/* ═══════════════════════════════════════════════════════════════
   MechVerse Project Page — style.css
   Design: Clean academic paper page, warm off-white base,
   mechanical steel accents, precision typography.
   Fonts: Syne (display) + DM Sans (body) + DM Mono (code/tags)
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=DM+Mono:wght@400;500&display=swap');

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:          #F7F6F3;
  --bg-card:     #FFFFFF;
  --bg-subtle:   #F0EEE9;
  --border:      #E4E1DA;
  --border-dark: #C8C4BC;

  --text:        #1A1815;
  --text-2:      #4A4744;
  --text-3:      #7A7672;
  --text-inv:    #FFFFFF;

  /* Accent palette — deep indigo + warm amber */
  --accent:      #4361EE;
  --accent-2:    #F72585;
  --accent-3:    #7209B7;
  --accent-soft: rgba(67,97,238,0.10);
  --accent-2-soft: rgba(247,37,133,0.10);

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:      0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover:0 20px 60px rgba(0,0,0,0.13), 0 4px 16px rgba(0,0,0,0.08);

  --transition:  all 0.22s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);

  --max-w:       1100px;
  --max-w-wide:  1320px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Scroll progress bar ─────────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── Sticky nav ──────────────────────────────────────────────── */
#site-nav {
  display: none;
}
#site-nav::-webkit-scrollbar { display: none; }

.nav-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent);
  white-space: nowrap;
  margin-right: 12px;
  letter-spacing: -0.02em;
}

.nav-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  transition: var(--transition);
  border: 1px solid transparent;
}
.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border);
}
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(26,107,90,0.2);
}

/* ── Containers ──────────────────────────────────────────────── */
.container       { max-width: var(--max-w);      margin: 0 auto; padding: 0 24px; }
.container-wide  { max-width: var(--max-w-wide); margin: 0 auto; padding: 0 24px; }

/* ── Section wrappers ────────────────────────────────────────── */
.section {
  padding: 80px 0;
}
.section + .section {
  border-top: 1px solid var(--border);
}
.section-alt {
  background: var(--bg-subtle);
}

/* ── Section headings ────────────────────────────────────────── */
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}
.section-title span { color: var(--accent); }
.section-title span.amber { color: var(--accent-2); }
.section-sub {
  margin-top: 12px;
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 640px;
  line-height: 1.65;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--border-dark);
}
.card-pad { padding: 28px; }

/* ── Video cards ─────────────────────────────────────────────── */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}
.video-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.video-card video {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  background: #0a0a0a;
  object-fit: cover;
}
.video-card-meta {
  padding: 12px 14px 14px;
}
.video-card-label {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 4px;
}
.video-card-sub {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-3);
}

/* ── Tag pills ───────────────────────────────────────────────── */
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-2);
}
.tag.easy   { background: rgba(26,107,90,0.10);  color: var(--accent);   border-color: rgba(26,107,90,0.2); }
.tag.medium { background: rgba(212,116,42,0.10); color: var(--accent-2); border-color: rgba(212,116,42,0.2);}
.tag.hard   { background: rgba(220,38,38,0.10);  color: #DC2626;          border-color: rgba(220,38,38,0.2); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border-dark);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 16px rgba(26,107,90,0.15);
  transform: translateY(-1px);
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: #145749;
  border-color: #145749;
  color: white;
  box-shadow: 0 8px 24px rgba(26,107,90,0.30);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 7px 14px;
}

/* ── Toggle / filter buttons ─────────────────────────────────── */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.filter-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.83rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border-dark);
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 16px rgba(26,107,90,0.25);
}

/* ── Category pills ──────────────────────────────────────────── */
.cat-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 24px;
}
.cat-pill {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.cat-pill:hover  { border-color: var(--accent); color: var(--accent); }
.cat-pill.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ── Video grids ─────────────────────────────────────────────── */
.video-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.video-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.video-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }

@media (max-width: 900px) {
  .video-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .video-grid-3, .video-grid-2 { grid-template-columns: 1fr; }
}

/* ── Stats row ───────────────────────────────────────────────── */
.stats-hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 800px) { .stats-hero-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .stats-hero-row { grid-template-columns: 1fr; } }

.stat-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-hero-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-hero-card h4 {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.stat-hero-value {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-hero-sub {
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ── Bar chart card ──────────────────────────────────────────── */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.chart-card h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 18px;
}

/* ── Table card ──────────────────────────────────────────────── */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.table-card h4 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 14px;
  color: var(--text);
}
.table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.table-row:last-child { border-bottom: none; }
.table-key { color: var(--text-2); }
.table-val { font-weight: 600; color: var(--text); font-family: 'DM Mono', monospace; font-size: 0.82rem; }

.stats-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width:700px) { .stats-table-row { grid-template-columns: 1fr; } }

/* ── Radar section layout ────────────────────────────────────── */
.radar-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) { .radar-layout { grid-template-columns: 1fr; } }

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

.radar-group-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Model list sidebar */
.model-list { display: flex; flex-direction: column; gap: 8px; }

.model-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.model-card:hover { border-color: var(--border-dark); box-shadow: var(--shadow); }
.model-card.selected {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(26,107,90,0.15);
}
.model-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.model-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.model-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  flex: 1;
}
.model-avg {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1rem;
}
.model-detail {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.model-card.selected .model-detail { display: grid; }
.model-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 2px 0;
}
.model-detail-key { color: var(--text-3); }
.model-detail-val { font-family:'DM Mono',monospace; font-weight:500; color:var(--text); font-size:0.73rem; }

/* ── Cross-model comparison ──────────────────────────────────── */
.model-video-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ── Figures / paper charts ──────────────────────────────────── */
.figure-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.figure-img-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.figure-img-wrap img {
  width: 100%;
  display: block;
}
.figure-caption {
  padding: 16px 20px;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.6;
  border-top: 1px solid var(--border);
}

/* ── Hero section ────────────────────────────────────────────── */
#hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(26,107,90,0.2);
  margin-bottom: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 8px;
}
.hero-title span { color: var(--accent); }

.hero-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 28px;
  font-weight: 400;
  line-height: 1.6;
}

.authors-block {
  margin-bottom: 28px;
}
.authors-names {
  font-size: 0.95rem;
  color: var(--text-2);
  margin-bottom: 6px;
}
.authors-names a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 1px;
  transition: var(--transition);
}
.authors-names a:hover { color: var(--accent); border-color: var(--accent); }
.authors-affil {
  font-size: 0.82rem;
  color: var(--text-3);
}
.authors-affil sup { font-size: 0.65rem; color: var(--accent); }
.equal-note {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: 4px;
  font-style: italic;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

/* ── Problem cards ───────────────────────────────────────────── */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 820px) { .problem-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .problem-grid { grid-template-columns: 1fr; } }

.problem-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.problem-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: var(--transition);
}
.problem-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  border-color: var(--border-dark);
}
.problem-card:hover::before { opacity: 1; }

.problem-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
}
.problem-card h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.problem-card p {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
}
.problem-chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.problem-chip {
  font-family: 'DM Mono', monospace;
  font-size: 0.63rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-3);
}

/* ── Eval protocol cards ─────────────────────────────────────── */
.eval-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 700px) { .eval-grid { grid-template-columns: 1fr; } }

.eval-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.eval-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.eval-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--accent-2-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
}
.eval-card h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
}
.eval-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.eval-card li {
  display: flex;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.5;
}
.eval-card li::before {
  content: counter(list-item, decimal) '.';
  counter-increment: list-item;
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent-2);
  font-weight: 500;
  flex-shrink: 0;
  padding-top: 1px;
}
.eval-card ul { counter-reset: list-item; }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-3);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Utility ─────────────────────────────────────────────────── */
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.text-center { text-align: center; }
.flex-center { display:flex; align-items:center; justify-content:center; }
.gap-3 { gap: 12px; }

/* ── Fade-in on scroll ───────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 0.88rem;
  font-style: italic;
}

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Hero button row — wrap gracefully ───────────────────────── */
.hero-btns {
  flex-wrap: wrap;
  row-gap: 10px;
}

/* ── Color accent overrides for new palette ──────────────────── */
/* tag colors updated to match new accent */
.tag.easy   { background: rgba(67,97,238,0.10);  color: #4361EE; border-color: rgba(67,97,238,0.25); }
.tag.medium { background: rgba(247,37,133,0.10); color: #F72585; border-color: rgba(247,37,133,0.25);}
.tag.hard   { background: rgba(114,9,183,0.10);  color: #7209B7; border-color: rgba(114,9,183,0.25); }

/* Problem card top stripe uses new accent */
.problem-card::before {
  background: linear-gradient(90deg, #4361EE, #F72585);
}

/* Stat hero value color */
.stat-hero-value { color: #4361EE; }

/* Section label color */
.section-label { color: #4361EE; }
