/* SuperMemory-VQA project page
   Design system ported from the MMDeepResearch-Bench (MMDR-Bench) template:
   clean light theme, Inter type, blue accent, card-based layout, and an
   interactive leaderboard. */

:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #475569;
  --muted2: #64748b;
  --border: #e2e8f0;
  --soft: #f8fafc;
  --card: #ffffff;
  --dark: #0b1220;
  --shadow: 0 12px 28px rgba(2, 6, 23, .08);
  --radius: 14px;
  --max: 1120px;
  --max-content: 980px;
  /* OSU scarlet accent */
  --blue: #bb0000;
  --accent: #bb0000;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
}

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

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 18px; }
.is-max-desktop { max-width: var(--max-content); margin: 0 auto; }
.has-text-centered { text-align: center; }
.has-text-justified { text-align: justify; }
.muted { color: var(--muted); }
.muted2 { color: var(--muted2); }

/* Top nav */
header.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 32px; width: auto; border-radius: 6px; display: block; }
.navlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}
.navlinks a { padding: 6px 10px; border-radius: 10px; }
.navlinks a:hover { background: var(--soft); text-decoration: none; color: var(--fg); }
@media (max-width: 880px) { .navlinks { display: none; } }

/* Hero */
.hero-wrap {
  background:
    radial-gradient(900px 260px at 15% 0%, rgba(187, 0, 0, .10), transparent 60%),
    radial-gradient(900px 260px at 85% 0%, rgba(187, 0, 0, .07), transparent 60%),
    linear-gradient(180deg, var(--soft), #ffffff 55%);
  border-bottom: 1px solid var(--border);
}
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 54px 18px 40px;
  text-align: center;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-weight: 900;
  letter-spacing: -.02em;
  font-size: 44px;
  line-height: 1;
  margin-bottom: 10px;
}
.eyebrow {
  margin: 0;
  color: var(--blue);
  font-weight: 900;
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}
.title {
  margin: 0 auto;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.22;
  font-weight: 700;
  max-width: 980px;
  letter-spacing: -.01em;
}
.subtitle {
  margin: 14px auto 0;
  max-width: 760px;
  font-size: 17px;
  color: var(--muted);
}

/* Author block */
.authors-wrapper { margin: 20px auto 0; max-width: 980px; text-align: center; }
.authors {
  color: var(--blue);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}
.authors sup { color: inherit; }
.authors a { color: var(--blue); text-decoration: none; }
.authors a:hover { text-decoration: underline; }
.team-label { margin-top: 10px; font-size: 17px; font-weight: 800; color: var(--fg); }
.affiliations {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.6;
  text-align: center;
}
.team-label {
  margin: 14px auto 0;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 900;
  text-align: center;
}
.correspondence {
  max-width: 980px;
  margin: 10px auto 0;
  color: var(--fg);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  font-weight: 400;
}
.correspondence code {
  color: var(--accent);
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-weight: 600;
}
.affil-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 18px auto 0;
  flex-wrap: wrap;
}
.affil-logo { display: block; width: auto; object-fit: contain; }
.affil-logo.osu { height: 42px; }
.affil-logo.meta { height: 26px; }
.contribution-notes {
  margin-top: 8px;
  font-size: 13px;
  color: var(--fg);
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  flex-direction: column;
}

/* Buttons */
.publication-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--dark);
  background: var(--dark);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(2, 6, 23, .06);
  transition: filter .15s ease, transform .15s ease;
}
.button:hover { text-decoration: none; filter: brightness(1.08); color: #fff; transform: translateY(-1px); }
.button.primary { background: var(--accent); border-color: var(--accent); }
.button.secondary { background: #fff; color: var(--dark); }
.button.secondary:hover { color: var(--dark); background: var(--soft); }
.button .icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, .85);
  color: var(--muted);
}
.irb-note { margin: 18px auto 0; max-width: 780px; color: var(--muted); font-size: 12.5px; }

/* Quickstart */
.quickstart {
  margin: 22px auto 0;
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.qs-card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .85);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, .06);
  text-align: left;
  transition: transform .15s ease, box-shadow .15s ease;
}
.qs-card:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(2, 6, 23, .10); text-decoration: none; }
.qs-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qs-step { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 13px; color: var(--fg); }
.qs-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--soft);
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
}
.qs-title { margin: 8px 0 2px; font-size: 15px; font-weight: 900; letter-spacing: -.01em; }
.qs-desc { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.5; }
@media (max-width: 920px) { .quickstart { grid-template-columns: 1fr; } }

/* Sections */
section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 42px 18px;
  scroll-margin-top: 74px;
}
section.narrow { max-width: var(--max); }
.section-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  text-align: center;
}
.section-heading::before {
  content: "";
  width: 68px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}
h2 { font-size: 26px; margin: 0 0 14px; letter-spacing: -.2px; }
h3 { margin: 0 0 8px; font-size: 16px; letter-spacing: -.2px; }
.section-intro { color: var(--muted); max-width: none; }
section p { margin: 0 0 14px; }

/* Band separators */
.band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--soft);
  padding: 24px 18px;
}
.band-inner { max-width: var(--max); margin: 0 auto; text-align: center; }
.band-title { margin: 0; font-size: 32px; letter-spacing: -.02em; font-weight: 900; }
.band-sub { margin: 8px 0 0; color: var(--muted); font-weight: 600; }

/* Grid & Cards */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-12 { grid-column: span 12; }
@media (max-width: 900px) { .col-6, .col-4, .col-3 { grid-column: span 12; } }
@media (min-width: 901px) and (max-width: 1100px) { .col-3 { grid-column: span 6; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
figure { margin: 0; }
.figure-card {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.figure-media {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.paper-fig { display: block; max-width: 100%; height: auto; border-radius: 10px; transition: transform .35s ease; }
.figure-media:hover .paper-fig { transform: scale(1.02); }
figcaption { margin-top: 10px; color: var(--muted2); font-size: 13px; font-weight: 550; }
.example-figure { margin-top: 18px; }
.example-figure .figure-media { padding: 12px; }

/* Task grid */
.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.task-grid .card { border-left: 3px solid var(--blue); }
.task-grid h3 { margin-bottom: 6px; }
.task-grid p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 900px) { .task-grid { grid-template-columns: 1fr; } }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.stat-card { text-align: center; }
.stat-value { display: block; color: var(--blue); font-size: 34px; font-weight: 900; line-height: 1; }
.stat-label { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
@media (max-width: 720px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* Leaderboard */
.leaderboard-container {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 14px;
}
.leaderboard-header { background: var(--dark); color: white; padding: 22px 24px; }
.leaderboard-header h3 { margin: 0 0 4px; font-size: 20px; color: white; font-weight: 900; letter-spacing: -.01em; }
.leaderboard-header p { margin: 0; opacity: .95; font-size: 14px; color: white; font-weight: 600; }

.score-notes {
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}
.score-notes b { color: var(--fg); }

.controls {
  padding: 16px 20px;
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-label { font-weight: 900; font-size: 13px; color: var(--muted); margin-right: 2px; }
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
  font-weight: 900;
  color: var(--fg);
}
.filter-btn:hover { border-color: var(--dark); color: var(--dark); }
.filter-btn.active { background: var(--dark); color: white; border-color: var(--dark); }
.search-box { flex: 1; min-width: 200px; max-width: 320px; margin-left: auto; }
.search-box input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  outline: none;
  font-weight: 600;
  font-family: inherit;
}
.search-box input:focus { border-color: rgba(2, 6, 23, .35); box-shadow: 0 0 0 3px rgba(2, 6, 23, .10); }

.metrics-legend { padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.legend-title { font-weight: 900; margin-bottom: 8px; display: block; color: var(--fg); }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.legend-item { display: flex; align-items: baseline; gap: 6px; line-height: 1.4; }
.legend-badge { background: var(--dark); color: white; padding: 2px 6px; border-radius: 6px; font-weight: 900; font-size: 11px; flex-shrink: 0; }

.table-container { overflow-x: auto; }
.leaderboard-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.leaderboard-table thead { background: var(--soft); position: sticky; top: 0; z-index: 10; }
.leaderboard-table th {
  padding: 10px 8px;
  text-align: center;
  font-weight: 900;
  color: var(--muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
}
.leaderboard-table th:hover { background: #fdeaea; }
.leaderboard-table th.sortable::after { content: ' \21C5'; opacity: .3; font-size: 10px; }
.leaderboard-table th.sort-asc::after { content: ' \2191'; opacity: 1; }
.leaderboard-table th.sort-desc::after { content: ' \2193'; opacity: 1; }
.metric-group { border-left: 2px solid var(--border); }
.leaderboard-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid #f1f3f5; font-weight: 600; }
.leaderboard-table tr:hover { background: var(--soft); }
.leaderboard-table td.best { color: var(--blue); font-weight: 900; }
.model-cell {
  text-align: left !important;
  font-weight: 900;
  padding-left: 12px !important;
  position: sticky;
  left: 0;
  background: white;
  z-index: 5;
  min-width: 220px;
}
.leaderboard-table tr:hover .model-cell { background: var(--soft); }
.model-name { font-weight: 900; }
.model-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, .85);
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  line-height: 1.2;
}
.tag.dark { background: var(--dark); border-color: var(--dark); color: white; }
.rank {
  display: inline-block;
  width: 22px; height: 22px; line-height: 22px;
  text-align: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
  margin-right: 8px;
}
.rank-1 { background: #ffd700; color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-other { background: #e9ecef; color: #6c757d; }
.model-inline { display: flex; align-items: center; }

@media (max-width: 768px) {
  .controls { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; margin-left: 0; }
  .model-cell { position: static; min-width: 0; }
}

/* Comparison data table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table thead th { background: var(--dark); color: #fff; font-weight: 800; font-size: 12px; }
.data-table tbody tr:nth-child(even) { background: var(--soft); }
.data-table tbody tr.ours { background: rgba(187, 0, 0, .07); }
.data-table tbody tr.ours td { font-weight: 800; color: var(--fg); }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Numbered criteria / finding lists */
.crit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.crit-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.crit-list li b { color: var(--fg); }
.crit-num {
  flex-shrink: 0;
  width: 22px; height: 22px; line-height: 22px;
  text-align: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

/* Spec / framework list */
.spec-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.spec-list li { margin: 6px 0; }
.spec-list b { color: var(--fg); }

/* Pill row (e.g. model tags) */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Codeblock / bibtex */
.codeblock {
  border: 1px solid var(--border);
  background: var(--soft);
  border-radius: 14px;
  padding: 14px;
  overflow: auto;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 600;
  color: #0b1220;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Inline note block */
.note {
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, .75);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 8px 22px rgba(2, 6, 23, .05);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}
.note b { color: var(--fg); }

/* Footer */
footer.footer { border-top: 1px solid var(--border); background: #fff; padding: 28px 18px; color: var(--muted2); }
.footer-inner { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; }

/* Reveal animation.
   Content is visible by default. The hidden/animated state is gated behind the
   `.js-reveal` class that the script adds to <html> only once it is running, so
   the page is never blank if JavaScript fails to load or execute. */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal .reveal { opacity: 1; transform: none; }
}
