/* Matryoshka Labs · site styles.
   Palette is the current site's, mapped 1:1 onto the scrollcraft tokens.
   Chapters cut hard between four grounds; each ground restates its ink. */

:root {
  color-scheme: dark;
  --sc-canvas: #070907;
  --sc-surface: #121512;
  --sc-ink: #f4f3ee;
  --sc-ink-soft: #aaa9a1;
  --sc-accent: #ff5c35;
  --sc-accent-ink: #180906;
  --ml-soft: #0d100e;
  --ml-accent-soft: #ff9a7f;
  --ml-ok: #b9e769;
  --ml-paper: #f4f3ee;
  --ml-paper-soft: #55574f;
  --ml-paper-accent: #b23a1c;
  --ml-red-soft: #3a1208;

  --sc-font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --sc-font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sc-r-sm: 2px; --sc-r-md: 2px; --sc-r-lg: 2px;
  --sc-shadow-color: 120 12% 2%;

  --folio-w: 76px;
  --folio-h: 0px;
  --ml-line: color-mix(in oklab, currentColor 18%, transparent);
  --ml-line-strong: color-mix(in oklab, currentColor 42%, transparent);
}
@media (max-width: 860px) {
  :root { --folio-w: 0px; --folio-h: 54px; }
}

html { scroll-padding-top: calc(var(--folio-h) + 12px); }
body { background: var(--sc-canvas); }
main { padding-left: var(--folio-w); }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

.skip { position: fixed; top: 10px; left: 10px; z-index: 200; padding: 10px 14px; background: var(--sc-ink); color: var(--sc-canvas); transform: translateY(-160%); }
.skip:focus { transform: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--sc-gutter), 78rem); margin-inline: auto; }

/* ------------------------------------------------------------------ grounds */
.ch { position: relative; padding-block: var(--sc-section); }
.ch--dark  { background: var(--sc-canvas); color: var(--sc-ink); }
.ch--soft  { background: var(--ml-soft); color: var(--sc-ink); }
.ch--paper {
  --sc-ink: #070907; --sc-ink-soft: var(--ml-paper-soft);
  --sc-accent-text: var(--ml-paper-accent);
  background: var(--ml-paper); color: var(--sc-ink);
}
.ch--accent {
  --sc-ink: #180906; --sc-ink-soft: var(--ml-red-soft);
  --sc-accent-text: #180906;
  background: var(--sc-accent); color: var(--sc-ink);
}
.ch--dark, .ch--soft { --sc-accent-text: var(--sc-accent); }
.ch--paper ::selection { background: #070907; color: var(--ml-paper); }
.ch--accent ::selection { background: #180906; color: var(--sc-accent); }
.ch--paper :focus-visible, .ch--accent :focus-visible { outline-color: currentColor; }

/* ------------------------------------------------------------ type system */
.ch-head { display: grid; gap: var(--sc-4); margin-bottom: var(--sc-8); max-width: 52rem; }
.ch-num {
  font: 700 clamp(3.2rem, 2rem + 6vw, 7.5rem)/0.8 var(--sc-font-display);
  letter-spacing: -0.06em; color: var(--sc-accent-text);
  margin-bottom: var(--sc-3);
}
.ch-title {
  font: 500 clamp(1.85rem, 1.15rem + 3vw, 4.1rem)/1.04 var(--sc-font-display);
  letter-spacing: -0.045em; text-wrap: balance; max-width: 18ch;
}
.ch-lede { font-size: var(--sc-t-lg); line-height: 1.5; color: var(--sc-ink-soft); max-width: 46ch; text-wrap: pretty; }
html[lang="ru"] .ch-title { font-size: clamp(1.6rem, 1.05rem + 2.5vw, 3.5rem); max-width: 22ch; }

.note { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); max-width: 52ch; }
.note--small { font-size: var(--sc-t-xs); }

.proverb { display: grid; gap: 2px; margin-top: var(--sc-6); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.proverb [lang="ru"] { font: 500 0.78rem/1.4 var(--sc-font-display); letter-spacing: 0.02em; color: var(--sc-accent-text); }
.proverb--lg [lang="ru"] { font-size: 0.92rem; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px; border: 1px solid transparent; border-radius: 2px;
  font: 500 0.82rem/1 var(--sc-font-display); letter-spacing: 0.01em; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--sc-ease-out), background-color 160ms var(--sc-ease-out), color 160ms var(--sc-ease-out);
}
.btn::after { content: ""; width: 14px; height: 2px; background: currentColor; transform: rotate(-24deg); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn--accent { background: var(--sc-accent); color: var(--sc-accent-ink); }
.btn--ink { background: var(--sc-ink); color: var(--ml-paper); }
.ch--accent .btn--ink { background: #180906; color: var(--sc-accent); }
.ch--dark .btn--ink, .ch--soft .btn--ink { background: var(--sc-ink); color: var(--sc-canvas); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-2px); }
  .btn--accent:hover { background: var(--ml-accent-soft); }
}

/* ------------------------------------------------------------------- folio */
.folio {
  position: fixed; z-index: 95; inset: 0 auto 0 0; width: var(--folio-w);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 22px 0 18px; background: var(--sc-canvas); color: var(--sc-ink);
  border-right: 1px solid color-mix(in oklab, var(--sc-ink) 12%, transparent);
}
.folio__mark { display: block; padding: 4px; }
.folio__mark img { width: 28px; height: 42px; }
.folio__chapter {
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; gap: 14px;
  font: 500 0.72rem/1 var(--sc-font-display); letter-spacing: 0.08em; color: var(--sc-ink-soft);
  white-space: nowrap;
}
.folio__num { color: var(--sc-accent); font-weight: 700; font-size: 0.86rem; letter-spacing: 0; }
.folio__tools { display: grid; gap: 12px; justify-items: center; }
.lang { display: grid; gap: 2px; }
.lang button, .folio__index {
  min-width: 44px; min-height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: 2px;
  background: transparent; color: var(--sc-ink-soft); cursor: pointer;
  font: 500 0.7rem/1 var(--sc-font-display); letter-spacing: 0.04em;
  transition: color 140ms var(--sc-ease-out), background-color 140ms var(--sc-ease-out);
}
.lang button[aria-pressed="true"] { color: var(--sc-canvas); background: var(--sc-ink); }
.folio__index { border-color: color-mix(in oklab, var(--sc-ink) 26%, transparent); color: var(--sc-ink); min-height: 44px; }
.folio__index[aria-expanded="true"] { background: var(--sc-accent); color: var(--sc-accent-ink); border-color: var(--sc-accent); }
@media (hover: hover) and (pointer: fine) {
  .lang button:hover, .folio__index:hover { color: var(--sc-ink); }
}
@media (max-width: 860px) {
  .folio {
    inset: 0 0 auto 0; width: auto; height: var(--folio-h);
    flex-direction: row; padding: 0 10px 0 14px; gap: 10px;
    border-right: 0; border-bottom: 1px solid color-mix(in oklab, var(--sc-ink) 12%, transparent);
  }
  .folio__mark img { width: 22px; height: 33px; }
  .folio__chapter { writing-mode: horizontal-tb; transform: none; gap: 8px; flex: 1; min-width: 0; font-size: 0.68rem; }
  .folio__title { overflow: hidden; text-overflow: ellipsis; }
  .folio__tools { display: flex; gap: 6px; align-items: center; }
  .lang { display: flex; }
  .lang button { min-width: 38px; min-height: 40px; }
  .folio__index { min-height: 40px; }
}

/* ------------------------------------------------------------- index panel */
.index-panel {
  position: fixed; z-index: 90; inset: 0 0 0 var(--folio-w); padding-top: var(--folio-h);
  background: color-mix(in oklab, var(--sc-canvas) 97%, transparent); color: var(--sc-ink);
  overflow-y: auto; overscroll-behavior: contain;
}
.index-panel[hidden] { display: none; }
.index-panel__inner { width: min(100% - 2 * var(--sc-gutter), 60rem); margin: 0 auto; padding-block: clamp(2rem, 8vh, 6rem); display: grid; gap: var(--sc-6); justify-items: start; }
.index-panel__kicker { font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.index-panel__list { display: grid; width: 100%; }
.index-panel__list a {
  display: grid; grid-template-columns: 4.2rem 1fr; align-items: baseline;
  padding: 0.55em 0; border-bottom: 1px solid color-mix(in oklab, var(--sc-ink) 12%, transparent);
  font: 500 clamp(1.3rem, 0.9rem + 2vw, 2.4rem)/1.1 var(--sc-font-display); letter-spacing: -0.03em; text-decoration: none;
}
.index-panel__list b { font-size: 0.5em; color: var(--sc-accent); letter-spacing: 0; }
@media (hover: hover) and (pointer: fine) { .index-panel__list a:hover span { color: var(--sc-accent); } }
.index-panel__links { display: flex; flex-wrap: wrap; gap: var(--sc-5); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
body.index-open { overflow: hidden; }

/* -------------------------------------------------------- 0 · title page */
.title-page {
  min-height: 100svh; padding-block: 0; overflow: clip; isolation: isolate;
  display: grid; align-items: end;
}
.tp-planes { position: absolute; inset: 0; z-index: 0; pointer-events: none; --mx: 0; --my: 0; }
.tp-plane {
  position: absolute; bottom: -6vh; right: 8vw; width: auto; max-width: none;
  overflow: visible; fill: none; stroke: var(--sc-ink); vector-effect: non-scaling-stroke;
}
.tp-plane use, .tp-plane circle { vector-effect: non-scaling-stroke; }
.tp-plane--far  { height: 118vh; right: 2vw;  stroke-opacity: 0.1;  stroke-width: 1; translate: calc(var(--mx) * -18px) calc(var(--my) * -12px); }
.tp-plane--mid  { height: 92vh;  right: 8.5vw; stroke-opacity: 0.2;  stroke-width: 1; translate: calc(var(--mx) * -11px) calc(var(--my) * -7px); }
.tp-plane--near { height: 68vh;  right: 14.6vw; stroke-opacity: 0.38; stroke-width: 1.2; translate: calc(var(--mx) * -6px) calc(var(--my) * -4px); }
.tp-plane--core { height: 46vh;  right: 20.2vw; stroke: var(--sc-accent); stroke-opacity: 0.9; stroke-width: 1.5; translate: calc(var(--mx) * -2px) calc(var(--my) * -1px); }
.tp-dot { fill: var(--sc-accent); stroke: none; }
.tp-bar {
  position: absolute; left: 44vw; bottom: 4vh; width: 80vw; height: clamp(10px, 1.4vw, 18px);
  background: var(--sc-accent); transform-origin: 0 50%; rotate: -27deg; opacity: 0.92;
  translate: calc(var(--mx) * 6px) calc(var(--my) * 4px);
}
.tp-copy {
  position: relative; z-index: 2; display: grid; gap: var(--sc-5); justify-items: start;
  padding: 0 var(--sc-gutter) clamp(3rem, 12vh, 8rem);
  max-width: 58rem;
}
.tp-kicker { font: 500 0.74rem/1.3 var(--sc-font-display); letter-spacing: 0.08em; color: var(--sc-ink-soft); }
.tp-title {
  font: 700 clamp(3rem, 1.6rem + 6.4vw, 7.6rem)/0.92 var(--sc-font-display);
  letter-spacing: -0.06em;
}
.tp-lead { font-size: var(--sc-t-lg); line-height: 1.5; color: var(--sc-ink-soft); max-width: 40ch; text-wrap: pretty; }
/* The headline sits on its own ground strip so the bar passes behind the type
   without the type ever reading against it. */
.tp-title, .tp-lead { position: relative; }
.tp-title { padding-right: 0.1em; }
html[lang="ru"] .tp-title { font-size: clamp(2.2rem, 1.1rem + 3.9vw, 5rem); }
@media (max-width: 860px) {
  .title-page { padding-top: var(--folio-h); align-items: end; }
  .tp-plane { right: auto; left: 58%; bottom: auto; translate: -50% 0 !important; }
  .tp-plane--far  { height: 46svh; top: calc(var(--folio-h) + 2svh); }
  .tp-plane--mid  { height: 36.5svh; top: calc(var(--folio-h) + 11.5svh); }
  .tp-plane--near { height: 27svh; top: calc(var(--folio-h) + 21svh); }
  .tp-plane--core { height: 18.5svh; top: calc(var(--folio-h) + 29.5svh); }
  .tp-bar { bottom: auto; top: 40svh; rotate: -20deg; left: -20vw; height: 9px; }
  .tp-title { font-size: clamp(2.6rem, 13vw, 3.6rem); }
  html[lang="ru"] .tp-title { font-size: clamp(2.1rem, 10.5vw, 3rem); }
  .tp-copy { padding-bottom: clamp(5.5rem, 12svh, 7rem); gap: var(--sc-4); }
  .tp-lead { font-size: 1.02rem; }
}

/* --------------------------------------------------------- I · the gains */
.wins { border-top: 3px solid var(--sc-ink); }
.win { display: grid; grid-template-columns: 5rem minmax(0, 7fr) minmax(0, 5fr); gap: var(--sc-3) var(--sc-7); align-items: baseline;
  padding-block: clamp(1.6rem, 3.5vw, 2.8rem); border-bottom: 1px solid var(--ml-line-strong); }
.win__n { font: 700 1rem/1 var(--sc-font-display); color: var(--sc-accent-text); letter-spacing: 0.02em; position: relative; padding-top: 14px; }
.win__n::before { content: ""; position: absolute; left: 0; top: 0; width: 28px; height: 4px; background: var(--sc-accent); rotate: -16deg; transform-origin: 0 50%; }
.win__title { font: 600 clamp(1.7rem, 1rem + 3vw, 3.6rem)/1.02 var(--sc-font-display); letter-spacing: -0.05em; text-wrap: balance; }
.win__text { font-size: var(--sc-t-lg); line-height: 1.5; color: var(--sc-ink-soft); max-width: 40ch; text-wrap: pretty; }
.wins__close { margin-top: var(--sc-8); margin-left: auto; max-width: 22ch; text-align: right;
  font: 700 clamp(1.5rem, 1rem + 2.4vw, 3rem)/1.05 var(--sc-font-display); letter-spacing: -0.045em; color: var(--sc-accent-text); text-wrap: balance; }
html[lang="ru"] .win__title { font-size: clamp(1.45rem, 0.95rem + 2.4vw, 3rem); }
@media (max-width: 860px) {
  .win { grid-template-columns: 3rem minmax(0, 1fr); gap: var(--sc-3) var(--sc-4); }
  .win__text { grid-column: 2; font-size: 1.02rem; }
  .wins__close { text-align: left; margin-left: 0; }
}

/* ------------------------------------------------------ the intertitle */
.intertitle {
  min-height: 72svh; display: grid; place-items: center; padding: 0 var(--sc-gutter);
  background: var(--sc-canvas); color: var(--sc-ink-soft);
}
.intertitle__copy { display: grid; gap: var(--sc-4); justify-items: center; text-align: center; max-width: 44rem; }
.intertitle__main { font: 500 clamp(1.7rem, 1.1rem + 2.6vw, 3.2rem)/1.08 var(--sc-font-display); letter-spacing: -0.045em; color: var(--sc-ink); text-wrap: balance; }
.intertitle__sub { font-size: var(--sc-t-lg); line-height: 1.5; color: var(--sc-ink-soft); max-width: 34ch; text-wrap: balance; }

/* ----------------------------------------------------- III · the opening */
.ap { padding-block: 0; }
.ap-head { display: grid; gap: var(--sc-3); }
.ap-label__bar { display: block; }

/* Static lámina: the default, the no-JS and the reduced-motion state. */
.ap:not(.ap--live) .ap-stage { padding: var(--sc-section) var(--sc-gutter); width: min(100%, 86rem); margin-inline: auto; }
.ap:not(.ap--live) .ap-head { margin-bottom: var(--sc-8); }
.ap:not(.ap--live) .ap-scene {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; gap: var(--sc-5);
  padding-bottom: var(--sc-5); border-bottom: 1px solid var(--ml-line);
}
.ap:not(.ap--live) .doll { position: relative; aspect-ratio: 300 / 420; justify-self: center; }
.ap:not(.ap--live) .doll[data-k="0"] { width: 100%; }
.ap:not(.ap--live) .doll[data-k="1"] { width: 82%; }
.ap:not(.ap--live) .doll[data-k="2"] { width: 66%; }
.ap:not(.ap--live) .doll[data-k="3"] { width: 52%; }
.ap:not(.ap--live) .doll__half { position: absolute; inset: 0; }
.ap:not(.ap--live) .doll__half--top { translate: 0 -7%; }
.ap:not(.ap--live) .doll__mouth { position: absolute; inset: 0; }
.ap:not(.ap--live) .core { position: relative; width: 46%; aspect-ratio: 1; justify-self: center; margin-bottom: 12%; }
.ap:not(.ap--live) .ap-labels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sc-5); margin-top: var(--sc-5); }
.ap:not(.ap--live) .ap-label__bar { width: 34px; height: 4px; background: var(--sc-accent); rotate: -16deg; margin-bottom: var(--sc-4); }
.ap:not(.ap--live) .ap-label__name { font-size: 1rem; }
.ap:not(.ap--live) .ap-label__name--core { font-size: 1.6rem; color: var(--sc-accent); }
@media (max-width: 860px) {
  .ap:not(.ap--live) .ap-scene { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .ap:not(.ap--live) .ap-labels { grid-template-columns: 1fr; gap: var(--sc-6); }
  .ap:not(.ap--live) .ap-label { display: grid; grid-template-columns: 1fr; }
}

.doll { margin: 0; }
.doll__half img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
.doll__half--top { clip-path: inset(0 0 calc((1 - var(--seam, 0.581)) * 100%) 0); }
.doll__half--bot { clip-path: inset(calc(var(--seam, 0.581) * 100%) 0 0 0); }
/* The dark interior of the bottom shell, seen over its lip. */
.doll__mouth::before {
  content: ""; position: absolute; left: var(--mi, 13%); right: var(--mi, 13%);
  top: calc(var(--seam, 0.581) * 100% - 2.6%); height: 5.2%; border-radius: 50%;
  background: radial-gradient(closest-side, #020302 55%, #1e130c 82%, #3a2416 100%);
}
.doll__lip {
  position: absolute; left: var(--mi, 12%); right: var(--mi, 12%); top: calc(var(--seam, 0.581) * 100% - 1.6%); height: 3.2%;
  border-radius: 50%; background: radial-gradient(closest-side, #050605 50%, #2b1b10 90%); opacity: 0;
}
.doll__crack {
  position: absolute; left: 10%; right: 10%; top: calc(var(--seam, 0.581) * 100% - 0.6%); height: 1.2%;
  border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(closest-side, #fff8ef, var(--ml-accent-soft) 45%, transparent);
  filter: blur(1px);
}
.core__frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.core__frame rect { fill: none; stroke: var(--sc-ink); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 100; stroke-dashoffset: var(--draw, 0); }
.core__light {
  position: absolute; left: 50%; top: 50%; width: 36%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(closest-side, #fffaf2 0%, #ffd9c7 30%, var(--sc-accent) 62%, color-mix(in oklab, var(--sc-accent) 0%, transparent) 100%);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--sc-accent) 40%, transparent), 0 18px 60px -10px color-mix(in oklab, var(--sc-accent) 55%, transparent);
}
.ap-label__layer { font: 500 0.72rem/1.2 var(--sc-font-display); letter-spacing: 0.08em; color: var(--sc-accent); margin-bottom: var(--sc-2); }
.ap-label__name { font: 500 clamp(1.2rem, 0.9rem + 1.2vw, 2rem)/1.1 var(--sc-font-display); letter-spacing: -0.035em; margin-bottom: var(--sc-3); text-wrap: balance; }
.ap-label__name--core { font-weight: 700; font-size: clamp(2.2rem, 1.2rem + 4vw, 4.6rem); letter-spacing: -0.06em; }
.ap-label__text { color: var(--sc-ink-soft); max-width: 36ch; text-wrap: pretty; }
.ap-label__list { margin-top: var(--sc-4); display: grid; gap: 6px; font-size: var(--sc-t-sm); }
.ap-label__list li { position: relative; padding-left: 1.3em; color: var(--sc-ink); }
.ap-label__list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; background: var(--sc-accent); rotate: 45deg; }
.ap-label__time { margin-top: var(--sc-4); padding-top: var(--sc-3); border-top: 1px solid var(--ml-line); font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.ap-label__time b { color: var(--sc-ink); font-weight: 600; margin-left: 6px; }
.ap-label__cta { margin-top: var(--sc-5); }
.ap--live .ap-label.is-visible { pointer-events: auto; }

/* Live: a pinned stage, every piece positioned by site.js. */
.ap--live .ap-stage { isolation: isolate; }
.ap--live .ap-head { position: absolute; z-index: 120; left: var(--sc-gutter); top: calc(var(--folio-h) + clamp(1.5rem, 7vh, 4.5rem)); max-width: 30rem; will-change: opacity; }
.ap--live .ap-head .ch-title { font-size: clamp(1.6rem, 1rem + 2vw, 2.8rem); }
.ap--live .ap-scene { position: absolute; inset: 0; }
.ap--live .doll { display: contents; }
.ap--live .doll__half, .ap--live .doll__mouth, .ap--live .doll__crack {
  position: absolute; left: 0; top: 0; width: var(--fw); height: var(--fh);
  transform-origin: 50% calc(var(--seam, 0.581) * 100%); will-change: transform, opacity; visibility: hidden;
}
.ap--live .doll__crack { left: 0; right: auto; top: 0; height: var(--fh); background: none; filter: none; border-radius: 0; }
.ap--live .doll__crack::before {
  content: ""; position: absolute; left: calc(var(--mi, 9%) - 2%); right: calc(var(--mi, 9%) - 2%); top: calc(var(--seam, 0.581) * 100% - 0.7%); height: 1.4%; border-radius: 50%;
  background: radial-gradient(closest-side, #fff8ef, var(--ml-accent-soft) 45%, transparent); filter: blur(1.5px);
}
.ap--live .core { position: absolute; left: 0; top: 0; width: var(--cs); height: var(--cs); transform-origin: 50% 50%; visibility: hidden; z-index: 65; will-change: transform, opacity; }
.ap--live .ap-labels { position: absolute; inset: 0; z-index: 110; pointer-events: none; }
.ap--live .ap-label {
  position: absolute; top: 50%; width: min(28rem, 29%); opacity: 0; translate: 0 -50%; will-change: opacity, transform;
}
.ap--live .ap-label[data-k="0"], .ap--live .ap-label[data-k="2"], .ap--live .ap-label[data-k="4"] { right: calc(var(--sc-gutter) * 0.8); }
.ap--live .ap-label[data-k="1"], .ap--live .ap-label[data-k="3"] { left: var(--sc-gutter); }
.ap--live .ap-label__bar { position: absolute; left: -8%; top: -26px; width: 70%; height: 10px; background: var(--sc-accent); rotate: -16deg; transform-origin: 0 50%; scale: var(--bar, 0) 1; }
.ap--live .ap-label__layer, .ap--live .ap-label__name, .ap--live .ap-label__text { position: relative; }
@media (max-width: 860px) {
  .ap--live .ap-head { top: calc(var(--folio-h) + 18px); right: var(--sc-gutter); }
  .ap--live .ap-label,
  .ap--live .ap-label[data-k] { left: var(--sc-gutter); right: var(--sc-gutter); width: auto; top: auto; bottom: calc(24px + env(safe-area-inset-bottom)); translate: none; }
  .ap--live .ap-label__bar { top: -18px; left: -4px; width: 46%; height: 7px; }
  .ap--live .ap-label__name { font-size: 1.25rem; margin-bottom: var(--sc-2); }
  .ap--live .ap-label__text { font-size: 0.92rem; line-height: 1.5; }
  .ap--live .ap-label__list { margin-top: var(--sc-3); gap: 3px; font-size: 0.84rem; }
  .ap--live .ap-label__time { margin-top: var(--sc-3); padding-top: var(--sc-2); font-size: 0.82rem; }
  .ap--live .ap-label__cta { margin-top: var(--sc-3); min-height: 44px; font-size: 0.78rem; }
  .ap--live .ap-label__name--core { font-size: 2.6rem; }
}

/* ---------------------------------------------- IV · method over the film */
.method-scene { padding: 0; background: #070907; }
.method-scene__stage { height: 100vh; height: 100svh; display: grid; place-items: center; overflow: hidden; background: #070907; isolation: isolate; }
.method-scene__film { filter: brightness(0.58) saturate(0.9); }
.method-scene__shade { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,9,7,0.78) 0%, rgba(7,9,7,0.05) 32%, rgba(7,9,7,0) 50%, rgba(7,9,7,0.82) 76%, #070907 100%); }
.method-scene__content { position: absolute; inset: 0; z-index: 4; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(2rem, 7vh, 4.5rem) var(--sc-gutter) clamp(2rem, 7vh, 4rem); color: #f4f3ee; }
.method-scene__head { display: grid; gap: var(--sc-3); max-width: 40rem; }
.method-scene__head .ch-num { color: var(--sc-accent); margin-bottom: 0; }
.method-scene__head .proverb { margin-top: var(--sc-2); }
.method-scene__head .proverb span:not([lang]) { color: #c9c8c1; }
.method-scene__track { grid-row: 3; position: relative; padding-top: var(--sc-6); }
.method-scene__line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(244, 243, 238, 0.22); }
.method-scene__fill { position: absolute; inset: 0; background: var(--sc-accent); transform-origin: 0 50%; transform: scaleX(var(--tl, 0)); }
.method-scene .timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sc-6); }
.method-scene .step { position: relative; display: grid; gap: var(--sc-2); align-content: start; opacity: 0.38; transform: translateY(8px);
  transition: opacity 420ms var(--sc-ease-out), transform 420ms var(--sc-ease-out); }
.method-scene .step::before { content: ""; position: absolute; top: calc(var(--sc-6) * -1 - 8px); left: 0; width: 16px; height: 16px; background: #070907; border: 2px solid rgba(244,243,238,0.5); rotate: 45deg; transition: background-color 300ms var(--sc-ease-out), border-color 300ms var(--sc-ease-out); }
.method-scene .step.is-on { opacity: 1; transform: none; }
.method-scene .step.is-on::before { background: var(--sc-accent); border-color: var(--sc-accent); }
.step__n { font: 700 clamp(1.6rem, 1rem + 1.6vw, 2.6rem)/1 var(--sc-font-display); letter-spacing: -0.05em; color: var(--sc-accent); }
.step__time { font: 500 0.76rem/1.2 var(--sc-font-display); letter-spacing: 0.06em; color: #c9c8c1; }
.step__name { font: 500 clamp(1.25rem, 1rem + 0.9vw, 1.8rem)/1.1 var(--sc-font-display); letter-spacing: -0.035em; }
.step__text { color: #d8d7d0; max-width: 34ch; }
.step .proverb { margin-top: var(--sc-2); }
.step .proverb span:not([lang]) { color: #c9c8c1; }
@media (max-width: 860px) {
  .method-scene__film { width: 150%; }
  .method-scene__content { padding-top: calc(var(--folio-h) + 20px); }
  .method-scene__track { padding-top: var(--sc-6); }
  /* One stage at a time on a phone, in the same place. */
  .method-scene .timeline { grid-template-columns: 1fr; }
  .method-scene .step { grid-area: 1 / 1; opacity: 0; transform: translateY(12px); }
  .method-scene .step.is-on:not(.is-now) { opacity: 0; transform: translateY(-12px); }
  .method-scene .step.is-now { opacity: 1; transform: none; }
  .method-scene .step::before { display: none; }
}
/* Static: reduced motion, no JS. The film is a dark still and every stage shows. */
.method-scene:not(.is-live) .method-scene__stage { height: auto; min-height: 100svh; }
.method-scene:not(.is-live) .method-scene__content { position: relative; inset: auto; gap: var(--sc-9); }
.method-scene:not(.is-live) .method-scene__film { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.method-scene:not(.is-live) .step { opacity: 1; transform: none; grid-area: auto; }
.method-scene:not(.is-live) .step::before { background: var(--sc-accent); border-color: var(--sc-accent); }
.method-scene:not(.is-live) .method-scene__fill { transform: none; }
.method-scene:not(.is-live) .method-scene__shade { background: rgba(7,9,7,0.72); }
@media (max-width: 860px) { .method-scene:not(.is-live) .step::before { display: none; } .method-scene:not(.is-live) .method-scene__line { display: none; } }

.faq-sec { padding-block: var(--sc-9); }
.faq { max-width: 52rem; margin-left: auto; }
.faq__title { font: 500 1.1rem/1.2 var(--sc-font-display); letter-spacing: -0.02em; margin-bottom: var(--sc-4); }
.faq details { border-top: 1px solid var(--ml-line); }
.faq details:last-child { border-bottom: 1px solid var(--ml-line); }
.faq summary { display: grid; grid-template-columns: 1fr 22px; gap: var(--sc-4); align-items: center; padding: var(--sc-5) 0; cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 12px; height: 12px; border-right: 2px solid var(--sc-accent); border-bottom: 2px solid var(--sc-accent); rotate: 45deg; translate: 0 -3px; transition: rotate 180ms var(--sc-ease-out); justify-self: center; }
.faq details[open] summary::after { rotate: 225deg; translate: 0 3px; }
.faq details p { padding: 0 var(--sc-8) var(--sc-5) 0; color: var(--sc-ink-soft); max-width: 62ch; }

/* Scene: the turning doll, full screen. The film spans the full width; when
   the screen is taller than the film, black fills the rest and a gradient
   melts the film's top and bottom edges into it. */
.film__poster, .film__canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.film-scene { padding: 0; background: #070907; }
.film-scene__stage { height: 100vh; height: 100svh; display: grid; place-items: center; overflow: hidden; background: #070907; }
.film-scene__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.film-scene__frame::before, .film-scene__frame::after { content: ""; position: absolute; left: 0; right: 0; z-index: 2; height: 24%; pointer-events: none; }
.film-scene__frame::before { top: -1px; background: linear-gradient(#070907, rgba(7, 9, 7, 0)); }
.film-scene__frame::after { bottom: -1px; background: linear-gradient(rgba(7, 9, 7, 0), #070907); }
/* Wider than 16:9: the film is taller than the screen, so it simply crops. */
@media (max-aspect-ratio: 16 / 9) { .film-scene__frame::before, .film-scene__frame::after { height: 30%; } }
@media (max-width: 860px) { .film-scene__frame { width: 132%; } }
@media (prefers-reduced-motion: reduce) { .film-scene__stage { height: auto; padding-block: var(--sc-8); } }

/* ------------------------------------------------ V · who we are, over the dancer */
.about-scene { padding: 0; background: #070907; }
.about-scene__stage { height: 100vh; height: 100svh; display: grid; place-items: center; overflow: hidden; background: #070907; isolation: isolate; }
.about-scene__film { filter: brightness(0.5) saturate(0.85); }
.about-scene__shade { position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7,9,7,0.86) 0%, rgba(7,9,7,0.5) 36%, rgba(7,9,7,0.2) 58%, rgba(7,9,7,0.7) 100%),
    linear-gradient(180deg, rgba(7,9,7,0.55) 0%, rgba(7,9,7,0) 30%, rgba(7,9,7,0) 70%, rgba(7,9,7,0.7) 100%); }
.about-scene__content { position: absolute; inset: 0; z-index: 4; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--sc-8); align-items: center;
  padding: clamp(2rem, 7vh, 4.5rem) var(--sc-gutter); color: #f4f3ee; }
.about-scene__intro { display: grid; gap: var(--sc-4); align-content: center; max-width: 36rem; }
.about-scene__intro .ch-num { margin-bottom: 0; color: var(--sc-accent); }
.about__ru { font: 500 0.95rem/1.3 var(--sc-font-display); letter-spacing: 0.04em; color: var(--sc-accent); }
.about__text { display: grid; gap: var(--sc-3); font-size: var(--sc-t-lg); line-height: 1.55; max-width: 42ch; }
.about__text p:first-child { color: #f4f3ee; }
.about__text p + p { color: #c9c8c1; }
.pledges { counter-reset: pl; display: grid; align-content: center; border-top: 1px solid rgba(244,243,238,0.18); }
.pledges li { counter-increment: pl; display: grid; grid-template-columns: 2.6rem 1fr; gap: 2px var(--sc-4); padding-block: var(--sc-4); border-bottom: 1px solid rgba(244,243,238,0.18);
  opacity: 0.36; transition: opacity 420ms var(--sc-ease-out), transform 420ms var(--sc-ease-out); }
.pledges li::before { content: counter(pl); grid-row: 1 / span 2; font: 700 1.5rem/1 var(--sc-font-display); color: var(--sc-accent); }
.pledges li.is-on { opacity: 1; }
.pledges h3 { font: 500 clamp(1rem, 0.9rem + 0.45vw, 1.3rem)/1.25 var(--sc-font-display); letter-spacing: -0.025em; }
.pledges p { color: #c9c8c1; }
@media (max-width: 860px) {
  .about-scene__film { width: 150%; }
  .about-scene__shade { background: linear-gradient(180deg, rgba(7,9,7,0.85) 0%, rgba(7,9,7,0.45) 40%, rgba(7,9,7,0.5) 60%, rgba(7,9,7,0.92) 100%); }
  .about-scene__content { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; gap: var(--sc-5); align-items: start; padding-top: calc(var(--folio-h) + 20px); padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .about__text { font-size: 0.98rem; }
  .about__text p + p { display: none; }
  .about-scene .pledges { grid-row: 3; display: grid; border: 0; }
  /* One commitment at a time on a phone, in the same place. */
  .about-scene.is-live .pledges li { grid-area: 1 / 1; opacity: 0; transform: translateY(12px); border: 0; }
  .about-scene.is-live .pledges li.is-now { opacity: 1; transform: none; }
}
/* Static: reduced motion, no JS. A dark still behind, everything visible. */
.about-scene:not(.is-live) .about-scene__stage { height: auto; min-height: 100svh; }
.about-scene:not(.is-live) .about-scene__content { position: relative; inset: auto; }
.about-scene:not(.is-live) .about-scene__film { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.about-scene:not(.is-live) .pledges li { opacity: 1; }
.about-scene:not(.is-live) .about-scene__shade { background: rgba(7,9,7,0.74); }
@media (max-width: 860px) { .about-scene:not(.is-live) .about__text p + p { display: block; } }

/* --------------------------------------------------------- VI · the close */
.close { padding-bottom: var(--sc-6); }
.close__layout { display: grid; gap: var(--sc-8); }
.close .ch-num { color: #180906; }
.letter { display: grid; gap: var(--sc-4); max-width: 60rem; font-size: clamp(1.2rem, 0.95rem + 1.1vw, 1.85rem); line-height: 1.95; font-weight: 500; letter-spacing: -0.01em; }
.letter__line { display: block; }
.letter input, .letter select, .letter textarea {
  font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 2px solid currentColor; border-radius: 0;
  padding: 0 0.15em; margin: 0 0.15em; min-height: 1.6em; line-height: 1.3; vertical-align: baseline;
}
.letter input::placeholder, .letter textarea::placeholder { color: var(--ml-red-soft); opacity: 0.75; }
.letter #name { width: 9ch; }
.letter #company { width: 10ch; }
.letter #email { width: min(16ch, 100%); }
.letter select { max-width: 100%; cursor: pointer; padding-right: 1.2em; appearance: none; -webkit-appearance: none;
  background: linear-gradient(45deg, transparent 50%, currentColor 50%) right 0.25em center / 0.45em 0.45em no-repeat; }
.letter select option { color: #070907; background: #f4f3ee; }
.letter__line--free { display: grid; gap: 4px; }
.letter textarea { display: block; width: 100%; margin: 0; resize: vertical; font-size: 0.8em; line-height: 1.6; min-height: 4.2em; }
.letter :focus-visible { outline: 2px solid #180906; outline-offset: 4px; }
.letter input:user-invalid, .letter select:user-invalid, .letter textarea:user-invalid { border-bottom-style: dashed; }
.letter__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sc-5); margin-top: var(--sc-4); font-size: var(--sc-t-base); line-height: 1.5; font-weight: 400; }
.letter__actions .btn { min-height: 56px; font-size: 0.9rem; }
.letter__note, .letter__alt { font-size: var(--sc-t-sm); line-height: 1.5; font-weight: 400; color: var(--ml-red-soft); }
.letter__alt a { color: #180906; font-weight: 600; }
.letter__status { min-height: 1.5em; font-size: var(--sc-t-base); line-height: 1.5; font-weight: 600; }
.honeypot { position: absolute !important; left: -9999px !important; }
@media (max-width: 860px) {
  .letter { line-height: 2.05; }
  .letter #name, .letter #company { width: 8.5ch; }
  .letter #email { width: 100%; margin: 0; }
  .letter select { width: 100%; margin: 0; }
  .letter__actions .btn { width: 100%; }
}

.colophon {
  display: grid; grid-template-columns: 1fr auto; gap: var(--sc-4) var(--sc-6); align-items: start;
  margin-top: var(--sc-9); padding-top: var(--sc-5); border-top: 1px solid color-mix(in oklab, #180906 30%, transparent);
  font-size: var(--sc-t-sm); color: #180906;
}
.colophon__name { font-weight: 500; max-width: 42ch; }
.colophon__links { display: flex; flex-wrap: wrap; gap: var(--sc-2) var(--sc-5); grid-column: 1 / -1; }
.colophon__links a { color: #180906; }
.colophon__fine { grid-column: 2; grid-row: 1; color: var(--ml-red-soft); }
@media (max-width: 860px) {
  .colophon { grid-template-columns: 1fr; }
  .colophon__links, .colophon__fine { grid-column: 1 / -1; grid-row: auto; }
}

/* ---------------------------------------------------------- assistant */
.chat-launcher {
  position: fixed; z-index: 80; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 16px;
  background: var(--sc-surface); color: #f4f3ee; border: 1px solid color-mix(in oklab, #f4f3ee 22%, transparent); border-radius: 2px;
  font: 500 0.76rem/1 var(--sc-font-display); letter-spacing: 0.02em; cursor: pointer; box-shadow: var(--sc-e2);
  transition: transform 160ms var(--sc-ease-out);
}
.chat-launcher:active { transform: scale(0.97); }
.chat-launcher__short { display: none; }
@media (max-width: 860px) {
  .chat-launcher { padding: 0 14px; min-height: 44px; }
  .chat-launcher__long { display: none; }
  .chat-launcher__short { display: inline; }
}
.chat-launcher__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ml-ok); }
.chat-panel {
  position: fixed; z-index: 81; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 32px)); max-height: min(620px, calc(100svh - 150px));
  display: grid; grid-template-rows: auto 1fr auto; background: #101310; color: #f4f3ee;
  border: 1px solid color-mix(in oklab, #f4f3ee 24%, transparent); border-radius: 2px; box-shadow: var(--sc-e3); overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid color-mix(in oklab, #f4f3ee 13%, transparent); }
.chat-head strong { font: 500 0.9rem var(--sc-font-display); }
.chat-head small { display: block; color: var(--ml-ok); font-size: 0.75rem; }
.chat-close { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: #f4f3ee; font-size: 1.5rem; cursor: pointer; }
.chat-messages { min-height: 220px; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 9px; }
.chat-bubble { max-width: 88%; padding: 10px 12px; border-radius: 2px; background: #202420; font-size: 0.88rem; white-space: pre-wrap; }
.chat-bubble.user { margin-left: auto; background: #4a241a; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px; border-top: 1px solid color-mix(in oklab, #f4f3ee 13%, transparent); }
.chat-form input { min-width: 0; min-height: 44px; border: 1px solid color-mix(in oklab, #f4f3ee 18%, transparent); border-radius: 2px; background: #080a08; color: #f4f3ee; padding: 10px 13px; }
.chat-send { width: 44px; height: 44px; border: 0; border-radius: 2px; background: var(--sc-accent); color: var(--sc-accent-ink); font-weight: 800; cursor: pointer; }

/* In Russian the proverb needs no gloss, and the section title already is the expression. */
html[lang="ru"] .proverb > span:not([lang]), html[lang="ru"] .about__ru { display: none; }

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tp-plane, .tp-bar { translate: none !important; }
}
