/* scroll-scrubbed frame sequence — engine styles (see scrub.js) */
.scrub{position:relative; height:420vh; background:var(--ink); color:var(--text)}
.scrub__stage{position:sticky; top:0; height:100vh; height:100svh; overflow:hidden; isolation:isolate}
.scrub__canvas{position:absolute; inset:0; width:100%; height:100%; display:block}

/* film grain + vignette over the frames, cheap and static */
.scrub__grain{position:absolute; inset:0; pointer-events:none; mix-blend-mode:overlay; opacity:.35;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .6 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  background-size:160px 160px}
.scrub__vignette{position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(ellipse at 55% 50%, transparent 45%, rgba(0,0,0,.55) 100%)}
/* desktop: the labels sit over the left third, where the finish panel comes to rest in the footage;
   a soft side scrim keeps the type readable there without touching the cavity on the right */
.scrub__stage::before{content:""; position:absolute; inset:0; z-index:1; pointer-events:none;
  background:linear-gradient(to right, rgba(10,12,16,.86) 0%, rgba(10,12,16,.58) 24%, rgba(10,12,16,0) 48%)}

/* section head: shows at the start, then hands over to the labels */
.scrub__head{position:absolute; left:0; right:0; top:clamp(72px,12vh,120px); z-index:2;
  opacity:0; transform:translateY(14px); transition:opacity .5s var(--ease), transform .7s var(--ease)}
.scrub__head.is-on{opacity:1; transform:none}
.scrub__head .h2{max-width:14ch}
.scrub__head .lede{color:var(--text-dim); max-width:32ch}

/* anatomy labels, left third of the frame */
.scrub__label{position:absolute; left:var(--pad); top:50%; transform:translateY(calc(-50% + 18px));
  width:min(34ch, calc(100% - 2*var(--pad))); margin:0; z-index:2;
  display:grid; grid-template-columns:3ch 1fr; gap:14px;
  opacity:0; pointer-events:none;
  transition:opacity .28s var(--ease), transform .5s var(--ease)}
/* the incoming label waits for the outgoing one to clear, so two never sit on top of each other */
.scrub__label.is-on{opacity:1; transform:translateY(-50%); transition:opacity .5s var(--ease) .2s, transform .7s var(--ease) .2s}
.scrub__label .wall__n{color:var(--accent); padding-top:.5em}
.scrub__label h3{font:600 clamp(1.3rem,2.4vw,1.9rem)/1.1 var(--font-d); word-spacing:.14em; margin:0 0 10px}
.scrub__label p{color:var(--text-dim); font-size:clamp(.92rem,1.1vw,1.02rem); margin:0}
.scrub__label .tag{display:inline-block; margin-top:14px; padding:.45em .7em; border:1px solid var(--line-hi);
  border-radius:var(--r); color:var(--text-faint); font-family:var(--font-m); font-size:.62rem; letter-spacing:.14em; text-transform:uppercase}

/* progress: thin rail at the bottom, fills while frames load, then shows scrub position */
.scrub__loader{position:absolute; left:0; right:0; bottom:0; height:2px; background:rgba(244,242,237,.08); z-index:3}
.scrub__loader i{display:block; height:100%; background:var(--accent); transform-origin:left; transform:scaleX(0); transition:transform .25s linear}
.scrub__loader.is-done{opacity:.6}
.scrub__hint{position:absolute; right:var(--pad); bottom:28px; z-index:2; color:var(--text-faint);
  display:flex; align-items:center; gap:12px; transition:opacity .4s}
.scrub__hint i{display:block; width:1px; height:48px; background:var(--line-hi); position:relative; overflow:hidden}
.scrub__hint i::after{content:""; position:absolute; left:0; top:-50%; width:100%; height:50%; background:var(--accent); animation:scrubHint 1.6s var(--ease) infinite}
.scrub.is-pinned .scrub__hint{opacity:0}
@keyframes scrubHint{to{top:100%}}

/* reduced motion: no pin, final frame, labels stacked */
.scrub.is-static{height:auto}
.scrub.is-static .scrub__stage{position:relative; height:auto; aspect-ratio:16/9}
.scrub.is-static .scrub__label{position:relative; left:auto; top:auto; transform:none; opacity:1; margin:0 var(--pad) 18px}
.scrub.is-static .scrub__hint{display:none}

@media (max-width:760px){
  .scrub{height:360vh}
  /* phones: labels sit over the lower half, on a scrim so the text stays readable over the frames */
  .scrub__stage::before{display:none}
  .scrub__stage::after{content:""; position:absolute; left:0; right:0; bottom:0; height:64%; z-index:1; pointer-events:none;
    background:linear-gradient(to top, rgba(10,12,16,.94) 0%, rgba(10,12,16,.78) 40%, rgba(10,12,16,0) 100%)}
  .scrub__label{top:auto; bottom:12vh; width:calc(100% - 2*var(--pad)); transform:translateY(16px)}
  .scrub__label.is-on{transform:none}
  .scrub__head{top:clamp(64px,10vh,100px)}
  .scrub__caption{display:none}
  .scrub__hint{bottom:18px}
}

/* homepage additions: the caption under the frames, and the climate box that follows the scrub section */
.scrub__caption{position:absolute; left:var(--pad); bottom:28px; z-index:2; color:var(--text-faint); font-size:.6rem; max-width:40ch}
.wall--climate .wall__climate{margin-top:0}

/* homepage: the fixed nav is about 90px tall, so the section head starts below it */
.scrub__head{top:clamp(120px,17vh,170px)}
@media (max-width:760px){ .scrub__head{top:clamp(112px,14vh,140px)} }
