/* ===================================================================
   Base — variables, resets, typography, buttons, links
   =================================================================== */

:root {
  --bg: #f8fafd;
  --surface: #ffffff;
  --surface-alt: #f7f9fc;
  --text: #202124;
  --muted: #5f6368;
  --line: #e0e3e7;
  --line-strong: #c7d1e0;
  --accent: #4f46e5;
  --accent-strong: #3730a3;
  --accent-soft: #eef2ff;
  --green: #188038;
  --green-soft: #e6f4ea;
  --amber: #b06000;
  --amber-soft: #fef7e0;
  --red: #c5221f;
  --red-soft: #fce8e6;
  --shadow: 0 14px 36px rgba(60, 64, 67, 0.07);
  --shell: 1000px;
  --shell-wide: 1280px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --section-gap: 48px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scroll-padding-top: 76px;
}

[id] { scroll-margin-top: 76px; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 15.5px;
  color: var(--text);
  background: #f8f9fa;
  line-height: 1.62;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

.site-frame {
  width: min(calc(100% - 32px), var(--shell));
  margin: 0 auto;
}

/* ---- Topbar ---- */

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(248, 250, 253, 0.84);
  border-bottom: 1px solid rgba(224, 227, 231, 0.7);
}

.topbar-wrap .site-frame { width: min(calc(100% - 32px), var(--shell-wide)); }

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  overflow: hidden;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
}

.brand-badge .material-symbols-outlined { font-size: 16px; }
.brand-text { display: grid; gap: 2px; }
.brand-text strong { font-family: "Plus Jakarta Sans", sans-serif; font-size: 0.88rem; font-weight: 700; }
.brand-text span { color: var(--muted); font-size: 0.72rem; font-weight: 600; }

/* ---- Navigation ---- */

.topnav,
.topnav-actions,
.hero-actions,
.hero-links,
.hero-meta,
.hero-highlights,
.layout,
.toc-list,
.content-stack,
.fact-grid,
.pros-grid,
.visual-grid,
.callout-grid,
.score-stack,
.heatmap,
.timeline,
.source-grid,
.footer-grid,
.footer-links,
.article-meta-row,
.top-info-grid,
.hero-scoring,
.score-chip-grid,
.descriptor-grid {
  display: grid;
}

.topnav {
  grid-auto-flow: column;
  justify-self: center;
  gap: var(--space-1);
  align-items: center;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 34px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.topnav a .material-symbols-outlined { font-size: 15px; }

.topnav a:hover {
  color: var(--accent);
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.1);
}

.topnav a.active {
  color: var(--accent-strong);
  background: var(--surface-alt);
  border-color: var(--line);
}

.topnav-actions { grid-auto-flow: column; justify-self: end; gap: var(--space-2); }

/* ---- Buttons ---- */

.button,
.button-secondary,
.button-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
}

.button .material-symbols-outlined,
.button-secondary .material-symbols-outlined,
.button-tertiary .material-symbols-outlined { font-size: 15px; }

.button { color: white; background: var(--accent); }
.button:hover { background: var(--accent-strong); text-decoration: none; }
.button-secondary { color: var(--text); background: white; border-color: var(--line); }
.button-tertiary { color: var(--accent); background: var(--accent-soft); }

/* ---- Eyebrow / labels ---- */

.eyebrow,
.section-tag,
.micro-label,
.source-pill,
.faq-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--accent);
}

.micro-note { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 1100px) {
  .topnav a span:not(.material-symbols-outlined),
  .topnav-actions span:not(.material-symbols-outlined) {
    display: none;
  }

  .topnav a {
    min-width: 38px;
    padding: 0 6px;
    justify-content: center;
  }

  .topnav-actions .button,
  .topnav-actions .button-secondary,
  .topnav-actions .button-tertiary {
    min-width: 32px;
    padding: 0 8px;
  }
}

@media (max-width: 640px) {
  :root { --section-gap: 36px; }

  .site-frame { width: min(calc(100% - 20px), var(--shell)); }
  .topbar { grid-template-columns: 1fr auto; }
  .topnav { display: none; }
  .topnav-actions { grid-auto-flow: column; }
}
