/* ─────────────────────────────────────────────────────────────
   Сейка — Гид по SEO для Рунета
   Docs-density aesthetic, dark/light, warm rust accent.
   ───────────────────────────────────────────────────────────── */

/* Self-hosted variable fonts on the static CDN; latin + cyrillic subsets. */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("https://static.seyka.ru/fonts/source-serif-4-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("https://static.seyka.ru/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("https://static.seyka.ru/fonts/jetbrains-mono-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("https://static.seyka.ru/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* TYPE */
  --font-sans: "Source Serif 4", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --fs-base: 15px;
  --lh-base: 1.55;
  --density: 1; /* 0.85 compact, 1 regular, 1.18 comfy */

  /* COLORS — light defaults */
  --bg:        #F4F0E8;
  --surface:   #FBF8F2;
  --surface-2: #EFEADF;
  --ink:       #1B1812;
  --ink-2:     #3C362C;
  --muted:     #786F62;
  --faint:     #A89F8E;
  --line:      #E2DBCB;
  --line-2:    #D2C9B6;
  --accent:    oklch(40% 0.04 250);
  --accent-2:  oklch(40% 0.04 250 / 0.10);
  --accent-ink:oklch(28% 0.04 250);
  --ok:        oklch(56% 0.12 145);
  --warn:      oklch(70% 0.16 75);
  --shadow:    0 1px 0 rgba(255,255,255,.6) inset, 0 1px 2px rgba(40,30,15,.05);

  /* SPACING (scales with density) */
  --gap: calc(8px * var(--density));
  --gap-2: calc(16px * var(--density));
  --gap-3: calc(24px * var(--density));
  --gap-4: calc(40px * var(--density));
  --gap-5: calc(64px * var(--density));
  --radius: 6px;
  --radius-lg: 10px;

  /* LAYOUT */
  --nav-w: 256px;
  --toc-w: 232px;
  --max-w: 1440px;
  --topbar-h: 52px;
}

[data-theme="dark"] {
  --bg:        #100E0A;
  --surface:   #181511;
  --surface-2: #20 1C16;
  --surface-2: #201C16;
  --ink:       #ECE6D9;
  --ink-2:     #C9C2B2;
  --muted:     #8A8273;
  --faint:     #5C5648;
  --line:      #2A2620;
  --line-2:    #3A352C;
  --accent:    oklch(82% 0.05 240);
  --accent-2:  oklch(82% 0.05 240 / 0.14);
  --accent-ink:oklch(88% 0.04 240);
  --shadow:    0 1px 0 rgba(255,255,255,.03) inset, 0 1px 2px rgba(0,0,0,.5);
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  color-scheme: light dark;
  /* Reserve the scrollbar gutter so the centered layout doesn't shift sideways
     when a classic (non-overlay) scrollbar appears after first paint. */
  scrollbar-gutter: stable;
  /* Every anchor jump (TOC, alpha bar, in-page links) leaves clearance for
     the sticky topbar so the target heading isn't hidden behind it. */
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  font-variant-numeric: tabular-nums;
  transition: background-color .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-2);
}
hr { border: 0; border-top: 1px solid var(--line); margin: var(--gap-3) 0; }

::selection { background: var(--accent-2); color: var(--accent-ink); }

/* ──────────────────────────────────────────────────
   TOP BAR
   ────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.topbar-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: var(--nav-w) 1fr auto;
  gap: var(--gap-2);
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-name { font-size: 15px; }
.brand-name span { color: var(--muted); font-weight: 500; }

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topnav a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--ink-2);
  white-space: nowrap;
  transition: color .12s ease, background-color .12s ease;
}
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topnav a.active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

.top-actions { display: flex; align-items: center; gap: 6px; }
.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 10px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 220px;
  transition: border-color .12s ease, color .12s ease;
}
.search-trigger:hover { border-color: var(--line-2); color: var(--ink-2); }
.search-trigger .placeholder { flex: 1; text-align: left; }
.search-trigger kbd { border-bottom-width: 1px; padding: 0 4px; font-size: 10.5px; }

.icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--muted);
  transition: background-color .12s ease, color .12s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ──────────────────────────────────────────────────
   LAYOUT — 3-column docs grid
   ────────────────────────────────────────────────── */
.app {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--toc-w);
  gap: var(--gap-4);
  align-items: start;
}
.app.has-toc { grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--toc-w); }
.app.no-toc  { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
.app.wide    { grid-template-columns: var(--nav-w) minmax(0, 1fr); }

/* SIDE NAV */
.sidenav {
  position: sticky;
  top: calc(var(--topbar-h) + 4px);
  padding-top: var(--gap-3);
  padding-bottom: var(--gap-3);
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  font-size: 13.5px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.sidenav h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: var(--gap-3) 0 var(--gap) 10px;
}
.sidenav h4:first-child { margin-top: 0; }
.sidenav ul { list-style: none; padding: 0; margin: 0; }
.sidenav li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius);
  color: var(--ink-2);
  transition: color .1s ease, background-color .1s ease;
  position: relative;
}
.sidenav li > a:hover { color: var(--ink); background: var(--surface-2); }
.sidenav li > a.active {
  color: var(--accent-ink);
  background: var(--accent-2);
  font-weight: 500;
}
[data-theme="dark"] .sidenav li > a.active { color: var(--accent); }
.sidenav .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.sidenav li > a.active .count { color: currentColor; opacity: .7; }

/* TOC (right rail) */
.toc {
  position: sticky;
  top: calc(var(--topbar-h) + 4px);
  padding-top: var(--gap-3);
  padding-bottom: var(--gap-3);
  font-size: 13px;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: var(--gap);
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li a {
  display: block;
  padding: 4px 0 4px 10px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  transition: color .1s ease, border-color .1s ease;
}
.toc li a:hover { color: var(--ink); border-left-color: var(--ink-2); }
.toc li a.active { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 500; }
[data-theme="dark"] .toc li a.active { color: var(--accent); }
.toc li.h3 a { padding-left: 22px; font-size: 12px; }

/* MAIN content */
.main {
  min-width: 0;
  padding: var(--gap-3) 0 var(--gap-3);
}

/* ──────────────────────────────────────────────────
   HEADINGS & TYPE
   ────────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.025em; }
h2 { font-size: 24px; margin: var(--gap-4) 0 var(--gap-2); letter-spacing: -0.02em; }
h3 { font-size: 17px; margin: var(--gap-3) 0 var(--gap); }
h4 { font-size: 14px; }
p  { margin: 0 0 var(--gap-2); text-wrap: pretty; max-width: 70ch; }
p.lede { font-size: 17px; color: var(--ink-2); max-width: 60ch; }
.prose p, .prose ul, .prose ol { color: var(--ink-2); }
.prose a { color: var(--accent-ink); border-bottom: 1px solid var(--accent-2); }
[data-theme="dark"] .prose a { color: var(--accent); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 var(--gap-2); }
.prose li { margin-bottom: 4px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--muted);
}
.eyebrow.no-rule::before { display: none; }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--gap);
}
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .sep { color: var(--faint); }

/* ──────────────────────────────────────────────────
   HERO (hub page)
   ────────────────────────────────────────────────── */
.hero {
  padding: var(--gap-4) 0 var(--gap-3);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--gap-4);
  align-items: end;
}
.hero h1 { max-width: 18ch; }
.hero .lede { margin-top: var(--gap-2); max-width: 56ch; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-3);
  padding: var(--gap-2) 0;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .num {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "ss01";
}
.stat .lbl {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-mascot {
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ──────────────────────────────────────────────────
   SECTION CARDS GRID
   ────────────────────────────────────────────────── */
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--gap-3) 0;
}
.section-card {
  position: relative;
  background: var(--surface);
  padding: var(--gap-3);
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: start;
  transition: background-color .15s ease;
  cursor: default;
}
.section-card:hover { background: var(--surface-2); }
.section-card .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.section-card:hover .idx { color: var(--accent); }
.section-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.section-card .meta {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.02em;
}
.section-card .arrow {
  align-self: center;
  color: var(--faint);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s ease, transform .15s ease, color .15s ease;
}
.section-card:hover .arrow { opacity: 1; transform: translateX(0); color: var(--accent); }
.section-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid transparent;
  transition: border-color .15s ease;
}
.section-card:hover::after { border-color: var(--accent); }

/* ──────────────────────────────────────────────────
   FEATURED / START PICKS
   ────────────────────────────────────────────────── */
.picks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap-2);
  margin: var(--gap-3) 0;
}
.pick {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--gap-3);
  transition: border-color .15s ease, transform .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pick:hover { border-color: var(--accent); transform: translateY(-2px); }
.pick .tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-2);
  padding: 3px 7px;
  border-radius: 4px;
  align-self: flex-start;
}
[data-theme="dark"] .pick .tag { color: var(--accent); }
.pick h3 { font-size: 16px; margin: 0; }
.pick p { font-size: 13px; color: var(--muted); margin: 0; }
.pick .read { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: auto; }

/* ──────────────────────────────────────────────────
   ARTICLE LIST (section listing page)
   ────────────────────────────────────────────────── */
.article-list {
  border-top: 1px solid var(--line);
  margin-top: var(--gap-3);
}
.article-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: var(--gap-2);
  align-items: baseline;
  padding: var(--gap-2) 0;
  border-bottom: 1px solid var(--line);
  cursor: default;
  transition: background-color .12s ease;
  position: relative;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 0;
}
.article-row:hover { background: var(--surface); }
.article-row .num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.article-row .title { font-size: 16px; font-weight: 500; color: var(--ink); margin: 0 0 4px; letter-spacing: -0.01em; }
.article-row .desc { font-size: 13.5px; color: var(--muted); margin: 0; max-width: 64ch; }
.article-row .right {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}
.article-row .right .pill {
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 3px;
}
.article-row:hover .num { color: var(--accent); }

/* ──────────────────────────────────────────────────
   GLOSSARY
   ────────────────────────────────────────────────── */
.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: var(--gap-2) 0 var(--gap-3);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.alpha-bar a {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--muted);
  transition: color .1s ease, background-color .1s ease;
}
.alpha-bar a:hover { background: var(--surface-2); color: var(--ink); }
.alpha-bar a.has { color: var(--ink); }
.alpha-bar a.has:hover { background: var(--accent-2); color: var(--accent-ink); }
.alpha-bar .disabled { opacity: 0.3; pointer-events: none; }

.term {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--gap-3);
  padding: var(--gap) 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}
.term:last-child { border-bottom: 0; }
.term dt {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.term dt .alt {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.term dd { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.term dd .also { color: var(--muted); font-size: 12px; margin-top: 4px; display: block; }
.term dd .also a { color: var(--accent-ink); border-bottom: 1px dotted; }
[data-theme="dark"] .term dd .also a { color: var(--accent); }

/* ──────────────────────────────────────────────────
   CALLOUTS / NOTES
   ────────────────────────────────────────────────── */
.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  margin: var(--gap-2) 0;
  font-size: 13.5px;
  color: var(--ink-2);
}
.callout .tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  padding-top: 1px;
}
[data-theme="dark"] .callout .tag { color: var(--accent); }
.callout p { margin: 0; max-width: none; }
.callout.warn { border-left-color: var(--warn); }
.callout.warn .tag { color: var(--warn); }

/* Code block */
pre.code {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--ink-2);
  margin: var(--gap-2) 0;
}
pre.code .c { color: var(--faint); }
pre.code .k { color: var(--accent-ink); }
[data-theme="dark"] pre.code .k { color: var(--accent); }

/* Tables */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: var(--gap-2) 0;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
}
.tbl tr:hover td { background: var(--surface); }
.tbl td code { font-size: 12px; }

/* ──────────────────────────────────────────────────
   ARTICLE PAGE
   ────────────────────────────────────────────────── */
.article-head {
  padding: var(--gap-2) 0 var(--gap-3);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--gap-3);
}
.article-head h1 { margin-top: var(--gap); max-width: 22ch; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  margin-top: var(--gap-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); display: inline-block; }

.article-foot {
  margin-top: var(--gap-4);
  padding-top: var(--gap-3);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-2);
}
.nav-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
  transition: border-color .15s, background-color .15s;
}
.nav-card:hover { border-color: var(--accent); background: var(--surface-2); }
.nav-card.next { text-align: right; }
.nav-card .dir {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-card .ttl { display: block; margin-top: 4px; font-weight: 500; color: var(--ink); }

/* ──────────────────────────────────────────────────
   ABOUT PAGE
   ────────────────────────────────────────────────── */
.about-hero {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: var(--gap-4);
  align-items: center;
  padding: var(--gap-4) 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--gap-3);
}
.about-hero h1 { max-width: 16ch; }
.about-hero .lede { margin-top: var(--gap-2); font-size: 18px; }
.about-hero .mascot-frame {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.about-hero .mascot-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 11px, var(--surface-2) 11px 12px);
  opacity: .4;
  pointer-events: none;
  z-index: 0;
}
.about-hero .mascot-frame svg { position: relative; z-index: 1; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--gap-3) 0;
}
.fact { padding: var(--gap-2) var(--gap-2); background: var(--surface); }
.fact .lbl {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.fact .val { font-size: 16px; color: var(--ink); }

/* ──────────────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────────────── */
.footer {
  margin-top: 0;
  border-top: 1px solid var(--line);
  padding: var(--gap-3) 0 var(--gap-4);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  justify-content: space-between;
  align-items: center;
}
.footer a:hover { color: var(--ink); }
.footer .links { display: flex; gap: 18px; }

/* ──────────────────────────────────────────────────
   TWEAKS PANEL (vanilla)
   ────────────────────────────────────────────────── */
.tweaks {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  width: 264px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  font-size: 12px;
  display: none;
  overflow: hidden;
}
.tweaks.open { display: block; }
.tweaks-hd {
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.tweaks-hd b { color: var(--ink); font-weight: 600; }
.tweaks-bd { padding: 12px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
.tw-row { display: flex; flex-direction: column; gap: 6px; }
.tw-row label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; justify-content: space-between;
}
.tw-row label .v { color: var(--faint); }
.tw-seg {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 2px;
}
.tw-seg button {
  font-size: 11.5px;
  padding: 5px 6px;
  border-radius: 4px;
  color: var(--muted);
  text-align: center;
}
.tw-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.tw-seg button:hover { color: var(--ink); }
.tw-swatch-row { display: flex; gap: 6px; }
.tw-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
}
.tw-swatch.on { border-color: var(--ink); }
.tw-slider { width: 100%; }
.tw-row input[type=range] {
  -webkit-appearance: none;
  height: 3px;
  background: var(--line-2);
  border-radius: 99px;
  outline: none;
}
.tw-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 0;
}
.tw-row input[type=range]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 0;
}

/* ──────────────────────────────────────────────────
   CAT MASCOT — minimal geometric
   ────────────────────────────────────────────────── */
.cat {
  display: block;
}
.cat .body { fill: var(--ink); }
.cat .body-2 { fill: var(--ink-2); }
.cat .eye { fill: var(--surface); }
.cat .nose { fill: var(--accent); }
.cat .accent { stroke: var(--accent); }
.cat .whisker { stroke: var(--muted); }

/* blink animation */
@keyframes blink {
  0%, 92%, 96%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.08); }
}
.cat .eye-l, .cat .eye-r {
  transform-origin: center;
  transform-box: fill-box;
  animation: blink 5.4s infinite;
}
.cat .eye-r { animation-delay: 0.12s; }

/* tail wag */
@keyframes wag {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(14deg); }
}
.cat .tail {
  transform-origin: 22% 78%;
  transform-box: fill-box;
  animation: wag 2.4s ease-in-out infinite;
}

/* head bob on hover */
.section-card svg.mini-cat,
.brand .cat { transition: transform .25s ease; }
.brand:hover .cat { transform: rotate(-6deg); }

/* ──────────────────────────────────────────────────
   RESPONSIVE — two modes only: standard and mobile.
   Mobile transition at 720px keeps the right rail visible on
   every iPad orientation, then collapses to single column on phones.
   ────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .app, .app.has-toc, .app.no-toc { grid-template-columns: 1fr; }
  .toc { display: none; }
  .sidenav { position: static; max-height: none; }
  .hero { grid-template-columns: 1fr; }
  .picks { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: 1fr; }
  .article-foot { grid-template-columns: 1fr; }
  .about-hero { grid-template-columns: 1fr; }
  /* Mobile topbar: brand (auto) | CTA (1fr, centered) | icons (auto).
     Only the "AI SEO Анализ" pill stays in the topnav; nav links collapse. */
  .topbar-inner { grid-template-columns: auto 1fr auto; }
  .topnav { display: flex; justify-content: center; gap: 0; }
  .topnav a:not(.topnav-cta) { display: none; }
  .topnav a.topnav-cta { margin-left: 0; padding: 0 12px; height: 32px; font-size: 12.5px; }
}
