:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.07), 0 4px 10px rgba(0,0,0,.05);
  --max-w: 960px;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

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

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 24px 48px;
  background: linear-gradient(168deg, #f0f5ff 0%, #ffffff 60%);
}
.hero h1 {
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  max-width: 780px;
  margin: 0 auto 10px;
  letter-spacing: -.02em;
}
.hero .venue {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 14px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  border-radius: 20px;
}
.authors {
  margin-top: 22px;
  font-size: .97rem;
  color: var(--text-secondary);
  line-height: 1.8;
}
.authors a { color: var(--text); text-decoration: none; font-weight: 500; }
.authors a:hover { color: var(--primary); }
.affiliations {
  margin-top: 6px;
  font-size: .82rem;
  color: var(--text-secondary);
}
sup { font-size: .7em; margin-right: 1px; }

/* ── Links row ────────────────────────────────────────────── */
.link-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--bg);
  background: var(--text);
  border-radius: 8px;
  transition: background .2s, transform .15s;
}
.link-btn:hover { background: var(--primary); transform: translateY(-1px); }
.link-btn svg { width: 18px; height: 18px; fill: currentColor; }
.link-btn.outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.link-btn.outline:hover { border-color: var(--primary); color: var(--primary); }

/* ── Sections ─────────────────────────────────────────────── */
section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px;
}
section + section { padding-top: 0; }

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* ── TLDR ─────────────────────────────────────────────────── */
.tldr {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 0;
  text-align: center;
}
.tldr-box {
  display: inline-block;
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
  max-width: 780px;
  text-align: left;
}
.tldr-box strong { color: var(--primary); }

/* ── Abstract ─────────────────────────────────────────────── */
.abstract p {
  text-align: justify;
  hyphens: auto;
  color: #334155;
}

/* ── Video ────────────────────────────────────────────────── */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: .95rem;
  gap: 10px;
}
.video-placeholder svg { width: 48px; height: 48px; opacity: .35; }

/* ── Pipeline / figures ───────────────────────────────────── */
.figure-box {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.figure-box img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.figure-box .caption {
  margin-top: 12px;
  font-size: .85rem;
  color: var(--text-secondary);
  font-style: italic;
}
.placeholder-img {
  width: 100%;
  aspect-ratio: 16 / 7;
  background: linear-gradient(135deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: .9rem;
  font-weight: 500;
}

/* ── Demo gallery ─────────────────────────────────────────── */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.demo-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.demo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.demo-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: .85rem;
}
.demo-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.demo-card .info { padding: 14px 16px; }
.demo-card .info h4 { font-size: .95rem; margin-bottom: 4px; }
.demo-card .info p { font-size: .82rem; color: var(--text-secondary); }

/* ── BibTeX ───────────────────────────────────────────────── */
.bibtex-block {
  position: relative;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: .82rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}
.bibtex-block .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,.1);
  border: none;
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: .75rem;
  cursor: pointer;
  transition: background .2s;
}
.bibtex-block .copy-btn:hover { background: rgba(255,255,255,.2); }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 48px;
  text-align: center;
  font-size: .8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}
footer a { color: var(--primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Subsection description ────────────────────────────────── */
.subsection-desc {
  color: var(--text-secondary);
  font-size: .93rem;
  margin-bottom: 20px;
}

/* ── Tab group ────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  padding: 9px 20px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s, border-color .2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Object grid (3 cols) ─────────────────────────────────── */
.obj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.obj-card {
  text-align: center;
}
.obj-card .placeholder-img,
.obj-card .placeholder-gif,
.obj-card img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.obj-card img { width: 100%; height: auto; }
.obj-card model-viewer {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--bg-alt);
  --poster-color: transparent;
}
.obj-label {
  margin-top: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Aspect-ratio helpers ─────────────────────────────────── */
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-1-1  { aspect-ratio: 1 / 1; }

/* ── Combo selector (scene + object in one bar) ───────────── */
.combo-selector {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.combo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.combo-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  min-width: 48px;
}
.pill-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill {
  padding: 6px 16px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all .18s;
  text-align: left;
  line-height: 1.4;
}
.pill:hover { border-color: var(--primary-light); color: var(--primary); }
.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.combo-display { position: relative; }
.combo-panel { display: none; }
.combo-panel.active { display: block; }
.panel-video {
  width: 100%;
  border-radius: 6px;
  display: block;
}

/* Real-Robot: wrapper + portrait Real2Real “cup” clip rotated CCW 90° */
.robot-video-shell {
  width: 100%;
}

.robot-video-shell:not(.robot-video-shell--real2real-cup-ccw90) .panel-video {
  width: 100%;
  height: auto;
}

.robot-video-shell--real2real-cup-ccw90 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f172a;
  border-radius: 6px;
}

.robot-video-shell--real2real-cup-ccw90 .panel-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: auto;
  height: 100%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center center;
  border-radius: 0;
  max-width: none;
}

/* ── GIF placeholder ──────────────────────────────────────── */
.placeholder-gif {
  width: 100%;
  background: linear-gradient(135deg, #e0e7ef 25%, #eef2f7 50%, #e0e7ef 75%);
  background-size: 200% 100%;
  animation: shimmer 2.4s ease-in-out infinite;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  font-size: .88rem;
  font-weight: 500;
}
.placeholder-gif i { font-size: 1.6rem; opacity: .45; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Nested tabs (object selector inside scene) ───────────── */
.inpaint-heading {
  font-size: .95rem;
  font-weight: 600;
  margin: 22px 0 6px;
  color: var(--text);
}
.tab-group.nested { margin-top: 4px; }
.tab-bar-sm .tab-btn {
  padding: 6px 16px;
  font-size: .82rem;
}
.figure-box.compact { padding: 16px; }

/* ── Dual-video (sim + real side by side) ─────────────────── */
.dual-video {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dual-video-item h4 {
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 56px 16px 36px; }
  section { padding: 32px 16px; }
  .demo-grid { grid-template-columns: 1fr; }
  .obj-grid { grid-template-columns: 1fr; }
  .dual-video { grid-template-columns: 1fr; }
}
