/* Токены — из дизайн-системы Экоштаба (design/tokens.css, тёмная тема). */
:root {
  --bg-void: #050505; --bg-deep: #0A0A0A; --bg-panel: #0F0F0F; --bg-panel-2: #161616;
  --bg-raised: #1E1E1E; --bg-hover: #262626; --line: #232323; --line-soft: #1B1B1B; --line-strong: #343434;
  --text: #ECECEC; --text-2: #C3C3C3; --text-3: #989898; --text-4: #7D7D7D;
  --acc: #35D08A; --acc-fg: #06120C; --acc-dim: #1E8F5E; --acc-glow: rgba(53,208,138,.35);
  --acc-wash: rgba(53,208,138,.14); --acc-edge: rgba(53,208,138,.28);
  --st-ok: #2FBF71; --st-warn: #E8B33A; --st-crit: #EF4C43; --st-none: #B0B0B0;
  --st-ok-ink: #57DC9B; --st-warn-ink: #F2C86B; --st-crit-ink: #FF7A72;
  --fill-crit: rgba(239,76,67,.1); --fill-crit-edge: rgba(239,76,67,.3);
  --fill-warn: rgba(232,179,58,.1); --fill-warn-edge: rgba(232,179,58,.3);
  --fill-ok: rgba(47,191,113,.1); --fill-ok-edge: rgba(47,191,113,.3);
  --fill-none: rgba(176,176,176,.12); --fill-none-edge: rgba(176,176,176,.3);
  --info: #4DA3FF; --violet: #9A7BFF;
  --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 14px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.22,.8,.2,1);
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg-void); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
#wall { position: fixed; inset: 0; }
#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
#stage > div { position: absolute; inset: 0; }
.mono { font-family: var(--mono); }
.shot *, .shot *::before, .shot *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-delay: -30s !important; animation-play-state: paused !important; }
.shot .keep-anim, .shot .keep-anim * { animation-play-state: paused !important; }

/* ── загрузка ── */
#loader { position: fixed; inset: 0; background: var(--bg-void); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 50; transition: opacity .6s; font: 500 14px var(--mono); color: var(--text-3); }
#loader .ld { position: relative; width: 112px; height: 112px; display: grid; place-items: center; }
#loader img { width: 52px; }
#loader .ring { position: absolute; inset: 0; transform: rotate(-90deg); }
#loader .ring circle { fill: none; stroke-width: 2; }
#loader .ring .track { stroke: var(--line-strong); }
#loader .ring .prog { stroke: var(--acc); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .3s; }
#loader .pct { font: 600 22px var(--mono); color: var(--text); }
#loader.off { opacity: 0; pointer-events: none; }

/* ── HUD ── */
#hud { pointer-events: none; }
.hud-sec { position: absolute; left: 64px; top: 26px; display: flex; gap: 12px; align-items: baseline; font: 500 14px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); transition: opacity .4s; }
.hud-sec b { color: var(--acc); font-weight: 600; }
.hud-lang { position: absolute; right: 64px; top: 18px; display: flex; gap: 4px; pointer-events: auto; padding: 3px; border-radius: 999px; background: rgba(10,10,10,.7); border: 1px solid var(--line); z-index: 5; }
.hud-lang button { height: 26px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--text-3); font: 600 12px var(--mono); letter-spacing: .06em; cursor: pointer; }
.hud-lang button.cur { background: var(--bg-hover); color: var(--text); }
.scrub { position: absolute; left: 64px; right: 64px; bottom: 26px; height: 24px; display: flex; align-items: center; gap: 18px; font: 500 13px var(--mono); color: var(--text-3); }
.rec { display: flex; align-items: center; gap: 8px; color: var(--st-crit-ink); letter-spacing: .1em; }
.rec i { width: 9px; height: 9px; border-radius: 50%; background: var(--st-crit); box-shadow: 0 0 10px var(--st-crit-glow, rgba(239,76,67,.6)); animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.scrub-track { flex: 1; position: relative; height: 3px; background: var(--line-strong); border-radius: 2px; }
.scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--acc); border-radius: 2px; transition: width .8s var(--ease); }
.scrub-head { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 4px var(--acc-wash); transition: left .8s var(--ease); }
.scrub-mark { position: absolute; top: -22px; transform: translateX(-2px); font: 500 11px var(--mono); color: var(--text-4); white-space: nowrap; letter-spacing: .06em; text-transform: uppercase; }
.scrub-mark::after { content: ''; position: absolute; left: 1px; top: 17px; width: 2px; height: 11px; background: var(--line-strong); }
.scrub-mark.on { color: var(--text-2); }
.tc { min-width: 150px; text-align: right; color: var(--text-2); }

/* ── общий носитель текста ── */
.kicker { font: 500 14px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acc); }
.fade { opacity: 0; transition: opacity .7s var(--ease), transform .8s var(--ease); }
.on > .fade, .fade.on { opacity: 1; transform: none; }

/* ── интро и финал ── */
.hero { position: absolute; left: 120px; top: 330px; width: 1100px; }
.hero .brand { display: flex; align-items: center; gap: 16px; margin-bottom: 34px; }
.hero .brand img { width: 52px; }
.hero .brand b { display: block; font: 600 20px var(--sans); }
.hero .brand span { font: 400 15px var(--sans); color: var(--text-3); }
.hero h1 { font: 700 104px/1 var(--sans); letter-spacing: -.02em; }
.hero p { margin-top: 26px; font: 400 26px/1.45 var(--sans); color: var(--text-2); max-width: 900px; }
.hero .facts { margin-top: 34px; display: flex; gap: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(15,15,15,.85); font: 500 15px var(--mono); color: var(--text-2); white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--st-ok-ink); border-color: var(--fill-ok-edge); background: rgba(10,30,20,.85); }
.chip.warn { color: var(--st-warn-ink); border-color: var(--fill-warn-edge); background: rgba(30,24,8,.85); }
.chip.crit { color: var(--st-crit-ink); border-color: var(--fill-crit-edge); background: rgba(32,10,9,.85); }
.chip.none { color: var(--st-none); border-color: var(--fill-none-edge); }
.shade { position: absolute; inset: 0; pointer-events: none; transition: opacity .8s; }
/* Затемнение выходит за кадр 1920×1080 на 3000 px во все стороны: стена
   рисуется на весь экран, и при окне другой пропорции в полях сцены иначе
   оставалась бы незатемлённая полоса. Точки градиента — в пикселях кадра. */
.shade.left, .shade.bottom, .dshade { inset: -3000px; }
.shade.left { background: linear-gradient(90deg, rgba(5,5,5,.94) 3000px, rgba(5,5,5,.82) 3806px, rgba(5,5,5,0) 4344px); }
.shade.bottom { background: linear-gradient(0deg, rgba(5,5,5,.96) 3000px, rgba(5,5,5,.85) 3389px, rgba(5,5,5,0) 3670px); }

/* ── раздел 1: проблемы ── */
#s1 > section { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; pointer-events: none; }
#s1 > section.on { opacity: 1; }
.pb { position: absolute; left: 120px; bottom: 150px; width: 980px; }
.pb .n { font: 500 16px var(--mono); color: var(--st-crit-ink); letter-spacing: .1em; margin-bottom: 18px; }
.pb h2 { font: 700 64px/1.06 var(--sans); letter-spacing: -.015em; }
.pb p { margin-top: 20px; font: 400 25px/1.45 var(--sans); color: var(--text-2); max-width: 860px; }
.pb .src { margin-top: 16px; font: 400 14px/1.5 var(--mono); color: var(--text-4); }
.counter { position: absolute; right: 120px; top: 190px; text-align: right; }
.counter b { display: block; font: 600 150px/1 var(--mono); letter-spacing: -.04em; color: var(--text); }
.counter span { display: block; margin-top: 18px; font: 500 20px var(--mono); color: var(--text-3); }
.ff { position: absolute; right: 120px; top: 120px; font: 600 22px var(--mono); color: var(--st-warn-ink); letter-spacing: .1em; }
.qs { position: absolute; inset: 0; }
.q { position: absolute; transform: translate(-50%, -50%) scale(.6); opacity: 0; transition: all .6s var(--ease); }
.on .q { opacity: 1; transform: translate(-50%, -50%); }
.q .chip { height: 46px; font-size: 20px; padding: 0 18px; }
.islands .lbl { position: absolute; transform: translate(-50%, 0); font: 500 14px var(--mono); color: var(--text-2); background: rgba(5,5,5,.8); padding: 4px 10px; border-radius: 6px; white-space: nowrap; border: 1px solid var(--line); }
.dots { position: absolute; right: 120px; top: 150px; width: 640px; display: grid; grid-template-columns: repeat(17, 1fr); gap: 10px; }
.dots i { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-raised); border: 1px solid var(--line-strong); opacity: 0; transform: scale(.4); transition: all .4s var(--ease); }
.on .dots i { opacity: 1; transform: none; }
.dots i.fine { background: var(--st-ok); border-color: var(--st-ok); box-shadow: 0 0 12px var(--st-ok-glow, rgba(47,191,113,.5)); }
.dots i.wait { background: rgba(232,179,58,.18); border-color: var(--fill-warn-edge); }
.legend { position: absolute; right: 120px; top: 790px; width: 640px; display: flex; gap: 22px; font: 500 15px var(--mono); color: var(--text-3); flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; }

/* ── раздел 2: путь события ── */
#ev { opacity: 0; transition: opacity .5s; pointer-events: none; }
#ev.on { opacity: 1; }
.pipe { position: absolute; left: 64px; right: 64px; top: 66px; height: 44px; display: flex; align-items: center; transition: opacity .5s; }
.pipe .node { display: flex; align-items: center; gap: 10px; font: 500 16px var(--sans); color: var(--text-4); white-space: nowrap; transition: color .4s; }
.pipe .node i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); transition: all .4s; }
.pipe .link { flex: 1; height: 2px; margin: 0 16px; background: var(--line-strong); position: relative; overflow: hidden; }
.pipe .link::after { content: ''; position: absolute; inset: 0; background: var(--acc); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.pipe .node.done { color: var(--text-2); }
.pipe .node.done i { background: var(--acc-dim); border-color: var(--acc-dim); }
.pipe .node.cur { color: var(--text); }
.pipe .node.cur i { background: var(--acc); border-color: var(--acc); box-shadow: 0 0 0 5px var(--acc-wash), 0 0 16px var(--acc-glow); }
.pipe .link.done::after { transform: scaleX(1); }

.vid { position: absolute; left: 64px; top: 140px; width: 1152px; height: 648px; border-radius: var(--r-xl); overflow: hidden; background: #000; border: 1px solid var(--line-strong); transition: all 1s var(--ease); }
#ev.full .vid { left: 0; top: 0; width: 1920px; height: 1080px; border-radius: 0; border-color: transparent; }
.vid video, .vid .ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid .ghost { opacity: 0; mix-blend-mode: screen; filter: grayscale(1) brightness(1.2) sepia(1) hue-rotate(95deg) saturate(3); transform: translate(26px, -14px) scale(1.035); transition: opacity .6s, transform 1.6s var(--ease) .6s; }
.st-camera .vid .ghost { opacity: .3; transform: none; }
.vid svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.osd { position: absolute; left: 16px; top: 16px; display: flex; gap: 8px; transition: opacity .5s; }
.osd .chip { height: 30px; font-size: 13px; }
#ev.full .osd, #ev.full .vcap { opacity: 0; }
.vcap { position: absolute; left: 16px; bottom: 14px; font: 400 13px var(--mono); color: rgba(236,236,236,.75); background: rgba(5,5,5,.6); padding: 4px 10px; border-radius: 6px; transition: opacity .5s; }
.dshade { position: absolute; background: linear-gradient(0deg, rgba(5,5,5,.92) 3000px, rgba(5,5,5,.7) 3324px, rgba(5,5,5,0) 3594px); opacity: 0; transition: opacity .25s; }
#ev.full .dshade { opacity: 1; transition: opacity .6s .4s; }
.divecap { position: absolute; left: 120px; bottom: 150px; opacity: 0; transition: opacity .25s; }
#ev.full .divecap { opacity: 1; transition: opacity .6s .6s; }
.divecap h2 { font: 700 64px/1.06 var(--sans); }
.divecap p { margin-top: 16px; font: 400 24px/1.45 var(--sans); color: var(--text-2); }
.divecap .src { margin-top: 12px; font: 400 14px var(--mono); color: var(--text-3); }
#ev.full .pipe, #ev.full .side, #ev.full .tl, #ev.full .keys { opacity: 0 !important; }

.zone { fill-opacity: 0; stroke-width: 3; stroke-dasharray: 2400; stroke-dashoffset: 2400; transition: stroke-dashoffset 1.6s var(--ease), fill-opacity .8s .9s, opacity .5s; }
.zones-on .zone { stroke-dashoffset: 0; fill-opacity: .16; }
.zone.dump { stroke: var(--st-crit); fill: var(--st-crit); }
.zone.appr { stroke: var(--st-warn); fill: var(--st-warn); transition-delay: .5s, 1.4s, 0s; }
.zone.excl, .zone.bins { stroke: var(--st-none); fill: url(#hatch); stroke-dasharray: 10 8; stroke-dashoffset: 0; opacity: 0; }
.zones-on .zone.excl, .zones-on .zone.bins { opacity: 1; fill-opacity: 1; transition-delay: 1s; }
.zl { font: 600 22px var(--mono); opacity: 0; transition: opacity .6s 1.4s; paint-order: stroke; stroke: #050505; stroke-width: 5px; }
.zones-on .zl { opacity: 1; }
.zones-dim .zone { fill-opacity: .06; } .zones-dim .zl { opacity: .5; }
.box rect { fill: none; stroke-width: 2.5; }
.box text { font: 600 17px var(--mono); paint-order: stroke; stroke: rgba(5,5,5,.85); stroke-width: 4px; }
.box.person rect { stroke: var(--info); } .box.person text { fill: var(--info); }
.box.vehicle rect { stroke: var(--violet); } .box.vehicle text { fill: var(--violet); }
.boxes { opacity: 0; transition: opacity .4s; }
.boxes-on .boxes { opacity: 1; }

.tl { position: absolute; left: 64px; top: 808px; width: 1152px; height: 58px; opacity: 0; transition: opacity .5s; }
.tl-on .tl { opacity: 1; }
.tl .bar { position: absolute; left: 0; right: 0; top: 34px; height: 4px; background: var(--line-strong); border-radius: 2px; }
.tl .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text-3); border-radius: 2px; }
.tl .seg { position: absolute; top: 34px; height: 4px; background: var(--st-warn); border-radius: 2px; }
.tl .mk { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font: 500 13px var(--mono); color: var(--text-2); white-space: nowrap; opacity: .25; transition: opacity .3s; }
.tl .mk.hit { opacity: 1; }
.tl .mk em { font-style: normal; color: var(--text-4); margin-left: 6px; }
.tl .mk::after { content: ''; width: 12px; height: 12px; margin-top: 7px; border-radius: 50%; background: var(--bg-void); border: 2px solid var(--text-3); }
.tl .mk.hit::after { border-color: var(--st-warn); background: var(--st-warn); }
.tl .mk.a { transform: translateX(-12%); } .tl .mk.z { transform: translateX(-88%); }

.side { position: absolute; left: 1264px; top: 140px; width: 592px; height: 860px; }
.panel { position: absolute; left: 0; top: 0; width: 592px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px 28px; opacity: 0; transform: translateX(40px); transition: opacity .5s, transform .7s var(--ease); }
.panel.on { opacity: 1; transform: none; }
.panel h3 { font: 600 26px var(--sans); display: flex; align-items: center; gap: 10px; }
.panel h3 svg { width: 22px; height: 22px; color: var(--acc); }
.panel .lead { margin-top: 12px; font: 400 18px/1.5 var(--sans); color: var(--text-2); }
.rows { margin-top: 18px; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font: 400 17px/1.45 var(--sans); }
.row > span { color: var(--text-3); }
.row > b { font-weight: 500; }
.row .mono { font-size: 15px; }
.thumb { margin-top: 18px; width: 100%; aspect-ratio: 16/9; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-strong); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .chip { position: absolute; left: 10px; top: 10px; height: 28px; font-size: 13px; }
.lg { display: grid; grid-template-columns: 22px 1fr; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.lg i { width: 18px; height: 18px; border-radius: 4px; margin-top: 4px; }
.lg b { font: 600 19px var(--sans); }
.lg span { grid-column: 2; font: 400 16px/1.45 var(--sans); color: var(--text-3); }
.trk { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; min-height: 124px; }
.trk div { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: var(--r-md); background: var(--bg-panel-2); font: 500 15px var(--mono); }
.trk div.vehicle { color: var(--violet); } .trk div.person { color: var(--info); }
.trk div em { font-style: normal; color: var(--text-3); }
.note { margin-top: 16px; font: 400 14px/1.5 var(--mono); color: var(--text-4); }
.verdict { margin-top: 16px; display: flex; align-items: center; gap: 14px; }
.verdict b { font: 700 38px var(--sans); }
.conf { margin-top: 12px; display: flex; align-items: center; gap: 12px; font: 500 15px var(--mono); color: var(--text-3); }
.conf .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-raised); overflow: hidden; }
.conf .bar i { display: block; height: 100%; width: 0; background: var(--acc); border-radius: 4px; transition: width 1.2s var(--ease) .6s; }
.panel.on .conf .bar i { width: 80%; }
.conf .chip { height: 28px; font-size: 14px; }
.strip { margin-top: 16px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.strip div { position: relative; aspect-ratio: 16/9; border-radius: 5px; overflow: hidden; border: 1px solid var(--line-strong); opacity: 0; transform: translate(-300px, 120px) scale(1.6); transition: all .8s var(--ease); }
.strip div img { width: 100%; height: 100%; object-fit: cover; display: block; }
.strip div span { position: absolute; left: 3px; top: 1px; font: 600 11px var(--mono); color: #fff; text-shadow: 0 0 3px #000; }
.panel.on .strip div { opacity: 1; transform: none; }
.strip div.hl { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); }
.reason { margin-top: 14px; font: 400 16px/1.5 var(--sans); color: var(--text-2); }
.reason mark { background: var(--acc-wash); color: var(--text); border-radius: 4px; padding: 0 3px; }

.keys { position: absolute; left: 64px; top: 880px; width: 1152px; height: 120px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .6s var(--ease); }
.keys-on .keys { opacity: 1; transform: none; }
.key { position: relative; border-radius: var(--r-xl); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font: 500 21px var(--sans); transition: transform .15s, filter .3s, opacity .4s; }
.key svg { width: 26px; height: 26px; }
.key kbd { position: absolute; right: 12px; top: 10px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; font: 600 12px/22px var(--mono); text-align: center; background: rgba(0,0,0,.18); }
.key.yes { background: var(--st-ok); color: #06120C; }
.key.no { background: var(--st-crit); color: #fff; }
.key.unk { background: var(--st-warn); color: #1A1204; }
.key.skip { background: var(--bg-raised); color: var(--text); border: 1px solid var(--line-strong); }
.key.skip small { font: 400 13px var(--sans); color: var(--text-3); margin-top: -4px; }
.key.skip kbd { background: var(--bg-hover); color: var(--text-3); }
.pressed .key.yes { animation: press .9s var(--ease) .5s both; }
@keyframes press { 0% { transform: none; } 20% { transform: scale(.95); filter: brightness(1.3); } 45% { transform: none; box-shadow: 0 0 0 6px var(--acc-wash), 0 0 40px var(--acc-glow); } 100% { transform: none; box-shadow: 0 0 0 4px var(--acc-wash); } }
.pressed .key:not(.yes) { opacity: .35; }
.cycle .key { animation: cyc 4s infinite; }
.cycle .key:nth-child(2) { animation-delay: 1s; } .cycle .key:nth-child(3) { animation-delay: 2s; } .cycle .key:nth-child(4) { animation-delay: 3s; }
@keyframes cyc { 0%, 30%, 100% { transform: none; filter: none; } 8% { transform: scale(.94); filter: brightness(1.35); } }

.decided { margin-top: 18px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-lg); background: rgba(10,30,20,.9); border: 1px solid var(--fill-ok-edge); font: 500 18px var(--sans); color: var(--st-ok-ink); opacity: 0; transform: translateY(10px); transition: all .6s var(--ease) 1.3s; }
.panel.on .decided { opacity: 1; transform: none; }

.doc .status { margin-top: 14px; display: flex; align-items: center; gap: 10px; font: 500 14px var(--mono); color: var(--text-3); }
.doc .status .chip { height: 28px; font-size: 13px; }
.ev-item { opacity: 0; transform: translate(-360px, -40px) scale(.8); transition: all .8s var(--ease); }
.panel.on .ev-item { opacity: 1; transform: none; }
.panel.on .ev-item:nth-child(2) { transition-delay: .15s; } .panel.on .ev-item:nth-child(3) { transition-delay: .3s; }
.panel.on .ev-item:nth-child(4) { transition-delay: .45s; } .panel.on .ev-item:nth-child(5) { transition-delay: .6s; } .panel.on .ev-item:nth-child(6) { transition-delay: .75s; }
.clipstrip { display: flex; gap: 4px; } .clipstrip img { width: 62px; height: 35px; object-fit: cover; border-radius: 3px; }
.plate { font: 600 17px var(--mono); letter-spacing: .08em; padding: 2px 8px; border: 1.5px solid var(--text-2); border-radius: 4px; }
.json { font: 400 13px/1.5 var(--mono); color: var(--text-2); white-space: pre; }

/* принципы */
.prin { position: absolute; left: 64px; top: 140px; width: 1152px; height: 648px; border-radius: var(--r-xl); background: linear-gradient(0deg, rgba(5,5,5,.94) 0%, rgba(5,5,5,.7) 48%, rgba(5,5,5,.2) 100%); opacity: 0; transition: opacity .6s; pointer-events: none; }
.prin.on { opacity: 1; }
.prin .in { position: absolute; left: 48px; bottom: 44px; right: 48px; }
.prin .n { font: 500 15px var(--mono); color: var(--acc); letter-spacing: .1em; }
.prin h2 { margin-top: 12px; font: 700 54px/1.08 var(--sans); letter-spacing: -.01em; }
.prin p { margin-top: 14px; font: 400 23px/1.45 var(--sans); color: var(--text-2); max-width: 980px; }
.lanes { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lane { background: var(--bg-panel-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; min-height: 384px; position: relative; }
.lanes { position: relative; }
.lane b { font: 500 14px var(--mono); color: var(--text-3); display: block; margin-bottom: 10px; }
.qcard { height: 58px; border-radius: var(--r-md); background: var(--bg-raised); border: 1px solid var(--line-strong); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; padding: 0 10px; font: 500 13px var(--mono); color: var(--text-2); }
.qcard i { width: 40px; height: 24px; border-radius: 3px; background-size: cover; background-position: center; flex: none; }
.qcard.hot { border-color: var(--st-warn); color: var(--st-warn-ink); }
.pool { margin-top: 12px; padding: 12px; border-radius: var(--r-lg); border: 1px dashed var(--line-strong); display: flex; gap: 8px; align-items: center; font: 500 14px var(--mono); color: var(--text-3); }
.flyer { position: absolute; left: 13px; top: 305px; width: calc((100% - 20px) / 3 - 26px); }
.flyer .qcard { margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.panel.on .flyer { animation: hop 6s var(--ease) infinite; }
@keyframes hop { 0%, 20% { transform: none; } 45% { transform: translate(91px, -34px) rotate(-3deg) scale(1.05); } 70%, 100% { transform: translate(calc(100% + 26px + 10px), 0); } }

/* подписи на стене */
#tags { pointer-events: none; }
#tags > section { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
#tags > section.on { opacity: 1; transition: opacity .7s 1.6s; }
.band { position: absolute; top: 0; font: 600 20px var(--sans); white-space: nowrap; display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: rgba(10,10,10,.9); border: 1px solid var(--line-strong); }
.band i { width: 12px; height: 12px; border-radius: 50%; }

/* ── раздел 3: экраны ── */
#ui { perspective: 2400px; opacity: 0; transition: opacity .5s; pointer-events: none; }
#ui.on { opacity: 1; }
.scr { position: absolute; left: 192px; top: 132px; width: 1536px; height: 864px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: 0 40px 120px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.03); background: #0A0A0A; opacity: 0; transform: translate3d(700px, 80px, -1400px) rotateY(-28deg) rotateX(8deg); transition: transform 1.2s var(--ease), opacity .8s; transform-origin: 50% 50%; }
.scr.on { opacity: 1; transform: none; }
.scr.gone { opacity: 0; transform: translate3d(-1300px, 0, -900px) rotateY(32deg); }
.scr .in { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform: scale(.8); transform-origin: 0 0; }
.scr .in > img { position: absolute; inset: 0; width: 1920px; height: 1080px; }
.scr .layer { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.scr .layer.on { opacity: 1; }
.cap { position: absolute; left: 192px; top: 66px; display: flex; align-items: baseline; gap: 16px; opacity: 0; transform: translateY(-10px); transition: all .6s var(--ease) .5s; }
.cap.on { opacity: 1; transform: none; }
.cap b { font: 700 36px var(--sans); }
.cap span { font: 400 20px var(--sans); color: var(--text-3); }
.crop { position: absolute; background-repeat: no-repeat; background-size: 1920px 1080px; }
.mk-new { position: absolute; left: 1195px; top: 663px; width: 46px; height: 70px; transition: filter .8s; }
.act .mk-new { filter: hue-rotate(104deg) saturate(.9) brightness(1.05); transition-delay: 1s; }
.ripple { position: absolute; left: 1218px; top: 697px; width: 30px; height: 30px; margin: -15px; border-radius: 50%; border: 3px solid var(--st-ok); opacity: 0; }
.act .ripple { animation: rip 1.8s ease-out 1s infinite; }
@keyframes rip { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(4); opacity: 0; } }
.num { position: absolute; width: 40px; height: 24px; background: #1A1A1A; font: 400 13px/24px var(--sans); color: var(--text-3); text-align: right; overflow: hidden; }
.num span { display: block; transition: transform .6s var(--ease) 1.2s; }
.act .num span { transform: translateY(-24px); }
.hand { position: absolute; width: 88px; height: 88px; margin: -44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.8); background: rgba(255,255,255,.12); opacity: 0; }
.act .hand { animation: tap 1.4s var(--ease) .4s both; }
@keyframes tap { 0% { opacity: 0; transform: scale(1.6); } 40% { opacity: 1; transform: scale(1); } 60% { transform: scale(.8); background: rgba(255,255,255,.3); } 100% { opacity: 0; transform: scale(1.3); } }
.bigkey { position: absolute; left: 1040px; top: 520px; width: 150px; height: 150px; border-radius: 26px; background: var(--bg-raised); border: 2px solid var(--line-strong); border-bottom-width: 10px; font: 600 80px/132px var(--mono); text-align: center; color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.6); opacity: 0; }
.act .bigkey { animation: bk 1.6s var(--ease) .3s both; }
@keyframes bk { 0% { opacity: 0; transform: translateY(40px) scale(.9); } 30% { opacity: 1; transform: none; } 45% { transform: translateY(8px); border-bottom-width: 2px; color: var(--st-ok-ink); border-color: var(--st-ok); } 70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-20px); } }
.flash { position: absolute; left: 56px; top: 954px; width: 347px; height: 116px; border-radius: 14px; background: #fff; opacity: 0; }
.act .flash { animation: fl .7s ease-out .75s both; }
@keyframes fl { 0% { opacity: 0; } 25% { opacity: .45; } 100% { opacity: 0; } }
.mv { position: absolute; transition: transform 1.2s var(--ease) .8s, box-shadow .4s .6s; }
.act .mv.card { transform: translate(390px, 0); box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 0 2px var(--acc); z-index: 3; }
.act .mv.up { transform: translateY(-135px); }
.act .mv.down { transform: translateY(135px); }
.stamp { position: absolute; left: 960px; top: 540px; transform: translate(-50%, -50%) rotate(-7deg) scale(2.4); opacity: 0; padding: 22px 46px; border: 6px solid var(--acc); border-radius: 20px; color: var(--acc); font: 700 76px/1 var(--sans); letter-spacing: .02em; text-transform: uppercase; background: rgba(5,15,10,.82); box-shadow: 0 0 80px var(--acc-glow); white-space: nowrap; }
.stamp small { display: block; margin-top: 12px; font: 500 22px var(--mono); letter-spacing: .06em; text-transform: none; color: var(--st-ok-ink); }
.stamp.on { animation: slam .5s cubic-bezier(.3,1.5,.5,1) .9s both; }
@keyframes slam { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(2.4); } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(1); } }

/* финал */
#fin { opacity: 0; transition: opacity .8s; pointer-events: none; }
#fin.on { opacity: 1; }
.fin-chain { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font: 500 20px var(--mono); color: var(--text-2); }
.fin-chain em { font-style: normal; color: var(--text-4); }

/* проблема 5: звенья дела, которые не сходятся */
.chain { position: absolute; right: 120px; top: 300px; display: flex; align-items: center; }
.chain .chip { height: 52px; padding: 0 22px; font-size: 21px; opacity: 0; transform: translateY(16px); transition: all .6s var(--ease); }
.chain i { width: 70px; height: 0; border-top: 2px dashed var(--line-strong); position: relative; opacity: 0; transition: opacity .6s; }
.chain i::after { content: '?'; position: absolute; left: 50%; top: -30px; transform: translateX(-50%); font: 600 18px var(--mono); color: var(--st-warn-ink); }
.on .chain .chip, .on .chain i { opacity: 1; transform: none; }
.on .chain .chip:nth-child(3) { transition-delay: .2s; } .on .chain .chip:nth-child(5) { transition-delay: .4s; } .on .chain .chip:nth-child(7) { transition-delay: .6s; }
.on .chain .chip:nth-child(3), .on .chain .chip:nth-child(7) { transform: translateY(-14px); }

/* номер и лица — то, ради чего собирается протокол */
.box.plate rect { stroke: var(--acc); stroke-width: 3; fill: rgba(53,208,138,.12); }
.box.plate text { fill: var(--acc); font-size: 19px; }
.box.face rect { stroke: #F2C86B; stroke-width: 2; }
.plate { display: inline-block; font: 600 16px var(--mono); letter-spacing: .06em; padding: 3px 10px; border: 1.5px solid var(--acc); border-radius: 5px; color: var(--text); background: rgba(53,208,138,.1); white-space: nowrap; }
.plate.sm { font-size: 14px; padding: 1px 8px; margin-top: 4px; }
.md { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--text-3); font-size: 15px; }
.face { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; border: 1.5px solid #F2C86B; }
.face.sm { width: 40px; height: 40px; border-radius: 6px; margin-top: 4px; }
.found { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plate-img { height: 46px; border-radius: 5px; border: 1.5px solid var(--acc); }

/* было / стало */
#ba { opacity: 0; transition: opacity .6s; pointer-events: none; }
#ba.on { opacity: 1; }
.ba-head { position: absolute; left: 120px; top: 110px; }
.ba-head h2 { margin-top: 12px; font: 700 64px/1.05 var(--sans); letter-spacing: -.015em; }
.ba-card { position: absolute; top: 300px; width: 800px; height: 470px; padding: 34px 40px; border-radius: var(--r-xl); background: rgba(12,12,12,.94); border: 1px solid var(--line-strong); opacity: 0; transform: translateY(30px); transition: opacity .6s, transform .8s var(--ease); }
.ba-card.was { left: 120px; }
.ba-card.now { left: 1000px; border-color: var(--fill-ok-edge); box-shadow: 0 0 0 1px var(--fill-ok-edge), 0 30px 80px rgba(0,0,0,.5); transition-delay: .15s; }
#ba.on .ba-card { opacity: 1; transform: none; }
.ba-card .chip { height: 36px; font-size: 16px; }
.ba-clock { margin-top: 26px; display: flex; align-items: baseline; gap: 22px; }
.ba-t { font: 600 88px/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.was .ba-t { color: var(--st-crit-ink); }
.now .ba-t { color: var(--st-ok-ink); }
.ba-clock span { font: 400 20px var(--sans); color: var(--text-2); }
.ba-bar { margin-top: 22px; height: 8px; border-radius: 4px; background: var(--bg-raised); overflow: hidden; }
.ba-bar i { display: block; height: 100%; width: 0; border-radius: 4px; }
.was .ba-bar i { background: var(--st-crit); transition: width 2.5s linear .6s; }
.now .ba-bar i { background: var(--st-ok); transition: width 3s linear .6s; }
#ba.on .was .ba-bar i { width: 100%; }
#ba.on .now .ba-bar i { width: .2%; min-width: 4px; }
.ba-card ol { margin-top: 28px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.ba-card li { counter-increment: s; display: flex; align-items: center; gap: 14px; font: 400 22px/1.35 var(--sans); color: var(--text-2); }
.ba-card li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 14px var(--mono); background: var(--bg-raised); color: var(--text-3); }
.now li::before { background: rgba(47,191,113,.16); color: var(--st-ok-ink); }
.was li { text-decoration: line-through rgba(239,76,67,0); transition: text-decoration-color .5s; }
#ba.done .was li { color: var(--text-4); text-decoration-color: rgba(239,76,67,.7); }
.ba-card kbd { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line-strong); border-bottom-width: 3px; background: var(--bg-raised); font: 600 15px var(--mono); color: var(--text); }
.ba-x { position: absolute; left: 120px; right: 120px; top: 820px; display: flex; align-items: baseline; gap: 28px; opacity: 0; transform: translateY(20px); transition: opacity .6s 2.8s, transform .8s var(--ease) 2.8s; }
#ba.on .ba-x { opacity: 1; transform: none; }
.ba-x b { font: 700 124px/1 var(--sans); color: var(--acc); letter-spacing: -.03em; text-shadow: 0 0 60px var(--acc-glow); font-variant-numeric: tabular-nums; }
.ba-x b em { font-style: normal; opacity: 0; transition: opacity .6s; }
#ba.done .ba-x b em { opacity: 1; }
.ba-x > span { font: 400 26px/1.4 var(--sans); color: var(--text-2); max-width: 760px; }
