/* ===================== Base ===================== */
:root {
  --accent: #57068c;        /* NYU violet */
  --accent-soft: #f3eafa;
  --ink: #1f2430;
  --muted: #5b6573;
  --line: #e7e9ee;
  --bg: #ffffff;
  --bg-soft: #fafbfc;
  --radius: 14px;
  --maxw: 920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img, video { max-width: 100%; height: auto; display: block; }

/* ===================== Hero ===================== */
.hero {
  text-align: center;
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--accent-soft) 0%, #ffffff 100%);
}

.title {
  font-size: clamp(1.45rem, 3.2vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 auto 28px;
  max-width: 22em;
  color: var(--ink);
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.author sup { color: var(--accent); font-weight: 700; }

.affiliations {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}
.affiliations sup { color: var(--accent); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(87, 6, 140, 0.25);
}
.btn-icon { font-size: 1.05rem; }

/* ===================== Sections ===================== */
.section { padding: 52px 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: none; }

h2 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0 0 28px;
  position: relative;
}
h2::after {
  content: "";
  display: block;
  width: 54px; height: 3px;
  background: var(--accent);
  border-radius: 3px;
  margin: 12px auto 0;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 8px 0 14px;
  color: var(--ink);
}

h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 10px;
  text-align: center;
  color: var(--accent);
}

p { margin: 0 0 16px; }

.abstract {
  font-size: 1.02rem;
  color: #34404f;
  text-align: justify;
}

.section-lead {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
  color: var(--muted);
}

/* ===================== Figures ===================== */
.figure { margin: 0 0 18px; }
.figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.figure.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.figure figcaption,
.table-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
  line-height: 1.5;
}
.figure figcaption b { color: var(--ink); }

.method-block { margin-bottom: 40px; }
.method-block:last-child { margin-bottom: 0; }

/* ===================== Task list ===================== */
.task-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 12px;
}
.task-list li {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.96rem;
}
.task-list b { color: var(--accent); }

/* ===================== Tabs + videos ===================== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}
.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 9px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
}
.video-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0e1118;
  box-shadow: 0 4px 18px rgba(20,20,40,0.06);
}
.video-card video { width: 100%; display: block; }
.panel-labels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #161a24;
  color: #cfd4e0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.panel-labels span {
  text-align: center;
  padding: 7px 0;
}
.panel-labels span:nth-child(2) { color: #c79bff; }
.panel-labels span:not(:last-child) { border-right: 1px solid #262c3a; }

/* ===================== Rollouts ===================== */
.rollout-grid { display: grid; gap: 26px; }
.rollout-card { margin: 0 auto; width: 75%; max-width: 75%; }
.rollout-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.rollout-pair > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.rollout-pair img { width: 100%; }
.tag {
  display: block;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 0;
}
.rollout-pair > div:nth-child(1) .tag { background: #475569; }

/* ===================== Tables ===================== */
.table-wrap { overflow-x: auto; margin-bottom: 34px; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 560px;
}
thead th {
  background: var(--bg-soft);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  text-align: center;
  color: var(--ink);
}
th.left, td.left { text-align: left; }
tbody td {
  padding: 9px 12px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  color: #36404e;
}
tbody tr:hover { background: #fcfaff; }
tbody td.best {
  background: var(--accent-soft);
  font-weight: 700;
  color: var(--accent);
}
tbody tr.ours td { font-weight: 600; }
tbody tr.ours td.left { color: var(--accent); }

/* ===================== OCE grid ===================== */
.oce-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.oce-grid .figure { margin: 0; }
.oce-grid figcaption { font-weight: 600; color: var(--ink); }

/* ===================== Footer ===================== */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--bg-soft);
}

/* ===================== Side-by-side (CDiT) ===================== */
.side-by-side {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: center;
}
.side-by-side .side-figure { margin: 0; }
.side-by-side .side-text { margin: 0; }

/* ===================== Algorithm / code blocks ===================== */
.algo-caption {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  max-width: 760px;
  margin: 0 auto 16px;
}
.algo, .bibtex {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #334155;
  margin: 0 0 26px;
  white-space: pre;
  tab-size: 4;
}
.algo .k { color: #0576bc; font-weight: 600; }   /* keywords */
.algo .fn { color: #c026d3; font-weight: 600; }  /* function name */
.algo .b { color: #9333ea; }                     /* builtins */
.algo .c { color: #64748b; font-style: italic; } /* comments */
.algo .n { color: #ea580c; }                     /* numbers */

.bibtex { margin-bottom: 0; }
.citation-section { background: var(--bg-soft); }

/* ===================== Responsive ===================== */
@media (max-width: 720px) {
  .video-grid,
  .rollout-pair,
  .side-by-side,
  .oce-grid { grid-template-columns: 1fr; }
  .rollout-card { width: 100%; max-width: 100%; }
  .hero { padding: 52px 0 32px; }
  .section { padding: 40px 0; }
  .abstract { text-align: left; }
}
