/* ==========================================================================
   CoBe — Counterfactual Benchmark
   Design system + section styles
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #faf7f3;
  --bg-softer: #fcfaf7;
  --ink: #1c1410;
  --ink-soft: #4a3f37;
  --muted: #7a6a5c;
  --line: #ebe4dc;
  --line-strong: #ddd2c5;

  /* Basketball orange palette */
  --primary: #ea580c;
  --primary-600: #c2410c;
  --primary-700: #9a3412;
  --primary-50: #fff7ed;
  --primary-100: #ffedd5;

  --accent: #f59e0b;
  --accent-teal: #0d9488;
  --violet: #f97316;

  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #d97706;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(28, 20, 16, 0.06), 0 1px 3px rgba(28, 20, 16, 0.05);
  --shadow: 0 4px 20px rgba(28, 20, 16, 0.08);
  --shadow-lg: 0 18px 50px rgba(154, 52, 18, 0.14);

  --maxw: 1100px;
  --font-sans: 'Inter', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* guard against any accidental horizontal scroll; doesn't break sticky nav */
}

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

h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -0.02em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.container.is-narrow { max-width: 820px; }
.container.is-wide { max-width: 1240px; }

.section { padding: 5rem 0; }
.section.is-soft { background: var(--bg-soft); }
.section.is-compact { padding: 3.5rem 0; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.85rem;
}

.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 800;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.section-lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 720px;
  margin: 0 0 2.5rem;
}
.section-head-center { text-align: center; }
.section-head-center .section-lead { margin-left: auto; margin-right: auto; }

/* ============================ Top navigation ============================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-logo {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  font-size: 1.65rem;
  line-height: 1;
}
.navbar-links { display: flex; align-items: center; gap: 0.35rem; }
.navbar-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
}
.navbar-links a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.navbar-links a.is-current { color: var(--primary-600); background: var(--primary-50); }
.navbar-cta {
  background: var(--ink) !important;
  color: #fff !important;
  font-weight: 600 !important;
}
.navbar-cta:hover { background: var(--primary-700) !important; }
.navbar-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  width: 40px; height: 38px;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.1rem;
}

@media (max-width: 860px) {
  .navbar-toggle { display: inline-grid; place-items: center; }
  .navbar-links {
    position: absolute;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .navbar-links.is-open { display: flex; }
  .navbar-links a { padding: 0.7rem 0.85rem; }
}

/* ================================ Hero ================================== */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(249, 115, 22, 0.18), transparent 60%),
    radial-gradient(900px 480px at 10% 0%, rgba(234, 88, 12, 0.14), transparent 58%),
    linear-gradient(180deg, #fffaf5 0%, #ffffff 75%);
  border-bottom: 1px solid var(--line);
  padding: 4.5rem 0 3.5rem;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(234, 88, 12, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 88, 12, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(900px 500px at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(900px 500px at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.1rem);
  font-weight: 800;
  margin: 0 0 0.4rem;
  letter-spacing: -0.035em;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--primary) 10%, var(--violet) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 760px;
  margin: 0.4rem auto 1.6rem;
}
.hero-subtitle b { color: var(--ink); font-weight: 700; }

.hero-authors {
  font-size: clamp(0.88rem, 1.2vw, 0.96rem);
  color: var(--ink-soft);
  max-width: 46rem;
  margin: 0 auto 0.45rem;
  line-height: 1.55;
}
.hero-affil {
  font-size: clamp(0.78rem, 1.02vw, 0.85rem);
  color: var(--muted);
  margin-bottom: 1.7rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}
.hero-affil a {
  color: var(--primary-600);
  font-weight: 600;
}
.hero-affil a:hover {
  text-decoration: underline;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); box-shadow: 0 8px 24px rgba(234, 88, 12, 0.32); }
.btn-light {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-light:hover { border-color: var(--primary); color: var(--primary-600); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn .icon { font-size: 1rem; line-height: 0; }
.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.85rem; }

/* ============================ Stat strip =============================== */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-top: 3rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--primary), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
}
@media (max-width: 860px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  .hero { padding: 3rem 0 2.5rem; }
  .hero h1 { font-size: 1.85rem; overflow-wrap: break-word; }
  .section-title { overflow-wrap: break-word; }
  .section { padding: 3.25rem 0; }
}

/* ============================== News ================================== */

.news-section { padding-top: 1.75rem; padding-bottom: 0; }
.news-dropdown {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1.2rem 0.95rem;
  box-shadow: var(--shadow-sm);
}
.news-dropdown summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.news-dropdown summary::-webkit-details-marker { display: none; }
.news-dropdown summary::marker { content: ""; }
.news-dropdown summary .eyebrow { margin-bottom: 0; }
.news-dropdown-title {
  flex: 1;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}
.news-dropdown summary::after {
  content: "";
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: auto;
  margin-top: 0.15rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transform-origin: 50% 50%;
  transition: transform 0.15s ease;
}
.news-dropdown[open] summary::after {
  margin-top: 0.45rem;
  transform: rotate(225deg);
}
.news-dropdown-lead {
  margin: 0.85rem 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary-100), var(--line));
}
.timeline-item {
  position: relative;
  padding: 0 0 1.6rem 2.1rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: 0; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
}
.timeline-item.is-muted .timeline-dot { border-color: var(--line-strong); }
.timeline-date {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--primary);
}
.timeline-item.is-muted .timeline-date { color: var(--muted); }
.timeline-text { margin: 0.15rem 0 0; color: var(--ink-soft); }
.timeline-text b { color: var(--ink); }
.tag-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: 1px;
}
.tag-new { background: var(--green-bg); color: #166534; }
.tag-soon { background: #fef3c7; color: #92400e; }

/* ============================ Finding cards ============================ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--primary-100); }
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1.12rem; margin: 0 0 0.5rem; font-weight: 700; }
.feature-card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.feature-card .stat-inline {
  font-weight: 800;
  color: var(--primary-600);
}

/* ============================ Teaser / ladder ========================== */

.ladder-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}
@media (max-width: 760px) { .ladder-compare { grid-template-columns: 1fr; } }
.ladder-card {
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: #fff;
  position: relative;
  overflow: hidden;
}
.ladder-card.is-cf { border-color: rgba(13,148,136,0.35); background: linear-gradient(180deg, #f0fdfa, #ffffff 70%); }
.ladder-card.is-assoc { border-color: rgba(220,38,38,0.25); background: linear-gradient(180deg, #fef2f2, #ffffff 70%); }
.ladder-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}
.ladder-card.is-cf .ladder-badge { background: var(--green-bg); color: #115e59; }
.ladder-card.is-assoc .ladder-badge { background: var(--red-bg); color: #991b1b; }
.ladder-card h3 { font-size: 1.2rem; margin: 0 0 0.5rem; }
.ladder-card p { margin: 0 0 0.75rem; color: var(--ink-soft); font-size: 0.95rem; }
.ladder-q {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink);
  border-left: 3px solid currentColor;
  padding-left: 0.85rem;
  margin: 0.9rem 0;
}
.ladder-card.is-cf .ladder-q { border-color: var(--accent-teal); }
.ladder-card.is-assoc .ladder-q { border-color: var(--red); }
.ladder-formula {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.85rem;
  background: rgba(22,22,41,0.04);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  color: var(--ink-soft);
  display: inline-block;
}

/* ============================ Abstract ================================= */

.abstract-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  box-shadow: var(--shadow-sm);
}
.abstract-card p {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
.abstract-card p:last-child { margin-bottom: 0; }
.abstract-card b { color: var(--ink); }

/* ============================ Try It Yourself ========================== */

.tryit-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tryit-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-softer);
}
.tryit-toolbar label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.5rem 2.1rem 0.5rem 1rem;
  cursor: pointer;
}
.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 0.9rem; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 0.75rem;
}
.tryit-counter { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.tryit-spacer { flex: 1; }
.tryit-nav-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
}
.tryit-nav-btn:hover { background: var(--bg-soft); border-color: var(--primary); color: var(--primary); }

.tryit-body { padding: 1.4rem; }

.demo-box {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  line-height: 1.55;
}
.demo-box .demo-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.demo-box--scenario { background: #eff5ff; border: 1px solid #dbe6fe; }
.demo-box--scenario .demo-label { color: #1e40af; }
.demo-box--query { background: #f5f0ff; border: 1px solid #e6dcff; }
.demo-box--query .demo-label { color: #5b21b6; }

.tryit-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.4rem 0 1.1rem;
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.85rem; font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  border: 1px solid var(--primary);
  background: var(--primary-50);
  color: var(--primary-700);
  cursor: pointer;
}
.copy-btn:hover { background: var(--primary-100); }
.copy-btn.is-done { background: var(--green-bg); border-color: #86efac; color: #166534; }

.tryit-paste {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  background: #fff;
}
.tryit-paste:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.tryit-paste-hint { font-size: 0.8rem; color: var(--muted); margin: 0.4rem 0 1rem; }

.reveal-btn {
  width: 100%;
  justify-content: center;
}
.tryit-answer { margin-top: 1.2rem; }
.tryit-answer[hidden] { display: none; }

.demo-box--gold { background: #ecfdf5; border: 1px solid #c7f0dc; }
.demo-box--gold .demo-label { color: #065f46; }
.demo-box--criteria { background: #fffbeb; border: 1px solid #fdeec2; }
.demo-box--criteria .demo-label { color: #92400e; }
.criteria-block { margin-bottom: 0.6rem; }
.criteria-block:last-child { margin-bottom: 0; }
.criteria-block .ctitle { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.2rem; }
.criteria-block .ctitle.keep { color: #b45309; }
.criteria-block .ctitle.change { color: #047857; }
.criteria-block ul { margin: 0; padding-left: 1.2rem; }
.criteria-block li { margin-bottom: 0.2rem; }

.model-verdicts {
  margin-top: 1.1rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}
.model-verdicts .mv-title {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.7rem;
}
.mv-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mv-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
}
.mv-chip .mv-mark { font-weight: 800; }
.mv-chip.is-correct { border-color: #86efac; background: var(--green-bg); color: #166534; }
.mv-chip.is-correct .mv-mark { color: var(--green); }
.mv-chip.is-wrong { border-color: #fca5a5; background: var(--red-bg); color: #991b1b; }
.mv-chip.is-wrong .mv-mark { color: var(--red); }
.mv-chip.is-unknown { color: var(--muted); }

/* ============================ Leaderboard ============================== */

.leaderboard-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.lb-controls {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-softer);
}
.lb-filter {
  font-size: 0.84rem; font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-soft);
  cursor: pointer;
}
.lb-filter.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.leaderboard {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.leaderboard thead th {
  text-align: left;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.leaderboard thead th.sortable:hover { color: var(--ink); }
.leaderboard thead th .sort-ind { opacity: 0.4; font-size: 0.7rem; }
.leaderboard thead th.is-sorted .sort-ind { opacity: 1; color: var(--primary); }
.leaderboard tbody td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.leaderboard tbody tr:last-child td { border-bottom: none; }
.leaderboard tbody tr:hover { background: var(--bg-softer); }
.lb-rank {
  font-weight: 800; color: var(--muted);
  width: 2.2rem; text-align: center;
}
.lb-rank.top1 { color: #b8860b; }
.lb-model { font-weight: 700; color: var(--ink); }
.lb-org { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.lb-type {
  display: inline-block;
  font-size: 0.7rem; font-weight: 700;
  padding: 0.12rem 0.55rem; border-radius: 999px;
}
.lb-type.proprietary { background: var(--primary-50); color: var(--primary-700); }
.lb-type.open { background: #ecfdf5; color: #047857; }
.lb-acc-cell { min-width: 180px; }
.lb-acc-bar {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-soft);
  overflow: hidden;
}
.lb-acc-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--violet));
}
.lb-acc-val {
  position: relative;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
  margin-left: 0.6rem;
}
.lb-note { font-size: 0.82rem; color: var(--muted); padding: 0.85rem 1rem; }
.lb-chance {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; color: var(--muted);
  padding: 0.75rem 1rem; border-top: 1px dashed var(--line-strong);
}
@media (max-width: 720px) {
  .leaderboard .hide-sm { display: none; }
}

/* ===================== Results chart wrapper (section) ================== */
.results-explain {
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.9rem;
}

/* ============================ Graph gallery =========================== */

.graph-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 760px) {
  .graph-gallery { grid-template-columns: 1fr; }
}
.graph-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.graph-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.graph-card .graph-svg { height: 88px; display: grid; place-items: center; margin-bottom: 0.5rem; }
.graph-card .graph-svg svg { max-height: 88px; width: auto; }
.graph-card h4 { margin: 0 0 0.2rem; font-size: 1rem; }
.graph-card .graph-pct {
  font-weight: 800;
  color: var(--primary-600);
  font-size: 0.92rem;
}

/* ============================ Failure modes =========================== */

.error-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}
.error-tab {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.88rem; font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-soft);
  cursor: pointer;
}
.error-tab:hover { border-color: var(--primary); color: var(--primary); }
.error-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.error-tab .etab-num {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 0.72rem; font-weight: 800;
  background: rgba(0,0,0,0.07);
}
.error-tab.is-active .etab-num { background: rgba(255,255,255,0.25); }

.error-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.error-card-head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-softer);
}
.error-card-head h3 { margin: 0 0 0.3rem; font-size: 1.2rem; }
.error-card-head p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.error-card-body { padding: 1.4rem; display: grid; gap: 0.85rem; }
.demo-box--reason { background: #f3f1fb; border: 1px solid #e4def5; }
.demo-box--reason .demo-label { color: #5b21b6; }
.demo-box--output-static {
  position: relative;
}
.demo-box--output-static .demo-label { color: #9a3412; }
.demo-box--output-static.is-wrong { background: #fef2f2; border: 1px solid #fbcaca; }
.demo-box--output-static.is-wrong .demo-label { color: #991b1b; }
.demo-model-name {
  font-weight: 700; font-size: 0.82rem; margin-left: auto;
  color: var(--muted);
}

/* ============================ Social buzz ============================= */

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2.5rem;
}
.social-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.social-head { display: flex; align-items: center; gap: 0.7rem; }
.social-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--violet));
  flex-shrink: 0;
}
.social-name { font-weight: 700; font-size: 0.95rem; line-height: 1.2; }
.social-handle { font-size: 0.82rem; color: var(--muted); }
.social-text { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.social-text .hl { color: var(--primary-600); font-weight: 600; }
.social-platform { margin-left: auto; color: var(--muted); font-size: 1.1rem; }

.social-placeholder {
  border: 1.5px dashed var(--line-strong);
  background: var(--bg-softer);
  color: var(--muted);
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 150px;
}
.social-placeholder .ph-icon { font-size: 1.6rem; color: var(--line-strong); }

.share-cta {
  background: linear-gradient(135deg, var(--primary), var(--violet));
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  text-align: center;
  color: #fff;
}
.share-cta h3 { margin: 0 0 0.5rem; font-size: 1.5rem; color: #fff; }
.share-cta p { margin: 0 0 1.4rem; color: rgba(255,255,255,0.85); }
.share-row { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.share-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-weight: 600; font-size: 0.92rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
}
.share-btn:hover { background: rgba(255,255,255,0.26); text-decoration: none; }

/* ============================ Citation =============================== */

.cite-wrap { position: relative; }
.cite-block {
  background: #161629;
  color: #d6d8e3;
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.86rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
.cite-copy {
  position: absolute;
  top: 0.9rem; right: 0.9rem;
}

/* ============================== Footer =============================== */

.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
  text-align: center;
}
.footer-links {
  display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center;
  margin-bottom: 1rem;
}
.footer-links:not(:has(a:not([hidden]))) { display: none; }
.footer-links a { color: var(--ink-soft); font-weight: 500; }
.site-footer p { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0; }

/* ============================ Reveal anim ============================ */
.reveal-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-up.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal-up { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ======================= Utilities & later additions ================== */

/* Elements toggled with the `hidden` attribute must stay hidden even when a class sets `display`. */
[hidden] { display: none !important; }

.sub-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--ink);
}

/* ---- Task: three steps + healthcare use case ---- */
.task-steps {
  margin-top: 2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
}
.task-steps h3 { font-size: 1.05rem; margin: 0 0 1rem; }
.task-steps ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.task-steps li { display: flex; gap: 0.75rem; align-items: flex-start; color: var(--ink-soft); font-size: 0.95rem; }
.step-num {
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-50); color: var(--primary);
  font-weight: 800; font-size: 0.85rem;
}
.task-note {
  margin: 1.1rem 0 0; padding-top: 1rem;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted); font-size: 0.9rem;
}
.task-note i { color: var(--primary); margin-right: 0.35rem; }
@media (max-width: 760px) { .task-steps ol { grid-template-columns: 1fr; } }

.usecase {
  margin-top: 2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.usecase-head { padding: 1.4rem 1.6rem 0.4rem; }
.usecase-head .eyebrow { margin-bottom: 0.4rem; }
.usecase-head h3 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.usecase-head p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.usecase-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem;
  padding: 1.2rem 1.6rem 1.6rem;
}
.usecase-flag {
  margin-top: 0.6rem;
  font-size: 0.8rem; font-weight: 700;
  color: #991b1b;
}
.usecase-flag.is-ok { color: #065f46; }
@media (max-width: 760px) { .usecase-grid { grid-template-columns: 1fr; } }

/* ---- Benchmark section ---- */
.pipeline {
  list-style: none; margin: 0 0 2rem; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  counter-reset: stage;
}
.pipeline-step {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.25rem;
  box-shadow: var(--shadow-sm);
  counter-increment: stage;
}
.pipeline-step::before {
  content: "Stage " counter(stage);
  display: block;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.4rem;
}
.pipeline-num {
  font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  background: linear-gradient(120deg, var(--primary), var(--violet));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pipeline-label { font-weight: 700; font-size: 0.9rem; color: var(--ink); margin-bottom: 0.45rem; }
.pipeline-step p { margin: 0; font-size: 0.86rem; color: var(--ink-soft); }
@media (max-width: 860px) { .pipeline { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pipeline { grid-template-columns: 1fr; } }

.bench-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
  margin-bottom: 1rem;
}
.bench-split {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 960px) { .bench-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .bench-grid, .bench-split { grid-template-columns: 1fr; } }
.bench-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.bench-card h4 { margin: 0 0 0.85rem; font-size: 0.98rem; }
.bench-card h4 i { color: var(--primary); margin-right: 0.35rem; }
.bench-note { margin: 0.75rem 0 0; font-size: 0.84rem; color: var(--muted); }

.kv-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.kv-table td { padding: 0.38rem 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.kv-table tr:last-child td { border-bottom: none; }
.kv-table td:last-child { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.dist-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.dist-bars li {
  display: grid; grid-template-columns: minmax(0, 9.5rem) 1fr 3rem;
  align-items: center; gap: 0.6rem; font-size: 0.85rem;
}
.dist-label { color: var(--ink-soft); }
.dist-bar { height: 10px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.dist-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--violet));
  /* --w is the share in %; shares top out near 30%, so the track spans 0–33% to keep bars readable */
  width: calc(var(--w) * 3%);
}
.dist-val { text-align: right; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 0.85rem; }
.audit-grid > div {
  background: var(--bg-softer);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}
.audit-num { display: block; font-size: 1.35rem; font-weight: 800; color: var(--primary-600); line-height: 1.2; }
.audit-label { display: block; font-size: 0.76rem; color: var(--muted); font-weight: 600; }

.phrasing-list, .check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.phrasing-list li, .check-list li {
  display: flex; gap: 0.65rem; align-items: flex-start;
  font-size: 0.9rem; color: var(--ink-soft);
}
.phrasing-list li { font-family: var(--font-serif); font-style: italic; }
.ph-key, .check-key {
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 0.35rem; border-radius: 8px;
  font-family: var(--font-sans); font-style: normal;
  font-weight: 800; font-size: 0.78rem;
  background: var(--primary-50); color: var(--primary-700);
}

.agreement {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1.25rem;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-50), #fff1e0);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.agreement-num { display: block; font-size: 1.9rem; font-weight: 800; color: var(--primary-700); letter-spacing: -0.02em; }
.agreement-label { display: block; font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; }
.agreement-detail p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
@media (max-width: 760px) { .agreement { grid-template-columns: 1fr; } }

.sample-json {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-sm);
}
.sample-json summary { cursor: pointer; font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.sample-json summary i { color: var(--primary); margin-right: 0.35rem; }
.sample-json pre {
  margin: 0.9rem 0 0;
  background: #161629; color: #d6d8e3;
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8rem; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.sample-json code { font-size: 0.85em; }

.compare-scroll { overflow-x: auto; }
.compare-table, .ablation-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9rem;
}
.compare-table th, .ablation-table th {
  text-align: center;
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.8rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-softer);
}
.compare-table th:first-child, .ablation-table th:first-child { text-align: left; }
.compare-table td, .ablation-table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.compare-table tr:last-child td, .ablation-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { text-align: left; font-weight: 600; color: var(--ink); white-space: nowrap; }
.compare-table td.y { color: var(--green); font-weight: 800; }
.compare-table td.n { color: var(--red); font-weight: 800; }
.compare-table tr.is-ours td { background: var(--primary-50); }
.compare-table tr.is-ours td:first-child { color: var(--primary-700); }

/* ---- Prompt ablations ---- */
.ablation-table td:first-child { text-align: left; min-width: 13rem; }
.ablation-table th { white-space: nowrap; }
.tier-desc { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 500; margin-top: 0.15rem; }
.ablation-table tr.is-control td { background: var(--bg-softer); }
.abl-val { display: block; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.abl-bar { display: block; height: 6px; margin-top: 0.3rem; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.abl-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--violet)); }
.ablation-notes { margin: 1.25rem 0 0; padding-left: 1.2rem; color: var(--ink-soft); font-size: 0.93rem; }
.ablation-notes li { margin-bottom: 0.4rem; }

/* ---- Leaderboard ± ---- */
.lb-acc-std {
  font-size: 0.76rem; font-weight: 600; color: var(--muted);
  margin-left: 0.3rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ---- Failure-mode explorer additions ---- */
.error-tab .etab-num { width: auto; min-width: 20px; padding: 0 0.3rem; border-radius: 999px; }
.error-tab.is-success:not(.is-active) { border-color: #86efac; color: #166534; }
.check-pill {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.75rem; font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--red-bg); color: #991b1b;
}
.check-pill.is-pass { background: var(--green-bg); color: #166534; }
.demo-box--output-static.is-right { background: #ecfdf5; border: 1px solid #c7f0dc; }
.demo-box--output-static.is-right .demo-label { color: #065f46; }
.output-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; }
