/* Библия игровых механик — стили сайта. Журнал 2026: гротеск + моно, две спроектированные темы
   (светлая — холодный off-white, тёмная — глубокий сине-чёрный), один фирменный акцент,
   сетка статьи с именованными линиями (content / popout / feature / full), bento-карточки, флюидная типографика. */

/* ================================================================== */
/* Шрифты: локальные woff2 (SIL OFL, см. assets/fonts/OFL.txt)         */
/* ================================================================== */

@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/unbounded-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url("../fonts/unbounded-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/onest-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/onest-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ================================================================== */
/* Токены                                                              */
/* Палитра рассчитана в OKLCH (холодный оттенок 270°, акцент 285°);     */
/* контраст пар проверен: текст ≥ 4,5:1, UI и крупные цифры ≥ 3:1.      */
/* ================================================================== */

:root {
  /* светлая тема: чистый холодный off-white и чернильный текст */
  --bg: #f9fafd;
  --surface: #ffffff;
  --tint: #f0f2f9;
  --ink: #121522;
  --ink-2: #383d4b;
  --muted: #838999; /* декоративные линии и крупные цифры (≥24px): контраст 3,35:1 на --bg; мелкий текст — --muted-ink */
  --muted-ink: #555a69; /* приглушённый текст с контрастом AA */
  --line: #dee1e8;
  --accent: #653de9;
  --accent-ink: #5929d8; /* акцент для текста и ссылок */
  --on-accent: #ffffff;
  --blue: #0078aa;
  --green: #0a7e3a;
  --yellow: #af7c00;
  --focus: #653de9;
  --night: #06070c; /* подложка кадров-героев и лайтбокса в обеих темах */
  --cover-bg: #0c0e1c; /* типографская обложка статьи без кадра */
  --cover-ink: #f0f2f6;
  --glow: color-mix(in srgb, var(--accent) 14%, transparent);
  --shadow: 0 1px 2px rgba(18, 21, 34, .06), 0 12px 32px -12px rgba(18, 21, 34, .16);

  /* шрифты: Unbounded — дисплей (крупные заголовки и цифры), Onest — текст и интерфейс, JetBrains Mono — метки */
  --wide: "Unbounded", "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* флюидная модульная шкала 360 → 1440 px: крупные ступени заметно контрастнее текста */
  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --step--1: clamp(0.84rem, 0.81rem + 0.15vw, 0.94rem);
  --step-0: clamp(1.0625rem, 1.01rem + 0.25vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.12rem + 0.56vw, 1.6rem);
  --step-2: clamp(1.45rem, 1.25rem + 0.9vw, 2.05rem);
  --step-3: clamp(1.65rem, 1.3rem + 1.5vw, 2.6rem);
  --step-4: clamp(1.9rem, 1.4rem + 2.2vw, 3.3rem);
  --step-5: clamp(2rem, 1.2rem + 3.5vw, 4.4rem);
  --step-6: clamp(2.2rem, 1rem + 4.4vw, 5rem);

  /* ритм */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  --sp-7: clamp(2.5rem, 2rem + 2vw, 3.75rem);
  --sp-8: clamp(3.25rem, 2.4rem + 3.6vw, 5.5rem);
  --sp-9: clamp(4rem, 2.8rem + 5.4vw, 7.5rem);

  /* сетка */
  --wrap: 1280px;
  --gut: clamp(16px, 4vw, 40px);
  --gap: clamp(16px, 4vw, 40px);
  --measure: 68ch;
  --popout-w: 5rem;
  --feature-w: 9rem;
  --rail-w: 14rem;
  --header-h: 64px;
  --radius: 8px;
  --r-card: clamp(16px, 1.2vw + 8px, 24px);
  --r-media: 14px;
  color-scheme: light;
}

/* тёмная тема: слои поверхностей разной светлоты, без теней; акцент — электрический фиолетовый */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e15; --surface: #13161d; --tint: #1e212a; --ink: #f0f2f6; --ink-2: #c8cad1; --muted: #747a8a; --muted-ink: #a6abb8;
    --line: #2f333d; --accent: #9187ff; --accent-ink: #afa9ff; --on-accent: #0c0b1a; --blue: #53b6eb; --green: #5fd37f; --yellow: #edcc48;
    --focus: #afa9ff; --night: #04060a; --cover-bg: #05070f; --cover-ink: #f0f2f6;
    --glow: color-mix(in srgb, var(--accent) 22%, transparent);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .04);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e15; --surface: #13161d; --tint: #1e212a; --ink: #f0f2f6; --ink-2: #c8cad1; --muted: #747a8a; --muted-ink: #a6abb8;
  --line: #2f333d; --accent: #9187ff; --accent-ink: #afa9ff; --on-accent: #0c0b1a; --blue: #53b6eb; --green: #5fd37f; --yellow: #edcc48;
  --focus: #afa9ff; --night: #04060a; --cover-bg: #05070f; --cover-ink: #f0f2f6;
  --glow: color-mix(in srgb, var(--accent) 22%, transparent);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .04);
  color-scheme: dark;
}

/* ================================================================== */
/* База                                                                */
/* ================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.55 var(--sans); overflow-x: hidden;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-feature-settings: "kern";
}
img, svg, iframe { max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
kbd { font: 600 .8em var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: .05em .4em; background: var(--surface); white-space: nowrap; }
button, input, select { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 1px; }
[tabindex="-1"]:focus { outline: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted-ink); font-weight: 400; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }

/* ================================================================== */
/* Шапка-«плашка» и подвал-колофон                                     */
/* ================================================================== */

.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; min-width: 0; }
.logo:hover { color: var(--ink); }
.logo-mark { flex: none; width: 30px; height: 30px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  font: 800 1.1rem/1 var(--display); padding-bottom: 2px; }
.logo-text { font: 700 1.28rem/1.1 var(--display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-text em { font-weight: 500; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { text-decoration: none; font: 600 .72rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); padding: 8px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.theme-toggle, .nav-toggle { background: none; border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; display: inline-grid; place-items: center; cursor: pointer; flex: none; color: var(--ink); }
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--ink); }
.nav-toggle { display: none; border-radius: var(--radius); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; content: ""; transition: transform .2s; }
.nav-toggle-bars::before { position: absolute; top: -5px; }
.nav-toggle-bars::after { position: absolute; top: 5px; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-open .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

/* индикатор прогресса чтения — только на страницах-статьях */
.read-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.read-progress-bar { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.is-reading .read-progress { opacity: 1; }

@media (max-width: 1040px) {
  .header-inner { gap: 10px; }
  .nav-toggle { display: inline-grid; order: 2; }
  .theme-toggle { order: 3; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; gap: 0; padding: 8px var(--gut) 16px; }
  .nav-open .site-nav { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .8rem; }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a[aria-current="page"] { color: var(--accent-ink); border-bottom-color: var(--line); }
}

.site-footer { border-top: 1px solid var(--line); margin-top: var(--sp-9); color: var(--muted-ink); font-size: .88rem; background: var(--bg); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 48px; padding-top: 36px; padding-bottom: 44px; }
.footer-inner p { margin: 0 0 .5em; }
.footer-logo { font: 700 1.5rem/1.1 var(--display); color: var(--ink); }
.footer-logo em { font-weight: 500; }
.footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; align-content: start; }
.footer-nav a { text-decoration: none; color: var(--ink-2); }
.footer-nav a:hover { color: var(--accent-ink); }
.footer-fine { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; font-size: .78rem; }
@media (max-width: 640px) { .footer-inner { grid-template-columns: minmax(0, 1fr); } }

/* ================================================================== */
/* Общие элементы                                                      */
/* ================================================================== */

main { display: block; min-height: 60vh; }
.page { max-width: var(--wrap); margin: 0 auto; padding: var(--sp-7) var(--gut) 0; }
.page-head { max-width: 860px; margin-bottom: var(--sp-6); }
.kicker { font: 600 .72rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 14px; }
.page-title { font-size: var(--step-5); line-height: 1; letter-spacing: -.025em; margin-bottom: 20px; }
.lead { font: 400 var(--step-1)/1.45 var(--body); color: var(--ink-2); max-width: 40em; text-wrap: pretty; }
.prose { max-width: 40em; font-family: var(--body); }
.prose p { margin-bottom: 1.1em; }
.section { margin-top: var(--sp-8); padding-top: var(--sp-4); border-top: 1px solid var(--line); }
.section-title { font-size: var(--step-3); margin-bottom: var(--sp-5); }
.section-count { font: 500 .9rem var(--sans); color: var(--muted-ink); vertical-align: super; letter-spacing: 0; }
.h3 { font-size: var(--step-1); margin-bottom: 10px; }
.note { color: var(--muted-ink); font: 400 1rem/1.5 var(--body); max-width: 46em; margin-top: 16px; }
.meta { color: var(--muted-ink); font-size: .95rem; margin-bottom: 18px; }
.title-en { font: 400 var(--step-1)/1.3 var(--display); color: var(--muted-ink); margin: 8px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag { display: inline-block; font: 500 .74rem/1.5 var(--sans); padding: 2px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink-2); letter-spacing: .01em; }
.tag-wip { border-color: var(--accent); color: var(--accent-ink); }
.tag-link { text-decoration: none; }
.tag-link:hover { border-color: var(--accent); color: var(--accent-ink); }
.list { padding-left: 1.2em; margin: 0; max-width: 46em; }
.list li { margin-bottom: .55em; padding-left: .2em; }
.list li::marker { color: var(--accent); }
.sep { color: var(--muted); }

.empty { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 40px 12px; text-align: center; color: var(--muted-ink); }
.empty-title { font: 700 var(--step-2)/1.2 var(--display); color: var(--ink); margin-bottom: 8px; }
.empty-text { margin: 0 auto; max-width: 34em; font-family: var(--body); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 9px 20px; border-radius: 99px; border: 1px solid var(--line); background: var(--ink); color: var(--bg);
  text-decoration: none; cursor: pointer; font: 600 .84rem/1.2 var(--sans); letter-spacing: .02em; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-play { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-size: .95rem; padding: 11px 28px; }
.btn-play:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-link { font-size: .9rem; }
.ext { color: var(--muted-ink); font-size: .85em; }

/* ================================================================== */
/* Сетка статьи: именованные линии и выносы (breakout)                 */
/* ================================================================== */

.page.article { max-width: none; padding: 0; }
.flow {
  --content: min(var(--measure), 100% - var(--gap) * 2);
  display: grid;
  row-gap: 0;
  font-family: var(--body);
  font-size: var(--step-0);
  grid-template-columns:
    [full-start] minmax(var(--gap), 1fr)
    [feature-start] minmax(0, var(--feature-w))
    [popout-start] minmax(0, var(--popout-w))
    [content-start] var(--content) [content-end]
    minmax(0, var(--popout-w)) [popout-end]
    minmax(0, var(--feature-w)) [feature-end]
    minmax(var(--gap), 1fr) [full-end];
}
.flow > * { grid-column: content; min-width: 0; }
.flow > .w-popout, .asec > .w-popout { grid-column: popout; }
.flow > .w-feature, .asec > .w-feature { grid-column: feature; }
.flow > .w-full { grid-column: full; }

/* разделы статьи — подсетка от feature до правого края (для врезок на полях) */
.asec { grid-column: feature-start / full-end; display: grid; grid-template-columns: subgrid; margin-top: var(--sp-8); scroll-margin-top: calc(var(--header-h) + 16px); }
.asec > * { grid-column: content; min-width: 0; margin-top: 0; margin-bottom: 0; }
.asec > * + * { margin-top: 1.15em; }

/* шапка статьи */
.article-head { padding-top: var(--sp-7); }
.article-head > .crumbs { margin-bottom: var(--sp-5); }
.article-head > .kicker { margin-bottom: var(--sp-4); }
.article-title { grid-column: content-start / popout-end !important; font-size: var(--step-5); line-height: 1.02; letter-spacing: -.025em; font-weight: 700; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.article-head > .title-en { margin-top: var(--sp-3); }
.standfirst { font: 400 var(--step-1)/1.45 var(--body); color: var(--ink-2); margin: var(--sp-5) 0 0; text-wrap: pretty; }
.byline { margin: var(--sp-5) 0 0; padding-top: var(--sp-3); border-top: 1px solid var(--line); font: 600 .72rem/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); }
.article-head > .tags { margin-top: var(--sp-4); }
.crumbs { font: 500 .8rem/1.4 var(--sans); color: var(--muted-ink); margin-bottom: 26px; }
.crumbs a { color: var(--muted-ink); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }

/* герой: кадр без обрезки на размытой подложке, на всю ширину окна */
.article-hero { margin: var(--sp-7) 0 0; }
.hero-frame { position: relative; display: block; width: 100%; padding: clamp(0px, 2vw, 28px) 0; border: 0; background: var(--night); cursor: zoom-in; overflow: hidden; }
.hero-backdrop { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(36px) saturate(1.15) brightness(.5); transform: scale(1.1); }
.hero-frame .shot-hero { position: relative; width: min(100%, calc(min(72vh, 760px) * (var(--ar)))); margin: 0 auto; background: transparent; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.hero-frame:hover .shot-hero { outline: 1px solid rgba(255, 255, 255, .35); }
.hero-cap { font: .8rem/1.5 var(--sans); color: var(--muted-ink); padding-top: var(--sp-3); }
.hero-cap > * { grid-column: content-start / popout-end; }
.hero-cap-text { display: block; color: var(--ink-2); }
.hero-cap-label { font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: .7rem; color: var(--muted-ink); }
.hero-cap .shot-credit { margin-top: 2px; }
.article-hero.is-type { display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 6px; min-height: clamp(220px, 34vw, 420px);
  padding: var(--sp-6) var(--gap); background: var(--cover-bg); color: var(--cover-ink); overflow: hidden; position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-hero.is-type::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(color-mix(in srgb, var(--cover-ink) 8%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--cover-ink) 8%, transparent) 1px, transparent 1px); background-size: 48px 48px; }
.cover-big { position: relative; font: 800 clamp(5rem, 3rem + 14vw, 15rem)/.82 var(--display); letter-spacing: -.04em; color: var(--accent); font-variant-numeric: lining-nums; }
.cover-sub { position: relative; font: 500 var(--step-2)/1.2 var(--display); color: var(--cover-ink); }

/* тело статьи и оглавление */
.article-body { padding-top: var(--sp-4); }
.article-body > .asec:first-of-type { margin-top: var(--sp-7); }
.toc { font-family: var(--sans); font-size: .86rem; margin-top: var(--sp-6); }
.toc-title { display: none; }
.toc-toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; background: none; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font: 600 .74rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; text-align: left; }
.toc-toggle::after { content: "▾"; font-size: 1rem; letter-spacing: 0; transition: transform .2s; }
.toc.is-open .toc-toggle::after { transform: rotate(180deg); }
.toc-count { margin-left: auto; color: var(--muted-ink); font-weight: 500; letter-spacing: 0; }
.toc-list { list-style: none; margin: 0; padding: 8px 0 0; display: none; }
.toc.is-open .toc-list { display: block; }
.toc-link { display: flex; gap: 10px; align-items: baseline; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); color: var(--muted-ink); text-decoration: none; line-height: 1.35; }
.toc-link:hover { color: var(--ink); border-left-color: var(--muted); }
.toc-link[aria-current] { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.toc-num { font: 600 .7rem var(--sans); color: var(--accent-ink); font-variant-numeric: tabular-nums; flex: none; }
.lvl-2 .toc-link { padding-left: 26px; font-size: .8rem; }

@media (min-width: 1280px) {
  .flow.has-toc, .article-head.has-toc ~ .article-hero .hero-cap {
    grid-template-columns:
      [full-start] minmax(calc(var(--rail-w) + var(--gap) * 2), 1fr)
      [feature-start] minmax(0, var(--feature-w))
      [popout-start] minmax(0, var(--popout-w))
      [content-start] var(--content) [content-end]
      minmax(0, var(--popout-w)) [popout-end]
      minmax(0, var(--feature-w)) [feature-end]
      minmax(var(--gap), 1fr) [full-end];
  }
  .article-body.has-toc > .toc { grid-column: full-start / feature-start; grid-row: 1 / span 400; justify-self: end; align-self: start; width: var(--rail-w); margin: var(--sp-7) var(--gap) 0 0;
    position: sticky; top: calc(var(--header-h) + 28px); }
  .article-body.has-toc > .toc-title { display: block; }
  .has-toc > .toc .toc-title { display: block; font: 600 .7rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .has-toc > .toc .toc-toggle { display: none; }
  .has-toc > .toc .toc-list { display: block; padding: 0; max-height: calc(100vh - var(--header-h) - 120px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}

/* разделы: номер, заголовок, лид */
.asec-head { position: relative; padding-top: var(--sp-4); border-top: 1px solid var(--line); margin-bottom: var(--sp-5) !important; }
.asec-num { display: block; font: 700 var(--step-1)/1 var(--display); color: var(--accent); margin-bottom: 10px; font-variant-numeric: lining-nums tabular-nums; }
.asec-title { font-size: var(--step-3); line-height: 1.08; }
.asec-head > .kicker { margin-bottom: 10px; }
.asec-lead { margin: var(--sp-4) 0 0; font: 400 var(--step-1)/1.45 var(--body); color: var(--ink-2); text-wrap: pretty; }
@media (min-width: 1024px) {
  .asec-num { position: absolute; right: calc(100% + 1.25rem); top: calc(var(--sp-4) - .05em); margin: 0; font-size: var(--step-3); color: var(--muted); }
  .asec-head > .kicker + .asec-title { margin-top: 0; }
}

/* основной текст */
.body-p { margin: 0; line-height: 1.66; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; font-variant-numeric: oldstyle-nums proportional-nums; hanging-punctuation: first allow-end; }
.body-p + .body-p { margin-top: 1em !important; }
.has-dropcap::first-letter { float: left; font: 700 4.15em/.8 var(--display); margin: .07em .09em 0 -.02em; color: var(--accent-ink); }
@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .has-dropcap::first-letter { float: none; -webkit-initial-letter: 3; initial-letter: 3; font-size: inherit; line-height: inherit; margin: 0 .1em 0 0; }
}

/* выносная цитата */
.pullquote { margin: var(--sp-6) 0 !important; padding: var(--sp-5) 0 var(--sp-4); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pullquote blockquote { margin: 0; }
.pullquote p { margin: 0; font: 500 var(--step-2)/1.25 var(--display); text-wrap: balance; color: var(--ink); }
.pullquote p::before { content: "«"; margin-left: -.5em; display: inline-block; width: .5em; color: var(--accent); }
.pullquote p::after { content: "»"; color: var(--accent); }
.pullquote figcaption { margin-top: var(--sp-3); font: 600 .7rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-ink); }
@media (max-width: 720px) { .pullquote p::before { margin-left: 0; width: auto; } }

/* рисунки с подписями */
.fig { margin: var(--sp-6) 0 var(--sp-4) !important; }
.fig + .fig { margin-top: var(--sp-5) !important; }
.fig-cap { margin-top: var(--sp-3); padding-top: var(--sp-2); border-top: 1px solid var(--line); font: .8rem/1.5 var(--sans); color: var(--muted-ink); max-width: 62ch; text-wrap: pretty; }
.fig-num { font-weight: 700; color: var(--ink); }

/* врезка-справка */
.factbox { background: var(--tint); padding: var(--sp-5) clamp(16px, 3vw, 32px) var(--sp-5); border-top: 0; font: .95rem/1.5 var(--sans); color: var(--ink-2); }
.factbox-kicker { font: 700 .7rem/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 0 0 var(--sp-3); }
.factbox-kicker:not(:first-child) { margin-top: var(--sp-5); }
.factbox-list { margin: 0; padding: 0; list-style: none; counter-reset: fb; }
.factbox-list li { counter-increment: fb; position: relative; padding: 10px 0 10px 2.4em; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.factbox-list li:first-child { border-top: 0; padding-top: 0; }
ol.factbox-list li::before { content: counter(fb, decimal-leading-zero); position: absolute; left: 0; top: 10px; font: 700 .78rem/1.5 var(--sans); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
ol.factbox-list li:first-child::before { top: 0; }
ul.factbox-list li { padding-left: 1.1em; }
ul.factbox-list li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 6px; height: 6px; background: var(--accent); }
ul.factbox-list li:first-child::before { top: .55em; }

/* двухколоночные блоки: вариации и ошибки */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-6); margin: 0; padding: 0; list-style: none; }
.var { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.var-title { font-size: var(--step-1); margin-bottom: 6px; }
.var p { margin: 0; color: var(--ink-2); font-size: .92em; line-height: 1.55; hyphens: auto; }
.duo-list { counter-reset: pit; }
.duo-list li { counter-increment: pit; border-top: 1px solid var(--line); padding-top: var(--sp-3); font-size: .92em; line-height: 1.55; color: var(--ink-2); hyphens: auto; }
.duo-list li::before { content: "✕ " counter(pit, decimal-leading-zero); display: block; font: 700 .72rem/1.4 var(--sans); letter-spacing: .1em; color: var(--accent-ink); margin-bottom: 6px; }
@media (max-width: 640px) { .duo { grid-template-columns: minmax(0, 1fr); } }

/* хроника истории: годы на полях */
.vtl { list-style: none; margin: 0; padding: 0; position: relative; font-size: .95em; }
.vtl-item { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0 var(--sp-5); padding: 14px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 24px); }
.vtl-item.has-shot { grid-template-columns: 5.5rem minmax(0, 1fr) auto; }
.vtl-year { font: 700 var(--step-1)/1.1 var(--display); text-align: right; color: var(--accent-ink); font-variant-numeric: lining-nums tabular-nums; }
.vtl-body p { margin: 0; color: var(--ink-2); line-height: 1.55; }
.vtl-body .vtl-game { font: 700 1.05em/1.3 var(--display); color: var(--ink); margin-bottom: 2px; }
.vtl-item.is-flash .vtl-body { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.legend { font: .78rem/1.5 var(--sans); color: var(--muted-ink); margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 520px) {
  .vtl-item, .vtl-item.has-shot { grid-template-columns: minmax(0, 1fr) auto; }
  .vtl-year { grid-column: 1 / -1; text-align: left; margin-bottom: 4px; }
}
.conf { display: inline-flex; vertical-align: middle; }
.conf-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--accent); }
.conf-high .conf-dot { background: var(--accent); }
.conf-medium .conf-dot { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.conf-low .conf-dot { background: transparent; border-style: dashed; border-color: var(--muted); }

/* библиография */
.src-list { list-style: none; padding: 0; margin: 0; font: .86rem/1.5 var(--sans); }
.src-list li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 2px 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.src-type { font: 600 .68rem/1.9 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); }
.src-main { color: var(--ink); }
.src-note { grid-column: 2; color: var(--muted-ink); font-size: .82rem; }
@media (max-width: 520px) { .src-list li { grid-template-columns: minmax(0, 1fr); } .src-note { grid-column: 1; } }

/* «Читать дальше» */
.pager { grid-column: content-start / popout-end !important; display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); margin-top: var(--sp-9); padding-top: var(--sp-4); border-top: 1px solid var(--line); font-family: var(--sans); }
.page:not(.article) .pager { margin-top: var(--sp-8); }
.pager-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; min-width: 0; }
.pager-next { text-align: right; }
.pager-dir { font: 600 .7rem/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.pager-title { font: 700 var(--step-2)/1.15 var(--display); color: var(--ink); text-wrap: balance; }
.pager-text { font: .86rem/1.45 var(--body); color: var(--muted-ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pager-link:hover .pager-title { color: var(--accent-ink); }

/* ================================================================== */
/* Плеер прототипов                                                    */
/* ================================================================== */

.player { border: 1px solid var(--line); overflow: hidden; background: var(--surface); font-family: var(--sans); font-size: 1rem; }
.player-stage { position: relative; aspect-ratio: 16 / 9; background: var(--surface); }
.player-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #f6f5f1; }
.plate { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 16px; padding: clamp(16px, 4vw, 44px); overflow: auto;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; background-position: -1px -1px; }
.plate::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, var(--surface) 35%, color-mix(in srgb, var(--surface) 70%, transparent)); pointer-events: none; }
.plate > * { position: relative; }
.plate-body { max-width: 660px; }
.plate-goal { font: 700 clamp(1.2rem, 2.6vw, 1.9rem)/1.2 var(--display); margin-bottom: 14px; text-wrap: balance; }
.plate-note { font-size: .88rem; color: var(--muted-ink); margin: 8px 0 0; }
.controls { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.control { display: flex; gap: 8px; align-items: baseline; font-size: .88rem; }
.control dd { margin: 0; color: var(--ink-2); }
.player-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: .85rem; }
.player-status { color: var(--muted-ink); }
.player-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.player-actions .btn { min-height: 34px; padding: 5px 14px; font-size: .8rem; }
@media (max-width: 560px) { .player-stage:not(.is-playing) { aspect-ratio: auto; } .player-stage:not(.is-playing) .plate { position: relative; inset: auto; min-height: 240px; } }
.player-demo .player-stage.is-playing { aspect-ratio: auto; height: clamp(460px, 78vh, 760px); }
@media (max-width: 560px) { .player-demo .player-stage.is-playing { height: clamp(480px, 82vh, 720px); } }

/* ================================================================== */
/* Визуализации статьи механики                                        */
/* ================================================================== */

/* игровой цикл */
.loop-viz { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px 44px; align-items: center; font-family: var(--sans); }
.loop-fig { max-width: 300px; width: 100%; margin: 0 auto; }
.loop-svg { display: block; width: 100%; height: auto; overflow: visible; }
.loop-ring { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.loop-arc { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.loop-arrowhead { fill: var(--accent); }
.loop-center { font: 700 44px var(--display); fill: var(--accent); }
.loop-center-sub { font: 13px var(--sans); fill: var(--muted-ink); }
.loop-node circle { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; transition: fill .15s; }
.loop-node text { font: 700 17px var(--display); fill: var(--ink); pointer-events: none; }
.loop-node { cursor: default; outline: none; }
.loop-node.is-hl circle, .loop-node:focus-visible circle { fill: var(--accent); stroke: var(--accent); }
.loop-node.is-hl text, .loop-node:focus-visible text { fill: var(--on-accent); }
.loop-node:focus-visible circle { stroke-width: 4; stroke: var(--ink); }
.loop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: .95rem; line-height: 1.45; }
.loop-list li { display: flex; gap: 14px; align-items: baseline; padding: 10px 6px; border-top: 1px solid var(--line); transition: background-color .15s; }
.loop-list li:first-child { border-top-color: var(--ink); }
.loop-list li.is-hl { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.loop-list li:last-child::after { content: "↻ к шагу 1"; margin-left: auto; padding-left: 8px; color: var(--accent-ink); font-size: .78rem; white-space: nowrap; }
.loop-n { flex: none; font: 700 1.1rem/1 var(--display); color: var(--accent-ink); min-width: 1.2em; }
@media (max-width: 720px) { .loop-viz { grid-template-columns: minmax(0, 1fr); } .loop-fig { max-width: 240px; } }

/* мини-шкала истории */
.mtl-wrap { margin: 0; font-family: var(--sans); }
.mtl { position: relative; padding: 0 12px; }
.mtl-plot { position: relative; height: calc(var(--lanes, 1) * 20px + 22px); }
.mtl-line { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1.5px solid var(--ink); }
.mtl-pt { position: absolute; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; padding: 0; border: 2px solid var(--accent); background: var(--accent); cursor: pointer; transition: transform .12s; }
.mtl-medium, .mtl-key.mtl-medium { background: color-mix(in srgb, var(--accent) 40%, var(--bg)); }
.mtl-low, .mtl-key.mtl-low { background: var(--bg); border-style: dashed; border-color: var(--muted); }
.mtl-pt:hover, .mtl-pt:focus-visible { transform: scale(1.35); z-index: 3; }
.mtl-axis { position: relative; height: 22px; }
.mtl-tick { position: absolute; top: 3px; transform: translateX(-50%); font: .7rem var(--sans); color: var(--muted-ink); font-variant-numeric: tabular-nums; }
.mtl-tick::before { content: ""; position: absolute; left: 50%; top: -4px; height: 4px; border-left: 1px solid var(--line); }
.mtl-tip { position: absolute; top: 100%; z-index: 10; width: min(300px, 80vw); background: var(--bg); border: 1px solid var(--line); padding: 10px 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .2); display: flex; flex-direction: column; gap: 2px; font-size: .84rem; pointer-events: none; }
.mtl-tip[hidden] { display: none; }
.mtl-tip.is-mid { transform: translateX(-50%); }
.mtl-tip.is-right { transform: translateX(-100%); }
.mtl-tip .shot { margin-bottom: 6px; max-height: 150px; }
.mtl-tip-year { font: 700 .9rem var(--display); color: var(--accent-ink); }
.mtl-tip-game { font: 700 1rem var(--display); }
.mtl-tip-text { color: var(--ink-2); line-height: 1.4; font-family: var(--body); }
.mtl-tip-conf { color: var(--muted-ink); font-size: .76rem; margin-top: 2px; }
.mtl-key { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--accent); background: var(--accent); }
.mtl-wrap > .legend { padding: 0 12px; }

/* граф-звезда связанных механик */
.star-wrap { margin: 0; }
.star { display: block; width: 100%; max-width: 600px; height: auto; margin: 0 auto; overflow: visible; }
.star-edge { stroke: var(--line); stroke-width: 1.5; }
.star-center { fill: var(--accent); }
.star-center-label { font: 700 15px var(--display); fill: var(--ink); }
.star-node circle { fill: var(--bg); stroke: var(--ink); stroke-width: 1.5; }
.star-node text { font: 13px var(--sans); fill: var(--ink-2); }
.star-node:hover circle, .star-node:focus-visible circle { fill: var(--accent); stroke: var(--accent); }
.star-node:hover text, .star-node:focus-visible text { fill: var(--accent-ink); text-decoration: underline; }
.star-node:focus-visible { outline: none; }
.star-node:focus-visible circle { stroke: var(--ink); stroke-width: 3; }

/* референсы: инструменты, гистограмма, таблица */
.refs-block { font-family: var(--sans); font-size: 1rem; }
.refs-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 18px; }
.refs-tools .chipbar { margin-bottom: 0; }
.dec-chart { margin: 0; min-width: 0; padding-bottom: 18px; }
.dec-cap { font: 600 .7rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-ink); margin-bottom: 8px; }
.dec-bars { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 4px; height: 92px; border-bottom: 1px solid var(--line); }
.dec-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 34px; position: relative; }
.dec-bar { display: block; width: 18px; height: calc(var(--h, 0%) * .7); min-height: 1px; background: var(--accent); }
.dec-n { font: .7rem var(--sans); color: var(--ink-2); line-height: 1.2; font-variant-numeric: tabular-nums; }
.dec-l { position: absolute; top: 100%; font: .66rem var(--sans); color: var(--muted-ink); padding-top: 3px; white-space: nowrap; }
@media (max-width: 400px) { .dec-col { width: 26px; } .dec-bar { width: 14px; } }

.table-wrap { overflow-x: auto; }
.refs { width: 100%; border-collapse: collapse; font: .9rem/1.45 var(--sans); font-variant-numeric: tabular-nums; }
.refs th { text-align: left; font: 600 .68rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-ink); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.refs td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.refs tbody tr:hover { background: color-mix(in srgb, var(--tint) 60%, transparent); }
.td-year { font: 700 1rem var(--display); white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.td-title { font: 700 1.02rem/1.3 var(--display); }
.td-title a { text-decoration: none; }
.td-title a:hover { text-decoration: underline; }
.td-note { color: var(--ink-2); min-width: 16em; font-family: var(--body); font-size: .88rem; line-height: 1.5; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.th-sort:hover { color: var(--accent-ink); }
.refs td.td-shot { width: 108px; padding-right: 12px; }
.th-shot { width: 108px; }
.td-shot .shot-none { width: 96px; }
@media (max-width: 720px) {
  .refs thead tr { display: flex; } .refs thead th:not(:first-child) { display: none; } .refs thead th { border: 0; }
  .refs, .refs tbody, .refs tr, .refs td { display: block; width: 100%; }
  .refs tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .refs td { border: 0; padding: 1px 0; min-width: 0; }
  .refs td.td-title { font-size: 1.08rem; }
  .refs td:not(.td-title):not(.td-year):not(.td-note)::before { content: attr(data-label) ": "; color: var(--muted-ink); }
  .refs td.td-note { margin-top: 4px; }
  .refs thead th.th-shot { display: none; }
  .refs thead th.th-year { display: block; }
  .refs tbody tr { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 14px; }
  .refs td.td-shot { grid-row: 1 / span 5; width: auto; padding: 2px 0; }
  .refs td:not(.td-shot) { grid-column: 2; }
  .refs td.td-shot .shot-none { width: 96px; white-space: normal; text-align: center; }
}

/* ================================================================== */
/* Кадры, полосы, галереи, лайтбокс                                    */
/* ================================================================== */

.shot { position: relative; display: block; aspect-ratio: var(--ar, 16 / 9); background: color-mix(in srgb, var(--line) 55%, var(--surface)); overflow: hidden; }
.shot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.shot.is-pixel img, .lb-frame.is-pixel img { image-rendering: pixelated; }
.shot.is-broken img { visibility: hidden; }
.shot.is-broken::after { content: "кадр недоступен"; position: absolute; inset: 0; display: grid; place-items: center; font: .72rem var(--sans); color: var(--muted-ink); }
.shot-cover { aspect-ratio: 16 / 9; }
.shot-cover img { object-fit: cover; }
.shot-none { display: inline-flex; align-items: center; justify-content: center; font: .72rem var(--sans); color: var(--muted-ink); border: 1px dashed var(--line); padding: 2px 8px; white-space: nowrap; min-height: 28px; }
.shot-credit { font: .74rem/1.45 var(--sans); color: var(--muted-ink); margin: 8px 0 0; }
.shot-credit a { color: inherit; }

.thumb { position: relative; display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 96px; overflow: hidden; }
.thumb:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.thumb-badge { position: absolute; right: 3px; bottom: 3px; font: 600 .68rem/1 var(--sans); background: rgba(0, 0, 0, .72); color: #fff; padding: 3px 5px; }
.thumb-card { width: 100%; }
.thumb-vtl { width: 92px; margin-top: 2px; }

.strip { list-style: none; margin: 0; padding: 0 0 8px; display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin; font-family: var(--sans); }
.strip > li { flex: none; scroll-snap-align: start; }
.strip-btn { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; max-width: 300px; color: inherit; }
.strip-btn .shot { height: 150px; width: auto; }
.strip-btn:hover .shot { outline: 2px solid var(--accent); outline-offset: 1px; }
.strip-cap { font: .76rem/1.3 var(--sans); color: var(--ink-2); max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .strip-btn .shot { height: 108px; } }
.more-link { margin: 0; font-size: .9rem; }

.lb-open, .lb-open body { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 1000; background: rgba(10, 10, 9, .97); color: #f2f1ec; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; padding: 10px clamp(10px, 3vw, 28px) 14px; font-family: var(--sans); }
.lb-top { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.lb-title { font: 700 clamp(1rem, 2.4vw, 1.35rem) var(--display); margin: 0 auto 0 0; color: #fff; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-count { font: .82rem var(--sans); color: #bdbab2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-btn { min-width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .35); color: #fff; font-size: 1.15rem; cursor: pointer; }
.lb-btn:hover { background: var(--accent); border-color: var(--accent); color: #111; }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-stage { display: grid; place-items: center; min-height: 0; padding: 8px 0; }
.lb-frame { position: relative; aspect-ratio: var(--ar); width: min(100%, calc((100vh - 230px) * var(--arn, 1.777))); max-height: 100%; }
.lb-frame img { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.lb-nav { display: flex; justify-content: center; gap: 14px; padding: 4px 0; }
.lb-cap { font-size: .86rem; color: #d6d3cb; max-width: 900px; margin: 0 auto; width: 100%; max-height: 26vh; overflow: auto; }
.lb-cap .shot-credit { color: #bdbab2; }
.lb-cap a { color: #fff; }
.lb-text { margin: 4px 0; font-family: var(--body); }
.lb .mk-badge { width: 26px; height: 26px; font-size: .85rem; line-height: 22px; }
@media (max-width: 560px) { .lb-frame { width: min(100%, calc((100vh - 290px) * var(--arn, 1.777))); } }

/* размеченные кадры приёмов */
.tfig { margin: 0; min-width: 0; font-family: var(--sans); }
.tfig-frame { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: zoom-in; aspect-ratio: var(--ar); }
.tfig-frame .shot-fill { position: absolute; inset: 0; aspect-ratio: auto; background: #000; }
.mk-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.mk-layer .mk { pointer-events: visiblePainted; transition: opacity .15s; }
.mk-halo, .mk-line { fill: none; vector-effect: non-scaling-stroke; }
.mk-halo { stroke: rgba(0, 0, 0, .8); stroke-width: 6px; }
.mk-line { stroke: var(--accent); stroke-width: 3px; }
.mk-head { fill: var(--accent); }
.mk-head-halo { fill: rgba(0, 0, 0, .8); stroke: rgba(0, 0, 0, .8); stroke-width: 6px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mk.is-hl .mk-line { stroke-width: 5px; stroke: #ffd23f; }
.mk.is-hl .mk-head { fill: #ffd23f; }
.has-hl .mk:not(.is-hl) { opacity: .3; }
.mk-badges { position: absolute; inset: 0; pointer-events: none; }
.mk-badge { position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #111; border: 2px solid #111; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); font: 700 .76rem/20px var(--sans); text-align: center; pointer-events: auto; transition: transform .15s; }
.mk-badge.is-hl { background: #ffd23f; transform: translate(-50%, -50%) scale(1.25); }
.has-hl .mk-badge:not(.is-hl) { opacity: .45; }
.tfig-cap { display: block; font-size: .84rem; color: var(--ink-2); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.tfig-title { font: 700 1rem var(--display); color: var(--ink); }
.tfig-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: .84rem; }
.tfig-legend li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 6px; margin: 0 -6px; cursor: default; }
.tfig-legend li.is-hl, .tfig-legend li:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.mk-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #111; border: 1.5px solid #111; font: 700 .68rem/17px var(--sans); text-align: center; margin-top: 1px; }
.tfig-legend-lb { color: #e9e7e1; }
.tfig-legend-lb li:hover { background: transparent; }

/* ================================================================== */
/* Карточки: без «коробок», на тонких линейках                         */
/* ================================================================== */

.grid { display: grid; gap: var(--sp-6) var(--sp-5); }
.grid > * { min-width: 0; }
.grid-cards, .grid-rel { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.grid-comb, .grid-src, .grid-links { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-play { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

.card { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-3) 0 0; border-top: 1px solid var(--line); text-decoration: none; position: relative; font-family: var(--sans); }
a.card:hover { color: var(--ink); }
a.card:hover .card-title { color: var(--accent-ink); }
.card-num { font: 700 .74rem var(--sans); color: var(--accent-ink); letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.card-title { font: 700 var(--step-1)/1.15 var(--display); text-wrap: balance; }
.card-en { font: 400 1rem var(--display); color: var(--muted-ink); }
.card-text { color: var(--ink-2); font: .92rem/1.5 var(--body); }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: .76rem; color: var(--muted-ink); letter-spacing: .02em; }
.card-year { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.card-static, .comb, .links-group, .playcard { padding: var(--sp-3) 0 0; border-top: 1px solid var(--line); }
.mech-card.is-wip .card-title { color: var(--ink-2); }
.mech-thumb { display: block; position: relative; margin-bottom: 8px; }
.mech-thumb-cap { position: absolute; left: 0; bottom: 0; font: .66rem/1.4 var(--sans); background: rgba(0, 0, 0, .7); color: #fff; padding: 2px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================================================================== */
/* Главная — обложка номера                                            */
/* ================================================================== */

.page-home { padding-top: var(--sp-6); }
.cover { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--sp-7); align-items: end; padding-bottom: var(--sp-6); border-bottom: 1px solid var(--line); }
.cover-title { font-size: var(--step-6); line-height: .92; letter-spacing: -.035em; font-weight: 800; margin: 0 0 var(--sp-5); }
.cover-l1 { display: block; }
.cover-l2 { display: block; font-weight: 500; letter-spacing: -.025em; color: var(--accent-ink); }
.cover-lead { font: 400 var(--step-1)/1.45 var(--body); color: var(--ink-2); max-width: 30em; margin: 0 0 var(--sp-5); text-wrap: pretty; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.mosaic { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: clamp(84px, 10.5vw, 170px); gap: 6px; }
.mosaic-item { min-width: 0; grid-column: span 3; }
.mosaic-item:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.mosaic-item:nth-child(2), .mosaic-item:nth-child(3) { grid-column: span 2; }
.mosaic-3 .mosaic-item:nth-child(n+2) { grid-column: span 2; }
.mosaic-btn { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--night); cursor: zoom-in; overflow: hidden; color: #fff; text-align: left; }
.mosaic-btn .shot { aspect-ratio: auto; height: 100%; transition: transform .5s ease; }
.mosaic-btn:hover .shot { transform: scale(1.03); }
.mosaic-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; background: linear-gradient(transparent, rgba(0, 0, 0, .78)); font: .7rem/1.3 var(--sans); display: flex; flex-direction: column; }
.mosaic-game { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mosaic-mech { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mosaic-item:not(:first-child) .mosaic-mech { display: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 0; margin: 0; }
.stat { padding: var(--sp-5) var(--sp-4) var(--sp-5) 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: var(--sp-5); }
.stat-num { font: 800 var(--step-5)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: lining-nums; }
.stat-label { margin: 6px 0 0; font: 600 .72rem/1.35 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); }
.stat-link { text-decoration: none; }
.stat-link:hover { color: var(--accent-ink); }

.hsec { margin-top: var(--sp-8); }
.hsec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; border-top: 1px solid var(--line); padding-top: var(--sp-3); margin-bottom: var(--sp-5); }
.hsec-title { font-size: var(--step-3); }
.hsec-more { font: 600 .74rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--accent-ink); }
.hsec-more:hover { text-decoration: underline; }

/* рубрики номера — асимметричная редакционная сетка */
.rubrics { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-6) var(--sp-5); }
.rubric { position: relative; display: flex; flex-direction: column; gap: 6px; grid-column: span 3; padding-top: var(--sp-3); border-top: 1px solid var(--line); text-decoration: none; font-family: var(--sans); min-width: 0; }
.rubric.r-1 { grid-column: span 7; grid-row: span 2; }
.rubric.r-2, .rubric.r-3 { grid-column: span 5; }
.rubric:hover { color: var(--ink); }
.rubric:hover .rubric-title { color: var(--accent-ink); }
.rubric-shot { display: block; margin-bottom: 10px; overflow: hidden; background: var(--night); }
.rubric-shot .shot { transition: transform .5s ease; }
.rubric:hover .rubric-shot .shot { transform: scale(1.025); }
.r-1 .rubric-shot .shot { aspect-ratio: 3 / 2; }
.rubric-num { position: absolute; right: 0; top: var(--sp-3); font: 700 .74rem var(--sans); color: var(--muted-ink); font-variant-numeric: tabular-nums; }
.rubric.has-shot .rubric-num { top: calc(var(--sp-3) + 8px); right: 8px; color: #fff; background: rgba(0, 0, 0, .55); padding: 2px 6px; }
.rubric .kicker { margin: 4px 0 0; }
.rubric-title { font: 700 var(--step-2)/1.08 var(--display); }
.r-1 .rubric-title { font-size: var(--step-4); letter-spacing: -.02em; }
.rubric-text { font: 1rem/1.5 var(--body); color: var(--ink-2); max-width: 36em; text-wrap: pretty; }
.r-1 .rubric-text { font-size: var(--step-0); }
.rubric-cap { font: .72rem var(--sans); color: var(--muted-ink); }
.r-2 .rubric-shot .shot, .r-3 .rubric-shot .shot { aspect-ratio: 21 / 9; }

/* содержание с отточиями */
.contents { list-style: none; margin: 0; padding: 0; columns: 2 340px; column-gap: var(--sp-7); }
.contents li { break-inside: avoid; }
.contents-link { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.contents-num { font: 700 .78rem var(--sans); color: var(--accent-ink); font-variant-numeric: tabular-nums; flex: none; }
.contents-title { font: 700 1.1rem/1.25 var(--display); }
.contents-dots { flex: 1; min-width: 20px; border-bottom: 1px dotted var(--muted); transform: translateY(-4px); }
.contents-cat { font: .76rem var(--sans); color: var(--muted-ink); white-space: nowrap; }
.contents-link:hover .contents-title { color: var(--accent-ink); }

/* мини-таймлайн */
.mini-tl { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(124px, 1fr); gap: 0; text-decoration: none; border-bottom: 1px solid var(--line); overflow-x: auto; font-family: var(--sans); }
.mini-col { display: flex; flex-direction: column; justify-content: flex-end; padding: 0 12px 14px; min-height: 200px; border-left: 1px solid var(--line); }
.mini-col:first-child { border-left: 0; padding-left: 0; }
.mini-bar { display: block; width: 12px; height: calc(var(--h, 10%) * 0.9); min-height: 6px; background: var(--accent); margin-bottom: auto; align-self: flex-start; max-height: 90px; }
.mini-label { font: 700 1.3rem var(--display); margin-top: 12px; font-variant-numeric: lining-nums; }
.mini-count { font-size: .76rem; color: var(--muted-ink); }
.mini-ev { font: .78rem/1.35 var(--body); color: var(--ink-2); margin-top: 4px; }
.mini-tl:hover .mini-label { color: var(--accent-ink); }

.cat-index { list-style: none; margin: 0; padding: 0; columns: 4 200px; column-gap: var(--sp-6); }
.cat-index li { break-inside: avoid; }
.cat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.cat-title { font: 700 1.02rem var(--display); }
.cat-count { font: 600 .78rem var(--sans); color: var(--muted-ink); font-variant-numeric: tabular-nums; }
.cat:hover .cat-title { color: var(--accent-ink); }

@media (max-width: 960px) {
  .cover { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
  .rubric.r-1 { grid-column: span 12; grid-row: auto; }
  .rubric.r-2, .rubric.r-3 { grid-column: span 6; }
  .rubric { grid-column: span 6; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .rubric, .rubric.r-2, .rubric.r-3 { grid-column: span 12; }
  .mosaic { grid-auto-rows: 86px; }
}

/* ================================================================== */
/* Каталог механик — журнальный индекс                                 */
/* ================================================================== */

.filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: var(--sp-4); padding: var(--sp-4) 0 var(--sp-5); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--sans); }
.filters-row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.filters-chips { gap: 10px 28px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 160px; }
.field-search { flex: 3 1 260px; }
.field-chips { flex: 0 1 auto; }
.field-label { font: 600 .68rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-ink); }
.field input, .field select { width: 100%; min-height: 42px; padding: 8px 2px; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; background: transparent; font-size: 1rem; }
.field select { padding-right: 24px; cursor: pointer; }
.field select option { background: var(--bg); color: var(--ink); }
.field input:hover, .field select:hover { border-bottom-color: var(--accent); }
.field input:focus-visible, .field select:focus-visible { outline: none; border-bottom-color: var(--accent); box-shadow: 0 2px 0 var(--accent); }
.btn-reset { flex: none; }
.result-count { color: var(--muted-ink); font: .82rem var(--sans); margin: 0 0 var(--sp-4); }
.chipbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.field .chipbar { margin-bottom: 0; }
.fchip { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 4px 13px; font: 500 .8rem/1.3 var(--sans); cursor: pointer; min-height: 32px; }
.fchip:hover { border-color: var(--ink); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.mindex { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.mrow { border-top: 1px solid var(--line); }
.mrow:first-child { border-top-color: var(--ink); }
.mrow-link { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) clamp(140px, 18vw, 240px); gap: var(--sp-5); padding: var(--sp-5) 0; text-decoration: none; align-items: start; }
.mrow-link:hover { color: var(--ink); }
.mrow-link:hover .mrow-title { color: var(--accent-ink); }
.mrow-num { font: 700 var(--step-3)/.9 var(--display); color: var(--muted); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; }
.mrow-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mrow-kicker { font: 600 .68rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
.mrow-title { font: 700 var(--step-2)/1.1 var(--display); text-wrap: balance; }
.mrow-en { font: 400 1rem var(--display); color: var(--muted-ink); }
.mrow-text { font: 1rem/1.55 var(--body); color: var(--ink-2); max-width: 40em; margin-top: 4px; text-wrap: pretty; }
.mrow-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mrow-side .mech-thumb { margin: 0; }
.mrow-ph { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--tint); font: 700 2.4rem var(--display); color: var(--muted); }
.mrow-year { font: 600 .72rem var(--sans); color: var(--muted-ink); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.mrow.is-wip .mrow-title { color: var(--ink-2); }
.mrow .tag-wip { align-self: flex-start; margin-top: 6px; }
@media (max-width: 720px) {
  .mrow-link { grid-template-columns: 2.6rem minmax(0, 1fr) 96px; gap: 12px; padding: var(--sp-4) 0; }
  .mrow-num { font-size: 1.5rem; }
  .mrow-title { font-size: 1.25rem; }
  .mrow-text { font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .mrow-side .mech-thumb-cap { display: none; }
}

/* ================================================================== */
/* Таймлайн — хроника                                                  */
/* ================================================================== */

.tl-track { display: block; font-family: var(--sans); }
.tl-dec { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 0 var(--sp-6); border-top: 1px solid var(--line); padding: var(--sp-3) 0 var(--sp-6); }
.tl-dec-title { font: 800 var(--step-4)/1 var(--display); letter-spacing: -.03em; display: flex; flex-direction: column; gap: 6px; align-self: start; position: sticky; top: calc(var(--header-h) + 16px); font-variant-numeric: lining-nums; }
.tl-dec-count { font: 600 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); }
.tl-dec > .tl-dec-title { grid-column: 1; grid-row: 1 / span 400; }
.tl-dec > .tl-year { grid-column: 2; }
.tl-year { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.tl-year:first-of-type { border-top: 0; }
.tl-year-n { font: 700 1.25rem/1.2 var(--display); color: var(--accent-ink); font-variant-numeric: lining-nums tabular-nums; }
.tl-events { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px 24px; }
.tl-ev { display: flex; flex-direction: column; text-decoration: none; font-size: .86rem; line-height: 1.4; padding: 4px 6px; margin: -4px -6px; }
a.tl-ev:hover { background: color-mix(in srgb, var(--tint) 70%, transparent); color: var(--ink); }
a.tl-ev:hover .tl-mech { color: var(--accent-ink); }
.tl-game { font: 700 1rem/1.3 var(--display); }
.tl-mech { color: var(--ink-2); font-weight: 600; font-size: .8rem; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: .2em; }
.tl-text { color: var(--muted-ink); font: .84rem/1.45 var(--body); }
@media (max-width: 760px) {
  .tl-dec { grid-template-columns: minmax(0, 1fr); }
  .tl-dec > .tl-dec-title { grid-row: auto; }
  .tl-dec > .tl-year { grid-column: 1; }
  .tl-dec-title { flex-direction: row; align-items: baseline; gap: 12px; padding: 8px 0; background: var(--bg); z-index: 2; }
}

/* ================================================================== */
/* Эволюция                                                            */
/* ================================================================== */

.lineage { margin-top: var(--sp-6) !important; font-family: var(--sans); }
.lineage > .h3 { font-size: var(--step-2); }
.lineage > .chips { margin: 4px 0 16px; }
.chain { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
.chain-step { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 16px 0; position: relative; min-width: 0; }
.chain-step::before { content: ""; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.chain-step + .chain-step { padding-left: 18px; border-left: 1px solid var(--line); }
.chain-step + .chain-step::before { left: 18px; }
.chain-year { font: 700 1.1rem var(--display); color: var(--accent-ink); padding-top: 6px; font-variant-numeric: lining-nums; }
.chain-game { font: 700 1.05rem/1.25 var(--display); }
.chain-text { color: var(--ink-2); font: .88rem/1.5 var(--body); }
@media (max-width: 720px) {
  .chain { grid-auto-flow: row; border-top: 0; border-left: 1px solid var(--line); }
  .chain-step, .chain-step + .chain-step { padding: 4px 0 18px 20px; border-left: 0; }
  .chain-step::before, .chain-step + .chain-step::before { left: -5px; top: 12px; }
}
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; font: 500 .78rem/1.5 var(--sans); padding: 2px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
a.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.is-missing { color: var(--muted-ink); }
.comb { font: .92rem/1.55 var(--body); }
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-family: var(--sans); }
.op { color: var(--accent); font-weight: 700; font-family: var(--sans); }
.result { font: 700 1.3rem/1.2 var(--display); }
.kv { font-size: .9rem; color: var(--ink-2); margin-bottom: .6em; }
.kv .k { display: block; font: 600 .66rem/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-ink); }
.comb p:last-child { margin-bottom: 0; }
.graph-wrap { margin: 0; font-family: var(--sans); }
.graph { display: block; width: 100%; max-width: 820px; height: auto; margin: 0 auto; overflow: visible; touch-action: manipulation; }
.edge { fill: none; stroke-width: 1.1; opacity: .5; transition: opacity .15s, stroke-width .15s; }
.edge-influence { stroke: var(--accent); }
.edge-similarity { stroke: var(--blue); stroke-dasharray: 4 3; }
.edge-combination { stroke: var(--green); }
.edge-other { stroke: var(--muted); }
.graph.has-sel .edge { opacity: .07; }
.graph.has-sel .edge.is-on { opacity: 1; stroke-width: 2.2; }
.sector-arc { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; opacity: .55; }
.sector-arc.is-alt { stroke: var(--ink-2); opacity: .3; }
.sector-arc.is-cur { stroke: var(--accent); opacity: 1; }
.sector-label { font: 600 11px var(--sans); fill: var(--muted-ink); letter-spacing: .02em; transition: opacity .15s; }
.graph.has-sel .sector-label, .graph:has(.gnode:hover) .sector-label { opacity: 0; }
.gnode { cursor: pointer; outline: none; }
.node-hit { fill: transparent; }
.node { fill: var(--ink); transition: fill .15s; }
.gnode.is-lone .node { fill: var(--muted); }
.node-label { font: 600 12px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; display: none; pointer-events: none; }
.gnode:hover .node-label-out, .gnode:focus-visible .node-label-out, .gnode.is-sel .node-label-out, .gnode.is-nb .node-label-out { display: inline; }
.graph.has-sel .gnode .node { fill: var(--muted); opacity: .45; }
.graph.has-sel .gnode.is-nb .node { fill: var(--ink); opacity: 1; }
.graph.has-sel .gnode.is-sel .node, .gnode:hover .node { fill: var(--accent); opacity: 1; }
.gnode.is-sel .node-label { fill: var(--accent-ink); font-size: 14px; font-weight: 700; }
.gnode:focus, .gnode:focus-visible { outline: none; }
.gnode:focus-visible .node-hit { fill: none; stroke: var(--focus); stroke-width: 2.5; }
.gnode.is-nb .node-label { fill: var(--ink-2); font-weight: 500; }
.graph-info { max-width: 820px; margin: var(--sp-3) auto 0; min-height: 3em; font-size: .92rem; }
.graph-hint { margin: 0; color: var(--muted-ink); text-align: center; }
.graph-sel { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 6px; }
.graph-sel-title { font: 700 1.05rem var(--display); }
.graph-sel-meta { color: var(--muted-ink); }
.graph-clear { margin-left: auto; background: none; border: 0; padding: 4px 0; color: var(--accent-ink); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.graph-links { max-height: 22em; overflow-y: auto; overscroll-behavior: contain; }
.graph-links .lt { margin-right: 2px; }
@media (max-width: 600px) {
  /* Обрезаем поля холста под подписи: кольцо — почти во всю ширину. */
  .graph-wrap { overflow: hidden; }
  .graph { width: 164%; max-width: none; margin: -32% 0 -32% -32%; }
  .sector-label { display: none; }
  .gnode .node-label-out { display: none !important; }
  .gnode.is-sel .node-label-in { display: inline; }
  .node-label { font-size: 18px; stroke-width: 6px; }
  .gnode.is-sel .node-label { font-size: 20px; }
  .graph-clear { margin-left: 0; }
}
.graph-wrap .legend { justify-content: center; }
.lt { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--muted); vertical-align: middle; margin-right: 6px; }
.lt-influence { border-color: var(--accent); }
.lt-similarity { border-color: var(--blue); border-top-style: dashed; }
.lt-combination { border-color: var(--green); }
.links-group { font-family: var(--sans); }
.links { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.links li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.links li:last-child { border-bottom: 0; }
.link-text { display: block; color: var(--muted-ink); font: .84rem/1.45 var(--body); margin-top: 2px; }

/* ================================================================== */
/* История графики — главы и развороты приёмов                         */
/* ================================================================== */

.eras-scale { --lane-h: 40px; position: relative; height: calc(var(--lane-h) * var(--lanes, 1) + 36px); border-top: 1px solid var(--line); overflow: hidden; font-family: var(--sans); }
.eras-ticks { position: absolute; inset: 0; }
.tick { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--line); font: .7rem var(--sans); color: var(--muted-ink); padding: 4px 0 0 4px; font-variant-numeric: tabular-nums; }
.era-bar { position: absolute; height: calc(var(--lane-h) - 8px); border: 0; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--ink); text-align: left; padding: 0 8px; cursor: pointer; overflow: hidden; font: 500 .78rem var(--sans); }
.era-bar:hover { background: color-mix(in srgb, var(--accent) 28%, var(--bg)); }
.era-bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
@media (max-width: 640px) { .era-bar-label { font-size: .7rem; } .tick:nth-child(even) { color: transparent; } }

.era > .strip { grid-column: feature; margin-top: var(--sp-5); }
.era-text { margin-top: var(--sp-5) !important; display: flow-root; }
.era-text > .body-p + .body-p { margin-top: 1em; }
.era-side { font-size: .84rem; }
.era-text.has-side { display: flex; flex-direction: column; }
.era-text.has-side > .era-side { order: 2; margin-top: var(--sp-5); }
.era-techs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; font-family: var(--sans); }
.more-details { font-family: var(--sans); font-size: 1rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: var(--sp-5) !important; }
.more-details > summary { cursor: pointer; padding: 12px 0; font: 600 .74rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); list-style-position: inside; }
.more-details > summary:hover { color: var(--accent-ink); }
.more-details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
@media (min-width: 900px) {
  /* врезка «Технологии» — сбоку, текст главы её обтекает */
  .era-text.has-side { display: flow-root; }
  .era-text.has-side > .era-side { float: right; width: min(40%, 17rem); margin: .3em 0 var(--sp-4) var(--sp-5); }
}

.tech { scroll-margin-top: calc(var(--header-h) + 16px); }
.tech-wide { grid-column: feature-start / full-end; display: grid; grid-template-columns: subgrid; margin-top: var(--sp-8) !important; }
.tech-wide > * { grid-column: content; min-width: 0; margin: 0; }
.tech-wide > * + * { margin-top: 1.1em; }
.tech-wide > .w-popout { grid-column: popout; }
.tech-wide > .w-feature { grid-column: feature; }
.tech-head { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.tech-head .kicker { margin-bottom: 8px; }
.tech-title { font-size: var(--step-3); }
.tech-diagram { margin: var(--sp-5) 0 var(--sp-3) !important; background: var(--surface); border: 1px solid var(--line); padding: clamp(8px, 2vw, 18px); font-family: var(--sans); }
.tech-diagram svg { display: block; width: 100%; height: auto; }
.tech-diagram-cap { font: .8rem/1.45 var(--sans); color: var(--muted-ink); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.kv-list { margin: 0; font: .92rem/1.5 var(--sans); display: grid; grid-template-columns: 7rem minmax(0, 1fr); border-top: 1px solid var(--line); }
.kv-list > div { display: contents; }
.kv-list dt { font: 600 .66rem/2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-ink); padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv-list dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); font-family: var(--body); }
@media (max-width: 520px) { .kv-list { grid-template-columns: minmax(0, 1fr); } .kv-list dt { border-bottom: 0; padding-bottom: 0; } }
.tech-figs { margin-top: var(--sp-5) !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--sp-5); }
.tech-figs > .tech-sub, .tech-figs > .strip { grid-column: 1 / -1; }
.tech-figs.is-single { grid-template-columns: minmax(0, 640px); }
.tech-sub { font: 600 .7rem/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-ink); margin: 0 0 -8px; }
.tech-actions { font-family: var(--sans); }
.tech-demo:empty { display: none; }

/* ================================================================== */
/* Игры — фоторепортаж                                                 */
/* ================================================================== */

.games-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; margin-bottom: var(--sp-5); }
.games-stat { font: 600 .74rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); margin: 0; }
.games-stat strong { display: inline-block; font: 800 var(--step-4)/1 var(--display); letter-spacing: -.03em; color: var(--ink); text-transform: none; vertical-align: -.1em; font-variant-numeric: lining-nums; }
.ggrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--sp-6) var(--sp-5); }
.gcard { display: flex; flex-direction: column; min-width: 0; font-family: var(--sans); }
.gcard-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; }
.gcard-link:hover { color: var(--ink); }
.gcard-link:hover .gcard-title { color: var(--accent-ink); }
.gcard-ph { display: grid; place-items: center; aspect-ratio: 16 / 9; font: 700 2.6rem var(--display); color: var(--muted); background: var(--tint); }
.gcard-shot { transition: filter .2s; }
.gcard-link:hover .gcard-shot { filter: brightness(1.06); }
.gcard-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 0 0; flex: 1; border-top: 0; }
.gcard-title { font: 700 1.08rem/1.2 var(--display); margin: 0; }
.gcard-title a { text-decoration: none; }
.gcard-title a:hover { color: var(--accent-ink); }
.gcard-meta { font-size: .76rem; color: var(--muted-ink); margin: 0; font-variant-numeric: tabular-nums; }
.gcard-note { font: .86rem/1.5 var(--body); color: var(--ink-2); margin: 4px 0 0; }
.gcard-foot { margin-top: auto; padding-top: 6px; font-size: .72rem; color: var(--muted-ink); display: flex; justify-content: space-between; gap: 8px; }
.ggrid-refs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.more-wrap { text-align: center; margin: var(--sp-6) 0 0; }

/* карточка игры */
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: clamp(110px, 12vw, 200px); gap: 8px; }
.photo-item { grid-column: span 2; min-width: 0; }
.photo-item:nth-child(1) { grid-column: span 4; grid-row: span 2; }
.photo-2 .photo-item, .photo-4 .photo-item { grid-column: span 3; grid-row: span 2; }
.photo-5 .photo-item:nth-child(n+4) { grid-column: span 3; }
.photo-btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--night); cursor: zoom-in; overflow: hidden; }
.photo-btn .shot { aspect-ratio: auto; height: 100%; background: var(--night); }
.photo-btn .shot img { object-fit: cover; }
.photo-btn:hover .shot img { transform: scale(1.03); }
.photo-btn .shot img { transition: transform .5s ease; }
@media (max-width: 560px) {
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 110px; }
  .photo-item, .photo-2 .photo-item, .photo-4 .photo-item, .photo-5 .photo-item:nth-child(n+4) { grid-column: span 1; grid-row: span 1; }
  .photo-item:nth-child(1) { grid-column: span 2; grid-row: span 2; }
}
.shot-empty { color: var(--muted-ink); font-family: var(--sans); font-size: .95rem; }
.game-refs { list-style: none; margin: 0; padding: 0; font-family: var(--sans); }
.game-refs li { padding: 12px 0; border-top: 1px solid var(--line); }
.game-ref-head { margin: 0; }
.game-ref-mech { font: 700 1.12rem var(--display); }
.game-ref-head .muted { font: .8rem var(--sans); }
.game-ref-note { margin: 4px 0 0; color: var(--ink-2); font: .95rem/1.55 var(--body); }
.game-fig { min-width: 0; }
.game-fig .kicker { margin-bottom: 8px; }
.page-game .asec > .h3 { margin-top: var(--sp-5); font-size: var(--step-1); }

/* ================================================================== */
/* Источники — книжная полка                                           */
/* ================================================================== */

.src-groups > .section:first-child { margin-top: var(--sp-6); }
.shelf .grid-src { gap: var(--sp-6) var(--sp-6); }
.src { font-family: var(--sans); }
.src-meta { font: 600 .68rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 8px; }
.src .h3 { font-size: 1.25rem; line-height: 1.2; }
.src-book .h3 { font-weight: 600; }
.src .h3 a { text-decoration: none; }
.src .h3 a:hover { text-decoration: underline; }
.src-ru { font: 400 .9rem var(--body); color: var(--ink-2); margin-bottom: 4px; }
.src-author { color: var(--ink); margin-bottom: 4px; font-size: .9rem; font-weight: 600; }
.src-ed { color: var(--muted-ink); font-size: .8rem; margin-bottom: 8px; }
.src-ann { font: .92rem/1.55 var(--body); color: var(--ink-2); }

/* ================================================================== */
/* Игротека, о проекте, 404                                            */
/* ================================================================== */

.play-stage:not(:empty) { margin-bottom: var(--sp-6); scroll-margin-top: calc(var(--header-h) + 16px); }
.play-stage .section-title { margin-bottom: 14px; }
.playcard { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-family: var(--sans); }
.playcard .h3 { margin: 0; font-size: 1.2rem; }
.playcard .h3 a { text-decoration: none; }
.playcard .h3 a:hover { color: var(--accent-ink); }
.playcard .card-text { margin: 0; }
.playcard .btn, .playcard-actions { margin-top: auto; }
.playcard-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 0; }
.playcard .src-meta { margin: 0; color: var(--muted-ink); }
.playcard.is-wip .h3 a { color: var(--ink-2); }

.page-about .list { font-size: .95em; }
.page-404 { position: relative; }
.big-404 { font: 800 clamp(6rem, 4rem + 18vw, 18rem)/.8 var(--display); letter-spacing: -.05em; color: var(--accent); margin: 0 0 var(--sp-5); font-variant-numeric: lining-nums; }
.actions-404 { display: flex; flex-wrap: wrap; gap: 10px; }

/* ================================================================== */
/* Навигация второго уровня: крошки и подразделы рубрики               */
/* ================================================================== */

.crumbs-sep { color: var(--muted-ink); }
.crumbs [aria-current="page"] { color: var(--ink-2); }
.subnav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 0 0 var(--sp-5); padding-bottom: 10px; border-bottom: 1px solid var(--line); font-family: var(--sans); }
.article-head > .subnav { margin-bottom: var(--sp-5); }
.subnav-title { font: 700 .7rem/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.subnav-list { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.subnav-link { display: inline-block; padding: 4px 0; font: 500 .9rem/1.3 var(--sans); color: var(--muted-ink); text-decoration: none; border-bottom: 2px solid transparent; }
.subnav-link:hover { color: var(--ink); border-bottom-color: var(--line); }
.subnav-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* уровень статьи цикла: три деления */
.lvl { display: inline-flex; align-items: center; gap: 6px; font: 600 .68rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.lvl-bars { display: inline-flex; gap: 2px; }
.lvl-bars i { display: block; width: 4px; height: 11px; background: var(--line); }
.lvl-1 .lvl-bars i:nth-child(-n+1), .lvl-2 .lvl-bars i:nth-child(-n+2), .lvl-3 .lvl-bars i { background: var(--accent); }
.byline .lvl { font-size: inherit; letter-spacing: inherit; color: inherit; vertical-align: middle; }

/* ================================================================== */
/* Циклы статей: оглавления, карточки, маршрут обучения                */
/* ================================================================== */

.filters-inline { padding-top: var(--sp-3); margin-bottom: var(--sp-3); }
.tindex, .ux-list { list-style: none; margin: 0; padding: 0; font-family: var(--sans); }
.trow, .ux-row { border-top: 1px solid var(--line); }
.trow:first-child, .ux-row:first-child { border-top-color: var(--ink); }
.trow-link, .ux-row-link { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) clamp(120px, 16vw, 200px); gap: var(--sp-4) var(--sp-5); padding: var(--sp-4) 0; text-decoration: none; align-items: start; }
.ux-row-link { grid-template-columns: 3.4rem minmax(0, 1fr); }
.trow-link:hover, .ux-row-link:hover { color: var(--ink); }
.trow-link:hover .trow-title, .ux-row-link:hover .ux-row-title { color: var(--accent-ink); }
.trow-num, .ux-row-num { font: 700 var(--step-2)/1 var(--display); color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.trow-body, .ux-row-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trow-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font: 600 .68rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); }
.trow-title, .ux-row-title { font: 700 var(--step-1)/1.15 var(--display); text-wrap: balance; }
.trow-name { font: 400 .95rem var(--display); color: var(--muted-ink); }
.trow-text, .ux-row-text { font: .95rem/1.5 var(--body); color: var(--ink-2); max-width: 44em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.trow-side { display: block; min-width: 0; }
.ux-row.is-done .ux-row-num { color: var(--accent); }
.ux-done { color: var(--accent-ink); letter-spacing: .04em; }
@media (max-width: 640px) {
  .trow-link { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .ux-row-link { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .trow-side { display: none; }
  .trow-num, .ux-row-num { font-size: 1.35rem; }
}

/* главы-эпохи */
.era-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--sp-6) var(--sp-5); font-family: var(--sans); }
.era-card-link { display: flex; flex-direction: column; gap: 6px; padding-top: var(--sp-3); border-top: 1px solid var(--line); text-decoration: none; height: 100%; }
.era-card-link:hover { color: var(--ink); }
.era-card-link:hover .era-card-title { color: var(--accent-ink); }
.era-card-shot { display: block; margin-bottom: 6px; overflow: hidden; background: var(--night); }
.era-card .kicker { margin: 0; }
.era-card-title { font: 700 var(--step-1)/1.15 var(--display); text-wrap: balance; }
.era-card-text { font: .92rem/1.5 var(--body); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.era-card-foot { margin-top: auto; padding-top: 6px; font-size: .76rem; color: var(--muted-ink); }
a.era-bar { display: block; text-decoration: none; }
a.era-bar .era-bar-label { line-height: calc(var(--lane-h) - 8px); }

/* карточки статей о приёмах */
.tcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--sp-5); font-family: var(--sans); }
.tcard-link { display: flex; flex-direction: column; gap: 6px; padding-top: var(--sp-3); border-top: 1px solid var(--line); text-decoration: none; height: 100%; }
.tcard-link:hover { color: var(--ink); }
.tcard-link:hover .tcard-title { color: var(--accent-ink); }
.tcard-kicker { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.tcard-n { font: 700 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.tcard-title { font: 700 1.2rem/1.2 var(--display); text-wrap: balance; }
.tcard-text { font: .9rem/1.5 var(--body); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* маршрут обучения UX/UI */
.route { font-family: var(--sans); }
.route-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 12px; }
.route-count { margin: 0; font: 600 .74rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); }
.route-count strong { font: 800 var(--step-3)/1 var(--display); letter-spacing: -.02em; color: var(--ink); text-transform: none; vertical-align: -.08em; margin-right: 4px; }
.route-head .btn { max-width: 100%; white-space: normal; text-align: left; }
.route-done { margin: 0; font: 400 1rem var(--body); color: var(--accent-ink); }
.route-bar { height: 4px; background: var(--line); margin-bottom: var(--sp-4); }
.route-fill { display: block; height: 100%; background: var(--accent); }
.route-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: var(--sp-4) var(--sp-5); }
.route-part { min-width: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.route-part-title { display: block; font: 600 .7rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.route-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 0; position: relative; }
.route-steps > li { display: flex; align-items: center; }
.route-steps > li + li::before { content: ""; width: 10px; height: 2px; background: var(--line); }
.route-step { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--bg); font: 700 .78rem/1 var(--sans); text-decoration: none; color: var(--ink); font-variant-numeric: tabular-nums; }
.route-step:hover { border-color: var(--accent); color: var(--accent-ink); }
.route-step.is-done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.route-step.is-next { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

/* врезки статей циклов */
.prereq { margin-top: var(--sp-7) !important; border-top-color: var(--ink); }
.prereq a { font-weight: 600; }
.takeaways { border-top-color: var(--ink); }
.tasks .factbox-kicker::before { content: "▶ "; color: var(--accent); }
.fig-diagram .tech-diagram, .ux-figure { margin: 0 !important; background: var(--surface); border: 1px solid var(--line); padding: clamp(8px, 2vw, 18px); }
.ux-figure svg { display: block; width: 100%; height: auto; }
.ux-read-wrap { grid-column: content; margin: var(--sp-7) 0 0; font-family: var(--sans); }
.ux-read[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-ink); }

/* ================================================================== */
/* Глоссарий                                                           */
/* ================================================================== */

.letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 var(--sp-4); font-family: var(--sans); position: sticky; top: var(--header-h); z-index: 5; background: var(--bg); padding: 8px 0; border-bottom: 1px solid var(--line); }
.letter { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border: 1px solid var(--line); font: 700 .86rem/1 var(--display); text-decoration: none; color: var(--ink); }
.letter:hover { border-color: var(--accent); color: var(--accent-ink); }
.gloss-group { display: grid; grid-template-columns: minmax(0, 5rem) minmax(0, 1fr); gap: 0 var(--sp-5); border-top: 1px solid var(--line); padding: var(--sp-3) 0 var(--sp-5); scroll-margin-top: calc(var(--header-h) + 60px); }
.gloss-letter { font: 800 var(--step-4)/1 var(--display); color: var(--accent); align-self: start; position: sticky; top: calc(var(--header-h) + 60px); }
.gloss-list { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--sp-4) var(--sp-6); font-family: var(--sans); }
.gloss-item { border-top: 1px solid var(--line); padding-top: 8px; min-width: 0; }
.gloss-item dt { margin: 0 0 4px; }
.gloss-term { font: 700 1.12rem/1.25 var(--display); text-decoration: none; }
.gloss-term:hover { color: var(--accent-ink); text-decoration: underline; }
.gloss-en { font: 400 .9rem var(--display); color: var(--muted-ink); }
.gloss-item dd { margin: 0; font: .92rem/1.5 var(--body); color: var(--ink-2); }
.gloss-cat { font: .76rem var(--sans); color: var(--muted-ink); }
.gloss-home { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
@media (max-width: 640px) { .gloss-group { grid-template-columns: minmax(0, 1fr); } .gloss-letter { position: static; margin-bottom: 8px; } }
.usage-list { list-style: none; margin: 0; padding: 0; font: .95rem/1.45 var(--sans); }
.usage-list li { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 4px 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.usage-kind { font: 600 .68rem/1.9 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-ink); }
@media (max-width: 520px) { .usage-list li { grid-template-columns: minmax(0, 1fr); } }
.term-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* термин в тексте и всплывающее определение */
a.term { color: inherit; text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, var(--accent) 75%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: .22em; cursor: help; }
a.term:hover, a.term[aria-expanded="true"] { color: var(--accent-ink); text-decoration-style: solid; }
.term-pop { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: 6px; width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow: auto;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 12px 14px 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
  font: 400 .9rem/1.5 var(--sans); text-align: left; hyphens: manual; text-indent: 0; letter-spacing: 0; }
.term-pop-head { display: flex; align-items: flex-start; gap: 10px; }
.term-pop-title { font: 700 1.15rem/1.2 var(--display); margin-right: auto; }
.term-pop-close { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; font-size: .8rem; line-height: 1; display: none; }
.term-pop.is-pinned .term-pop-close, .term-pop.is-sheet .term-pop-close { display: inline-grid; place-items: center; }
.term-pop-close:hover { border-color: var(--ink); }
.term-pop-en { font: 400 .85rem var(--display); color: var(--muted-ink); }
.term-pop-text { font: .92rem/1.5 var(--body); color: var(--ink-2); }
.term-pop-fig { display: block; background: var(--surface); border: 1px solid var(--line); padding: 6px; }
.term-pop-fig svg { display: block; width: 100%; height: auto; max-height: 180px; }
.term-pop-more { align-self: flex-start; font: 600 .74rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); text-decoration: none; padding: 4px 0; }
.term-pop-more:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .term-pop, .term-pop.is-sheet { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-height: 60vh; border-left: 0; border-right: 0; border-bottom: 0;
    padding: 14px var(--gut) calc(16px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 40px rgba(0, 0, 0, .3); }
  .term-pop .term-pop-close { display: inline-grid; place-items: center; }
}
@media print { .term-pop { display: none !important; } a.term { text-decoration: none; } }

/* ================================================================== */
/* Слой 2026: гротеск + моно, bento-карточки, стекло шапки, переходы   */
/* ================================================================== */

html { background: var(--bg); }
body {
  font: 400 1rem/1.55 var(--body); font-optical-sizing: auto;
  background: radial-gradient(70rem 32rem at 88% -12rem, var(--glow), transparent 70%), var(--bg);
  background-repeat: no-repeat;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 680; letter-spacing: -.022em; line-height: 1.12; overflow-wrap: break-word; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
kbd { font: 500 .78em var(--mono); border-radius: 6px; background: var(--tint); }

/* крупные заголовки и цифры — Unbounded, плотный трекинг */
.page-title, .article-title, .cover-title, .section-title, .hsec-title, .asec-title, .tech-title,
.stat-num, .cover-big, .big-404, .asec-num, .tl-dec-title, .gloss-letter, .games-stat strong, .route-count strong,
.mrow-num, .trow-num, .ux-row-num, .mini-label, .r-1 .rubric-title {
  font-family: var(--wide); font-weight: 560; letter-spacing: -.04em; line-height: 1.04;
}
.page-title { font-size: var(--step-5); letter-spacing: -.045em; }
.article-title { font-size: var(--step-5); font-weight: 560; line-height: 1.05; letter-spacing: -.045em; }
.section-title, .hsec-title, .asec-title, .tech-title { font-size: var(--step-3); letter-spacing: -.04em; }
.stat-num, .games-stat strong { font-weight: 500; }
.cover-big, .big-404 { font-weight: 600; letter-spacing: -.06em; }
.asec-num, .mrow-num, .trow-num, .ux-row-num { font-weight: 500; }
.mini-label { font-size: 1.05rem; }
.empty-title { font-weight: 640; }

/* метки, цифры, годы, подписи — моно, табличные */
.kicker, .card-num, .toc-num, .contents-num, .rubric-num, .tcard-n, .mrow-year, .card-year, .vtl-year, .tl-year-n, .td-year,
.chain-year, .mtl-tip-year, .loop-n, .cat-count, .src-meta, .src-type, .gloss-cat, .tick, .mtl-tick, .dec-n, .dec-l, .thumb-badge,
.mosaic-cap, .mech-thumb-cap, .lb-count, .result-count, .mk-badge, .mk-dot, .tag, .fchip, .section-count, .player-status,
.card-foot, .gcard-meta, .gcard-foot, .byline, .crumbs, .hero-cap-label, .fig-num, .tfig-legend, .mini-count, .era-card-foot,
.usage-kind, .field-label, .legend, .shot-credit, .tl-dec-count, .stats .stat-label, .eras-scale, .era-bar {
  font-family: var(--mono);
}
.kicker { font-weight: 500; font-size: .7rem; letter-spacing: .1em; }
.crumbs { font-size: .74rem; letter-spacing: .02em; }
.tag { font-size: .7rem; font-weight: 500; letter-spacing: .02em; }
.fchip { font-size: .74rem; }
.card-num, .toc-num, .contents-num, .rubric-num, .mrow-year, .card-year, .vtl-year, .tl-year-n, .td-year, .chain-year, .mtl-tip-year, .loop-n, .cat-count { font-weight: 500; letter-spacing: 0; }
.vtl-year, .tl-year-n, .chain-year, .td-year, .loop-n { font-weight: 600; }
.title-en, .card-en, .mrow-en, .gloss-en, .term-pop-en, .trow-name { font-family: var(--mono); font-size: .8em; letter-spacing: -.01em; font-weight: 400; color: var(--muted-ink); }
.title-en { font-size: var(--step-0); margin-top: 12px; }
.note { font-style: normal; }
.logo-text em, .footer-logo em, .cover-l2 { font-style: normal; }

/* ---------- шапка: липкое стекло ---------- */
.site-header { background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); }
.header-inner { gap: 20px; }
.logo { gap: 10px; }
.logo-mark { width: 32px; height: 32px; border-radius: 10px; font: 600 1rem/1 var(--wide); padding: 0;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--blue))); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent), 0 6px 20px -4px var(--glow); }
.logo-text { font: 650 1rem/1.1 var(--display); letter-spacing: -.02em; }
.logo-text em { font-weight: 450; color: var(--muted-ink); }
.site-nav { gap: 2px; }
.site-nav a { font: 500 .8rem/1 var(--body); letter-spacing: 0; text-transform: none; color: var(--muted-ink); padding: 9px 13px; border: 0; border-radius: 99px; transition: background-color .2s, color .2s; }
.site-nav a:hover { color: var(--ink); background: var(--tint); border: 0; }
.site-nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--accent) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.nav-toggle { border-radius: 12px; width: 38px; height: 38px; background: var(--surface); }
.nav-toggle:hover { border-color: var(--accent); }

/* переключатель темы: система / светлая / тёмная */
.theme-toggle { display: inline-flex; gap: 2px; padding: 3px; width: auto; height: auto; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); flex: none; }
.theme-toggle:hover { border-color: var(--line); }
.theme-toggle button { all: unset; box-sizing: border-box; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--muted-ink); cursor: pointer; transition: background-color .2s, color .2s; }
.theme-toggle button:hover { color: var(--ink); background: var(--tint); }
.theme-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.theme-toggle button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.read-progress { height: 2px; bottom: -1px; }
.read-progress-bar { background: linear-gradient(90deg, var(--accent), var(--blue)); }
@supports (animation-timeline: scroll()) {
  .is-reading .read-progress-bar { animation: gs-progress linear both; animation-timeline: scroll(root block); }
  @keyframes gs-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
@media (max-width: 1040px) {
  .site-nav { background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
  .site-nav a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 1rem; box-shadow: none; background: none; }
  .site-nav a[aria-current="page"] { background: none; box-shadow: none; color: var(--accent-ink); }
}
@media (max-width: 480px) {
  .logo-text { display: none; }
  .theme-toggle button { width: 32px; height: 32px; }
}

.site-footer { border-top: 1px solid var(--line); background: transparent; }
.footer-logo { font: 650 1.3rem/1.1 var(--display); letter-spacing: -.02em; }
.footer-fine { font-family: var(--mono); font-size: .72rem; }

/* ---------- текст ---------- */
.page-head { max-width: 960px; }
.lead, .standfirst { font: 400 var(--step-1)/1.45 var(--body); letter-spacing: -.01em; color: var(--ink-2); }
.prose { font-family: var(--body); }
.flow { font-family: var(--body); font-size: var(--step-0); }
.body-p { line-height: 1.62; font-variant-numeric: normal; hanging-punctuation: none; }
.has-dropcap { font-size: 1.14em; line-height: 1.5; color: var(--ink); letter-spacing: -.005em; }
.has-dropcap::first-letter { float: none; -webkit-initial-letter: normal; initial-letter: normal; font: inherit; margin: 0; color: inherit; }
.section, .hsec-head, .asec-head, .tech-head { border-top: 1px solid var(--line); }
.hsec-head { padding-top: var(--sp-4); }
.hsec-more, .toc-toggle, .subnav-title, .toc-title, .pager-dir, .factbox-kicker, .tech-sub, .dec-cap, .route-count, .route-part-title, .games-stat, .stat-label, .hero-cap-label {
  font-family: var(--mono); font-weight: 500; letter-spacing: .08em;
}
.asec-lead { font-style: normal; color: var(--ink-2); }
.byline { border-top: 1px solid var(--line); font-weight: 500; letter-spacing: .06em; }

/* кнопки */
.btn { font: 600 .86rem/1.2 var(--body); letter-spacing: 0; border-radius: 99px; border: 1px solid transparent; background: var(--ink); color: var(--bg); transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s, transform .2s; }
.btn:hover { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: 0 8px 24px -8px var(--glow); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: var(--accent); color: var(--ink); box-shadow: none; }
.btn-play { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 28px -8px var(--glow); }
.btn-play:hover { background: var(--ink); color: var(--bg); }
.tag { background: transparent; }
.tag-link:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.chip { background: var(--tint); border-color: transparent; border-radius: 99px; }
.fchip { border-radius: 99px; }
.fchip:hover { border-color: var(--accent); }
.fchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- bento: карточки с поверхностью и скруглением (в статьях — без коробок) ---------- */
.card, .card-static, .comb, .links-group, .playcard, .src, .era-card-link, .tcard-link, .rubric {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(14px, 1.6vw, 22px); overflow: hidden;
  transition: border-color .25s, background-color .25s, transform .25s, box-shadow .25s;
}
a.card:hover, .era-card-link:hover, .tcard-link:hover, .rubric:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow), 0 0 0 4px var(--glow); transform: translateY(-2px);
}
.card .mech-thumb, .rubric-shot, .era-card-shot { border-radius: var(--r-media); overflow: hidden; }
.card-title, .rubric-title, .era-card-title, .tcard-title, .gcard-title, .mrow-title, .trow-title, .ux-row-title, .pager-title, .cat-title, .contents-title, .tl-game, .td-title, .gloss-term {
  font-family: var(--display); font-weight: 650; letter-spacing: -.02em;
}
.r-1 .rubric-title { font-size: var(--step-3); }
.card-text, .rubric-text, .era-card-text, .tcard-text, .mrow-text, .trow-text, .ux-row-text, .gcard-note, .td-note, .tl-text, .mini-ev, .chain-text, .link-text, .src-ann, .gloss-item dd, .game-ref-note, .kv-list dd, .term-pop-text, .mtl-tip-text, .pager-text, .comb, .src-ru {
  font-family: var(--body);
}
.rubrics { gap: clamp(10px, 1.4vw, 16px); }
.rubric { gap: 8px; }
.rubric.r-1 { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 55%); }
.rubric-num { top: calc(clamp(14px, 1.6vw, 22px) + 4px); right: clamp(14px, 1.6vw, 22px); }
.rubric.has-shot .rubric-num { top: calc(clamp(14px, 1.6vw, 22px) + 10px); right: calc(clamp(14px, 1.6vw, 22px) + 10px); border-radius: 99px; padding: 3px 8px; }
.grid, .grid-cards, .grid-rel, .grid-comb, .grid-src, .grid-links, .grid-play, .era-cards, .tcards { gap: clamp(10px, 1.4vw, 16px); }
.shelf .grid-src { gap: clamp(10px, 1.4vw, 16px); }
.card-foot { font-family: var(--mono); font-size: .7rem; }
.mech-card.is-wip { border-style: dashed; }

/* игры */
.ggrid { gap: clamp(10px, 1.4vw, 16px); }
.gcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; transition: border-color .25s, box-shadow .25s, transform .25s; }
.gcard:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow), 0 0 0 4px var(--glow); transform: translateY(-2px); }
.gcard-body { padding: 12px 14px 14px; }
.gcard-title { font-size: 1rem; }
.gcard-meta, .gcard-foot { font-size: .68rem; }
.gcard-ph { font-family: var(--wide); font-weight: 500; }

/* статистика главной: bento-плитки */
.stats { gap: clamp(10px, 1.4vw, 16px); }
.stat, .stat + .stat { padding: clamp(14px, 1.6vw, 22px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.stat-num { font-size: var(--step-4); }
.stat-link { transition: border-color .25s, box-shadow .25s; }
a.stat:hover, .stat-link:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 4px var(--glow); }
@media (max-width: 640px) { .stat:nth-child(odd) { padding-left: clamp(14px, 1.6vw, 22px); } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* обложка главной */
.cover { border-bottom: 0; padding-bottom: var(--sp-5); gap: clamp(24px, 4vw, 56px); }
.cover-title { font-family: var(--wide); font-weight: 560; letter-spacing: -.055em; line-height: .98; font-size: clamp(2.1rem, .8rem + 4.3vw, 4.6rem); overflow-wrap: normal; hyphens: manual; }
.cover-l2 { background: linear-gradient(100deg, var(--accent-ink), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 560; letter-spacing: -.055em; }
.mosaic { gap: 8px; }
.mosaic-btn { border-radius: var(--r-media); }
.mosaic-item:nth-child(1) .mosaic-btn { border-radius: var(--r-card); }
.mosaic-cap { font-family: var(--mono); font-size: .64rem; }
.contents-link, .cat { border-bottom: 1px solid var(--line); transition: padding .2s; }
.contents-link:hover, .cat:hover { padding-left: 8px; }
.contents-dots { border-bottom: 1px dotted var(--muted); }
.mini-tl { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding-top: 6px; }
.mini-bar { border-radius: 99px; width: 8px; }

/* списки-индексы: строки с мягкой подсветкой */
.mrow:first-child, .trow:first-child, .ux-row:first-child { border-top-color: var(--line); }
.mrow-link, .trow-link, .ux-row-link { padding-left: 12px; padding-right: 12px; margin: 0 -12px; border-radius: var(--r-media); transition: background-color .2s; }
.mrow-link:hover, .trow-link:hover, .ux-row-link:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.mrow-num { color: var(--muted); font-size: var(--step-2); }
.mrow-ph { border-radius: var(--r-media); font-family: var(--wide); }
.mrow-side .shot, .mrow-side .mech-thumb, .trow-side .shot { border-radius: 10px; }
.filters { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding: var(--sp-4) clamp(14px, 2vw, 24px) var(--sp-5); }
.filters-inline { padding-top: var(--sp-3); }
.field input, .field select { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--bg); min-height: 44px; transition: border-color .2s, box-shadow .2s; }
.field input:hover, .field select:hover { border-color: var(--muted); }
.field input:focus-visible, .field select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); outline: none; }
.letters { background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.letter { border-radius: 10px; font-family: var(--mono); font-weight: 600; }
.letter:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gloss-group { border-top: 1px solid var(--line); }
.gloss-letter { font-weight: 500; }
.gloss-item { border-top: 1px solid var(--line); }

/* ---------- статья ---------- */
.article-hero { margin-top: var(--sp-6); }
.hero-frame { background: var(--night); }
.hero-frame .shot-hero { border-radius: var(--r-media); box-shadow: 0 24px 80px rgba(0, 0, 0, .5); outline: 1px solid rgba(255, 255, 255, .1); outline-offset: -1px; }
.hero-cap { font-family: var(--body); }
.article-hero.is-type { margin: var(--sp-6) var(--gap) 0; border: 1px solid var(--line); border-radius: calc(var(--r-card) + 8px);
  background: radial-gradient(40rem 22rem at 85% 110%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%), var(--cover-bg); }
.article-hero.is-type::before { background-image: linear-gradient(color-mix(in srgb, var(--cover-ink) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--cover-ink) 6%, transparent) 1px, transparent 1px);
  -webkit-mask-image: linear-gradient(160deg, transparent 20%, #000); mask-image: linear-gradient(160deg, transparent 20%, #000); }
.cover-big { font-size: clamp(4.5rem, 2.5rem + 13vw, 13rem); color: transparent; background: linear-gradient(120deg, #fff, var(--accent)); -webkit-background-clip: text; background-clip: text; }
.cover-sub { font: 500 var(--step-1)/1.2 var(--mono); letter-spacing: -.01em; }
.shot, .tfig-frame, .tech-diagram, .fig-diagram .tech-diagram, .ux-figure, .term-pop-fig, .player { border-radius: var(--r-media); }
.shot { background: var(--tint); }
.thumb, .strip-btn .shot { border-radius: 12px; }
.photo-btn { border-radius: var(--r-media); }
.photo-grid { gap: 8px; }
.tech-diagram, .ux-figure, .fig-diagram .tech-diagram { background: var(--surface); border-color: var(--line); }
.fig-cap, .tfig-cap, .tech-diagram-cap { font-family: var(--body); border-top: 1px solid var(--line); }
.fig-cap { font-size: .82rem; }
.fig-num { font-family: var(--mono); font-weight: 600; font-size: .78em; color: var(--accent-ink); }

.toc-toggle { border-top: 1px solid var(--line); }
.toc-link { border-left: 1px solid var(--line); font-family: var(--body); transition: color .2s, border-color .2s; }
.toc-link[aria-current] { border-left: 2px solid var(--accent); margin-left: -1px; font-weight: 600; }
.toc-num { color: var(--accent-ink); }

.asec-head { border-top: 1px solid var(--line); }
.asec-num { color: var(--accent-ink); font-size: var(--step-1); }
@media (min-width: 1024px) { .asec-num { color: var(--muted); font-size: var(--step-2); } }
.pullquote { border: 0; padding: var(--sp-5) 0 var(--sp-4) clamp(18px, 3vw, 36px); position: relative; }
.pullquote::before { content: ""; position: absolute; left: 0; top: var(--sp-5); bottom: var(--sp-4); width: 3px; border-radius: 3px; background: linear-gradient(var(--accent), var(--blue)); }
.pullquote p { font: 560 var(--step-2)/1.22 var(--display); letter-spacing: -.03em; }
.pullquote p::before { margin-left: 0; width: auto; }
.pullquote figcaption { font-family: var(--mono); font-weight: 500; letter-spacing: .06em; }
.factbox { background: var(--tint); border: 1px solid var(--line); border-radius: var(--r-card); font-family: var(--body); }
.factbox-list li { border-top: 1px solid var(--line); }
ol.factbox-list li::before { font-family: var(--mono); font-weight: 500; }
ul.factbox-list li::before { border-radius: 50%; top: 1.15em; }
ul.factbox-list li:first-child::before { top: .6em; }
.var, .duo-list li { border-top: 1px solid var(--line); }
.duo-list li::before { font-family: var(--mono); font-weight: 500; }
.vtl-item.is-flash .vtl-body { border-radius: 8px; }
.pager { border-top: 1px solid var(--line); gap: clamp(10px, 1.4vw, 16px); }
.pager-link { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(14px, 1.6vw, 22px); transition: border-color .25s, box-shadow .25s; }
.pager-link:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 4px var(--glow); }
.pager-title { font-size: var(--step-1); }

/* подразделы, крошки */
.subnav-link { font-family: var(--body); }
.lvl { font-family: var(--mono); font-weight: 500; }
.lvl-bars i { border-radius: 2px; }

/* плеер, подложка, график */
.player { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.player-stage iframe { background: var(--surface); }
.plate-goal { font-family: var(--display); font-weight: 680; letter-spacing: -.03em; }
.route-bar { border-radius: 99px; overflow: hidden; height: 6px; }
.route-fill { border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.route-part { border-top: 1px solid var(--line); }
.route-step { border-color: var(--line); background: var(--surface); font-family: var(--mono); font-weight: 600; transition: border-color .2s, background-color .2s; }
.route-step:hover { border-color: var(--accent); }
.route-step.is-done { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.era-bar { border-radius: 8px; font-weight: 500; }
.eras-scale { border-top: 1px solid var(--line); }
.chain { border-top: 1px solid var(--line); }
.mtl-tip, .term-pop { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 56px -12px rgba(0, 0, 0, .35); }
.term-pop { border-top: 1px solid var(--line); }
.term-pop-title { font-weight: 650; letter-spacing: -.02em; }
.term-pop-more { font-family: var(--mono); font-weight: 500; }
@media (max-width: 600px) { .term-pop, .term-pop.is-sheet { border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0; } }
a.term { text-decoration-color: color-mix(in srgb, var(--accent) 80%, transparent); }
.refs th { border-bottom: 1px solid var(--line); font-family: var(--mono); font-weight: 500; letter-spacing: .08em; }
.refs tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.td-title { font-weight: 650; }
.lb { background: color-mix(in srgb, #04060a 96%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lb-frame img { border-radius: 10px; }
.lb-btn { background: rgba(255, 255, 255, .08); }
.lb-btn:hover { background: var(--accent); color: var(--on-accent); }
.lb-title { font-family: var(--display); font-weight: 650; }
.mk-badge, .mk-dot { color: #0b0b12; border-color: #0b0b12; }
.big-404 { font-size: clamp(6rem, 4rem + 16vw, 16rem); }
.empty { border: 1px dashed var(--line); border-radius: var(--r-card); }

/* View Transitions: мягкая смена страницы */
@supports (view-transition-name: none) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: ease; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  a.card:hover, .era-card-link:hover, .tcard-link:hover, .rubric:hover, .gcard:hover { transform: none; }
}

/* ================================================================== */
/* Превью встроенных блоков (data/previews.js)                         */
/* ================================================================== */

/* Постер плеера: кадр игры/демо под затемнением, текст и «Играть» поверх. */
.plate.has-poster { isolation: isolate; }
.plate.has-poster > * { z-index: 2; }
.plate.has-poster::before { z-index: 1; }
.plate.has-poster > .plate-poster { position: absolute; z-index: 0; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 561px) {
  .plate.has-poster { justify-content: flex-end; background: #0c0e15; color: #fff;
    --ink: #fff; --ink-2: rgba(255, 255, 255, .86); --muted-ink: rgba(255, 255, 255, .8); --accent-ink: #fff; --line: rgba(255, 255, 255, .34); --surface: rgba(12, 14, 21, .55); --tint: rgba(255, 255, 255, .14); }
  .plate.has-poster::before { background: linear-gradient(to top, rgba(8, 10, 16, .92) 0%, rgba(8, 10, 16, .74) 40%, rgba(8, 10, 16, .18) 76%, rgba(8, 10, 16, 0) 100%); }
  .plate.has-poster .plate-body { text-shadow: 0 1px 12px rgba(0, 0, 0, .55); }
  .plate.has-poster .plate-goal { margin-bottom: 10px; }
  .plate.has-poster .btn-play { box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6); }
  .plate.has-poster .btn-play:hover { background: #fff; border-color: #fff; color: #0c0e15; }
}
@media (max-width: 560px) {
  /* На телефоне кадр — сверху во всю ширину, текст и кнопка — под ним на обычном фоне. */
  .player-stage:not(.is-playing) .plate.has-poster { padding-top: calc(56.25% + 16px); background: var(--surface); }
  .plate.has-poster::before { display: none; }
  .plate.has-poster > .plate-poster { height: auto; aspect-ratio: 16 / 9; }
}

/* Карточки Игротеки: кадр сверху, щелчок по нему запускает игру. */
.playcard-poster { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-media); background: var(--tint); cursor: pointer; }
.playcard-img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.playcard-play { position: absolute; left: 10px; bottom: 10px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; padding-left: 2px;
  background: var(--accent); color: var(--on-accent); font-size: .8rem; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .55); transition: transform .2s ease; }
.playcard-poster:hover .playcard-img, .playcard:focus-within .playcard-img { transform: scale(1.03); }
.playcard-poster:hover .playcard-play, .playcard:focus-within .playcard-play { transform: scale(1.1); }
.playcard.has-poster .card-num { margin-top: 2px; }

/* Миниатюра механики: превью прототипа проявляется вторым кадром по наведению/фокусу карточки. */
.mech-thumb-alt { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
.mech-thumb-alt .shot { height: 100%; }
a:hover .mech-thumb.has-alt .mech-thumb-alt, a:focus-visible .mech-thumb.has-alt .mech-thumb-alt { opacity: 1; }
@media (hover: none) { .mech-thumb-alt { display: none; } }

/* ================================================================== */
/* Узкие экраны, движение, печать                                      */
/* ================================================================== */

@media (max-width: 480px) {
  .page { padding-top: var(--sp-6); }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
  .logo-text { font-size: 1.05rem; }
  .logo-mark { width: 26px; height: 26px; font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .filters, .player, .pager, .chipbar, .toc, .skip-link, .lb, .thumb-badge, .tech-actions, .tech-demo, .hero-backdrop, .read-progress { display: none !important; }
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --tint: #f2f2f2; --ink: #000; --ink-2: #222; --muted-ink: #444; --line: #bbb; --accent-ink: #000; }
  body { background: #fff; color: #000; }
  .flow, .flow.has-toc { display: block; }
  .asec, .tech-wide { display: block; }
  .asec { break-inside: auto; }
  .hero-frame { background: #fff; padding: 0; }
  .hero-frame .shot-hero { box-shadow: none; width: 60%; }
  .article-hero.is-type { display: none; }
  a { text-decoration: none; }
  .fig, .factbox, .pullquote, .tfig { break-inside: avoid; }
}
