:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-radial: rgba(56, 189, 248, 0.18);
  --surface: rgba(15, 23, 42, 0.86);
  --surface-strong: #111c30;
  --surface-soft: rgba(148, 163, 184, 0.1);
  --border: rgba(148, 163, 184, 0.24);
  --text: #e5edf7;
  --muted: #9fb0c7;
  --faint: #728198;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --success: #34d399;
  --warning: #f59e0b;
  --danger: #fb7185;
  --control: #f97316;
  --early: #a78bfa;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  /* No webfont is loaded anywhere in this site, by design — zero CDN calls, zero
     layout shift. Name only faces that actually resolve locally. */
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f6f8fb;
    --bg-radial: rgba(14, 165, 233, 0.16);
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --surface-soft: rgba(2, 6, 23, 0.04);
    --border: rgba(15, 23, 42, 0.14);
    --text: #0f172a;
    --muted: #475569;
    /* Slate-500 (#64748b) lands at 4.47:1 here — just under AA for the small
       uppercase axis labels. Nudged darker to clear 4.5 without losing the
       "faint" role. */
    --faint: #5f6d82;
    --accent: #0369a1;
    --accent-strong: #0284c7;
    --shadow: 0 24px 80px rgba(15, 23, 42, 0.12);
  }
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at 18% 0%, var(--bg-radial), transparent 30rem),
    radial-gradient(circle at 90% 8%, rgba(52, 211, 153, 0.12), transparent 24rem),
    var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: var(--accent);
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent-strong);
}

code {
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  padding: 0.08rem 0.32rem;
  background: var(--surface-soft);
  color: var(--text);
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  transform: translateY(-160%);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero-shell {
  padding: 1.3rem 0 1rem;
}

.topbar,
.footer,
.section-heading,
.button-row,
.badge-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
}

.brand,
.topbar-links {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--surface);
}

.topbar-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.95rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 1.4rem;
  align-items: stretch;
  padding: 4rem 0 2.4rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 1rem;
  font-size: clamp(2.55rem, 7vw, 5.8rem);
  line-height: 0.94;
  /* Tight enough to read as display type, but not so tight that word spaces
     collapse — at this size -0.08em ran "Who actually" into "Whoactually". */
  letter-spacing: -0.03em;
  word-spacing: 0.04em;
}

h2 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.6;
}

.verdict-card,
.metric-card,
.panel,
.empty-state,
.data-note {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.verdict-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.verdict-card h2 {
  font-size: clamp(1.8rem, 4vw, 3.1rem);
}

.verdict-card p:last-child,
.metric-card span,
.section-heading p,
.empty-state p,
.footer {
  color: var(--muted);
}

.data-note {
  margin-bottom: 1rem;
  border-color: color-mix(in srgb, var(--warning) 55%, var(--border));
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  color: var(--text);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric-card {
  min-height: 140px;
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.metric-card strong {
  display: block;
  margin: 0.35rem 0 0.45rem;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.emphasis {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
}

.control-card {
  border-color: color-mix(in srgb, var(--control) 55%, var(--border));
}

.panel,
.empty-state {
  margin: 1rem 0;
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 2vw, 1.45rem);
}

.empty-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  border-style: dashed;
}

.empty-state[hidden] {
  display: none;
}

.empty-art {
  display: grid;
  width: clamp(4rem, 12vw, 7rem);
  height: clamp(4rem, 12vw, 7rem);
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background: var(--surface-soft);
  font-size: clamp(2.3rem, 7vw, 4rem);
}

.button-row,
.badge-row {
  flex-wrap: wrap;
  gap: 0.65rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

.section-heading {
  justify-content: space-between;
  gap: 1.4rem;
  margin-bottom: 1rem;
}

.section-heading p {
  max-width: 460px;
  margin-bottom: 0;
  line-height: 1.5;
}

.chart-frame {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-soft), transparent);
}

.chart-frame svg {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

/* SVG text takes `fill`, not `color`, so it ignores the inherited theme colour
   and falls back to the SVG default of solid black — invisible on the dark
   background. Every classed SVG element needs an explicit fill or stroke. */
.chart-label {
  fill: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.chart-value {
  fill: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.axis-label {
  fill: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Lines default to `stroke: none`, so these were not faint — they were absent. */
.grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

.zero-line {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.75;
}

.lane {
  stroke: var(--surface-soft);
  stroke-width: 18;
  stroke-linecap: round;
}

.chart-empty {
  padding: 2rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.95rem 1rem;
  text-align: right;
  vertical-align: middle;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.control-row {
  background: color-mix(in srgb, var(--control) 9%, transparent);
}

.low-confidence-row {
  color: var(--faint);
  opacity: 0.72;
}

.source-name {
  display: block;
  color: var(--text);
  font-weight: 800;
}

.low-confidence-row .source-name {
  color: var(--muted);
}

.source-id {
  display: block;
  margin-top: 0.2rem;
  color: var(--faint);
  font-size: 0.84rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.48rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.control {
  border-color: color-mix(in srgb, var(--control) 60%, var(--border));
  color: var(--control);
}

.badge.confidence {
  border-color: color-mix(in srgb, var(--warning) 60%, var(--border));
  color: var(--warning);
}

.reliability-pill {
  display: inline-flex;
  min-width: 4.8rem;
  justify-content: center;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  background: color-mix(in srgb, var(--success) 17%, transparent);
  color: var(--success);
  font-weight: 900;
}

.reliability-pill.warning {
  background: color-mix(in srgb, var(--warning) 17%, transparent);
  color: var(--warning);
}

.reliability-pill.danger {
  background: color-mix(in srgb, var(--danger) 17%, transparent);
  color: var(--danger);
}

.footer {
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  padding: 2rem 0 3rem;
  font-size: 0.95rem;
}

@media (max-width: 920px) {
  .intro-grid,
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .intro-grid {
    padding-top: 2.4rem;
  }

  .verdict-card {
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 1180px);
  }

  .topbar,
  .section-heading,
  .empty-state {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-grid,
  .metric-grid,
  .empty-state {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.4rem, 17vw, 4rem);
  }

  .metric-card {
    min-height: 118px;
  }
}
