:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --hair: #eef2f7;
  --accent: #b45309;
  --accent-dark: #92400e;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

html { scroll-behavior: smooth; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
}

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(17, 24, 39, 0.25);
}

a:hover { border-bottom-color: rgba(17, 24, 39, 0.6); }

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

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 0;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  border-bottom: none;
}

.navlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.navlinks a {
  font-size: 15px;
  color: var(--muted);
  border-bottom: none;
}

.navlinks a:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero {
  padding: 44px 0 8px;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
}

.venue {
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0;
}

.title {
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.18;
  letter-spacing: -0.01em;
  font-weight: 800;
  margin: 10px 0 16px;
}

.authors p {
  margin: 8px 0;
  font-size: 17px;
  font-weight: 600;
}

.authors sup { font-weight: 500; }

.affiliations {
  color: #334155;
  font-size: 15.5px;
  font-weight: 500 !important;
}

.dot { margin: 0 8px; color: var(--line); }

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 20px 0 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
  box-shadow: 0 6px 14px rgba(180, 83, 9, 0.2);
}

.btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-disabled {
  background: #ffffff;
  color: var(--muted);
  border: 1px dashed var(--line);
  box-shadow: none;
  cursor: default;
}

.btn-disabled:hover {
  background: #ffffff;
  border-color: var(--line);
  transform: none;
}

.tagline {
  color: #1f2937;
  font-size: 17px;
  font-style: italic;
  max-width: 780px;
  margin: 18px auto 0;
}

/* ---------- sections ---------- */

.section {
  padding: 32px 0;
  border-top: 1px solid var(--hair);
  max-width: 920px;
  margin: 0 auto;
}

.section.wide { max-width: 1200px; }

.section.flush {
  border-top: none;
  padding-top: 8px;
}

.section h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: -0.01em;
  text-align: center;
}

.section h3 {
  margin: 30px 0 4px;
  font-size: 17px;
  text-align: center;
}

.section > p {
  color: #1f2937;
  font-size: 16px;
  text-align: justify;
  text-justify: inter-word;
}

.section-subtitle {
  margin: 0 auto 4px;
  max-width: 760px;
  font-size: 14.5px;
  color: var(--muted);
  text-align: center !important;
}

.prompt {
  margin: 0 auto;
  font-size: 14.5px;
  color: var(--muted);
  text-align: center !important;
}

.prompt em { color: #1f2937; font-style: italic; }

/* ---------- figures ---------- */

.figure {
  margin: 20px auto 0;
  padding: 0;
  border-radius: 16px;
  border: 1px solid var(--hair);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  width: 100%;
  background: #ffffff;
}

.figure img {
  width: 100%;
  height: auto;
  display: block;
}

.figure figcaption {
  margin: 0;
  padding: 12px 18px 14px;
  color: var(--muted);
  font-size: 14px;
  background: #ffffff;
  border-top: 1px solid var(--hair);
}

/* ---------- main video ---------- */

.video {
  width: 100%;
  max-width: 920px;
  margin: 20px auto 0;
  border: 1px solid var(--hair);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}

.video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
}

/* ---------- steps ---------- */

.steps {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--muted);
}

.step-title { font-weight: 700; }
.step-text { color: var(--muted); font-size: 15px; }

/* A figure that illustrates the step card directly above it: sits close to that
   card, with a wider gap before the next one, and kept smaller than the
   full-width framework figure so it reads as subordinate to the step. */
.step-figure {
  margin: 0 auto 10px;
  max-width: 560px;
}

/* ---------- result grids ---------- */

.grid {
  margin-top: 14px;
  display: grid;
  gap: 14px;
  align-items: start;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 760px; margin-left: auto; margin-right: auto; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.tile-label {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.3;
  color: #0f172a;
  font-weight: 600;
  text-align: center;
  /* Fixed so the clips of one row line up even when a label wraps. */
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.tile-label .kind {
  font-weight: 500;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.clip {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: zoom-in;
}

.tile.is-ref .clip { border-color: #fcd9a4; background: #fffdf8; }
.tile.is-ours .clip { border-color: #b45309; box-shadow: 0 0 0 1px #b45309; }
.tile.is-ours .tile-label { color: var(--accent-dark); }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(15, 23, 42, 0.82);
  padding: 24px;
}

.lightbox[open] { display: grid; }

.lightbox video {
  width: min(92vw, 1000px);
  max-height: 86vh;
  background: #ffffff;
  border-radius: 12px;
}

.lightbox-caption {
  color: #ffffff;
  font-size: 15px;
  text-align: center;
  margin-top: 12px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- bibtex, footer ---------- */

.bibtex {
  background: #0b1020;
  color: #e5e7eb;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  margin: 12px 0 0;
}

.footer {
  border-top: 1px solid var(--hair);
  padding: 20px 0 8px;
  color: var(--muted);
  font-size: 14px;
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

.footer p { margin: 0; }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .navlinks { display: none; }
  .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .section > p { text-align: left; }
  .tile-label { height: auto; min-height: 54px; }
}
