:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #1a1a1a;
  --primary: #1a1a1a;
  --accent: #f14122;
  --link: #2d6aa0;
  --link-soft: #e8e8e7;
  --rule: #e5e5e5;
  --rule-soft: #efefef;
  --neutral-50: #f8f8f7;
  --neutral-100: #f3f3f2;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-500: #828282;
  --neutral-600: #4a4a4a;
  --neutral-700: #333333;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --paper-title-size: clamp(1.25rem, 2.2vw, 2.32rem);
  --muted: var(--neutral-600);
  --surface: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
}

a:focus-visible,
button:focus-visible,
video:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.hero {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 42px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 1500px;
  margin-bottom: 14px;
  color: var(--primary);
  font-family: var(--font-serif);
  font-size: var(--paper-title-size);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0;
}

.title-line {
  display: block;
  white-space: nowrap;
}

.authors {
  max-width: 860px;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 500;
  font-family: var(--font-serif);
  line-height: 1.7;
}

.authors a {
  color: var(--primary);
  text-decoration-color: var(--neutral-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.authors a:hover {
  color: var(--link);
  text-decoration-color: currentColor;
}

.affiliations {
  max-width: 840px;
  margin-bottom: 4px;
  color: var(--neutral-600);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
}

.venues {
  display: grid;
  gap: 3px;
  max-width: 880px;
  margin: 18px 0 8px;
  color: var(--neutral-600);
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.45;
}

.venues p {
  margin-bottom: 0;
}

.venue-secondary {
  margin-top: 5px;
}

.venues a {
  color: var(--primary);
  text-decoration: none;
}

.venues a:hover {
  color: var(--link);
}

.award {
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 8px;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  color: var(--neutral-500);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.button:not([href]) {
  cursor: default;
}

.button.is-disabled {
  opacity: 0.54;
  pointer-events: none;
}

.button svg,
.button img {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.button:hover,
.button.primary:hover {
  border-color: var(--neutral-300);
  background: var(--link-soft);
  color: var(--primary);
}

figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.section {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0;
}

.section h2 {
  margin: 0;
  color: var(--primary);
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.section-heading {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}

.section-description {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--neutral-600);
  font-size: 0.92rem;
  line-height: 1.68;
  text-wrap: pretty;
}

.map-copy,
.experiments-intro,
.experiment-copy {
  display: grid;
  gap: 16px;
  max-width: 100%;
}

.map-copy .section-description,
.experiments-intro .section-description,
.experiment-copy .section-description {
  max-width: 100%;
  font-size: 0.98rem;
  line-height: 1.78;
}

.video-frame {
  overflow: hidden;
  width: 100%;
  margin-top: 24px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule-soft);
  border-radius: 5px;
  background: var(--neutral-50);
}

.project-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.framework-figure {
  margin: 24px 0 0;
  background: var(--background);
}

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

.experiments-section {
  padding-bottom: 36px;
}

.experiments-intro {
  margin-bottom: 24px;
}

.experiment-stack {
  display: grid;
  gap: 24px;
}

.experiment-block {
  display: grid;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-soft);
}

.experiment-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.experiment-copy {
  gap: 6px;
}

.experiment-kicker {
  margin-bottom: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.experiment-copy h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.28;
}

.result-figure,
.latent-video-card,
.result-video-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
  background: var(--neutral-50);
}

.result-figure img,
.latent-video-card video,
.result-video-card video,
.result-video-card .media-placeholder {
  display: block;
  width: 100%;
  background: var(--neutral-100);
}

.latent-video-card video,
.result-video-card video {
  object-fit: contain;
}

.result-figure img {
  height: auto;
}

.latent-video-card video {
  aspect-ratio: 16 / 9;
}

.result-video-card video,
.result-video-card .media-placeholder {
  aspect-ratio: 3 / 2;
}

.result-figure figcaption,
.latent-video-card figcaption,
.result-video-card figcaption,
.scene-chart-card figcaption,
.recovery-chart-card figcaption {
  margin: 0;
  padding: 10px 12px;
  color: var(--neutral-600);
  font-size: 0.88rem;
  line-height: 1.45;
}

.latent-video-card figcaption {
  border-bottom: 1px solid var(--rule-soft);
}

.result-video-card figcaption {
  border-top: 1px solid var(--rule-soft);
}

.result-figure code,
.result-video-card code {
  color: var(--neutral-700);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.experiment-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.policy-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scene-chart-card {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
  background: var(--neutral-50);
  position: relative;
}

.recovery-chart-card {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
  background: var(--neutral-50);
}

.scene-chart-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.recovery-chart-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.scene-chart-kicker {
  margin-bottom: 3px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.scene-chart-topline h4 {
  margin: 0;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.recovery-chart-topline h4 {
  margin: 0;
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.scene-chart-stage {
  overflow: hidden;
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  background: var(--surface);
}

.recovery-chart-stage {
  overflow: hidden;
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  background: var(--surface);
}

.scene-chart-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

.recovery-chart-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

.scene-chart-grid-line {
  stroke: var(--rule-soft);
  stroke-width: 1;
}

.recovery-chart-grid-line {
  stroke: var(--rule-soft);
  stroke-width: 1;
}

.scene-chart-label {
  fill: var(--neutral-600);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(26, 26, 26, 0.18);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.scene-chart-label:hover,
.scene-chart-label:focus-visible {
  fill: var(--accent);
  text-decoration-color: currentColor;
}

.recovery-chart-label {
  fill: var(--neutral-600);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.scene-chart-axis-title {
  fill: var(--neutral-700);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
}

.recovery-chart-axis-title {
  fill: var(--neutral-700);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
}

.scene-chart-svg-legend {
  pointer-events: none;
}

.scene-chart-svg-legend-label {
  fill: var(--neutral-700);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
}

.recovery-chart-svg-legend-label {
  fill: var(--neutral-700);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
}

.scene-chart-value-label {
  fill: var(--neutral-700);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.recovery-chart-value-label {
  fill: var(--neutral-700);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
}

.scene-chart-bar {
  cursor: pointer;
  outline: none;
}

.scene-chart-task-hotspot {
  fill: transparent;
  cursor: pointer;
}

.scene-chart-tooltip {
  position: absolute;
  z-index: 3;
  width: min(680px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 8px;
  background: var(--surface);
  box-shadow:
    0 12px 28px rgba(26, 26, 26, 0.12),
    0 2px 5px rgba(26, 26, 26, 0.06);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 0s linear 140ms;
}

.scene-chart-tooltip.is-visible {
  transform: translateY(0);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 0s;
}

.scene-chart-tooltip img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: var(--surface);
  border-radius: 0;
}

.scene-chart-bar path {
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    filter 160ms ease;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.scene-chart-bar:hover path,
.scene-chart-bar:focus-visible path,
.scene-chart-bar.is-active path {
  filter: drop-shadow(0 5px 9px rgba(26, 26, 26, 0.14));
  transform: scaleY(1.025);
}

.scene-chart-bar.is-dimmed path {
  opacity: 0.45;
}

.recovery-chart-line {
  fill: none;
  stroke: var(--neutral-700);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recovery-chart-marker {
  fill: var(--surface);
  stroke: var(--neutral-700);
  stroke-width: 2;
}

.recovery-chart-bar {
  cursor: pointer;
  outline: none;
}

.recovery-chart-bar path {
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    filter 160ms ease;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.recovery-chart-bar:hover path,
.recovery-chart-bar:focus-visible path,
.recovery-chart-bar.is-active path {
  filter: drop-shadow(0 5px 9px rgba(26, 26, 26, 0.14));
  transform: scaleY(1.025);
}

.recovery-chart-bar.is-dimmed path {
  opacity: 0.45;
}

.recovery-chart-label:hover,
.recovery-chart-label:focus-visible,
.recovery-chart-label.is-active {
  fill: var(--accent);
}

.media-placeholder {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(45, 106, 160, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(241, 65, 34, 0.08), transparent 42%),
    var(--neutral-100);
  color: var(--neutral-600);
  text-align: center;
}

.result-video-card .media-placeholder {
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.latent-video-card .media-placeholder {
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.media-placeholder span {
  max-width: 280px;
  color: var(--neutral-700);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.task-rotator {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.rollout-rotator {
  margin-top: 18px;
}

.rollout-rotator .policy-comparison-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  gap: 14px;
}

.rollout-rotator .latent-video-card {
  min-width: 0;
}

.rollout-rotator .latent-video-card figcaption {
  padding: 8px 9px;
  font-size: 0.82rem;
}

.rollout-rotator .latent-video-card video,
.rollout-rotator .latent-video-card .media-placeholder {
  aspect-ratio: 3 / 2;
}

.task-rotator-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.task-kicker {
  margin-bottom: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.task-rotator h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
}

.task-note {
  margin: 4px 0 0;
  color: var(--neutral-500);
  font-size: 0.82rem;
}

.task-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  background: var(--neutral-50);
}

.task-tab {
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--neutral-600);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.task-tab:hover {
  color: var(--primary);
}

.task-tab.is-active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--neutral-200);
}

.task-video-group {
  animation: fade-in 260ms ease;
}

.latent-video-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.84375fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.latent-video-card.is-rgb-observation video {
  aspect-ratio: 3 / 2;
}

.latent-video-summary {
  margin: 14px 0 0;
  color: var(--primary);
  font-size: 1.08rem;
  line-height: 1.45;
  text-align: center;
}

.latent-video-summary strong {
  font-weight: 700;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

footer {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 52px;
  border-top: 1px solid var(--rule);
  color: var(--neutral-600);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .hero {
    padding-top: 36px;
  }

  h1 {
    font-size: clamp(1rem, 3.33vw, 1.95rem);
  }

  .section-heading,
  .experiment-video-grid,
  .latent-video-grid {
    grid-template-columns: 1fr;
  }

  .task-rotator-header {
    display: grid;
    align-items: start;
  }

  .scene-chart-topline {
    display: grid;
  }

  .task-tabs {
    width: 100%;
  }

  .task-tab {
    flex: 1;
  }

}

@media (max-width: 520px) {
  .hero {
    width: calc(100% - 36px);
    padding-top: 32px;
  }

  h1 {
    font-size: clamp(0.66rem, 3.33vw, 1.1rem);
  }

  .actions {
    display: flex;
  }

  .button {
    width: auto;
  }

  .rollout-rotator .policy-comparison-grid {
    gap: 6px;
  }

  .rollout-rotator .latent-video-card figcaption {
    padding: 7px 6px;
    font-size: 0.78rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
