:root {
  --content-max: 56rem;
  --wide-max: 88rem;
  --bg: #ffffff;
  --fg: #18181b;
  --muted: #52525b;
  --muted-2: #71717a;
  --tick: #a1a1aa;
  --border: #e4e4e7;
  --link: #2563eb;
  --btn-bg: #27272a;
  --btn-fg: #ffffff;
  --btn-bg-hover: #000000;
  --thumb: #18181b;
  --track: #e4e4e7;
  --badge-bg: #f4f4f5;
  --badge-fg: #3f3f46;
  --axis-static: #475569;
  --axis-dynamic: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --fg: #f4f4f5;
    --muted: #a1a1aa;
    --muted-2: #71717a;
    --tick: #71717a;
    --border: #27272a;
    --link: #93c5fd;
    --btn-bg: #e4e4e7;
    --btn-fg: #18181b;
    --btn-bg-hover: #fafafa;
    --thumb: #ffffff;
    --track: #3f3f46;
    --badge-bg: #1c1c1f;
    --badge-fg: #d4d4d8;
    --axis-static: #94a3b8;
    --axis-dynamic: #f87171;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  padding: 4rem 1rem 3rem;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; }
h2 {
  font-size: 1.75rem;
  margin-top: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
h3.group-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.page-header {
  max-width: var(--content-max);
  margin: 0 auto 3rem;
  text-align: center;
  padding: 0 0.5rem;
}
.title {
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 600;
  margin: 0 0 1.5rem;
}
.authors {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1rem 2rem; margin-bottom: 0.5rem;
}
.author-name { font-size: 1.05rem; font-weight: 500; }
.author-name sup { font-size: 0.7em; font-weight: 500; margin-left: 0.05em; }
.author-aff { font-size: 0.95rem; color: var(--muted); }
.affiliations {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.5rem 1.5rem;
  font-size: 1rem; color: var(--muted);
  margin-top: 0.75rem;
}
.affiliations sup { font-size: 0.7em; margin-right: 0.1em; }
.author-notes {
  font-size: 0.85rem; color: var(--muted-2);
  margin-top: 0.4rem;
}
.author-notes sup { font-size: 0.85em; margin-right: 0.1em; }
.conference { margin: 0.5rem 0; color: var(--muted); }
.anon-note { font-size: 0.85rem; color: var(--muted-2); margin: 0.5rem 0 1.5rem; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin-top: 0.5rem; }
.link-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--btn-bg); color: var(--btn-fg);
  padding: 0.55rem 1.1rem; border-radius: 9999px; font-size: 1rem;
  text-decoration: none; transition: background 0.15s;
}
.link-btn:hover { background: var(--btn-bg-hover); text-decoration: none; }
.link-btn .icon { display: inline-flex; font-size: 1.1em; line-height: 1; }

.content { max-width: var(--content-max); margin: 0 auto; }
.wide { max-width: var(--wide-max); margin: 0 auto 1.5rem; }

#teaser-section { margin-bottom: 3rem; }

.teaser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .teaser-grid { grid-template-columns: 1fr; }
}

.teaser-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--badge-bg);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1rem 1rem 0.75rem;
}
.teaser-a-body, .teaser-b-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.panel-caption {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  margin-top: 0.5rem;
}

.teaser-dyn-block { display: flex; flex-direction: column; gap: 0.35rem; }
.teaser-dyn-block + .teaser-dyn-block { margin-top: 0.9rem; }
.teaser-dyn-rows { display: flex; flex-direction: column; gap: 0.25rem; }

.teaser-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  align-items: stretch;
  gap: 0.45rem;
}

.row-label {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
  line-height: 1.1;
}
.row-label-vertical span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.row-label-ours { color: var(--fg); }
.row-label-ours span { font-weight: 700; }

.teaser-prompt {
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  margin-top: 0.4rem;
}

.teaser-cont-inner {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.45rem;
  align-items: stretch;
}
.teaser-cont-rows { display: flex; flex-direction: column; gap: 0.25rem; }

.teaser-axis {
  display: flex; flex-direction: column; align-items: center;
  justify-content: space-between;
  padding: 0.1rem 0;
}
.axis-end {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
}
.axis-static { color: var(--axis-static); }
.axis-dynamic { color: var(--axis-dynamic); }
.axis-text {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
}
.axis-text span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}
.axis-arrow {
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
.axis-arrow-up   { border-bottom: 7px solid var(--axis-static);  }
.axis-arrow-down { border-top:    7px solid var(--axis-dynamic); }
.axis-bar {
  flex: 1;
  width: 3px;
  margin: 0.25rem 0;
  border-radius: 9999px;
  background: linear-gradient(to bottom, var(--axis-static), var(--axis-dynamic));
}

.grid { display: grid; gap: 0.75rem; width: 100%; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .grid-3 { grid-template-columns: 1fr; } }

.video-cell {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 0.4rem;
  overflow: hidden;
}
.video-cell video {
  width: 100%; height: 100%; display: block; object-fit: cover;
}

.cell-label {
  margin-top: 0.35rem; text-align: center;
  font-size: 0.85rem; font-weight: 500; color: var(--muted);
}

.method-compare { margin: 1.5rem 0 2rem; padding: 0; }
.method-compare figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cap-line { line-height: 1.5; }
.cap-title {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.95rem;
}
.cap-prompt { color: var(--muted); }
.prompt-label { font-weight: 600; color: var(--fg); }
.prompt-text { font-style: italic; }

.meta-badges {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-items: center;
}
.badge {
  display: inline-block;
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.video-slider {
  margin: 1.25rem 0 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.video-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 0.5rem;
  overflow: hidden;
}
.video-stack video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; display: block; object-fit: cover;
}
.video-stack video.hidden { display: none; }

.slider-caption {
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.9rem; color: var(--muted);
}

.slider-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.9rem; font-weight: 500; color: var(--muted);
  margin-top: 0.25rem;
}
.slider-header .value-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem; color: var(--muted-2);
}

.slider-row { display: flex; align-items: center; gap: 1.75rem; }
.end-label { flex: 0 0 auto; font-size: 0.8rem; color: var(--muted); }

.slider-track-wrapper {
  --thumb-size: 16px;
  position: relative; flex: 1 1 auto; width: 100%;
}
.slider-input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px;
  background: var(--track); border-radius: 9999px;
  outline: none; cursor: pointer; margin: 0; display: block;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: var(--thumb-size); height: var(--thumb-size);
  border-radius: 9999px; background: var(--thumb); border: none; cursor: pointer;
}
.slider-input::-moz-range-thumb {
  width: var(--thumb-size); height: var(--thumb-size);
  border-radius: 9999px; background: var(--thumb); border: none; cursor: pointer;
}

.tick-row { position: relative; width: 100%; height: 1rem; margin-top: 0.25rem; }
.tick {
  position: absolute; top: 0; transform: translateX(-50%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem; color: var(--tick); white-space: nowrap;
}
