:root {
  --ink: #1d2724;
  --ink-soft: #3d4a46;
  --muted: #66736f;
  --teal: #087f6f;
  --teal-dark: #07675c;
  --teal-soft: #e7f4f0;
  --orange: #ce6938;
  --orange-soft: #fff0e7;
  --blue: #3c6fa8;
  --blue-soft: #eaf1f8;
  --rose: #b94f6d;
  --paper: #ffffff;
  --mist: #f6f8f7;
  --line: #dce3e0;
  --line-dark: #cbd5d1;
  --code: #172521;
  --shadow: 0 16px 38px rgba(25, 51, 44, 0.09);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(8, 127, 111, 0.3);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  width: auto;
  height: auto;
  padding: 8px 12px;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
}

.container {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

.container-wide {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 38px;
  text-align: center;
}

.hero::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--teal) 0 45%, var(--orange) 45% 68%, var(--blue) 68% 100%);
  content: "";
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 14px;
}

.centered {
  text-align: center;
}

.hero h1 {
  max-width: 1050px;
  margin: 0 auto 24px;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 2.65rem;
  font-weight: 600;
  line-height: 1.16;
}

.hero h1 span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.72em;
  font-weight: 500;
}

.method-name {
  color: var(--teal);
  font-weight: 700;
}

.authors {
  max-width: 1100px;
  margin: 0 auto 7px;
  color: var(--ink-soft);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.9;
}

.authors a {
  font-weight: 500;
  text-decoration: none;
}

.authors sup,
.author-note sup {
  color: var(--orange);
  font-size: 0.72em;
}

.affiliations {
  color: var(--muted);
  font-size: 0.92rem;
}

.author-note {
  margin-top: 3px;
  color: #8a9491;
  font-size: 0.76rem;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.paper-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 7px 17px;
  border: 1.5px solid var(--teal);
  border-radius: 20px;
  background: #fff;
  color: var(--teal-dark);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.paper-links a:hover {
  background: var(--teal);
  color: #fff;
  transform: translateY(-1px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading h2,
.section-title {
  margin: 0;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}

.centered-heading {
  display: block;
  max-width: 820px;
  margin: 0 auto 30px;
  text-align: center;
}

.centered-heading > p:last-child {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.section-title {
  margin-bottom: 22px;
  text-align: center;
}

.demo-section {
  padding-top: 42px;
  background: var(--mist);
}

.demo-heading {
  margin-bottom: 18px;
}

.icon-button,
.figure-zoom,
.dialog-close {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.icon-button:hover,
.figure-zoom:hover,
.dialog-close:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.demo-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 720px;
  margin: 0 auto 14px;
  color: #8b9692;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
}

.demo-progress button {
  position: relative;
  padding: 8px 4px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.demo-progress button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--line-dark);
  content: "";
  transition: background-color 260ms ease;
}

.demo-progress b {
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}

.demo-progress button:hover,
.demo-progress button:focus-visible,
.demo-progress button.active {
  color: var(--teal-dark);
}

.demo-progress button:focus-visible {
  outline: 2px solid rgba(8, 127, 111, 0.3);
  outline-offset: 2px;
}

.demo-progress button.active::after {
  background: var(--teal);
}

.demo-progress button.done::after {
  background: rgba(8, 127, 111, 0.35);
}

.method-demo {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 30px minmax(0, 0.9fr) 30px minmax(0, 0.9fr);
  align-items: stretch;
  min-height: 470px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.compute-stage {
  position: relative;
  min-width: 0;
  padding: 24px;
  overflow: hidden;
  border-top: 4px solid transparent;
  transition: border-color 260ms ease, background-color 260ms ease, opacity 260ms ease;
}

.compute-stage:not(:first-child) {
  opacity: 0.58;
}

.method-demo[data-phase="0"] .gae-stage,
.method-demo[data-phase="1"] .hybrid-stage,
.method-demo[data-phase="2"] .critic-stage {
  border-top-color: var(--teal);
  background: linear-gradient(180deg, rgba(231, 244, 240, 0.56), rgba(255, 255, 255, 0) 36%);
  opacity: 1;
}

.method-demo[data-phase="1"] .gae-stage,
.method-demo[data-phase="2"] .gae-stage,
.method-demo[data-phase="2"] .hybrid-stage {
  opacity: 0.88;
}

.stage-index {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #d4dcd9;
  font-family: "Google Sans", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stage-copy {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 42px);
}

.stage-copy h3 {
  margin: 0 0 6px;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
}

.stage-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.pipeline-arrow {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--line-dark);
}

.pipeline-arrow::before {
  position: absolute;
  inset: 28px 50%;
  width: 1px;
  background: var(--line);
  content: "";
}

.pipeline-arrow i {
  position: relative;
  z-index: 1;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: #fff;
  font-size: 0.72rem;
}

.method-demo[data-phase="1"] .pipeline-arrow:first-of-type,
.method-demo[data-phase="2"] .pipeline-arrow {
  color: var(--teal);
}

.trajectory {
  display: grid;
  gap: 8px;
  margin-top: 26px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--mist);
}

.turn-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.turn-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.token-sequence {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  min-height: 28px;
}

.turn-row:last-child .token-sequence {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.token-sequence i {
  display: grid;
  min-width: 0;
  min-height: 28px;
  place-items: center;
  padding: 2px 3px;
  overflow: hidden;
  border: 1px solid #d4dedb;
  border-radius: 4px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.61rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}

.method-demo[data-phase="0"] .token-sequence i {
  animation: tokenSweep 2.15s ease both;
  animation-delay: calc(var(--token) * 95ms);
}

.token-sequence .reward-token {
  border-color: rgba(206, 105, 56, 0.45);
  background: var(--orange-soft);
  color: var(--orange);
  font-weight: 700;
}

@keyframes tokenSweep {
  0%, 18% { border-color: #d4dedb; background: #fff; color: var(--ink-soft); }
  45%, 70% { border-color: var(--blue); background: var(--blue); color: #fff; }
  100% { border-color: #bcd1e6; background: var(--blue-soft); color: var(--blue); }
}

.advantage-pair {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.advantage-row {
  display: grid;
  grid-template-columns: 66px 1fr;
  align-items: center;
  gap: 8px;
}

.advantage-row > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.adv-bars {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 44px;
  padding: 4px 7px;
  border-bottom: 1px solid var(--line-dark);
}

.adv-bars i {
  width: 100%;
  height: 0;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
  opacity: 0.72;
  transition: height 520ms ease;
}

.method-demo[data-phase="0"] .adv-bars i,
.method-demo[data-phase="1"] .adv-bars i,
.method-demo[data-phase="2"] .adv-bars i {
  height: var(--bar);
}

.method-demo[data-phase="0"] .adv-bars i {
  animation: growBar 640ms ease both;
}

.adv-bars i:nth-child(2) { animation-delay: 100ms; }
.adv-bars i:nth-child(3) { animation-delay: 180ms; }
.adv-bars i:nth-child(4) { animation-delay: 260ms; }
.adv-bars i:nth-child(5) { animation-delay: 340ms; }
.adv-bars i:nth-child(6) { animation-delay: 420ms; }
.adv-bars i:nth-child(7) { animation-delay: 500ms; }

@keyframes growBar {
  from { height: 0; }
  to { height: var(--bar); }
}

.turn-bands {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 4px;
  height: 24px;
}

.turn-bands i {
  border-radius: 3px;
  background: var(--orange-soft);
  box-shadow: inset 0 0 0 1px rgba(206, 105, 56, 0.32);
}

.method-demo[data-phase="0"] .turn-bands i {
  animation: turnPulse 1.25s ease both;
}

.turn-bands i:nth-child(2) { animation-delay: 220ms; }
.turn-bands i:nth-child(3) { animation-delay: 440ms; }

@keyframes turnPulse {
  0%, 20% { background: var(--orange-soft); }
  50%, 78% { background: var(--orange); }
  100% { background: rgba(206, 105, 56, 0.22); }
}

.hybrid-stage,
.critic-stage {
  display: flex;
  flex-direction: column;
}

.mix-visual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 7px;
  margin-top: 34px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--mist);
}

.mix-source,
.mix-result {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.mix-source span {
  grid-column: 1 / -1;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-align: center;
}

.mix-source i,
.mix-result i {
  height: 34px;
  border-radius: 3px;
}

.token-source i {
  background: var(--blue-soft);
  box-shadow: inset 0 0 0 1px #c5d8e9;
}

.token-source i:nth-of-type(2),
.token-source i:nth-of-type(4) {
  height: 24px;
  align-self: end;
}

.turn-source i {
  background: var(--orange-soft);
  box-shadow: inset 0 0 0 1px #eed0bf;
}

.mix-plus,
.mix-equals {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.mix-equals {
  grid-column: 1 / -1;
  justify-self: center;
  line-height: 1;
}

.mix-result {
  grid-column: 1 / -1;
  width: 72%;
  justify-self: center;
}

.mix-result i {
  height: 38px;
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px #b7d8cf;
  transform: scaleY(0.35);
  transform-origin: bottom;
  transition: transform 500ms ease, background-color 500ms ease;
}

.mix-result i:nth-child(2) { height: 29px; }
.mix-result i:nth-child(3) { height: 34px; }
.mix-result i:nth-child(4) { height: 25px; }

.method-demo[data-phase="1"] .mix-result i,
.method-demo[data-phase="2"] .mix-result i {
  background: var(--teal);
  transform: scaleY(1);
}

.method-demo[data-phase="1"] .mix-result i {
  animation: mixResolve 900ms ease both;
}

.mix-result i:nth-child(2) { animation-delay: 80ms; }
.mix-result i:nth-child(3) { animation-delay: 160ms; }
.mix-result i:nth-child(4) { animation-delay: 240ms; }
.mix-result i:nth-child(5) { animation-delay: 320ms; }

@keyframes mixResolve {
  from { background: var(--teal-soft); transform: scaleY(0.35); }
  to { background: var(--teal); transform: scaleY(1); }
}

.demo-equation {
  margin-top: auto;
  padding: 12px;
  overflow: hidden;
  border-left: 3px solid var(--teal);
  border-radius: 0 4px 4px 0;
  background: var(--teal-soft);
}

.equation-label {
  display: block;
  margin-bottom: 3px;
  color: var(--teal-dark);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.demo-equation strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-family: Georgia, serif;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.6;
}

.critic-flow {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) 30px minmax(92px, 1fr);
  align-items: center;
  margin: 38px 0 22px;
}

.critic-inputs {
  display: grid;
  gap: 10px;
}

.critic-inputs span,
.critic-output span {
  display: grid;
  min-height: 34px;
  place-items: center;
  padding: 5px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
}

.critic-lines {
  display: grid;
  gap: 25px;
}

.critic-lines i {
  position: relative;
  height: 2px;
  overflow: hidden;
  background: var(--line-dark);
}

.critic-lines i::after {
  position: absolute;
  top: 0;
  left: -60%;
  width: 55%;
  height: 2px;
  background: var(--teal);
  content: "";
}

.method-demo[data-phase="2"] .critic-lines i::after {
  animation: valueFlow 1s ease-in-out infinite;
}

.critic-lines i:nth-child(2)::after {
  animation-delay: 260ms;
}

@keyframes valueFlow {
  from { left: -60%; }
  to { left: 105%; }
}

.critic-core {
  display: grid;
  min-height: 116px;
  place-items: center;
  align-content: center;
  border: 2px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-soft);
  box-shadow: 0 9px 20px rgba(8, 127, 111, 0.1);
  text-align: center;
}

.critic-core small,
.critic-core span {
  color: var(--teal-dark);
  font-size: 0.58rem;
  font-weight: 700;
}

.critic-core strong {
  color: var(--teal-dark);
  font-family: Georgia, serif;
  font-size: 2rem;
  line-height: 1.1;
}

.critic-output {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.critic-output span {
  min-height: 28px;
  padding: 4px 12px;
  border-color: rgba(206, 105, 56, 0.38);
  background: var(--orange-soft);
  color: var(--orange);
}

.critic-output strong {
  color: var(--orange);
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.method-demo[data-phase="2"] .critic-core {
  animation: criticPulse 1.35s ease-in-out infinite;
}

@keyframes criticPulse {
  0%, 100% { box-shadow: 0 9px 20px rgba(8, 127, 111, 0.1); }
  50% { box-shadow: 0 9px 26px rgba(8, 127, 111, 0.28); }
}

.critic-equation {
  border-left-color: var(--orange);
  background: var(--orange-soft);
}

.critic-equation .equation-label {
  color: var(--orange);
}

.demo-caption {
  max-width: 920px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.abstract-section {
  background: #fff;
}

.abstract-copy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.03rem;
  line-height: 1.85;
  text-align: justify;
}

.abstract-copy strong {
  color: var(--teal-dark);
}

.background-section {
  background: var(--mist);
}

.view-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  max-width: 940px;
  margin: 0 auto 30px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--line-dark);
}

.view-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 0 14px;
  padding: 22px;
  background: #fff;
}

.view-mark {
  grid-row: 1 / 4;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  font-size: 1rem;
}

.token-view .view-mark {
  background: var(--blue-soft);
  color: var(--blue);
}

.turn-view .view-mark {
  background: var(--orange-soft);
  color: var(--orange);
}

.view-item h3 {
  margin: 0;
  font-family: "Google Sans", sans-serif;
  font-size: 1.06rem;
}

.view-item p {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.view-item code {
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  overflow-wrap: anywhere;
  border-radius: 4px;
  background: var(--mist);
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
}

.research-figure {
  position: relative;
  margin: 0;
}

.research-figure img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.research-figure figcaption {
  max-width: 920px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.figure-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  box-shadow: 0 4px 12px rgba(20, 38, 33, 0.12);
}

.wide-figure {
  max-width: 1120px;
  margin: 0 auto;
}

.formulation-section {
  background: #fbfcfc;
}

.formulation-surrogates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.surrogate-view {
  min-width: 0;
  padding: 24px 28px 22px;
}

.surrogate-view + .surrogate-view {
  border-left: 1px solid var(--line-dark);
}

.surrogate-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.surrogate-heading span,
.finding-label {
  color: var(--teal-dark);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.turn-view .surrogate-heading span {
  color: var(--orange);
}

.token-view .surrogate-heading span {
  color: var(--blue);
}

.surrogate-heading strong {
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1rem;
  line-height: 1.35;
}

.pomdp-definitions {
  margin: 16px 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.pomdp-definitions > div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
}

.pomdp-definitions > div + div {
  border-top: 1px solid var(--line);
}

.pomdp-definitions dt {
  color: var(--ink);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pomdp-definitions dd {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.surrogate-equation,
.finding-equation {
  overflow-x: auto;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.surrogate-equation mjx-container,
.finding-equation mjx-container {
  margin: 12px 0 !important;
}

.surrogate-view p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.formulation-finding {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.5fr);
  gap: 36px;
  max-width: 1120px;
  margin: 28px auto 0;
  padding: 22px 28px;
  border-left: 4px solid var(--teal);
  background: var(--teal-soft);
}

.formulation-finding h3 {
  margin: 5px 0 0;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.12rem;
  line-height: 1.35;
}

.finding-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.method-section {
  background: #fff;
}

.algorithm-figure {
  max-width: 1120px;
  margin: 0 auto 32px;
}

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

.method-points article {
  position: relative;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--mist);
}

.point-number {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
  font-family: "Google Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
}

.method-points article:nth-child(2) .point-number {
  color: var(--blue);
}

.method-points article:nth-child(3) .point-number {
  color: var(--orange);
}

.method-points h3 {
  margin: 0 0 6px;
  font-family: "Google Sans", sans-serif;
  font-size: 1rem;
}

.method-points p {
  min-height: 48px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.equation-line {
  min-height: 58px;
  padding: 4px 8px;
  overflow-x: auto;
  border-radius: 4px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.hygae-estimation {
  max-width: 1120px;
  margin: 38px auto 0;
  padding-top: 34px;
  border-top: 1px solid var(--line-dark);
}

.estimation-heading {
  max-width: 760px;
  margin: 0 auto 24px;
  text-align: center;
}

.estimation-heading h3 {
  margin: 0;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.5rem;
  line-height: 1.3;
}

.estimation-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.estimation-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
}

.estimation-block {
  min-width: 0;
  padding: 24px;
}

.estimation-block + .estimation-block {
  border-left: 1px solid var(--line-dark);
}

.estimation-block > span {
  color: var(--teal-dark);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.critic-estimation > span {
  color: var(--blue);
}

.estimation-block h4 {
  margin: 4px 0 8px;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.05rem;
}

.estimation-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.estimation-equation {
  margin: 13px 0;
  padding: 7px 10px;
  overflow-x: auto;
  background: var(--mist);
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.estimation-equation mjx-container {
  margin: 7px 0 !important;
}

.stacked-equation {
  margin-bottom: 9px;
}

.final-equation {
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
}

.estimation-update {
  margin: 16px 0 0;
  padding: 13px 18px;
  border-left: 3px solid var(--teal);
  background: var(--teal-soft);
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

.results-section {
  background: var(--mist);
}

.result-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1000px;
  margin: 0 auto 26px;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.result-highlights article {
  position: relative;
  display: grid;
  min-height: 96px;
  place-content: center;
  padding: 13px 16px;
  text-align: center;
}

.result-highlights article + article::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 1px;
  background: var(--line-dark);
  content: "";
}

.result-highlights strong {
  color: var(--teal-dark);
  font-family: "Google Sans", sans-serif;
  font-size: 1.85rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.result-highlights article:nth-child(2) strong {
  color: var(--orange);
}

.result-highlights article:nth-child(3) strong {
  color: var(--blue);
}

.result-highlights article:nth-child(4) strong {
  color: var(--rose);
}

.result-highlights span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.results-table-shell {
  max-width: 1240px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(25, 51, 44, 0.05);
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  min-width: 1130px;
  border-collapse: collapse;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.results-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.results-table th,
.results-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

.results-table thead th {
  background: #eef2f0;
  color: var(--ink);
  font-family: "Google Sans", sans-serif;
  font-weight: 600;
}

.results-table thead tr:first-child th {
  border-bottom-color: var(--line-dark);
}

.results-table thead th:first-child,
.results-table tbody tr:not(.group-row) th {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 175px;
  background: #fff;
  text-align: left;
}

.results-table thead th:first-child {
  z-index: 3;
  background: #eef2f0;
}

.results-table tbody tr:not(.group-row) th {
  font-weight: 600;
}

.results-table .group-row th {
  padding: 7px 12px;
  background: #f3f5f4;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: italic;
  font-weight: 600;
  text-align: left;
}

.results-table .ours-row th,
.results-table .ours-row td {
  background: var(--teal-soft);
  font-weight: 700;
}

.results-table .ours-row th {
  z-index: 2;
}

.results-table .ours-row th span {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--teal);
  color: #fff;
  font-size: 0.58rem;
  text-transform: uppercase;
}

.best {
  color: var(--teal-dark);
  font-weight: 700;
}

.analysis-band {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.8fr);
  align-items: center;
  gap: 38px;
  max-width: 1120px;
  margin: 38px auto 0;
}

.analysis-figure img {
  background: #fff;
}

.ablation-block h3 {
  margin: 0;
  font-family: "Google Sans", sans-serif;
  font-size: 1.35rem;
}

.ablation-block > div:first-child > p:last-child {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.alpha-grid {
  display: grid;
  grid-template-columns: 74px repeat(5, minmax(44px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: #fff;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.alpha-grid > * {
  display: grid;
  min-height: 34px;
  place-items: center;
  padding: 4px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.alpha-grid > *:nth-child(6n) {
  border-right: 0;
}

.alpha-grid > *:nth-last-child(-n + 6) {
  border-bottom: 0;
}

.alpha-grid > :nth-child(-n + 6) {
  background: #eef2f0;
  color: var(--muted);
  font-weight: 700;
}

.alpha-grid b {
  justify-items: start;
  background: #f7f9f8;
  color: var(--ink-soft);
  font-weight: 600;
}

.alpha-grid .selected,
.alpha-grid strong {
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 700;
}

.qualitative-section {
  background: #fff;
}

.trace-highlight-key {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
  margin: -6px auto 18px;
  color: var(--muted);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
}

.trace-highlight-key span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trace-highlight-key i {
  display: block;
  width: 14px;
  height: 3px;
}

.observation-swatch {
  background: #3c6fa8;
}

.reasoning-swatch {
  background: #b9582b;
}

.prediction-swatch {
  background: #a6415d;
}

.action-swatch {
  background: #087f6f;
}

.qual-tabs {
  display: flex;
  max-width: 860px;
  margin: 0 auto 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-dark);
  scrollbar-width: thin;
}

.qual-tabs button {
  position: relative;
  flex: 1 0 auto;
  min-height: 44px;
  padding: 8px 18px 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: "Google Sans", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.qual-tabs button::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 3px;
  background: transparent;
  content: "";
}

.qual-tabs button:hover,
.qual-tabs button[aria-selected="true"] {
  color: var(--teal-dark);
}

.qual-tabs button[aria-selected="true"]::after {
  background: var(--teal);
}

.qual-panel {
  max-width: 1160px;
  margin: 0 auto;
}

.qual-panel[hidden] {
  display: none;
}

.rollout-summary {
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 11px 16px;
  border-left: 3px solid var(--teal);
  background: var(--mist);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.rollout-summary strong {
  color: var(--ink-soft);
}

.comparison-labels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-family: "Google Sans", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.comparison-labels span:last-child {
  color: var(--teal-dark);
}

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

.rollout-side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.turn-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.baseline-side .turn-card {
  border-color: #e1d9d4;
  background: #fffdfc;
}

.ours-side .turn-card {
  border-color: #bfdbd4;
  background: #fbfffd;
}

.turn-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.turn-number {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 3px;
  background: rgba(29, 39, 36, 0.84);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
}

.turn-card p {
  min-height: 54px;
  margin: 0;
  padding: 10px;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 0.69rem;
  line-height: 1.45;
}

.turn-card p b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.turn-card p em {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.57rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.success-card {
  box-shadow: inset 0 -3px 0 var(--teal);
}

.one-step-rollout {
  grid-template-columns: minmax(0, 1fr) 1fr 1fr;
}

.one-step-rollout .turn-card {
  grid-column: 1 / 2;
}

.qual-source {
  max-width: 900px;
  margin: 22px auto 0;
  color: #8a9491;
  font-size: 0.7rem;
  text-align: center;
}

.citation-section {
  background: var(--mist);
}

.citation-venue {
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.bibtex-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--code);
  box-shadow: var(--shadow);
}

.bibtex-wrapper button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
}

.bibtex-wrapper button:hover {
  background: rgba(255, 255, 255, 0.18);
}

pre {
  margin: 0;
  padding: 54px 20px 20px;
  overflow-x: auto;
}

pre code {
  color: #e7f2ee;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.6;
}

.footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

.figure-dialog {
  width: min(1200px, calc(100% - 40px));
  max-height: calc(100vh - 40px);
  padding: 44px 18px 18px;
  overflow: auto;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 30, 26, 0.24);
}

.figure-dialog::backdrop {
  background: rgba(20, 29, 27, 0.72);
}

.figure-dialog img {
  width: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
}

.dialog-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 32px;
  height: 32px;
}

@media (max-width: 1100px) {
  .method-demo {
    grid-template-columns: 1fr 24px 1fr;
  }

  .critic-stage {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .method-demo > .pipeline-arrow:last-of-type {
    display: none;
  }

  .critic-flow {
    width: min(480px, 100%);
    margin-right: auto;
    margin-left: auto;
  }

  .critic-equation {
    width: min(500px, 100%);
    margin-right: auto;
    margin-left: auto;
  }

  .analysis-band {
    grid-template-columns: 1fr;
  }

  .ablation-block {
    max-width: 620px;
    margin: 0 auto;
  }
}

@media (max-width: 820px) {
  .hero {
    padding: 48px 0 30px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  section {
    padding: 56px 0;
  }

  .section-heading h2,
  .section-title {
    font-size: 1.7rem;
  }

  .demo-heading {
    display: block;
  }

  .method-demo {
    grid-template-columns: 1fr;
  }

  .method-demo > .pipeline-arrow {
    display: none;
  }

  .compute-stage {
    min-height: 400px;
    border-top: 1px solid var(--line);
  }

  .compute-stage:first-child {
    border-top: 4px solid transparent;
  }

  .view-comparison,
  .method-points {
    grid-template-columns: 1fr;
  }

  .method-points p {
    min-height: 0;
  }

  .result-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-highlights article:nth-child(3)::before {
    display: none;
  }

  .result-highlights article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-dark);
  }

  .comparison-labels,
  .paired-rollouts {
    gap: 18px;
  }

  .rollout-side {
    grid-template-columns: 1fr;
  }

  .one-step-rollout {
    grid-template-columns: 1fr;
  }

  .one-step-rollout .turn-card {
    grid-column: auto;
  }

  .turn-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .container,
  .container-wide {
    width: min(100% - 26px, 1240px);
  }

  .hero h1 {
    font-size: 1.55rem;
  }

  .hero h1 span:last-child {
    margin-top: 7px;
    font-size: 0.76em;
  }

  .authors {
    font-size: 0.85rem;
  }

  section {
    padding: 46px 0;
  }

  .section-heading h2,
  .section-title {
    font-size: 1.48rem;
  }

  .demo-progress {
    font-size: 0.62rem;
  }

  .demo-progress b {
    display: block;
  }

  .compute-stage {
    min-height: 0;
    padding: 20px 16px;
  }

  .turn-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 6px;
  }

  .token-sequence i {
    font-size: 0.53rem;
  }

  .view-item {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 17px;
  }

  .view-mark {
    width: 36px;
    height: 36px;
  }

  .result-highlights strong {
    font-size: 1.5rem;
  }

  .alpha-grid {
    grid-template-columns: 64px repeat(5, minmax(38px, 1fr));
    overflow-x: auto;
    font-size: 0.63rem;
  }

  .comparison-labels,
  .paired-rollouts {
    grid-template-columns: 1fr;
  }

  .comparison-labels {
    display: none;
  }

  .rollout-side::before {
    display: block;
    margin: 4px 0;
    color: var(--ink-soft);
    font-family: "Google Sans", sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
  }

  .baseline-side::before {
    content: "Baseline";
  }

  .ours-side::before {
    color: var(--teal-dark);
    content: "HyGAE";
  }

  .turn-card {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
  }

  .turn-card img {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .turn-number {
    font-size: 0.54rem;
  }

  .turn-card p {
    min-width: 0;
    min-height: 0;
    font-size: 0.67rem;
  }

  .abstract-copy {
    font-size: 0.94rem;
    text-align: left;
  }

  pre code {
    font-size: 0.68rem;
  }
}

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

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

/* Paper release placeholder */
.paper-link-disabled {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 7px 17px;
  border: 1.5px solid var(--line-dark);
  border-radius: 20px;
  background: var(--mist);
  color: var(--muted);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: not-allowed;
}

/* Animated HyGAE algorithm */
.method-demo {
  position: relative;
  display: block;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.algorithm-motion-grid {
  display: grid;
  grid-template-columns: 184px repeat(3, minmax(0, 1fr)) 172px;
  min-width: 0;
}

.algorithm-labels,
.algorithm-turn {
  display: grid;
  grid-template-rows: 90px 44px 100px 48px 112px 44px 100px;
  min-width: 0;
}

.algorithm-labels {
  grid-column: 1;
  grid-row: 1;
  border-right: 1px solid #202522;
  background: #fff;
}

.algorithm-turn {
  --adv: #f2ad70;
  --adv-border: #cf684d;
  --adv-ink: #6d2f1f;
  --value: #a9c8e2;
  --value-border: #5c9bd2;
  --value-ink: #193f6f;
  position: relative;
  padding: 0;
}

.algorithm-turn.turn-two {
  --adv: #e8692f;
  --adv-border: #c94d2d;
  --adv-ink: #5f2417;
  --value: #5592c3;
  --value-border: #377bb6;
  --value-ink: #123964;
}

.algorithm-turn.turn-three {
  --adv: #9f3819;
  --adv-border: #813018;
  --adv-ink: #38130b;
  --value: #214b84;
  --value-border: #173d72;
  --value-ink: #081d3b;
}

.algorithm-turn.turn-one {
  grid-column: 2;
  grid-row: 1;
}

.algorithm-turn.turn-two {
  grid-column: 3;
  grid-row: 1;
}

.algorithm-turn.turn-three {
  grid-column: 4;
  grid-row: 1;
}

.algorithm-turn + .algorithm-turn {
  border-left: 2px dotted #6f7773;
}

.algorithm-row-label,
.algorithm-label-spacer {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 8px 16px;
  color: #1c211f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  transition: background-color 260ms ease, color 260ms ease;
}

.algorithm-label-spacer {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.algorithm-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px;
}

.algorithm-row::before {
  display: none;
  content: attr(data-label);
}

.algorithm-turn-title {
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #171b19;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  font-weight: 700;
}

.turn-adv-row::after,
.turn-value-row::after {
  position: absolute;
  z-index: 0;
  inset: 6px 7px;
  border: 1.5px dashed #202522;
  border-radius: 8px;
  content: "";
  pointer-events: none;
}

.turn-adv-row {
  align-items: end;
  padding-top: 33px;
}

.turn-adv-row::after {
  top: 27px;
}

.turn-value-row {
  align-items: end;
  padding-top: 52px;
}

.token-adv-row,
.token-value-row {
  align-items: start;
  padding-bottom: 36px;
}

.turn-gae-links {
  position: relative;
  z-index: 3;
  grid-row: 1;
  grid-column: 2 / 5;
  pointer-events: none;
}

.turn-gae-links i {
  position: absolute;
  top: 18px;
  width: 33.33%;
  height: 21px;
  border-top: 1.5px solid #252a28;
  border-radius: 50% 50% 0 0;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: right;
}

.turn-gae-links i:first-child {
  right: 50%;
}

.turn-gae-links i:last-child {
  right: 16.67%;
}

.turn-gae-links i::before {
  position: absolute;
  top: 2px;
  left: 0;
  width: 7px;
  height: 8px;
  background: #252a28;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  content: "";
}

.algorithm-cell {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  min-height: 45px;
  place-items: center;
  border: 1.5px solid;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(6px) scale(0.78);
}

.algorithm-cell mjx-container,
.operation-plus mjx-container,
.legend-cell mjx-container,
.legend-plus mjx-container {
  max-width: 100%;
  margin: 0 !important;
}

.algorithm-cell mjx-container {
  overflow: hidden;
  font-size: 78% !important;
}

.adv-cell {
  border-color: var(--adv-border);
  background: color-mix(in srgb, var(--adv) 68%, white);
  color: var(--adv-ink);
}

.token-adv-cell:nth-of-type(1) {
  background: color-mix(in srgb, var(--adv) 28%, white);
}

.token-adv-cell:nth-of-type(2) {
  background: color-mix(in srgb, var(--adv) 45%, white);
}

.token-adv-cell:nth-of-type(3) {
  background: color-mix(in srgb, var(--adv) 62%, white);
}

.token-adv-cell:nth-of-type(4) {
  background: color-mix(in srgb, var(--adv) 82%, white);
}

.value-cell {
  border-color: var(--value-border);
  background: color-mix(in srgb, var(--value) 72%, white);
  color: var(--value-ink);
}

.token-value-cell:nth-of-type(1) {
  background: color-mix(in srgb, var(--value) 28%, white);
}

.token-value-cell:nth-of-type(2) {
  background: color-mix(in srgb, var(--value) 45%, white);
}

.token-value-cell:nth-of-type(3) {
  background: color-mix(in srgb, var(--value) 64%, white);
}

.token-value-cell:nth-of-type(4) {
  background: color-mix(in srgb, var(--value) 84%, white);
}

.broadcast-cell {
  display: flex;
  min-height: 45px;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  background: color-mix(in srgb, var(--value) 54%, white);
}

.broadcast-cell b,
.broadcast-cell small {
  display: block;
  font-weight: 400;
  line-height: 1;
}

.broadcast-cell b mjx-container {
  font-size: 52% !important;
}

.broadcast-cell small mjx-container {
  font-size: 60% !important;
}

.operation-plus {
  position: relative;
  z-index: 2;
  display: grid;
  width: 30px;
  height: 30px;
  place-self: center;
  place-items: center;
  border: 1.5px solid #242927;
  border-radius: 50%;
  background: #fff;
  color: #1b201e;
  opacity: 0;
  transform: scale(0.45) rotate(-40deg);
}

.operation-plus mjx-container {
  font-size: 74% !important;
}

.gae-arcs {
  position: absolute;
  z-index: 1;
  right: 12.5%;
  bottom: 18px;
  left: 12.5%;
  display: grid;
  height: 19px;
  grid-template-columns: repeat(3, 1fr);
  pointer-events: none;
}

.gae-arcs i {
  position: relative;
  border-bottom: 1.5px solid #252a28;
  border-radius: 0 0 50% 50%;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: right;
}

.gae-arcs i::before {
  position: absolute;
  top: calc(100% - 9px);
  left: -0.5ex;
  width: 7px;
  height: 8px;
  background: #252a28;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  content: "";
}

.broadcast-arcs {
  position: absolute;
  z-index: 1;
  top: 18px;
  right: 12.5%;
  left: 12.5%;
  height: 38px;
  pointer-events: none;
}

.broadcast-arcs i {
  position: absolute;
  right: 0;
  border-top: 1.5px dotted #252a28;
  border-radius: 50% 50% 0 0;
  opacity: 0;
  clip-path: inset(0 0 0 100%);
}

.broadcast-arcs i::before {
  position: absolute;
  top: calc(50% - 8px);
  left: 0;
  width: 7px;
  height: 8px;
  background: #252a28;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  content: "";
}

.broadcast-arcs .arc-long {
  top: 0;
  width: 100%;
  height: 33px;
}

.broadcast-arcs .arc-medium {
  top: 10px;
  width: 66.66%;
  height: 23px;
}

.broadcast-arcs .arc-short {
  top: 20px;
  width: 33.33%;
  height: 13px;
}

.algorithm-legend {
  grid-column: 5;
  grid-row: 1 / -1;
  display: grid;
  align-content: center;
  gap: 13px;
  padding: 20px 13px;
  border-left: 1px solid var(--line-dark);
  background: #fbfcfb;
}

.algorithm-legend > div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.algorithm-legend strong {
  color: #202522;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
}

.legend-cell {
  display: grid;
  width: 46px;
  min-height: 38px;
  place-items: center;
  border: 1.5px solid;
  border-radius: 6px;
}

.legend-cell mjx-container {
  font-size: 66% !important;
}

.legend-adv {
  border-color: #cf684d;
  background: #f2ad70;
  color: #6d2f1f;
}

.legend-value {
  border-color: #377bb6;
  background: #5592c3;
  color: #123964;
}

.legend-broadcast {
  border-color: #80aede;
  background: #dce9f5;
  color: #193f6f;
}

.legend-broadcast mjx-container {
  font-size: 46% !important;
}

.legend-arrow {
  position: relative;
  display: block;
  width: 44px;
  height: 2px;
  background: #202522;
}

.legend-arrow::before {
  position: absolute;
  top: -3px;
  left: 0;
  width: 7px;
  height: 8px;
  background: #202522;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
  content: "";
}

.legend-arrow.dotted {
  background: repeating-linear-gradient(90deg, #202522 0 4px, transparent 4px 9px);
}

.legend-plus {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1.5px solid #202522;
  border-radius: 50%;
}

.legend-turn {
  width: 46px;
  height: 34px;
  border: 1.5px dashed #202522;
  border-radius: 5px;
}

.method-demo[data-phase="0"] .stage-gae-cell {
  animation: algorithm-cell-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.method-demo[data-phase="0"] .token-adv-cell {
  animation-delay: calc((11 - var(--order)) * 130ms);
}

.method-demo[data-phase="0"] .turn-adv-cell {
  animation-delay: calc((23 - var(--order)) * 130ms);
}

.method-demo[data-phase="0"] .token-value-cell {
  animation: algorithm-cell-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc((11 - var(--order)) * 130ms);
}

.method-demo[data-phase="0"] .turn-value-anchor {
  animation: algorithm-cell-in 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--reverse-turn-cell-delay);
}

.method-demo[data-phase="0"] .advantage-arcs i {
  animation: gae-arc-draw 460ms ease both;
  animation-delay: calc(650ms + var(--reverse-turn-arc-delay) + var(--reverse-arc-delay));
}

.method-demo[data-phase="0"] .value-arcs i {
  animation: gae-arc-draw 460ms ease both;
  animation-delay: calc(650ms + var(--reverse-turn-arc-delay) + var(--reverse-arc-delay));
}

.method-demo[data-phase="0"] .turn-gae-links i {
  animation: gae-arc-draw 620ms ease both;
}

.method-demo[data-phase="0"] .turn-gae-links i:last-child {
  animation-delay: 1050ms;
}

.method-demo[data-phase="0"] .turn-gae-links i:first-child {
  animation-delay: 1450ms;
}

.advantage-arcs i,
.value-arcs i {
  --reverse-arc-delay: 140ms;
}

.advantage-arcs i:nth-child(2),
.value-arcs i:nth-child(2) {
  --reverse-arc-delay: 70ms;
}

.advantage-arcs i:nth-child(3),
.value-arcs i:nth-child(3) {
  --reverse-arc-delay: 0ms;
}

.method-demo[data-phase="1"] .stage-gae-cell {
  opacity: 0.82;
  transform: none;
}

.method-demo[data-phase="1"] .token-value-cell,
.method-demo[data-phase="1"] .turn-value-anchor {
  opacity: 0.42;
  transform: none;
}

.method-demo[data-phase="1"] .advantage-arcs i {
  opacity: 0.65;
  transform: none;
}

.method-demo[data-phase="1"] .value-arcs i {
  opacity: 0.3;
  transform: none;
}

.method-demo[data-phase="1"] .turn-gae-links i {
  opacity: 0.65;
  transform: none;
}

.method-demo[data-phase="1"] .hybrid-plus {
  animation: operation-pop 420ms cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
  animation-delay: calc((var(--turn-index, 0) * 4 + var(--operator-index, 0)) * 48ms);
}

.hybrid-operation-row .operation-plus:nth-child(2),
.unified-operation-row .operation-plus:nth-child(2) {
  --operator-index: 1;
}

.hybrid-operation-row .operation-plus:nth-child(3),
.unified-operation-row .operation-plus:nth-child(3) {
  --operator-index: 2;
}

.hybrid-operation-row .operation-plus:nth-child(4),
.unified-operation-row .operation-plus:nth-child(4) {
  --operator-index: 3;
}

.turn-one {
  --turn-index: 0;
  --reverse-turn-cell-delay: 1040ms;
  --reverse-turn-arc-delay: 520ms;
}

.turn-two {
  --turn-index: 1;
  --reverse-turn-cell-delay: 520ms;
  --reverse-turn-arc-delay: 260ms;
}

.turn-three {
  --turn-index: 2;
  --reverse-turn-cell-delay: 0ms;
  --reverse-turn-arc-delay: 0ms;
}

.method-demo[data-phase="2"] .stage-gae-cell,
.method-demo[data-phase="2"] .hybrid-plus,
.method-demo[data-phase="2"] .advantage-arcs i,
.method-demo[data-phase="2"] .turn-gae-links i {
  opacity: 0.4;
  transform: none;
}

.method-demo[data-phase="2"] .token-value-cell,
.method-demo[data-phase="2"] .turn-value-anchor {
  opacity: 1;
  transform: none;
}

.method-demo[data-phase="2"] .broadcast-arcs i {
  animation: broadcast-draw 480ms ease both;
}

.method-demo[data-phase="2"] .broadcast-arcs .arc-short {
  animation-delay: calc(650ms + var(--turn-index) * 90ms);
}

.method-demo[data-phase="2"] .broadcast-arcs .arc-medium {
  animation-delay: calc(780ms + var(--turn-index) * 90ms);
}

.method-demo[data-phase="2"] .broadcast-arcs .arc-long {
  animation-delay: calc(910ms + var(--turn-index) * 90ms);
}

.method-demo[data-phase="2"] .broadcast-cell {
  animation: algorithm-cell-in 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.method-demo[data-phase="2"] .broadcast-cell:nth-of-type(4) {
  animation-delay: calc(900ms + var(--turn-index) * 90ms);
}

.method-demo[data-phase="2"] .broadcast-cell:nth-of-type(3) {
  animation-delay: calc(1030ms + var(--turn-index) * 90ms);
}

.method-demo[data-phase="2"] .broadcast-cell:nth-of-type(2) {
  animation-delay: calc(1160ms + var(--turn-index) * 90ms);
}

.method-demo[data-phase="2"] .value-arcs i {
  opacity: 0.7;
  transform: none;
}

.method-demo[data-phase="2"] .unified-plus {
  animation: operation-pop 420ms cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
  animation-delay: calc(1660ms + (var(--turn-index) * 4 + var(--operator-index, 0)) * 34ms);
}

.method-demo[data-phase="0"] .label-turn-adv,
.method-demo[data-phase="0"] .label-token-adv {
  background: #fff5ec;
  color: #8b351f;
}

.method-demo[data-phase="0"] .label-turn-value,
.method-demo[data-phase="0"] .label-token-value {
  background: #edf4fa;
  color: #214f80;
}

.method-demo[data-phase="1"] .label-hybrid {
  background: #fff0e4;
  color: #8b351f;
}

.method-demo[data-phase="2"] .label-turn-value,
.method-demo[data-phase="2"] .label-token-value,
.method-demo[data-phase="2"] .label-unified {
  background: #edf4fa;
  color: #214f80;
}

@keyframes algorithm-cell-in {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.78);
  }
  72% {
    opacity: 1;
    transform: translateY(-1px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes operation-pop {
  0% {
    opacity: 0;
    transform: scale(0.45) rotate(-40deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.1) rotate(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes gae-arc-draw {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes broadcast-draw {
  from {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
  }
  to {
    opacity: 1;
    clip-path: inset(0);
  }
}

/* Theorem cards */
.method-points .theorem-card {
  display: flex;
  min-height: 440px;
  flex-direction: column;
}

.method-points .theorem-label {
  min-height: 0;
  margin: -2px 0 4px;
  color: var(--teal-dark);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.method-points .theorem-card:nth-child(2) .theorem-label {
  color: var(--blue);
}

.method-points .theorem-card:nth-child(3) .theorem-label {
  color: var(--orange);
}

.method-points .theorem-card > .theorem-statement {
  min-height: 84px;
}

.theorem-card .equation-line {
  display: grid;
  min-height: 98px;
  margin-top: auto;
  place-items: center;
  font-size: 0.68rem;
}

.method-points .theorem-card > .theorem-meaning {
  min-height: 116px;
  margin: 14px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line-dark);
  color: var(--ink-soft);
  line-height: 1.55;
}

.theorem-meaning strong {
  color: var(--ink);
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.theorem-card .equation-line mjx-container {
  max-width: 100%;
  margin: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
}

.single-analysis {
  display: block;
  max-width: 920px;
}

/* Complete qualitative traces */
.trace-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.trace-comparison .rollout-side {
  display: block;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trace-comparison .baseline-side {
  border-color: #e1d9d4;
  background: #fffdfc;
}

.trace-comparison .ours-side {
  border-color: #bfdbd4;
  background: #fbfffd;
}

.trace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.trace-header span {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ours-side .trace-header span,
.ours-side .trace-header h3 {
  color: var(--teal-dark);
}

.trace-header h3 {
  margin: 1px 0 0;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1rem;
}

.trace-header small {
  color: var(--muted);
  font-size: 0.64rem;
  text-align: right;
}

.trace-turn {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.trace-turn img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.trace-turn > div {
  min-width: 0;
}

.trace-turn .turn-number {
  position: static;
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--ink-soft);
  font-size: 0.58rem;
}

.ours-side .trace-turn .turn-number {
  background: var(--teal);
}

.model-output {
  margin: 8px 0 0;
  padding: 9px;
  overflow: visible;
  border: 1px solid #e6ebe9;
  border-radius: 4px;
  background: var(--mist);
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.64rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.trace-observation,
.trace-reasoning,
.trace-prediction,
.trace-action {
  background: transparent;
}

.trace-observation {
  color: #315f91;
}

.trace-reasoning {
  color: #a64c25;
}

.trace-prediction {
  color: #963b55;
}

.trace-action {
  color: #087064;
  font-weight: 700;
}

.trace-final {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid #bfdbd4;
  border-radius: 6px;
  background: var(--teal-soft);
}

.trace-final.partial {
  border-color: #efd4c6;
  background: var(--orange-soft);
}

.trace-final img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.trace-final figcaption {
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-align: left;
}

@media (max-width: 1120px) {
  .algorithm-motion-grid {
    grid-template-columns: 176px repeat(3, minmax(0, 1fr));
  }

  .algorithm-legend {
    display: none;
  }
}

@media (max-width: 900px) {
  .formulation-surrogates,
  .formulation-finding {
    grid-template-columns: 1fr;
  }

  .surrogate-view + .surrogate-view {
    border-top: 1px solid var(--line-dark);
    border-left: 0;
  }

  .formulation-finding {
    gap: 14px;
  }

  .estimation-grid {
    grid-template-columns: 1fr;
  }

  .estimation-block + .estimation-block {
    border-top: 1px solid var(--line-dark);
    border-left: 0;
  }

  .algorithm-motion-grid {
    grid-template-columns: 1fr;
  }

  .algorithm-labels,
  .algorithm-legend {
    display: none;
  }

  .algorithm-turn.turn-one,
  .algorithm-turn.turn-two,
  .algorithm-turn.turn-three {
    grid-column: 1;
    grid-row: auto;
    grid-template-rows: 84px 42px 94px 42px 106px 42px 94px;
  }

  .turn-adv-row {
    padding-top: 27px;
    padding-bottom: 7px;
  }

  .turn-adv-row::after {
    top: 19px;
  }

  .turn-gae-links {
    display: none;
  }

  .algorithm-turn + .algorithm-turn {
    border-top: 1px solid var(--line-dark);
    border-left: 0;
  }

  .algorithm-row {
    grid-template-columns: 96px repeat(4, minmax(0, 1fr));
  }

  .algorithm-row::before {
    display: flex;
    align-items: center;
    align-self: stretch;
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .turn-adv-row::after,
  .turn-value-row::after {
    left: 103px;
  }

  .gae-arcs,
  .broadcast-arcs {
    right: 9%;
    left: calc(96px + 9%);
  }

  .trace-comparison {
    grid-template-columns: 1fr;
  }

  .trace-comparison .rollout-side::before {
    display: none;
    content: none;
  }
}

@media (max-width: 620px) {
  .surrogate-view,
  .formulation-finding {
    padding: 18px 16px;
  }

  .surrogate-equation,
  .finding-equation {
    font-size: 0.66rem;
  }

  .pomdp-definitions > div {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .hygae-estimation {
    margin-top: 30px;
    padding-top: 28px;
  }

  .estimation-heading h3 {
    font-size: 1.25rem;
  }

  .estimation-block {
    padding: 18px 16px;
  }

  .estimation-equation {
    font-size: 0.64rem;
  }

  .estimation-update {
    text-align: left;
  }

  .trace-highlight-key {
    justify-content: flex-start;
  }

  .qual-tabs button {
    min-width: 0;
    padding-right: 7px;
    padding-left: 7px;
    font-size: 0.68rem;
  }

  .method-demo {
    padding: 0;
  }

  .algorithm-turn {
    grid-template-rows: 80px 40px 90px 40px 102px 40px 90px;
  }

  .algorithm-row {
    grid-template-columns: 80px repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 7px;
  }

  .algorithm-row::before {
    font-size: 0.52rem;
  }

  .algorithm-cell {
    min-height: 40px;
    border-radius: 5px;
  }

  .algorithm-cell mjx-container {
    font-size: 68% !important;
  }

  .broadcast-cell b mjx-container {
    font-size: 44% !important;
  }

  .broadcast-cell small mjx-container {
    font-size: 52% !important;
  }

  .operation-plus {
    width: 26px;
    height: 26px;
  }

  .turn-adv-row::after,
  .turn-value-row::after {
    left: 87px;
  }

  .gae-arcs,
  .broadcast-arcs {
    right: 9%;
    left: calc(80px + 9%);
  }

  .algorithm-turn-title {
    font-size: 0.88rem;
  }

  .method-points .theorem-card {
    min-height: 0;
  }

  .method-points .theorem-card > p:not(.theorem-label) {
    min-height: 0;
  }

  .trace-comparison .rollout-side {
    padding: 10px;
  }

  .trace-header {
    align-items: flex-start;
  }

  .trace-turn,
  .trace-final {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .model-output {
    padding: 7px;
    font-size: 0.6rem;
  }

  .rollout-summary {
    text-align: left;
  }
}
