:root {
  --navy: #001F5B;
  --heading: var(--navy);
  --teal: #00A6B8;
  --navy-light: #0d3d7a;
  --teal-light: #2ec4d4;
  --teal-glow: rgba(0, 166, 184, 0.18);
  --navy-glow: rgba(0, 31, 91, 0.08);
  --bg: #f7f9fc;
  --bg-alt: #eef3f9;
  --surface: #ffffff;
  --text: #152238;
  --text-muted: #5c6b82;
  --border: #dde5f0;
  --border-light: #e8eef6;
  --shadow-sm: 0 2px 8px rgba(0, 31, 91, 0.05);
  --shadow: 0 8px 32px rgba(0, 31, 91, 0.07);
  --shadow-lg: 0 16px 48px rgba(0, 31, 91, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);
  --nav-height: 68px;
  --code-bg: #0f1a2e;
  --code-text: #dce8f4;
  --inline-code-bg: #e8eef6;
  --inline-code-text: #001540;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--heading);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
}

.container-narrow {
  max-width: 780px;
}

.logo-unpredicta,
.title-unpredicta {
  color: var(--heading);
}

.logo-bench,
.title-bench {
  color: var(--teal);
}

.site-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.site-logo-nav {
  height: 38px;
  max-width: min(248px, 50vw);
}

.hero-title-logo {
  margin-bottom: 18px;
  line-height: 0;
}

.site-logo-hero {
  max-width: min(400px, 100%);
}

.footer-brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1;
}

.site-logo-mark {
  display: block;
  width: 36px;
  height: auto;
  flex-shrink: 0;
}

.footer-brand-text {
  font-size: 1rem;
  font-weight: 700;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(221, 229, 240, 0.8);
  transition: box-shadow 0.3s, background 0.3s;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.nav-logo:hover {
  opacity: 0.85;
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--heading);
  background: var(--navy-glow);
}

.nav-links a.active {
  color: var(--teal);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Hero */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + 56px) 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, #e8f4f8 0%, #f0f5fa 35%, var(--bg) 70%);
  z-index: -1;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-orb-1 {
  width: 500px;
  height: 500px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(0, 166, 184, 0.22), transparent 70%);
}

.hero-orb-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -100px;
  background: radial-gradient(circle, rgba(0, 31, 91, 0.1), transparent 70%);
}

.hero-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 31, 91, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 31, 91, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black 0%, transparent 85%);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

.hero-main {
  padding-top: 8px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 32px;
  font-weight: 400;
  line-height: 1.5;
}

.authors {
  margin-bottom: 32px;
}

.author-list {
  font-size: 0.98rem;
  line-height: 1.85;
  margin-bottom: 6px;
}

.author-list .author-name {
  color: var(--text);
  font-weight: 600;
}

.author-list sup {
  font-size: 0.68em;
  color: var(--text-muted);
  font-weight: 500;
}

.affiliations,
.author-notes {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.author-notes {
  margin-top: 4px;
  font-size: 0.82rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  backdrop-filter: blur(8px);
}

.stat-number {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 31, 91, 0.25);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 31, 91, 0.32);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--heading);
  border: 1.5px solid var(--border);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* Mini Leaderboard */
.mini-leaderboard-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.mini-lb-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.mini-lb-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.02em;
}

.mini-lb-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.mini-lb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border-light);
  transition: transform 0.15s, box-shadow 0.15s;
}

.mini-lb-item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.mini-lb-item.mini-rank-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 255, 255, 0.9));
  border-color: rgba(184, 134, 11, 0.2);
}

.mini-lb-item.mini-rank-2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(255, 255, 255, 0.9));
}

.mini-lb-item.mini-rank-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.08), rgba(255, 255, 255, 0.9));
}

.mini-lb-rank {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.mini-rank-1 .mini-lb-rank { color: #b8860b; border-color: rgba(184, 134, 11, 0.3); background: #fffdf5; }
.mini-rank-2 .mini-lb-rank { color: #708090; }
.mini-rank-3 .mini-lb-rank { color: #a0522d; }

.mini-lb-info {
  flex: 1;
  min-width: 0;
}

.mini-lb-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.mini-lb-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-lb-score {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.mini-lb-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.mini-lb-skeleton {
  height: 52px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--border-light) 25%, #f5f8fc 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.mini-lb-link {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--heading);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.mini-lb-link:hover {
  border-color: var(--teal);
  background: var(--teal-glow);
  color: var(--teal);
}

.mini-lb-error {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 12px;
  text-align: center;
}

/* Sections */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--heading);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 40px;
  line-height: 1.65;
}

.subsection-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
  margin: 48px 0 24px;
  letter-spacing: -0.02em;
}

.teaser-section {
  padding-top: 16px;
  padding-bottom: 56px;
}

/* Abstract */
.abstract-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.abstract-text p {
  margin-bottom: 1.25em;
}

.abstract-text p:last-child {
  margin-bottom: 0;
}

/* Examples */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.example-card-wide {
  grid-column: 1 / -1;
}

.example-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--teal);
  background: var(--teal-glow);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.example-prompt {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.example-prompt code,
.metric-chip code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.85em;
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-weight: 600;
}

.example-card pre {
  background: var(--code-bg);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.example-card pre code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--code-text);
  background: transparent;
  border: none;
  padding: 0;
  font-weight: 400;
}

.example-note {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.task-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.task-pill {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--heading);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
}

.task-pill em {
  font-style: normal;
  font-weight: 800;
  color: var(--teal);
  margin-left: 4px;
}

/* Metric chips */
.metric-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.metric-chip {
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Figures */
.figure {
  margin: 36px 0;
}

.figure img {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

.figure-medium {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.figure-compact {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.figure-hero img {
  box-shadow: var(--shadow-lg);
}

.figure figcaption {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  text-align: center;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* Findings */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}

.findings-compact {
  grid-template-columns: repeat(3, 1fr);
}

.finding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.finding-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.finding-card h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.finding-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* BibTeX */
.bibtex-block {
  position: relative;
  background: linear-gradient(160deg, #1a2744 0%, #0f1a2e 100%);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg);
}

.bibtex-block pre {
  padding: 28px;
  overflow-x: auto;
}

.bibtex-block code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #c8d6e8;
}

.copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #a8b8cc;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.copy-btn.copied {
  background: rgba(0, 166, 184, 0.25);
  border-color: var(--teal);
  color: var(--teal-light);
}

/* Footer */
.footer {
  background: linear-gradient(160deg, var(--navy) 0%, #001540 100%);
  color: rgba(255, 255, 255, 0.6);
  padding: 40px 0;
  text-align: center;
  font-size: 0.88rem;
}

.footer-brand {
  margin-bottom: 8px;
}

.footer-affil {
  font-size: 0.82rem;
  margin-bottom: 16px;
  opacity: 0.7;
}

.footer .logo-unpredicta {
  color: #fff;
}

.footer .logo-bench {
  color: var(--teal-light);
}

.footer a {
  color: var(--teal-light);
}

.footer a:hover {
  color: #fff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

/* Full Leaderboard */
.leaderboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.leaderboard-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 22px 24px;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
  flex: 1;
}

.control-group.control-search {
  flex: 1.5;
  min-width: 180px;
}

.control-group label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.control-group input,
.control-group select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.control-group input:focus,
.control-group select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.control-group.control-inactive {
  opacity: 0.5;
}

.control-group.control-inactive label {
  color: var(--text-muted);
}

.control-group.control-inactive select {
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border-light);
}

.control-group.control-inactive select:focus {
  border-color: var(--border-light);
  box-shadow: none;
}

.cat-bars-subset .cat-bar-item:nth-child(1) .cat-bar-fill,
.cat-bars-subset .cat-bar-item:nth-child(2) .cat-bar-fill {
  opacity: 0.85;
}

.leaderboard-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
}

.leaderboard-hint {
  font-size: 0.78rem;
  opacity: 0.75;
}

.leaderboard-table-wrap {
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.leaderboard-table th {
  position: sticky;
  top: 0;
  background: var(--navy);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.leaderboard-table th:hover {
  background: var(--navy-light);
}

.leaderboard-table th.sort-active::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  border: 4px solid transparent;
}

.leaderboard-table th.sort-active.sort-desc::after {
  border-top-color: var(--teal-light);
  border-bottom: none;
  vertical-align: middle;
}

.leaderboard-table th.sort-active.sort-asc::after {
  border-bottom-color: var(--teal-light);
  border-top: none;
  vertical-align: middle;
}

.leaderboard-table th.col-rank,
.leaderboard-table td.lb-rank {
  width: 48px;
  text-align: center;
}

.leaderboard-table th.col-profile,
.leaderboard-table td.lb-profile {
  width: 240px;
  min-width: 200px;
}

.leaderboard-table th.col-profile {
  line-height: 1.35;
  vertical-align: bottom;
}

.col-profile-axes {
  display: block;
  margin-top: 2px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-transform: none;
}

.leaderboard-table th.col-score,
.leaderboard-table td.lb-score {
  width: 120px;
  text-align: right;
}

.leaderboard-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.leaderboard-table tbody tr {
  transition: background 0.12s;
}

.leaderboard-table tbody tr:hover {
  background: rgba(0, 166, 184, 0.04);
}

.lb-rank {
  font-weight: 800;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.lb-rank.rank-gold { color: #b8860b; }
.lb-rank.rank-silver { color: #708090; }
.lb-rank.rank-bronze { color: #a0522d; }

.lb-model {
  min-width: 220px;
}

.lb-model-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--heading);
  flex-wrap: wrap;
}

.lb-variant-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.4;
}

.lb-variant-badge-base {
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.lb-scope-badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px dashed var(--border);
}

.score-value:empty,
.lb-score .score-value {
  min-width: 3ch;
}

.model-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.mini-lb-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-lb-bar-track {
  display: block;
  height: 4px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

/* KS@N profile sparkline */
.ks-profile {
  position: relative;
  width: 100%;
}

.ks-profile-svg {
  display: block;
  width: 100%;
  height: 40px;
}

.ks-profile-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 4px;
}

/* Category breakdown bars */
.cat-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.cat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-bar-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.cat-bar-track {
  height: 6px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}

.cat-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--teal));
  border-radius: 999px;
}

.lb-no-profile {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.lb-score {
  font-variant-numeric: tabular-nums;
  color: var(--heading);
}

.score-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.score-value {
  font-weight: 800;
  font-size: 0.95rem;
}

.lb-score-missing .score-value {
  color: var(--text-muted);
  font-weight: 600;
}

.lb-score-missing .score-meter {
  opacity: 0;
}

.score-meter {
  display: block;
  width: 72px;
  height: 4px;
  background: rgba(0, 31, 91, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.score-meter-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--navy));
  border-radius: 999px;
}

.leaderboard-error {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 960px) {
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .mini-leaderboard-card {
    position: static;
    max-width: 480px;
    margin: 0 auto;
  }

  .examples-grid {
    grid-template-columns: 1fr;
  }

  .findings-grid,
  .findings-compact {
    grid-template-columns: 1fr;
  }

  .leaderboard-controls {
    flex-direction: column;
  }

  .control-group {
    min-width: 100%;
  }

  .leaderboard-meta {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .leaderboard-table th.col-profile,
  .leaderboard-table td.lb-profile {
    min-width: 160px;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li a {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
  }

  .hero {
    padding-bottom: 56px;
  }

  .hero-main {
    text-align: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .author-list {
    font-size: 0.88rem;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .section {
    padding: 56px 0;
  }

  .mini-leaderboard-card {
    max-width: 100%;
  }
}

/* Nav actions + theme switch */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-alt);
  cursor: pointer;
  font-family: var(--font-sans);
}

.theme-switch-seg {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
  user-select: none;
}

.theme-switch-seg.active {
  background: var(--surface);
  color: var(--heading);
  box-shadow: var(--shadow-sm);
}

.theme-switch:hover {
  border-color: var(--teal);
}

.math-expr {
  font-family: Georgia, 'Times New Roman', 'STIX Two Text', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--text);
}

[data-theme="dark"] .theme-switch-seg.active {
  color: var(--text);
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0f1218;
  --bg-alt: #161c26;
  --surface: #1c2430;
  --text: #f0f4f8;
  --text-muted: #c2cddc;
  --heading: #f0f4f8;
  --navy: #001F5B;
  --navy-light: #0d3d7a;
  --teal: #4dd4e8;
  --teal-light: #7ee8f7;
  --border: #3a4a60;
  --border-light: #2d3a4d;
  --navy-glow: rgba(0, 166, 184, 0.12);
  --teal-glow: rgba(77, 212, 232, 0.15);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.35);
  --code-bg: #0a0e14;
  --code-text: #e8f2fc;
  --inline-code-bg: #1e2d42;
  --inline-code-text: #e0f4fa;
}

[data-theme="dark"] .nav {
  background: rgba(15, 18, 24, 0.85);
  border-bottom-color: var(--border);
}

[data-theme="dark"] .nav.scrolled {
  background: rgba(15, 18, 24, 0.95);
}

[data-theme="dark"] .hero-bg {
  background: linear-gradient(165deg, #0d1f3d 0%, #121820 35%, var(--bg) 70%);
}

[data-theme="dark"] .hero-orb-1 {
  background: radial-gradient(circle, rgba(0, 166, 184, 0.12), transparent 70%);
}

[data-theme="dark"] .hero-orb-2 {
  background: radial-gradient(circle, rgba(0, 31, 91, 0.2), transparent 70%);
}

[data-theme="dark"] .hero-grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

[data-theme="dark"] .stat-item,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .mini-leaderboard-card {
  background: rgba(28, 36, 48, 0.9);
}

[data-theme="dark"] .example-card,
[data-theme="dark"] .finding-card,
[data-theme="dark"] .metric-chip,
[data-theme="dark"] .leaderboard,
[data-theme="dark"] .task-pill {
  background: var(--surface);
}

[data-theme="dark"] .mini-lb-item {
  background: var(--bg-alt);
}

[data-theme="dark"] .bibtex-block {
  background: linear-gradient(160deg, #0a0e14 0%, #121820 100%);
}

[data-theme="dark"] .footer {
  background: linear-gradient(160deg, #001540 0%, #0f1218 100%);
  color: #c2cddc;
}

[data-theme="dark"] .footer-affil {
  opacity: 1;
  color: #a8b8c8;
}

[data-theme="dark"] .leaderboard-hint,
[data-theme="dark"] .leaderboard-meta {
  opacity: 1;
  color: var(--text-muted);
}

[data-theme="dark"] .control-group label {
  color: #b0bec9;
}

[data-theme="dark"] .figure figcaption,
[data-theme="dark"] .example-note,
[data-theme="dark"] .finding-card p {
  color: var(--text-muted);
}

[data-theme="dark"] .author-list .author-name {
  color: var(--text);
}

[data-theme="dark"] .btn-secondary {
  color: var(--text);
}

[data-theme="dark"] .lb-rank,
[data-theme="dark"] .mini-lb-rank {
  color: var(--text-muted);
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .lb-rank.rank-gold,
[data-theme="dark"] .mini-rank-1 .mini-lb-rank {
  color: #f0c84a;
}

[data-theme="dark"] .lb-rank.rank-silver,
[data-theme="dark"] .mini-rank-2 .mini-lb-rank {
  color: #b8c5d4;
}

[data-theme="dark"] .lb-rank.rank-bronze,
[data-theme="dark"] .mini-rank-3 .mini-lb-rank {
  color: #d4a574;
}

[data-theme="dark"] .mini-lb-item.mini-rank-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.07), rgba(28, 36, 48, 0.95));
}

[data-theme="dark"] .mini-lb-item.mini-rank-2,
[data-theme="dark"] .mini-lb-item.mini-rank-3 {
  background: var(--bg-alt);
}

[data-theme="dark"] .cat-bar-label {
  color: #b0bec9;
}

[data-theme="dark"] .lb-no-profile {
  color: var(--text-muted);
}

[data-theme="dark"] .theme-switch-seg:not(.active) {
  color: var(--text-muted);
}

[data-theme="dark"] .leaderboard-table th {
  background: var(--navy);
  color: #fff;
}

[data-theme="dark"] .leaderboard-table th:hover {
  background: var(--navy-light);
}

[data-theme="dark"] .leaderboard-hint {
  opacity: 1;
}

[data-theme="dark"] .mini-rank-1 .mini-lb-rank {
  background: rgba(240, 200, 74, 0.15);
  border-color: rgba(240, 200, 74, 0.35);
}

[data-theme="dark"] .nav-toggle span {
  background: var(--heading);
}

[data-theme="dark"] .nav-links a:hover {
  color: var(--heading);
}

[data-theme="dark"] .score-meter {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .leaderboard-table tbody tr:hover {
  background: rgba(77, 212, 232, 0.06);
}

[data-theme="dark"] .footer-brand,
[data-theme="dark"] .footer .logo-unpredicta {
  color: var(--heading);
}



[data-theme="dark"] .btn-secondary:hover {
  background: var(--surface);
}