/* Home page motion. Each display acts out its own words: app.js runs a sequence (data in app.js) that adds classes to the
   [data-seq] and [data-act] elements of a stage marked .seq-on. Without JavaScript, or with prefers-reduced-motion, no stage
   is .seq-on, so every display shows its finished state. .seq-hold (paused, off screen, tab hidden) freezes every animation.
   Only transform, opacity and clip-path move (plus two small SVG strokes), so nothing shifts the layout. */
@keyframes seq-in{from{opacity:0;transform:translateY(6px)}}
@keyframes seq-fade{from{opacity:0}}
@keyframes seq-grow{from{opacity:0;transform:scaleX(0)}}
@keyframes seq-pop{from{opacity:0;transform:scale(.4)}}
@keyframes seq-type{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes seq-spin{to{transform:rotate(360deg)}}
@keyframes seq-press{0%,100%{transform:none}35%{transform:scale(.9);filter:brightness(1.4)}}
@keyframes seq-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes seq-progress{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes seq-scan{from{opacity:1;transform:translateX(-100%)}to{opacity:1;transform:translateX(715%)}}
@keyframes seq-lift{0%{opacity:.9;transform:none}100%{opacity:0;transform:translateY(46px) scaleX(4)}}
@keyframes seq-cut{to{opacity:0;clip-path:inset(0 100% 0 0)}}
@keyframes seq-pin{from{opacity:0;transform:translateY(-18px)}}
@keyframes seq-reflow{from{clip-path:inset(0 var(--in) 0 var(--in))}to{clip-path:inset(0)}}
@keyframes seq-safe{15%,70%{opacity:1}}
@keyframes seq-sw-r{45%{transform:translate(50%,-12%)}100%{transform:translateX(calc(100% + 8px))}}
@keyframes seq-sw-l{45%{transform:translate(-50%,12%)}100%{transform:translateX(calc(-100% - 8px))}}

.seq-hold,.seq-hold *,.seq-hold *::before,.seq-hold *::after{animation-play-state:paused!important}

/* Generic states: hidden until its step (.in); extras (.x) exist only while a sequence runs; while the cut plays (.playing),
   time-bound elements (.tb) show only between their data-from and data-to (.live). */
.x{visibility:hidden}
.seq-on .x{visibility:visible}
.seq-on [data-seq]:not(.in){opacity:0}
.seq-on [data-seq].in{animation:seq-in .45s cubic-bezier(.2,.7,.2,1) backwards}
.seq-on .tb{transition:opacity .2s}
.seq-on:not(.playing) .x.tb,.seq-on.playing .tb:not(.live){opacity:0}
.seq-on.playing .tb.live{opacity:1}
/* The preview plays: each shot's picture pushes in and drifts with the playhead (--p from app.js), so it stops when the cut does. */
.seq-on.playing .pv img.live{transform:scale(calc(1.03 + var(--p,0)*.13));translate:calc(var(--p,0)*-3%) calc(var(--p,0)*-1.5%)}
.seq-on.playing .pv img.live:nth-of-type(even){transform:scale(calc(1.16 - var(--p,0)*.13));translate:calc(-3% + var(--p,0)*3%) calc(var(--p,0)*1.5% - 1.5%)}
.seq-on [data-type].in{animation:seq-type 1s steps(24) backwards}
.seq-on :is(.clip,.slot,.len,.cv-tl i,.ag-tl i).in{transform-origin:left center;animation-name:seq-grow;animation-duration:.5s}
.seq-on :is(.bin>i,.bin-src,.cv-media i,.ag-res i,.cv-board em,.pv-logo,.ms-focal,.ag-call em).in{animation-name:seq-pop}
.seq-on .press[data-act]{animation:seq-press .45s}

/* Hero demo */
.seq-on .chat-steps li:not(.done):before{content:'';width:14px;height:14px;background:none;border:2px solid var(--stage-line);border-top-color:var(--leaf);border-radius:50%;animation:seq-spin .7s linear infinite}
.seq-on .chat-steps li.done:before{animation:seq-pop .3s backwards}
.seq-on .tl-ruler span.in{animation-name:seq-fade}
.seq-on .tl-mark.in{animation:seq-fade .5s backwards}
.seq-on.playing .tl-head{opacity:1}
.seq-on .src-read:not(.go){transform:scaleX(0)}
.seq-on .src-read.go{animation:seq-progress 1.3s linear backwards}
.src-lift.lift{animation:seq-lift .8s ease-in}
.seq-on .clip.tail.cut{animation:seq-cut .6s forwards}
.tl-scan.go{animation:seq-scan 1.2s linear}
.seq-on .pv-cap [data-from].live{color:var(--leaf)}
.seq-on .pv-third.in{animation:seq-in .5s backwards}

/* Studio assistant steps */
.crew-chips.auto button[aria-selected=true] i{animation:seq-progress var(--step,5.5s) linear forwards}
.seq-on .cv-board .sw-r.swap{animation:seq-sw-r .9s cubic-bezier(.5,0,.2,1) forwards}
.seq-on .cv-board .sw-l.swap{animation:seq-sw-l .9s cubic-bezier(.5,0,.2,1) forwards}
.seq-on .cv-sound .lv.in{animation:none}
.seq-on .cv-sound .lv.in polyline{animation:seq-draw .8s ease-out backwards}
.seq-on .cv-sound .nar:not(.made){border-style:dashed}
.seq-on .cv-sound .nar:not(.made):after{display:block}
.seq-on .cv-sound .nar:not(.made) b{display:block}
.seq-on .cv-bar.in{animation:seq-progress 2s linear backwards}

/* Review link */
.seq-on .rv-draw.in{animation:none}
.seq-on .rv-draw.in path{animation:seq-draw .8s ease-out backwards}
.seq-on .rv-draw.in path+path{animation-delay:.75s}
.seq-on .rv-typed.in{animation:seq-type 1.4s steps(32) backwards}
.seq-on .rv-mark.in{animation:seq-pin .5s cubic-bezier(.3,1.5,.5,1) backwards}
.seq-on .rv-list li.in{animation:seq-in .5s backwards;border-color:var(--leaf)}

/* Writing */
.seq-on .wr-chunk.live{background:#dfe8c8;box-shadow:0 0 0 2px #dfe8c8}

/* Make other sizes */
.seq-on .ms-f.in{animation:none}
.seq-on .ms-f.in>div{animation:seq-reflow .9s cubic-bezier(.2,.7,.2,1) backwards}
.seq-on .ms-f.in b{animation:seq-in .5s .65s backwards}
.seq-on .ms-f.in span{animation:seq-pop .45s .5s backwards}
.seq-on .ms-f.in figcaption{animation:seq-fade .4s .3s backwards}
.seq-on .ms-f.in .ms-safe{animation:seq-safe 1.9s .4s}

.ex-panel.play .cmp{animation:seq-fade .4s both}

@media(prefers-reduced-motion:reduce){
 .home *,.home *:before,.home *:after{animation:none!important;transition:none!important}
 .tl-head{display:none}
}
