/* Motion layer. Only active when <html> has .motion (set in <head> unless reduced motion).
   Rules (design-system.md §6): transform + opacity only, signature ease, >= 400ms, upward, no bounce. */

/* Line / word masks */
.motion .mask { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.motion .mask--word { display: inline-block; vertical-align: top; }
.motion .mask > span { display: inline-block; transform: translateY(105%); transition: transform 1100ms var(--ease); will-change: transform; }
.motion .is-in .mask > span,
.motion .mask.is-in > span { transform: none; }

/* Hero entrance */
.motion .hero__lead,
.motion .hero__artifact-inner { opacity: 0; transform: translateY(24px); transition: opacity 1200ms var(--ease), transform 1200ms var(--ease); }
.motion .hero.is-in .hero__lead { opacity: 1; transform: none; transition-delay: 600ms; }
.motion .hero.is-in .hero__artifact-inner { opacity: 1; transform: none; transition-delay: 200ms; }
.hero__artifact-inner { position: absolute; inset: 0; display: grid; place-items: center; }

/* Scroll-linked hero (values written by JS as CSS vars) */
.hero__artifact { will-change: transform; }
.motion .hero__artifact { translate: 0 var(--hero-shift, 0px); opacity: var(--hero-fade, 1); }
.motion .hero__copy { translate: 0 var(--hero-lift, 0px); }

/* Nav hides on scroll down, returns on scroll up */
.site-nav { transition: transform 600ms var(--ease); }
.site-nav.is-hidden { transform: translateY(-110%); }

/* Rows: hairlines draw left to right, text rises */
.motion .rows .row { border-top-color: transparent; position: relative; }
.motion .rows .row::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--ash);
  transform: scaleX(0); transform-origin: left; transition: transform 1000ms var(--ease);
}
.motion .rows .row > * { opacity: 0; transform: translateY(16px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); }
.motion .rows.is-in .row::before { transform: scaleX(1); }
.motion .rows.is-in .row > * { opacity: 1; transform: none; }
.motion .rows.is-in .row:nth-child(2)::before, .motion .rows.is-in .row:nth-child(2) > * { transition-delay: 80ms; }
.motion .rows.is-in .row:nth-child(3)::before, .motion .rows.is-in .row:nth-child(3) > * { transition-delay: 160ms; }
.motion .rows.is-in .row:nth-child(4)::before, .motion .rows.is-in .row:nth-child(4) > * { transition-delay: 240ms; }
.motion .rows.is-in .row:nth-child(5)::before, .motion .rows.is-in .row:nth-child(5) > * { transition-delay: 320ms; }
.motion .rows.is-in .row:nth-child(6)::before, .motion .rows.is-in .row:nth-child(6) > * { transition-delay: 400ms; }
.motion .rows.is-in .row:nth-child(7)::before, .motion .rows.is-in .row:nth-child(7) > * { transition-delay: 480ms; }

/* Sectors: same hairline draw */
.motion .sectors li { border-top-color: transparent; position: relative; }
.motion .sectors li::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; background: var(--ash);
  transform: scaleX(0); transform-origin: left; transition: transform 1000ms var(--ease);
}
.motion .sectors.is-in li::before { transform: scaleX(1); }
.motion .sectors.is-in li:nth-child(2)::before { transition-delay: 100ms; }
.motion .sectors.is-in li:nth-child(3)::before { transition-delay: 200ms; }
.motion .sectors.is-in li:nth-child(4)::before { transition-delay: 300ms; }
.motion .sectors.is-in li:nth-child(5)::before { transition-delay: 400ms; }

/* Section artifacts: slow drift with scroll (JS sets --drift) */
.motion .feature__media video, .motion .band video { translate: 0 var(--drift, 0px); }

/* Row hover: arrow slide (refined) */
.row .title { transition: color var(--dur) var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .site-nav.is-hidden { transform: none; }
}

/* Sections emerge from the cloud: blurred + low + transparent -> sharp */
.motion .reveal { opacity: 0; transform: translateY(48px) scale(.985); filter: blur(14px);
  transition: opacity 1400ms var(--ease-out), transform 1400ms var(--ease-out), filter 1400ms var(--ease-out); }
.motion .reveal.is-in { opacity: 1; transform: none; filter: none; }

/* Depth: items come from deep in the cloud (small, blurred) and settle sharp */
.motion .reveal.depth { transform: translateY(60px) scale(.86); filter: blur(18px); opacity: 0;
  transition: opacity 1600ms var(--ease-out), transform 1600ms var(--ease-out), filter 1600ms var(--ease-out); }
.motion .reveal.depth.is-in { transform: none; filter: none; opacity: 1; }
.motion .constellation .node:nth-child(2) { transition-delay: 120ms; }
.motion .constellation .node:nth-child(3) { transition-delay: 240ms; }
.motion .constellation .node:nth-child(4) { transition-delay: 360ms; }

/* 4. Security nodes build in one by one: dot ignites, line flows down, text slides in */
.motion .node { opacity: 1 !important; filter: none !important; transform: none !important; }
.motion .node .node__dot { transform: scale(0); transition: transform 700ms var(--ease-out); }
.motion .node::before { transform: scaleY(0); transform-origin: top; transition: transform 1200ms var(--ease-out) 300ms; }
.motion .node > :not(.node__dot) { opacity: 0; transform: translateX(-24px); filter: blur(8px); transition: opacity 900ms var(--ease-out) 250ms, transform 900ms var(--ease-out) 250ms, filter 900ms var(--ease-out) 250ms; }
.motion .node.is-in .node__dot { transform: scale(1); }
.motion .node.is-in::before { transform: scaleY(1); }
.motion .node.is-in > :not(.node__dot) { opacity: 1; transform: none; filter: none; }

/* Pass 6: text must be readable quickly. Shorter, lighter reveals (no heavy blur). */
.motion .reveal { transform: translateY(20px); filter: none;
  transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out); }
.motion .reveal.depth { transform: translateY(24px) scale(.97); filter: none;
  transition: opacity 750ms var(--ease-out), transform 850ms var(--ease-out); }
.motion .reveal.is-in, .motion .reveal.depth.is-in { opacity: 1; transform: none; filter: none; }
.site-nav.is-hidden { transform: none; }
.motion .node > :not(.node__dot) { filter: none; transform: translateX(-12px); transition: opacity 600ms var(--ease-out) 120ms, transform 650ms var(--ease-out) 120ms; }
.motion .node.is-in > :not(.node__dot) { transform: none; }

/* Pass 11 (speed): reveals start just before an element scrolls in and finish quicker,
   so text and visuals never look like they arrive late. */
.motion .reveal { transition: opacity 500ms var(--ease-out), transform 600ms var(--ease-out); }
.motion .reveal.depth { transition: opacity 550ms var(--ease-out), transform 650ms var(--ease-out); }
