@font-face {
  font-family: "Literata Fallback";
  src: local("Georgia");
  font-style: normal;
  size-adjust: 108.03%;
  ascent-override: 108.96%;
  descent-override: 28.51%;
  line-gap-override: 0.00%;
}

@font-face {
  font-family: "Literata Fallback";
  src: local("Georgia Italic");
  font-style: italic;
  size-adjust: 97.77%;
  ascent-override: 120.39%;
  descent-override: 31.50%;
  line-gap-override: 0.00%;
}

/* Сгенерировано движком из design/tokens.json. Не править руками. */

@font-face {
  font-family: "Literata";
  src: url("/fonts/Literata-Variable.3a2b39a2.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Literata";
  src: url("/fonts/Literata-Italic-Variable.c7d02878.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: optional;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/IBMPlexMono-Regular.65a56057.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("/fonts/IBMPlexSerif-Italic.1add2288.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: optional;
}

:root {
  --surface: #fcfbf8;
  --surface-deep: #f3f0e9;
  --sky: #08112b;
  --sky-ink: #f4f1ea;
  --sky-ink-2: #a9b5cb;
  --ink: #1c2440;
  --ink-2: #4a5068;
  --muted: #6e685b;
  --line: #d3c8b5;
  --navy: #1e397f;
  --better: #0e7c70;
  --signal: #a32749;
  --context: #9aa5bb;
  --navy-fill: #bcd1fd;
  --better-fill: #a4d8c5;
  --signal-fill: #fabecb;
  --model-ink: #5a5f6b;
  --chat-them: #e9e5dc;
  --chat-me: #d6e0f5;
  --seq-1: #dbdee6;
  --seq-2: #b5bdd1;
  --seq-3: #8d9abc;
  --seq-4: #6173a3;
  --seq-5: #1e397f;
  --seq-6: #0f2152;
  --div-1: #a32749;
  --div-2: #cb8698;
  --div-3: #e6c6cc;
  --div-4: #e4e1da;
  --div-5: #c0dbd6;
  --div-6: #79b5ad;
  --div-7: #0e7c70;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;
  --radius-0: 0;
  --radius-2: 2px;
  --layout-columns: 12;
  --layout-page: 1600px;
  --layout-gap: 24px;
  --layout-gutter-min: 16px;
  --layout-gutter-max: 64px;
  --layout-text: 660px;
  --layout-margin: 3;
  --layout-wide: 9;
  --layout-story-steps: 4;
  --layout-story-canvas: 7;
  --layout-header: 56px;
  --layout-toc: 200px;
  --layout-toc-gap: 48px;
  --layout-bp-toc: 1400px;
  --layout-bp-margin: 1100px;
  --layout-bp-phone: 860px;
  --layout-header-phone: 48px;
  --layout-header-edge: 14px;
  --layout-chapter-pad: 56px;
  --type-sky-display-size: 214.7px;
  --type-sky-display-line: 0.96;
  --type-sky-display-weight: 200;
  --type-data-number-size: 107.4px;
  --type-data-number-line: 1;
  --type-data-number-weight: 200;
  --type-h1-size: 104px;
  --type-h1-line: 1.04;
  --type-h1-weight: 520;
  --type-h1-variation: "opsz" 24;
  --type-h1-mobile-size: 44px;
  --type-h1-mobile-line: 1.04;
  --type-h1-mobile-weight: 520;
  --type-h1-mobile-variation: "opsz" 24;
  --type-h2-size: 46px;
  --type-h2-line: 1.1;
  --type-h2-weight: 560;
  --type-h2-variation: "opsz" 24;
  --type-act-display-size: 64px;
  --type-act-display-line: 1.05;
  --type-act-display-weight: 300;
  --type-act-display-variation: "opsz" 24;
  --type-lead-size: 26.9px;
  --type-lead-line: 1.45;
  --type-lead-weight: 300;
  --type-h3-size: 26.9px;
  --type-h3-line: 1.25;
  --type-h3-weight: 560;
  --type-h3-variation: "opsz" 24;
  --type-h4-size: 13.4px;
  --type-h4-line: 1.4;
  --type-h4-weight: 640;
  --type-thought-size: 46px;
  --type-thought-line: 1.15;
  --type-thought-weight: 400;
  --type-thought-variation: "opsz" 24;
  --type-chat-size: 17px;
  --type-chat-line: 1.45;
  --type-chat-weight: 400;
  --type-body-size: 19px;
  --type-body-line: 1.65;
  --type-body-weight: 400;
  --type-model-note-size: 15px;
  --type-model-note-line: 1.5;
  --type-model-note-weight: 360;
  --type-figure-title-size: 21px;
  --type-figure-title-line: 1.3;
  --type-figure-title-weight: 600;
  --type-caption-size: 13.4px;
  --type-caption-line: 1.5;
  --type-caption-weight: 400;
  --type-code-size: 14px;
  --type-code-line: 1.6;
  --type-code-weight: 400;
  --type-mark-visualize-size: 48px;
  --type-mark-visualize-line: 1;
  --type-mark-visualize-weight: 400;
  --font-mark: "IBM Plex Serif", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-serif: "Literata", "Literata Fallback", Georgia, serif;
}

:root[data-theme="night"] {
  color-scheme: dark;
  --surface: #0f1834;
  --surface-deep: #18223f;
  --sky: #08112b;
  --sky-ink: #f4f1ea;
  --sky-ink-2: #a9b5cb;
  --ink: #ece8df;
  --ink-2: #aeb8cc;
  --muted: #8f96a9;
  --line: #2a3658;
  --navy: #8fa7e6;
  --better: #4fc2ae;
  --signal: #f0738f;
  --context: #5d6884;
  --navy-fill: #38466d;
  --better-fill: #234e5b;
  --signal-fill: #573551;
  --model-ink: #a3a8b3;
  --chat-them: #1c2747;
  --chat-me: #26386a;
  --seq-1: #222d4f;
  --seq-2: #38466d;
  --seq-3: #4f608d;
  --seq-4: #697cb1;
  --seq-5: #8fa7e6;
  --seq-6: #c9d6f6;
  --div-1: #f0738f;
  --div-2: #8b4a66;
  --div-3: #472f4b;
  --div-4: #2a3350;
  --div-5: #1f4252;
  --div-6: #327677;
  --div-7: #4fc2ae;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --surface: #0f1834;
    --surface-deep: #18223f;
    --sky: #08112b;
    --sky-ink: #f4f1ea;
    --sky-ink-2: #a9b5cb;
    --ink: #ece8df;
    --ink-2: #aeb8cc;
    --muted: #8f96a9;
    --line: #2a3658;
    --navy: #8fa7e6;
    --better: #4fc2ae;
    --signal: #f0738f;
    --context: #5d6884;
    --navy-fill: #38466d;
    --better-fill: #234e5b;
    --signal-fill: #573551;
    --model-ink: #a3a8b3;
    --chat-them: #1c2747;
    --chat-me: #26386a;
    --seq-1: #222d4f;
    --seq-2: #38466d;
    --seq-3: #4f608d;
    --seq-4: #697cb1;
    --seq-5: #8fa7e6;
    --seq-6: #c9d6f6;
    --div-1: #f0738f;
    --div-2: #8b4a66;
    --div-3: #472f4b;
    --div-4: #2a3350;
    --div-5: #1f4252;
    --div-6: #327677;
    --div-7: #4fc2ae;
  }
}

.type-sky-display {
  font-family: var(--font-serif);
  font-size: 214.7px;
  line-height: 0.96;
  font-weight: 200;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-data-number {
  font-family: var(--font-serif);
  font-size: 107.4px;
  line-height: 1;
  font-weight: 200;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-h1 {
  font-family: var(--font-serif);
  font-size: 104px;
  line-height: 1.04;
  font-weight: 520;
  font-style: normal;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 24;
}

.type-h1-mobile {
  font-family: var(--font-serif);
  font-size: 44px;
  line-height: 1.04;
  font-weight: 520;
  font-style: normal;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 24;
}

.type-h2 {
  font-family: var(--font-serif);
  font-size: 46px;
  line-height: 1.1;
  font-weight: 560;
  font-style: normal;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 24;
}

.type-act-display {
  font-family: var(--font-serif);
  font-size: 64px;
  line-height: 1.05;
  font-weight: 300;
  font-style: normal;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 24;
}

.type-lead {
  font-family: var(--font-serif);
  font-size: 26.9px;
  line-height: 1.45;
  font-weight: 300;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-h3 {
  font-family: var(--font-serif);
  font-size: 26.9px;
  line-height: 1.25;
  font-weight: 560;
  font-style: normal;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 24;
}

.type-h4 {
  font-family: var(--font-serif);
  font-size: 13.4px;
  line-height: 1.4;
  font-weight: 640;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-thought {
  font-family: var(--font-serif);
  font-size: 46px;
  line-height: 1.15;
  font-weight: 400;
  font-style: italic;
  font-optical-sizing: auto;
  font-variation-settings: "opsz" 24;
}

.type-chat {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.45;
  font-weight: 400;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-body {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.65;
  font-weight: 400;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-model-note {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 360;
  font-style: italic;
  font-optical-sizing: auto;
}

.type-figure-title {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.3;
  font-weight: 600;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-caption {
  font-family: var(--font-serif);
  font-size: 13.4px;
  line-height: 1.5;
  font-weight: 400;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-code {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
  font-style: normal;
  font-optical-sizing: auto;
}

.type-mark-visualize {
  font-family: var(--font-mark);
  font-size: 48px;
  line-height: 1;
  font-weight: 400;
  font-style: italic;
  font-optical-sizing: auto;
}

/* Стили страниц движка по сетке «Дизайна» (согласована автором 15.11, образец — lab/grid/src/tpl.html).
   Цвета, шрифты, отступы и размеры сетки — только переменные из design/tokens.json.
   Переломы (@media) переменными не задать — значения повторяют layout-bp-* из токенов,
   и сборка проверяет, что они совпадают. */

:root {
  --gutter: clamp(var(--layout-gutter-min), 4vw, var(--layout-gutter-max));
  /* Колонки: текст 1–6, правое поле (мысль модели) 8–10, картинки 1–9, история 1–4 и 6–12. */
  --col-text: 1 / 7;
  --col-margin: 8 / 11;
  --col-wide: 1 / 10;
  --col-steps: 1 / 5;
  --col-canvas: 6 / -1;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: calc(var(--layout-header) + var(--space-3)); }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-serif);
       font-optical-sizing: auto; letter-spacing: 0; }
/* Крупные заголовки — текстовым рисунком Литераты (opsz 24 в токенах): на дисплейном оптическом
   размере волосяные штрихи слишком тонкие против основных (решение «Дизайна»). */
.hero h1 { font-variation-settings: var(--type-h1-variation, normal); }
.prose > h2, .index h1 { font-variation-settings: var(--type-h2-variation, normal); }
h1, h2, h3, h4 { font-feature-settings: "case" 1; text-wrap: balance; }
/* Крупный кегль на телефоне: длинное слово («информационно-аналитических») шире экрана.
   Переносим по слогам, где у браузера есть словарь, иначе — где придётся, но не вбок. */
h1, h2 { hyphens: auto; overflow-wrap: break-word; }
p, li { text-wrap: pretty; }
a { color: var(--navy); text-underline-offset: 0.15em; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--space-2); top: var(--space-2); z-index: 30; background: var(--surface); padding: var(--space-1); }

/* ---------- сетка: 12 колонок во всю ширину окна, всё от левого края сетки ---------- */
.g { display: grid; grid-template-columns: repeat(var(--layout-columns), minmax(0, 1fr)); column-gap: var(--layout-gap);
     max-width: calc(var(--layout-page) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.g > * { grid-column: 1 / -1; min-width: 0; }

/* ---------- шапка-небо: прилипает на всём сайте; справа от знака — «где вы» ---------- */
.sky { position: sticky; top: 0; z-index: 20; background: var(--sky); color: var(--sky-ink); }
.sky-bar { display: flex; align-items: center; gap: var(--space-3); height: var(--layout-header); }
.home { color: inherit; text-decoration: none; flex: none; font-size: 20px; }
.where { min-width: 0; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--sky-ink);
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
         opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s; }
.where.on { opacity: .75; visibility: visible; }
.where:hover { opacity: 1; }
.where b { font-weight: 600; }

/* ---------- первый экран статьи ---------- */
.hero { padding-top: var(--space-12); }
.meta { margin: 0 0 var(--space-3); color: var(--muted); }
.hero h1 { grid-column: 1 / -1; max-width: 22ch; margin: 0 0 var(--space-6);
           font-size: clamp(var(--type-h1-mobile-size), 5.6vw, var(--type-h1-size));
           line-height: var(--type-h1-line); font-weight: var(--type-h1-weight); letter-spacing: -.005em; }

/* ---------- текст статьи ---------- */
.prose { padding-bottom: var(--space-12); overflow-wrap: break-word; }
/* Длинный адрес или слово без пробелов переносится, только когда иначе не влезает в строку:
   на телефоне такой адрес выталкивал страницу вбок. */
.prose > * { grid-column: var(--col-text); max-width: var(--layout-text); margin: 0 0 var(--space-3); }
.prose > h2 { grid-column: var(--col-wide); max-width: none; margin: var(--space-10) 0 var(--space-3);
              font-size: clamp(30px, 3.2vw, var(--type-h2-size)); line-height: 1.1; font-weight: var(--type-h2-weight); }
.prose > h3 { margin: 40px 0 var(--space-1); font-size: var(--type-h3-size); line-height: var(--type-h3-line);
              font-weight: var(--type-h3-weight); }
.prose > h4 { margin: var(--space-4) 0 var(--space-1); font-size: var(--type-body-size); font-weight: 600; }
.prose ul, .prose ol { padding-left: var(--space-3); }
.prose li + li { margin-top: var(--space-1); }
.prose blockquote { padding-left: var(--space-3); color: var(--ink-2); }
.prose code { font-family: var(--font-mono); font-size: 0.85em; }
.prose > pre { grid-column: var(--col-wide); max-width: none; font-family: var(--font-mono); font-size: var(--type-code-size);
               background: var(--surface-deep); padding: var(--space-2); overflow-x: auto; border-radius: var(--radius-2); }
/* Таблица прокручивается в своей обёртке, а не тянет страницу вбок. */
.prose > .table-wrap { grid-column: var(--col-wide); max-width: none; overflow-x: auto; }
.prose table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: var(--space-1); text-align: left; vertical-align: top; }
.prose > hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-6) 0; }
.prose .anchor { display: none; }
.prose > .footnotes { grid-column: var(--col-text); color: var(--ink-2); font-size: 0.85em; border-top: 1px solid var(--line);
                      padding-top: var(--space-3); margin-top: var(--space-6); }

/* Картинки и ролики — шире текста (1–9), растр не шире 1040; вокруг рисунка 48. */
.prose > :is(figure.image, p:has(> a.zoom), p:has(> .anim-box), p:has(> video)) {
  grid-column: var(--col-wide); max-width: none; margin: var(--space-3) 0 var(--space-6); }
/* Поля в сетке не схлопываются: 24 от абзаца выше + 24 = 48 над рисунком. */
.prose :is(figure.image, p) :is(img, video) { max-width: min(100%, 1040px); border-radius: var(--radius-2); }
.prose figure.image > * { margin: 0; }
.prose figcaption { max-width: var(--layout-text); margin-top: var(--space-2); font-size: var(--type-caption-size);
                    line-height: var(--type-caption-line); color: var(--ink-2); }

/* Мысль модели: карандаш — курсив графитом на правом поле (решение «Дизайна»). */
.prose > .model { grid-column: var(--col-margin); max-width: 320px; font-style: italic; font-weight: 360;
                  font-size: var(--type-model-note-size); line-height: var(--type-model-note-line); color: var(--model-ink); }

/* История: шаги слева (1–4), один график справа (6–12) прилипает и меняется по шагам. */
.prose > .scrolly { grid-column: 1 / -1; max-width: none; display: grid; grid-template-columns: subgrid; margin: var(--space-6) 0; }
.scrolly > .step { grid-column: var(--col-steps); min-height: 76svh; }
.scrolly > .step:last-of-type { min-height: 0; padding-bottom: 36svh; }
.stage { grid-column: var(--col-canvas); grid-row: 1 / span 100; position: sticky; top: calc(var(--layout-header) + 6svh);
         align-self: start; min-height: 60svh; background: var(--surface-deep); border-radius: var(--radius-2); }
.control { font: inherit; color: var(--navy); background: none; border: 1px solid var(--line);
           border-radius: var(--radius-2); padding: 0 var(--space-1); cursor: pointer; }

/* ---------- оглавление: карта чтения ----------
   От layout-bp-toc — колонка слева от сетки, прилипает (шапка + 96), знак в шапке на той же вертикали.
   Уже — строка «где вы» в шапке, по нажатию список в окне (site.js).
   У раздела номер и линия под названием, заполняется тушью по мере чтения (--p от 0 до 1, ставит скрипт). */
.toc-rail { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc-sections { display: grid; gap: 14px; counter-reset: section; font-size: var(--type-caption-size); line-height: 1.4; }
.toc-section { --p: 0; counter-increment: section; position: relative; padding-left: 28px; }
.toc-section::before { content: counter(section); position: absolute; left: 0; top: 0;
                       color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }
.toc-sections a { display: block; color: var(--muted); text-decoration: none; }
.toc-section > a { padding-bottom: 6px; background: linear-gradient(to right, var(--ink) calc(var(--p) * 100%), var(--line) 0)
                   left bottom / 100% 1px no-repeat; }
.toc-subsections { display: grid; gap: 6px; padding-top: 8px; }
.toc-sections a:hover { color: var(--ink); }
.toc-section.is-current > a, .toc-section.is-current::before { color: var(--ink); font-weight: 600; }
.toc-section:not(.is-current) .toc-subsections { display: none; }
.toc-subsections a { color: var(--ink-2); }

.toc-dialog { width: min(100vw - 32px, 30rem); max-height: 80vh; padding: var(--space-3);
              border: 1px solid var(--line); border-radius: var(--radius-2); background: var(--surface); color: var(--ink); }
.toc-dialog::backdrop { background: color-mix(in srgb, var(--sky) 45%, transparent); }
.toc-dialog .toc-sections { font-size: 16px; }

@media (min-width: 1400px) {
  /* Место под оглавлением съедает колонку — текст берёт 7 колонок, чтобы остаться около 660. */
  .with-toc { --col-text: 1 / 8; --col-margin: 9 / 12; --col-steps: 1 / 6; --col-canvas: 7 / -1; }
  .with-toc .g { padding-left: calc(var(--gutter) + var(--layout-toc) + var(--layout-toc-gap));
                 max-width: calc(var(--layout-page) + 2 * var(--gutter) + var(--layout-toc) + var(--layout-toc-gap)); }
  .with-toc .sky .g { padding-left: var(--gutter); }
  .article { position: relative; }
  .toc-rail { display: block; position: absolute; top: 0; bottom: 0; width: var(--layout-toc);
              left: calc(max(0px, (100% - var(--layout-page) - 2 * var(--gutter) - var(--layout-toc) - var(--layout-toc-gap)) / 2) + var(--gutter)); }
  .toc { position: sticky; top: calc(var(--layout-header) + var(--space-12));
         max-height: calc(100vh - var(--layout-header)); overflow-y: auto; }
  .where { display: none; }
}

/* Средняя ширина: правое поле уходит под абзац, всё в одну колонку. */
@media (max-width: 1100px) {
  :root { --col-text: 1 / -1; --col-margin: 1 / -1; --col-wide: 1 / -1; --col-steps: 1 / 6; --col-canvas: 7 / -1; }
  .prose > .model { padding-left: var(--space-3); margin-top: calc(-1 * var(--space-1)); }
}
/* Телефон: график истории прилипает под шапкой, шаги проходят под ним. */
@media (max-width: 860px) {
  :root { --layout-gap: 16px; }
  .hero { padding-top: var(--space-6); }
  .hero h1 { margin-bottom: var(--space-4); }
  .prose > h2 { margin-top: var(--space-8); }
  .prose > .scrolly { display: block; }
  .stage { position: sticky; top: var(--layout-header); z-index: 1; min-height: 46svh; }
  .scrolly > .step { min-height: 52svh; }
  .home { font-size: 17px; }
}

/* ---------- главная и 404 ---------- */
.index { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.index > * { grid-column: var(--col-text); max-width: var(--layout-text); }
.index h1 { margin: 0 0 var(--space-6); font-size: clamp(30px, 3.2vw, var(--type-h2-size)); font-weight: var(--type-h2-weight); }
.index-list { list-style: none; padding: 0; margin: 0; }
.index-list li { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.index-list a { color: var(--ink); text-decoration: none; }
.index-list a:hover { color: var(--navy); }
.index-list p { color: var(--muted); margin: var(--space-1) 0 0; }

.footer { color: var(--muted); padding-top: var(--space-6); padding-bottom: var(--space-6); border-top: 1px solid var(--line); }
.footer p { margin: 0; }

/* ---------- картинка на весь экран (site.js; без скрипта ссылка открывает оригинал) ---------- */
.prose a.zoom { display: block; cursor: zoom-in; }
.zoom-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: var(--space-3);
               border: 0; background: var(--surface); cursor: zoom-out; }
.zoom-dialog::backdrop { background: var(--surface); }
.zoom-dialog img, .zoom-dialog video { width: 100%; height: 100%; object-fit: contain; }
.zoom-dialog video { cursor: auto; }
.zoom-close { position: fixed; top: var(--space-2); right: var(--space-2); font: inherit; color: var(--ink);
              background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-2);
              padding: var(--space-1) var(--space-2); cursor: pointer; }

/* Бывшие GIF: ролик по кругу, кнопка паузы в центре. Вид кнопки — до решения «Дизайна». */
.prose video.anim { height: auto; display: block; }
.prose a.zoom video.anim { cursor: zoom-in; }
.anim-box { position: relative; display: block; width: fit-content; max-width: 100%; }
.anim-toggle { position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 56px; height: 56px;
               display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%;
               background: var(--surface); color: var(--ink); cursor: pointer; opacity: 0; transition: opacity .2s; }
.anim-toggle svg { width: 24px; height: 24px; fill: currentColor; }
.anim-box:hover .anim-toggle, .anim-toggle:focus-visible, .anim-box.paused .anim-toggle { opacity: .9; }
@media (hover: none) { .anim-toggle { opacity: .75; } }

/* Ночью растровые картинки и ролики чуть приглушены (решение «Дизайна» 14.11).
   SVG не трогаем — они на токенах. Рамок нет: рамка делает из картинки карточку. */
:root[data-theme="night"] :is(.prose, .zoom-dialog) :is(img:not([src$=".svg"]), video) { filter: brightness(.88); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) :is(.prose, .zoom-dialog) :is(img:not([src$=".svg"]), video) { filter: brightness(.88); }
}

/* Пиксель Метрики для читателей без скрипта: на странице не виден. */
.metrika-pixel { position: absolute; left: -9999px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- ссылка на любой кусок текста (site.js) ----------
   Значок у абзаца — в промежутке слева от текста, только при наведении мышью.
   Кнопка «Ссылка» — над выделенной фразой. Вид временный, до решения «Дизайна». */
.link-mark, .select-link { position: absolute; top: 0; left: 0; z-index: 15; opacity: 0; visibility: hidden;
                           transition: opacity .15s ease, visibility .15s; cursor: pointer; }
.link-mark.on, .select-link.on { opacity: 1; visibility: visible; }
.link-mark { translate: var(--x) var(--y); width: 24px; height: 24px; padding: 2px; border: 0; border-radius: var(--radius-2);
             background: none; color: var(--muted); }
.link-mark:hover { color: var(--navy); }
.link-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: none) {
  .link-mark { display: none; }
  /* Заголовок на телефоне: значок-цепочка после текста, всегда виден, бледный. */
  .prose .anchor { display: inline-block; width: 0.8em; height: 0.8em; margin-left: 0.3em; vertical-align: -0.05em;
                   background: var(--muted); opacity: .6;
                   mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E") center / contain no-repeat; }
}
.select-link { translate: calc(var(--x) - 50%) var(--y); padding: 6px 12px; border: 0; border-radius: var(--radius-2);
               background: var(--sky); color: var(--sky-ink); font: inherit; font-size: 14px; }
.link-toast { position: fixed; left: 50%; bottom: var(--space-3); z-index: 40; translate: -50% 8px; margin: 0;
              padding: 8px 16px; border-radius: var(--radius-2); background: var(--sky); color: var(--sky-ink);
              font-size: 14px; opacity: 0; transition: opacity .2s ease, translate .2s ease; pointer-events: none; }
.link-toast.on { opacity: 1; translate: -50% 0; }

/* Пришли по ссылке на абзац — он на мгновение подсвечен, чтобы глаз нашёл место. */
.prose > :target { animation: target-flash 2.4s ease-out; }
/* Фон бумаги поглубже с полями 8 px (тенью — вёрстка не сдвигается); цвет данных в текст не пускаем. */
@keyframes target-flash {
  from { background: var(--surface-deep); box-shadow: -8px 0 0 var(--surface-deep), 8px 0 0 var(--surface-deep); }
  to { background: transparent; box-shadow: -8px 0 0 transparent, 8px 0 0 transparent; }
}
/* Знак: сгенерирован движком из design/logo/. */
.lk { display: inline-block; white-space: nowrap; line-height: 1; font-weight: 800; }
.lk svg { display: inline-block; fill: currentColor; }
.lk-dot { width: 0.2249em; height: 0.2249em; margin: 0 0.2202em 0 0.0668em; vertical-align: -0.04em; }
.lk-vis { height: 0.8860em; vertical-align: -0.0477em; }
