/* [OPUS-4.8] sparq benchmark dashboard — eye-js / Jelly style: system font, light theme with a
   dark-mode media query, card layout, sticky table header, zebra rows, tabular-nums, Δ pills. */
:root {
  --bg: #f6f8fa; --card: #ffffff; --fg: #1f2328; --muted: #586069; --line: #d8dee4;
  --accent: #2563eb; --zebra: #fafbfc; --head: #f0f3f6;
  --best-bg: #dcfce7; --best-fg: #166534; --worse-bg: #fee2e2; --worse-fg: #991b1b; --na: #e5e7eb;
  /* [OPUS-4.8] sq-19z8: per-metric semantic badges (regime + result-mode), muted by design. */
  --badge-entailed-bg: #ede9fe; --badge-entailed-fg: #5b21b6;
  --badge-extensional-bg: #e0f2fe; --badge-extensional-fg: #075985;
  --badge-mode-bg: #eef0f3; --badge-mode-fg: #586069;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --card: #161b22; --fg: #e6edf3; --muted: #9aa4b2; --line: #30363d;
    --accent: #58a6ff; --zebra: #11161d; --head: #1b222c;
    --best-bg: #0f3d24; --best-fg: #4ade80; --worse-bg: #4a1d1d; --worse-fg: #f87171; --na: #30363d;
    /* [OPUS-4.8] sq-19z8 dark-mode semantic-badge palette. */
    --badge-entailed-bg: #2e1065; --badge-entailed-fg: #c4b5fd;
    --badge-extensional-bg: #0c2a3e; --badge-extensional-fg: #7dd3fc;
    --badge-mode-bg: #21262d; --badge-mode-fg: #9aa4b2;
  }
}

* { box-sizing: border-box; }
html { font-variant-numeric: tabular-nums; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--head); padding: 1px 5px; border-radius: 4px; }

.site-header { border-bottom: 1px solid var(--line); background: var(--card); padding: 22px 0; }
.site-header h1 { margin: 0; font-size: 1.55rem; font-weight: 650; letter-spacing: -0.01em; }
.site-header .sub { color: var(--muted); font-weight: 400; }
.meta { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.meta .dot { margin: 0 8px; opacity: 0.5; }

main.wrap { padding-top: 24px; padding-bottom: 48px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 24px; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card h2 { margin: 0 0 14px; font-size: 1.1rem; font-weight: 620; }
.hint { color: var(--muted); font-size: 0.85rem; margin: -6px 0 16px; }

.commit-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 14px; font-size: 0.9rem; }
.commit-meta .sha { font-family: var(--mono); font-weight: 600; }
.commit-meta .msg { color: var(--fg); flex: 1 1 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-meta .when { color: var(--muted); }

table.summary-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.summary-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--head); text-align: left;
  padding: 9px 12px; font-weight: 600; border-bottom: 1px solid var(--line); color: var(--muted);
}
.summary-table th.num, .summary-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.summary-table tbody td { padding: 7px 12px; border-bottom: 1px solid var(--line); }
.summary-table tbody tr:nth-child(even):not(.group-row) { background: var(--zebra); }
.summary-table tr.group-row th.group {
  background: var(--card); text-align: left; padding: 14px 12px 6px; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-weight: 700;
}
.summary-table td.metric { font-weight: 500; }
/* [OPUS-4.8] sq-ocuf: readable label on top, raw metric stem muted underneath (transparency).
   The full raw-stem + dataset + query tooltip is on the cell's title attr (hover anywhere). */
.summary-table td.metric .metric-label { display: block; }
.summary-table td.metric .metric-stem {
  display: block; margin-top: 2px; background: none; padding: 0;
  font-size: 0.74rem; color: var(--muted); font-weight: 400; cursor: help;
}
.summary-table td.unit { color: var(--muted); }

.pill {
  display: inline-block; min-width: 48px; text-align: center; padding: 2px 9px;
  border-radius: 999px; font-size: 0.78rem; font-weight: 650; font-variant-numeric: tabular-nums;
}
.pill-best { background: var(--best-bg); color: var(--best-fg); }
.pill-worse { background: var(--worse-bg); color: var(--worse-fg); }
.pill-na { background: var(--na); color: var(--muted); }

/* [OPUS-4.8] sq-19z8: per-metric SEMANTIC badges (LUBM regime + result mode), shown next to the
   metric label. Smaller + lighter-weight than the Δ pill so they READ as metadata, not a verdict;
   the regime/mode value previously lived only in the cell's title-attr tooltip. */
.metric-badges { margin-left: 7px; white-space: nowrap; }
.metric-badge {
  min-width: 0; padding: 1px 7px; margin-left: 4px; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.01em; vertical-align: middle; cursor: help;
}
.metric-badge:first-child { margin-left: 0; }
.badge-entailed { background: var(--badge-entailed-bg); color: var(--badge-entailed-fg); }
.badge-extensional { background: var(--badge-extensional-bg); color: var(--badge-extensional-fg); }
.badge-mode { background: var(--badge-mode-bg); color: var(--badge-mode-fg); }

/* [OPUS-4.8] sq-aas7: FEATURED-tier provenance badge. Shows whether the featured numbers came from
   the EC2/nightly series (preferred when present) or the per-commit gh-runner band. Reuses the
   .pill base; nightly is the "best/promoted" colour, per-commit a muted neutral. */
.featured-tier { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.tier-badge { min-width: 0; cursor: help; }
.tier-nightly { background: var(--best-bg); color: var(--best-fg); }
.tier-per-commit { background: var(--na); color: var(--muted); }
.featured-tier-note { font-size: 0.82rem; color: var(--muted); }

.chart-group { margin-bottom: 26px; }
.chart-group h3 {
  margin: 0 0 12px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent); font-weight: 700;
}
.chart-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 8px;
}
.chart-card .chart-title {
  font-size: 0.82rem; font-weight: 550; margin-bottom: 2px; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* [OPUS-4.8] sq-ocuf: raw metric stem under each chart title (muted, transparency); hover for
   the full dataset/query tooltip. */
.chart-card .chart-stem {
  display: block; background: none; padding: 0; margin-bottom: 6px; cursor: help;
  font-size: 0.7rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chart-card canvas { height: 140px !important; width: 100% !important; }

/* [OPUS-4.8] sq-rltn: capability FAMILIES — the summary-first view. A nav chip row makes every
   query type visible at a glance; each family is a prominent section with a summary table and a
   lazily-loaded <details> trends grid. An empty family shows a muted "not yet reported" note. */
.family-nav {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px;
}
.family-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--head);
  font-size: 0.82rem; font-weight: 600; color: var(--fg); text-decoration: none;
}
.family-chip:hover { border-color: var(--accent); text-decoration: none; }
.family-chip .family-chip-count {
  display: inline-block; min-width: 20px; text-align: center; padding: 0 6px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 700;
}
.family-chip-empty { opacity: 0.55; }
.family-chip-empty .family-chip-count { background: var(--na); color: var(--muted); }

.family-section { margin: 0 0 26px; scroll-margin-top: 16px; }
.family-section:last-child { margin-bottom: 0; }
.family-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px;
  padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.family-title {
  margin: 0; font-size: 0.95rem; font-weight: 700; letter-spacing: 0.01em; color: var(--fg);
}
/* the capability surfaces get an accent stripe so they don't feel buried under the SPARQL volume. */
.family-section.family-capability .family-head { border-bottom-color: var(--accent); }
.family-meta { font-size: 0.78rem; color: var(--muted); }
.family-empty { margin: 6px 0 0; }

.family-trends { margin-top: 12px; }
.family-trends > summary {
  cursor: pointer; font-size: 0.8rem; font-weight: 650; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 0; list-style: revert;
}
.family-trends > summary:hover { text-decoration: underline; }
.family-trends[open] > summary { margin-bottom: 10px; }

/* [OPUS-4.8] sq-xvow: featured well-known suites at the top. One table per suite, with sparq's
   latest value + optional competitor columns (the sq-t0c3 seam). Reuses .summary-table styling. */
#featured-card .featured-suite { margin-bottom: 22px; }
#featured-card .featured-suite:last-child { margin-bottom: 0; }
.featured-title {
  margin: 0 0 10px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent); font-weight: 700;
}
/* [OPUS-4.8] sq-5o5.3: per-suite honest framing caption (e.g. the ZK estate's circuit-COST,
   not-speed, research-grade / not-audited note). Muted + italic, like the scaling/refs captions. */
.featured-suite-note {
  font-size: 0.74rem; color: var(--muted); font-style: italic; margin: -4px 0 10px; line-height: 1.5;
}
.featured-table th.competitor-col, .featured-table td.competitor-col { color: var(--muted); }
/* sparq's own column reads slightly stronger than competitor columns so the engine-under-test is
   visually anchored. */
.featured-table thead th:nth-child(2) { color: var(--fg); }
.featured-table td.competitor-na { color: var(--muted); opacity: 0.7; }
/* [OPUS-4.8] sq-i0nm: competitor column header shows the engine name + the pinned VERSION inline
   (muted, smaller) so versions are visible for transparency, not just on hover. */
.featured-table th.competitor-col .competitor-name { display: block; }
.featured-table th.competitor-col .competitor-version {
  display: block; font-size: 0.66rem; font-weight: 400; color: var(--muted); opacity: 0.8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* [OPUS-4.8] sq-i0nm: per-suite EXTERNAL-REFERENCE baselines — real cited competitor numbers at
   their own scale/machine, shown beneath the comparison table (NOT a same-scale comparison). */
.featured-refs { margin: 8px 0 4px; }
.featured-refs-head {
  font-size: 0.72rem; color: var(--muted); font-style: italic; margin-bottom: 4px;
}
.featured-refs-list { margin: 0; padding-left: 16px; }
.featured-ref { font-size: 0.74rem; color: var(--muted); line-height: 1.5; cursor: help; }

/* [OPUS-4.8] sq-viby: scaling charts at the bottom. Same chart-card shell as the trend charts; a
   muted note appears for single-point families until more sizes are reported. */
#scaling-card .scaling-card { display: flex; flex-direction: column; }
.scaling-note {
  font-size: 0.72rem; color: var(--muted); margin: -2px 0 6px; font-style: italic;
}
.scaling-card canvas { height: 160px !important; width: 100% !important; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; padding: 18px 0; }
