/* === GLOBAL: ACCESSIBILITY & PERFORMANCE === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-mesh-bg, .card-shimmer, .benefit-card::before { display: none !important; }
  #custom-cursor { display: none !important; }
  .wa-pulse-ring { display: none !important; }
}

/* Performance: off-screen sections */
section:not(#domov) {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

/* === PHASE 2: HERO ENHANCEMENTS === */

/* Mesh Gradient Hero Background */
.hero-mesh-bg {
  position: absolute; inset: 0;
  background-color: oklch(22% 0.08 240);
  background-image:
    radial-gradient(ellipse 80% 50% at 20% 40%, oklch(45% 0.22 240 / 0.6) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, oklch(55% 0.18 180 / 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 90% 40% at 60% 90%, oklch(35% 0.15 260 / 0.5) 0%, transparent 55%);
  animation: mesh-shift 12s ease-in-out infinite alternate;
  z-index: 1;
  mix-blend-mode: overlay;
  opacity: 0.7;
}
@keyframes mesh-shift {
  0% { background-position: 0% 50%, 100% 0%, 50% 100%; }
  100% { background-position: 100% 50%, 0% 100%, 50% 0%; }
}

/* Hero Kinetic Words */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: var(--word-from, translateY(40px));
  animation: wordReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-fill-mode: forwards;
}
/* Fallback: if JS fails or animation doesn't fire, show text after 2s */
@supports not (animation-timeline: view()) {
  .hero-word { animation-delay: 0.3s; }
}
.no-js .hero-word, 
.hero-word.revealed { opacity: 1; transform: none; animation: none; }
@keyframes wordReveal {
  to { opacity: 1; transform: none; }
}

/* Variable Font Weight Animation */
.hero-weight-animate {
  font-variation-settings: "wght" var(--hw, 800);
  animation: heroWeight 4s ease-in-out infinite alternate;
}
@keyframes heroWeight {
  from { --hw: 400; }
  to { --hw: 800; }
}
@property --hw {
  syntax: "<number>";
  initial-value: 800;
  inherits: false;
}

/* Time-of-day status dot */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,0.6);
  animation: dotPulse 2s ease-in-out infinite;
}
.status-dot.offline {
  background: #f59e0b;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

/* Cinematic hero scroll - multi-layer */
.hero-layer { transition: transform 0.1s linear, opacity 0.1s linear, filter 0.1s linear; }
/* === PHASE 3: SCROLL ANIMATIONS & MICRO-INTERACTIONS === */

/* Scroll-driven reveal for service cards */
@supports (animation-timeline: view()) {
  .service-card {
    animation: cardScrollReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 40%;
  }
  @keyframes cardScrollReveal {
    from { opacity: 0; transform: translateY(50px) scale(0.95); filter: blur(3px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  }
  .service-card:nth-child(1) { animation-delay: 0ms; }
  .service-card:nth-child(2) { animation-delay: 80ms; }
  .service-card:nth-child(3) { animation-delay: 160ms; }
  .service-card:nth-child(4) { animation-delay: 240ms; }
  .service-card:nth-child(5) { animation-delay: 320ms; }
  
  .benefit-card {
    animation: benefitReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
  @keyframes benefitReveal {
    from { opacity: 0; transform: translateX(calc(var(--reveal-dir, 1) * 30px)); }
    to { opacity: 1; transform: translateX(0); }
  }
  .benefit-card:nth-child(odd) { --reveal-dir: -1; }
  .benefit-card:nth-child(even) { --reveal-dir: 1; }

  .gallery-item {
    animation: galleryReveal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
  @keyframes galleryReveal {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
  }
}

/* Scroll progress bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, oklch(55% 0.20 240), oklch(65% 0.18 68));
  transform-origin: left;
  scale: 0 1;
  z-index: 10000;
}
@supports (animation-timeline: scroll()) {
  #scroll-progress {
    animation: scaleProgress linear;
    animation-timeline: scroll(root);
  }
  @keyframes scaleProgress { to { scale: 1 1; } }
}

/* Magnetic cursor */
#custom-cursor {
  width: 12px; height: 12px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  position: fixed;
  top: -6px; left: -6px;
  pointer-events: none;
  z-index: 99999;
  transition: width 0.35s cubic-bezier(0.34,1.56,0.64,1),
              height 0.35s cubic-bezier(0.34,1.56,0.64,1),
              background 0.25s ease,
              border-radius 0.25s ease;
  mix-blend-mode: difference;
  opacity: 0;
}
#custom-cursor.visible { opacity: 1; }
#custom-cursor[data-state="cta"] {
  width: 56px; height: 56px;
  background: oklch(55% 0.20 240 / 0.7);
  border-radius: 50%;
}
#custom-cursor[data-state="gallery"] {
  width: 48px; height: 48px;
  border: 2px solid white;
  background: transparent;
  border-radius: 50%;
}
#custom-cursor[data-state="link"] {
  width: 32px; height: 32px;
  background: oklch(55% 0.20 240 / 0.5);
}

/* WhatsApp breathing pulse */
.whatsapp-btn { animation: none !important; } /* Remove old float animation */
.wa-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.6);
  animation: pulseExpand 0.9s ease-out forwards;
  pointer-events: none;
}
@keyframes pulseExpand {
  to { transform: scale(2.2); opacity: 0; }
}
@keyframes waBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Form micro-interactions */
.form-input-wrapper { position: relative; }
.form-input-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: oklch(55% 0.20 240);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateX(-50%);
}
.form-input-wrapper:focus-within::after {
  width: 100%;
}

/* Form shake error */
@keyframes formShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.form-error-shake { animation: formShake 0.4s ease-out; }

/* Touch device — hide cursor */
@media (hover: none) and (pointer: coarse) {
  #custom-cursor { display: none !important; }
}
/* === PHASE 4: 3D SPATIAL EFFECTS === */

/* Service Card Tilt Container */
.service-card {
  transform-style: preserve-3d;
  perspective: 800px;
  transition: transform 0.15s ease-out, box-shadow 0.4s ease;
}
.service-card .service-icon { transform: translateZ(40px); transition: transform 0.4s cubic-bezier(0.16,1,0.3,1); }
.service-card h3 { transform: translateZ(20px); }

/* Light shimmer following cursor */
.card-shimmer {
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.service-card:hover .card-shimmer { opacity: 1; }

/* Glassmorphism 2.0 */
.glass-card-2026 {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(14px) saturate(190%) brightness(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(190%) brightness(1.08);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 32px rgba(37,99,235,0.12), inset 0 1px 0 rgba(255,255,255,0.25), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.glass-card-2026::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.08) 40%, rgba(59,130,246,0.1) 60%, rgba(255,255,255,0) 100%);
  opacity: 0; transition: opacity 0.4s ease;
  pointer-events: none;
}
.glass-card-2026:hover::after { opacity: 1; }

/* Holographic shimmer for benefit cards */
.benefit-card { position: relative; overflow: hidden; }
.benefit-card::before {
  content: ""; position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, oklch(55% 0.20 240 / 0.15), oklch(60% 0.18 180 / 0.15), oklch(55% 0.15 280 / 0.15), oklch(55% 0.20 240 / 0.15));
  animation: holoSpin 8s linear infinite;
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.benefit-card:hover::before { opacity: 1; }
@keyframes holoSpin { to { transform: rotate(360deg); } }

/* Volumetric 3D Text */
.text-3d {
  text-shadow:
    1px 1px 0 oklch(40% 0.15 240 / 0.3),
    2px 2px 0 oklch(38% 0.14 240 / 0.25),
    3px 3px 0 oklch(36% 0.13 240 / 0.2),
    4px 4px 0 oklch(34% 0.12 240 / 0.15),
    5px 5px 0 oklch(32% 0.11 240 / 0.1),
    6px 6px 12px oklch(30% 0.10 240 / 0.15);
}

/* Accessibility: disable 3D for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .service-card { perspective: none; transform-style: flat; }
  .service-card .service-icon, .service-card h3 { transform: none; }
  .benefit-card::before { animation: none; display: none; }
  .card-shimmer { display: none; }
}
/* === PHASE 5: GALLERY ENHANCEMENTS === */

/* Editorial Grid replacing masonry */
.gallery-editorial {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 260px;
  gap: 12px;
}
/* Featured items — every 5th starting from 1st */
.gallery-editorial .gallery-item:nth-child(5n+1) {
  grid-column: span 2;
  grid-row: span 2;
}
/* Panorama items — every 5th starting from 4th */
.gallery-editorial .gallery-item:nth-child(5n+4) {
  grid-column: 1 / -1;
}

.gallery-editorial .gallery-item {
  overflow: hidden;
  border-radius: 16px;
}
.gallery-editorial .gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-editorial .gallery-item:hover img {
  transform: scale(1.06);
}

/* Gallery depth effect on hover */
.gallery-item.depth-near {
  transform: scale(1.02);
  z-index: 2;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.gallery-item.depth-far {
  transform: scale(0.98);
  opacity: 0.85;
}
.gallery-item { transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease; }

/* Responsive editorial grid */
@media (max-width: 1023px) {
  .gallery-editorial {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }
  .gallery-editorial .gallery-item:nth-child(5n+1) { grid-column: span 2; grid-row: span 1; }
  .gallery-editorial .gallery-item:nth-child(5n+4) { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .gallery-editorial {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }
  .gallery-editorial .gallery-item:nth-child(5n+1),
  .gallery-editorial .gallery-item:nth-child(5n+4) {
    grid-column: 1;
    grid-row: span 1;
  }
}

/* FLIP animation for filter transitions */
.gallery-item.flip-entering {
  animation: flipEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes flipEnter {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.gallery-item.flip-exiting {
  animation: flipExit 0.3s ease-in both;
}
@keyframes flipExit {
  to { opacity: 0; transform: scale(0.8); }
}

/* Improved Lightbox transitions */
.lightbox-modal img {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.lightbox-modal.open {
  animation: lbFadeIn 0.3s ease-out;
}
@keyframes lbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* === PHASE 6: AI ADAPTIVE UI === */

/* Progressive Urgency Bar */
#urgency-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9998;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
#urgency-bar.visible { transform: translateY(0); }
#urgency-bar .urgency-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1c1917;
}
#urgency-bar .urgency-actions {
  display: flex; gap: 8px;
}
#urgency-bar .urgency-btn {
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#urgency-bar .urgency-btn-primary {
  background: oklch(52% 0.20 240);
  color: white;
}
#urgency-bar .urgency-btn-primary:hover { background: oklch(44% 0.20 240); }
#urgency-bar .urgency-btn-secondary {
  background: rgba(0,0,0,0.06);
  color: #44403c;
}
#urgency-bar .urgency-btn-secondary:hover { background: rgba(0,0,0,0.1); }
#urgency-bar .urgency-close {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.05);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #78716c;
}
#urgency-bar .urgency-close:hover { background: rgba(0,0,0,0.1); }

/* Container queries for service cards */
.service-card-wrapper { container-type: inline-size; container-name: svc; }
@container svc (max-width: 280px) {
  .service-card p, .service-card ul { display: none; }
  .service-card { padding: 1.25rem; }
}

/* Intent highlight */
.intent-highlight {
  ring: 2px solid oklch(55% 0.20 240);
  box-shadow: 0 0 0 3px oklch(55% 0.20 240 / 0.15);
  transition: box-shadow 0.3s ease;
}

@media (max-width: 640px) {
  #urgency-bar { flex-direction: column; gap: 10px; padding: 16px; }
}
/* === PHASE 7: NAVIGATION & GLOBAL ELEMENTS === */

/* Vertical Scroll Indicator — left side */
.scroll-nav {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.scroll-nav.visible { opacity: 1; }
.scroll-nav-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(120,113,108,0.3);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.scroll-nav-dot:hover {
  background: rgba(120,113,108,0.6);
  transform: scale(1.3);
}
.scroll-nav-dot.active {
  background: oklch(52% 0.20 240);
  transform: scale(1.6);
  box-shadow: 0 0 12px oklch(52% 0.20 240 / 0.5);
}
.scroll-nav-dot::before {
  content: attr(data-label);
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  color: #78716c;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.scroll-nav-dot:hover::before { opacity: 1; }

/* Hide scroll nav on mobile */
@media (max-width: 1023px) {
  .scroll-nav { display: none; }
}

/* Ambient water canvas for contact section */
#contact-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.35;
  pointer-events: none;
}
#kontakt { position: relative; }
#kontakt > .max-w-7xl { position: relative; z-index: 1; }

/* Liquid focus for form inputs */
.form-input {
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.form-input:focus {
  border-color: oklch(52% 0.20 240) !important;
  box-shadow: 0 4px 16px oklch(52% 0.20 240 / 0.12), 0 0 0 3px oklch(52% 0.20 240 / 0.08) !important;
  transform: translateY(-1px);
}



/* === HERO HEADING V2 — Final Premium Design === */

.hero-heading-v2 {
  font-family: "Plus Jakarta Sans Variable", "Plus Jakarta Sans", system-ui, sans-serif;
  position: relative;
  z-index: 2;
}

/* — "PROFESIONÁLNE" — uppercase eyebrow label — */
.hero-v2-eyebrow {
  display: block;
  font-size: clamp(0.65rem, 1vw, 0.85rem);
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.65rem;
  opacity: 1;
}

/* — "vodoinštalačné" — the MAIN hero word — */
.hero-v2-main {
  display: block;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 2px 30px rgba(59,130,246,0.3);
  opacity: 0;
  animation: hv2Reveal 0.8s cubic-bezier(0.16,1,0.3,1) 0.3s forwards;
}

/* — Accent line — gold/brass gradient — */
.hero-v2-accent-line {
  display: block;
  height: 3px;
  width: clamp(180px, 45%, 400px);
  margin: 10px 0 8px;
  background: linear-gradient(90deg, rgba(200,169,110,0.9) 0%, rgba(245,223,160,0.7) 40%, rgba(200,169,110,0) 100%);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  animation: hv2DrawLine 0.5s cubic-bezier(0.16,1,0.3,1) 0.9s forwards;
}

/* — "SLUŽBY" — smaller, elegant — */
.hero-v2-sub {
  display: block;
  font-size: clamp(1.1rem, 2.5vw, 2rem);
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  opacity: 0;
  animation: hv2SlideUp 0.6s cubic-bezier(0.16,1,0.3,1) 0.55s forwards;
}

/* Hover: subtle glow */
.hero-heading-v2:hover .hero-v2-main {
  text-shadow: 0 2px 40px rgba(59,130,246,0.5), 0 0 80px rgba(59,130,246,0.15);
  transition: text-shadow 0.5s ease;
}
.hero-heading-v2:hover .hero-v2-accent-line {
  background: linear-gradient(90deg, rgba(200,169,110,1) 0%, rgba(245,223,160,0.9) 50%, rgba(200,169,110,0) 100%);
  transition: background 0.5s ease;
}

/* Keyframes */
@keyframes hv2SlideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes hv2Reveal {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to   { opacity: 1; clip-path: inset(0 0% 0 0); }
}
@keyframes hv2SlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes hv2DrawLine {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-v2-eyebrow, .hero-v2-main, .hero-v2-sub {
    opacity: 1; animation: none; transform: none; clip-path: none;
  }
  .hero-v2-accent-line { transform: scaleX(1); opacity: 1; animation: none; }
}

/* === MOBILE FIXES === */

/* Gallery: show overlay text always on mobile (no hover on touch) */
@media (hover: none), (max-width: 768px) {
  .gallery-item .gallery-overlay {
    opacity: 1 !important;
  }
}

/* Disable heavy animations on mobile */
@media (max-width: 768px) {
  .hero-mesh-bg { display: none; }
  .service-card { perspective: none !important; transform-style: flat !important; }
  .service-card:hover { transform: none !important; }
  .benefit-card::before { display: none !important; }
  .card-shimmer { display: none !important; }
}
