/* ==========================================================================
   BIO POD — motion
   All motion is additive: without JavaScript, or with reduced motion enabled,
   every element is fully visible and every interaction still works.
   ========================================================================== */

@keyframes cue-slide {
  0% {
    transform: translateX(-100%);
  }
  55%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(155, 196, 122, 0.4);
  }
  50% {
    opacity: 0.6;
    box-shadow: 0 0 0 5px rgba(155, 196, 122, 0);
  }
}

@keyframes flow-dash {
  to {
    stroke-dashoffset: -130;
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(7px, -5px);
  }
}

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes enter-line {
  from {
    opacity: 0;
    transform: translateY(104%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes enter-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes enter-scale {
  from {
    opacity: 0;
    transform: scale(0.965);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Page load ---------------------------------------------------------------
   No body-level fade: a transparent first paint delays FCP/LCP on every page.
   The hero runs its own staggered entrance instead. */

/* Staggered hero entrance, driven by CSS so it never blocks reading. */
[data-enter] {
  animation: enter-up 900ms var(--ease-out) both;
  animation-delay: var(--enter-delay, 0ms);
}

[data-enter="line"] {
  animation-name: enter-line;
  animation-duration: 1000ms;
}

[data-enter="fade"] {
  animation-name: enter-fade;
}

[data-enter="scale"] {
  animation-name: enter-scale;
  animation-duration: 1200ms;
}

.enter-line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}

/* Scroll reveals ---------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

[data-reveal="fade"] {
  transform: none;
}

[data-reveal="scale"] {
  transform: scale(0.97);
}

[data-reveal="mask"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1100ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  will-change: auto;
}

/* Children revealed in sequence without animating the parent. */
[data-reveal-group] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}

[data-reveal-group].is-visible > * {
  opacity: 1;
  transform: none;
}

[data-reveal-group].is-visible > *:nth-child(1) {
  transition-delay: 60ms;
}

[data-reveal-group].is-visible > *:nth-child(2) {
  transition-delay: 130ms;
}

[data-reveal-group].is-visible > *:nth-child(3) {
  transition-delay: 200ms;
}

[data-reveal-group].is-visible > *:nth-child(4) {
  transition-delay: 270ms;
}

[data-reveal-group].is-visible > *:nth-child(5) {
  transition-delay: 340ms;
}

[data-reveal-group].is-visible > *:nth-child(6) {
  transition-delay: 410ms;
}

[data-reveal-group].is-visible > *:nth-child(n + 7) {
  transition-delay: 470ms;
}

/* Gentle parallax for decorative art only. */
[data-parallax] {
  transform: translate3d(0, var(--parallax-y, 0), 0);
  transition: transform 120ms linear;
}

/* Reading progress bar. */
.progress {
  transition: transform 90ms linear;
}

/* Reduced motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body,
  [data-enter],
  [data-reveal],
  [data-reveal-group] > * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }

  .scroll-cue__rail::after,
  .schematic .flow,
  .schematic .motile,
  .map-shell__state::before {
    animation: none !important;
  }

  .stagebar__seg {
    transform: none !important;
  }

  .scale-rail__line::after {
    transform: none !important;
  }

  [data-parallax] {
    transform: none !important;
  }

  .progress {
    display: none;
  }

  .leaflet-container .leaflet-interactive {
    transition: none;
  }
}
