/* VPERP scroll motion A–F (design review 2026-11-20: part of the main page).
   Motion values come from motion.js as CSS variables; their fallbacks are the finished state, so without JS
   or with reduced motion the page shows its static layout. */

/* A. Hero leaves: copy drifts down slower than the page and fades, the field lags and grows, a purple veil comes up. */
:root .hero-copy { transform: translate3d(0, calc(var(--hx, 0) * 24vh), 0); opacity: calc(1 - var(--hx, 0) * 2.2); }
:root .hero-ascii { transform: translate3d(0, calc(var(--hx, 0) * 16vh), 0) scale(calc(1 + var(--hx, 0) * .08)); transform-origin: 50% 100%; }
:root .hero-index { opacity: calc(1 - var(--hx, 0) * 4); }
:root .hero::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--dark); opacity: calc(var(--hx, 0) * .55); }
/* …and the two advantage cards rise in with the scroll. */
:root.motion-ready .edge-card.reveal {
  transition: none; opacity: calc(.15 + var(--rise, 1) * .85);
  transform: translate3d(0, calc((1 - var(--rise, 1)) * 110px), 0);
}

/* B. Big headlines enter line by line from a mask (once). The mask box is padded so descenders (g, p) are not cut. */
:root h2 .ln { display: block; overflow: clip; padding-block: .08em .16em; margin-block: -.08em -.16em; }
:root h2 .ln > span { display: block; }
:root h2:has(.ln) br { display: none; }
:root.motion-on h2 .ln > span { transition: transform 1.15s cubic-bezier(.19, 1, .22, 1); }
:root.motion-on h2:not(.lines-in) .ln > span { transform: translate3d(0, 120%, 0); }
:root.motion-on h2 .ln:nth-of-type(2) > span { transition-delay: .11s; }

/* C. Dark sections open from an inset rounded card to full width. */
:root :is(.protocol, .contact) { clip-path: inset(0 var(--inset, 0px) round var(--radius, 0px)); }

/* D. Protocol layers start stacked and separate with the scroll; the autoplay highlight keeps working. */
:root .iso-layer { transform: translate(-50%, -50%) translateY(calc(var(--y) * var(--spread, 1))) rotateX(56deg) rotateZ(-42deg); }
/* The ray signal only shows once the layers have nearly finished separating. */
:root.motion-on .architecture.is-live .iso-signal { opacity: clamp(0, (var(--spread, 1) - .85) * 7, 1); }
:root :is([data-layer="0"] .layer-0, [data-layer="1"] .layer-1, [data-layer="2"] .layer-2) {
  transform: translate(-50%, -50%) translateY(calc(var(--y) * var(--spread, 1) - 9px)) rotateX(56deg) rotateZ(-42deg) scale(1.045);
}

/* E. Product stage lifts to full size; the terminal rises a little faster than the stage (≤ 24px). */
:root.motion-ready .product-stage.reveal {
  transition: none; opacity: 1; transform: scale(calc(.94 + var(--lift, 1) * .06)); transform-origin: 50% 0;
}
:root .terminal { transform: translate3d(0, calc((1 - var(--lift, 1)) * 24px), 0); }

/* F. Partner symbol moves slower than its frame. */
:root .partner-mark { transform: translate3d(0, calc(var(--par, 0) * -40px), 0); }

:root.motion-on :is(.hero-copy, .hero-ascii, .edge-card, .product-stage, .terminal, .partner-mark) { will-change: transform; }
