:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5b6472;
  --accent: #c0392b;
  --accent-soft: #fde3df;
  --border: #e3e6eb;
  --card-bg: #fafbfc;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 96px 24px 80px;
}
@media (max-width: 640px) {
  main { padding-top: 48px; }
}

h1, h2, h3 { line-height: 1.25; }

/* ---------- Main figure ---------- */
.figure-section {
  margin-bottom: 32px;
}
.figure-section img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-bg);
}
.figure-caption {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Title ---------- */
.title-section {
  text-align: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.title-section h1 {
  margin: 0 0 16px 0;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.title-section .authors {
  color: var(--fg);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.45;
  margin: 0 0 6px;
}
.title-section .authors sup {
  font-size: 0.68em;
  font-weight: 600;
  margin-left: 1px;
  vertical-align: super;
}
.title-section .affiliations {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.35;
  margin: 0 0 10px;
}
.title-section .affiliations sup {
  color: var(--fg);
  font-size: 0.72em;
  font-weight: 600;
  margin-right: 4px;
  vertical-align: super;
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 10px;
}
.link-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.project-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--fg);
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.project-button:hover {
  background: #343434;
  border-color: #343434;
}
.project-button.disabled {
  border-color: var(--border);
  background: #eef0f3;
  color: var(--muted);
  cursor: not-allowed;
}
.link-note {
  color: var(--muted);
  font-size: 0.88rem;
}
.title-section .venue {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Abstract ---------- */
.abstract-section {
  max-width: 820px;
  margin: 0 auto 40px auto;
}
.abstract-section h2 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.25rem;
}
.abstract-section p {
  text-align: justify;
  color: var(--fg);
}

/* ---------- Demo ---------- */
.demo-section h2 {
  text-align: center;
  margin-bottom: 4px;
}
.demo-note {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 24px auto;
  max-width: 820px;
  font-size: 0.95rem;
}

.section-heading {
  margin: 32px 0 12px 0;
  padding-left: 6px;
  border-left: 4px solid var(--accent);
  font-size: 1.15rem;
  font-weight: 600;
}

/* one card per task */
.task-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 18px;
  margin-bottom: 22px;
  background: var(--card-bg);
}
.task-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.task-header .video-stem {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
}
.prompt-row { font-size: 0.95rem; }
.prompt-row .src-prompt {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}
.prompt-row .arrow { color: var(--muted); margin: 0 6px; }
.prompt-row .tgt-prompt {
  color: var(--accent);
  font-weight: 600;
}

/* grid layout: ours | 3 baselines */
.video-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px) {
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

.video-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.video-cell.ours {
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 6px;
  background: var(--accent-soft);
}
.video-cell .cell-label {
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
}
.video-cell.ours .cell-label { color: var(--accent); }
.video-cell video {
  width: 100%;
  height: auto;
  background: #000;
  border-radius: 6px;
}
.video-cell .missing {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #eee;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  text-align: center;
  padding: 8px;
}
