/* Shared scroll atmosphere for the Labs pages.
   Content remains sharp and stationary; motion belongs to the background. */

html.site-water-motion main > section {
  position: relative !important;
  top: auto !important;
  isolation: isolate;
  overflow: clip;
}

html.site-water-motion main > section:not(#hero)::before {
  content: "";
  position: absolute;
  inset: -18% -8%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 74% 30% at 50% 50%,
      color-mix(in oklch, var(--muted) 22%, transparent),
      transparent 72%
    );
  opacity: var(--site-water-opacity, 0);
  transform:
    translate3d(0, var(--site-water-y, 0), 0)
    scale(var(--site-water-scale, 1));
  transform-origin: 50% 50%;
}

html.site-water-motion main > section:not(#hero) > * {
  position: relative;
  z-index: 1;
}

html.site-water-motion main > section labs-reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  filter: none !important;
}

html.site-water-motion #hero .hero__shader {
  transform: scale(var(--site-hero-visual-scale, 1));
  transform-origin: 50% 42%;
}

html.site-water-motion #hero.is-water-active .hero__shader,
html.site-water-motion main > section.is-water-active::before {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  html.site-water-motion main > section:not(#hero)::before {
    display: none !important;
  }

  html.site-water-motion #hero .hero__shader {
    transform: none !important;
    will-change: auto !important;
  }
}
