:root {
  --ink: #0B2447;
  --ink-soft: #1f3563;
  --accent: #E94B3C;
  --accent-soft: #fde8e5;
  --el: #3B82F6;
  --ea: #10B981;
  --mds: #F59E0B;
  --bg: #ffffff;
  --bg-soft: #f7f8fb;
  --border: #e5e7eb;
  --muted: #6b7280;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
code, pre { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.nav-brand .logo {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--accent) 100%);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700;
}
.nav-brand .nav-logo {
  width: 32px; height: 32px; object-fit: contain;
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; opacity: 0.85; }
.nav-links a:hover { opacity: 1; color: var(--accent); }
.nav-gh {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--ink); color: #fff !important; opacity: 1 !important;
  font-size: 13px; font-weight: 600;
}
.nav-gh:hover { background: var(--accent); }
@media (max-width: 760px) {
  .nav-links a:not(.nav-gh) { display: none; }
}

/* ---------- Layout ---------- */
.section { padding: 80px 24px; }
.section-tight { padding-top: 24px; }   /* blends with previous white section */
.container { max-width: 1200px; margin: 0 auto; }
.section-soft { background: var(--bg-soft); }
.section-title {
  font-size: 32px; font-weight: 700; margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.section-kicker {
  text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; font-weight: 700;
  color: var(--accent); margin-bottom: 12px;
}
.section-sub { color: var(--muted); font-size: 16px; max-width: 720px; margin-bottom: 40px; }

/* ---------- Hero ---------- */
.hero { padding: 64px 24px 40px; text-align: center; }
.hero-icon {
  display: block; margin: 0 auto 16px;
  width: 96px; height: 96px; object-fit: contain;
}
.hero h1 {
  font-size: 52px; font-weight: 800; margin: 12px 0 16px;
  letter-spacing: -0.03em; line-height: 1.1;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .subtitle { font-size: 20px; color: var(--ink-soft); font-weight: 500; max-width: 800px; margin: 0 auto 28px; }
.badge-kdd {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em;
  border: 1px solid rgba(233, 75, 60, 0.2);
}
.authors { font-size: 16px; color: var(--ink); margin: 24px 0 6px; font-weight: 500; }
.affiliations { font-size: 14px; color: var(--muted); margin-bottom: 32px; }
.affiliations sup { color: var(--accent); font-weight: 700; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--ink);
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--accent); border-color: var(--accent); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- TL;DR stat cards ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  max-width: 900px; margin: 48px auto 0;
}
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 24px 16px; text-align: center;
}
.stat-card .num { font-size: 38px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.stat-card .label { font-size: 13px; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.08em; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Sources (KBs + vendors) ---------- */
.sources-block { margin-top: 36px; }
.sources-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px;
}
.kb-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 760px) { .kb-grid { grid-template-columns: repeat(2, 1fr); } }
.kb-card {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 8px; padding: 18px 14px 16px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border);
  text-align: center; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.kb-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(11, 36, 71, 0.18); border-color: var(--accent); }
/* Fixed inner box so all logos appear at consistent visual size */
.kb-logo-wrap {
  width: 100%; aspect-ratio: 3 / 1;
  display: flex; align-items: center; justify-content: center;
}
.kb-logo {
  max-height: 78%; max-width: 78%; object-fit: contain;
}
.kb-card .kb-sub { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.kb-card .kb-meta { font-size: 11px; color: var(--ink-soft); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

/* Featured vendor wall: bigger logo cards, 5-up */
.vendor-wall {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 14px;
}
@media (max-width: 900px) { .vendor-wall { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .vendor-wall { grid-template-columns: repeat(2, 1fr); } }
.vendor-card {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  aspect-ratio: 5 / 2;  /* every card the same shape */
}
.vendor-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(11, 36, 71, 0.18); border-color: var(--accent); }
.vendor-card img {
  max-height: 75%; max-width: 80%; object-fit: contain;
}
.vendor-more-note {
  font-size: 13px; color: var(--muted); margin-top: 14px; text-align: center;
}

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
@media (max-width: 900px) { .cat-grid { grid-template-columns: 1fr; } }
.cat-card {
  border: 1px solid var(--border); border-radius: 16px; padding: 24px;
  background: #fff; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(11, 36, 71, 0.18); }
.cat-pill {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 12px;
}
.cat-EL .cat-pill { background: #dbeafe; color: var(--el); }
.cat-EA .cat-pill { background: #d1fae5; color: var(--ea); }
.cat-MDS .cat-pill { background: #fef3c7; color: var(--mds); }
.cat-card h3 { font-size: 20px; margin: 0 0 8px; font-weight: 700; }
.cat-card .direction { font-size: 13px; color: var(--muted); margin-bottom: 12px; font-family: 'JetBrains Mono', monospace; }
.cat-card p { font-size: 14px; color: var(--ink-soft); margin: 0 0 16px; }
.cat-tasks { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-tasks .tag {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: var(--bg-soft); border: 1px solid var(--border);
  font-weight: 600; color: var(--ink-soft);
}

/* ---------- Leaderboard ---------- */
.lb-controls {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 20px;
}
.lb-group { display: flex; gap: 4px; background: var(--bg-soft); padding: 4px; border-radius: 10px; border: 1px solid var(--border); }
.lb-btn {
  padding: 7px 14px; border-radius: 7px;
  background: transparent; color: var(--ink-soft);
  border: none; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: inherit;
}
.lb-btn.active { background: var(--ink); color: #fff; }
.lb-btn:hover:not(.active) { color: var(--ink); }

.lb-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
table.lb {
  width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px;
}
table.lb th, table.lb td {
  padding: 12px 12px; text-align: center; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.lb th {
  background: var(--bg-soft); font-weight: 700; color: var(--ink-soft);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  position: sticky; top: 0;
}
table.lb th.sortable { cursor: pointer; user-select: none; }
table.lb th.sortable:hover { color: var(--accent); }
table.lb th .sort-ind { opacity: 0.4; margin-left: 4px; }
table.lb th.sorted .sort-ind { opacity: 1; color: var(--accent); }
table.lb td.model-name { text-align: left; font-weight: 600; padding-left: 18px; }
table.lb tr:last-child td { border-bottom: none; }
table.lb tr.top1 { background: linear-gradient(90deg, #fffbeb 0%, transparent 100%); }
table.lb tr.top1 td:first-child::before { content: '🥇 '; }
table.lb tr.top2 td:first-child::before { content: '🥈 '; }
table.lb tr.top3 td:first-child::before { content: '🥉 '; }
.org-tag {
  display: inline-block; font-size: 10px; padding: 2px 6px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 4px; font-weight: 600; color: var(--muted); margin-left: 8px;
}
.score-cell {
  position: relative;
  background-image: linear-gradient(to right, rgba(59,130,246,0.13) var(--w, 0%), transparent var(--w, 0%));
  font-variant-numeric: tabular-nums;
}
td.avg { font-weight: 700; color: var(--ink); }
td.score-cell.cat-best { color: var(--accent); font-weight: 700; }
.lb-note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* ---------- Findings ---------- */
.findings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 32px; }
@media (max-width: 900px) { .findings-grid { grid-template-columns: 1fr; } }
.finding {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; position: relative; overflow: hidden;
}
.finding::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent);
}
.finding h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.finding p { margin: 0; font-size: 14px; color: var(--ink-soft); }
.finding .big {
  font-size: inherit; font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- Pipeline / Methodology ---------- */
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
@media (max-width: 900px) { .method-grid { grid-template-columns: 1fr; } }
.method-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 24px;
}
.method-card .head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.method-card .chip {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  padding: 3px 8px; border-radius: 6px; font-weight: 700;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.method-card h3 { margin: 0; font-size: 17px; font-weight: 700; }
.method-card p { font-size: 13px; color: var(--ink-soft); margin: 8px 0 0; }
.method-card .flow {
  margin-top: 14px; font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--ink); background: var(--bg-soft); padding: 10px; border-radius: 8px;
  border: 1px solid var(--border);
}

/* ---------- Tasks grid ---------- */
.tasks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
@media (max-width: 1000px) { .tasks-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tasks-grid { grid-template-columns: 1fr; } }
.task-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px;
  border-top: 3px solid var(--border);
}
.task-card.EL { border-top-color: var(--el); }
.task-card.EA { border-top-color: var(--ea); }
.task-card.MDS { border-top-color: var(--mds); }
.task-card h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.task-card .task-id {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--muted); font-weight: 600;
}
.task-card .dir { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--ink-soft); margin: 6px 0 10px; }
.task-card p { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* ---------- Example tabs ---------- */
.example-tabs { display: flex; gap: 4px; margin: 24px 0 16px; background: var(--bg-soft); padding: 4px; border-radius: 10px; border: 1px solid var(--border); width: fit-content; }
.example-tab {
  padding: 8px 16px; border-radius: 7px;
  background: transparent; color: var(--ink-soft); border: none;
  cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit;
}
.example-tab.active { background: var(--ink); color: #fff; }
.example-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; display: none;
}
.example-card.active { display: block; }
.example-card .q, .example-card .a { margin-bottom: 16px; }
.example-card .label {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.example-card .q-text {
  background: var(--bg-soft); padding: 14px 16px; border-radius: 10px;
  border-left: 3px solid var(--el); font-size: 14px; color: var(--ink);
  white-space: pre-wrap; line-height: 1.65;
}
.example-card .a-text {
  background: #f0fdf4; padding: 14px 16px; border-radius: 10px;
  border-left: 3px solid var(--ea); font-size: 13px; font-family: 'JetBrains Mono', monospace;
  white-space: pre-wrap; line-height: 1.65; overflow-x: auto;
}
.example-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.example-cat {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--ink);
  letter-spacing: 0.01em;
}
.example-cat .example-dir {
  font-family: 'JetBrains Mono', monospace; font-weight: 500;
  color: var(--muted); font-size: 12px; margin-left: 4px;
}
.example-intro {
  margin: 8px 0 0; font-size: 13px; color: var(--ink-soft); line-height: 1.55;
}

/* ---------- Citation ---------- */
.cite-block {
  position: relative; background: var(--ink); color: #c7d2fe;
  padding: 24px 24px; border-radius: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  white-space: pre; overflow-x: auto; line-height: 1.6;
}
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  padding: 6px 12px; border-radius: 7px; cursor: pointer;
  background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  font-size: 12px; font-weight: 600; font-family: 'Inter', sans-serif;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); }

/* ---------- Footer ---------- */
.footer { padding: 48px 24px 64px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer p { margin: 4px 0; font-size: 13px; color: var(--muted); }
.footer a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.footer a:hover { color: var(--accent); }

/* ---------- Figures ---------- */
.figure {
  margin: 8px 0 36px; padding: 18px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
}
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption {
  margin-top: 12px; font-size: 13px; color: var(--muted);
  text-align: center; line-height: 1.6;
}
.data-table-wrap {
  max-width: 760px; margin: 0 auto;
}

/* Dataset 2-col layout: figure+table on left, description on right */
.row-data {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 36px;
  align-items: start; margin-top: 32px;
}
@media (max-width: 900px) { .row-data { grid-template-columns: 1fr; } }
.row-data-left .figure { margin: 0 0 18px; padding: 14px; }
.row-data-right .lead { font-size: 16px; margin: 0 0 16px; }
.pipeline-steps {
  list-style: none; counter-reset: step;
  padding: 0; margin: 0;
}
.pipeline-steps li {
  counter-increment: step;
  position: relative; padding-left: 44px; margin-bottom: 18px;
  font-size: 14px; color: var(--ink-soft); line-height: 1.65;
}
.pipeline-steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}
.pipeline-steps strong { color: var(--ink); }

/* ---------- Util ---------- */
.row-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: start; }
@media (max-width: 900px) { .row-2 { grid-template-columns: 1fr; } }
.lead { font-size: 17px; color: var(--ink-soft); }
.lead strong { color: var(--ink); }
.divider { height: 1px; background: var(--border); border: none; margin: 24px 0; }
