:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #94a3b8;
  --blue: #2563eb;
  --blue-2: #3b82f6;
  --red: #dc2626;
  --green: #16a34a;
  --purple: #7c3aed;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --accent: var(--blue);
  --accent-2: var(--blue-2);
  --teal: var(--red);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------------- Header / Nav ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-group {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
}
.brand-name { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }

.nav-links { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 8px;
}
.nav-links a:hover { color: var(--blue); background: var(--panel-2); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; cursor: pointer; flex-direction: column; gap: 4px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text); display: block; border-radius: 2px; }

/* ---------------- Hero ---------------- */
.hero {
  padding: 72px 0 64px;
  background:
    radial-gradient(900px 400px at 15% -10%, rgba(220, 38, 38, 0.06), transparent 60%),
    radial-gradient(800px 400px at 90% 0%, rgba(37, 99, 235, 0.06), transparent 55%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red);
  margin: 0 0 14px;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  font-weight: 800;
  color: var(--text);
}

.lede { color: var(--text-dim); font-size: 1.05rem; margin: 0 0 26px; max-width: 60ch; }
.lede strong { color: var(--text); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-cite {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin: 22px 0 0;
  max-width: 64ch;
  line-height: 1.5;
}
.hero-cite em { font-style: italic; }

.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--blue); color: #ffffff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--text-faint); }
.btn-block { width: 100%; }

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-num {
  display: block;
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--blue);
  font-family: var(--mono);
  letter-spacing: -0.03em;
}
.stat-label { color: var(--text-dim); font-size: 0.85rem; font-weight: 500; }

/* ---------------- Sections ---------------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 800;
  color: var(--text);
}
.section-sub { color: var(--text-dim); margin: 0; }

/* ---------------- Toolbar / filters ---------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}
.segmented {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.seg {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.seg:hover { color: var(--blue); }
.seg.active { background: var(--blue); color: #ffffff; }

/* ---------------- Leaderboard table ---------------- */
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.leaderboard { width: 100%; border-collapse: collapse; }
.leaderboard th, .leaderboard td { padding: 14px 16px; text-align: left; }
.leaderboard thead th {
  background: var(--panel-2);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.col-rank { width: 64px; }
.col-model { min-width: 220px; }
.col-overall { width: 190px; }
.col-modality { width: 86px; }
.col-actions { width: 46px; }

.leaderboard tbody tr { border-bottom: 1px solid var(--border); }
.leaderboard tbody tr:last-child { border-bottom: none; }
.leaderboard tbody tr:hover { background: rgba(37, 99, 235, 0.04); }

.rank {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-faint);
  font-size: 0.95rem;
}
.rank.top1 { color: #b45309; }
.rank.top2 { color: #64748b; }
.rank.top3 { color: #a16207; }

.model-cell { display: flex; flex-direction: column; gap: 4px; }
.model-name { font-weight: 700; color: var(--text); }
.model-sub { font-size: 0.76rem; color: var(--text-faint); font-family: var(--mono); }

.badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  margin-left: 8px;
  vertical-align: 1px;
}
.badge-proprietary { color: var(--blue); border-color: rgba(37, 99, 235, 0.3); background: rgba(37, 99, 235, 0.06); }
.badge-open { color: var(--red); border-color: rgba(220, 38, 38, 0.3); background: rgba(220, 38, 38, 0.06); }
.badge-general { color: #334155; border-color: rgba(51, 65, 85, 0.3); background: rgba(51, 65, 85, 0.05); }
.badge-medical { color: var(--purple); border-color: rgba(124, 58, 237, 0.3); background: rgba(124, 58, 237, 0.06); }

.bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; min-width: 90px; }
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-fill.modality { background: linear-gradient(90deg, var(--blue), var(--blue-2)); }

.acc-num { font-family: var(--mono); font-weight: 700; font-size: 0.85rem; }
.acc-overall { font-size: 1.05rem; }

.correct-note { font-size: 0.74rem; color: var(--text-faint); font-family: var(--mono); }

.detail-row td { background: var(--panel-2); padding: 20px 24px; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 28px;
  max-width: 860px;
}
.detail-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 12px;
}
.mini-bars { display: grid; gap: 8px; }
.mini-bar-row { display: grid; grid-template-columns: 76px 1fr 44px; align-items: center; gap: 10px; }
.mini-bar-label { font-size: 0.8rem; color: var(--text-dim); }
.mini-bar-val { font-family: var(--mono); font-size: 0.8rem; text-align: right; }

.expand-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.expand-btn:hover { color: var(--blue); border-color: var(--text-faint); }
.expand-btn.open { transform: rotate(45deg); }

.disclaimer { color: var(--text-faint); font-size: 0.8rem; text-align: center; margin: 18px 0 0; }

/* ---------------- Highlights ---------------- */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.highlight-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.highlight-card h3 {
  margin: 0 0 14px;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.highlight-card h3 .medal { font-size: 1rem; }
.highlight-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.highlight-rank { font-family: var(--mono); font-weight: 700; color: var(--text-faint); width: 22px; flex: none; }
.highlight-model { flex: 1; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.highlight-val { font-family: var(--mono); font-weight: 700; font-size: 0.9rem; color: var(--blue); }

/* ---------------- Dataset charts ---------------- */
.dataset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 8px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 16px; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--text); }
.panel-wide { grid-column: 1 / -1; }

.chart-donut-wrap { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; flex: none; transform: rotate(-90deg); }
.donut .segment { stroke-width: 30; fill: none; stroke-linecap: butt; }

.chart-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chart-legend li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-dim); }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend-val { margin-left: auto; font-family: var(--mono); color: var(--text); font-weight: 700; }

.bar-list { display: grid; gap: 16px; }
.bar-list .bar-row-label { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; }
.bar-list .bar-row-label span:last-child { font-family: var(--mono); color: var(--text); font-weight: 700; }
.bar-row { height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar-row-fill { height: 100%; border-radius: 999px; transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1); }

.figure-img {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
figure { margin: 0; }
figcaption { color: var(--text-faint); font-size: 0.82rem; margin-top: 12px; line-height: 1.5; }

/* ---------------- Pipeline ---------------- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.pipeline-step {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.step-num {
  position: absolute;
  top: -14px; left: 18px;
  background: var(--blue);
  color: #ffffff;
  font-family: var(--mono);
  font-weight: 700;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  box-shadow: var(--shadow);
}
.pipeline-step h3 { margin: 6px 0 10px; font-size: 1rem; color: var(--text); }
.pipeline-step p { margin: 0; color: var(--text-dim); font-size: 0.9rem; }
.mono { font-family: var(--mono); font-size: 0.78rem !important; color: var(--blue) !important; }

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 26px; color: var(--text-dim); font-size: 0.94rem; }
.check-list li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--red);
  font-weight: 700;
}

/* ---------------- Submit ---------------- */
.form { display: grid; gap: 16px; }
.form iframe {
  width: 100%;
  min-height: 1200px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: grid; gap: 6px; }
.form label { font-size: 0.84rem; font-weight: 600; color: var(--text-dim); }
.form input,
.form select,
.form textarea {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.94rem;
  font-family: inherit;
  width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form select { appearance: none; }
.form textarea { resize: vertical; }
.form-note { min-height: 22px; margin: 0; font-size: 0.88rem; text-align: center; font-weight: 600; }
.form-note.ok { color: var(--green); }
.form-note.err { color: var(--red); }

.mt-2 { margin-top: 20px; }
.small { font-size: 0.85rem; color: var(--text-dim); }

/* ---------------- Footer ---------------- */
.site-footer {
  background: #0f172a;
  border-top: 1px solid var(--border);
  padding-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr;
  gap: 40px;
  padding-bottom: 36px;
}
.footer-brand { display: flex; gap: 20px; align-items: center; }
.footer-brand .brand-logo { width: 200px; height: 200px; border-radius: 20px; object-fit: contain; }
.footer-title { margin: 0 0 4px; font-weight: 700; color: #e6edf7; }
.footer-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.footer-col h4 {
  margin: 0 0 10px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col li a { font-size: 0.9rem; color: #cbd5e1; }
.footer-col li a:hover { color: #ffffff; }
.site-footer .small { color: #94a3b8; }
.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 20px 24px;
  text-align: center;
  display: grid;
  gap: 4px;
}
.footer-bottom p { margin: 0; }

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .dataset-grid, .method-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px 20px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .leaderboard { min-width: 680px; }
  .table-wrap { overflow-x: auto; }
  .pipeline { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0; }
  .section { padding: 52px 0; }
}
