/* ============================================================
   Антон Клевцов · Серия стримов — унифицированные стили
   Светлый редакционный лонгрид. Один файл на все выпуски.
   Подключается из папки каждого стрима как ../assets/styles.css
   ============================================================ */

/* ---------- Шрифты (Google Fonts, с кириллицей) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Prata&family=Spectral:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=Golos+Text:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ---------- Дизайн-токены ---------- */
:root {
  /* Палитра — тёплая бумага + чернила + биржевой изумруд */
  --paper:        #f5f1e8;
  --paper-2:      #efe9db;
  --paper-card:   #fbf8f1;
  --ink:          #1c1b17;
  --ink-soft:     #4c4a42;
  --ink-faint:    #7a776c;
  --line:         rgba(28, 27, 23, 0.14);
  --line-strong:  rgba(28, 27, 23, 0.30);

  --accent:       #0f5c3f;   /* глубокий изумруд */
  --accent-deep:  #0a3f2b;
  --accent-bright:#1a7a54;
  --pos:          #1a7a54;   /* плюс */
  --neg:          #b23a2e;   /* минус */
  --gold:         #b1853a;   /* тонкий золотой акцент */

  /* Типографика */
  --font-display: 'Prata', Georgia, serif;
  --font-serif:   'Spectral', Georgia, 'Times New Roman', serif;
  --font-sans:    'Golos Text', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Ритм и габариты — три уровня ширины + боковые рельсы для grid */
  --measure: 44rem;          /* колонка чтения (текст) */
  --measure-wide: 60rem;     /* широкие блоки: графика, таблицы, карточки */
  --measure-full: 78rem;     /* обложка, футер, полноширинные блоки */
  --rail: clamp(0rem, 7vw, 8rem); /* вынос широких блоков за колонку текста */
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --aside-w: clamp(15rem, 19vw, 17rem); /* ширина левого сайдбара-оглавления */
  --radius: 4px;
  --shadow: 0 1px 0 rgba(28,27,23,0.04), 0 18px 40px -28px rgba(28,27,23,0.45);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.06rem, 0.55vw + 0.95rem, 1.22rem);
  line-height: 1.72;
  font-feature-settings: "onum" 1, "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Бумажная фактура: лёгкое зерно + виньетка */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(140% 100% at 50% 0%, rgba(255,255,255,0.5), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(28,27,23,0.05), transparent 60%);
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ---------- Прогресс-бар чтения ---------- */
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent));
  z-index: 100; transition: width 0.1s linear;
}

/* ---------- Каркас страницы: сайдбар + контент ---------- */
.wrap { position: relative; z-index: 1; }

.page-shell {
  display: grid;
  grid-template-columns: var(--aside-w) minmax(0, 1fr);
  align-items: start;
}
.page-main { grid-column: 2; min-width: 0; position: relative; z-index: 1; }

/* Базовый контейнер — полная редакционная ширина (обложка, футер) */
.container {
  width: 100%;
  max-width: var(--measure-full);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.bleed { max-width: var(--measure-full); }

/* Единая контентная сетка: центральная колонка текста + боковые рельсы,
   в которые «вырываются» широкие блоки. Одна вертикальная ось для
   обложки, секций и футера — чтобы верх и низ не выбивались. */
.section > .container,
.cover  > .container,
.footer > .container {
  display: grid;
  padding-inline: 0;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, var(--rail))
    [text-start] min(100% - var(--gutter) * 2, var(--measure)) [text-end]
    minmax(0, var(--rail)) [wide-end]
    minmax(var(--gutter), 1fr) [full-end];
}
/* По умолчанию всё ложится в читаемую колонку */
.section > .container > *,
.cover  > .container > *,
.footer > .container > * { grid-column: text-start / text-end; min-width: 0; }
/* Широкие блоки занимают колонку текста + обе рельсы */
.section > .container > .figure,
.section > .container > .stat-grid,
.section > .container > .glossary,
.section > .container > .calc,
.section > .container > .table-scroll,
.section > .container > .pullquote,
.section > .container > .wide { grid-column: wide-start / wide-end; }
/* Полноширинные блоки — на всю сетку секции */
.section > .container > .full { grid-column: full-start / full-end; }

/* ============================================================
   ЛЕВЫЙ САЙДБАР-ОГЛАВЛЕНИЕ
   ============================================================ */
.toc-rail {
  grid-column: 1;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: clamp(1.5rem, 3vw, 2.4rem) clamp(1rem, 2vw, 1.6rem);
  border-right: 1px solid var(--line);
  background: var(--paper-2);
  overscroll-behavior: contain;
}
.toc-rail__head {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding-bottom: 1.1rem; border-bottom: 1px solid var(--line);
}
.toc-rail__head .mono {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  color: var(--accent); text-transform: uppercase;
}
.toc-rail__head b {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.25rem; color: var(--ink); line-height: 1.1;
}
.toc-rail__foot { margin-top: auto; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.toc-rail__foot a {
  font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500;
  color: var(--ink-soft); text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: color 0.2s var(--ease);
}
.toc-rail__foot a:hover { color: var(--accent); }

/* Кнопка-бургер (видна только на планшете/мобайле) */
.toc-toggle {
  display: none;
  position: fixed; top: 0.85rem; left: 0.85rem; z-index: 95;
  align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.9rem 0.55rem 0.75rem;
  font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600;
  color: var(--ink); background: var(--paper-card);
  border: 1px solid var(--line-strong); border-radius: 100px;
  box-shadow: var(--shadow); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toc-toggle__bars { position: relative; width: 1.1rem; height: 0.72rem; flex: none; }
.toc-toggle__bars, .toc-toggle__bars::before, .toc-toggle__bars::after {
  display: block;
}
.toc-toggle__bars::before, .toc-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--accent); border-radius: 2px; transition: transform 0.28s var(--ease), top 0.28s var(--ease), opacity 0.2s;
}
.toc-toggle__bars { border-top: 2px solid var(--accent); }
.toc-toggle__bars::before { top: 4px; }
.toc-toggle__bars::after  { top: 9px; }
body.nav-open .toc-toggle { border-color: var(--accent); }

/* Затемнение под выехавшей панелью */
.toc-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(20, 18, 14, 0.45);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.toc-backdrop.open { opacity: 1; visibility: visible; }

/* ============================================================
   ШАПКА / ОБЛОЖКА
   ============================================================ */
.cover {
  position: relative;
  padding: clamp(2.5rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}
.cover__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex; flex-wrap: wrap; gap: 0.4rem 1rem;
  align-items: center;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.cover__eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.cover__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7.5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}
.cover__title em { font-style: italic; color: var(--accent); }
.cover__lead {
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 300;
  max-width: 34rem;
  margin: 0 0 2rem;
}
.cover__lead b { font-weight: 600; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  font-family: var(--font-sans);
  font-size: 0.82rem; font-weight: 500;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  color: var(--ink-soft);
  background: rgba(255,255,255,0.35);
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.chip b { color: var(--accent); font-weight: 700; }

/* ============================================================
   ОГЛАВЛЕНИЕ
   ============================================================ */
.toc { margin: 0; }
.toc__label {
  font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 0.7rem;
}
.toc__list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc__list li { counter-increment: toc; }
.toc__list a {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.4rem 0.5rem; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 0.9rem; font-weight: 500;
  line-height: 1.3; color: var(--ink-soft); text-decoration: none;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.toc__list a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  color: var(--accent); flex: none; width: 1.4rem;
}
.toc__list a:hover { color: var(--ink); background: rgba(28,27,23,0.05); }
.toc__list a.is-active {
  color: var(--accent); font-weight: 600;
  background: rgba(15,92,63,0.08);
}
.toc__list a.is-active::before { color: var(--gold); }

/* ============================================================
   СЕКЦИИ И ТИПОГРАФИКА ТЕЛА
   ============================================================ */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; scroll-margin-top: 2rem; }
.section + .section { border-top: 1px solid var(--line); }

.section__num {
  font-family: var(--font-mono);
  font-size: 0.78rem; letter-spacing: 0.18em; color: var(--accent);
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.9rem;
}
.section__num::before {
  content: ""; width: 1.8rem; height: 1px; background: var(--gold);
}
h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.8rem, 3.6vw, 3rem); line-height: 1.08;
  letter-spacing: -0.01em; margin: 0 0 1.4rem; text-wrap: balance;
}
h3 {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.2;
  margin: 2.4rem 0 0.8rem;
}
p { margin: 0 0 1.25rem; }
.section > .container > p:first-of-type,
.lead-para { font-size: 1.08em; }

/* Буквица для первого абзаца секции */
.dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 3.6em; line-height: 0.78; float: left;
  padding: 0.05em 0.12em 0 0; color: var(--accent);
}

a.inline { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line-strong); transition: border-color 0.2s; }
a.inline:hover { border-color: var(--accent); }

strong { font-weight: 700; }
em { font-style: italic; }
mark {
  background: linear-gradient(transparent 58%, rgba(177,133,58,0.32) 58%);
  color: inherit; padding: 0 0.05em;
}
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.tick {
  font-family: var(--font-mono); font-size: 0.84em; font-weight: 500;
  background: var(--paper-2); border: 1px solid var(--line);
  padding: 0.05em 0.4em; border-radius: 3px; white-space: nowrap;
}

/* Списки */
.list { margin: 0 0 1.4rem; padding: 0; list-style: none; }
.list li { position: relative; padding-left: 1.6rem; margin-bottom: 0.7rem; }
.list li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.72em;
  width: 0.5rem; height: 0.5rem; border: 1px solid var(--accent);
  transform: rotate(45deg);
}

/* ============================================================
   ВЫНОСКИ / ЦИТАТЫ
   ============================================================ */
.pullquote {
  margin: clamp(2.4rem, 5vw, 4rem) 0;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.7rem);
  line-height: 1.18; letter-spacing: -0.01em;
  color: var(--accent-deep); text-wrap: balance;
  text-align: center;
  max-width: 48rem; margin-inline: auto;
}
.pullquote::before { content: "«"; color: var(--gold); }
.pullquote::after  { content: "»"; color: var(--gold); }

blockquote {
  margin: 1.8rem 0; padding: 0.4rem 0 0.4rem 1.6rem;
  border-left: 3px solid var(--accent);
  font-style: italic; color: var(--ink-soft);
}
blockquote cite {
  display: block; margin-top: 0.6rem; font-style: normal;
  font-family: var(--font-sans); font-size: 0.82rem; font-weight: 500;
  color: var(--ink-faint); letter-spacing: 0.02em;
}
blockquote cite::before { content: "— "; }

/* Реплика-цитата из опроса (карточка с кавычкой) */
.voice {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem 1.6rem;
  margin: 1rem 0; font-style: italic; color: var(--ink-soft);
  box-shadow: var(--shadow); position: relative;
}
.voice::before {
  content: "“"; position: absolute; top: -0.3rem; left: 0.7rem;
  font-family: var(--font-display); font-size: 3rem; color: var(--line-strong);
  font-style: normal;
}
.voice p { margin: 0; padding-left: 1.4rem; }

/* ============================================================
   КАРТОЧКИ-ФАКТЫ / СТАТЫ
   ============================================================ */
.stat-grid {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin: 1.8rem 0;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}
.stat {
  background: var(--paper-card); padding: 1.3rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.stat__num {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1;
  color: var(--accent); letter-spacing: -0.02em;
}
.stat__num .unit { font-size: 0.5em; color: var(--ink-faint); }
.stat__label {
  font-family: var(--font-sans); font-size: 0.82rem; font-weight: 500;
  color: var(--ink-soft); line-height: 1.3;
}

/* ============================================================
   ГРАФИКИ (чистый CSS)
   ============================================================ */
.figure {
  margin: 2rem 0; padding: 1.6rem; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.figure__title {
  font-family: var(--font-sans); font-weight: 600; font-size: 1rem;
  margin-bottom: 0.3rem;
}
.figure__sub {
  font-family: var(--font-sans); font-size: 0.82rem; color: var(--ink-faint);
  margin-bottom: 1.3rem;
}
.figure__cap {
  font-family: var(--font-sans); font-size: 0.78rem; color: var(--ink-faint);
  margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dotted var(--line);
}

/* Горизонтальные бары */
.bars { display: flex; flex-direction: column; gap: 0.9rem; }
.bar { display: grid; grid-template-columns: 1fr; gap: 0.35rem; }
.bar__head { display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-sans); font-size: 0.88rem; }
.bar__head b { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; }
.bar__track { height: 0.7rem; background: var(--paper-2); border-radius: 100px; overflow: hidden; }
.bar__fill {
  height: 100%; width: var(--val, 0%); border-radius: 100px;
  background: linear-gradient(90deg, var(--accent-bright), var(--accent));
  transform-origin: left; animation: grow 1.1s var(--ease) both;
}
.bar__fill.neg { background: linear-gradient(90deg, #cf5749, var(--neg)); }
.bar__fill.muted { background: var(--ink-faint); opacity: 0.5; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Донат-кольцо */
.donut-row { display: flex; flex-wrap: wrap; gap: 1.8rem; align-items: center; }
.donut {
  --p: 50; --size: 9.5rem;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  background:
    radial-gradient(closest-side, var(--paper-card) 70%, transparent 71%),
    conic-gradient(var(--accent) calc(var(--p) * 1%), var(--paper-2) 0);
  display: grid; place-items: center; position: relative;
}
.donut__center { text-align: center; }
.donut__center b { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 700; color: var(--accent); display: block; line-height: 1; }
.donut__center span { font-family: var(--font-sans); font-size: 0.72rem; color: var(--ink-faint); }
.donut-legend { font-family: var(--font-sans); font-size: 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.donut-legend i { width: 0.7rem; height: 0.7rem; display: inline-block; border-radius: 2px; margin-right: 0.5rem; vertical-align: middle; }

/* Линия спреда (SVG) */
.spread svg { width: 100%; height: auto; display: block; }
.spread .grid line { stroke: var(--line); stroke-width: 1; }
.spread .ser-a { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.spread .ser-b { fill: none; stroke: var(--neg); stroke-width: 2.5; stroke-dasharray: 5 4; }
.spread .gap { fill: rgba(15,92,63,0.10); }

/* ============================================================
   ТАБЛИЦЫ (сравнение)
   ============================================================ */
.table-scroll { overflow-x: auto; margin: 1.8rem 0; -webkit-overflow-scrolling: touch; }
table.compare {
  width: 100%; border-collapse: collapse; min-width: 32rem;
  font-size: 0.96rem; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
table.compare thead th {
  font-family: var(--font-sans); font-weight: 600; text-align: left;
  padding: 0.9rem 1.1rem; font-size: 0.9rem;
  border-bottom: 2px solid var(--line-strong);
}
table.compare thead th.neg-col { color: var(--neg); }
table.compare thead th.pos-col { color: var(--pos); }
table.compare td {
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line);
  vertical-align: top; line-height: 1.5;
}
table.compare tr:last-child td { border-bottom: none; }
table.compare td:first-child {
  font-family: var(--font-sans); font-weight: 500; font-size: 0.88rem;
  color: var(--ink-faint); width: 9rem;
}
table.compare .c-neg { background: rgba(178,58,46,0.045); }
table.compare .c-pos { background: rgba(26,122,84,0.05); }

/* ============================================================
   ГЛОССАРИЙ / СЛОВАРЬ
   ============================================================ */
.glossary { display: grid; gap: 1rem; margin: 1.8rem 0;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.term {
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.term:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.term__name {
  font-family: var(--font-serif); font-weight: 700; font-size: 1.12rem;
  margin-bottom: 0.45rem; display: flex; align-items: center; gap: 0.5rem;
}
.term__name .glyph { font-family: var(--font-mono); color: var(--accent); font-size: 0.9rem; }
.term__desc { font-size: 0.92rem; color: var(--ink-soft); line-height: 1.55; }

/* ============================================================
   WORKED EXAMPLE / КАЛЬКУЛЯТОР
   ============================================================ */
.calc {
  margin: 2rem 0; border: 1px solid var(--line-strong); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.calc__head {
  background: var(--accent-deep); color: #f3efe4; padding: 1rem 1.4rem;
  font-family: var(--font-sans); font-weight: 600; display: flex;
  justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.calc__head .mono { color: #c9e3d6; font-size: 0.85rem; }
.calc__body { background: var(--paper-card); padding: 0.4rem 1.4rem; }
.calc__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.85rem 0; border-bottom: 1px dotted var(--line);
}
.calc__row:last-child { border-bottom: none; }
.calc__row .k { font-family: var(--font-sans); font-size: 0.92rem; color: var(--ink-soft); }
.calc__row .v { font-family: var(--font-mono); font-weight: 500; font-size: 1rem; white-space: nowrap; }
.calc__row.total { background: rgba(26,122,84,0.06); margin: 0 -1.4rem; padding: 1rem 1.4rem; }
.calc__row.total .k { color: var(--ink); font-weight: 600; }
.calc__row.total .v { color: var(--pos); font-weight: 700; font-size: 1.2rem; }

/* ============================================================
   TIMELINE (карьера / расписание)
   ============================================================ */
.timeline { margin: 1.8rem 0; padding: 0; list-style: none; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 0.46rem; top: 0.4rem; bottom: 0.4rem;
  width: 2px; background: linear-gradient(var(--accent), var(--line));
}
.timeline li { position: relative; padding: 0 0 1.5rem 2.2rem; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 0.35em;
  width: 1rem; height: 1rem; border-radius: 50%;
  background: var(--paper); border: 3px solid var(--accent);
}
.timeline li.now::before { background: var(--accent); box-shadow: 0 0 0 4px rgba(15,92,63,0.18); }
.timeline .t-date {
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500;
  color: var(--accent); letter-spacing: 0.03em;
}
.timeline .t-title { font-family: var(--font-serif); font-weight: 600; font-size: 1.08rem; margin: 0.1rem 0 0.2rem; }
.timeline .t-desc { font-size: 0.92rem; color: var(--ink-soft); }

/* ============================================================
   Q&A (аккордеон)
   ============================================================ */
.qa { margin: 1.8rem 0; border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2.2rem 1.1rem 0;
  font-family: var(--font-serif); font-weight: 600; font-size: 1.1rem;
  position: relative; transition: color 0.2s;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; position: absolute; right: 0.2rem; top: 50%;
  transform: translateY(-50%); font-family: var(--font-mono); font-weight: 400;
  font-size: 1.5rem; color: var(--accent); transition: transform 0.25s var(--ease);
}
.qa details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.qa summary:hover { color: var(--accent); }
.qa__a { padding: 0 0 1.3rem; color: var(--ink-soft); }
.qa__a p { margin: 0 0 0.8rem; }
.qa__a p:last-child { margin-bottom: 0; }

/* ============================================================
   ССЫЛКИ-РЕСУРСЫ
   ============================================================ */
.resource-note {
  font-family: var(--font-sans); font-size: 0.88rem; color: var(--ink-faint);
  background: var(--paper-2); border-left: 3px solid var(--gold);
  padding: 0.9rem 1.1rem; margin: 1.5rem 0; border-radius: 0 var(--radius) var(--radius) 0;
}
.resource-note a { color: var(--accent); }

/* ============================================================
   ФУТЕР
   ============================================================ */
.footer {
  margin-top: clamp(3rem, 7vw, 5rem); padding: clamp(2.5rem, 6vw, 4rem) 0 3rem;
  border-top: 2px solid var(--ink); background: var(--paper-2);
}
.disclaimer {
  font-family: var(--font-sans); font-size: 0.84rem; line-height: 1.6;
  color: var(--ink-faint); border: 1px dashed var(--line-strong);
  padding: 1.1rem 1.3rem; border-radius: var(--radius); margin-bottom: 2rem;
}
.footer__nav { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 1.5rem; }
.footer__nav a, .footer__nav span {
  font-family: var(--font-sans); font-size: 0.86rem; font-weight: 500;
  padding: 0.55rem 1rem; border: 1px solid var(--line-strong);
  border-radius: 100px; text-decoration: none; color: var(--ink-soft);
}
.footer__nav a:hover { border-color: var(--accent); color: var(--accent); }
.footer__nav .disabled { opacity: 0.45; }
.footer__sign {
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* ---------- Появление при скролле ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   АДАПТИВ
   Сетка на min()/minmax()/clamp() перестраивается плавно сама:
   на широких экранах появляются боковые рельсы для широких блоков,
   к планшету рельсы схлопываются и текст занимает почти всю ширину.
   Брейкпоинты ниже лишь донастраивают плотность.
   ============================================================ */

/* Планшет и мобайл — сайдбар прячется в бургер-меню (overlay),
   контент занимает всю ширину. Порог: 1080px. */
@media (max-width: 1080px) {
  .page-shell { display: block; }
  .page-main { grid-column: auto; }
  .toc-toggle { display: inline-flex; }

  .toc-rail {
    position: fixed; inset: 0 auto 0 0;
    width: min(86vw, 340px); max-width: 22rem;
    transform: translateX(-100%);
    transition: transform 0.32s var(--ease);
    z-index: 90; box-shadow: 0 0 60px rgba(20,18,14,0.3);
    border-right: 1px solid var(--line-strong);
  }
  .toc-rail.open { transform: none; }

  body.nav-open { overflow: hidden; }

  /* кнопка-бургер не должна перекрывать шапку обложки */
  .cover { padding-top: clamp(4.5rem, 8vw, 6rem); }
}

/* Планшет — рельсы сжимаем, текст почти во всю ширину */
@media (max-width: 1024px) {
  :root { --rail: clamp(0rem, 4vw, 4rem); }
}

/* Узкий планшет / крупный телефон — рельсы убираем,
   всё выстраивается в одну колонку */
@media (max-width: 760px) {
  :root { --rail: 0rem; }
  .pullquote { text-align: left; }
  .pullquote::before, .pullquote::after { content: none; }
}

/* Телефон */
@media (max-width: 640px) {
  :root { --gutter: clamp(1.1rem, 5vw, 1.6rem); }
  .dropcap::first-letter { font-size: 3em; }
  .donut-row { gap: 1.2rem; }
  table.compare td:first-child { width: auto; }
  /* плотные карточки в один столбец */
  .glossary { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .calc__head { font-size: 0.95rem; }
}

/* Очень узкие экраны */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
}
