/* Rubric explorer — shared styles.
   Color roles follow the validated reference palette; category slot order is
   the CVD-safe ordering, do not reshuffle. */

:root {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --shadow: 0 1px 3px rgba(11, 11, 11, 0.08), 0 4px 16px rgba(11, 11, 11, 0.06);

  /* categorical slots, fixed order (validated light set) */
  --cat-1: #2a78d6; /* Environment & Infrastructure Setup */
  --cat-2: #1baf7a; /* Dataset and Model Acquisition */
  --cat-3: #eda100; /* Data Processing & Preparation */
  --cat-4: #008300; /* Method Implementation */
  --cat-5: #4a3aa7; /* Experimental Setup */
  --cat-6: #e34948; /* Evaluation, Metrics & Benchmarking */
  --cat-7: #e87ba4; /* Logging, Analysis & Presentation */
  --cat-0: #898781; /* uncategorized / group nodes */
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --hairline: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);

    --cat-1: #3987e5;
    --cat-2: #199e70;
    --cat-3: #c98500;
    --cat-4: #008300;
    --cat-5: #9085e9;
    --cat-6: #e66767;
    --cat-7: #d55181;
    --cat-0: #898781;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: inherit; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px 64px; }

header.site {
  padding: 28px 0 8px;
}
header.site h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
header.site p.sub { margin: 0; color: var(--ink-2); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 18px 0 8px;
  color: var(--ink-2);
  font-size: 12.5px;
}
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch {
  width: 10px; height: 10px; border-radius: 3px; flex: none;
}

.searchbar { margin: 14px 0 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.searchbar input,
.searchbar select {
  padding: 8px 12px;
  border: 1px solid var(--baseline);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.searchbar input { flex: 1 1 260px; max-width: 420px; }
.searchbar select { flex: none; cursor: pointer; }
.searchbar input:focus,
.searchbar select:focus { outline: 2px solid var(--cat-1); outline-offset: 1px; }

section.collection { margin-top: 28px; }
section.collection h2 {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 2px;
}
section.collection .count { color: var(--muted); font-weight: 400; }

.paper-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.paper-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 12px;
}
.paper-card:hover { border-color: var(--baseline); box-shadow: var(--shadow); }
.paper-card .title { font-weight: 600; margin: 0 0 2px; }
.paper-card .meta { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.paper-card .meta .slug { word-break: break-all; }

.dist {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  gap: 2px; /* 2px surface gap between fills */
  background: transparent;
}
.dist span { display: block; height: 100%; border-radius: 2px; }

.empty { color: var(--muted); margin-top: 24px; }

/* ---------- tree page ---------- */

.tree-page { display: flex; flex-direction: column; height: 100vh; }

.tree-header {
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--hairline);
  background: var(--page);
}
.tree-header .back { color: var(--ink-2); text-decoration: none; font-size: 12.5px; }
.tree-header .back:hover { color: var(--ink); }
.tree-header h1 { font-size: 16px; margin: 4px 0 2px; font-weight: 650; }
.tree-header .meta { color: var(--muted); font-size: 12.5px; }

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--hairline);
  background: var(--page);
}
.toolbar button {
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--baseline);
  border-radius: 7px;
  padding: 4px 10px;
  cursor: pointer;
}
.toolbar button:hover { border-color: var(--muted); }
.toolbar .legend { margin: 0; margin-left: auto; }

#viz { flex: 1; overflow: hidden; background: var(--page); }
#viz svg { display: block; width: 100%; height: 100%; cursor: grab; }
#viz svg:active { cursor: grabbing; }

.link { fill: none; stroke: var(--hairline); stroke-width: 1.2px; }

.node .chip {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1px;
  rx: 7px;
}
.node:hover .chip { stroke: var(--baseline); }
.node .accent { rx: 2px; }
.node text {
  fill: var(--ink);
  font-size: 11.5px;
  pointer-events: none;
}
.node text.count { fill: var(--muted); font-size: 10.5px; }
.node .toggle circle { fill: var(--surface); stroke: var(--baseline); stroke-width: 1px; }
.node .toggle:hover circle { stroke: var(--ink-2); }
.node .toggle text {
  fill: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
  pointer-events: none;
}

/* hover tooltip */
#tooltip {
  position: fixed;
  z-index: 30;
  max-width: 380px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px 11px;
  font-size: 12.5px;
  pointer-events: none;
  display: none;
}
#tooltip .cat { color: var(--ink-2); font-size: 11.5px; margin-top: 4px; }

/* detail popup */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(11, 11, 11, 0.35);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
}
#overlay.open { display: flex; }

#detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 720px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px 24px 24px;
}
#detail .crumbs { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
#detail .crumbs .sep { margin: 0 5px; }
#detail h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; line-height: 1.5; }
#detail .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
#detail .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--ink-2);
}
#detail .badge .swatch { width: 9px; height: 9px; border-radius: 3px; }
#detail dl { margin: 0; }
#detail dt {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 14px 0 3px;
}
#detail dd { margin: 0; color: var(--ink); white-space: pre-wrap; }
#detail dd.mono { font-size: 12.5px; color: var(--ink-2); }
#detail .close {
  float: right;
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--baseline);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 7px;
  padding: 2px 9px;
  cursor: pointer;
}
#detail .close:hover { color: var(--ink); }

/* Pending split members: visible but not clickable. */
.paper-card.pending { opacity: 0.55; cursor: default; pointer-events: none; border-style: dashed; }

/* --- Official-site hero, downloads, and baselines ------------------------- */
.hero .tagline { font-size: 1.05rem; color: var(--ink, #333); margin: 0.2rem 0 0.4rem; font-weight: 600; }
.stat-tiles { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.tile { background: var(--card-bg, #fff); border: 1px solid var(--border, #ddd); border-radius: 10px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 120px; }
.tile .n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 0.78rem; color: var(--muted, #666); }
.tile.wide { min-width: 230px; gap: 3px; }
.tile .pair { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tile .pair .n { font-size: 1.02rem; }
.tile .who { font-size: 0.8rem; font-weight: 600; padding-left: 10px; position: relative; }
.tile .who::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 2px; }
.tile .who.claude::before { background: var(--cat-1, #4269d0); }
.tile .who.codex::before { background: var(--cat-2, #efb118); }
.tile .l.sub { margin-top: 2px; }
.panel { margin: 18px 0; padding: 14px 16px; background: var(--panel-bg, #fafafa); border: 1px solid var(--border, #ddd); border-radius: 12px; }
.panel h2 { margin: 0 0 4px; font-size: 1.05rem; }
.bundle-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.bundle { display: flex; flex-direction: column; padding: 9px 14px; border: 1px solid var(--border, #ccc); border-radius: 9px; text-decoration: none; color: inherit; background: var(--card-bg, #fff); }
.bundle:hover { border-color: var(--cat-1, #4269d0); }
.bundle .name { font-weight: 700; }
.bundle .meta { font-size: 0.78rem; color: var(--muted, #666); }
.baseline-tiles { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0; }
.baseline-table-wrap summary { cursor: pointer; font-size: 0.9rem; color: var(--muted, #555); }
table.baseline { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 0.82rem; }
table.baseline th, table.baseline td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border, #eee); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.baseline td .frac { color: var(--muted, #888); font-size: 0.75rem; }
table.baseline td .pctbar { display: inline-block; vertical-align: middle; height: 6px; width: 64px; margin-right: 6px; border-radius: 3px; background: linear-gradient(to right, var(--cat-1, #4269d0) var(--w), var(--track, #e8e8e8) var(--w)); }
.paper-card { position: relative; }
.paper-card .stretch { position: absolute; inset: 0; z-index: 1; }
.paper-card .dl { position: relative; z-index: 2; font-size: 0.75rem; text-decoration: none; border: 1px solid var(--border, #ccc); border-radius: 6px; padding: 1px 7px; color: var(--muted, #555); align-self: flex-start; }
.paper-card .dl:hover { border-color: var(--cat-1, #4269d0); color: var(--cat-1, #4269d0); }
.toolbar .dl-link { font-size: 0.85rem; margin-left: 8px; align-self: center; text-decoration: none; border: 1px solid var(--border, #ccc); border-radius: 7px; padding: 3px 10px; color: inherit; }
.about-cols { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.about-text { flex: 1 1 380px; }
.about-text h3 { margin: 14px 0 4px; font-size: 0.95rem; }
.about-text p { margin: 4px 0 8px; line-height: 1.5; font-size: 0.92rem; }
.about-figure { flex: 0 0 300px; margin: 4px 0; }
.about-figure svg { max-width: 100%; height: auto; }
.about-figure figcaption { font-size: 0.78rem; color: var(--muted, #666); margin-top: 4px; }

/* --- Infinity brand theme (matches omega.infinity.inc) --------------------- */
body.brand {
  --brand-bg: #F8F7F2;
  --brand-accent: #D4AF37;
  --brand-accent-soft: rgba(212, 175, 55, 0.08);
  --brand-accent-line: rgba(212, 175, 55, 0.35);
  background: var(--brand-bg);
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 400;
  color: #1e1c16;
}
body.brand h1, body.brand h2, body.brand h3 { font-family: 'Crimson Pro', Georgia, serif; font-weight: 600; letter-spacing: 0.01em; }
body.brand .hero h1 { font-size: 2.4rem; margin: 0.35em 0 0.1em; }
body.brand .hero .tagline { color: #4a4635; }
body.brand .topnav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 6px; border-bottom: 1px dashed var(--brand-accent-line); }
body.brand .brandmark img { height: 34px; width: auto; display: block; }
body.brand .navlinks a { margin-left: 18px; text-decoration: none; color: #4a4635; font-size: 0.98rem; }
body.brand .navlinks a:hover { color: var(--brand-accent); }
body.brand .panel { background: var(--brand-accent-soft); border: 1px dashed var(--brand-accent-line); border-radius: 12px; }
body.brand .tile { background: #fff; border-color: var(--brand-accent-line); }
body.brand .tile .n { color: #1e1c16; }
body.brand .bundle { background: #fff; border-color: var(--brand-accent-line); }
body.brand .bundle:hover { border-color: var(--brand-accent); border-style: solid; }
body.brand .bundle .name { color: #1e1c16; }
body.brand .paper-card { background: #fff; border: 1px solid var(--brand-accent-line); }
body.brand .paper-card:hover { border-color: var(--brand-accent); }
body.brand .paper-card .dl:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
body.brand .searchbar select, body.brand .searchbar input { border: 1px solid var(--brand-accent-line); background: #fff; border-radius: 8px; font-family: inherit; }
body.brand a { color: #7a6420; }
body.brand .slug, body.brand code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

/* Compact masthead */
body.brand .masthead { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--brand-accent-line); }
body.brand .masthead .brandmark img { height: 30px; width: auto; display: block; }
body.brand .masthead .wordmark { font-family: 'Crimson Pro', Georgia, serif; font-weight: 600; font-size: 1.25rem; }
body.brand .masthead .navlinks { margin-left: auto; }
body.brand .hero.compact { padding: 10px 0 4px; }
body.brand .hero.compact .tagline { font-size: 1rem; margin: 0 0 8px; }
body.brand .hero.compact .stat-tiles { margin-top: 6px; }
body.brand .hero.compact .tile { padding: 6px 12px; min-width: 104px; }
body.brand .hero.compact .tile .n { font-size: 1.15rem; }
body.brand .panel { padding: 12px 14px; margin: 12px 0; }
body.brand .about-text p { font-size: 0.9rem; line-height: 1.45; }

/* --- Landing intro: staggered INFINITY reveal ----------------------------- */
body.brand .intro { min-height: calc(100vh - 120px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
body.brand .intro-word { display: flex; gap: 0.08em; font-family: 'Crimson Pro', Georgia, serif; font-weight: 300; font-size: clamp(3rem, 11vw, 7.5rem); letter-spacing: 0.14em; color: #1e1c16; }
body.brand .intro-word span { opacity: 0; transform: translateY(0.25em); animation: ltr-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
body.brand .intro-word span:nth-child(1) { animation-delay: 0.15s; }
body.brand .intro-word span:nth-child(2) { animation-delay: 0.32s; }
body.brand .intro-word span:nth-child(3) { animation-delay: 0.49s; }
body.brand .intro-word span:nth-child(4) { animation-delay: 0.66s; }
body.brand .intro-word span:nth-child(5) { animation-delay: 0.83s; }
body.brand .intro-word span:nth-child(6) { animation-delay: 1.00s; }
body.brand .intro-word span:nth-child(7) { animation-delay: 1.17s; }
body.brand .intro-word span:nth-child(8) { animation-delay: 1.34s; color: var(--brand-accent); }
@keyframes ltr-in { to { opacity: 1; transform: none; } }
body.brand .intro-sub { opacity: 0; animation: ltr-in 1s 2.0s forwards; color: #4a4635; font-size: 1.05rem; line-height: 1.5; margin-top: 1rem; }
body.brand .scroll-cue { opacity: 0; animation: ltr-in 1s 2.6s forwards, bob 1.8s 3.6s ease-in-out infinite; text-decoration: none; font-size: 1.6rem; color: var(--brand-accent); margin-top: 2.2rem; }
@keyframes bob { 50% { transform: translateY(6px); } }

/* Scroll-reveal for content blocks */
body.brand .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
body.brand .reveal.revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  body.brand .intro-word span, body.brand .intro-sub, body.brand .scroll-cue { animation: none; opacity: 1; transform: none; }
  body.brand .reveal { opacity: 1; transform: none; transition: none; }
}

/* JSON download pinned top-right of each card */
body.brand .paper-card { padding-top: 14px; }
body.brand .paper-card .title { padding-right: 64px; }
body.brand .paper-card .dl { position: absolute; top: 8px; right: 8px; background: #fff; }
.baseline-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: #4a4635; margin-left: 10px; white-space: nowrap; }
.bl-cols { display: inline-flex; gap: 8px; margin-left: 10px; font-variant-numeric: tabular-nums; }
.bl { font-size: 0.78rem; font-weight: 600; padding-left: 12px; position: relative; }
.bl::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 7px; height: 7px; border-radius: 2px; }
.bl.claude::before { background: var(--cat-1, #4269d0); }
.bl.codex::before { background: var(--cat-2, #efb118); }
.bl-row { display: flex; gap: 14px; align-items: baseline; margin: 4px 0 6px; font-size: 0.8rem; font-variant-numeric: tabular-nums; position: relative; z-index: 2; }
.bl-row b { font-weight: 600; }
.bl-key { color: var(--muted, #888); font-size: 0.7rem; }
.cbars { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.cbar-row { display: flex; align-items: center; gap: 8px; }
.cbar-label { font-size: 0.72rem; color: var(--muted, #666); width: 44px; flex: none; }
.cbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; flex: 1; gap: 1px; background: transparent; }
.completion-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 2px; font-size: 0.8rem; color: #4a4635; }
.completion-legend .chip { display: inline-flex; align-items: center; gap: 5px; }
.completion-legend .chip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.completion-legend .note { color: var(--muted, #888); }

/* v9 overrides: white masthead, visible select, RESEARCHBENCH intro */
body.brand .masthead { background: #fff; margin: 0 -16px; padding: 10px 16px; border-bottom: 1px solid var(--brand-accent-line); }
body.brand .searchbar select { color: #1e1c16; padding: 7px 12px; font-size: 0.95rem; min-width: 220px; appearance: auto; background: #fff; }
body.brand .searchbar select option { color: #1e1c16; }
body.brand .intro-word { font-size: clamp(2.2rem, 8.5vw, 6rem); letter-spacing: 0.1em; }
body.brand .intro-word span { color: #1e1c16; }
body.brand .intro-word span:nth-child(1) { animation-delay: 0.10s; }
body.brand .intro-word span:nth-child(2) { animation-delay: 0.20s; }
body.brand .intro-word span:nth-child(3) { animation-delay: 0.30s; }
body.brand .intro-word span:nth-child(4) { animation-delay: 0.40s; }
body.brand .intro-word span:nth-child(5) { animation-delay: 0.50s; }
body.brand .intro-word span:nth-child(6) { animation-delay: 0.60s; }
body.brand .intro-word span:nth-child(7) { animation-delay: 0.70s; }
body.brand .intro-word span:nth-child(8) { animation-delay: 0.80s; }
body.brand .intro-word span:nth-child(9) { animation-delay: 0.90s; }
body.brand .intro-word span:nth-child(10) { animation-delay: 1.00s; }
body.brand .intro-word span:nth-child(11) { animation-delay: 1.10s; }
body.brand .intro-word span:nth-child(12) { animation-delay: 1.20s; }
body.brand .intro-word span:nth-child(13) { animation-delay: 1.30s; }
body.brand .intro-word span:nth-child(n+9) { color: var(--brand-accent); }
body.brand .intro-sub.byline { font-size: 1.25rem; color: var(--brand-accent); font-weight: 600; animation-delay: 1.7s; margin-top: 0.6rem; }
body.brand .intro-sub { animation-delay: 2.1s; }
/* v10: only BENCH gold (old INFINITY rule made child 8 gold too); logo byline */
body.brand .intro-word span:nth-child(8) { color: #1e1c16; }
body.brand .intro-sub.byline img { height: 40px; width: auto; display: inline-block; vertical-align: middle; }
.searchbar { display: flex; align-items: center; gap: 10px; }
.searchbar input { flex: 1; }
body.brand .zip-all { white-space: nowrap; font-size: 0.85rem; text-decoration: none; border: 1px solid var(--brand-accent-line); border-radius: 7px; padding: 6px 12px; color: #1e1c16; background: #fff; }
body.brand .zip-all:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
/* v12: full-bleed masthead */
body.brand .masthead { margin: 0; width: 100%; background: #fff; border-bottom: 1px solid var(--brand-accent-line); padding: 0; }
body.brand .masthead-inner { max-width: 1100px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 12px; }
body.brand .masthead-inner .navlinks { margin-left: auto; }
/* v14: masthead content spans the full bar — logo far left, nav far right */
body.brand .masthead { display: block; }
body.brand .masthead-inner { max-width: none; width: 100%; margin: 0; padding: 10px 20px; }
