:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --line: #e5e7eb;
  --page: #f7f7f5;
  --panel: #fff;
  --accent: #5946f2;
  --accent-soft: #ede9ff;
  --accent-mid: #c4b5fd;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.5 "Helvetica Neue", Arial, sans-serif;
}

main {
  width: 100%;
  padding: 34px 0 0;
}

.hero {
  text-align: center;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 44px;
}

.lab {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 13px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.1;
  letter-spacing: 0;
  font-weight: 400;
}

.brand-gradient,
h1 span {
  background: linear-gradient(90deg, #312e81 0%, var(--accent) 48%, var(--accent-mid) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant: small-caps;
  font-weight: 400;
}

.authors {
  margin: 28px 0 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 400;
}

.lead-author {
  background: linear-gradient(90deg, #312e81 0%, var(--accent) 48%, var(--accent-mid) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.affiliations {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  margin-top: 22px;
}

.hero-logos img {
  display: block;
  width: auto;
  height: 42px;
  object-fit: contain;
}

.hero-logos img[alt="Hyundai Motor"] {
  height: 50px;
}

.hero-figure {
  width: min(100%, 1080px);
  margin: 34px auto 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  aspect-ratio: auto;
}

.hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.hero-figure figcaption {
  position: static;
  max-width: 920px;
  margin: 14px auto 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.controls button {
  border: 1px solid var(--accent-mid);
  background: var(--accent-soft);
  color: #312e81;
  border-radius: 999px;
  padding: 9px 14px;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.paper-section,
.comparison {
  --section-bg: var(--page);
  border-top: 1px solid var(--line);
  padding: 48px max(16px, calc((100% - 1180px) / 2)) 44px;
  background: var(--section-bg);
}

.paper-section {
  margin: 0;
}

#main-result {
  --section-bg: #fff;
}

.comparison {
  --section-bg: var(--page);
}

.internal-comparison {
  --section-bg: #fff;
}

.nondriving-comparison {
  --section-bg: var(--page);
}

.novel-comparison {
  --section-bg: var(--page);
}

.additional-results {
  --section-bg: #fff;
}

.paper-section h2,
.comparison h2 {
  margin: 0 0 30px;
  text-align: center;
  font-size: clamp(26px, 3vw, 34px);
  font-family: inherit;
  font-weight: 400;
  color: #4b5563;
}

.comparison h3 {
  margin: -12px 0 24px;
  text-align: center;
  color: #4b5563;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 400;
}

#additional-results h3:not(:first-of-type) {
  margin-top: 54px;
}

#comparison-nondriving {
  margin-top: 72px;
}

.paper-section h2::after,
.comparison h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: var(--accent);
}

.viewer {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0 auto;
}

.motivation-copy {
  max-width: 920px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.motivation-copy p {
  margin: 0 0 16px;
}

.motivation-copy a {
  color: var(--accent);
}

.motivation-copy strong {
  color: var(--ink);
}

.motivation-grid {
  display: grid;
  gap: 14px;
}

.motivation-grid figure {
  position: relative;
  aspect-ratio: 16 / 9;
}

.motivation-strip figure {
  width: min(100%, 960px);
  margin: 0 auto;
  aspect-ratio: 960 / 544;
}

.motivation-grid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #020617;
}

.cell-captions {
  position: absolute;
  inset: 10px 10px auto;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.cell-captions.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.cell-captions.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cell-captions.cols-2x2 {
  inset: 10px;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

.cell-captions span {
  justify-self: start;
  align-self: start;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgb(17 24 39 / .72);
  color: white;
  font-size: clamp(11px, 1.5vw, 14px);
  line-height: 1.2;
}

.cell-captions small {
  font: inherit;
  color: rgb(255 255 255 / .82);
}

.cell-captions a {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.media-note {
  margin: 10px auto 0;
  max-width: 920px;
  color: #8a94a6;
  font-size: 14px;
  text-align: center;
}

.comparison-note {
  margin-bottom: 22px;
}

.method-footnote {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.motivation-controls {
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  max-width: 820px;
}

.media-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10;
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgb(17 24 39 / .72);
  color: white;
  font-size: 13px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.media-loader.active {
  display: flex;
}

.media-loader span {
  width: 14px;
  height: 14px;
  border: 2px solid rgb(255 255 255 / .35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.glance {
  --section-bg: #fff;
}

.glance-grid {
  display: grid;
  gap: 24px;
}

.glance-grid figure {
  width: min(100%, 860px);
  height: auto;
  aspect-ratio: auto;
  margin: 0 auto;
  overflow: visible;
  background: transparent;
}

.glance-grid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: white;
}

.glance-grid figcaption {
  position: static;
  margin-top: 10px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.glance-grid figcaption strong {
  color: var(--ink);
}

.phase-labels {
  display: flex;
  justify-content: space-between;
  margin-top: -2px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.question {
  max-width: 920px;
  margin: 20px auto 0;
  text-align: center;
  color: var(--ink);
  font-size: 18px;
}

.compare {
  --split: 50%;
  --aspect: 960 / 544;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #020617;
  aspect-ratio: var(--aspect);
  box-shadow: 0 18px 50px rgb(15 23 42 / .16);
  touch-action: none;
}

.compare img,
.compare video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #020617;
}

.output {
  clip-path: inset(0 0 0 var(--split));
}

.badge {
  position: absolute;
  top: 18px;
  z-index: 3;
  padding: 7px 12px;
  border-radius: 7px;
  background: rgb(17 24 39 / .72);
  color: white;
  font-size: clamp(13px, 2vw, 18px);
  backdrop-filter: blur(8px);
}

.badge-left { left: 18px; }
.badge-right { right: 18px; }

.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split);
  z-index: 4;
  width: 2px;
  background: white;
  transform: translateX(-1px);
  pointer-events: none;
}

.divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: white;
  color: #111827;
  font-size: 16px;
  box-shadow: 0 4px 16px rgb(0 0 0 / .18);
}

.split {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.arrow {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  margin: 18px auto 12px;
  max-width: 920px;
  padding: 10px 12px;
  border: 1px solid var(--accent-mid);
  border-radius: 999px;
  background: var(--panel);
}

.comparison-controls {
  margin: 14px auto 0;
}

.scrubber {
  --loaded: 0%;
  --played: 0%;
  position: relative;
  height: 24px;
  min-width: 0;
}

.scrubber::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  pointer-events: none;
}

.scrubber span {
  position: absolute;
  left: var(--played);
  right: calc(100% - var(--loaded));
  top: 10px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 28%, white);
  z-index: 3;
  pointer-events: none;
}

.controls input {
  position: relative;
  width: 100%;
  height: 24px;
  accent-color: var(--accent);
  background: transparent;
  z-index: 2;
}

#frame,
#cmpFrame,
.loaded-label {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.loaded-label {
  color: var(--accent);
  font-size: 13px;
}

.scrubber.loading span,
.loaded-label.loading {
  animation: loadingPulse .8s ease-in-out infinite alternate;
}

@keyframes loadingPulse {
  from { opacity: .35; }
  to { opacity: 1; }
}

.scenes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 0 0;
}

.scenes button {
  width: min(29vw, 220px);
  aspect-ratio: 960 / 544;
  border: 3px solid transparent;
  border-radius: 8px;
  background: center / cover no-repeat;
  cursor: pointer;
  opacity: .46;
  transition: opacity .15s ease, border-color .15s ease;
}

.scenes button.active {
  border-color: var(--accent);
  opacity: 1;
}

.paper {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.paper h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.paper p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.model-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.release-viewer {
  width: min(100%, 960px);
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: 8px;
  background: #020617;
}

.release-viewer video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.closed-loop-viewer {
  position: relative;
  width: min(100%, 1040px);
  height: auto;
  margin: 0 auto;
  background: transparent;
}

.closed-loop-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.closed-loop-grid figure {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 8px;
  background: #020617;
  aspect-ratio: 384 / 324;
}

.closed-loop-grid figure:nth-child(1) { grid-column: 2 / 4; }
.closed-loop-grid figure:nth-child(2) { grid-column: 4 / 6; }
.closed-loop-grid figure:nth-child(3) { grid-column: 1 / 3; }
.closed-loop-grid figure:nth-child(4) { grid-column: 3 / 5; }
.closed-loop-grid figure:nth-child(5) { grid-column: 5 / 7; }

.closed-loop-grid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #020617;
}

.closed-loop-grid figcaption {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgb(17 24 39 / .78);
  color: #fff;
  font-size: clamp(11px, 1.2vw, 14px);
  line-height: 1.2;
}

.multicam-viewer {
  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 1280 / 622;
  margin: 0 auto;
}

.multicam-viewer video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #020617;
}

.highres-viewer {
  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 3840 / 1172;
  margin: 0 auto;
}

.highres-viewer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #020617;
}

.closed-loop-labels {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  pointer-events: none;
  z-index: 2;
}

.closed-loop-labels span {
  justify-self: center;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgb(17 24 39 / .72);
  color: white;
  font-size: clamp(11px, 1.5vw, 14px);
  line-height: 1.2;
}

.stylization-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.style-cell {
  aspect-ratio: 480 / 272;
}

.style-cell video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #020617;
}

.style-top-a { grid-column: 2 / 4; }
.style-top-b { grid-column: 4 / 6; }
.style-bottom-a { grid-column: 1 / 3; }
.style-bottom-b { grid-column: 3 / 5; }
.style-bottom-c { grid-column: 5 / 7; }

.media-controls {
  max-width: 820px;
}

#stylizationThumbs {
  grid-template-columns: repeat(5, minmax(0, 150px));
  justify-content: center;
  gap: 10px;
  max-width: 820px;
  margin: 16px auto 0;
}

#closedLoopThumbs {
  grid-template-columns: repeat(6, minmax(0, 150px));
  justify-content: center;
  gap: 10px;
  max-width: 980px;
  margin: 16px auto 0;
}

#multicamThumbs {
  grid-template-columns: repeat(2, minmax(0, 150px));
  justify-content: center;
  gap: 10px;
  max-width: 340px;
  margin: 16px auto 0;
}

#multicamThumbs button {
  width: 150px;
}

#highresThumbs {
  grid-template-columns: repeat(5, minmax(0, 150px));
  justify-content: center;
  gap: 10px;
  max-width: 820px;
  margin: 16px auto 0;
}

.model-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.model-group span {
  color: var(--muted);
  font-size: 14px;
  min-width: 150px;
  text-align: right;
}

.model-picker button {
  border: 1px solid var(--accent-mid);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #312e81;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.model-picker button.active {
  border-color: var(--accent);
  background: var(--accent-mid);
  color: #1e1b4b;
}

.model-picker button.locked {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.model-picker button:disabled {
  cursor: default;
}

.model-dagger {
  font-size: .58em;
  line-height: 0;
  vertical-align: super;
}

.novel-selectors {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.novel-selectors button {
  border: 1px solid var(--accent-mid);
  border-radius: 999px;
  background: var(--accent-soft);
  color: #312e81;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.novel-selectors button.active {
  border-color: var(--accent);
  background: var(--accent-mid);
  color: #1e1b4b;
}

.novel-composite {
  position: relative;
  width: min(100%, 1084px);
  margin: 0 auto;
  aspect-ratio: 1084 / 408;
}

.novel-side-composite {
  aspect-ratio: 1084 / 388;
}

.novel-composite::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(100% / 3);
  width: 4px;
  background: #9ca3af;
  pointer-events: none;
  z-index: 2;
}

.novel-composite img,
.novel-composite video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.cell-captions.cols-3x2 {
  inset: 10px;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  z-index: 3;
}

.cell-captions.cols-3x2 span:nth-child(1) { grid-area: 1 / 1; }
.cell-captions.cols-3x2 span:nth-child(2) { grid-area: 1 / 2; }
.cell-captions.cols-3x2 span:nth-child(3) { grid-area: 1 / 3; }
.cell-captions.cols-3x2 span:nth-child(4) { grid-area: 2 / 1; }
.cell-captions.cols-3x2 span:nth-child(5) { grid-area: 2 / 2; }
.cell-captions.cols-3x2 span:nth-child(6) { grid-area: 2 / 3; }

.compare-grid {
  display: grid;
  gap: 12px;
}

.top-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 360px));
  justify-content: center;
  margin-bottom: 12px;
}

.model-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 360px));
  justify-content: center;
}

figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #020617;
  aspect-ratio: 360 / 204;
}

figure img,
figure video {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.closed-loop-viewer {
  overflow: visible;
  border-radius: 0;
  background: transparent;
  aspect-ratio: auto;
}

figcaption {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgb(17 24 39 / .72);
  color: white;
  font-size: 14px;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
  margin: 22px 0 0;
}

.thumb-grid button {
  position: relative;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: #020617;
  cursor: pointer;
  opacity: .58;
}

.thumb-grid button.active {
  border-color: var(--accent);
  opacity: 1;
}

.thumb-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-grid button {
  aspect-ratio: 16 / 9;
}

@media (max-width: 720px) {
  main {
    width: min(100% - 20px, 1180px);
    padding-top: 28px;
  }

  .viewer {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .arrow {
    position: absolute;
    z-index: 8;
    opacity: .9;
  }

  .arrow.left { left: 18px; }
  .arrow.right { right: 18px; }

  .controls {
    grid-template-columns: 1fr;
    border-radius: 28px;
    gap: 8px;
  }

  .controls button {
    justify-self: start;
  }

  .controls input {
    grid-column: 1 / -1;
  }

  .scrubber {
    grid-column: 1 / -1;
  }

  #frame,
  #cmpFrame,
  #internalFrame,
  #nondrivingFrame,
  #novelFrame,
  #motivationFrame,
  .loaded-label,
  #closedLoopTime,
  #stylizationTime,
  #multicamTime {
    justify-self: start;
    font-size: 14px;
  }

  .top-grid,
  .model-grid,
  .closed-loop-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .closed-loop-grid figure {
    grid-column: 1 / -1 !important;
  }
}
