/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --bg:          #0a0b0d;
  --bg-1:        #0f1115;
  --bg-2:        #14171c;
  --bg-3:        #1a1e25;
  --surface:     #0f1115;
  --border:      #22272f;
  --border-dim:  #1a1e25;
  --border-soft: #2b313b;

  --fg:          #d8dce3;
  --fg-dim:      #8a919c;
  --fg-mute:     #5a616c;
  --fg-faint:    #3a3f48;

  --green:        oklch(0.82 0.19 140);
  --green-dim:    oklch(0.55 0.14 140);
  --green-faint:  oklch(0.32 0.08 140);
  --amber:        oklch(0.78 0.16 75);
  --amber-dim:    oklch(0.52 0.12 75);
  --amber-faint:  oklch(0.32 0.06 75);

  --danger:       oklch(0.68 0.22 25);
  --danger-dim:   oklch(0.45 0.15 25);

  /* Legacy token aliases so existing page CSS keeps working */
  --accent:        var(--green);
  --accent-deep:   var(--green-dim);
  --accent-soft:   #1a2218;
  --threat:        var(--amber);
  --threat-soft:   #1f1a10;
  --threat-deep:   var(--amber-dim);
  --ink:           var(--fg);
  --ink-soft:      var(--fg);
  --muted:         var(--fg-dim);
  --muted-soft:    var(--fg-mute);
  --surface-soft:  var(--bg-1);
  --safe:          var(--green);
  --safe-soft:     #1a2218;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --nav-h: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { min-height: 70vh; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
::selection { background: var(--green-faint); color: var(--fg); }

/* ── Typography base ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--sans);
  color: var(--fg);
  letter-spacing: -0.015em;
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 0.6em;
}
h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: 1.65rem; font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; color: var(--fg); }
h5 { font-size: 0.9rem; font-weight: 600; color: var(--fg-dim); }
h6 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

p { margin: 0 0 1em; }
strong { color: var(--fg); font-weight: 600; }
em { color: var(--fg); font-style: italic; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--green);
}
.eyebrow::before { content: '// '; color: var(--fg-mute); }

.lede {
  font-size: 1.05rem;
  color: var(--fg-dim);
  line-height: 1.65;
  max-width: 65ch;
}
.lede strong { color: var(--fg); }

.text-muted { color: var(--fg-mute) !important; }
.mono { font-family: var(--mono); }

hr.section-divider { border: 0; border-top: 1px dashed var(--border); margin: 3rem auto; max-width: 80%; }
.divider-dot::before { content: "·"; color: var(--fg-mute); margin: 0 0.5rem; }

/* ── Code ───────────────────────────────────────────────────── */
code { font-family: var(--mono); }
pre > code { font-size: inherit; }
:not(pre) > code {
  background: var(--bg-2);
  color: var(--amber);
  padding: 0.1em 0.38em;
  border-radius: 3px;
  font-size: 0.88em;
  border: 1px solid var(--border-dim);
}
pre[class*="language-"] {
  font-size: 0.82rem !important;
  border-radius: 4px !important;
  padding: 1.05rem 1.25rem !important;
  margin: 1.4rem 0 !important;
  line-height: 1.55 !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-1) !important;
}

/* ── Bootstrap container overrides ──────────────────────────── */
.container, .container-xxl {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.container-xxl { max-width: 1320px; }

/* ── Generic page header (non-home) ─────────────────────────── */
.page-header {
  padding: 56px 0 32px;
  border-bottom: 1px dashed var(--border);
  background:
    radial-gradient(800px 240px at 90% 0%, rgba(163,230,53,0.045), transparent 65%),
    var(--bg);
}
.page-header h1 { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.028em; color: var(--fg); }
.page-header .lede { margin-top: 14px; max-width: 62ch; }

/* ── Bootstrap utility overrides (dark theme compat) ────────── */
.py-5 { padding-top: 56px !important; padding-bottom: 56px !important; background: var(--bg); }
.bg-light { background: var(--bg-1) !important; }
.card { background: var(--bg-1); border-color: var(--border); color: var(--fg); }
.bg-white { background: var(--bg-1) !important; }
.text-dark { color: var(--fg) !important; }
.text-body { color: var(--fg-dim) !important; }

/* Lab / attack page chrome (dark-theme friendly overrides) */
.lab-shell, .chain-section { background: var(--bg); }
.lab-pane-dark, .lab-pane { background: var(--bg-1); border: 1px solid var(--border); border-radius: 4px; }
.lab-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: 4px; }
.lab-card-head {
  font-family: var(--mono);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 10px 14px;
}
.lab-card-body { padding: 16px; color: var(--fg-dim); }
