:root {
  --bg: #0b0f14;
  --bg-elevated: #10151d;
  --bg-card: #141b24;
  --border: #1f2937;
  --border-subtle: #172030;
  --text: #e6edf5;
  --text-muted: #8b98a8;
  --text-dim: #5f6b7a;
  --accent: #4ade80;
  --accent-dim: #22c55e;
  --accent-glow: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-glow: rgba(251, 191, 36, 0.12);
  --code-bg: #0a0f15;
  --code-text: #7dd3fc;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { color: var(--text-dim); font-weight: 500; }

.brand-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 28px;
  padding-left: 19px;
}

.nav-list { list-style: none; display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-list a {
  display: block;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav-list a:hover { color: var(--text); background: var(--bg-card); }

.nav-list a.active {
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 500;
}

.sidebar-foot {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 24px;
  padding-left: 12px;
}

/* ---------- Content ---------- */

.content {
  margin-left: 240px;
  padding: 64px clamp(24px, 5vw, 72px) 120px;
  max-width: 1080px;
}

.hero {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--border-subtle);
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 20px;
}

.lede {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 740px;
  line-height: 1.7;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.hero-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.hero-meta strong {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
}

.hero-meta span { font-size: 14px; color: var(--text); }

/* ---------- Sections ---------- */

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

section h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

section > p {
  color: var(--text-muted);
  margin-bottom: 28px;
  max-width: 780px;
}

/* ---------- Pillars ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.pillar {
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.pillar h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }

.pillar > p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
}

.pillar p.why { font-size: 13px; margin-bottom: 0; }

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  margin-bottom: 20px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table-wrap th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  white-space: nowrap;
}

.table-wrap td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  vertical-align: top;
}

.table-wrap tr:last-child td { border-bottom: none; }

.table-wrap td strong { color: var(--text); font-weight: 600; }

.summary-table td:first-child { color: var(--text); }

.summary-table em {
  font-style: normal;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.9em;
}

.takeaway {
  font-size: 14px;
  color: var(--text-muted);
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--bg-elevated);
  border-radius: 6px;
  margin-bottom: 0;
}

.takeaway strong { color: var(--accent); }

/* ---------- Tier cards ---------- */

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.tier-card {
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-card.pro { border-color: rgba(74, 222, 128, 0.35); }

.tier-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.tier-card h3 { font-size: 14.5px; font-weight: 600; }

.tier-number {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.tier-number em { font-style: normal; color: var(--text-dim); font-size: 12px; }

.tier-card > p {
  font-size: 13.5px;
  color: var(--text-muted);
}

.tier-card > p strong { color: var(--text); }

.tier-card p.why { font-size: 13px; margin-bottom: 0; }

/* ---------- Why label ---------- */

.why strong { color: var(--accent); font-weight: 600; }

/* ---------- Notes ---------- */

.note {
  padding: 18px 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}

.note.warn { border-left-color: var(--warn); background: #14120b; }

.note.warn .why strong { color: var(--warn); }

.note > p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 8px; }
.note > p:last-child { margin-bottom: 0; }

/* ---------- Page footer ---------- */

.page-footer {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 13px;
}

.page-footer p { margin-bottom: 8px; max-width: 720px; line-height: 1.65; }

.page-footer .sig {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
  margin-top: 16px;
}

/* ---------- Inline code ---------- */

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--code-text);
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
  }

  .brand-tag { margin-bottom: 14px; }

  .nav-list { flex-direction: row; flex-wrap: wrap; gap: 4px; }

  .nav-list a { padding: 6px 10px; font-size: 13px; }

  .sidebar-foot { display: none; }

  .content { margin-left: 0; padding: 36px 20px 80px; }

  .hero { padding-bottom: 32px; margin-bottom: 32px; }

  section { margin-bottom: 44px; }
}

@media (max-width: 520px) {
  .hero h1 { font-size: 28px; }
  .lede { font-size: 15px; }
  .tier-card header { flex-direction: column; align-items: flex-start; gap: 4px; }
}