/* Flow: scroll choreography. Everything here is driven by progress values written once per frame by flow.js. */

/* hero: as the pulse fires, the headline separates in depth; the two lines leave at different speeds */
.fl .sx__hin { transform: translate3d(0, calc(var(--hx, 0) * -6vh), 0); }
.fl .sx__h1 .sx__l1 { display: inline-block; transform: translate3d(0, calc(var(--hx, 0) * -4vh), 0); }
.fl .sx__h1 em { translate: calc(var(--hx, 0) * 2vw) calc(var(--hx, 0) * -11vh); }
.fl .sx__lede, .fl .sx__hero .sx__row { translate: 0 calc(var(--hx, 0) * -2vh); }

/* headings: every word sits in a mask and rises on its line's beat; the italic phrase follows a half beat later */
.fl .flw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .12em; margin-bottom: -.12em; }
.fl .fli { display: inline-block; will-change: transform;
  --lp: clamp(0, calc(var(--hp, 0) * (var(--ln, 1) * .55 + 1) - var(--li, 0) * .55), 1);
  transform: translate3d(0, calc((1 - var(--lp)) * 108%), 0) rotate(calc((1 - var(--lp)) * 3deg));
  transform-origin: 0 100%; }
.fl em .fli { --lp: clamp(0, calc(var(--hp, 0) * (var(--ln, 1) * .55 + 1.25) - var(--li, 0) * .55 - .25), 1); }

/* depth: panels arrive tilted back in space and settle flat as they reach reading position */
.fl .fld { transform: perspective(1400px) translate3d(0, calc((1 - var(--dp, 1)) * 70px), calc((1 - var(--dp, 1)) * -120px)) rotateX(calc((1 - var(--dp, 1)) * 9deg));
  transform-origin: 50% 0; opacity: calc(.15 + var(--dp, 1) * .85); }
.fl .sv__list > li.fld:nth-child(2) { transform: perspective(1400px) translate3d(0, calc((1 - var(--dp, 1)) * 95px), calc((1 - var(--dp, 1)) * -150px)) rotateX(calc((1 - var(--dp, 1)) * 9deg)); }
.fl .sv__list > li.fld:nth-child(3) { transform: perspective(1400px) translate3d(0, calc((1 - var(--dp, 1)) * 120px), calc((1 - var(--dp, 1)) * -180px)) rotateX(calc((1 - var(--dp, 1)) * 9deg)); }
/* the old one-shot fade would fight the scrubbed motion */
.fl .fld.rv { transition: none; }

@media (max-width: 760px) {
  .fl .sx__h1 em { translate: 0 calc(var(--hx, 0) * -7vh); }
  .fl .fld { transform: translate3d(0, calc((1 - var(--dp, 1)) * 44px), 0) scale(calc(.96 + var(--dp, 1) * .04)); }
  .fl .sv__list > li.fld:nth-child(n) { transform: translate3d(0, calc((1 - var(--dp, 1)) * 44px), 0) scale(calc(.96 + var(--dp, 1) * .04)); }
}
@media (prefers-reduced-motion: reduce) { .fl .fli, .fl .fld, .fl .sx__hin, .fl .sx__h1 * { transform: none !important; translate: none !important; opacity: 1 !important; } }

/* worlds: captions arrive line by line after the glass has passed, and leave line by line before the next move */
.wz--gl .wz__cap { opacity: 1; transform: none; }
.wz--gl .wz__cap > * { --c: clamp(0, calc(var(--ca, 0) * 1.6 - var(--n, 0) * .2), 1); opacity: var(--c); transform: translate3d(0, calc((1 - var(--c)) * 22px), 0); }
.wz--gl .wz__cap > :nth-child(2) { --n: 1; } .wz--gl .wz__cap > :nth-child(3) { --n: 2; } .wz--gl .wz__cap > :nth-child(4) { --n: 3; }
.wz--gl .wz__fx { display: none; }

/* gradient italic phrases: the gradient moves onto each word, aligned to the phrase so it still reads as one sweep */
.fl .fl-split em { background: none; -webkit-background-clip: border-box; background-clip: border-box; }
.fl .fl-split em .fli { background: linear-gradient(90deg, var(--p), var(--i)) no-repeat; background-size: var(--gw, 100%) 100%; background-position: var(--gx, 0) 0; -webkit-background-clip: text; background-clip: text; color: transparent; }

/* V41: worlds journey spread over a little more distance so every transition moves at the same, unhurried speed */
.wz { height: 440vh; }
@media (max-width: 760px) { .wz { height: 380vh; } }
