:root {
  --bg: #ffffff;
  --surface: #fbfcfe;
  --surface-alt: #f4f6fa;
  --ink: #1b2230;
  --ink-muted: #526075;
  --border: #e3e8f0;
  --border-strong: #c8d2e1;
  --accent: #0f3d68;
  --accent-2: #0d9488;
  --wearer: #10b981;
  --other: #ef4444;
  --exo: #0284c7;
  --ego: #d97706;
  --ours-light: #f0f9ff;
  --ours-strong: #e0f2fe;
  --radius: 10px;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.10);
  --font-sans: "Google Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

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

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

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1240px;
}

/* ---- Hero ---- */
.hero {
  padding: 56px 0 28px;
  text-align: center;
}

.pub-title {
  margin: 0 auto 18px;
  max-width: 960px;
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.pub-title .brand {
  font-family: var(--font-serif);
  background: linear-gradient(135deg, #0b2d56 0%, #0d7a7b 55%, #d97706 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pub-authors {
  margin: 0 auto 8px;
  max-width: 900px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
}

.pub-authors .author {
  display: inline-block;
  margin: 0 5px;
  font-weight: 500;
}

.pub-authors sup,
.pub-affils sup {
  font-size: 0.72em;
  color: var(--ink-muted);
  margin-left: 1px;
}

.pub-affils {
  margin: 0 auto 6px;
  max-width: 920px;
  font-size: 14.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}

.pub-affils span {
  display: inline-block;
  margin: 0 7px;
}

.pub-notes {
  margin: 4px 0 22px;
  font-size: 13px;
  color: var(--ink-muted);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #232833;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}

.pill-btn:hover {
  background: #0f3d68;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 61, 104, 0.22);
}

.pill-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

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

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

.section-title {
  margin: 0 0 18px;
  text-align: center;
  font-size: clamp(22px, 2.4vw, 29px);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.section-sub {
  margin: -8px auto 22px;
  max-width: 780px;
  text-align: center;
  font-size: 15px;
  color: var(--ink-muted);
}

/* ---- Demo Teaser (VGGT-Omega inspired) ---- */
.teaser-section {
  padding-top: 16px;
  padding-bottom: 32px;
}

.teaser-stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0e1117;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.teaser-stage video {
  width: 100%;
  aspect-ratio: 2 / 1;
  display: block;
  object-fit: contain;
  background: #0e1117;
}

.teaser-caption-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: #131822;
  border-top: 1px solid #242d3d;
  color: #dbe4f0;
  font-size: 13.5px;
}

.teaser-caption-bar .tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ---- Thumbnail dock (VGGT-Omega style) ---- */
.thumb-dock {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 16px 20px;
  border: 1px solid rgba(24, 29, 35, 0.09);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 26px rgba(20, 24, 30, 0.09);
}

.thumb-btn {
  position: relative;
  width: 148px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1.5px solid rgba(24, 29, 35, 0.14);
  border-radius: 8px;
  background: #0e1117;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(20, 24, 30, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: brightness(0.84) saturate(0.92);
  transition: filter 0.18s ease, transform 0.18s ease;
}

.thumb-btn .thumb-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 7px 5px;
  background: linear-gradient(180deg, rgba(10, 14, 22, 0), rgba(10, 14, 22, 0.86));
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  line-height: 1.2;
  pointer-events: none;
}

.thumb-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 26px;
  height: 2.5px;
  border-radius: 999px;
  background: #34d399;
  transform: translateX(-50%) scaleX(0);
  transition: transform 0.18s ease;
}

.thumb-btn:hover,
.thumb-btn.active {
  border-color: #0f3d68;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(15, 61, 104, 0.25), 0 10px 22px rgba(20, 24, 30, 0.18);
  transform: translateY(-3px) scale(1.08);
  z-index: 3;
}

.thumb-btn:hover img,
.thumb-btn.active img {
  filter: brightness(1.02) saturate(1.06);
}

.thumb-btn.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ---- Abstract ---- */
.abstract-body {
  max-width: 860px;
  margin: 0 auto;
  text-align: justify;
  font-size: 16px;
  color: #262f3d;
}

.abstract-body p {
  margin: 0 0 14px;
}

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

/* ---- Key Takeaways (VGGT-Omega 2x2) ---- */
.takeaways-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.takeaway-card {
  padding: 22px 24px;
  border: 1px solid #e5ebf3;
  border-radius: var(--radius);
  background: #fbfcfe;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.035);
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.takeaway-card:hover {
  border-color: #b7c9e0;
  background: #f2f7fd;
  box-shadow: 0 10px 26px rgba(15, 61, 104, 0.10);
  transform: translateY(-2px);
}

.takeaway-card h3 {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--accent);
}

.takeaway-card p {
  margin: 0;
  font-size: 14.5px;
  color: #2f3a4b;
  line-height: 1.55;
}

/* ---- Interactive 3D Demo ---- */
.i3d-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: #0e121a;
  border: 1px solid #242e40;
  box-shadow: var(--shadow-md);
  color: #e6edf7;
}

.i3d-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.i3d-card {
  border-radius: 9px;
  background: #151b26;
  border: 1px solid #273247;
  overflow: hidden;
}

.i3d-card-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #232d40;
}

.i3d-card-hdr.exo { color: #38bdf8; }
.i3d-card-hdr.ego { color: #fbbf24; }
.i3d-card-hdr.readout { color: #94a3b8; }

.i3d-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #0c0f15;
}

.i3d-readout-list {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.i3d-row {
  display: grid;
  grid-template-columns: 34px 1fr 82px;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.i3d-row .cid {
  font-weight: 700;
}

.i3d-row.wearer .cid,
.i3d-row.wearer .val {
  color: #34d399;
}

.i3d-row.other .cid {
  color: #f87171;
}

.i3d-row.other .val {
  color: #94a3b8;
}

.i3d-bar-track {
  height: 8px;
  border-radius: 4px;
  background: #222b3c;
  overflow: hidden;
}

.i3d-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.i3d-row.wearer .i3d-bar-fill {
  background: #34d399;
}

.i3d-row.other .i3d-bar-fill {
  background: #c85a62;
}

.i3d-stage-wrap {
  position: relative;
  min-height: 520px;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #182132 0%, #0d1118 100%);
  border: 1px solid #273247;
}

#i3dCanvasHost {
  position: absolute;
  inset: 0;
  cursor: grab;
}

#i3dCanvasHost:active {
  cursor: grabbing;
}

.i3d-labels-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.i3d-pin {
  position: absolute;
  transform: translate(10px, -50%);
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(12, 16, 24, 0.86);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid currentColor;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.i3d-pin.exo { color: #38bdf8; }
.i3d-pin.ego { color: #fbbf24; }
.i3d-pin.wearer { color: #34d399; }
.i3d-pin.other { color: #f87171; font-size: 10.5px; padding: 1px 6px; }

.i3d-top-hud {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.i3d-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(12, 16, 24, 0.82);
  border: 1px solid #2e3b52;
  font-size: 12px;
  color: #e2e8f0;
  backdrop-filter: blur(6px);
}

.i3d-legend {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.i3d-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #cbd5e1;
}

.i3d-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.i3d-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 16, 24, 0.65);
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.i3d-status.hidden {
  opacity: 0;
}

.i3d-controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(12, 16, 24, 0.86);
  border: 1px solid #2e3b52;
  backdrop-filter: blur(8px);
}

.i3d-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1b2434;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.i3d-toggle.on {
  background: #1d3654;
  border-color: #38bdf8;
  color: #f8fafc;
}

.i3d-toggle.on-red {
  background: rgba(239, 68, 68, 0.22);
  border-color: #f87171;
  color: #fecaca;
}

.i3d-toggle.on-green {
  background: rgba(16, 185, 129, 0.22);
  border-color: #34d399;
  color: #d1fae5;
}

.i3d-slider-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 11.5px;
  color: #94a3b8;
}

.i3d-slider-wrap input[type="range"] {
  width: 72px;
  accent-color: #38bdf8;
}

.i3d-hint {
  margin-top: 8px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* ---- Method Diagram ---- */
.method-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.method-svg {
  width: 100%;
  height: auto;
  display: block;
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.method-step {
  padding: 16px 18px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.method-step .step-num {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e6f0fa;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}

.method-step h4 {
  margin: 0 0 5px;
  font-size: 15.5px;
  color: var(--ink);
}

.method-step p {
  margin: 0;
  font-size: 13.8px;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ---- Benchmark Tables ---- */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-btn {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

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

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

table.bench {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.bench th,
table.bench td {
  padding: 9px 11px;
  text-align: center;
  border-bottom: 1px solid #edf1f7;
  white-space: nowrap;
}

table.bench th {
  background: #f6f8fc;
  color: #334155;
  font-weight: 700;
  font-size: 12.5px;
}

table.bench td.lalign,
table.bench th.lalign {
  text-align: left;
  padding-left: 14px;
}

table.bench tr.group-row td {
  background: #f9fafd;
  color: var(--ink-muted);
  font-style: italic;
  font-size: 12.5px;
  text-align: left;
  padding: 6px 14px;
}

table.bench tr.ours-zs td {
  background: var(--ours-light);
}

table.bench tr.ours-full td {
  background: var(--ours-strong);
  font-weight: 600;
}

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

.table-note {
  margin: 10px 2px 0;
  font-size: 12.8px;
  color: var(--ink-muted);
}

/* ---- FindEgo-1M Levels ---- */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.level-card {
  padding: 16px 18px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.lvl-0 { background: #e0f2fe; color: #0369a1; }
.lvl-1 { background: #dcfce7; color: #15803d; }
.lvl-2 { background: #fef3c7; color: #b45309; }
.lvl-3 { background: #fee2e2; color: #b91c1c; }

.level-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.level-card p {
  margin: 0;
  font-size: 13.2px;
  color: var(--ink-muted);
  line-height: 1.5;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-box {
  padding: 16px;
  text-align: center;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
}

.stat-num {
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.stat-lbl {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---- Citation ---- */
.bib-wrap {
  position: relative;
}

.bib-wrap pre {
  margin: 0;
  padding: 18px 20px;
  border-radius: 10px;
  background: #141923;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  background: #334155;
}

/* ---- Footer ---- */
footer {
  padding: 28px 0 42px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 960px) {
  .i3d-shell {
    grid-template-columns: 1fr;
  }
  .i3d-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .i3d-card.readout-card {
    grid-column: 1 / -1;
  }
  .i3d-stage-wrap {
    min-height: 440px;
  }
  .levels-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .method-steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .takeaways-grid,
  .stats-strip,
  .levels-grid,
  .i3d-sidebar {
    grid-template-columns: 1fr;
  }
  .thumb-btn {
    width: 122px;
  }
}
