:root {
  color-scheme: light;
  --ink: #18211f;
  --muted: #65716d;
  --paper: #fbfaf6;
  --soft: #f0eee7;
  --line: rgba(24, 33, 31, 0.14);
  --pine: #1f5a4d;
  --teal: #1c8c8a;
  --coral: #d65f45;
  --gold: #ca982e;
  --violet: #6957ad;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(24, 33, 31, 0.14);
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px max(24px, calc((100vw - var(--max)) / 2));
  background: rgba(251, 250, 246, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--pine);
}

.site-nav nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav nav a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 12px;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.site-nav nav a:hover,
.site-nav nav a:focus-visible {
  background: var(--soft);
  color: var(--ink);
  outline: none;
}

.hero {
  position: relative;
  min-height: 88svh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 92px 24px 80px;
  background: #111815;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: -8vh -6vw;
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  transform: rotate(-3deg) scale(1.08);
  opacity: 0.92;
  z-index: -3;
}

.hero-media video {
  width: 100%;
  height: 100%;
  min-height: 76svh;
  object-fit: cover;
  filter: brightness(1.08) saturate(1.18) contrast(1.04);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(13, 18, 17, 0.72), rgba(13, 18, 17, 0.4) 44%, rgba(13, 18, 17, 0.54)),
    linear-gradient(180deg, rgba(247, 238, 214, 0.2), rgba(31, 90, 77, 0.14) 44%, rgba(13, 18, 17, 0.56));
}

.hero-content {
  width: min(980px, 100%);
  color: var(--white);
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--coral);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  font-size: 1.17rem;
}

.section-kicker {
  font-size: 1.75rem;
}

.hero h1 {
  margin: 0 auto 22px;
  max-width: 860px;
  font-size: clamp(1.72rem, 3.35vw, 3.05rem);
  line-height: 1.14;
  letter-spacing: 0;
}

.hero sup,
.brand sup,
footer sup {
  line-height: 0;
}

.authors {
  margin: 0 auto;
  max-width: 820px;
  font-size: clamp(1.12rem, 2.2vw, 1.45rem);
  font-weight: 700;
}

.authors a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.42);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition:
    color 160ms ease,
    text-decoration-color 160ms ease;
}

.authors a:hover,
.authors a:focus-visible {
  color: #8fc7ff;
  text-decoration-color: currentColor;
  outline: none;
}

.affiliations {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  font-weight: 650;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.hero-actions a,
.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 10px 16px;
  transition:
    background 160ms ease,
    transform 160ms ease,
    border-color 160ms ease;
}

.hero-actions a:hover,
.hero-actions a:focus-visible,
.control-button:hover,
.control-button:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
  outline: none;
  transform: translateY(-1px);
}

.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 86px 0;
}

.section.narrow {
  max-width: 900px;
}

.section h2 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.section h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.lead {
  margin: 24px 0 0;
  color: #34403d;
  font-size: clamp(1.06rem, 2vw, 1.28rem);
}

.feature-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding-top: 28px;
}

.capability {
  min-height: 188px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 22px;
  box-shadow: 0 14px 38px rgba(24, 33, 31, 0.06);
}

.capability span {
  display: block;
  margin-bottom: 26px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
}

.capability:nth-child(2) span {
  color: var(--coral);
}

.capability:nth-child(3) span {
  color: var(--gold);
}

.capability:nth-child(4) span {
  color: var(--violet);
}

.capability p,
.method-grid p,
.video-card p,
.edit-pair p,
.section-heading p,
.wide-figure figcaption {
  margin: 0;
  color: var(--muted);
}

.section-heading .section-kicker {
  color: var(--coral);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
  gap: 36px;
  align-items: end;
  margin-bottom: 34px;
}

.media-section .section-heading {
  grid-template-columns: minmax(0, 1fr) auto;
}

.control-button {
  align-self: end;
  border-color: var(--line);
  background: var(--ink);
  color: var(--white);
  white-space: nowrap;
}

.control-button:hover,
.control-button:focus-visible {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--white);
}

.wide-figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.wide-figure img {
  width: 100%;
  background: var(--white);
}

.wide-figure figcaption {
  border-top: 1px solid var(--line);
  padding: 16px 18px;
  font-size: 0.94rem;
}

.wide-figure.compact {
  margin-top: 18px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}

.method-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f5ee;
  padding: 22px;
}

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

.labeled-video-stack {
  display: grid;
  gap: 34px;
}

.labeled-video {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(24, 33, 31, 0.08);
}

.labeled-video video {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #101513;
  object-fit: cover;
}

.composite-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  padding: 10px 0;
  color: var(--ink);
  font-size: clamp(0.72rem, 1.55vw, 1.1rem);
  font-weight: 850;
  line-height: 1.16;
  text-align: center;
}

.composite-labels span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 10px;
}

.composite-labels.top {
  border-bottom: 1px solid var(--line);
}

.composite-labels.bottom {
  border-top: 1px solid var(--line);
}

.generated-label {
  color: #4f91dd;
}

.small-grid {
  margin-top: 16px;
}

.video-card,
.edit-pair {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(24, 33, 31, 0.08);
}

.video-card video {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #101513;
  object-fit: cover;
}

.video-card div,
.edit-pair > div:last-child {
  padding: 16px;
}

.video-card.highlight {
  border-color: rgba(28, 140, 138, 0.55);
  box-shadow: 0 22px 64px rgba(28, 140, 138, 0.18);
}

.comparison-grid {
  display: grid;
  gap: 16px;
}

.comparison-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.comparison-card video {
  aspect-ratio: 1 / 1;
}

.comparison-card.highlight h3 {
  color: #4f91dd;
}

.ablation-stack {
  display: grid;
  gap: 54px;
}

.ablation-block {
  display: grid;
  gap: 18px;
}

.ablation-copy h3 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.08;
}

.ablation-copy p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.28rem);
}

.ablation-wide-video {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(24, 33, 31, 0.08);
}

.ablation-wide-video > video {
  width: 100%;
  aspect-ratio: 3 / 1;
  background: #101513;
  object-fit: cover;
}

.ablation-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.ablation-labels span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2em;
  padding: 10px 12px;
  color: var(--ink);
  font-size: clamp(0.9rem, 1.55vw, 1.12rem);
  font-weight: 800;
  line-height: 1.22;
  text-align: center;
}

.ablation-labels .ours {
  display: inline;
  min-height: auto;
  padding: 0;
}

.ablation-labels .ours-label {
  color: #4f91dd;
}

.ours {
  color: #4f91dd;
}

.scene-edit-caption {
  display: block;
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.28rem);
  font-weight: 650;
  line-height: 1.36;
}

.scene-edit-caption .edit-red {
  color: #ec3b25;
  font-weight: 900;
}

.scene-edit-caption .edit-blue {
  color: #4f91dd;
  font-weight: 900;
}

#editing .editing-wide-video > video {
  width: 100%;
  aspect-ratio: 4 / 1;
  object-fit: cover;
}

#editing .ablation-labels.editing-labels {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#editing .ablation-labels.editing-labels span {
  min-width: 0;
  white-space: nowrap;
}

.composition-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 16px 48px rgba(24, 33, 31, 0.08);
  overflow: hidden;
  padding: clamp(16px, 2.6vw, 28px);
}

.composition-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(14px, 2vw, 24px);
  align-items: start;
  margin-bottom: clamp(16px, 2.4vw, 26px);
}

.composition-control {
  margin-top: 2px;
}

.composition-grid {
  display: grid;
  grid-template-columns:
    minmax(140px, 1fr)
    clamp(54px, 6vw, 86px)
    minmax(140px, 1fr)
    clamp(128px, 14vw, 190px)
    minmax(150px, 1.1fr);
  grid-template-rows: repeat(2, auto);
  align-items: center;
  gap: clamp(18px, 2.8vw, 30px) clamp(12px, 2vw, 24px);
}

.composition-caption {
  margin-bottom: 0;
}

.composition-caption strong {
  color: var(--ink);
  font-weight: 900;
}

.composition-panel {
  display: grid;
  gap: 10px;
  margin: 0;
}

.composition-panel video {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: #101513;
  object-fit: cover;
}

.composition-panel figcaption {
  color: var(--ink);
  font-size: clamp(0.8rem, 1.44vw, 1.14rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.composition-panel figcaption span {
  color: #00a6df;
}

.compose-video-a {
  grid-column: 1;
  grid-row: 1;
}

.compose-video-b {
  grid-column: 1;
  grid-row: 2;
}

.compose-arrow-a {
  grid-column: 2;
  grid-row: 1;
}

.compose-arrow-b {
  grid-column: 2;
  grid-row: 2;
}

.compose-ego {
  grid-column: 3;
  grid-row: 1;
}

.compose-memory {
  grid-column: 3;
  grid-row: 2;
}

.compose-main-arrow {
  grid-column: 4;
  grid-row: 1 / span 2;
}

.compose-condition {
  grid-column: 5;
  grid-row: 1;
}

.compose-generation {
  grid-column: 5;
  grid-row: 2;
}

.flow-arrow {
  width: 100%;
  background: #20a4d2;
  clip-path: polygon(0 32%, 62% 32%, 62% 0, 100% 50%, 62% 100%, 62% 68%, 0 68%);
  filter: drop-shadow(0 0 0 #10364a);
}

.flow-arrow.small {
  height: clamp(46px, 6vw, 68px);
}

.flow-arrow.large {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(132px, 18vw, 190px);
  color: var(--white);
  font-size: clamp(0.63rem, 1.26vw, 0.93rem);
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
}

.flow-arrow.large span {
  transform: translateX(-7%);
}

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

.edit-pair.wide {
  grid-column: 1 / -1;
}

.paired-videos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.paired-videos.triptych {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.paired-videos video {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #101513;
  object-fit: cover;
}

pre {
  margin: 24px 0 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17201d;
  color: #f7f1df;
  padding: 20px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 28px 24px 42px;
  text-align: center;
}

.footer p {
  margin: 0;
}

@media (max-width: 940px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .site-nav nav {
    flex-wrap: wrap;
  }

  .hero {
    min-height: 82svh;
    padding-top: 82px;
  }

  .hero-media {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .feature-band,
  .method-grid,
  .video-grid,
  .comparison-row,
  .editing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading,
  .media-section .section-heading {
    grid-template-columns: 1fr;
  }

  .composition-card {
    overflow-x: auto;
  }

  .composition-grid {
    min-width: 980px;
  }

  .composition-topline {
    grid-template-columns: 1fr;
  }

  .control-button {
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .site-nav {
    padding: 12px 16px;
  }

  .site-nav nav a {
    padding: 6px 8px;
  }

  .section {
    width: min(100% - 28px, var(--max));
    padding: 58px 0;
  }

  .hero {
    min-height: 78svh;
    padding: 68px 16px 56px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 12vw, 4rem);
  }

  .hero-media {
    grid-template-columns: 1fr;
    transform: scale(1.08);
  }

  .hero-media video:nth-child(n + 3) {
    display: none;
  }

  .feature-band,
  .method-grid,
  .video-grid,
  .comparison-row,
  .editing-grid,
  .paired-videos,
  .paired-videos.triptych {
    grid-template-columns: 1fr;
  }

  .capability {
    min-height: 0;
  }
}
