:root[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-soft: #11111a;
  --bg-elev: #16161f;
  --border: #1f1f2c;
  --border-bright: #2a2a3d;
  --text: #e9e9f1;
  --text-dim: #a7a7ba;
  --text-muted: #6f6f85;
  --accent: #00ffa3;
  --accent-2: #5b8cff;
  --accent-on: #0a0a0f;
}
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f5f6f9;
  --bg-elev: #ffffff;
  --border: #e6e8ef;
  --border-bright: #d3d6e0;
  --text: #0a0e1a;
  --text-dim: #4f5870;
  --text-muted: #7f899d;
  --accent: #00a56f;
  --accent-2: #3a6dff;
  --accent-on: #ffffff;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(800px circle at 15% -10%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 58%),
    radial-gradient(680px circle at 85% 12%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 56%);
}
a { color: inherit; }
code, pre { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace; }
.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; }
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-on);
}
.nav-links { display: flex; align-items: center; gap: 18px; color: var(--text-dim); font-size: 14px; }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); }
.hero { padding: 72px 0 42px; }
.kicker {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1 {
  max-width: 900px;
  margin: 14px 0 18px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
}
.lead { max-width: 760px; margin: 0; color: var(--text-dim); font-size: 19px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-bright);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-on); border-color: transparent; }
.content { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 36px; padding: 30px 0 80px; }
.main { min-width: 0; }
.toc {
  position: sticky;
  top: 76px;
  align-self: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  padding: 18px;
}
.toc-title { margin: 0 0 10px; font-weight: 800; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.toc a { display: block; padding: 6px 0; color: var(--text-dim); text-decoration: none; font-size: 14px; }
.toc a:hover { color: var(--text); }
section { padding: 34px 0; border-top: 1px solid var(--border); }
section:first-child { border-top: 0; padding-top: 0; }
h2 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; letter-spacing: 0; }
h3 { margin: 22px 0 8px; font-size: 20px; line-height: 1.25; }
p, li { color: var(--text-dim); font-size: 16px; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin: 7px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 18px 0; }
.card, .note {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  padding: 20px;
}
.card h3, .card h2 { margin-top: 0; }
.note { border-color: var(--border-bright); }
.metric { font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--text); }
.muted { color: var(--text-muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--text); background: var(--bg-soft); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
td { color: var(--text-dim); font-size: 15px; }
tr:last-child td { border-bottom: 0; }
pre {
  overflow-x: auto;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.related a {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  background: var(--bg-elev);
}
.related strong { display: block; margin-bottom: 4px; }
.related span { color: var(--text-dim); font-size: 14px; }
.footer { border-top: 1px solid var(--border); padding: 34px 0 46px; color: var(--text-muted); font-size: 14px; }
.footer a { color: var(--text-dim); text-decoration: none; }
.footer a:hover { color: var(--text); }
@media (max-width: 860px) {
  .content { grid-template-columns: 1fr; padding-top: 18px; }
  .toc { position: static; }
  .nav { align-items: flex-start; }
  .nav-links { flex-wrap: wrap; justify-content: flex-end; gap: 10px 14px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .hero { padding-top: 52px; }
  .nav { flex-direction: column; }
  .nav-links { justify-content: flex-start; }
}
