/* DTP LLM Benchmark — minimal scaffold styles. Phase 5 layers on the rich
   chart styling. Tone: serious, readable, tasteful — closer to a docs site
   than a marketing landing. */

:root {
  --color-bg: #fafaf7;
  --color-fg: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-accent: #2a5d9f;
  --color-border: #e4e4dc;
  --color-card-bg: #ffffff;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-width: 1100px;
  --pad: 1.5rem;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-fg);
  background: var(--color-bg);
  line-height: 1.55;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--pad);
}

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

h1, h2, h3 {
  line-height: 1.2;
  margin: 1.5em 0 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 3px;
}
code { padding: 0.1em 0.3em; }
pre { padding: 0.75rem; overflow-x: auto; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-card-bg);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.brand { display: flex; align-items: baseline; gap: 0.75rem; text-decoration: none; color: var(--color-fg); }
.brand-tagline { color: var(--color-muted); font-size: 0.85rem; }
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--color-fg); }
.site-nav a:hover { color: var(--color-accent); }
.site-nav a.active { color: var(--color-accent); font-weight: 600; }

/* Main */
main { padding: 2rem 0 3rem; }

.page-header h1 { margin-top: 0; }
.lede { color: var(--color-muted); font-size: 1.1rem; margin-top: 0.25rem; }

/* Hero / landing */
.hero h1 { font-size: 2.3rem; max-width: 22ch; }
.hero .lede { max-width: 60ch; }
.snapshot-date { color: var(--color-muted); font-size: 0.9rem; font-family: var(--font-mono); }

/* Slider controls */
.slider-controls {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.slider-group { flex: 1 1 320px; }
.slider-group label { display: block; font-size: 0.95rem; }
.slider-group input[type="range"] { width: 100%; margin-top: 0.5rem; }
.toggle-group { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; font-size: 0.9rem; }
.toggle-label { color: var(--color-muted); }

/* Sections */
section { margin: 2.5rem 0; }
.section-blurb { color: var(--color-muted); max-width: 60ch; }

/* Category grid (landing) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.category-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1rem;
}
.category-card h3 { margin-top: 0; }
.category-card h3 a { text-decoration: none; }
.category-blurb { color: var(--color-muted); font-size: 0.9rem; }
.placeholder { font-size: 0.85rem; color: var(--color-muted); }

/* Heatmap placeholder */
.heatmap-placeholder,
.composite-placeholder {
  background: var(--color-card-bg);
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  padding: 2rem;
  text-align: center;
  color: var(--color-muted);
}

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-border); }
th { font-weight: 600; color: var(--color-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Judge panel */
.judge-table { background: var(--color-card-bg); border: 1px solid var(--color-border); border-radius: 6px; overflow: hidden; }
.panel-meta { color: var(--color-muted); font-size: 0.9rem; }

/* Model pages */
.model-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin-top: 0.5rem; }
.model-meta dt { color: var(--color-muted); font-size: 0.9rem; }
.verdict-paragraph { font-size: 1.05rem; max-width: 70ch; }

/* Index lists */
.index-list ul { list-style: none; padding: 0; }
.index-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--color-border); }
.index-list li a { font-weight: 600; }
.index-list li p { margin: 0.25rem 0 0; color: var(--color-muted); font-size: 0.9rem; }

/* Subscribe form */
.subscribe-form { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.subscribe-form button {
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: white;
  border: 0;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
}
.subscribe-form button:hover { background: #1f4677; }

/* =========================================================================
   Heatmap
   ========================================================================= */
.heatmap-wrapper { overflow-x: auto; margin: 1rem 0 1.5rem; }
.heatmap-table { border-collapse: collapse; min-width: 100%; font-size: 0.9rem; }
.heatmap-table th, .heatmap-table td { border: 1px solid var(--color-border); padding: 0.4rem 0.5rem; vertical-align: middle; }
.heatmap-table th { background: var(--color-card-bg); position: sticky; top: 0; z-index: 1; }
.heatmap-table th.hm-col { font-size: 0.78rem; line-height: 1.2; max-width: 130px; text-align: center; }
.heatmap-table th.hm-col a { color: var(--color-accent); text-decoration: none; }
.heatmap-table th.hm-col a:hover { text-decoration: underline; }
.heatmap-table th.hm-corner { text-align: left; min-width: 180px; }
.heatmap-table th.hm-totals { text-align: right; }
.hm-model { font-weight: 500; }
.hm-model a { color: var(--color-accent); text-decoration: none; }
.hm-model a:hover { text-decoration: underline; }
.hm-model small { display: block; color: var(--color-muted); font-size: 0.78rem; font-weight: 400; }

/*
  Cost-position color gradient: 0 = bright green (cheapest), 1 = bright red.
  We mix the hue from green (110°) through yellow (60°) to red (10°) as a
  function of --cost-pos. Lightness stays mid (75%) so text is readable.
  Saturation high (60%) so colors are vivid without becoming garish.
*/
.hm-cell {
  text-align: center;
  --cost-pos: 0.5;
  --cost-hue: calc(110 - (var(--cost-pos) * 100));    /* 110° green → 10° red */
  --cost-light: calc(82% - (var(--cost-pos) * 8%));   /* slightly darker as cost rises */
  background-color: hsl(var(--cost-hue), 65%, var(--cost-light));
  color: hsl(var(--cost-hue), 40%, 20%);
  position: relative;
  padding: 0;
}
.hm-cell-link {
  display: block;
  padding: 0.5rem 0.5rem;
  color: inherit;
  text-decoration: none;
  line-height: 1.25;
}
.hm-cell-link:hover { background-color: rgba(0, 0, 0, 0.05); }
.hm-cell.hm-empty {
  background-color: #f2f2ee;
  color: #b8b8b0;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(0,0,0,0.04) 4px, rgba(0,0,0,0.04) 6px);
}
.hm-num { font-variant-numeric: tabular-nums; font-size: 0.95rem; font-weight: 600; display: block; }
.hm-savings { font-size: 0.78rem; font-variant-numeric: tabular-nums; display: block; opacity: 0.85; }
.hm-star { color: #c95d3f; font-size: 0.95rem; }
.hm-totals { text-align: right; font-variant-numeric: tabular-nums; }
.hm-totals small { color: var(--color-muted); display: block; font-size: 0.78rem; }

/* Legend below the heatmap. */
.hm-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.hm-legend-label { font-weight: 500; color: var(--color-fg); }
.hm-legend-gradient {
  display: inline-block;
  height: 0.7rem;
  width: 180px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    hsl(110, 65%, 82%),
    hsl(60, 65%, 78%),
    hsl(10, 65%, 74%)
  );
  border: 1px solid var(--color-border);
}
.hm-legend-tick { font-size: 0.78rem; }
.hm-legend-min::before { content: "←"; margin-right: 0.25em; color: #3f7d4c; }
.hm-legend-max::after  { content: "→"; margin-left: 0.25em; color: #c25240; }
.hm-legend-aside { flex-basis: 100%; font-size: 0.8rem; }

/* =========================================================================
   Composite leaderboard
   ========================================================================= */
.composite-table { width: 100%; font-size: 0.95rem; }
.composite-table th.num, .composite-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.composite-table td.rank { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.composite-table .model-link { font-weight: 600; text-decoration: none; }
.composite-table small { color: var(--color-muted); font-size: 0.82rem; }
.composite-table .rate-pct { color: var(--color-muted); font-size: 0.82rem; margin-left: 0.4em; }
.composite-table .muted { color: var(--color-muted); }
.composite-blurb { color: var(--color-muted); font-size: 0.9rem; max-width: 70ch; }

/* =========================================================================
   Category mini-tables (landing)
   ========================================================================= */
.cat-mini { width: 100%; font-size: 0.85rem; margin-top: 0.5rem; }
.cat-mini th, .cat-mini td { padding: 0.3rem 0.35rem; border-bottom: 1px solid var(--color-border); }
.cat-mini th { font-size: 0.72rem; color: var(--color-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.cat-mini th.num, .cat-mini td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cat-mini tbody tr:last-child td { border-bottom: 0; }
.cat-mini a { text-decoration: none; }
.cat-mini a:hover { text-decoration: underline; }
.cat-cta { margin-top: 0.6rem; font-size: 0.85rem; }

/* =========================================================================
   Task page CI bars
   ========================================================================= */
.ci-chart { margin: 1rem 0; }
.ci-svg { width: 100%; max-width: 900px; height: auto; display: block; }
.ci-row { cursor: pointer; }
.ci-row:hover text { fill: var(--color-accent); }
.ci-row-marginal text { fill: var(--color-muted); }
.ci-legend { color: var(--color-muted); font-size: 0.85rem; margin-top: 0.5rem; max-width: 70ch; }
.legend-swatch { display: inline-block; width: 1em; height: 0.7em; vertical-align: middle; margin-right: 0.2em; }
.legend-swatch.legend-solid { background: var(--color-accent); }
.legend-swatch.legend-stripe {
  background: var(--color-accent);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255,255,255,0.6) 2px, rgba(255,255,255,0.6) 4px);
  opacity: 0.4;
}

/* =========================================================================
   Cost table on task page
   ========================================================================= */
.cost-table { width: 100%; }
.cost-table th.num, .cost-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cost-table small { color: var(--color-muted); display: block; font-size: 0.78rem; }
.cost-table .row-anchor { background-color: rgba(201, 93, 63, 0.06); }
.badge {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  font-size: 0.7rem;
  border-radius: 3px;
  margin-left: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}
.badge-frontier { background: rgba(201, 93, 63, 0.15); color: #a04a30; }
.savings { color: #3f7d4c; font-weight: 600; }
.check { color: #3f7d4c; font-weight: 600; }
.task-token-shape { color: var(--color-muted); font-size: 0.85rem; max-width: 75ch; }

/* =========================================================================
   Category page task cards
   ========================================================================= */
.task-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.task-card h3 { margin-top: 0; }
.task-card h3 a { text-decoration: none; }
.task-card .task-blurb { color: var(--color-muted); font-size: 0.9rem; }
.task-status { font-style: italic; }
.mini-task-table { width: 100%; font-size: 0.9rem; margin-top: 0.5rem; }
.mini-task-table th.num, .mini-task-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-task-table td.rank { color: var(--color-muted); }
.more { margin: 0.4rem 0 0; font-size: 0.85rem; }
.row-anchor { background-color: rgba(201, 93, 63, 0.04); }

/* =========================================================================
   Model page
   ========================================================================= */
.scatter-wrapper { max-width: 720px; margin: 1rem 0; }
.scatter-svg { width: 100%; height: auto; display: block; }
.scatter-svg circle { transition: r 0.1s ease; }
.scatter-svg a:hover circle { r: 6; }
.scatter-legend { color: var(--color-muted); font-size: 0.85rem; }
.dot { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; vertical-align: middle; }
.dot-green { background: #3f7d4c; }
.dot-grey { background: #9aa6b2; }
.model-task-table { width: 100%; font-size: 0.9rem; }
.model-task-table th.num, .model-task-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* =========================================================================
   Empty / muted states
   ========================================================================= */
.empty-state {
  background: var(--color-card-bg);
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  color: var(--color-muted);
}
.muted { color: var(--color-muted); }

/* =========================================================================
   Rubric
   ========================================================================= */
.rubric {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

/* =========================================================================
   Hero / lede polish
   ========================================================================= */
.hero { padding: 1rem 0 1.5rem; border-bottom: 1px solid var(--color-border); margin-bottom: 1.5rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-card-bg);
  margin-top: 3rem;
  padding: 2rem 0 1rem;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.footer-col h3 { margin-top: 0; font-size: 1rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { padding: 0.2rem 0; }
.footer-fineprint { color: var(--color-muted); font-size: 0.85rem; }
.footer-copyright { color: var(--color-muted); margin-top: 1.5rem; text-align: center; font-size: 0.85rem; }
