@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0d1117;
  --bg2: #151b27;
  --bg3: #1b2233;
  --bg4: #222c40;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.14);
  --text: #e6eaf4;
  --muted: #8892a8;
  --accent: #0194e2;
  --accent2: #38bdf8;
  --accent3: #f97316;
  --accent4: #fb923c;
  --accent5: #818cf8;
  --accent6: #4ade80;
  --code-bg: #0a0e17;
  --tag-bg: rgba(1,148,226,0.10);
  --tag-text: #38bdf8;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 0 40px;
  flex-shrink: 0;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.logo-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.logo-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.nav-section { margin-bottom: 4px; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 20px 4px;
}
.nav-link {
  display: block;
  padding: 6px 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s, background 0.15s;
  border-left: 2px solid transparent;
}
.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--accent2); border-left-color: var(--accent); background: rgba(1,148,226,0.06); }

/* ── Main content ───────────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 960px;
  padding: 40px 48px 80px;
  overflow-x: hidden;
}

section { margin-bottom: 60px; scroll-margin-top: 24px; }

h1 { font-size: 28px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.page-sub { font-size: 15px; color: var(--muted); margin-bottom: 32px; line-height: 1.5; }
h2 {
  font-size: 20px; font-weight: 600; color: var(--text);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 24px 0 10px; }
h4 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 20px 0 8px; }
p { color: var(--muted); margin-bottom: 10px; line-height: 1.7; font-size: 14px; }
p strong { color: var(--text); font-weight: 500; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 20px; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
li { margin-bottom: 4px; line-height: 1.7; }
li strong { color: var(--text); font-weight: 500; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, rgba(1,148,226,0.09) 0%, rgba(249,115,22,0.06) 100%);
  border: 1px solid rgba(1,148,226,0.22);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(1,148,226,0.14), transparent 70%);
  pointer-events: none;
}
.hero h1 { font-size: 22px; margin-bottom: 4px; }
.hero-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-blue   { background: rgba(56,189,248,0.13);  color: #7dd3fc; border: 1px solid rgba(56,189,248,0.25); }
.badge-orange { background: rgba(249,115,22,0.12);  color: #fb923c; border: 1px solid rgba(249,115,22,0.25); }
.badge-green  { background: rgba(74,222,128,0.10);  color: #4ade80; border: 1px solid rgba(74,222,128,0.20); }
.badge-purple { background: rgba(129,140,248,0.12); color: #a5b4fc; border: 1px solid rgba(129,140,248,0.22); }
.badge-amber  { background: rgba(251,191,36,0.12);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.22); }

/* ── Code blocks ────────────────────────────────────────────── */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 12px 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}
pre::-webkit-scrollbar { height: 4px; }
pre::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent6);
}
pre code { background: none; padding: 0; border-radius: 0; color: inherit; font-size: 13px; }

/* syntax highlight spans */
.cm  { color: #4a5568; }
.kw  { color: #c678dd; }
.str { color: #98c379; }
.nu  { color: #d19a66; }
.fn  { color: #61afef; }
.key { color: #e06c75; }
.ty  { color: #56b6c2; }
.de  { color: #e5c07b; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 12px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 8px 12px;
  background: var(--bg3);
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--border2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--border); color: var(--muted); vertical-align: top; }
tr:hover td { background: rgba(255,255,255,0.02); }
td code { font-size: 12px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card-grid { display: grid; gap: 14px; }
.card-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border2); }
.card-icon { font-size: 20px; margin-bottom: 10px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.card-body { font-size: 13px; color: var(--muted); line-height: 1.6; }

.mode-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.mode-card.blue   { border-left-color: var(--accent); }
.mode-card.orange { border-left-color: var(--accent3); }
.mode-card.green  { border-left-color: var(--accent6); }
.mode-card.purple { border-left-color: var(--accent5); }
.mode-card.amber  { border-left-color: #fbbf24; }
.mode-card .card-title { margin-bottom: 4px; }

/* ── Callouts ───────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 14px 0;
}
.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.callout-body { color: var(--muted); font-size: 13px; }
.callout-body strong { color: var(--text); }
.callout.tip    { background: rgba(74,222,128,0.07);  border: 1px solid rgba(74,222,128,0.18); }
.callout.warn   { background: rgba(251,191,36,0.07);  border: 1px solid rgba(251,191,36,0.18); }
.callout.info   { background: rgba(56,189,248,0.07);  border: 1px solid rgba(56,189,248,0.18); }
.callout.danger { background: rgba(249,115,22,0.08);  border: 1px solid rgba(249,115,22,0.22); }

/* ── Step list ──────────────────────────────────────────────── */
.step-list { list-style: none; padding: 0; counter-reset: steps; }
.step-list li {
  counter-increment: steps;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}
.step-list li::before {
  content: counter(steps);
  flex-shrink: 0;
  width: 24px; height: 24px;
  background: rgba(1,148,226,0.15);
  color: var(--accent2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}

/* ── Section header accent ──────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 18px; height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 24px 20px 60px; max-width: 100%; }
}
