/* ─────────────────────────────────────────────────────────────────────
   Graphik LC — гарнитура Центрального университета. Файлы взяты из
   брендовой дизайн-системы и лежат рядом, поэтому лонгрид набирается
   правильно на любой машине, а не только там, где шрифт установлен.
   ───────────────────────────────────────────────────────────────────── */
@font-face { font-family:'Graphik LC'; src:url('fonts/graphik-lc-400.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:'Graphik LC'; src:url('fonts/graphik-lc-500.woff2') format('woff2'); font-weight:500; font-style:normal; font-display:swap; }
@font-face { font-family:'Graphik LC'; src:url('fonts/graphik-lc-600.woff2') format('woff2'); font-weight:600; font-style:normal; font-display:swap; }

/* ─────────────────────────────────────────────────────────────────────
   Лонгриды курса «Чёрные ящики и цифровые агенты».
   Светлая поверхность — переключаемая альтернатива тёмной теме ЦУ:
   для чтения на 6–8 страниц и для печати она обязательна.
   ───────────────────────────────────────────────────────────────────── */
:root {
  --bg:       #ffffff;
  --ink:      #141414;
  --muted:    #454545;
  --border:   #454545;
  --accent:   #3995a1;
  --dark:     #141414;
  --surface:  color-mix(in oklch, #141414 4%, #ffffff);
  --rule:     color-mix(in oklch, #141414 18%, #ffffff);

  --font-display: 'Graphik LC', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-body:    'Graphik LC', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-mono:    'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  --r: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px) 120px; }
.col  { max-width: 66ch; }
p { margin: 0 0 1.05em; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
strong { font-weight: 600; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ─── шапка ─────────────────────────────────────────────────────────── */
.top {
  border-bottom: 1px solid var(--rule);
  padding: clamp(20px, 2.4vw, 34px) 0;
  margin-bottom: clamp(34px, 4.5vw, 76px);
  display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: baseline;
}
.top .mark { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.top .crumbs { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.top .back { margin-left: auto; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 2px; }

.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 18px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ''; width: 22px; height: 2px; background: var(--accent); flex: none; }

h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(34px, 4.4vw, 62px); line-height: 1.04; letter-spacing: 0;
  margin: 0 0 20px; max-width: 20ch;
}
.standfirst { font-size: clamp(19px, 1.5vw, 25px); line-height: 1.5; color: var(--muted); max-width: 60ch; margin: 0 0 30px; }

.facts { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: clamp(34px, 4vw, 64px); }
.facts div { padding: 16px 28px 16px 0; margin-right: 28px; border-right: 1px solid var(--rule); }
.facts div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.facts b { display: block; font-family: var(--font-mono); font-size: 17px; font-weight: 400; }
.facts span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ─── структура текста ──────────────────────────────────────────────── */
h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(25px, 2.3vw, 38px); line-height: 1.12; letter-spacing: 0;
  margin: clamp(46px, 5vw, 84px) 0 18px; max-width: 24ch;
}
h2 .n { font-family: var(--font-mono); font-size: 0.42em; font-weight: 400; color: var(--muted); display: block; margin-bottom: 10px; letter-spacing: 0.08em; }
h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(19px, 1.55vw, 26px); line-height: 1.2;
  margin: clamp(28px, 3vw, 44px) 0 12px; max-width: 30ch;
}
ul, ol { max-width: 66ch; margin: 0 0 1.05em; padding-left: 1.3em; }
li { margin-bottom: 0.45em; }
li::marker { color: var(--muted); }

/* ─── врезки ────────────────────────────────────────────────────────── */
.def {
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--rule);
  padding: 22px 0 20px; margin: clamp(28px, 3vw, 44px) 0;
  max-width: 66ch;
}
.def .t { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 10px; }
.def p:last-child { margin-bottom: 0; }
.def .term { font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 1.7vw, 28px); line-height: 1.16; margin: 0 0 10px; }

.stop {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: clamp(20px, 2.2vw, 32px); margin: clamp(30px, 3.2vw, 52px) 0; max-width: 66ch;
}
.stop .t { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 12px; }
.stop p:last-child, .stop ol:last-child, .stop ul:last-child { margin-bottom: 0; }

.pull {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(22px, 2vw, 32px); line-height: 1.25;
  border-left: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 26px 0; margin: clamp(34px, 3.6vw, 60px) 0; max-width: 30ch;
}

.example { border-top: 1px solid var(--rule); padding-top: 18px; margin: clamp(26px, 2.8vw, 44px) 0; max-width: 66ch; }
.example .t { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 10px; }

/* ─── таблица ───────────────────────────────────────────────────────── */
table { border-collapse: collapse; width: 100%; max-width: 100%; margin: clamp(26px, 2.8vw, 44px) 0; font-size: 0.9em; }
th, td { text-align: left; vertical-align: top; padding: 13px 20px 13px 0; border-top: 1px solid var(--rule); }
th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 400; border-top: 0; padding-top: 0; }
tbody tr:last-child td { border-bottom: 1px solid var(--rule); }
/* Первая колонка несёт ключевое слово строки — не рвём его переносом */
th:first-child, td:first-child { width: 23%; }
td:first-child { font-weight: 500; padding-right: 28px; hyphens: manual; -webkit-hyphens: manual; }

/* ─── словарь и вопросы ─────────────────────────────────────────────── */
.gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 44px; margin: clamp(24px, 2.6vw, 40px) 0; }
.gloss div { border-top: 1px solid var(--rule); padding: 13px 0; }
.gloss b { display: block; font-weight: 600; font-size: 0.97em; margin-bottom: 3px; }
.gloss span { color: var(--muted); font-size: 0.9em; line-height: 1.45; }

.qs { counter-reset: q; margin: clamp(24px, 2.6vw, 40px) 0; max-width: 66ch; }
.qs p { position: relative; padding-left: 46px; margin-bottom: 0.75em; }
.qs p::before {
  counter-increment: q; content: counter(q, decimal-leading-zero);
  position: absolute; left: 0; top: 0.18em;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted);
}

/* ─── подвал ────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--rule); margin-top: clamp(48px, 5vw, 90px); padding-top: 24px; display: flex; flex-wrap: wrap; gap: 12px 32px; }
.foot p { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); margin: 0; }
.foot a { text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 2px; }

.note { font-size: 0.88em; color: var(--muted); max-width: 66ch; }

/* ─── печать ────────────────────────────────────────────────────────── */
@media print {
  @page { margin: 18mm 16mm; }
  body { font-size: 11.5pt; line-height: 1.5; }
  .top .back, .foot a { display: none; }
  .wrap { max-width: none; padding: 0; }
  h1 { font-size: 26pt; }
  h2 { font-size: 16pt; margin-top: 22pt; page-break-after: avoid; }
  h3 { font-size: 13pt; page-break-after: avoid; }
  .stop, .def, .example, table, .pull { page-break-inside: avoid; }
  .facts { border: 0; }
}
