/* Stable scrollbar gutter to prevent any horizontal layout shifts */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}


/* Performance pass: preserve the premium look while reducing expensive effects. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
@media (max-width: 768px) {
  /* Mobile GPUs benefit from less blur and no animated smooth-scroll behavior. */
  html, *, *::before, *::after { scroll-behavior: auto !important; }
  .glass, .glass-card, .glassmorphism, .glass-effect,
  [class*="glass"], [class*="blur"],
  #main-header .nav-wrapper, .nav-wrapper, .header-morph-bg,
  .drawer-content, .drawer-backdrop {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .project-cursor, #project-cursor-follower, .cursor-follower,
  #interactive-grid { display: none !important; }
}
@media (min-width: 769px) {
  /* Keep the glass effect subtle instead of applying 60–70px header blur. */
  .glass, .glass-card, .glassmorphism, .glass-effect,
  [class*="glass"], [class*="blur"],
  #main-header .nav-wrapper, .nav-wrapper, .header-morph-bg {
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
  }
  html { scroll-behavior: smooth; }
}
img { height: auto; }

/* Animation audit: retain the premium feel while reducing unnecessary GPU work. */
/* Slow down decorative loops on desktop; reveal and interaction timings stay responsive. */
@media (min-width: 769px) {
  .morph-blob { animation-duration: 60s !important; filter: blur(28px); }
  #global-atmosphere .atmos-orb { animation-duration: 75s !important; }
  .metrics-bg-canvas .atmos-shape { animation-duration: 24s !important; }
  .horizon-canvas .horizon-orb { animation-duration: 30s !important; }
  #dynamic-text { animation-duration: 10s; }
  .testimonials-track,
  .marquee-content,
  .icon-track,
  .ribbon-track,
  .ribbon-track-ltr,
  .ribbon-track-rtl { animation-duration: 45s; }
}

/* Decorative blur/morph loops are the costliest effects on small GPUs.
   Keep layout, reveal animations, button feedback, and content intact. */
@media (max-width: 768px) {
  .morph-blob {
    animation: none !important;
    filter: blur(20px) !important;
    mix-blend-mode: normal !important;
  }
  #global-atmosphere .atmos-orb,
  .metrics-bg-canvas .atmos-shape,
  .horizon-canvas .horizon-orb {
    animation: none !important;
    will-change: auto !important;
  }
  .horizon-title { animation: none !important; }
  .btn-whatsapp.pulse-active i { animation-duration: 1.2s !important; }
}

/* Never keep decorative elements composited when their animation is idle. */
@media (prefers-reduced-motion: no-preference) {
  .morph-blob,
  #global-atmosphere .atmos-orb,
  .metrics-bg-canvas .atmos-shape,
  .horizon-canvas .horizon-orb { will-change: auto; }
}



/* Final overrides: cap the heaviest header blur on all breakpoints. */
@media (min-width: 769px) {
  #main-header .nav-wrapper, #main-header.header-scrolled .nav-wrapper,
  .nav-wrapper, .header-morph-bg {
    -webkit-backdrop-filter: blur(10px) saturate(140%) brightness(0.95) !important;
    backdrop-filter: blur(10px) saturate(140%) brightness(0.95) !important;
  }
}
@media (max-width: 768px) {
  #main-header .nav-wrapper, #main-header.header-scrolled .nav-wrapper,
  .nav-wrapper, .header-morph-bg {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  html { scroll-behavior: auto !important; }
}

/* Mobile/tablet: make the centered card feel hovered as it enters the reading area. */
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
  .service-card.hovered {
    border-color: rgba(255, 107, 0, 0.82);
    transform: translateY(-8px) scale(1.015);
    box-shadow: 0 24px 60px rgba(0,0,0,.48), 0 0 28px rgba(255,107,0,.22), inset 0 0 24px rgba(255,92,0,.045);
  }
  .project-card.hovered {
    border-color: rgba(255,107,0,.82);
    box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 25px rgba(255,107,0,.2);
  }
  .solution-detail-card.hovered {
    transform: translateY(-6px);
    border-color: rgba(255,107,0,.82);
    box-shadow: 0 26px 65px rgba(0,0,0,.58), 0 0 30px rgba(255,107,0,.22);
  }
  .solution-detail-card.hovered .sol-icon-box { transform: scale(1.08) rotate(-4deg); }
  .service-card, .project-card, .solution-detail-card { transition-duration: .32s; }
}
@media (prefers-reduced-motion: reduce) {
  .service-card.hovered, .project-card.hovered, .solution-detail-card.hovered { transform: none; }
}


/* Robust scroll-activated hover styling for touch devices. The extra class makes
   activation easy to inspect in DevTools; .hovered keeps existing site effects. */
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
  .service-card.scroll-hover-active,
  .service-card.hovered {
    border-color: #ff6b00 !important;
    box-shadow: 0 24px 60px rgba(0,0,0,.48), 0 0 28px rgba(255,107,0,.28), inset 0 0 24px rgba(255,92,0,.05) !important;
    transform: translateY(-6px) scale(1.01) !important;
  }
  .project-card.scroll-hover-active,
  .project-card.hovered {
    border-color: #ff6b00 !important;
    box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 25px rgba(255,107,0,.25) !important;
    transform: translateY(-5px) !important;
  }
  .solution-detail-card.scroll-hover-active,
  .solution-detail-card.hovered {
    border-color: #ff6b00 !important;
    box-shadow: 0 26px 65px rgba(0,0,0,.58), 0 0 30px rgba(255,107,0,.25) !important;
    transform: translateY(-5px) !important;
  }
}
