/* ---------- demo video: the first sheet that rises over the hero ----------
   Poster only until play is pressed; the film is not fetched before that.
   Reveal is opacity and transform only, set up by demo.js (.rv), off under reduced motion. */
.demo{position:relative;z-index:2;background:#090909;padding-block:clamp(64px,10vh,112px) clamp(64px,10vh,120px)}
.fx .hero-pin+.demo,.pinm .hero-pin+.demo{margin-top:-100svh}
/* a shade runs ahead of the sheet, so it meets the hero with no hard edge. Only once the hero is pinned:
   before that the sheet sits right under the hero and the shade would move when the pin starts (layout shift). */
.fx .hero-pin+.demo::before,.pinm .hero-pin+.demo::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:clamp(56px,12svh,132px);pointer-events:none;background:linear-gradient(to bottom,rgba(9,9,9,0),#090909)}
.demo-in{width:100%;max-width:calc(1120px + 2 * var(--edge));margin:0 auto;padding-inline:var(--edge);display:grid;gap:clamp(24px,3.4vw,44px)}
.demo-head{display:grid;gap:12px}
.demo-head p{font-size:clamp(15px,1.25vw,18px);line-height:1.45;color:var(--soft);max-width:44ch}
.demo-fig{position:relative;margin:0;width:min(100%,calc((100svh - 250px) * 1.7778));min-width:min(100%,560px)}
.demo-fig::before{content:"";position:absolute;inset:-9% -6%;z-index:0;pointer-events:none;background:radial-gradient(60% 60% at 30% 40%,rgba(127,134,201,.3),transparent 70%),radial-gradient(50% 55% at 78% 70%,rgba(143,214,207,.18),transparent 72%);filter:blur(30px)}
.demo-frame{position:relative;z-index:1;border-radius:12px;overflow:hidden;overflow:clip;background:#0b1a3b;box-shadow:0 40px 90px -36px rgba(0,0,0,.9);aspect-ratio:16/9}
.demo-frame::after{content:"";position:absolute;inset:0;z-index:3;border-radius:inherit;pointer-events:none;box-shadow:inset 0 0 0 1px rgba(255,255,255,.16)}
.demo-frame video{display:block;width:100%;height:100%;object-fit:contain;background:#0b1a3b}
.demo-play{position:absolute;inset:0;z-index:2;display:block;width:100%;height:100%;cursor:pointer;text-align:left;-webkit-tap-highlight-color:transparent}
.demo-play[hidden]{display:none}
.demo-play img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform 1.2s var(--ease)}
.demo-play:hover img{transform:scale(1.02)}
/* silent highlight loop over the poster: no source until demo.js attaches one near the viewport, shown only once it is really playing */
.demo-loop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;pointer-events:none;transition:opacity .6s var(--ease),transform 1.2s var(--ease)}
.demo-loop.on{opacity:1}
.demo-play:hover .demo-loop{transform:scale(1.02)}
.demo-pill{position:absolute;left:52%;top:70%;display:inline-flex;align-items:center;gap:12px;height:56px;padding:0 22px 0 8px;border-radius:999px;background:#fff;color:#090909;font-size:15px;font-weight:500;letter-spacing:-.01em;white-space:nowrap;box-shadow:0 18px 40px -18px rgba(0,0,0,.7);transition:transform .45s var(--ease)}
.demo-pill i{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#090909;color:#fff;flex:none}
.demo-pill small{font-size:13px;font-weight:400;color:rgba(9,9,9,.62)}
.demo-play:hover .demo-pill{transform:scale(1.04)}
.demo-play:active .demo-pill{transform:scale(.97)}
.demo-play:focus-visible{outline:none}
.demo-play:focus-visible .demo-pill{outline:2px solid var(--violet);outline-offset:3px}
.demo-cta{display:flex}
@media(max-width:820px){
  .demo{padding-block:72px 24px}
  .demo-fig{width:100%;min-width:0}
  .demo-fig::before{display:none}
  .demo-pill{height:44px;padding:0 16px 0 6px;gap:9px;font-size:14px}
  .demo-pill i{width:32px;height:32px}
  .demo-pill small{font-size:12.5px}
}
/* phones: the chapter after the film comes out of the dark like the later ones, instead of starting at a line */
@media(max-width:767px){
  .demo+.chap .chap-door::after{content:"";display:block;position:absolute;left:0;right:0;top:-1px;bottom:auto;height:clamp(96px,19svh,180px);z-index:0;pointer-events:none;border-radius:0;background:linear-gradient(180deg,#090909 0,rgba(9,9,9,.86) 22%,rgba(9,9,9,.38) 62%,rgba(9,9,9,0) 100%)}
}
@supports (animation-timeline:view()){
  @media(max-width:767px) and (prefers-reduced-motion:no-preference){
    .demo+.chap>.chap-bg{animation:bg-in linear both;animation-timeline:--chap;animation-range:entry 0% entry 72%}
    .demo+.chap .chap-bg .scene{animation:chap-par-in linear both;animation-timeline:--chap;animation-range:cover}
  }
}
@media(max-width:560px){
  .demo-in{gap:22px}
  .demo-head h2{font-size:36px}
  .demo-pill{height:40px;padding:0 14px 0 5px;gap:8px}
  .demo-pill i{width:30px;height:30px}
  .demo-pill .demo-long{display:none}
}
/* slide in: copy first, then the frame comes up and settles, then the button */
.demo.rv [data-demo-rv]{opacity:0;transform:translate3d(0,40px,0);transition:opacity .9s var(--ease),transform 1.1s var(--ease);transition-delay:calc(var(--i,0) * 110ms)}
.demo.rv .demo-fig[data-demo-rv]{transform:translate3d(0,76px,0) scale(.962);transform-origin:50% 100%;transition-duration:1s,1.3s}
.demo.rv [data-demo-rv].in{opacity:1;transform:none}
@media(prefers-reduced-motion:reduce){
  .demo.rv [data-demo-rv],.demo.rv .demo-fig[data-demo-rv]{opacity:1;transform:none;transition:none}
  .demo-play img,.demo-pill{transition:none}
  .demo-loop{display:none}
}
