/*
  Homepage hero story (scripts/hero-story.mjs, behaviour in hero-story.js). Homepage only.
  Tokens: styles.css (colour, type, space) and motion.css (easing, durations, stagger).

  Three layers:
  1. Static (no JS, reduced motion, layout check, print): the final state. A band with the source
     video and its content timeline (frames, transcript, three ranges with what is said in them,
     time axis), then the three numbered 9:16 clips; all four step captions.
  2. Pinned (desktop, see PIN below): the same composition inside a sticky stage. The clips take
     all the height the stage leaves (size container), so they are the hero of the final frame.
     The stage layout comes from a media query that includes `scripting: enabled`, so it is in
     place on the first frame (no layout shift when JS starts). The 250vh scroll travel only
     exists once motion.js has set [data-pinned], so a page whose scripts fail never gets a
     frozen pin.
  3. States: [data-step="0..3"] (written by motion.js while pinned, by hero-story.js for the
     one-shot sequence elsewhere) hide and transform things. --hs-v, --hs-c, --hs-tx/--hs-ty and
     --hs-from are FLIP transforms that hero-story.js measures; [data-hs-ready] turns transitions
     on after the first state is applied. Only transform, translate and opacity animate (plus the
     caption colour and the video's corner radius); the scroll-scrubbed part is the 1px progress
     line under the captions.
  4. The pinned morph (large video <-> band) moves everything at once, so the stage is never
     emptied: the video shrinks into the corner, the timeline rides directly under its bottom edge
     and turns into the band once the video's corner has passed, and the pictures drop out of their
     ranges and grow into the clips right behind the video's edge. Video, timeline and pictures
     never cross; the quotes, row labels and time axis step aside while it runs ([data-hs-morph]). Going back
     is the exact time reverse (mirrored curves and delays), so the same holds in both directions.
*/
.hero-story { padding-bottom: var(--section-y); }
.hs-stage { display: grid; gap: var(--space-6); }

/* Step captions: four short statements with a hairline each (doubles as progress while pinned). */
.hs-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); margin: 0; padding: 0; list-style: none; }
.hs-step { position: relative; padding-top: var(--space-4); font-size: var(--fs-lead); line-height: 1.35; font-weight: 500; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.hs-step::before, .hs-step::after { content: ''; position: absolute; inset: 0 0 auto; height: 1px; background: var(--line-strong); }
.hs-step::after { background: var(--ink); transform-origin: left center; transform: scaleX(var(--fill, 1)); }

/* Composition: the source band (video + timeline), then the clips. Positioned so offsets are
   measured against it. */
.hs-comp { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
.hs-group { position: relative; display: grid; gap: var(--space-4); align-items: center; }
.hs-source { position: relative; min-width: 0; }
.hs-video { position: relative; aspect-ratio: var(--ar-video); overflow: hidden; clip-path: inset(0 round var(--radius-md)); background: var(--surface); transform-origin: 0 0; }
.hs-video img { width: 100%; height: 100%; object-fit: cover; }
.hs-chip, .hs-num { position: absolute; right: var(--space-2); bottom: var(--space-2); padding: 3px 6px; border-radius: 4px; background: #000000a8; color: var(--ink); font-size: var(--fs-badge); line-height: 1.2; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Content timeline: what the selection reads. Quotes over the three ranges, two tracks (sampled
   frames, transcript as text lines), time axis. Labels in the first column (hidden on phones). */
.hs-tl { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-3); transform-origin: 0 0; }
.hs-quotes { grid-column: 2; grid-row: 1; display: grid; padding-bottom: 11px; }
.hs-quote { position: relative; grid-area: 1 / 1; align-self: end; justify-self: start; width: max-content; max-width: 27%; margin-left: var(--x); translate: -50% 0; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: var(--fs-meta); line-height: 1.3; font-weight: 500; text-align: center; text-wrap: balance; }
.hs-quote::after { content: ''; position: absolute; top: 100%; left: 50%; width: 1px; height: 11px; background: var(--line-strong); }
.hs-labs, .hs-tracks { grid-row: 2; display: grid; grid-template-rows: 16px 18px; row-gap: 6px; }
.hs-labs { grid-column: 1; font-size: var(--fs-badge); color: var(--muted); }
.hs-lab:first-child { line-height: 16px; }
.hs-lab:last-child { line-height: 18px; }
.hs-tracks { grid-column: 2; position: relative; }
.hs-track { position: relative; }
.hs-fm { position: absolute; left: var(--x); top: 5px; width: 10px; height: 6px; margin-left: -5px; border-radius: 1.5px; background: var(--line-strong); }
.hs-tx { position: absolute; left: var(--l); width: var(--w); top: calc(4px + var(--r) * 8px); height: 3px; border-radius: 2px; background: #ffffff2e; }
.hs-tx[data-hot] { background: var(--ink); }
/* The frame inside a range is a tiny 16:9 picture of what it shows (car, facecam, lake). */
.hs-fm[data-hot] { top: 0; width: 28px; height: 16px; margin-left: -14px; border-radius: 2px; background: var(--surface) url('/assets/editor-demo-source.jpg') var(--bx) var(--by) / var(--bs) auto no-repeat; box-shadow: 0 0 0 1px var(--ink); }
.hs-seg { position: absolute; top: -5px; bottom: -5px; left: calc(var(--l) - 3px); width: calc(var(--w) + 6px); border-radius: 5px; background: #ffffff14; box-shadow: inset 0 0 0 1px var(--ink); }
.hs-sweep { position: absolute; top: -7px; bottom: -7px; left: 0; width: 12%; border-radius: 6px; background: linear-gradient(90deg, #ffffff00, #ffffff3d 50%, #ffffff00); opacity: 0; pointer-events: none; }
.hs-tracks { overflow-x: clip; overflow-clip-margin: 4px; }
/* Time axis: 0:00 and the video's length at the ends, each moment's number under its range. */
.hs-axis { grid-column: 2; grid-row: 3; position: relative; display: flex; justify-content: space-between; margin-top: 10px; font-size: var(--fs-badge); line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hs-tick { position: absolute; top: 0; left: var(--x); transform: translateX(-50%); color: var(--ink); font-weight: 500; }
/* Phones hide the row labels; a one-line legend under the axis names the two tracks instead. */
.hs-legend { display: none; grid-column: 1; grid-row: 4; justify-content: center; gap: var(--space-4); margin: var(--space-2) 0 0; font-size: var(--fs-badge); line-height: 16px; color: var(--muted); }
.hs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hs-legend span::before { content: ''; width: 10px; height: 6px; border-radius: 1.5px; background: var(--line-strong); }
.hs-legend [data-track="text"]::before { width: 14px; height: 3px; border-radius: 2px; background: #ffffff2e; box-shadow: 0 -5px 0 #ffffff2e; margin-top: 5px; }

/* Clips. Captions sit in the lower third of one picture (over the facecam in the split clip),
   never on the split seam; their size follows the clip (size container). */
.hs-clips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.hs-clip { position: relative; }
.hs-frame { position: relative; display: block; aspect-ratio: var(--ar-portrait); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transform-origin: 0 0; container-type: inline-size; }
.hs-crop { position: absolute; inset: 0; overflow: hidden; }
.hs-crop[data-part="top"] { bottom: 50%; }
.hs-crop[data-part="bottom"] { top: 50%; border-top: 1px solid #00000080; }
.hs-crop img { position: absolute; left: var(--x); top: var(--y); top: calc(var(--yw) * 100cqi); width: var(--w); max-width: none; height: auto; }
.hs-burn { position: absolute; inset-inline: 7%; bottom: 14%; text-align: center; color: #fff; font-size: 15px; font-size: clamp(12px, 7.4cqi, 21px); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; text-shadow: 0 1px 2px #000000d9, 0 0 10px #00000099; }
.hs-clip .hs-chip { top: var(--space-2); bottom: auto; }
.hs-num { top: var(--space-2); right: auto; bottom: auto; left: var(--space-2); }
/* Where the clips will land (tablets and phones, while the sequence runs): calm numbered 9:16
   slots, a faint fill with the outline of a clip's caption lines in its lower third, so the
   reserved space reads as "three clips go here" (never as empty space or a failed load). The
   landed clip covers its slot exactly. */
.hs-clip::before { content: attr(data-n); position: absolute; inset: 0; padding: var(--space-2) 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: linear-gradient(var(--line-strong) 0 0) 50% 80% / 58% 3px no-repeat, linear-gradient(var(--line-strong) 0 0) 50% calc(80% + 9px) / 38% 3px no-repeat, var(--surface-hover); font-size: var(--fs-badge); line-height: 1.4; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none; }

.hs-note { margin: 0; font-size: var(--fs-meta); line-height: 1.4; color: var(--muted); }

/* Desktop: the source is a compact band (video left, timeline right), the clips below it are the
   largest thing in the composition. */
@media (min-width: 961px) {
  .hs-group { grid-template-columns: minmax(0, 26fr) minmax(0, 74fr); column-gap: var(--space-6); }
  /* Static and short desktops: at most 236px wide, and low enough that band and clips fit in one
     window below the header. */
  .hs-clips { grid-template-columns: repeat(3, minmax(0, clamp(150px, calc((100vh - 330px) * 9 / 16), 236px))); justify-content: center; gap: var(--space-5); }
  .hs-note { text-align: center; }
}

/* Tablets and phones: stacked, centred; the in-view sequence (hero-story.js) replaces the pin. */
@media (max-width: 960px) {
  .hs-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-4); }
  .hs-comp { width: 100%; max-width: 640px; margin-inline: auto; }
  .hs-note { text-align: center; }
}
@media (max-width: 640px) {
  .hs-stage { gap: var(--space-5); }
  .hs-steps { column-gap: var(--space-4); }
  .hs-step { padding-top: var(--space-3); font-size: var(--fs-body); }
  .hs-comp { gap: var(--space-5); }
  .hs-group { gap: var(--space-3); }
  .hs-tl { grid-template-columns: minmax(0, 1fr); }
  .hs-labs { display: none; }
  .hs-legend { display: flex; }
  .hs-quotes, .hs-tracks, .hs-axis { grid-column: 1; }
  .hs-quote { padding: 3px 5px; font-size: var(--fs-badge); line-height: 1.25; }
  .hs-fm { width: 8px; height: 5px; margin-left: -4px; }
  .hs-fm[data-hot] { top: 2px; width: 22px; height: 12px; margin-left: -11px; }
  .hs-clips { gap: var(--space-2); }
  .hs-frame, .hs-clip::before { border-radius: 8px; }
  .hs-clip::before { padding: 5px 7px; }
  .hs-burn { inset-inline: 5%; bottom: 12%; }
  .hs-chip, .hs-num { right: 5px; bottom: 5px; padding: 2px 4px; }
  .hs-clip .hs-chip, .hs-num { top: 5px; }
  .hs-num { right: auto; bottom: auto; left: 5px; }
}
/* Narrow phones: the third range sits close to the end of the axis; the video's own chip already
   shows the length, so the axis keeps only the moment numbers. */
@media (max-width: 420px) {
  .hs-time { visibility: hidden; }
}

/* PIN. Keep this query identical to data-pin-media in scripts/hero-story.mjs.
   Captions at the top, the composition fills the rest down to the note: the band takes its own
   height, the clips row everything else, sized by its height (or width, whichever is smaller)
   and centred. The large one-long-video state (steps 0–1) uses the whole composition. */
@media screen and (scripting: enabled) and (prefers-reduced-motion: no-preference) and (min-width: 961px) and (min-height: 680px) {
  /* scroll-padding-top is header + 18px; -18px lands a #so-gehts jump exactly at progress 0. */
  .hero-story { padding-bottom: 0; scroll-margin-top: -18px; }
  .hero-story[data-pinned] { height: 250vh; }
  .hs-stage { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); grid-template-rows: auto minmax(0, 1fr); gap: clamp(24px, 4vh, 40px); padding-block: clamp(20px, 4vh, 44px) 52px; }
  .hs-comp { grid-template-rows: auto minmax(0, 1fr); gap: clamp(20px, 3.4vh, 36px); min-height: 0; }
  .hs-clips { --gap: var(--space-5); display: flex; justify-content: center; align-items: center; gap: var(--gap); min-height: 0; container-type: size; }
  .hs-clip { flex: none; width: min(calc((100cqw - 2 * var(--gap)) / 3), calc(100cqh * 9 / 16)); }
  .hs-note { position: absolute; inset-inline: var(--gutter); bottom: var(--space-4); }
  /* The line of the active step follows the scroll; earlier ones are full, later ones empty. */
  .hs-step { --fill: clamp(0, calc(var(--progress, 0) * 4 - var(--n)), 1); }

  /* Before motion.js writes the first step (slow networks paint first): no flash of the final
     composition. The picture waits invisible, later captions are already muted; it fades in when
     the first state is applied. If the scripts never run, a delayed fallback shows everything. */
  .hero-story:not([data-step]) .hs-comp { opacity: 0; animation: hs-fallback-show 1ms 3s forwards; }
  .hero-story:not([data-step]) .hs-step:nth-child(n+2) { color: var(--muted); animation: hs-fallback-ink 1ms 3s forwards; }
  .hs-comp { transition: opacity var(--dur-reveal-fade) var(--ease-standard); }
}
/* Short pinned windows (laptops, about 680–820px tall): a slimmer band and tighter spacing, so the
   clips stay the largest thing in the final frame (at least as large as the unpinned layout). */
@media screen and (scripting: enabled) and (prefers-reduced-motion: no-preference) and (min-width: 961px) and (min-height: 680px) and (max-height: 820px) {
  .hs-stage { gap: 16px; padding-block: 16px 44px; }
  .hs-comp { gap: 14px; }
  .hs-step { padding-top: var(--space-3); font-size: var(--fs-body); }
  .hs-group { grid-template-columns: minmax(0, 19fr) minmax(0, 81fr); }
  .hs-quotes { padding-bottom: 8px; }
  .hs-quote::after { height: 8px; }
  .hs-axis { margin-top: 6px; }
}
@keyframes hs-fallback-show { to { opacity: 1; } }
@keyframes hs-fallback-ink { to { color: var(--ink); } }

/* ---- States (JS only) ------------------------------------------------------------------------ */

/* Screen only: printing always shows the complete final composition. */
@media screen {
  /* Step captions: current in ink, done in ink-2, upcoming muted. */
  .hero-story[data-step="0"] .hs-step:nth-child(n+2),
  .hero-story[data-step="1"] .hs-step:nth-child(n+3),
  .hero-story[data-step="2"] .hs-step:nth-child(n+4) { color: var(--muted); }
  .hero-story[data-step="1"] .hs-step:nth-child(1),
  .hero-story[data-step="2"] .hs-step:nth-child(-n+2),
  .hero-story[data-step="3"] .hs-step:nth-child(-n+3) { color: var(--ink-2); }
  .hero-story:not([data-pinned])[data-step="0"] .hs-step:nth-child(n+2),
  .hero-story:not([data-pinned])[data-step="1"] .hs-step:nth-child(n+3),
  .hero-story:not([data-pinned])[data-step="2"] .hs-step:nth-child(n+4) { --fill: 0; }

  /* 1: the source sits large in the stage, timeline under it: pinned only, see "Large state" below. */

  /* 2: the ranges, their quotes, numbers and the passages they cover stay quiet until the sweep
     has read past them. Hot bars and frames dim to the colour of the others (opacity only); the
     quotes wait as faint placeholders in their row (never an empty gap under the video). */
  .hero-story[data-step="0"] :is(.hs-seg, .hs-tick) { opacity: 0; }
  .hero-story[data-step="0"] .hs-quote { opacity: .2; transform: translateY(6px); }
  .hero-story[data-step="0"] .hs-tx[data-hot] { opacity: .2; }
  .hero-story[data-step="0"] .hs-fm[data-hot] { opacity: .24; }
  /* The sweep reads the timeline once on the way in (0 -> 1); coming back from the band
     ([data-hs-swept], hero-story.js) it is not read again. */
  .hero-story[data-step="1"]:not([data-hs-swept]) .hs-sweep { animation: hs-sweep var(--dur-sweep) var(--ease-standard) both; }

  /* 3: before the morph, each clip's picture sits as a small 9:16 thumbnail on its own range
     (uniform scale, so the picture is never stretched), invisible. */
  /* Unpinned (one-shot sequence) here; pinned in "Large state" below. */
  .hero-story[data-step="0"] .hs-frame,
  .hero-story[data-step="1"] .hs-frame { opacity: 0; }
  .hero-story:not([data-pinned]):is([data-step="0"], [data-step="1"]) .hs-frame { transform: var(--hs-from, none); }

  /* 4: burned-in captions and durations arrive last. */
  .hero-story[data-step="0"] .hs-clip :is(.hs-burn, .hs-chip),
  .hero-story[data-step="1"] .hs-clip :is(.hs-burn, .hs-chip),
  .hero-story[data-step="2"] .hs-clip :is(.hs-burn, .hs-chip) { opacity: 0; transform: translateY(6px); }

  /* Transitions, only after the first state has been applied without them. */
  .hero-story[data-hs-ready] .hs-step { transition: color var(--dur-fade) var(--ease-standard); }
  .hero-story[data-hs-ready]:not([data-pinned]) .hs-step::after { transition: transform var(--dur-reveal) var(--ease-standard); }
  /* The morph (see 4. above). Into the band (steps 2–3), all within 1.4s (MORPH_MS in
     hero-story.js):
       video + chip   1100ms, starts at once, a soft ease so the pictures can follow its edge
       timeline       horizontal offset and scale (transform) 500ms at once; vertical (translate)
                      1350ms from 40ms, slower at first: it stays under the video's bottom edge
                      until the video's corner has passed, then rises beside it
       pictures       appear on their ranges from 100ms, travel 1100ms from 140ms, 40ms apart
     Back (steps 0–1): the same, played backwards (each curve mirrored, delay = 1400ms − delay −
     duration). The values were checked frame by frame at 1024–1920px widths, 700–1080px heights. */
  .hero-story {
    --hs-ease-v: cubic-bezier(.45, .65, .3, 1);
    --hs-ease-v-back: cubic-bezier(.7, 0, .55, .35);
    --hs-ease-ty: cubic-bezier(.35, .6, .65, 1);
    --hs-ease-ty-back: cubic-bezier(.35, 0, .65, .4);
    --hs-ease-tx-back: cubic-bezier(.5, 0, 1, 1);
    --hs-ease-clip-back: cubic-bezier(.56, 0, .835, .16);
    --hs-ease-show-back: cubic-bezier(.32, 0, .67, 0);
  }
  /* Video, chip and timeline: see "Large state" below (pinned only). */
  /* Clip outlines (unpinned sequence only): there while the clips are on their way. */
  .hero-story:not([data-pinned]):is([data-step="0"], [data-step="1"], [data-step="2"]) .hs-clip::before { opacity: 1; }
  .hero-story[data-hs-ready] .hs-clip::before { transition: opacity var(--dur-fade) var(--ease-standard) calc(var(--dur-media) + var(--c) * var(--stagger)); }
  .hero-story[data-hs-ready] :is(.hs-seg, .hs-tick, .hs-tx[data-hot], .hs-fm[data-hot]) { transition: opacity var(--dur-fade) var(--ease-out-soft); }
  .hero-story[data-hs-ready] .hs-quote { transition: opacity var(--dur-fade) var(--ease-out-soft), transform var(--dur-fade) var(--ease-out-soft); }
  .hero-story[data-hs-ready][data-step="1"]:not([data-hs-swept]) :is(.hs-seg, .hs-tick, .hs-tx[data-hot], .hs-fm[data-hot], .hs-quote) { transition-delay: calc(var(--at) * var(--dur-sweep)); }
  /* The lift-out: each picture appears on its own range, then travels into its slot, one clip
     after another. The image itself moves (never an empty box), so "this moment became this clip".
     Back: each picture shrinks into its range and fades there. */
  /* Unpinned here, pinned in "Large state" below: never across a pin switch. */
  .hero-story[data-hs-ready]:not([data-pinned]) .hs-frame { transition: transform var(--dur-media) var(--ease-media) calc(140ms + var(--c) * 40ms), opacity 200ms var(--ease-out-soft) calc(100ms + var(--c) * 40ms); }
  .hero-story[data-hs-ready]:not([data-pinned]):is([data-step="0"], [data-step="1"]) .hs-frame { transition: transform var(--dur-media) var(--hs-ease-clip-back) calc(160ms - var(--c) * 40ms), opacity 200ms var(--hs-ease-show-back) calc(1100ms - var(--c) * 40ms); }
  .hero-story[data-hs-ready] .hs-clip :is(.hs-burn, .hs-chip) { transition: opacity var(--dur-fade) var(--ease-out-soft) calc(var(--c) * var(--stagger)), transform var(--dur-fade) var(--ease-out-soft) calc(var(--c) * var(--stagger)); }

  /* While the morph runs (hero-story.js): the row labels (the legend on phones), the time axis
     (its times and moment numbers) and, pinned, the quotes step aside quickly and return when
     everything has landed. */
  .hero-story[data-hs-ready] :is(.hs-labs, .hs-legend, .hs-axis) { transition: opacity var(--dur-ui) var(--ease-standard); }
  .hero-story[data-hs-morph] :is(.hs-labs, .hs-legend, .hs-axis),
  .hero-story[data-hs-ready][data-pinned][data-hs-morph] .hs-quote { opacity: 0; transition: opacity 100ms var(--ease-standard); }
}

/* Large state (steps 0–1, pinned only) and the morph's transitions. The measured FLIP transforms
   (hero-story.js) are sized for the pinned desktop composition (the video up to 920px wide), so they and
   their transitions apply only while the PIN query matches AND the section is pinned. Resize regression
   (3 October 2026): with the transitions outside this gate, a window resized from the pin (e.g. 1024px)
   to a phone width animated the video from its large state back to none over ~1.4s — the page overflowed
   by up to 1,200px meanwhile — because motion.js reads layout while switching the pin off, before
   hero-story.js drops [data-hs-ready]. Now the transform and its transition end in the same style change
   as the media query: the stacked layout appears at once. Keep this query identical to the PIN query
   above. The duration chip is not inside the scaled video: it only travels with the video's corner. */
@media screen and (scripting: enabled) and (prefers-reduced-motion: no-preference) and (min-width: 961px) and (min-height: 680px) {
  .hero-story[data-hs-ready][data-pinned] :is(.hs-video, .hs-vchip) { transition: transform 1100ms var(--hs-ease-v), clip-path 1100ms var(--hs-ease-v); }
  .hero-story[data-hs-ready][data-pinned] .hs-tl { transition: transform 500ms var(--ease-out), translate 1350ms var(--hs-ease-ty) 40ms; }
  .hero-story[data-hs-ready][data-pinned]:is([data-step="0"], [data-step="1"]) :is(.hs-video, .hs-vchip) { transition: transform 1100ms var(--hs-ease-v-back) 300ms, clip-path 1100ms var(--hs-ease-v-back) 300ms; }
  .hero-story[data-hs-ready][data-pinned]:is([data-step="0"], [data-step="1"]) .hs-tl { transition: transform 500ms var(--hs-ease-tx-back) 900ms, translate 1350ms var(--hs-ease-ty-back) 10ms; }
  .hero-story[data-hs-ready][data-pinned] .hs-frame { transition: transform var(--dur-media) var(--ease-media) calc(140ms + var(--c) * 40ms), opacity 200ms var(--ease-out-soft) calc(100ms + var(--c) * 40ms); }
  .hero-story[data-hs-ready][data-pinned]:is([data-step="0"], [data-step="1"]) .hs-frame { transition: transform var(--dur-media) var(--hs-ease-clip-back) calc(160ms - var(--c) * 40ms), opacity 200ms var(--hs-ease-show-back) calc(1100ms - var(--c) * 40ms); }

  .hero-story[data-pinned]:is([data-step="0"], [data-step="1"]) .hs-video { transform: var(--hs-v, none); }
  .hero-story[data-pinned]:is([data-step="0"], [data-step="1"]) .hs-vchip { transform: var(--hs-c, none); }
  /* Counter-scaled while large, so the corners keep their radius on screen. */
  .hero-story[data-pinned]:is([data-step="0"], [data-step="1"]) .hs-video { clip-path: inset(0 round calc(var(--radius-md) * var(--hs-vi, 1))); }
  .hero-story[data-pinned]:is([data-step="0"], [data-step="1"]) .hs-tl { transform: var(--hs-tx, none); translate: var(--hs-ty, none); }
  .hero-story[data-pinned]:is([data-step="0"], [data-step="1"]) .hs-frame { transform: var(--hs-from, none); }
}

@keyframes hs-sweep {
  0% { transform: translateX(-100%); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateX(833%); opacity: 0; }
}

/* Print / PDF: the static layout, never the pin. */
@media print {
  .hero-story { height: auto !important; }
  .hs-stage { position: static !important; height: auto !important; }
  .hs-note { position: static !important; }
}
