/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Design tokens ─── */
:root {
  --bg:            #0c0c12;
  --bg-alt:        #13131c;
  --surface:       #181824;
  --surface-hi:    #1f1f2e;
  --border:        #28283c;
  --border-subtle: #1c1c2a;

  --text:          #ddddf0;
  --text-muted:    #7070a0;
  --text-faint:    #404060;

  --accent:        #818cf8;
  --accent-hover:  #a5b4fc;
  --accent-dim:    rgba(129, 140, 248, 0.12);
  --accent-glow:   rgba(129, 140, 248, 0.08);

  --score-great-bg:   #0a2818;
  --score-great-text: #4ade80;
  --score-good-bg:    #251800;
  --score-good-text:  #fbbf24;
  --score-bad-bg:     #250a0a;
  --score-bad-text:   #f87171;

  --max-width: 1120px;
  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  --radius: 10px;
  --radius-sm: 6px;

  color-scheme: dark;
}

/* ─── Base ─── */
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--accent-hover);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ─── Nav ─── */
.site-header {
  background: rgba(12, 12, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--accent); text-decoration: none; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }

.nav-github {
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
}
.nav-github:hover { border-color: var(--accent) !important; color: var(--accent) !important; background: var(--accent-dim) !important; }

/* ─── Layout ─── */
main { max-width: var(--max-width); margin: 0 auto; padding: 3rem 1.5rem 6rem; }

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-faint);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ─── Hero ─── */
.hero {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 3.5rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 40% at 10% 0%, rgba(129,140,248,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  max-width: 22ch;
  color: var(--text);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.6;
}

/* ─── Hero stats ─── */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}
.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.hero-stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ─── Disclaimer ─── */
.disclaimer {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 3.5rem;
  font-size: 0.88rem;
  color: #c4a060;
}
.disclaimer strong { color: #fbbf24; }

/* ─── Findings ─── */
.findings > h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.finding {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  background: var(--surface);
  transition: border-color 0.2s;
}
.finding:hover { border-color: var(--border-subtle); border-color: rgba(129,140,248,0.2); }

.finding-verdict {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.85rem;
}

.finding-null     { background: rgba(100,100,150,0.2); color: #9090b8; border: 1px solid rgba(100,100,150,0.3); }
.finding-moderate { background: rgba(251,191,36,0.1);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.finding-bad      { background: rgba(248,113,113,0.1); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.finding-positive { background: rgba(52,211,153,0.1);  color: #34d399; border: 1px solid rgba(52,211,153,0.2); }

.finding h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.6rem; color: var(--text); }
.finding p  { color: #b0b0cc; margin-bottom: 0.6rem; font-size: 0.95rem; }
.finding ul { padding-left: 1.25rem; color: #b0b0cc; margin-bottom: 0.6rem; }
.finding li { margin-bottom: 0.3rem; font-size: 0.95rem; }
.finding-detail { font-size: 0.875rem; color: var(--text-muted) !important; }

/* Finding severity variants */
.finding--critical { border-color: rgba(248,113,113,0.25); }
.finding--critical:hover { border-color: rgba(248,113,113,0.4); }
.finding--danger   { border-color: rgba(248,113,113,0.15); }
.finding--surprise { border-color: rgba(100,100,150,0.2); background: rgba(255,255,255,0.01); }
.finding--amplifier { border-color: rgba(251,191,36,0.15); }

.finding-prose {
  padding: 1.75rem 0 0.5rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}
.home-findings .finding-prose:first-child {
  border-top: none;
  padding-top: 0;
}
.finding-prose h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.finding-prose p {
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 72ch;
}
.finding-prose p strong { color: var(--text); }
.finding-prose a { color: var(--accent); }

/* Home disclaimer */
.home-disclaimer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-faint);
  max-width: 70ch;
  line-height: 1.6;
}
.home-disclaimer a { color: var(--text-faint); text-decoration: underline; }
.home-disclaimer a:hover { color: var(--text-muted); }

/* ─── Bottom line ─── */
.bottom-line { margin-top: 4rem; }
.bottom-line > h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}
.summary-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: var(--surface-hi);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.summary-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.summary-table tr:last-child td { border-bottom: none; }

.verdict-cell { font-weight: 600; white-space: nowrap; }
.verdict-none  { color: var(--text-muted); }
.verdict-bad   { color: #f87171; }
.verdict-worst { color: #fca5a5; }

.bottom-line-cta {
  font-size: 0.93rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 60ch;
}

/* Experiment overview grid */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0 2.5rem;
}

.exp-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

.exp-card:hover { border-color: rgba(129,140,248,0.4); transform: translateY(-2px); text-decoration: none; }

[data-theme="light"] .exp-card:hover { border-color: #818cf8; }

.exp-card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.exp-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text); }
.exp-card p  { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.6; }

.exp-card-finding { color: var(--text) !important; }

.exp-card-link {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.overview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.bottom-line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #0c0c12;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--accent-hover); color: #0c0c12; text-decoration: none; transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--accent-dim); color: var(--accent-hover); border-color: var(--accent); transform: translateY(-1px); }

[data-theme="light"] .btn--ghost { color: var(--accent); }
[data-theme="light"] .btn--ghost:hover { color: var(--accent-hover); }

/* ─── Page header ─── */
.page-toc {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1rem 1.25rem 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 480px;
}
.toc-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.page-toc ol {
  margin: 0;
  padding-left: 1.2rem;
  list-style: decimal;
}
.page-toc li {
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
}
.page-toc a {
  color: var(--accent);
  text-decoration: none;
}
.page-toc a:hover { text-decoration: underline; }

.page-header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.6rem;
}
.page-header p { color: var(--text-muted); max-width: 66ch; font-size: 0.92rem; }
.page-meta { font-size: 0.8rem; margin-top: 0.75rem; color: var(--text-faint); line-height: 1.8; }

/* ─── Embedder comparison section ─── */
.embedder-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.embedder-section-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.embedder-section-sub { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1rem; }
.embed-model-name { font-size: 0.72rem; font-weight: 400; opacity: 0.7; }

/* ─── Results controls ─── */
.results-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.control-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.control-group select {
  font-size: 0.9rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.control-group select:focus { border-color: var(--accent); }

.mode-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.mode-btn {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.mode-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.mode-btn.active { background: var(--accent); border-color: var(--accent); color: #ffffff; font-weight: 700; }
[data-theme="light"] .mode-btn.active { color: #ffffff; }

/* ─── Mode description ─── */
.mode-description {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 80ch;
  line-height: 1.6;
}
.mode-description strong { color: var(--text); }

/* ─── Click hint ─── */
.click-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

/* ─── Score table ─── */
.results-table-wrap { overflow-x: auto; }
.table-scroll { overflow-x: auto; margin-bottom: 2rem; }

.score-table {
  border-collapse: collapse;
  font-size: 0.86rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.score-table th {
  text-align: left;
  padding: 0.55rem 0.8rem;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.score-table td {
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-family: var(--mono);
  font-size: 0.83rem;
  text-align: center;
  cursor: pointer;
  transition: filter 0.1s;
}
.score-table td:first-child {
  text-align: left;
  font-family: var(--font);
  font-size: 0.86rem;
  cursor: default;
  white-space: nowrap;
  color: var(--text-muted);
  background: var(--surface);
}
.score-table td[data-run] { cursor: pointer; }
.score-table td[data-run]:hover { filter: brightness(1.2); }

/* Score semantic classes */
.score-great { background: var(--score-great-bg); color: var(--score-great-text); font-weight: 600; }
.score-good  { background: var(--score-good-bg);  color: var(--score-good-text);  font-weight: 600; }
.score-bad   { background: var(--score-bad-bg);   color: var(--score-bad-text);   font-weight: 600; }
.score-null  { color: var(--text-faint); }

/* Static score classes for RAG strategies page */
.s100,.s99,.s98,.s97,.s96,.s95,.s94,.s93,.s92,.s91,.s90,.s89,.s88,.s87,.s86,.s85
  { background: var(--score-great-bg); color: var(--score-great-text); font-weight: 600; }
.s84,.s83,.s82,.s81,.s80,.s79,.s78,.s77,.s76,.s75,.s74,.s73,.s72,.s71,.s70,.s69,.s68,.s67,.s66,.s65
  { background: var(--score-good-bg);  color: var(--score-good-text);  font-weight: 600; }
.s64,.s63,.s62,.s61,.s60,.s59,.s58,.s57,.s56,.s55,.s54,.s53,.s52,.s51,.s50,.s49,.s48,.s47,.s46,.s45,
.s44,.s43,.s42,.s41,.s40,.s39,.s38,.s37,.s36,.s35,.s34,.s33,.s32,.s31,.s30,.s29,.s28,.s27,.s26,.s25,
.s24,.s23,.s22,.s21,.s20,.s19,.s18,.s17,.s16,.s15,.s14,.s13,.s12,.s11,.s10,.s9,.s8,.s7,.s6,.s5,.s4,.s3,.s2,.s1,.s0
  { background: var(--score-bad-bg);   color: var(--score-bad-text);   font-weight: 600; }

.score-best  { outline: 1px solid rgba(74, 222, 128, 0.4); }
.score-worst { outline: 1px solid rgba(248, 113, 113, 0.4); }
.score-table--narrow { width: auto; min-width: 400px; }
.score-table caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: left;
  padding-bottom: 0.5rem;
  caption-side: top;
}
.score-table--prose td {
  font-family: var(--font);
  font-size: 0.86rem;
  text-align: left;
  cursor: default;
  color: var(--text-muted);
  line-height: 1.5;
}
.score-table--prose td:hover { filter: none; }

.delta-good    { color: var(--score-great-text); font-weight: 700; }
.delta-bad     { color: var(--score-bad-text);   font-weight: 700; }
.delta-neutral { color: var(--text-muted);       font-weight: 700; }

/* ─── Response panel ─── */
.response-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: min(520px, 100vw);
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 200;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}

.panel-close {
  display: block;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: border-color 0.15s;
}
.panel-close:hover { border-color: var(--accent); color: var(--accent); }

.panel-query { font-size: 0.82rem; color: var(--text-faint); margin-bottom: 0.6rem; }
.panel-score { font-family: var(--mono); font-size: 0.82rem; margin-bottom: 1.25rem; color: var(--text-muted); }
.panel-answer {
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  color: var(--text-muted);
}

.panel-qid  { font-size: 0.8rem;  font-weight: 600; color: var(--text-muted); margin-bottom: 0.25rem; }
.panel-question { font-size: 0.85rem; color: var(--text); margin-bottom: 0.4rem; }

/* ─── RAG strategies page ─── */
.prose-section { max-width: 68ch; margin-bottom: 2.5rem; }
.prose-section h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text); }
.prose-section p { margin-bottom: 0.75rem; color: var(--text-muted); font-size: 0.93rem; }

.strat-grid { margin-bottom: 3rem; }
.strat-grid h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; }

.strat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.strat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--surface);
  transition: border-color 0.2s;
}
.strat-card:hover { border-color: rgba(129,140,248,0.3); }
.strat-card--winner  { border-color: rgba(74,222,128,0.3);  background: rgba(10,40,24,0.6); }
.strat-card--warning { border-color: rgba(248,113,113,0.3); background: rgba(37,10,10,0.6); }

[data-theme="light"] .strat-card--winner  { border-color: #86efac; background: #f0fdf4; }
[data-theme="light"] .strat-card--warning { border-color: #fca5a5; background: #fff5f5; }

.strat-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--text); }
.strat-card p  { font-size: 0.86rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.strat-baseline { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
.strat-tag      { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }

.rag-results h2 { font-size: 1.2rem; font-weight: 600; margin: 2.5rem 0 0.5rem; color: var(--text); }
.rag-results h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.4rem; color: var(--text); }
.rag-results p  { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; }

/* ─── Glossary ─── */
.glossary { max-width: 720px; }

.glossary-entry {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.glossary-entry:last-child { border-bottom: none; }

.glossary-term {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--text);
}

.glossary-full {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
}

.glossary-entry p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.65; }

/* ─── About page ─── */
.about-content { max-width: 760px; }

.about-section {
  margin-bottom: 3.5rem;
}
.about-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.about-section > p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 0.9rem;
  line-height: 1.7;
}

.corpus-grid, .degradation-grid, .scoring-grid, .models-grid {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
}
.corpus-grid   { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.degradation-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.scoring-grid  { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.models-grid   { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.corpus-card, .degradation-card, .scoring-card, .models-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--surface);
}
.corpus-card h3, .scoring-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.corpus-card p, .scoring-card p, .degradation-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.corpus-label, .degradation-card .deg-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.deg-name { margin-bottom: 0.4rem; }
.corpus-meta {
  font-size: 0.75rem !important;
  color: var(--text-faint) !important;
  font-family: var(--mono);
}

.explainer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.explainer-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  background: var(--surface);
}
.explainer-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.explainer-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.explainer-aka {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-faint);
}
.explainer-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 0.65rem;
}
.explainer-label--mode     { background: rgba(129,140,248,0.12); color: var(--accent); border: 1px solid rgba(129,140,248,0.2); }
.explainer-label--strategy { background: rgba(74,222,128,0.08);  color: #4ade80;        border: 1px solid rgba(74,222,128,0.15); }

.models-card {
  padding: 1rem 1.25rem;
}
.models-provider {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.models-card ul {
  list-style: none;
  padding: 0;
}
.models-card li {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.models-card li:last-child { border-bottom: none; }
.models-note { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

.limitations-list {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.limitations-list li { margin-bottom: 0.65rem; line-height: 1.65; }
.limitations-list strong { color: var(--text); }

/* ─── Theme toggle ─── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .toggle-icon { font-size: 0.9rem; line-height: 1; }

/* Light mode overrides */
[data-theme="light"] {
  --bg:            #ffffff;
  --bg-alt:        #f6f6fa;
  --surface:       #f0f0f8;
  --surface-hi:    #e8e8f4;
  --border:        #d0d0e8;
  --border-subtle: #e4e4f0;

  --text:          #111122;
  --text-muted:    #555578;
  --text-faint:    #9999bb;

  --accent:        #4f46e5;
  --accent-hover:  #6366f1;
  --accent-dim:    rgba(79, 70, 229, 0.08);
  --accent-glow:   rgba(79, 70, 229, 0.05);

  --score-great-bg:   #dcfce7;
  --score-great-text: #166534;
  --score-good-bg:    #fef9c3;
  --score-good-text:  #854d0e;
  --score-bad-bg:     #fee2e2;
  --score-bad-text:   #991b1b;

  color-scheme: light;
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.85);
}
[data-theme="light"] .hero::before {
  background: radial-gradient(ellipse 60% 40% at 10% 0%, rgba(79,70,229,0.04) 0%, transparent 70%);
}
[data-theme="light"] .finding { background: #fafafe; }
[data-theme="light"] .finding p,
[data-theme="light"] .finding ul { color: #333355; }
[data-theme="light"] .score-table td:first-child { background: #f4f4fa; }
[data-theme="light"] .response-panel { background: var(--bg-alt); box-shadow: -8px 0 40px rgba(0,0,0,0.1); }
[data-theme="light"] .btn:not(.btn--ghost) { color: #ffffff; }
[data-theme="light"] .btn:not(.btn--ghost):hover { color: #ffffff; }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .nav-links li:not(:last-child) { display: none; }
  main { padding: 2rem 1rem 4rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .strat-cards { grid-template-columns: 1fr; }
  .finding { padding: 1.25rem; }
}
