/* ============================================================
   Pixel-Searcher – Unified Design System
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --ink: #0f172a;
  --text: #1e293b;
  --muted: #526176;
  --quiet: #94a3b8;
  --paper: #ffffff;
  --wash: #f8fafc;
  --wash-alt: #f1f5f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --blue: #2563eb;
  --purple: #7c3aed;
  --pink: #c026d3;
  --green: #16a34a;
  --orange: #f97316;
  --teal: #0d9488;
  --red: #ef4444;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06);
  --shadow: 0 8px 30px rgba(15,23,42,.07);
  --shadow-lg: 0 18px 44px rgba(15,23,42,.1);
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1200px;
  --gradient: linear-gradient(135deg, var(--blue), var(--purple) 50%, var(--pink));
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------- Skip Link ---------- */
.skip-link {
  position: absolute; top: -48px; left: 18px; z-index: 30;
  padding: 10px 14px; color: #fff; background: var(--ink);
  border-radius: 999px; font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* ---------- Top Navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid rgba(226,232,240,.85);
}
.nav {
  width: min(var(--max), calc(100% - 48px));
  min-height: 64px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 800; color: var(--ink); white-space: nowrap;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--gradient); border-radius: 8px;
  color: #fff; font-size: 15px; font-weight: 900;
}
.navlinks {
  display: flex; align-items: center; gap: 4px;
  color: #475569; font-size: 14px; font-weight: 600;
}
.navlinks a {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  transition: color .15s, background .15s;
}
.navlinks a:hover, .navlinks a:focus-visible {
  color: var(--blue); background: #eef4ff; outline: none;
}

/* ---------- Hero ---------- */
.hero { padding: 32px 0 20px; text-align: center; }
.wrap { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }

h1.hero-title {
  margin: 0; font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08; font-weight: 900; letter-spacing: -.02em;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .subtitle {
  max-width: 720px; margin: 10px auto 0;
  color: #334155; font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(16px, 2.2vw, 22px); font-style: italic; line-height: 1.35;
}
.hero .tagline {
  margin: 8px 0 0; color: var(--quiet);
  font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}

/* ---------- Hero Action Buttons ---------- */
.hero-actions {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px;
}
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink); background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-sm);
  font-size: 14px; font-weight: 700;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.pill:hover, .pill:focus-visible {
  transform: translateY(-2px); border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(37,99,235,.14); outline: none;
}
.pill .icon {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; border-radius: 999px;
  color: #fff; background: var(--gradient);
  font-size: 11px; font-weight: 900;
}

/* ---------- Sections ---------- */
section { padding: 28px 0; }
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 6px; padding: 5px 14px;
  border-radius: 999px; background: #eef4ff;
  color: var(--blue); font-size: 12px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
}
.section-title {
  margin: 0 0 4px; text-align: center;
  font-size: clamp(22px, 3vw, 28px); font-weight: 800;
  color: var(--ink); letter-spacing: -.01em;
}
.section-desc {
  max-width: 680px; margin: 0 auto 18px; text-align: center;
  color: var(--muted); font-size: 14px;
}

/* ---------- Card Base ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- Abstract ---------- */
.abstract-text {
  max-width: 860px; margin: 0 auto;
  color: #334155; font-family: Georgia, "Times New Roman", serif;
  font-size: 16px; line-height: 1.65;
}
.abstract-text p { margin: 0 0 16px; }
.abstract-text p:last-child { margin-bottom: 0; }

/* ---------- Method Overview ---------- */
.figure-card { overflow: hidden; }
.figure-card img { width: 100%; background: #fff; }
.caption {
  margin: 0; padding: 10px 16px;
  color: var(--muted); background: var(--paper);
  border-top: 1px solid var(--line); font-size: 13px; line-height: 1.45;
}

/* ---------- Dataset ---------- */
.dataset-grid {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 16px; align-items: start; margin-top: 16px;
}
.stats-table {
  width: 100%; border-collapse: collapse; font-size: 15px;
}
.stats-table th, .stats-table td {
  padding: 12px 14px; border-bottom: 1px solid #eef2f7; text-align: left;
}
.stats-table th {
  color: var(--quiet); font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.stats-table td:last-child, .stats-table th:last-child {
  text-align: right; font-variant-numeric: tabular-nums;
}
.category-list { display: grid; gap: 10px; }
.category-row {
  display: grid; grid-template-columns: 100px minmax(0,1fr) 44px;
  gap: 10px; align-items: center;
  color: #334155; font-size: 14px; font-weight: 600;
}
.track {
  height: 10px; border-radius: 999px; background: #e6edf6; overflow: hidden;
}
.fill {
  width: var(--v); height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}

/* ---------- Leaderboard ---------- */
.task-switch {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 28px;
}
.switch-btn {
  min-height: 40px; padding: 0 20px;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  color: #475569; background: #fff; font-size: 14px; font-weight: 700;
  transition: all .18s;
}
.switch-btn[aria-selected="true"] {
  color: #fff; border-color: var(--purple);
  background: var(--gradient);
}
.switch-btn:focus-visible { outline: 3px solid rgba(124,58,237,.22); outline-offset: 2px; }

.chart-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; margin-bottom: 24px;
}
.chart-box {
  padding: 24px; min-height: 420px;
}
.chart-box-title {
  margin: 0 0 12px; text-align: center;
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.chart-area { width: 100%; height: 340px; }

/* Table */
.table-scroll { overflow-x: auto; }
.leader-table {
  width: 100%; border-collapse: collapse; background: #fff; font-size: 14px;
}
.leader-table th, .leader-table td {
  padding: 14px 16px; border-bottom: 1px solid #eef2f7;
  text-align: left; vertical-align: middle;
}
.leader-table th {
  color: var(--quiet); background: #f8fafc;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
}
.leader-table tr:last-child td { border-bottom: 0; }
.leader-table td:not(:nth-child(2)), .leader-table th:not(:nth-child(2)) {
  text-align: center; font-variant-numeric: tabular-nums;
}
.rank-badge {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 999px;
  color: var(--quiet); background: #f4f6f9; font-weight: 900; font-size: 13px;
}
.rank-badge.gold { color: #f59e0b; background: #fffbeb; }
.rank-badge.silver { color: #6b7280; background: #f3f4f6; }
.rank-badge.bronze { color: #d97706; background: #fef3c7; }
.model-name { color: var(--ink); font-weight: 700; }
.ours-tag {
  display: inline-flex; align-items: center;
  margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  color: #0f766e; background: #ecfdf5;
  font-size: 11px; font-weight: 800;
}
.score-val {
  color: var(--purple); font-family: "JetBrains Mono", monospace; font-weight: 800;
}
tr.ours-row td { background: #f0fdf8; }
td.best-val { font-weight: 800; color: var(--ink); }

/* ---------- Showcase ---------- */
.showcase-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.showcase-card { transition: transform .2s, box-shadow .2s; }
.showcase-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.showcase-card img {
  width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #f1f5f9;
}
.showcase-body { padding: 18px; }
.showcase-body h3 { margin: 0 0 6px; font-size: 17px; color: var(--ink); }
.showcase-body p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Citation ---------- */
.citation-card { padding: 24px; }
pre.cite-block {
  margin: 0; padding: 20px; overflow-x: auto;
  color: #e2e8f0; background: #0f172a; border-radius: var(--radius-sm);
  font-family: "JetBrains Mono", monospace; font-size: 13px; line-height: 1.7;
  white-space: pre-wrap;
}

/* ---------- Footer ---------- */
footer {
  padding: 24px 0; text-align: center;
  color: #64748b; border-top: 1px solid var(--line);
  background: rgba(255,255,255,.82); font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav { flex-direction: column; align-items: flex-start; padding: 12px 0; }
  .navlinks { width: 100%; flex-wrap: wrap; }
  .chart-row, .dataset-grid, .showcase-grid { grid-template-columns: 1fr; }
  .leader-table { min-width: 860px; }
}
@media (max-width: 640px) {
  .wrap, .nav { width: min(100% - 24px, var(--max)); }
  .hero { padding: 28px 0 16px; }
  section { padding: 20px 0; }
  .category-row { grid-template-columns: 88px minmax(0,1fr) 38px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
