:root {
  --accent: #1a3a5c;
  --accent-mid: #2c5282;
  --accent-light: #edf2f7;
  --green: #2f855a;
  --red: #c53030;
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-tertiary: #a0aec0;
  --border: #e2e8f0;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--white);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── Hero ───────────────────────────────────────── */

.hero {
  max-width: 880px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
  text-align: center;
}

.paper-title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}

.venue-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.75rem;
}

.authors {
  font-size: 1.15rem;
  line-height: 2;
}

.authors a {
  color: var(--accent-mid);
  text-decoration: none;
  font-weight: 500;
}

.authors a:hover { text-decoration: underline; }

.authors sup {
  font-size: 0.6em;
  color: var(--text-tertiary);
  margin-left: 1px;
}

.affiliations {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 0.25rem;
}

.equal-note {
  display: block;
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-top: 0.35rem;
}

.link-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  background: var(--white);
}

.link-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 12px rgba(26, 58, 92, 0.08);
}

.link-btn i { font-size: 1.05em; }

/* ── Divider ────────────────────────────────────── */

.divider {
  max-width: 880px;
  margin: 0 auto;
  border: none;
  border-top: 1px solid var(--border);
}

.divider-wide {
  max-width: 1060px;
  margin: 0 auto;
  border: none;
  border-top: 1px solid var(--border);
}

/* ── Sections ───────────────────────────────────── */

.section {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section-wide {
  max-width: 1060px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section-label {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ── Teaser ─────────────────────────────────────── */

.teaser {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

.teaser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.teaser-visual img {
  width: 90%;
  display: block;
  margin: 0 auto;
}

.teaser-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 1.5rem;
}

.teaser-content p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 2rem;
}

.stat-row {
  display: flex;
  gap: 2rem;
}

.stat-item { flex: 1; }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.3rem;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ── Video ──────────────────────────────────────── */

.video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.07);
}

.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ── Abstract ───────────────────────────────────── */

.abstract-body {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text-secondary);
  text-align: justify;
  hyphens: auto;
}

.abstract-body strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Method ─────────────────────────────────────── */

.method-intro {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.method-intro strong {
  color: var(--text);
  font-weight: 600;
}

.figure-block {
  margin: 2.5rem 0;
  text-align: center;
}

.figure-block img {
  width: 100%;
  display: block;
  border-radius: 6px;
}

.fig-caption {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
  line-height: 1.5;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Results ────────────────────────────────────── */

.results-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.result-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.result-hero img {
  max-width: 780px;
  width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

.results-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.results-grid-2 img {
  width: 100%;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.results-grid-2 .fig-caption { text-align: center; }

/* ── Robotarium Slider ──────────────────────────── */

.slider-intro {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.compare-container {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: ew-resize;
  user-select: none;
  -webkit-user-select: none;
}

.compare-container img {
  display: block;
  width: 100%;
  pointer-events: none;
}

.compare-overlay {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
}

.compare-overlay img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left;
}

.compare-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: var(--white);
  box-shadow: 0 0 8px rgba(0,0,0,0.25);
  transform: translateX(-50%);
  z-index: 10;
  will-change: left;
}

.compare-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.compare-handle::before {
  content: '\25C0\2009\25B6';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  color: var(--text-secondary);
  z-index: 11;
  line-height: 1;
  letter-spacing: 2px;
}

.compare-overlay {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  will-change: width;
}

.compare-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.compare-label {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
}

.compare-label.success {
  color: var(--green);
  background: #f0fff4;
}

.compare-label.fail {
  color: var(--red);
  background: #fff5f5;
}

/* ── BibTeX ─────────────────────────────────────── */

.bib-block {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
}

.bib-pre {
  background: #1a202c;
  color: #e2e8f0;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  padding: 1.75rem 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #e2e8f0;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-btn:hover { background: rgba(255,255,255,0.15); }

.copy-btn.copied {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* ── Footer ─────────────────────────────────────── */

.site-footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1.7;
}

.site-footer a {
  color: var(--accent-mid);
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────── */

@media (max-width: 860px) {
  .paper-title { font-size: 2rem; }

  .teaser-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .teaser-visual { order: -1; }

  .stat-row { gap: 1.25rem; }
  .stat-value { font-size: 1.5rem; }

  .results-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .paper-title { font-size: 1.6rem; }
  .hero { padding: 2.5rem 1.25rem 1.5rem; }

  .section, .section-wide, .teaser {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .stat-row { flex-direction: column; gap: 1rem; }

  .link-row {
    flex-direction: column;
    align-items: center;
  }
}
