/* scene.css — сцена «Выход» K1→K3 (Режиссёр движения, design/scene.md).
   Действует только при html.scn-on (ставит scene.js). Без JS и при reduced-motion — статичные главы из styles.css.
   Движется только transform/opacity; позиции и размеры актёров считает scene.js. */
html.scn-on .scn { position: relative; height: 480svh; background: var(--cage); }
html.scn-on .scn__pin { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--cage); color: var(--paint); contain: layout paint; }
/* главы — слои одного экрана, без своих фонов и отступов */
html.scn-on .scn__pin > section { position: absolute; inset: 0; min-height: 0; padding: 0; margin: 0; background: none; display: block; overflow: visible; isolation: auto; perspective: none; text-align: left; }
html.scn-on .start::after { display: none; }
html.scn-on .scn__pin [aria-hidden], html.scn-on .start__copy, html.scn-on .lane-title, html.scn-on .scn .door__text,
html.scn-on .peak__clock, html.scn-on .peak__title, html.scn-on .peak__line { position: absolute; will-change: transform, opacity; }
html.scn-on .scn .doors, html.scn-on .scn .door { display: contents; }

/* ① пол: фото зала, камера «бежит» масштабом от точки схода */
html.scn-on .start__floor { position: absolute; inset: 0; z-index: 1; }
html.scn-on .start__floor img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.scn-shade { inset: 0; z-index: 2; background: linear-gradient(90deg, rgb(11 11 11 / .9), rgb(11 11 11 / .55) 55%, rgb(11 11 11 / .7)); }
.scn-stage { inset: 0; pointer-events: none; transform-style: preserve-3d; will-change: auto !important; } /* will-change: opacity сплющил бы 3D */
.scn-stage--floor { z-index: 3; }
/* слова краской: каждое — плита на полу (rotateX 90° вокруг нижней кромки), потёртость — текстурой, не маской (маска сплющила бы 3D) */
html.scn-on .paint--stack { position: absolute; inset: 0; width: auto; bottom: auto; font-size: inherit; transform: none; transform-style: preserve-3d; -webkit-mask-image: none; mask-image: none; will-change: auto !important; }
html.scn-on .paint--stack .paint__word, .scn-label {
  position: absolute; white-space: nowrap; line-height: .82; padding-top: .04em; transform-origin: 50% 100%; backface-visibility: hidden;
  font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em;
  color: transparent; background: url(images/wear.webp) 0 0 / 180px repeat; -webkit-background-clip: text; background-clip: text;
}
.scn-label { -webkit-mask-image: none; mask-image: none; }
.scn-label span:first-child { font-size: 1.4em; }

/* окна на полу лицом к камере: тренер (K1, ПК) и дверь зоны */
.scn-trainer, .scn-door { transform-origin: 50% 100%; overflow: hidden; background: var(--cage); }
.scn-trainer { z-index: 4; }
.scn-trainer img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.scn-on .scn-door { position: absolute; z-index: 5; aspect-ratio: auto; will-change: transform, opacity; }
html.scn-on .scn-door video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ③ пик: чёрный, октагон поднимается в вид сверху */
.scn-black { inset: 0; z-index: 7; background: var(--cage); }
.scn-stage--cage { z-index: 8; }
html.scn-on .peak__cage { position: absolute; transform-origin: 50% 50%; }
html.scn-on .peak__cage img { width: 100%; height: 100%; display: block; }
html.scn-on .paint--cage { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: calc(var(--cage-w, 1) * 1px); }
html.scn-on .paint--cage .paint__word { display: block; line-height: .9; }
.scn-flash { inset: 0; z-index: 11; background: var(--led); pointer-events: none; }
html.scn-on .peak__strike { inset: 0; width: auto; aspect-ratio: auto; margin: 0; z-index: 10; overflow: hidden; }
html.scn-on .peak__strike video { width: 100%; height: 100%; object-fit: cover; display: block; }
html.scn-on .peak__strike::after { content: ""; position: absolute; inset: auto 0 0; height: 34%; background: linear-gradient(to top, rgb(11 11 11 / .85), transparent); } /* подложка строки на ролике */

/* тексты кадров (HUD) */
html.scn-on .start__copy { z-index: 6; left: var(--gutter); top: clamp(96px, 14vh, 140px); padding: 0; max-width: 30rem; } /* над полом, на тёмном потолке: пол — словам */
html.scn-on .start__title { text-shadow: 0 1px 12px rgb(0 0 0 / .45); }
html.scn-on .lane-title { z-index: 6; left: var(--gutter); top: 15%; font-size: var(--step-2); max-width: 30rem; text-shadow: 0 2px 14px rgb(0 0 0 / .5); }
html.scn-on .scn .door__text { z-index: 6; left: var(--gutter); top: 50%; margin-top: -4.5em; width: min(34vw, 30rem); display: grid; gap: var(--space-3); }
html.scn-on .scn .door__no { font-size: clamp(64px, 9vw, 140px); line-height: .8; }
html.scn-on .scn .door__name { font-family: var(--font-display); font-weight: 900; font-size: var(--step-3); line-height: .9; }
html.scn-on .scn .door__text p:last-child { color: color-mix(in oklab, var(--paint) 85%, transparent); font-size: var(--step-0); }
html.scn-on .peak__clock { z-index: 9; left: var(--gutter); top: 30%; font-size: clamp(54px, 5.6vw, 96px); }
html.scn-on .peak__clock .clock__ghost { opacity: .12; }
html.scn-on .peak__clock.is-19 .peak__time { text-shadow: 0 0 28px var(--led), 0 0 4px var(--led); }
html.scn-on .peak__title { z-index: 9; left: var(--gutter); top: calc(30% + clamp(54px, 5.6vw, 96px) + 32px); max-width: 24rem; text-align: left; font-family: var(--font-display); font-weight: 900; line-height: .9; }
html.scn-on .peak__line { z-index: 12; left: var(--gutter); bottom: 40px; font-size: var(--step-1); font-weight: 600; color: var(--paint); }
html.scn-on .paint--cage { color: var(--floor); }

/* телефон — своя композиция: дверь на весь экран, часы над клеткой, текст в зоне большого пальца */
@media (max-width: 700px) {
  html.scn-on .start__copy { inset: 0; max-width: none; pointer-events: none; } html.scn-on .start__copy > * { pointer-events: auto; } /* телефон: заголовок наверху, кнопка — в зоне большого пальца */
  html.scn-on .start__title, html.scn-on .start__where { position: absolute; left: var(--gutter); right: var(--gutter); }
  html.scn-on .start__title { top: 76px; font-size: 1.15rem; }
  html.scn-on .start__where { top: calc(76px + 3.1em); }
  html.scn-on .start__actions { position: absolute; left: var(--gutter); right: var(--gutter); bottom: max(20px, env(safe-area-inset-bottom)); margin: 0; }
  html.scn-on .start__actions .btn--primary { flex: 1; }
  html.scn-on .start__actions .btn--ghost { display: none; }
  html.scn-on .lane-title { top: 12%; right: var(--gutter); }
  html.scn-on .scn .door__text { top: auto; bottom: 32px; margin: 0; width: auto; right: var(--gutter); }
  html.scn-on .scn .door__text::before { content: ""; position: absolute; z-index: -1; inset: -60vh calc(-1 * var(--gutter)) -32px; background: linear-gradient(to top, rgb(11 11 11 / .9) 30%, transparent); }
  html.scn-on .scn .door__no { font-size: 72px; }
  html.scn-on .peak__clock { left: 0; right: 0; top: 12%; text-align: center; font-size: 15vw; }
  html.scn-on .peak__clock .peak__time { left: 0; right: 0; }
  html.scn-on .peak__title { top: auto; bottom: 76px; left: var(--gutter); right: var(--gutter); max-width: none; text-align: center; font-size: var(--step-2); }
  html.scn-on .peak__line { left: 0; right: 0; bottom: 36px; text-align: center; }
}
/* сайт: подпись первого экрана лежит на светлых лампах потолка — мягкая тень под ней, чтобы читалась (AA) */
html.scn-on .start__copy::before { content: ""; position: absolute; z-index: -1; inset: -56px -120px -56px calc(-1 * var(--gutter)); pointer-events: none;
  background: radial-gradient(closest-side at 40% 50%, rgb(11 11 11 / .72), rgb(11 11 11 / .45) 60%, transparent); }
@media (max-width: 700px) {
  html.scn-on .start__copy::before { inset: 0 0 auto; height: 230px; background: linear-gradient(rgb(11 11 11 / .82) 55%, transparent); }
}
.scn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
