/* MPTc-Bench GitHub Pages — style.css
   CSS variable system inherited from viewer/styles.css */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:            #fafafa;
  --bg-card:       #ffffff;
  --bg-alt:        #f4f6fb;
  --text:          #1a1a1a;
  --text-secondary:#666;
  --border:        #e5e5e5;
  --accent:        #2563eb;
  --accent-light:  #eff6ff;
  --good:          #16a34a;
  --medium:        #ca8a04;
  --poor:          #dc2626;
  --shadow:        0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.10);
  --radius:        8px;
  --nav-h:         56px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

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

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

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

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

section {
  padding: 72px 0;
}

section:nth-child(even) {
  background: var(--bg-alt);
}

/* ── Nav ─────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  white-space: nowrap;
  margin-right: 32px;
  text-decoration: none;
}

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

.nav-links a {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Hero ─────────────────────────────────────────────────────── */
#hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f8faff 60%, var(--bg-alt) 100%);
  padding: 80px 0 64px;
  text-align: center;
}

.hero-venue {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  max-width: 780px;
  margin: 0 auto 24px;
  color: var(--text);
}

.hero-authors {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.hero-affiliation {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.hero-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--outline {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--disabled {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  pointer-events: none;
  opacity: 0.7;
}

.btn-icon { font-size: 1rem; }

/* ── Section Headings ─────────────────────────────────────────── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.2;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 40px;
}

/* ── Abstract ─────────────────────────────────────────────────── */
.abstract-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 800px;
  border-left: 4px solid var(--accent);
  padding-left: 24px;
  margin: 0 auto;
}

/* ── Stats Grid ───────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Figure ─────────────────────────────────────────────────── */
.fig-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.fig-wrap img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.fig-caption {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

/* ── Download Panel ───────────────────────────────────────────── */
.download-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}

.download-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.download-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.code-snippet {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
}

/* ── Benchmark Tasks ─────────────────────────────────────────── */
.tasks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.task-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.task-badge--surface { background: #dcfce7; color: #166534; }
.task-badge--deep    { background: #ede9fe; color: #5b21b6; }

.task-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Metrics Icons */
.metrics-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 40px;
}

.metric-icon-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.metric-icon-card .icon { font-size: 2rem; margin-bottom: 8px; }
.metric-icon-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; }
.metric-icon-card p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* ── Leaderboard ─────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 8px 20px;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.lb-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--bg-card);
}

.lb-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  background: var(--bg-alt);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.lb-table th:hover { color: var(--accent); }

.lb-table th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  color: var(--text-secondary);
  font-style: normal;
}

.lb-table th.sorted .sort-arrow { color: var(--accent); }

.lb-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lb-table tr:last-child td { border-bottom: none; }

.lb-table tr:hover td { background: var(--bg-alt); }

.lb-table tr.row-gt td {
  background: #f8fafc;
  color: var(--text-secondary);
  font-style: italic;
}

.lb-table tr.row-best td:not(:nth-child(1)):not(:nth-child(2)) {
  font-weight: 700;
}

.cell-good   { color: var(--good);   font-weight: 600; }
.cell-medium { color: var(--medium); font-weight: 600; }
.cell-poor   { color: var(--poor);   font-weight: 600; }
.cell-na     { color: var(--text-secondary); }

.model-name { font-weight: 600; }
.planner-name { color: var(--text-secondary); font-size: 0.8rem; }

/* ── Gallery ─────────────────────────────────────────────────── */
.gallery-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.gallery-tab {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.gallery-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.gallery-case {
  display: none;
}
.gallery-case.active {
  display: block;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.gallery-item {
  text-align: center;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: transform 0.15s, box-shadow 0.15s;
}

.gallery-item img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.gallery-item-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.gallery-case-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  z-index: 10;
  line-height: 32px;
  text-align: center;
}

.modal-close:hover { background: var(--border); }

.modal-body {
  padding: 24px;
}

.modal-img-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-align: center;
}

.modal-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── Citation ────────────────────────────────────────────────── */
.citation-box {
  position: relative;
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: var(--radius);
  padding: 24px;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  overflow-x: auto;
}

.citation-copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: #cdd6f4;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}

.citation-copy-btn:hover { background: rgba(255,255,255,0.22); }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

footer a { color: var(--text-secondary); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-grid        { grid-template-columns: repeat(2, 1fr); }
  .tasks-grid        { grid-template-columns: 1fr; }
  .metrics-icons     { grid-template-columns: 1fr; }
  .gallery-grid      { grid-template-columns: repeat(2, 1fr); }
  .hero-title        { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .stats-grid        { grid-template-columns: repeat(2, 1fr); }
  .hero-links        { flex-direction: column; align-items: center; }
  .nav-links         { display: none; }
}
