/* ==========================================================
   Сергей Довыдов — стиль сайта (вариант E)
   Редакционная вёрстка + техно-акценты
   ========================================================== */

/* @font-face — в src/fonts.css (подключается, когда файлы шрифтов лежат в public/fonts) */

:root {
  --paper: #F3F3F0;
  --ink: #111317;
  --ink-2: #3F434A;
  --muted: #62656C;
  --rule: #D5D6D2;
  --grid: #E3E4E0;
  --stripe-a: #E4E5E1;
  --stripe-b: #ECECE8;
  --lime: #C4EE62;
  --on-ink: #F3F3F0;
  --on-ink-muted: #A9ACB2;
  --ink-line: #33363C;

  --display: 'Unbounded', 'Arial Black', 'Helvetica Neue', sans-serif;
  --text: 'Golos Text', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  --gutter: 88px;
  --max: 1440px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.6; }
h1, h2, h3, p, figure, blockquote, ul, ol { margin: 0; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { overflow-wrap: break-word; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; text-underline-offset: 5px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; background: var(--lime); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; padding: 8px 12px; background: var(--lime); }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Atoms ---------- */
.mono { font-family: var(--mono); }
.chip { display: inline-block; align-self: flex-start; justify-self: start; width: fit-content; font-family: var(--mono); font-size: 13px; line-height: 1.3; letter-spacing: 0.08em; text-transform: uppercase; background: var(--lime); color: var(--ink); padding: 5px 9px; text-decoration: none; }
.chip--dark { background: var(--ink); color: var(--lime); }
.chip--sm { font-size: 12px; }
.label { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }
.more { font-weight: 600; font-size: 16px; }
.grid-bg { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 40px 40px; }
.ph { color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 14px 24px; font-size: 16px; font-weight: 600; text-decoration: none; border: 1px solid var(--ink); }
.btn--ink { background: var(--ink); color: var(--lime); }
.btn--line { background: transparent; color: var(--ink); font-weight: 500; }
.btn--lime { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.btn:hover { text-decoration: none; filter: brightness(1.05); }

.photo { display: block; overflow: hidden; background: var(--rule); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.placeholder { background: repeating-linear-gradient(135deg, var(--stripe-a) 0 14px, var(--stripe-b) 14px 28px); display: flex; align-items: flex-end; padding: 16px; }
.placeholder span { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--paper); padding: 6px 10px; }
.video { background: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--on-ink-muted); font-family: var(--mono); font-size: 12px; text-decoration: none; }
.video iframe { width: 100%; height: 100%; border: 0; }

.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 24px; border-bottom: 1px solid var(--ink); padding-bottom: 16px; }
.sec-head h2 { font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1.15; text-transform: uppercase; }

/* ---------- Header ---------- */
.topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }
.topline nav { display: flex; gap: 24px; align-items: center; }
.topline a { text-decoration: none; }
.masthead { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 36px 0 28px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.masthead__name { font-family: var(--display); font-weight: 600; font-size: 72px; line-height: 1; text-transform: uppercase; letter-spacing: -0.01em; text-decoration: none; text-align: center; }
.masthead__claim { max-width: 780px; text-align: center; font-size: 21px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; font-size: 15px; font-weight: 500; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"], .nav a:hover { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; text-underline-offset: 6px; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; border-bottom: 3px solid var(--ink); }
.bar__name { font-family: var(--display); font-weight: 600; font-size: 20px; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.bar .nav { gap: 12px 30px; justify-content: flex-end; align-items: center; }

.menu { display: none; }
.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: flex; align-items: center; justify-content: flex-end; }
.menu summary::-webkit-details-marker { display: none; }
.menu__panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 3px solid var(--ink); padding: 8px 20px 20px; z-index: 5; display: flex; flex-direction: column; }
.menu__panel a { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 17px; font-weight: 500; text-decoration: none; }

/* ---------- Home ---------- */
.lead { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); border-bottom: 1px solid var(--ink); }
.lead__story { padding: 56px 56px 64px 0; border-right: 1px solid var(--ink); display: flex; flex-direction: column; gap: 28px; }
.lead__story h1 { font-family: var(--display); font-weight: 500; font-size: 50px; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.lead__story h1 a { text-decoration: none; }
.lead__story .dek { font-size: 21px; line-height: 1.5; color: var(--ink-2); max-width: 760px; text-wrap: pretty; }
.lead__story .placeholder { height: 360px; }
.lead__author { padding: 56px 0 64px 48px; display: flex; flex-direction: column; gap: 24px; }
.lead__author .placeholder, .lead__author .photo { height: 300px; }
.lead__author .big { font-size: 20px; line-height: 1.5; text-wrap: pretty; }
.lead__author .small { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 12px; }

.empty { padding: 56px 56px 64px 0; border-right: 1px solid var(--ink); display: flex; flex-direction: column; gap: 20px; justify-content: center; }
.empty h1 { font-family: var(--display); font-weight: 500; font-size: 44px; line-height: 1.15; text-wrap: balance; }

/* Промежуток между карточками задаётся column-gap, а не боковыми паддингами:
   при паддингах крайние карточки получались на 40px шире средней (у них одна
   сторона прижата к краю полосы), и превью в них рисовались крупнее. Разделитель
   поэтому рисуется псевдоэлементом по центру промежутка, а не бордюром колонки. */
.latest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 80px; border-bottom: 1px solid var(--ink); }
.latest > * { position: relative; padding: 40px 0 48px; display: flex; flex-direction: column; gap: 16px; }
.latest > *:not(:last-child)::after { content: ''; position: absolute; top: 0; bottom: 0; right: -40px; width: 1px; background: var(--rule); }
.card h3 { font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.3; text-wrap: balance; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-color: var(--lime); }
.card p { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.card--quote h3 { font-weight: 400; }

.section { padding-top: 80px; display: flex; flex-direction: column; gap: 36px; }
.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.topic { display: flex; flex-direction: column; gap: 14px; }
.topic h3 { font-family: var(--display); font-weight: 500; font-size: 20px; line-height: 1.3; }
.topic h3 a { text-decoration: none; }
.topic p { font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.chanrow { display: flex; flex-wrap: wrap; gap: 10px; }
.chan { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; border: 1px solid var(--ink); padding: 10px 16px; transition: background .15s; }
.chan:hover { background: var(--lime); }
sup { font-size: 75%; line-height: 0; position: relative; top: -0.45em; vertical-align: baseline; }
.footer nav { align-items: baseline; }
.footnote { flex-basis: 100%; font-family: var(--mono); font-size: 11px; line-height: 1.6; color: var(--muted); margin-top: 4px; }

/* Ряд площадок и программ */
/* Те же грабли, что были в .latest: на боковых паддингах крайние карточки
   получались шире средних, и логотипы в них рисовались крупнее. Промежуток
   задаётся column-gap, разделитель — псевдоэлементом по центру промежутка,
   нижняя линия переехала на контейнер, иначе она рвалась бы на промежутках. */
.venues { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 56px;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.venue { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  min-height: 128px; padding: 24px 0; text-decoration: none; }
.venue:not(:last-child)::after { content: ''; position: absolute; top: 0; bottom: 0; right: -28px; width: 1px; background: var(--rule); }
a.venue:hover .venue__name { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.venue__name { font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1.25; text-wrap: balance; }
/* высота каждого знака задаётся в site.json через --lh: у одно- и трёхстрочных
   логотипов при одинаковой высоте сильно разный оптический размер */
.venue__logo { display: block; max-width: 100%; max-height: var(--lh, 44px); width: auto; height: auto; object-fit: contain; object-position: left center; }
.venue__role { font-family: var(--mono); font-size: 12px; line-height: 1.5; letter-spacing: .04em; color: var(--muted); }

/* Картинка-марка в карточках разборов */
.thumb { display: block; text-decoration: none; }
.thumb .photo { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--rule); }
.thumb .photo img { object-position: 50% 50%; }
.lead__story .thumb .photo { aspect-ratio: 16 / 9; }

.talks-teaser { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 48px; }
.talks-teaser .video { height: 380px; }
.talk-row { padding: 22px 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 6px; }
.talk-row:first-child { padding-top: 0; }
.talk-row:last-child { border-bottom: 0; }
.talk-row .t { font-size: 19px; line-height: 1.45; max-width: 900px; }
.talks-list { border-top: 1px solid var(--rule); padding-top: 8px; }

.media-box { margin-top: 96px; border: 1px solid var(--ink); padding: 56px; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 56px; align-items: center; }
.media-box h2 { font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1.25; text-wrap: balance; }
.media-box--ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.kv { display: flex; flex-direction: column; }
.kv > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--rule); font-size: 17px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.media-box--ink .kv > div { border-color: var(--ink-line); }
.media-box--ink .kv dt { color: var(--on-ink-muted); }
.media-box--ink a { color: var(--lime); }
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tags span { font-family: var(--mono); font-size: 13px; border: 1px solid #4A4D55; color: #C9CBCF; padding: 6px 10px; }

/* ---------- Footer ---------- */
.footer { margin-top: 88px; border-top: 3px solid var(--ink); padding: 24px 0 40px; display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Article ---------- */
.art-head { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 52px; padding: 56px 0 48px; }
.art-head__main { display: flex; flex-direction: column; gap: 24px; }
.art-head h1 { font-family: var(--display); font-weight: 500; font-size: 52px; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.art-head .dek { font-size: 22px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.art-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.art-meta b { font-weight: 400; color: var(--ink); }
.draft-flag { font-family: var(--mono); font-size: 12px; background: var(--ink); color: var(--lime); padding: 4px 8px; align-self: flex-start; }
.art-cover { height: 520px; }
.art-body { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 52px; padding-top: 64px; align-items: start; }
.rail { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--ink); padding-top: 16px; }
.rail a { font-size: 15px; line-height: 1.4; text-decoration: none; color: var(--muted); }
.rail a:hover { color: var(--ink); }
.rail .label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; }

.prose { max-width: 720px; font-size: 20px; line-height: 1.7; display: flex; flex-direction: column; gap: 28px; counter-reset: h2; }
.prose p { text-wrap: pretty; }
.prose h2 { font-family: var(--display); font-weight: 500; font-size: 28px; line-height: 1.3; padding-top: 20px; counter-increment: h2; scroll-margin-top: 24px; text-wrap: balance; }
.prose h2::before { content: counter(h2, decimal-leading-zero); display: inline-block; margin-right: 14px; vertical-align: 0.3em; font-family: var(--mono); font-size: 14px; font-weight: 400; background: var(--lime); padding: 4px 8px; line-height: 1.3; }
.prose h3 { font-family: var(--display); font-weight: 500; font-size: 21px; line-height: 1.3; }
.prose ul, .prose ol { padding-left: 1.2em; display: flex; flex-direction: column; gap: 10px; }
.prose li::marker { color: var(--muted); }
.prose blockquote { border: 1px solid var(--ink); padding: 28px 32px; font-size: 18px; line-height: 1.6; }
.prose blockquote strong:first-child { display: inline-block; font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; background: var(--ink); color: var(--lime); padding: 5px 9px; margin-right: 8px; }
.prose code { font-family: var(--mono); font-size: 0.85em; background: var(--stripe-a); padding: 1px 5px; }
.prose pre { min-width: 0; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--stripe-a); border-left: 3px solid var(--lime); padding: 18px 22px; font-size: 16px; line-height: 1.6; }
.prose pre code { background: none; padding: 0; font-size: 0.95em; }
.prose table { border-collapse: collapse; font-size: 16px; width: 100%; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.prose .table { overflow-x: auto; }
.prose hr { border: 0; border-top: 3px solid var(--ink); margin: 0; align-self: stretch; }
.disclaimer { font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--muted); padding-top: 16px; border-top: 1px solid var(--rule); }

/* Ответ на вопрос статьи в двух-трёх предложениях. Стоит первым: его цитируют
   и поисковики, и языковые модели, и читатель, который дальше не пойдёт. */
.tldr { border-left: 4px solid var(--lime); padding: 4px 0 4px 22px; display: flex; flex-direction: column; gap: 10px; }
.tldr__k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tldr p { font-size: 21px; line-height: 1.55; text-wrap: pretty; }

.prose figure { margin: 40px 0; }
.prose figure a { display: block; text-decoration: none; }
.legal .chip, .page-title .chip { white-space: normal; }
.prose figure img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.prose figcaption { margin-top: 12px; font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--muted); }
.author-box { margin-top: 16px; background: var(--ink); color: var(--on-ink); padding: 32px; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 24px; align-items: start; font-size: 16px; line-height: 1.6; }
.author-box .ph-img { display: block; width: 96px; height: 96px; overflow: hidden; background: repeating-linear-gradient(135deg, #2A2D33 0 8px, #33363C 8px 16px); }
.author-box .ph-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.author-box b { font-family: var(--display); font-weight: 500; font-size: 18px; text-transform: uppercase; display: block; margin-bottom: 8px; }
.author-box p { color: #C9CBCF; }
.author-box .row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.author-box .btn--line { color: var(--on-ink); border-color: #4A4D55; }

.also { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.also > * { padding: 8px 40px 0 0; display: flex; flex-direction: column; gap: 14px; }
.also > * + * { padding: 8px 40px 0 40px; border-left: 1px solid var(--rule); }
.also > *:last-child { padding-right: 0; }

/* ---------- List page ---------- */
.page-title { padding: 64px 0 56px; border-bottom: 1px solid var(--ink); display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px 64px; align-items: end; }
.page-title__main { display: flex; flex-direction: column; gap: 24px; }
.page-title h1 { font-family: var(--display); font-weight: 500; font-size: 56px; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.page-title p { font-size: 20px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 24px 0; border-bottom: 1px solid var(--rule); }
.filters a { font-family: var(--mono); font-size: 13px; padding: 7px 12px; border: 1px solid var(--ink); text-decoration: none; }
.filters a[aria-current="page"] { background: var(--lime); border-color: var(--lime); }
.list-row { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; padding: 32px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.list-row--nopic { grid-template-columns: minmax(0, 1fr); }
.list-row > div { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.list-row h2 { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.25; text-wrap: balance; }
.list-row h2 a { text-decoration: none; }
.list-row p { font-size: 17px; color: var(--ink-2); }
.list-empty { padding: 56px 0; font-size: 20px; color: var(--ink-2); }

/* ---------- About ---------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); border-bottom: 1px solid var(--ink); }
.about-hero__text { padding: 72px 64px 72px 0; border-right: 1px solid var(--ink); display: flex; flex-direction: column; gap: 28px; justify-content: center; }
.about-hero h1 { font-family: var(--display); font-weight: 500; font-size: 54px; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.about-hero p { font-size: 22px; line-height: 1.5; color: var(--ink-2); max-width: 640px; text-wrap: pretty; }
.about-hero__photo { padding: 48px 0 48px 48px; display: flex; flex-direction: column; justify-content: center; }
.about-hero__photo .placeholder, .about-hero__photo .photo { height: 560px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.path-row { display: grid; grid-template-columns: 120px 320px minmax(0, 1fr); gap: 40px; padding: 28px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.path-row:last-child { border-bottom-color: var(--ink); }
.path-row h3 { font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.3; }
.path-row p { font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.path-row .chip { justify-self: start; font-size: 14px; letter-spacing: 0; text-transform: none; }
.creds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.creds > div { background: var(--paper); padding: 28px; display: flex; flex-direction: column; gap: 12px; min-height: 180px; }
.creds .kind { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; }
.creds .t { font-family: var(--display); font-weight: 500; font-size: 20px; line-height: 1.3; }
.creds .n { margin-top: auto; font-size: 15px; color: var(--ink-2); }
.creds .chip { margin-top: auto; align-self: flex-start; font-size: 12px; }

/* ---------- Talks ---------- */
.talk { display: grid; grid-template-columns: 560px minmax(0, 1fr); gap: 56px; padding: 48px 0; border-bottom: 1px solid var(--rule); }
.talk:last-child { border-bottom-color: var(--ink); }
.vidbox { position: relative; aspect-ratio: 16 / 9; background: var(--ink); overflow: hidden; }
.vidbox iframe, .vidbox video { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.vidbox__play { position: absolute; inset: 0; display: grid; place-items: center; border: 0; padding: 0; background: rgba(17, 19, 23, 0.28); cursor: pointer; transition: background .15s; }
.vidbox__play:hover { background: rgba(17, 19, 23, 0.12); }
.vidbox__play svg { filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .65)); }
.vidbox__title { margin-top: 18px; font-family: var(--display); font-weight: 500; font-size: 22px; line-height: 1.3; max-width: 760px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.shot { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.shot .photo { aspect-ratio: 16 / 9; }
.shot figcaption { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.talks-teaser .photo { height: 380px; }
.talk .video, .talk .placeholder, .talk .photo { height: 315px; }
.talk__body { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.talk__body h2 { font-family: var(--display); font-weight: 500; font-size: 32px; line-height: 1.2; }
.talk__body p { font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.talk__links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: auto; }

/* ---------- Media page ---------- */
.bio-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; padding: 28px 0; border-bottom: 1px solid var(--rule); }
.bio-row h3 { font-family: var(--display); font-weight: 500; font-size: 20px; }
.bio-row p { font-size: 18px; line-height: 1.65; max-width: 820px; }
.photos2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.press-photos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: dense; gap: 24px; }
.press-photo { grid-column: span 2; }
.press-photo { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.press-photo--wide { grid-column: span 3; }
.press-photo--full { grid-column: 1 / -1; }
.press-photo figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.press-photo figcaption a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .press-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .press-photo { grid-column: span 1; }
  .press-photo--wide, .press-photo--full { grid-column: span 2; }
  .press-photo .photo { height: 220px !important; }
  .press-photo:first-child { grid-column: span 2; }
  .press-photo figcaption { font-size: 13px; }
  .press-photo figcaption a { white-space: nowrap; }
}
.topic-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.topic-list ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.topic-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); font-size: 16px; line-height: 1.5; }
.topic-list li::before { content: ""; width: 9px; height: 9px; background: var(--lime); outline: 1px solid var(--ink); margin-top: 7px; }

.legal { max-width: 820px; padding: 56px 0 0; font-size: 18px; line-height: 1.7; display: flex; flex-direction: column; gap: 20px; }
.legal h1 { font-family: var(--display); font-weight: 500; font-size: 40px; line-height: 1.15; }
.legal h2 { font-family: var(--display); font-weight: 500; font-size: 22px; padding-top: 12px; }

.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-left: auto; background: var(--ink); color: var(--on-ink); padding: 18px 20px; display: flex; gap: 16px; align-items: center; font-size: 14px; line-height: 1.5; z-index: 20; }
/* важно: без этой строки атрибут hidden не работает — display: flex выше его перебивает,
   и баннер не скрывается ни по кнопке, ни при повторном заходе */
.cookie[hidden] { display: none; }
.cookie a { color: var(--lime); }
.cookie button { font: inherit; font-weight: 600; background: var(--lime); color: var(--ink); border: 0; padding: 10px 16px; min-height: 44px; cursor: pointer; }

/* ==========================================================
   Адаптив
   ========================================================== */
@media (max-width: 1180px) {
  :root { --gutter: 40px; }
  .masthead__name { font-size: 56px; }
  .bar .nav { display: none; }
  .menu { display: block; }
  .bar { position: relative; }
  .art-head, .art-body { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .art-head > .label:first-child, .art-head > div:last-child:empty, .rail--right { display: none; }
  .rail { position: static; }
  .prose { max-width: none; }
  .prose figure { margin: 28px 0; }
  .talk { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  .path-row { grid-template-columns: 90px 220px minmax(0, 1fr); gap: 24px; }
  .creds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; }
  body { font-size: 16px; }
  .topline { font-size: 11px; }
  .topline nav { display: none; }
  .masthead { padding: 20px 0 16px; align-items: flex-start; }
  .masthead__name { font-size: 26px; text-align: left; }
  .masthead .nav { display: none; }
  .home-head { position: relative; }
  /* меню на главной: сама кнопка прижата к правому краю, а выпадающая панель
     считает ширину от шапки целиком, а не от кнопки (иначе схлопывается в столбик) */
  .home-head .menu { display: block; position: static; }
  .home-head .menu > summary { position: absolute; right: 0; top: 52px; }
  .home-head .menu__panel { position: absolute; left: 0; right: 0; top: 100%; }

  .lead, .latest, .topics, .photos2, .talks-teaser, .media-box, .also, .page-title, .about-hero, .talk, .topic-list { grid-template-columns: minmax(0, 1fr); }
  .lead__story, .empty { padding: 28px 0 32px; border-right: 0; border-bottom: 1px solid var(--ink); gap: 16px; }
  .lead__story h1 { font-size: 27px; line-height: 1.2; }
  .empty h1 { font-size: 26px; }
  .lead__story .dek { font-size: 17px; }
  .lead__story .placeholder { height: 200px; }
  .lead__author { padding: 28px 0 32px; gap: 16px; }
  .lead__author .placeholder, .lead__author .photo { height: 260px; }
  .lead__author .btn { width: 100%; }
  .latest { column-gap: 0; }
  .latest > *, .latest > *:first-child, .latest > *:last-child { padding: 24px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .latest > *:not(:last-child)::after { display: none; }
  .latest > *:last-child { border-bottom: 0; }
  .card h3 { font-size: 19px; }
  .section { padding-top: 48px; gap: 20px; }
  .sec-head h2 { font-size: 22px; }
  .topics { gap: 24px; }
  .talks-teaser { gap: 16px; }
  .talks-teaser .video { height: 200px; }
  .media-box { margin-top: 48px; padding: 24px; gap: 20px; }
  .media-box h2 { font-size: 20px; }
  .kv > div { grid-template-columns: 96px minmax(0, 1fr); padding: 12px 0; font-size: 15px; }
  .footer { flex-direction: column; margin-top: 48px; }

  .art-head { padding: 28px 0 24px; gap: 16px; }
  .art-head h1 { font-size: 28px; line-height: 1.2; }
  .art-head .dek { font-size: 18px; }
  .art-cover { height: 220px; }
  .art-body { padding-top: 32px; }
  .prose { font-size: 17px; gap: 20px; }
  .tldr { padding-left: 16px; }
  .tldr p { font-size: 18px; }
  .prose h2 { font-size: 21px; }
  .prose h2::before { margin-right: 10px; }
  .prose blockquote { padding: 20px; font-size: 16px; }
  .author-box { grid-template-columns: 1fr; padding: 24px; }
  .author-box .btn { width: 100%; }
  .also > *, .also > * + * { padding: 20px 0; border-left: 0; border-bottom: 1px solid var(--rule); }

  .page-title { padding: 32px 0; gap: 16px; }
  .page-title h1 { font-size: 30px; }
  .page-title p { font-size: 17px; }
  .list-row, .list-row--nopic { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 24px 0; }
  /* на телефоне два столбца: правому нужен отступ от разделительной линии,
     иначе текст прилипает к ней вплотную */
  .venues { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0; }
  .venue, .venue:first-child, .venue:last-child { min-height: 0; padding: 20px 0; border-right: 0;
    border-bottom: 1px solid var(--rule); }
  .venue:not(:last-child)::after { display: none; }
  .venue:nth-child(odd) { padding-right: 22px; border-right: 1px solid var(--rule); }
  .venue:nth-child(even) { padding-left: 22px; }
  .venue__name { font-size: 18px; }
  .venue__logo { max-height: calc(var(--lh, 44px) * 0.85); }
  .masthead__claim { font-size: 16px; line-height: 1.5; text-align: left; }
  .list-row h2 { font-size: 20px; }

  .about-hero__text { padding: 32px 0; border-right: 0; border-bottom: 1px solid var(--ink); gap: 20px; }
  .about-hero h1 { font-size: 30px; }
  .about-hero p { font-size: 18px; }
  .about-hero__photo { padding: 24px 0; }
  .about-hero__photo .placeholder, .about-hero__photo .photo { height: 380px; }
  .path-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 22px 0; }
  .path-row h3 { font-size: 19px; }
  .path-row p { font-size: 16px; }
  .creds { grid-template-columns: minmax(0, 1fr); }
  .creds > div { min-height: 0; }

  .talk { gap: 16px; padding: 28px 0; }
  .talk .video, .talk .placeholder, .talk .photo { height: 200px; }
  /* на телефоне фото идут лентой с горизонтальной прокруткой: три кадра
     столбиком заняли бы почти весь экран */
  .gallery { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .gallery .shot { flex: 0 0 76%; scroll-snap-align: start; }
  .gallery .shot figcaption { font-size: 14px; }
  .venue { justify-content: flex-start; }
  .shot .photo { aspect-ratio: 16 / 9; }
  .talks-teaser .photo { height: 200px; }
  .talk__body h2 { font-size: 22px; }
  .talk__body p { font-size: 16px; }

  .bio-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .bio-row p { font-size: 16px; }
  .topic-list { gap: 28px; }
  .legal h1 { font-size: 24px; }
  .cookie { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { .topline, .masthead .nav, .bar .nav, .menu, .footer nav, .author-box .row, .cookie { display: none !important; } }

/* Переход на индекс карт в разделе «Карты и платежи». Лайм здесь подложка чипа
   и цвет текста на чёрной кнопке, но никогда не текст на светлом фоне. */
.index-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px;
  align-items: center; padding: 32px 0; border-bottom: 1px solid var(--ink); }
.index-cta__text { display: flex; flex-direction: column; gap: 12px; }
.index-cta h2 { font-family: var(--display); font-weight: 500; font-size: 32px; line-height: 1.15; }
.index-cta p { font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 62ch; }
@media (max-width: 720px) {
  .index-cta { grid-template-columns: 1fr; }
  .index-cta .btn { width: 100%; }
}

/* Вариант внутри статьи: рамка вместо линии снизу, заголовок абзацем. */
/* Карточка-превью другого разбора внутри текста: {{card:slug}} */
.link-card a { display: grid; grid-template-columns: 240px minmax(0, 1fr); border: 1px solid var(--rule); background: #fff; text-decoration: none; color: var(--ink); transition: border-color .15s; }
.link-card a:hover { border-color: var(--ink); }
/* Марка целиком, без обрезки: object-fit contain, а поля сливаются с фоном — у марок он того же цвета */
.link-card__img { position: relative; display: block; width: 100%; min-height: 146px; background: #111317; overflow: hidden; }
.link-card__img picture { background: transparent !important; }
.link-card__img picture, .link-card__img img { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; object-fit: contain !important; }
.link-card__b { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; min-width: 0; }
.link-card__k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.link-card__t { font-family: var(--display); font-weight: 500; font-size: 17px; line-height: 1.3; }
.link-card__d { font-size: 15px; line-height: 1.45; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-card__u { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: auto; }
@media (max-width: 720px) {
  .link-card a { grid-template-columns: 1fr; }
  .link-card__img { aspect-ratio: 16 / 9; min-height: 0; }
  .link-card__b { padding: 14px 16px; }
  .link-card__d { font-size: 14px; }
}
.index-cta--inline { border: 1px solid var(--ink); padding: 28px 32px; grid-template-columns: 1fr; justify-items: start; gap: 24px; }
.index-cta .index-cta__title { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.2; color: var(--ink); }
@media (max-width: 720px) { .index-cta--inline { padding: 24px 20px; } }

/* ==========================================================
   Тёмная тема — по выбору читателя, кнопкой в шапке.
   Выбор хранится в localStorage под ключом site-theme, атрибут data-theme="dark"
   ставит скрипт в <head> до отрисовки, поэтому вспышки светлой страницы нет.
   Почти всё перекрашивается через переменные. Ниже — места, где в светлой теме
   «чернилами» закрашен фон (кнопки, плашка автора, медиа-блок): в тёмной они
   становятся панелью, а текст на лайме всегда остаётся тёмным.
   ========================================================== */
.theme-btn { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; background: transparent; color: inherit;
  border: 1px solid var(--rule); padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.theme-btn:hover { border-color: var(--lime); }
.menu__panel .theme-btn { margin-top: 16px; align-self: flex-start; font-size: 14px; padding: 10px 14px; }

:root[data-theme="dark"] {
  --paper: #111317;
  --ink: #EDF1F5;
  --ink-2: #B4BBC6;
  --muted: #7C8694;
  --rule: #2A303A;
  --grid: #1A1E25;
  --stripe-a: #1C2027;
  --stripe-b: #171A20;
  --lime: #C8F135;
  --on-ink: #EDF1F5;
  --on-ink-muted: #9AA3AF;
  --ink-line: #2A303A;
  --panel: #1A1E25;
  color-scheme: dark;
}
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .btn--lime,
:root[data-theme="dark"] .cookie button,
:root[data-theme="dark"] .filters a[aria-current="page"],
:root[data-theme="dark"] .chan:hover,
:root[data-theme="dark"] .prose h2::before,
:root[data-theme="dark"] :focus-visible { color: #111317; }
:root[data-theme="dark"] .chip--dark,
:root[data-theme="dark"] .draft-flag,
:root[data-theme="dark"] .prose blockquote strong:first-child { background: var(--panel); color: var(--lime); }
:root[data-theme="dark"] .btn--ink { background: var(--lime); color: #111317; border-color: var(--lime); }
:root[data-theme="dark"] .author-box,
:root[data-theme="dark"] .media-box--ink,
:root[data-theme="dark"] .cookie { background: var(--panel); color: var(--ink); border: 1px solid var(--rule); }
:root[data-theme="dark"] .video,
:root[data-theme="dark"] .vidbox { background: #0B0D10; }
:root[data-theme="dark"] .author-box .btn--line { color: var(--ink); border-color: var(--rule); }
:root[data-theme="dark"] .link-card a { background: var(--panel); color: var(--ink); border-color: var(--rule); }
:root[data-theme="dark"] .link-card a:hover { border-color: var(--lime); }
:root[data-theme="dark"] .placeholder span { background: var(--panel); }
:root[data-theme="dark"] .topic-list li::before { outline-color: var(--paper); }
/* Логотипы площадок нарисованы под светлый фон: в тёмной теме — на светлой плашке */
:root[data-theme="dark"] .venue__logo { background: #F3F3F0; padding: 8px 12px; box-sizing: content-box; }
/* Инфографика и картинки в тексте светлые: рамка отделяет их от тёмного фона */
:root[data-theme="dark"] .prose figure img { border-color: var(--rule); }
:root[data-theme="dark"] .prose code { background: var(--panel); }
:root[data-theme="dark"] .prose pre { background: var(--panel); }
:root[data-theme="dark"] .prose pre code { background: none; }

/* Пошаговые инструкции на поддомене — блок {{guides:...}} в статье */
.guides { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--ink); padding: 28px 32px; }
.guides .guides__title { font-family: var(--display); font-weight: 500; font-size: 26px; line-height: 1.2; color: var(--ink); }
.prose .guides ul { list-style: none; padding: 0; gap: 0; }
.guides li { border-top: 1px solid var(--rule); }
.guides li:last-child { border-bottom: 1px solid var(--rule); }
.guides a { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; text-decoration: none; color: var(--ink); border: 0; }
.guides a b { font-weight: 600; }
.guides a span { font-size: 15px; color: var(--ink-2); }
.guides a:hover b { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 2px; }
@media (max-width: 720px) { .guides { padding: 24px 20px; } }

/* Значок темы в строке разделов: квадрат в высоту плашки «Для СМИ», внутри круг, закрашенный наполовину */
.theme-btn--icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.theme-btn--icon span { width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 50%;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

/* Строка разделов: значок темы стоит отдельно от меню, справа, по центру строки.
   Пока разделы не помещаются в одну строку, вместо них показывается бургер — там своя кнопка темы. */
/* С рубрикой «Инструменты» (31.10.2026) пунктов стало восемь: шрифт и отступы чуть меньше, бургер включается раньше */
.bar .nav { gap: 12px 14px; font-size: 14px; }
@media (min-width: 1400px) and (max-width: 1499px) { .bar .nav { font-size: 13.5px; } }
@media (max-width: 1399px) {
  .bar .nav, .bar > .theme-btn--icon { display: none; }
  .bar .menu { display: block; }
  .bar { position: relative; }
}

/* Короткое видео к разбору */
.reel { margin: 28px 0 8px; max-width: 360px; }
.reel video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; background: #111317; border-radius: 10px; }
.reel figcaption { display: flex; gap: 10px; align-items: baseline; margin-top: 10px; font-size: 15px; color: var(--muted); }

/* «Я в СМИ»: плитка с логотипом издания и заголовок материала */
.press-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
.press-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.press-card__tile { display: flex; align-items: center; justify-content: center; height: 150px; padding: 20px;
  background: #fff; border: 1px solid var(--rule); transition: border-color .15s; }
.press-card:hover .press-card__tile { border-color: var(--ink); }
.press-card__logo { display: block; max-width: 100%; max-height: var(--lh, 56px); width: auto; height: auto; object-fit: contain; }
.press-card__name { font-family: var(--display); font-weight: 600; font-size: 22px; }
.press-card__title { font-size: 17px; line-height: 1.4; text-wrap: pretty; }
a.press-card:hover .press-card__title { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.press-card__meta { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
@media (max-width: 1180px) { .press-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .press-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; } .press-card__tile { height: 120px; } }
@media (max-width: 480px) { .press-grid { grid-template-columns: minmax(0, 1fr); } }
:root[data-theme="dark"] .press-card__tile { background: #F3F3F0; border-color: transparent; }

/* «Моя экспертиза»: карточки 2×2 по рубрикам */
.exp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.exp-card { position: relative; display: flex; flex-direction: column; gap: 16px; min-height: 260px; padding: 40px 44px;
  border-radius: 28px; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--rule); transition: transform .15s; }
.exp-card:hover { transform: translateY(-3px); }
.exp-card--lime { background: var(--lime); border-color: var(--lime); }
.exp-card--ink { background: #111317; border-color: #111317; color: #F3F3F0; }
.exp-card.exp-card--ink p { color: #C9CBC6; }
.exp-card__n { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; opacity: .7; }
.exp-card h3 { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.2; text-wrap: balance; }
.exp-card p { font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 46ch; }
.exp-card.exp-card--lime p { color: #2A2F22; }
.exp-card__more { margin-top: auto; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; }
@media (max-width: 860px) { .exp-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } .exp-card { min-height: 0; padding: 28px 24px; border-radius: 22px; } .exp-card h3 { font-size: 22px; } }
:root[data-theme="dark"] .exp-card--paper { background: #1A1D23; border-color: var(--rule); color: var(--ink); }
:root[data-theme="dark"] .exp-card--lime { color: #111317; }
:root[data-theme="dark"] .exp-card--ink { background: #F3F3F0; border-color: #F3F3F0; color: #111317; }
:root[data-theme="dark"] .exp-card.exp-card--ink p { color: #3A3F47; }
