/* ==========================================================================
   Posters (spec 4.6, 5.7) — additions for js/posters.js. Base layout, grounds
   and the static (no-JS / reduced) form live in main.css.
   Hooks set by posters.js:
     .poster.is-active        the poster whose loops may run
     .chat.is-script          chat is scripted (messages appear one by one)
     .chat__m.is-on           message shown;  .chat.is-clear  clearing clip
     .nodes .pkt(.is-on)      the packet;     .nodes li.is-hit  node reached
     .wire[data-asm=a|b]      block re-assembly (two names restart the animation)
     .p4__w--ses.is-src       dictionary word hidden while its glyph copy runs
   ========================================================================== */

/* ---------- P1: packet, node hit, scripted chat ---------- */
.nodes .pkt{position:absolute;display:block;left:10%;right:10%;top:11px;height:6px;z-index:1;visibility:hidden;pointer-events:none}
.nodes .pkt::before{content:"";position:absolute;left:-3px;top:0;width:6px;height:6px;background:var(--kagit)}
.nodes .pkt.is-on{visibility:visible}
.nodes li.is-hit i{background:var(--safran);border-color:var(--safran)}
/* state swaps are instant: no transition, also not the .01ms one of the reduced safety net */
.chat__m,.nodes li i,.nodes .pkt{transition:none!important}
.chat.is-script .chat__m:not(.is-on){visibility:hidden}
.chat.is-script .chat__m:first-child>span{display:inline-block}
.chat.is-script .chat__m:first-child.is-on>span{animation:p1-type var(--d-3) steps(var(--n,28),end) backwards}
.chat.is-script.is-clear{animation:p1-clear var(--d-2) steps(4,end) forwards}
@keyframes p1-type{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
@keyframes p1-clear{from{clip-path:inset(0)}to{clip-path:inset(0 0 100% 0)}}

/* ---------- P2: stepping frame, wdth-fitted word, re-assembling wireframe ---------- */
.js:not(.reduced) .posters.is-live .device{transition:width var(--d-3) steps(6,end)}
.wire i:nth-child(2){--i:1}.wire i:nth-child(3){--i:2}.wire i:nth-child(4){--i:3}
.wire i:nth-child(5){--i:4}.wire i:nth-child(6){--i:5}.wire i:nth-child(7){--i:6}
.wire[data-asm="a"] i{animation:wire-a var(--d-2) steps(3,end) calc(var(--i,0)*40ms) backwards}
.wire[data-asm="b"] i{animation:wire-b var(--d-2) steps(3,end) calc(var(--i,0)*40ms) backwards}
@keyframes wire-a{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
@keyframes wire-b{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
/* stack: the word must clear the demo tag, and six one-column blocks need the height */
@media (max-width:767px){.device{height:60vw;padding-top:var(--s-6)}}

/* ---------- P3: scroll-driven strip (stage mode) ---------- */
.js:not(.flat) .strip__track{will-change:transform}
/* room under the lower sprocket row for the timecode, whatever height the grid leaves the strip */
.poster__kinetic--p3{padding-bottom:28px}

/* ---------- P4: equaliser glyphs in fixed slots; halftone only on the active poster ---------- */
.p4__w--ses.is-src{display:none}
.p4__w--ses .g{text-align:center}
.posters.is-live .poster:not(.is-active) .p4__w--gorsel{animation-play-state:paused}
