:root {
  --white: #ffffff;
  --surface: #f7f7f8;
  --ink: #111318;
  --muted: #626975;
  --line: #d8dde6;
  --blue: #002fa7;
  --blue-soft: #e8efff;
  --max: 1180px;
  --pad: clamp(1rem, 4vw, 3rem);
  --gutter: clamp(2rem, 4vw, 3.5rem);
  --reading-width: 72ch;
  --section-space: clamp(2rem, 4vw, 3rem);
  --content-gap: clamp(1.5rem, 3vw, 2.5rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
p { margin-bottom: 1rem; overflow-wrap: break-word; }
p:last-child { margin-bottom: 0; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .7rem 1rem;
  color: var(--white);
  background: var(--blue);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 4rem;
  padding: 0 max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad)));
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.site-brand {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -.025em;
  text-decoration: none;
}
.site-brand:hover, .site-brand:focus-visible { color: var(--blue); }
.nav { display: flex; justify-self: end; gap: 1.8rem; }
.nav a {
  padding: 1.2rem 0;
  color: var(--muted);
  font-size: .8rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a:focus-visible { color: var(--blue); border-bottom-color: var(--blue); }

.paper-link, .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 7rem;
  min-height: 2.75rem;
  padding: .6rem 1.15rem;
  color: var(--blue);
  background: var(--white);
  border: 1px solid var(--blue);
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.text-link { color: var(--ink); border-color: #9299a4; }
.paper-link svg, .text-link svg { width: 1.1rem; height: 1.1rem; flex: none; }
.paper-link:hover, .text-link:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.paper-link:focus-visible, .text-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.section-grid {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.hero {
  padding-top: clamp(2.25rem, 4vw, 3.5rem);
  padding-bottom: var(--section-space);
  border-bottom: 1px solid var(--line);
}
.hero-copy { max-width: none; }
.hero h1 { margin: 0 0 2rem; }
.project-name {
  display: block;
  margin-bottom: .7rem;
  color: var(--blue);
  font-size: clamp(3.25rem, 6vw, 4.75rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.055em;
}
.project-title {
  display: block;
  max-width: none;
  color: var(--ink);
  font-size: clamp(1.6rem, 3vw, 2.375rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.title-phrase { white-space: nowrap; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.publication-info { margin-bottom: 0; }
.authors {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  max-width: 57rem;
  margin-bottom: .85rem;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.65;
}
.author { white-space: nowrap; }
.author a { text-decoration: none; text-underline-offset: .2em; }
.author a:hover { color: var(--blue); text-decoration: underline; }
.author a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.publication-info sup { color: var(--muted); font-size: .65em; line-height: 0; }
.author sup { margin-left: .15em; }
.corresponding-icon {
  display: inline-block;
  width: .85em;
  height: .85em;
  margin-left: .3rem;
  color: var(--blue);
  vertical-align: -.02em;
}
.affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem 1.1rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.7;
}
.affiliations span { white-space: nowrap; }
.publication-links { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
.hero-overview { margin-top: 3rem; }
.hero-statement {
  max-width: none;
  margin-top: 0;
  margin-bottom: 0;
  color: #424955;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.65;
}
.hero-statement strong { color: var(--blue); font-weight: 600; }
.tldr-label { margin-right: .4rem; color: var(--ink); font-size: .85em; font-weight: 700; white-space: nowrap; }

.paper-figure { margin: 0; }
.paper-figure.teaser-figure { margin-top: 1.5rem; }
.paper-figure img { width: 100%; height: auto; }
.paper-figure figcaption {
  display: block;
  margin-top: .75rem;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
  text-align: center;
}

.content-section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
  border-bottom: 1px solid var(--line);
}
.section-intro { max-width: 820px; }
.section-intro h2, .closing h2 {
  margin-bottom: 1.5rem;
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -.045em;
}
/* Reading measures apply to prose; full-width Method copy keeps its layout. */
.section-intro p { color: #343a44; font-size: 1rem; line-height: 1.65; }
.section-intro:not(.wide) p { max-width: var(--reading-width); }
.engine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: clamp(2rem, 3.5vw, 3rem);
  align-items: center;
  margin-top: var(--content-gap);
}
.idea-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.idea-heading h2 { margin: 0; font-size: clamp(2rem, 3vw, 2.5rem); line-height: 1.15; letter-spacing: -.04em; }
.idea-section .approach-copy { max-width: none; margin: 0; }
.idea-section .approach-copy p { margin: 0; font-size: .95rem; line-height: 1.65; }
.idea-section .approach-copy p + p { margin-top: 1rem; }
.approach-copy .inference-mode { color: var(--blue); font-weight: 700; }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.principles article { min-height: 13rem; padding: 1.2rem 1.5rem 1.5rem 0; }
.principles article + article { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.principle-number { color: var(--blue); font-size: .76rem; font-weight: 700; }
.principles h3 { margin: 2.8rem 0 .55rem; font-size: 1.05rem; letter-spacing: -.02em; }
.principles p { margin-bottom: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

.idea-motto { margin: 0; justify-self: center; }
.idea-motto p { margin: 0; }
.idea-motto p + p { margin-top: 1.5rem; }
.idea-motto span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: 1rem; line-height: 1.2; }
.idea-motto strong { display: block; color: var(--ink); font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 700; line-height: 1.08; letter-spacing: -.04em; }
.idea-motto p:last-child strong { color: var(--blue); }
.method-figure { min-width: 0; width: 100%; margin-top: 0; }
.definition-card {
  display: inline-block;
  width: calc(34% - 1.5rem);
  margin: 4.5rem 0 0 3rem;
  padding: 1.4rem 0 1.4rem 1.4rem;
  vertical-align: bottom;
  border-left: 3px solid var(--blue);
}
.definition-term { margin-bottom: .8rem; color: var(--blue); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.definition-card h3 { margin-bottom: .7rem; font-size: 1.2rem; line-height: 1.25; }
.definition-card p:last-child { margin-bottom: 0; color: var(--muted); font-size: .9rem; }

.system-section { background: var(--white); }
.system-section > .section-intro { max-width: none; }
.system-figure { margin-top: var(--content-gap); }
.system-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-top: var(--content-gap);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.system-steps article { padding: 1rem 1.5rem 1.4rem 0; }
.system-steps .frontend-path { grid-column: 1 / -1; min-height: 9rem; padding-right: 0; border-bottom: 1px solid var(--line); }
.system-steps .backend-path { min-height: 12rem; }
.system-steps .backend-path + .backend-path { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.system-steps h3 {
  display: flex;
  align-items: baseline;
  gap: .42rem;
  margin: 0 0 .75rem;
  line-height: 1.2;
}
.stage-label {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.025em;
}
.stage-title {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -.01em;
}
.system-steps p { max-width: var(--reading-width); margin-bottom: 0; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.system-steps .frontend-path p { max-width: none; }
.system-steps .stage-sequence { margin-bottom: .65rem; color: var(--blue); font-size: .78rem; letter-spacing: .01em; }
.loop-figure { margin-top: var(--content-gap); }

.demo-section { padding-top: 0; padding-bottom: 0; }
.media-block { min-width: 0; padding: var(--section-space) 0; border-bottom: 1px solid var(--line); scroll-margin-top: 5rem; }
.media-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1rem; margin-bottom: 3rem; }
.media-heading h2 { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.25rem); line-height: 1.15; letter-spacing: -.035em; }
.media-browser { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sequence-sidebar { min-width: 0; }
.sequence-list { display: grid; gap: .35rem; }
.sequence-button { min-width: 0; min-height: 3rem; padding: .55rem .75rem; color: var(--muted); background: var(--white); border: 1px solid transparent; border-left: 3px solid transparent; text-align: left; cursor: pointer; }
.sequence-button span { display: block; font-size: .62rem; line-height: 1.15; }
.sequence-button strong { display: block; margin-top: .15rem; color: var(--ink); font-size: .83rem; font-weight: 500; line-height: 1.25; }
.sequence-button:hover { background: var(--surface); color: var(--blue); }
.sequence-button.is-active { border-left-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.sequence-button.is-active strong { color: var(--blue); }
.sequence-button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.scene-details { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; margin-bottom: 1rem; }
.scene-features { display: flex; flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; gap: .25rem 1.25rem; margin: 0; padding: 0; color: var(--blue); font-size: .8rem; font-weight: 500; line-height: 1.35; list-style: none; }
.scene-features li { white-space: nowrap; }
.scene-stats { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: .35rem 1.5rem; margin: 0; padding: 0; color: var(--muted); font-size: .8rem; line-height: 1.35; list-style: none; font-variant-numeric: tabular-nums; }
.scene-stats li { white-space: nowrap; }
.media-player {
  width: min(100%, calc((100vh - 17rem) * 16 / 9));
  width: min(100%, calc((100svh - 17rem) * 16 / 9));
  min-width: 0;
  justify-self: end;
}
.media-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.video-stage { position: relative; isolation: isolate; }
.scene-navigation { position: absolute; inset: 0; pointer-events: none; }
.scene-arrow { position: absolute; top: 50%; display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; padding: 0; color: var(--white); background: rgba(17, 19, 24, .2); border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: .8; transform: translateY(-50%); cursor: pointer; pointer-events: auto; transition: opacity 150ms ease, background-color 150ms ease; }
.scene-arrow:first-child { left: .85rem; }
.scene-arrow:last-child { right: .85rem; }
.scene-arrow svg { width: 1.25rem; height: 1.25rem; }
.video-stage:hover .scene-arrow, .video-stage:focus-within .scene-arrow { opacity: 1; }
.scene-arrow:hover { background: rgba(17, 19, 24, .3); border-color: rgba(255, 255, 255, .65); }
.scene-arrow:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; opacity: 1; background: rgba(17, 19, 24, .3); }
.speed-control { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.speed-control select {
  min-width: 4.5rem;
  padding: .45rem 1.7rem .45rem .65rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
}
.speed-control select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.dataset-tabs { display: flex; flex-wrap: wrap; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.dataset-tab {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  min-width: 10rem;
  padding: .8rem 1rem .8rem 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-top: 3px solid transparent;
  cursor: pointer;
  text-align: left;
}
.dataset-tab + .dataset-tab { padding-left: 1rem; border-left: 1px solid var(--line); }
.dataset-tab span { font-size: .7rem; font-variant-numeric: tabular-nums; }
.dataset-tab.is-active { color: var(--blue); border-top-color: var(--blue); }

.result-video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  margin: 0 auto;
  background: #111318;
  border: 1px solid var(--line);
}
.result-video:fullscreen { width: 100%; height: 100%; object-fit: contain; border: 0; }
.media-note { max-width: none; margin: 1rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; text-align: center; text-wrap: balance; }
.media-note .async-highlight { color: var(--blue); font-weight: 700; white-space: nowrap; }

.video-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.video-panel { min-width: 0; background: var(--white); }
.video-label { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
.video-label span { font-size: .78rem; font-weight: 700; }
.video-label small { color: var(--muted); font-size: .7rem; }
.video-panel video { width: 100%; aspect-ratio: 16 / 9; background: #111318; object-fit: contain; }
.video-footnote { display: grid; grid-template-columns: 1.5fr .5fr; gap: 2rem; padding-top: .9rem; color: var(--muted); font-size: .73rem; }
.video-footnote p:last-child { text-align: right; }

.results-table-wrap { margin-top: var(--content-gap); overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.results-table th, .results-table td { padding: .9rem 1rem .9rem 0; text-align: left; border-bottom: 1px solid var(--line); }
.results-table th { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-top: 1px solid var(--ink); }
.results-table thead th:not(:first-child), .results-table td { text-align: right; font-variant-numeric: tabular-nums; }
.results-table tbody th { color: var(--ink); font-size: .92rem; font-weight: 400; letter-spacing: 0; text-transform: none; border-top: 0; }
.results-table .ours-row { background: var(--blue-soft); }
.results-table .ours-row th { color: var(--blue); font-weight: 700; }
.results-table-note { width: 100%; margin: .85rem 0 0; color: var(--muted); font-size: .82rem; }
.benchmark-row {
  display: grid;
  grid-template-columns: minmax(10rem, .75fr) 2fr minmax(8rem, .55fr);
  gap: 2rem;
  align-items: center;
  min-height: 9rem;
  border-bottom: 1px solid var(--line);
}
.benchmark-name strong { display: block; font-size: 1.25rem; letter-spacing: -.025em; }
.benchmark-name span { color: var(--muted); font-size: .74rem; }
.bars { display: grid; gap: .65rem; }
.bar-row { display: grid; grid-template-columns: 4.8rem 1fr 4.5rem; gap: .7rem; align-items: center; font-size: .76rem; }
.bar-row strong { font-variant-numeric: tabular-nums; }
.bar-track { height: .5rem; background: #eceef2; }
.bar { display: block; height: 100%; }
.bar.ours { background: var(--blue); }
.bar.baseline { background: #9ba3af; }
.reduction { color: var(--blue); font-size: .92rem; font-weight: 700; text-align: right; }
.results-note { padding-top: .9rem; color: var(--muted); font-size: .76rem; }
.results-note p { max-width: 48rem; }

.runtime-block {
  display: grid;
  grid-template-columns: .65fr 1.35fr;
  gap: var(--gutter);
  align-items: start;
  margin-top: var(--section-space);
  padding-top: var(--section-space);
  border-top: 1px solid var(--ink);
}
.runtime-copy h3 { margin-bottom: .8rem; font-size: 1.35rem; letter-spacing: -.025em; }
.runtime-copy p { max-width: var(--reading-width); color: var(--muted); font-size: 1rem; line-height: 1.65; }
.retrieval-figure { width: min(100%, 440px); justify-self: center; }

.closing {
  padding-top: clamp(4rem, 7vw, 6rem);
  padding-bottom: clamp(4rem, 7vw, 6rem);
  background: var(--surface);
}
.closing-copy { max-width: 760px; }
.closing h2 { margin-bottom: .8rem; }
.closing p { color: #343a44; font-size: 1.04rem; }
.paper-link.inverse { margin-top: 1rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--pad);
  color: var(--muted);
  font-size: .72rem;
}
.site-footer p { margin: 0; }

@media (max-width: 900px) {
  .nav { gap: 1rem; }
  .engine-layout { grid-template-columns: 1fr; gap: 1.75rem; }
  .idea-heading { flex-wrap: wrap; }
  .media-browser { grid-template-columns: 11.5rem minmax(0, 1fr); gap: 1rem; }
  .method-figure { width: 100%; }
  .runtime-block { grid-template-columns: 1fr; gap: 2rem; }
  .media-player { width: 100%; }
}

@media (max-width: 680px) {
  :root { --pad: 1rem; }
  html { scroll-padding-top: 4.5rem; }
  .site-header { min-height: 3.5rem; column-gap: .75rem; }
  .nav { display: flex; gap: .75rem; }
  .nav a { padding: 1rem 0; font-size: .72rem; }
  .hero { padding-top: 2.25rem; }
  .hero h1 { margin-bottom: 1.75rem; }
  .authors { gap: .35rem 1rem; font-size: 1rem; }
  .affiliations { gap: .2rem .9rem; font-size: .8rem; }
  .publication-links { margin-top: 1.25rem; }
  .principles { grid-template-columns: 1fr; }
  .principles article, .principles article + article { min-height: auto; padding: 1rem 0 1.4rem; border-left: 0; border-bottom: 1px solid var(--line); }
  .principles article:last-child { border-bottom: 0; }
  .principles h3 { margin-top: 1.6rem; }
  .system-steps { grid-template-columns: 1fr; }
  .system-steps article, .system-steps .frontend-path, .system-steps .backend-path, .system-steps .backend-path + .backend-path { min-height: auto; padding: 1rem 0 1.3rem; border-left: 0; border-bottom: 1px solid var(--line); }
  .system-steps article:last-child { border-bottom: 0; }
  .idea-heading { align-items: flex-start; gap: 1rem; }
  .media-browser { grid-template-columns: 1fr; gap: 1rem; }
  .sequence-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sequence-button { padding: .5rem; }
  .sequence-button strong { font-size: .73rem; }
  .sequence-button.is-active { border-left-color: transparent; border-bottom-color: var(--blue); }
  .speed-control { margin-top: 0; }
  .scene-arrow { width: 2.75rem; height: 2.75rem; }
  .scene-arrow:first-child { left: .5rem; }
  .scene-arrow:last-child { right: .5rem; }
  .video-footnote { grid-template-columns: 1fr; gap: .35rem; }
  .video-footnote p:last-child { text-align: left; }
  .benchmark-row { grid-template-columns: 1fr; gap: 1rem; padding: 1.3rem 0; }
  .reduction { text-align: left; }
  .bar-row { grid-template-columns: 4.5rem 1fr 4rem; }
  .site-footer { display: block; }
  .site-footer p + p { margin-top: .25rem; }
}

@media (max-width: 560px) {
  .sequence-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Interactive inference schedule. */
.method-figure { container-type: inline-size; }
.schedule-animation {
  display: block;
  width: 100%;
  height: calc(100cqw * .4375 + 64px);
  border: 0;
}
.paper-figure .animation-caption { display: block; }

@media (max-height: 560px) and (min-width: 901px) {
  .media-player { width: 100%; }
}
