/* ------------------------------------------------------------------ *
 * Конвейер новинок — editorial dark, warm amber, Instrument Serif
 * ------------------------------------------------------------------ */

:root {
  --bg-0: #0b0a08;
  --bg-1: #13110e;
  --bg-2: #1b1813;
  --bg-3: #24201a;
  --bg-4: #2f2a22;

  --ink-0: #f4efe3;
  --ink-1: #d7d1c1;
  --ink-2: #968f7f;
  --ink-3: #6a6357;
  --ink-4: #423d34;

  --amber: #e8a13a;
  --amber-bright: #f5c05a;
  --amber-deep: #b07015;
  --amber-soft: rgba(232, 161, 58, 0.12);
  --amber-line: rgba(232, 161, 58, 0.35);

  --red: #c05a42;
  --green: #8a9e5c;

  --line: rgba(244, 239, 227, 0.08);
  --line-strong: rgba(244, 239, 227, 0.16);
  --line-amber: rgba(232, 161, 58, 0.22);

  --font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  --reading: 680px;
  --sidebar: 300px;
  --toc: 220px;
  --gutter: 72px;

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

* { box-sizing: border-box; }
*::selection { background: var(--amber); color: var(--bg-0); }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 40px;
  background: var(--bg-0);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--font-body);
  font-variation-settings: "opsz" 14, "SOFT" 40, "wght" 380;
  font-size: 16.5px;
  line-height: 1.68;
  letter-spacing: -0.002em;
  font-feature-settings: "ss01", "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ----- grain overlay ----- */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.88' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.95 0 0 0 0 0.82 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ----- sidebar ----- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar);
  padding: 40px 28px 28px 40px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow-y: auto;
  z-index: 10;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--ink-0);
  animation: riseIn 0.7s var(--ease) backwards;
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--amber);
  transform: translateY(-2px);
  transition: transform 0.5s var(--ease), color 0.5s var(--ease);
}
.brand:hover .brand-mark { transform: translateY(-2px) rotate(72deg); color: var(--amber-bright); }
.brand-lines {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 0.95;
  letter-spacing: -0.015em;
  display: flex;
  flex-direction: column;
}
.brand-top { color: var(--ink-0); }
.brand-bot em { font-style: italic; color: var(--amber); }

.sidebar-meta {
  display: flex;
  gap: 12px;
  align-items: baseline;
  animation: riseIn 0.7s var(--ease) backwards 0.05s;
}
.meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-3);
}
.meta-value {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--amber);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.nav-section {
  animation: riseIn 0.6s var(--ease) backwards;
  animation-delay: calc(0.08s + var(--i) * 0.05s);
}
.nav-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.nav-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.15em;
}
.nav-section h5 {
  margin: 0;
  font-family: var(--font-body);
  font-variation-settings: "opsz" 9, "SOFT" 0, "wght" 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-2);
}
.nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav a {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: baseline;
  text-decoration: none;
  padding: 6px 10px 6px 4px;
  border-radius: var(--radius);
  position: relative;
  color: var(--ink-1);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav a:hover {
  color: var(--ink-0);
  background: var(--bg-1);
}
.nav-kicker {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  transition: color 0.25s var(--ease);
}
.nav a:hover .nav-kicker { color: var(--amber); }
.nav-title {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-variation-settings: "opsz" 11, "SOFT" 50, "wght" 400;
  letter-spacing: -0.005em;
}
.nav a[aria-current="page"] {
  color: var(--amber);
  background: var(--amber-soft);
}
.nav a[aria-current="page"] .nav-kicker { color: var(--amber-bright); font-style: italic; }
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -40px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--amber);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: riseIn 0.6s var(--ease) backwards 0.5s;
}
.foot-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--ink-1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
}
.foot-link:hover { color: var(--amber); }
.foot-link .arrow {
  font-family: var(--font-display);
  font-size: 16px;
  transition: transform 0.3s var(--ease);
}
.foot-link:hover .arrow { transform: translate(2px, -2px); }
.foot-note {
  font-family: var(--font-body);
  font-variation-settings: "opsz" 9, "wght" 350;
  font-style: italic;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.4;
}

/* ----- main ----- */
.main {
  margin-left: var(--sidebar);
  padding: 60px var(--gutter) 140px;
  max-width: calc(var(--sidebar) + var(--reading) + var(--toc) + var(--gutter) * 2 + 100px);
}

/* ==================================================================
 * HOME
 * ================================================================== */
.home { max-width: 980px; }

.hero {
  padding: 40px 0 80px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 80px;
  animation: riseIn 0.9s var(--ease) backwards 0.2s;
}
.hero-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
}
.hero-rule span {
  flex: 1;
  height: 1px;
  background: var(--line-strong);
}
.hero-rule span:first-child { flex: 0 0 48px; }
.hero-rule em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(72px, 13vw, 176px);
  line-height: 0.86;
  letter-spacing: -0.035em;
  font-weight: 400;
  margin: 0 0 48px;
  color: var(--ink-0);
}
.ht-line {
  display: block;
  overflow: hidden;
}
.ht-line em {
  font-style: italic;
  color: var(--amber);
  position: relative;
  display: inline-block;
}
.ht-italic {
  padding-left: 0.1em;
  transform: translateX(-0.03em);
}

.hero-lede {
  font-family: var(--font-body);
  font-variation-settings: "opsz" 18, "SOFT" 30, "wght" 380;
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink-1);
  max-width: 620px;
  margin: 0 0 72px;
  letter-spacing: -0.005em;
}
.hero-lede strong {
  font-variation-settings: "opsz" 18, "SOFT" 0, "wght" 600;
  color: var(--amber);
  font-weight: normal;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.stat {
  padding: 24px 20px 24px 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat:last-child { border-right: 0; }
.stat:not(:first-child) { padding-left: 20px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--amber);
}
.stat-num sup { font-size: 0.5em; vertical-align: top; color: var(--ink-2); }
.stat-lab {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.35;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.home-prose {
  animation: riseIn 0.8s var(--ease) backwards 0.35s;
  margin-bottom: 80px;
  max-width: var(--reading);
}

.home-index {
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-top: 1px solid var(--line);
  padding-top: 60px;
  animation: riseIn 0.8s var(--ease) backwards 0.5s;
}
.home-index section { }
.home-index header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.hi-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.18em;
}
.home-index h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink-0);
}
.home-index ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
}
.home-index li {
  border-top: 1px solid var(--line);
}
.home-index a {
  display: grid;
  grid-template-columns: 36px 1fr 24px;
  align-items: baseline;
  gap: 14px;
  padding: 20px 4px;
  text-decoration: none;
  color: var(--ink-0);
  transition: color 0.3s var(--ease), padding 0.3s var(--ease), background 0.3s var(--ease);
}
.home-index a:hover { color: var(--amber); padding-left: 12px; }
.hi-kicker {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--ink-3);
  transition: color 0.3s var(--ease);
}
.home-index a:hover .hi-kicker { color: var(--amber-bright); }
.hi-title {
  font-family: var(--font-body);
  font-variation-settings: "opsz" 14, "SOFT" 30, "wght" 450;
  font-size: 17px;
  letter-spacing: -0.005em;
}
.hi-arrow {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink-3);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}
.home-index a:hover .hi-arrow { transform: translateX(6px); color: var(--amber); }

/* ==================================================================
 * DOC PAGE
 * ================================================================== */
.doc { }

.doc-head {
  padding: 40px 0 56px;
  animation: riseIn 0.8s var(--ease) backwards 0.1s;
  max-width: var(--reading);
}
.doc-crumb {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 28px;
}
.dc-kicker {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--amber);
}
.dc-sep {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.dc-section {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.doc-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 80px);
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 400;
  margin: 0 0 32px;
  color: var(--ink-0);
}
.doc-rule {
  height: 1px;
  background: linear-gradient(to right, var(--amber) 0%, var(--line-strong) 14%, var(--line) 100%);
}

.doc-body {
  display: grid;
  grid-template-columns: minmax(0, var(--reading)) var(--toc);
  gap: 80px;
  margin-top: 48px;
  animation: riseIn 0.8s var(--ease) backwards 0.25s;
}

.doc-foot {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.edit-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
}
.edit-link:hover { color: var(--amber); }
.edit-link .arrow { font-family: var(--font-display); font-size: 15px; font-style: italic; }

/* ==================================================================
 * PROSE (markdown body)
 * ================================================================== */
.prose {
  color: var(--ink-0);
  max-width: var(--reading);
}

.prose h1 {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  color: var(--ink-0);
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 72px 0 16px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  position: relative;
  color: var(--ink-0);
}
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h2::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 32px;
  height: 1px;
  background: var(--amber);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 48px 0 12px;
  color: var(--ink-0);
}
.prose h4 {
  font-family: var(--font-body);
  font-variation-settings: "opsz" 14, "SOFT" 0, "wght" 700;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 32px 0 8px;
  color: var(--amber);
  text-transform: none;
}
.prose h5, .prose h6 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 28px 0 8px;
  color: var(--ink-2);
}

.prose p {
  margin: 18px 0;
  color: var(--ink-0);
}
.prose p:first-child { margin-top: 0; }

.prose a {
  color: var(--amber);
  text-decoration: none;
  background-image: linear-gradient(to right, var(--amber) 0%, var(--amber) 50%, var(--amber-line) 50%, var(--amber-line) 100%);
  background-size: 200% 1px;
  background-position: 100% 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-position 0.45s var(--ease), color 0.2s;
}
.prose a:hover {
  background-position: 0 100%;
  color: var(--amber-bright);
}

.prose strong {
  font-variation-settings: "opsz" 14, "SOFT" 0, "wght" 650;
  color: var(--ink-0);
  font-weight: 650;
}
.prose em {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.04em;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}

.prose ul, .prose ol {
  padding-left: 0;
  margin: 22px 0;
  list-style: none;
}
.prose li {
  position: relative;
  padding-left: 28px;
  margin: 10px 0;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 14px;
  height: 1px;
  background: var(--amber);
}
.prose ol { counter-reset: ol; }
.prose ol li { counter-increment: ol; }
.prose ol li::before {
  content: counter(ol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1em;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.05em;
}
.prose li > ul, .prose li > ol { margin: 8px 0; }

/* Task list checkboxes */
.prose li input[type="checkbox"] {
  appearance: none;
  position: absolute;
  left: -2px;
  top: 0.5em;
  width: 14px;
  height: 14px;
  border: 1px solid var(--ink-3);
  border-radius: 2px;
  background: var(--bg-1);
  cursor: default;
}
.prose li input[type="checkbox"]:checked {
  background: var(--amber);
  border-color: var(--amber);
}
.prose li input[type="checkbox"]:checked::before {
  content: "✓";
  color: var(--bg-0);
  font-size: 11px;
  font-weight: 700;
  position: absolute;
  top: -2px;
  left: 2px;
}
.prose li:has(input[type="checkbox"])::before { display: none; }

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-family: var(--font-body);
  font-variation-settings: "opsz" 11, "SOFT" 40, "wght" 400;
  font-size: 14px;
  line-height: 1.5;
}
.prose thead tr {
  border-bottom: 1px solid var(--line-amber);
}
.prose th {
  text-align: left;
  padding: 14px 14px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  background: transparent;
}
.prose td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-1);
  vertical-align: top;
}
.prose td:first-child { color: var(--ink-0); }
.prose tbody tr { transition: background 0.15s var(--ease); }
.prose tbody tr:hover { background: var(--bg-1); }

/* Code */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  color: var(--amber);
  background: var(--bg-2);
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid var(--line);
  font-variant-ligatures: none;
}

.prose pre {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line);
  padding: 22px 24px 22px 28px;
  margin: 28px 0;
  overflow-x: auto;
  border-radius: 3px;
  font-size: 13.5px;
  line-height: 1.65;
}
.prose pre::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--amber);
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-0);
  font-size: inherit;
}

/* Syntax highlight (Pygments .hl) */
.hl .c, .hl .c1, .hl .cm { color: var(--ink-3); font-style: italic; }
.hl .k, .hl .kd, .hl .kn, .hl .kp, .hl .kr, .hl .kt { color: #c98aff; }
.hl .s, .hl .s1, .hl .s2, .hl .sd { color: var(--green); }
.hl .n { color: var(--ink-0); }
.hl .nf, .hl .nb { color: #86b7ff; }
.hl .nc, .hl .nn { color: var(--amber-bright); }
.hl .m, .hl .mi, .hl .mf { color: var(--amber); }
.hl .o, .hl .p { color: var(--ink-2); }
.hl .na { color: #86b7ff; }

/* Blockquote */
.prose blockquote {
  margin: 36px 0;
  padding: 8px 28px;
  border-left: 2px solid var(--amber);
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-1);
  letter-spacing: -0.01em;
}
.prose blockquote p { margin: 12px 0; }

/* Horizontal rules */
.prose hr {
  border: 0;
  height: 1px;
  background: var(--line-strong);
  margin: 72px 0;
  position: relative;
}
.prose hr::after {
  content: "✦";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-0);
  padding: 0 16px;
  font-family: var(--font-display);
  color: var(--amber);
  font-size: 16px;
}

/* Definition lists */
.prose dl { margin: 20px 0; }
.prose dt {
  font-family: var(--font-body);
  font-variation-settings: "opsz" 12, "wght" 650;
  color: var(--amber);
  margin-top: 14px;
}
.prose dd {
  margin: 4px 0 12px 24px;
  color: var(--ink-1);
}

/* Admonitions */
.admonition {
  margin: 32px 0;
  padding: 20px 24px 20px 28px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  border-radius: 3px;
  position: relative;
}
.admonition .admonition-title {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
}
.admonition.warning, .admonition.danger {
  border-left-color: var(--red);
}
.admonition.warning .admonition-title,
.admonition.danger .admonition-title { color: var(--red); }
.admonition.info {
  border-left-color: var(--amber);
}
.admonition.tip, .admonition.note {
  border-left-color: var(--green);
}
.admonition.tip .admonition-title,
.admonition.note .admonition-title { color: var(--green); }
.admonition p:last-child { margin-bottom: 0; }

/* ==================================================================
 * TOC (right rail)
 * ================================================================== */
.doc-toc {
  position: sticky;
  top: 40px;
  align-self: start;
  font-family: var(--font-body);
  font-variation-settings: "opsz" 11, "SOFT" 40, "wght" 400;
  font-size: 13px;
}
.doc-toc h6 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.toc-wrap > .toc > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-wrap ul { list-style: none; padding: 0; margin: 0; }
.toc-wrap ul ul { padding-left: 14px; margin-top: 4px; border-left: 1px solid var(--line); }
.toc-wrap li { margin: 6px 0; line-height: 1.35; }
.toc-wrap a {
  display: block;
  padding: 3px 0 3px 12px;
  margin-left: -12px;
  border-left: 1px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: -0.003em;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.toc-wrap a:hover {
  color: var(--amber);
  border-left-color: var(--amber);
}

/* ==================================================================
 * Animations
 * ================================================================== */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==================================================================
 * Scrollbars
 * ================================================================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border: 2px solid var(--bg-0);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--amber-deep); }

/* ==================================================================
 * Responsive
 * ================================================================== */
@media (max-width: 1280px) {
  :root { --sidebar: 260px; --gutter: 48px; --toc: 200px; }
}
@media (max-width: 1100px) {
  :root { --toc: 0px; }
  .doc-body { grid-template-columns: 1fr; gap: 0; }
  .doc-toc { display: none; }
  .home-index ul { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px 24px;
  }
  .nav a[aria-current="page"]::before { display: none; }
  .main {
    margin-left: 0;
    padding: 28px 24px 80px;
  }
  .hero { padding: 24px 0 56px; margin-bottom: 48px; }
  .hero-title { font-size: 64px; }
  .hero-lede { font-size: 18px; }
  .doc-title { font-size: 44px; }
  .stat { padding: 18px 12px; }
  .stat-num { font-size: 32px; }
  body { font-size: 15.5px; }
}
