/* ================================================================
   RoboAlign-R1 — Project page stylesheet
   Palette: modern academic, dark hero + light content + dark cite
   ================================================================ */

:root {
  --c-bg:            #ffffff;
  --c-bg-muted:      #f7f8fb;
  --c-bg-dark:       #0e1626;
  --c-bg-darker:     #080e1a;
  --c-border:        #e4e7ee;
  --c-border-strong: #cbd0db;
  --c-text:          #1b2230;
  --c-text-soft:     #4a5160;
  --c-text-muted:    #7a8192;
  --c-text-invert:   #eef1f7;
  --c-text-invert-soft: #b7bdcb;

  --c-brand:         #1a4f8b;
  --c-brand-dark:    #123768;
  --c-brand-light:   #2f6bb0;
  --c-brand-soft:    #e8eef8;
  --c-brand-glow:    #4a90e2;

  --c-accent:        #c0392b;     /* highlight red for best rows */
  --c-accent-soft:   #fde7e4;
  --c-success:       #1e7e52;
  --c-success-soft:  #e2f4ea;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;

  --shadow-sm:  0 1px 2px rgba(14,22,38,0.05);
  --shadow-md:  0 8px 24px rgba(14,22,38,0.08);
  --shadow-lg:  0 16px 48px rgba(14,22,38,0.12);

  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --container: 1160px;
}

/* -------------------- Reset -------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--c-brand); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--c-brand-light); }
button { font-family: inherit; cursor: pointer; }
code { font-family: var(--f-mono); font-size: 0.92em; background: #eef1f7; padding: 0.1em 0.4em; border-radius: 4px; }
pre  { font-family: var(--f-mono); }

h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.65rem, 2.3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* -------------------- Navbar -------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--c-text);
  font-size: 1.02rem;
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-brand), var(--c-brand-glow));
  color: #fff;
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.03em;
}
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: var(--c-text-soft);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--c-brand); background: var(--c-brand-soft); }

/* -------------------- Hero -------------------- */
.hero {
  position: relative;
  padding: 72px 24px 60px;
  overflow: hidden;
  background: radial-gradient(1200px 600px at 15% -10%, #1e3a6b 0%, transparent 60%),
              radial-gradient(1000px 520px at 90% 0%,  #2a5aa5 0%, transparent 55%),
              linear-gradient(180deg, #0b1324 0%, #0e1930 100%);
  color: var(--c-text-invert);
}
.hero-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 40%, transparent 75%);
  pointer-events: none;
}
.hero-bg-glow {
  position: absolute;
  width: 600px; height: 600px; border-radius: 50%;
  left: 50%; top: 55%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(74,144,226,0.22) 0%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}
.venue-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--c-text-invert-soft);
  margin-bottom: 24px;
}
.hero-title { margin: 0 0 22px; }
.title-method {
  display: block;
  font-size: clamp(2.4rem, 5.4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #eaf2ff 0%, #8fbaf2 60%, #4a90e2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}
.title-sub {
  display: block;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 500;
  color: var(--c-text-invert);
  opacity: 0.92;
  letter-spacing: -0.005em;
}

.authors { margin-top: 18px; }
.author-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--c-text-invert);
  font-size: 0.93rem;
}
.affil {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--c-text-invert-soft);
  font-style: italic;
}

.hero-buttons {
  margin: 30px 0 6px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.93rem;
  transition: transform .15s ease, background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
  border: 1px solid transparent;
  will-change: transform;
}
.btn i, .btn .ai { font-size: 1rem; }
.btn-dark {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
}
.btn-dark:hover {
  background: #ffffff;
  color: var(--c-brand-dark);
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  transform: translateY(-1px);
}

.metrics-row {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}
.metric-pill {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.metric-value {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1;
}
.metric-value .unit {
  font-size: 0.65em;
  font-weight: 600;
  color: #a7c8ef;
  margin-left: 2px;
}
.metric-label {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--c-text-invert-soft);
  line-height: 1.35;
}

/* -------------------- Generic sections -------------------- */
.section { padding: 72px 0; }
.section-light { background: var(--c-bg); }
.section-muted { background: var(--c-bg-muted); }
.section-dark {
  background: linear-gradient(180deg, #0e1626 0%, #080e1a 100%);
  color: var(--c-text-invert);
}

.section-head {
  text-align: center;
  margin-bottom: 40px;
}
.section-head .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-brand);
  background: var(--c-brand-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.section-head.light .eyebrow {
  background: rgba(255,255,255,0.1);
  color: #9cc3f0;
}
.section-head h2 { color: inherit; }
.section-head .section-lead {
  max-width: 720px;
  margin: 10px auto 0;
  color: var(--c-text-soft);
  font-size: 1rem;
}
.section-dark .section-head .section-lead { color: var(--c-text-invert-soft); }

.eyebrow.inline-method, .inline-method {
  color: var(--c-brand);
  font-weight: 700;
}
.section-dark .inline-method { color: #9cc3f0; }

/* -------------------- TL;DR -------------------- */
.tldr-box {
  background: #fff;
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-brand);
  border-radius: var(--radius-md);
  padding: 22px 28px;
  box-shadow: var(--shadow-sm);
  max-width: 960px;
  margin: 0 auto 40px;
}
.tldr-box > p { margin-top: 0; font-size: 1.02rem; color: var(--c-text); }
.tldr-list {
  list-style: none;
  padding: 0; margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
}
.tldr-list li {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 0.94rem; color: var(--c-text-soft);
}
.tldr-list li i {
  flex: 0 0 28px;
  height: 28px;
  width: 28px;
  border-radius: 8px;
  background: var(--c-brand-soft);
  color: var(--c-brand);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  margin-top: 2px;
}

/* -------------------- Figure blocks -------------------- */
.figure-block {
  margin: 0 auto 20px;
  max-width: 960px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.figure-block.thin { max-width: 760px; }
.figure-block img { width: 100%; height: auto; display: block; background: #fff; }
.figure-block figcaption {
  padding: 14px 22px 18px;
  font-size: 0.88rem;
  color: var(--c-text-soft);
  border-top: 1px solid var(--c-border);
  background: #fbfcfe;
  line-height: 1.55;
}

/* -------------------- Motivation two-col -------------------- */
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 24px;
  max-width: 960px; margin: 0 auto;
}
.issue-card {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 26px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.issue-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.issue-num {
  position: absolute; top: 18px; right: 22px;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--c-brand);
  opacity: 0.35;
}
.issue-card h3 {
  color: var(--c-text);
  padding-right: 40px;
  margin-bottom: 10px;
}
.issue-card p { margin: 0; color: var(--c-text-soft); font-size: 0.96rem; }

/* -------------------- Tabs -------------------- */
.tabs { max-width: 1040px; margin: 0 auto; }
.tab-buttons {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px;
  background: #eef1f7;
  border-radius: 14px;
  border: 1px solid var(--c-border);
  margin-bottom: 22px;
}
.tab-btn {
  flex: 1 1 220px;
  border: none;
  background: transparent;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--c-text-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .18s ease;
}
.tab-btn:hover { color: var(--c-brand); }
.tab-btn.active {
  background: #fff;
  color: var(--c-brand-dark);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
}
.tab-panel { display: none; animation: fadeIn .3s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.two-col-asym {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 14px;
}
.two-col-asym.flip { grid-template-columns: 0.9fr 1.1fr; }
.two-col-asym figure {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 0;
}
.two-col-asym figure img { width: 100%; height: auto; }
.two-col-asym figcaption {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--c-text-soft);
  border-top: 1px solid var(--c-border);
  background: #fbfcfe;
  line-height: 1.45;
}

/* Dimension chips */
.dim-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.dim-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--c-brand-soft);
  color: var(--c-brand-dark);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid #d5e1f2;
}
.dim-chip span {
  width: 22px; height: 22px;
  background: var(--c-brand);
  color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Callout */
.callout {
  margin-top: 16px;
  display: flex; gap: 12px;
  padding: 14px 16px;
  background: var(--c-brand-soft);
  border: 1px solid #d5e1f2;
  border-left: 3px solid var(--c-brand);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--c-text);
  line-height: 1.55;
}
.callout i {
  color: var(--c-brand);
  font-size: 1rem;
  margin-top: 2px;
}
.callout code { background: rgba(255,255,255,0.6); color: var(--c-brand-dark); }

/* Equation block */
.eq {
  margin: 10px 0 0;
  padding: 12px 14px;
  background: #0e1626;
  color: #dbe5f5;
  border-radius: 10px;
  font-family: var(--f-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
}
.muted { color: var(--c-text-muted); font-size: 0.9rem; }

/* -------------------- Results tables -------------------- */
.rq-title {
  margin: 36px auto 16px;
  max-width: 1040px;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--c-text);
  border-left: 3px solid var(--c-brand);
  padding-left: 12px;
}
.table-wrap {
  max-width: 1040px; margin: 0 auto 16px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.result-table thead th {
  background: #eef1f7;
  color: var(--c-text);
  font-weight: 700;
  padding: 10px 10px;
  text-align: center;
  border-bottom: 1px solid var(--c-border-strong);
}
.result-table thead th:first-child { text-align: left; padding-left: 18px; }
.result-table tbody td {
  padding: 9px 10px;
  text-align: center;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
}
.result-table tbody td:first-child {
  text-align: left;
  padding-left: 18px;
  color: var(--c-text);
  font-weight: 500;
}
.result-table tbody tr:nth-child(odd) td { background: #fbfcfe; }
.result-table tbody tr.row-group td {
  background: #f1f4fa;
  color: var(--c-text-soft);
  font-style: italic;
  font-size: 0.82rem;
  padding: 7px 18px;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.result-table tbody tr.row-real td { background: #f4fbf7; color: var(--c-text-soft); font-style: italic; }
.result-table tbody tr.row-runnerup td {
  background: #fff7eb !important;
  font-weight: 600;
}
.result-table tbody tr.row-ours td {
  background: #e8eef8 !important;
  color: var(--c-brand-dark);
  font-weight: 700;
  border-top: 1.5px solid var(--c-brand);
  border-bottom: 1.5px solid var(--c-brand);
}
.result-table tbody tr.subhead td {
  background: #f1f4fa;
  text-align: left; padding-left: 18px;
  font-weight: 600;
  color: var(--c-text-soft);
}
.result-table.compact thead th,
.result-table.compact tbody td { padding: 8px 10px; font-size: 0.85rem; }

.pos { color: var(--c-success); font-weight: 700; }

.swr-stats { max-width: 520px; }

/* SWR gallery grid */
.swr-grid {
  max-width: 1040px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.swr-grid figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.swr-grid figure:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.swr-grid figure img { width: 100%; height: auto; }
.swr-grid figcaption {
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--c-text-soft);
  border-top: 1px solid var(--c-border);
  background: #fbfcfe;
}

/* -------------------- BibTeX -------------------- */
.bibtex-box {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  background: #0b1324;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 22px 22px 18px;
  color: #dbe5f5;
  font-family: var(--f-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  overflow-x: auto;
}
.bibtex-box pre {
  margin: 0;
  white-space: pre;
  color: #dbe5f5;
  font-family: var(--f-mono);
}
.copy-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.08);
  color: #eaf2ff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex; gap: 6px; align-items: center;
  transition: all .15s ease;
}
.copy-btn:hover { background: #fff; color: var(--c-brand-dark); border-color: #fff; }
.copy-btn.copied { background: var(--c-success); color: #fff; border-color: var(--c-success); }

/* -------------------- Footer -------------------- */
.footer {
  background: #080e1a;
  color: var(--c-text-invert-soft);
  padding: 32px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-note p { margin: 0 0 6px; font-size: 0.9rem; }
.footer-note .small { font-size: 0.78rem; opacity: 0.75; }
.footer-links a {
  color: #9cc3f0;
  font-size: 0.9rem;
  font-weight: 500;
}
.footer-links a:hover { color: #fff; }

/* -------------------- SWR Live animated comparison -------------------- */
.swr-live-lead {
  max-width: 640px;
  margin: 0 auto 14px;
  text-align: center;
  color: var(--c-text-soft);
  font-size: 0.92rem;
}
.swr-live {
  max-width: 1040px;
  margin: 0 auto 20px;
  /* Inner column width; video is 960x256 (3.75:1), so ~800px reads naturally */
  --swr-col: 800px;
}
.swr-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  margin: 0 auto 12px;
  max-width: var(--swr-col);
  font-size: 0.84rem;
  color: var(--c-text-soft);
}
.legend-item { display: inline-flex; align-items: center; gap: 10px; }
.legend-dot {
  width: 12px; height: 12px; border-radius: 3px;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(14,22,38,0.1);
}
.legend-gt  { background: #1e7e52; }
.legend-ar  { background: #c87032; }
.legend-swr { background: var(--c-brand); }

/* Dataset selector (RT-1 / BridgeData V2) — segmented pill above episode tabs */
.swr-dataset-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #eef1f7;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  margin: 0 auto 10px;
  width: fit-content;
}
.swr-dataset-tab {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 18px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  color: var(--c-text-soft);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: var(--f-sans);
  transition: all .18s ease;
}
.swr-dataset-tab:hover { color: var(--c-brand); }
.swr-dataset-tab i { color: var(--c-brand); font-size: 0.9rem; }
.swr-dataset-tab.active {
  background: #fff;
  color: var(--c-brand-dark);
  border-color: var(--c-brand);
  box-shadow: var(--shadow-sm);
}
.swr-dataset-tab.active i { color: var(--c-brand-dark); }

.swr-tabs {
  display: flex;
  gap: 8px;
  margin: 0 auto 12px;
  max-width: var(--swr-col);
  flex-wrap: wrap;
}
.swr-tab {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--c-border);
  background: #fff;
  border-radius: 9px;
  color: var(--c-text-soft);
  font-weight: 600;
  font-size: 0.86rem;
  transition: all .18s ease;
  position: relative;
}
.swr-tab:hover {
  color: var(--c-brand);
  border-color: var(--c-brand-light);
  transform: translateY(-1px);
}
.swr-tab.active {
  background: var(--c-brand-soft);
  color: var(--c-brand-dark);
  border-color: var(--c-brand);
  box-shadow: inset 0 0 0 1px var(--c-brand);
}
.swr-tab i { color: var(--c-brand); }
.swr-tab.active i { color: var(--c-brand-dark); }
.size-hint {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--c-text-muted);
  font-weight: 500;
}
.swr-tab.active .size-hint { color: var(--c-brand); }

.swr-viewer {
  position: relative;
  background: #0b1324;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-height: 180px;
  max-width: var(--swr-col);
  margin: 0 auto;
}
.swr-viewer img,
.swr-viewer video {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity .25s ease;
  background: #000;
}
.swr-viewer img.loading,
.swr-viewer video.loading { opacity: 0.25; }

/* Column labels overlay on the top edge (left→right: GT | AR | SWR) */
.swr-col-labels {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  display: flex;
  flex-direction: row;
  pointer-events: none;
  z-index: 2;
}
.swr-col-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  font-family: var(--f-sans);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 70%, transparent 100%);
  border-bottom: 2px solid transparent;
}
.swr-col-gt  { border-top: 3px solid #1e7e52; }
.swr-col-ar  { border-top: 3px solid #c87032; }
.swr-col-swr { border-top: 3px solid var(--c-brand); }

/* Loading overlay */
.swr-loading {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(11,19,36,0.7);
  color: #dbe5f5;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 3;
  backdrop-filter: blur(4px);
}
.swr-loading.show { display: flex; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #9cc3f0;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.swr-caption {
  margin: 12px auto 0;
  max-width: var(--swr-col);
  padding: 10px 14px;
  background: var(--c-brand-soft);
  border: 1px solid #d5e1f2;
  border-left: 3px solid var(--c-brand);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  color: var(--c-text);
  line-height: 1.5;
}
.swr-caption i { color: var(--c-brand); margin-right: 6px; }

@media (max-width: 720px) {
  .swr-col-labels { height: 22px; }
  .swr-col-label { font-size: 0.66rem; }
}

/* -------------------- Responsive -------------------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .two-col-asym, .two-col-asym.flip { grid-template-columns: 1fr; }
  .tldr-list { grid-template-columns: 1fr; }
  .swr-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 20px 48px; }
  .section { padding: 56px 0; }
}
@media (max-width: 520px) {
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .hero-buttons { gap: 8px; }
  .btn { padding: 8px 13px; font-size: 0.88rem; }
  .dim-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   Judge Live Demo
   ================================================================ */
#judge-demo .section-head { margin-bottom: 28px; }

/* Case tabs (A / B) */
.judge-case-tabs {
  max-width: 960px;
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.judge-case-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all .18s ease;
  font-family: var(--f-sans);
}
.judge-case-tab:hover {
  border-color: var(--c-brand-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.judge-case-tab.active {
  background: var(--c-brand-soft);
  border-color: var(--c-brand);
  box-shadow: inset 0 0 0 1px var(--c-brand);
}
.judge-case-tab i {
  font-size: 1.05rem;
  color: var(--c-brand);
  width: 24px;
  text-align: center;
}
.judge-case-tab span {
  font-weight: 700;
  color: var(--c-text);
  font-size: 0.95rem;
  flex-shrink: 0;
}
.judge-case-tab em {
  font-style: italic;
  color: var(--c-text-muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.judge-case-tab.active em { color: var(--c-text-soft); }

/* Instruction banner */
.judge-banner {
  max-width: 960px;
  margin: 0 auto 18px;
  background: #0b1324;
  color: #eaf2ff;
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
}
.judge-banner-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.judge-banner-label {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9cc3f0;
  background: rgba(156,195,240,0.12);
  padding: 4px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.judge-banner-text {
  color: #fff;
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1.4;
}

/* Three-column stage */
.judge-stage {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 0.9fr;
  gap: 16px;
  align-items: stretch;
}
.judge-input,
.judge-reasoning,
.judge-scores {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

/* LEFT column */
.judge-input-head,
.judge-video-head,
.judge-reason-title,
.judge-scores-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--c-text);
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}
.judge-input-head i,
.judge-video-head i,
.judge-reason-title i,
.judge-scores-head i { color: var(--c-brand); }
.judge-scores-head em {
  margin-left: auto;
  font-weight: 500;
  font-style: italic;
  color: var(--c-text-muted);
  font-size: 0.78rem;
}

.judge-initial {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.judge-initial img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.judge-model-switch {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.judge-model-btn {
  --accent: var(--c-brand);
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 10px;
  background: #fbfcfe;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--c-text-soft);
  transition: all .18s ease;
  font-family: var(--f-sans);
}
.judge-model-btn:hover { color: var(--c-text); }
.judge-model-btn.active {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.judge-model-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.judge-model-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.judge-video-box {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.judge-video-box video {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #000;
  display: block;
}
.judge-video-caption {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text-soft);
  text-align: center;
}

/* MIDDLE column — reasoning */
.judge-reason-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.judge-reason-controls { display: inline-flex; gap: 6px; }
.judge-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--c-brand-soft);
  color: var(--c-brand-dark);
  border: 1px solid #d5e1f2;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--f-sans);
}
.judge-btn:hover { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.judge-btn-ghost {
  background: #fbfcfe;
  color: var(--c-text-soft);
  border-color: var(--c-border);
}
.judge-btn-ghost:hover { background: #eef1f7; color: var(--c-text); border-color: var(--c-border-strong); }

.judge-reason-body {
  flex: 1;
  min-height: 420px;
  max-height: 560px;
  overflow-y: auto;
  background: #0b1324;
  border-radius: 10px;
  padding: 16px 18px;
  color: #dbe5f5;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.judge-reason-body::-webkit-scrollbar { width: 8px; }
.judge-reason-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }
.judge-reason-text {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 0.86rem;
  line-height: 1.65;
  color: #dbe5f5;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-weight: 400;
}
.judge-cursor {
  display: inline-block;
  color: #9cc3f0;
  font-weight: 700;
  margin-left: 2px;
  animation: judge-blink 1s steps(1) infinite;
  font-family: var(--f-mono);
}
.judge-cursor.hidden { display: none; }
@keyframes judge-blink { 50% { opacity: 0; } }

/* RIGHT column — scores */
.judge-dim-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.judge-dim {
  background: #fbfcfe;
  border: 1px solid var(--c-border);
  border-radius: 9px;
  padding: 9px 11px;
}
.judge-dim-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--c-text);
  margin-bottom: 6px;
}
.judge-dim-head i { color: var(--c-brand); width: 14px; text-align: center; font-size: 0.82rem; }
.judge-dim-name { font-weight: 600; flex: 1; }
.judge-dim-max { color: var(--c-text-muted); font-family: var(--f-mono); font-size: 0.75rem; }

.judge-dim-bar {
  background: #eef1f7;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 4px;
}
.judge-dim-fill {
  height: 100%;
  width: 0%;
  background: var(--c-brand);
  border-radius: 4px;
}
.judge-dim-val {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: 0.76rem;
}
.judge-dim-mean { color: var(--c-text); font-weight: 700; }
.judge-dim-std  { color: var(--c-text-muted); }

.judge-total {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--c-brand-soft);
  border: 2px solid var(--c-brand);
  border-radius: 10px;
  text-align: center;
  transition: border-color .3s ease;
}
.judge-total-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-brand-dark);
}
.judge-total-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-top: 4px;
}
.judge-total-value > span:first-child {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--c-brand-dark);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.judge-total-unit {
  font-size: 0.9rem;
  color: var(--c-text-muted);
  font-weight: 600;
}
.judge-total-std {
  margin-top: 4px;
  font-family: var(--f-mono);
  font-size: 0.76rem;
  color: var(--c-text-soft);
}

/* Note below */
.judge-note {
  max-width: 1120px;
  margin: 16px auto 0;
  font-size: 0.84rem;
  color: var(--c-text-soft);
  text-align: center;
  padding: 10px 14px;
}
.judge-note i { color: var(--c-brand); margin-right: 6px; }

/* Responsive */
@media (max-width: 1024px) {
  .judge-stage { grid-template-columns: 1fr 1fr; }
  .judge-scores { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .judge-stage { grid-template-columns: 1fr; gap: 12px; }
  .judge-case-tabs { grid-template-columns: 1fr; }
  .judge-case-tab em { white-space: normal; }
  .judge-reason-body { min-height: 300px; max-height: 420px; }
  .judge-model-btn { flex: 1 1 100%; }
}
