/* ===== Design tokens ===== */
:root,
[data-theme='light'] {
  --color-bg: #f5f6f7;
  --color-surface: #ffffff;
  --color-surface-2: #fbfbfc;
  --color-surface-offset: #eef0f2;
  --color-surface-offset-2: #e6e9ec;
  --color-divider: #dde1e5;
  --color-border: #d2d7dc;

  --color-text: #1a2027;
  --color-text-muted: #5b6672;
  --color-text-faint: #97a0a8;
  --color-text-inverse: #f7f8f9;

  --color-primary: #0b6b74;
  --color-primary-hover: #094f56;
  --color-primary-active: #073a3f;
  --color-primary-highlight: #d7e6e6;

  --color-federal: #2c4870;
  --color-federal-highlight: #dbe2ec;
  --color-private: #a8631f;
  --color-private-highlight: #f0dfc8;

  --color-warning: #94540f;
  --color-warning-highlight: #eeddc7;
  --color-success: #3c7a3f;
  --color-success-highlight: #d8e7d8;
  --color-error: #a13a3a;
  --color-error-highlight: #ecd7d7;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 240 / 0.06);
  --shadow-md: 0 4px 14px oklch(0.2 0.02 240 / 0.08);
  --shadow-lg: 0 16px 36px oklch(0.2 0.02 240 / 0.14);

  --content-wide: 1240px;

  --font-display: 'Cabinet Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'General Sans', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

[data-theme='dark'] {
  --color-bg: #12161b;
  --color-surface: #181d23;
  --color-surface-2: #1c2229;
  --color-surface-offset: #20262d;
  --color-surface-offset-2: #262d35;
  --color-divider: #2b323a;
  --color-border: #363e47;

  --color-text: #dde2e6;
  --color-text-muted: #8b95a1;
  --color-text-faint: #5c6570;
  --color-text-inverse: #14181d;

  --color-primary: #4fb0b9;
  --color-primary-hover: #6fc4cc;
  --color-primary-active: #8ad2d8;
  --color-primary-highlight: #22383a;

  --color-federal: #7f9ac9;
  --color-federal-highlight: #232c3d;
  --color-private: #d99a51;
  --color-private-highlight: #3a2f20;

  --color-warning: #d99a51;
  --color-warning-highlight: #3a2f20;
  --color-success: #7cb87e;
  --color-success-highlight: #23301f;
  --color-error: #cf7b7b;
  --color-error-highlight: #3a2323;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 36px oklch(0 0 0 / 0.5);
}

:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.2vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.9vw, 1.875rem);
  --text-2xl: clamp(1.875rem, 1.4rem + 2vw, 3rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
}

/* ===== Base layout ===== */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.wrap {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

a {
  color: var(--color-primary);
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 100;
  font-size: var(--text-sm);
  font-weight: 600;
}
.skip-link:focus {
  top: var(--space-4);
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-divider);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.brand__mark {
  flex-shrink: 0;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}
.brand__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.header-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}
.header-nav a:hover {
  color: var(--color-text);
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: var(--color-surface);
}
.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-text-faint);
}

@media (max-width: 720px) {
  .header-nav {
    display: none;
  }
}

/* ===== Hero ===== */
.hero {
  padding-block: clamp(var(--space-10), 6vw, var(--space-16)) var(--space-10);
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.hero__eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 650;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin-bottom: var(--space-5);
}
.hero__lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 62ch;
  font-weight: 400;
  line-height: 1.55;
}

/* ===== Section shell ===== */
.section {
  padding-block: clamp(var(--space-10), 5vw, var(--space-16));
  border-top: 1px solid var(--color-divider);
}
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}
.section__head h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section__desc {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  max-width: 60ch;
  margin-top: var(--space-2);
}

/* ===== Snapshot cards ===== */
.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 900px) {
  .snapshot-grid {
    grid-template-columns: 1fr;
  }
}

.cert-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.cert-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.cert-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cert-card__issuer {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.badge--federal {
  background: var(--color-federal-highlight);
  color: var(--color-federal);
}
.badge--private {
  background: var(--color-private-highlight);
  color: var(--color-private);
}
.badge--both {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}

.cert-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-divider);
}
.metric dt {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
}
.metric dd {
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cert-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
}

.difficulty-bar {
  display: flex;
  gap: 3px;
  margin-top: var(--space-1);
}
.difficulty-bar span {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset-2);
}
.difficulty-bar span.filled {
  background: var(--color-primary);
}

/* ===== Comparison table ===== */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.compare-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}
.compare-table th,
.compare-table td {
  text-align: left;
  padding: var(--space-4) var(--space-5);
  vertical-align: top;
  border-bottom: 1px solid var(--color-divider);
}
.compare-table thead th {
  position: sticky;
  top: 0;
  background: var(--color-surface-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  z-index: 2;
}
.compare-table tbody th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--color-surface-2);
  position: sticky;
  left: 0;
  white-space: nowrap;
  width: 180px;
}
.compare-table tbody tr:last-child td,
.compare-table tbody tr:last-child th {
  border-bottom: none;
}
.compare-table td {
  color: var(--color-text);
  line-height: 1.5;
}
.compare-table .cell-muted {
  color: var(--color-text-muted);
}
.compare-table .num {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

/* ===== Decision tree ===== */
.tree-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-5), 3vw, var(--space-8));
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

/* ===== Role outcome cards ===== */
.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-8);
}
@media (max-width: 900px) {
  .outcome-grid {
    grid-template-columns: 1fr;
  }
}
.outcome-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  background: var(--color-surface);
}
.outcome-card__role {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-2);
}
.outcome-card__path {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  margin-bottom: var(--space-3);
}
.outcome-card__reason {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
}

/* ===== Footer / sources ===== */
.sources {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.8;
}
.sources a {
  color: var(--color-text-muted);
}
.site-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-10);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ===== Legend ===== */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
