:root {
  color-scheme: light;
  --ink: #101418;
  --muted: #5c6975;
  --line: #dce3e8;
  --panel: #ffffff;
  --panel-2: #f4f7f8;
  --accent: #00a876;
  --accent-2: #315bdc;
  --warn: #e36b2c;
  --dark: #0b1117;
  --dark-2: #16212b;
  --shadow: 0 18px 50px rgba(16, 20, 24, 0.12);
  --switch-block-height: 92px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  overflow-x: hidden;
}

a {
  color: inherit;
}

main {
  display: flex;
  flex-direction: column;
}

main > .hero {
  order: 0;
}

#abstract {
  order: 1;
}

#video {
  order: 2;
}

#contributions {
  order: 3;
}

#setup {
  order: 4;
}

#results {
  order: 5;
}

#stack {
  order: 6;
}

#trajectory-demo {
  order: 7;
}

#guidance-demo {
  order: 8;
}

#rl-demo {
  order: 9;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  color: #f7fbfc;
  background: rgba(11, 17, 23, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 800;
  text-decoration: none;
  font-size: 1.1rem;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 28px);
  min-width: 0;
  max-width: 100%;
  font-size: 0.92rem;
}

nav a {
  color: rgba(247, 251, 252, 0.82);
  text-decoration: none;
  white-space: nowrap;
}

nav a:hover {
  color: #ffffff;
}

.hero {
  position: relative;
  min-height: calc(100vh - 58px);
  display: flex;
  align-items: end;
  overflow: hidden;
  color: #ffffff;
  background: #0b1117;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 17, 23, 0.92) 0%, rgba(11, 17, 23, 0.66) 46%, rgba(11, 17, 23, 0.18) 100%),
    linear-gradient(0deg, rgba(11, 17, 23, 0.96) 0%, rgba(11, 17, 23, 0.16) 46%, rgba(11, 17, 23, 0.30) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(72px, 13vh, 140px) 0 clamp(58px, 10vh, 110px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(2.2rem, 5.2vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 690px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.03rem, 1.8vw, 1.35rem);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  font-weight: 800;
}

.button.primary {
  color: #05130f;
  border-color: var(--accent);
  background: var(--accent);
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(58px, 8vw, 96px) 0;
}

.section-heading {
  max-width: 880px;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.35rem, 4.6vw, 4.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.section-heading p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.55;
}

.abstract-section,
.problem-section {
  padding-bottom: clamp(32px, 4vw, 54px);
}

.abstract-statement,
.problem-statement {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) repeat(2, minmax(0, 1fr));
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  padding-bottom: clamp(24px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
}

.abstract-statement h2,
.problem-statement h2 {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.abstract-statement p,
.problem-statement p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.02rem, 1.45vw, 1.24rem);
  line-height: 1.58;
}

.video-figure {
  margin: 0;
  overflow: hidden;
}

.video-figure video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #101820;
}

.video-figure figcaption {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.overview-grid,
.overview-results,
.task-grid,
.result-placeholder-grid,
.setup-layout,
.task-gallery,
.policy-pipeline,
.equation-grid,
.results-layout {
  display: grid;
  gap: 18px;
}

.overview-grid,
.overview-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.overview-grid article,
.metric,
.equation-panel,
.equation-card,
.controls,
.demo-stage,
.video-figure,
.image-placeholder,
.result-placeholder,
.setup-photo,
.setup-facts,
.task-card,
.stage-card,
.signal-block,
.signal-plot-card,
.signal-panel,
.result-figure,
.result-table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.overview-grid article {
  min-height: 200px;
  padding: 26px;
}

.overview-results {
  margin-top: 18px;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.setup-section,
.tasks-section,
.stack-section,
.demo-section,
.results-section,
.citation-section {
  width: 100%;
  max-width: none;
  padding-inline: max(18px, calc((100vw - 1180px) / 2));
}

.setup-section,
.tasks-section,
.stack-section,
.results-section,
.citation-section {
  background: var(--panel-2);
}

.setup-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: stretch;
}

.setup-photo {
  margin: 0;
  overflow: hidden;
}

.setup-photo img,
.result-figure img,
.task-card img {
  display: block;
  width: 100%;
}

.setup-section img {
  cursor: zoom-in;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    box-shadow 180ms ease;
}

.setup-section img:hover,
.setup-section img:focus-visible {
  filter: brightness(1.04) saturate(1.04);
  transform: scale(1.018);
  box-shadow: 0 16px 34px rgba(16, 24, 32, 0.18);
}

.setup-photo img {
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.setup-photo figcaption,
.result-figure figcaption {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.setup-facts {
  display: grid;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.setup-facts div {
  padding: 22px;
  background: #ffffff;
}

.setup-facts strong,
.stage-card span {
  display: block;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.setup-facts span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.task-gallery {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.task-card {
  display: grid;
  grid-template-rows: auto auto auto;
  min-width: 0;
  overflow: hidden;
}

.task-outline {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #eef3f5;
}

.task-card div:not(.task-thumbs) {
  padding: 18px;
}

.task-card p {
  margin: 0;
  font-size: 0.92rem;
}

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

.task-thumbs img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.image-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
  background: rgba(16, 24, 32, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.image-zoom-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-zoom-overlay img {
  display: block;
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  cursor: zoom-out;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  transform: scale(0.96);
  transition: transform 180ms ease;
}

.image-zoom-overlay.is-open img {
  transform: scale(1);
}

.task-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.image-placeholder,
.result-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #42515f;
  background:
    linear-gradient(135deg, rgba(0, 168, 118, 0.08), rgba(49, 91, 220, 0.08)),
    #ffffff;
}

.image-placeholder {
  aspect-ratio: 4 / 3;
  min-height: 170px;
}

.image-placeholder::before,
.result-placeholder::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed #b9c7cf;
  border-radius: 6px;
}

.image-placeholder span,
.result-placeholder span {
  position: relative;
  font-size: 0.88rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stack-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

.policy-stack-section {
  background: #ffffff;
}

.signal-chain {
  --flow-active: var(--accent-2);
  --flow-inactive: #aeb8c2;
  --policy-flow: var(--flow-active);
  --external-flow: var(--flow-inactive);
  --shared-flow: var(--flow-active);
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) 20px minmax(150px, 0.8fr) 18px minmax(150px, 0.78fr) 18px minmax(160px, 0.95fr) 18px minmax(150px, 0.78fr) 18px minmax(160px, 0.95fr);
  grid-template-areas:
    "policy . switch switch-reference reference reference-output reference-signal reference-impedance impedance impedance-mass mass"
    "external external-admittance admittance . . . . . . . .";
  gap: 10px 8px;
  align-items: start;
}

.signal-chain[data-input-mode="external"] {
  --policy-flow: var(--flow-inactive);
  --external-flow: var(--flow-active);
}

.policy-signal {
  grid-area: policy;
}

.external-signal {
  grid-area: external;
}

.external-admittance-arrow {
  grid-area: external-admittance;
}

.admittance-block {
  grid-area: admittance;
}

.signal-switch-block {
  grid-area: switch;
}

.switch-reference-arrow {
  grid-area: switch-reference;
}

.reference-block {
  grid-area: reference;
}

.reference-output-arrow {
  grid-area: reference-output;
}

.reference-signal {
  grid-area: reference-signal;
}

.reference-impedance-arrow {
  grid-area: reference-impedance;
}

.impedance-block {
  grid-area: impedance;
}

.impedance-mass-arrow {
  grid-area: impedance-mass;
}

.mass-signal {
  grid-area: mass;
}

.signal-block,
.signal-plot-card {
  min-width: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.signal-block-header,
.signal-plot-header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
}

.signal-block-header span,
.signal-plot-header span {
  flex: 0 0 auto;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-block-header h3,
.signal-plot-header h3 {
  margin: 0;
  text-align: left;
}

.signal-plot-card canvas {
  display: block;
  width: 100%;
  height: 168px;
  min-height: 150px;
  border-radius: 6px;
  background: #101820;
}

.math-stack {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d7e0e5;
  border-radius: 6px;
  background: #f8fbfc;
  overflow-x: auto;
}

.math-stack math {
  color: var(--ink);
  font-size: 0.92rem;
}

.equation-block {
  position: relative;
  cursor: pointer;
  isolation: isolate;
  overflow: visible;
}

.equation-block.is-equation-open {
  z-index: 6;
  overflow: visible;
}

.equation-block .signal-block-header {
  position: relative;
  z-index: 2;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.equation-block .signal-block-header h3 {
  min-width: 0;
}

.equation-popover {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(620px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid rgba(49, 91, 220, 0.22);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 58px rgba(16, 20, 24, 0.18);
  z-index: 20;
}

.equation-block.is-equation-open .equation-popover {
  display: block;
}

.reference-block .equation-popover {
  left: 50%;
  transform: translateX(-50%);
}

.impedance-block .equation-popover {
  right: 0;
  left: auto;
}

.equation-popover::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 20px;
  width: 14px;
  height: 14px;
  border-top: 1px solid rgba(49, 91, 220, 0.22);
  border-left: 1px solid rgba(49, 91, 220, 0.22);
  background: #ffffff;
  transform: rotate(45deg);
}

.reference-block .equation-popover::before {
  left: calc(50% - 7px);
}

.impedance-block .equation-popover::before {
  right: 20px;
  left: auto;
}

.equation-title {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.equation-scroll {
  display: grid;
  gap: 12px;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.equation-scroll math {
  min-width: max-content;
  color: var(--ink);
  font-size: 1rem;
}

.equation-variants {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.equation-variants th,
.equation-variants td {
  padding: 6px 8px;
  border: 1px solid rgba(49, 91, 220, 0.14);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.equation-variants th {
  color: var(--accent-2);
  font-weight: 900;
}

.equation-variants math {
  font-size: 0.9rem;
}

.equation-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.equation-block .block-controls {
  position: relative;
  z-index: 3;
  cursor: auto;
}

.equation-popover {
  cursor: auto;
}

.block-controls {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 2px;
}

.block-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  align-items: center;
}

.block-controls label span {
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.block-controls label strong {
  color: var(--accent-2);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

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

.flow-arrow {
  align-self: center;
  justify-self: center;
  color: var(--shared-flow);
  font-size: 1.65rem;
  font-weight: 900;
}

.external-admittance-arrow {
  color: var(--external-flow);
}

.signal-switch-block,
.admittance-block,
.reference-block,
.reference-signal,
.impedance-block,
.mass-signal {
  align-self: center;
  padding: 10px;
  gap: 8px;
  font-size: 0.82rem;
}

.signal-switch-block .signal-block-header h3,
.admittance-block .signal-block-header h3,
.reference-block .signal-block-header h3,
.reference-signal .signal-plot-header h3,
.impedance-block .signal-block-header h3,
.mass-signal .signal-plot-header h3 {
  font-size: 0.88rem;
}

.admittance-block .block-controls,
.reference-block .block-controls,
.impedance-block .block-controls,
.mass-signal .block-controls {
  gap: 7px;
}

.admittance-block .block-controls label,
.reference-block .block-controls label,
.impedance-block .block-controls label,
.mass-signal .block-controls label {
  gap: 4px 8px;
}

.admittance-block .block-controls label span,
.reference-block .block-controls label span,
.impedance-block .block-controls label span,
.mass-signal .block-controls label span {
  font-size: 0.72rem;
}

.admittance-block .block-controls label strong,
.reference-block .block-controls label strong,
.impedance-block .block-controls label strong,
.mass-signal .block-controls label strong {
  font-size: 0.72rem;
}

.reference-block,
.impedance-block {
  height: 292px;
}

.policy-block {
  border-color: rgba(255, 209, 102, 0.72);
}

.external-signal {
  border-color: rgba(255, 107, 53, 0.55);
}

.admittance-block {
  border-color: rgba(255, 107, 53, 0.42);
  align-self: start;
}

.signal-switch-block {
  align-self: center;
  height: var(--switch-block-height);
  justify-content: center;
  padding: 10px;
  border-color: rgba(49, 91, 220, 0.38);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.switch-input-connector {
  grid-area: switch;
  min-width: 0;
  height: 100%;
  align-self: stretch;
  justify-self: stretch;
  position: relative;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.policy-to-switch::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 50%;
  width: 28px;
  border-top: 2px solid var(--policy-flow);
}

.policy-to-switch::after {
  content: "";
  position: absolute;
  left: -8px;
  top: calc(50% - 5px);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--policy-flow);
}

.admittance-to-switch {
  grid-area: switch;
}

.admittance-to-switch::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(50% + var(--switch-block-height) / 2 + 8px);
  bottom: -10px;
  border-left: 2px solid var(--external-flow);
}

.admittance-to-switch::after {
  content: "";
  position: absolute;
  left: calc(50% - 5px);
  top: calc(50% + var(--switch-block-height) / 2);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--external-flow);
}

.switch-reference-arrow {
  align-self: center;
  margin-top: 0;
}

.signal-switch {
  width: 100%;
  padding: 8px 6px;
  border: 1px solid rgba(49, 91, 220, 0.35);
  border-radius: 6px;
  color: var(--ink);
  background: #f8fbfc;
  cursor: pointer;
  text-align: left;
}

.signal-switch:hover,
.signal-switch:focus-visible {
  border-color: var(--accent-2);
  outline: none;
}

.signal-switch span,
.signal-switch strong {
  display: block;
}

.signal-switch span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-switch strong {
  margin-top: 4px;
  color: var(--accent-2);
  font-size: 0.78rem;
  line-height: 1.2;
}

.signal-switch[aria-pressed="true"] strong {
  color: var(--warn);
}

.reference-block {
  border-color: rgba(0, 209, 255, 0.55);
}

.reference-signal {
  border-color: rgba(0, 209, 255, 0.55);
}

.impedance-block {
  border-color: rgba(49, 91, 220, 0.48);
}

.mass-signal {
  border-color: rgba(0, 168, 118, 0.55);
}

.policy-pipeline {
  grid-template-columns: minmax(140px, 1fr) 26px minmax(150px, 1fr) 26px minmax(150px, 1fr) 26px minmax(150px, 1fr) 26px minmax(140px, 1fr);
  align-items: stretch;
}

.stage-card {
  min-width: 0;
  min-height: 190px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stage-card code {
  display: block;
  margin: 14px 0;
  padding: 10px;
  border-radius: 5px;
  color: #d8f7ef;
  background: #101820;
  white-space: normal;
}

.stage-card p {
  margin: 0;
  font-size: 0.9rem;
}

.stage-card.policy {
  border-color: rgba(255, 209, 102, 0.7);
}

.stage-card.reference {
  border-color: rgba(0, 209, 255, 0.55);
}

.stage-card.impedance {
  border-color: rgba(49, 91, 220, 0.45);
}

.stage-card.output {
  border-color: rgba(0, 168, 118, 0.55);
}

.stage-arrow {
  align-self: center;
  color: var(--accent-2);
  font-size: 1.45rem;
  font-weight: 900;
  text-align: center;
}

.equation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.equation-card {
  min-width: 0;
  padding: 22px;
}

.equation-card pre {
  margin: 14px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.signal-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
  padding: 22px;
  align-items: stretch;
}

.signal-copy h3 {
  margin-bottom: 12px;
}

.pipeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.path-row {
  margin-top: -2px;
}

.pipe-card {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 1px solid #cbd7dd;
  border-radius: 8px;
  background: #ffffff;
  font-weight: 850;
}

.pipe-card.wide {
  min-height: 82px;
  text-align: center;
}

.pipe-card.path-card {
  min-height: 74px;
}

.pipe-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

.pipe-card.guide {
  border-color: rgba(227, 107, 44, 0.5);
}

.pipe-card.output {
  border-color: rgba(0, 168, 118, 0.55);
}

.pipe-down {
  width: 2px;
  height: 30px;
  margin: -2px auto;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  position: relative;
}

.pipe-down::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: translateX(-50%) rotate(135deg);
}

.equation-panel {
  min-width: 0;
  padding: 24px;
}

.equation-code {
  width: 100%;
  max-width: 100%;
  margin: 14px 0 22px;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre;
  font-size: 0.82rem;
  line-height: 1.7;
}

.variant-list {
  margin: 16px 0 0;
}

.variant-list div {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.variant-list dt {
  color: var(--accent-2);
  font-weight: 900;
}

.variant-list dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.note {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.demo-stage {
  overflow: hidden;
}

.trajectory-plot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
}

.demo-stage canvas {
  display: block;
  width: 100%;
  height: min(64vh, 620px);
  min-height: 430px;
  background: #101820;
  cursor: crosshair;
}

#tracking-error-canvas {
  height: clamp(280px, 32vh, 360px);
  min-height: 260px;
}

#trajectory-canvas,
#tracking-error-canvas {
  cursor: default;
}

.readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.readout div {
  min-width: 0;
  padding: 12px 14px;
  background: #ffffff;
}

.readout span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.readout strong {
  display: block;
  margin-top: 3px;
  font-size: 0.96rem;
}

.rl-demo-section {
  background: #ffffff;
}

.rl-demo-grid {
  grid-template-columns: minmax(0, 1fr) 400px;
}

.rl-stage {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto;
}

.rl-stage canvas#rl-reach-canvas {
  height: min(66vh, 660px);
  min-height: 460px;
}

.rl-top-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.rl-top-panel .rl-readout {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.rl-side-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.rl-state-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.rl-state-strip span,
.rl-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cfdae0;
  border-radius: 999px;
  color: var(--ink);
  background: #f8fbfc;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.rl-state-strip span[data-active="true"],
.rl-pill.active {
  color: #05130f;
  border-color: rgba(0, 168, 118, 0.54);
  background: rgba(0, 168, 118, 0.16);
}

.rl-state-strip span[data-warn="true"],
.rl-pill.warn {
  color: #4f1c08;
  border-color: rgba(227, 107, 44, 0.5);
  background: rgba(227, 107, 44, 0.14);
}

.rl-readout {
  border: 1px solid var(--line);
}

.rl-run-controls,
.rl-joystick-panel {
  padding: 18px;
  background: #ffffff;
}

.rl-run-controls .control-group {
  padding: 0;
  border-top: 0;
}

.rl-run-controls .rl-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rl-joystick-panel h3 {
  margin-bottom: 12px;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.rl-spacemouse {
  display: flex;
  justify-content: center;
}

.rl-joystick {
  position: relative;
  width: 118px;
  aspect-ratio: 1;
  border: 1px solid #b8c7cf;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.96), rgba(210, 222, 229, 0.78) 58%, rgba(143, 160, 170, 0.52)),
    #dbe5ea;
  box-shadow: inset 0 8px 18px rgba(255, 255, 255, 0.55), inset 0 -10px 20px rgba(22, 36, 46, 0.15);
  touch-action: none;
  cursor: grab;
}

.rl-joystick:focus-visible,
.rl-joystick[data-active="true"] {
  border-color: var(--accent);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(0, 168, 118, 0.18),
    inset 0 8px 18px rgba(255, 255, 255, 0.55),
    inset 0 -10px 20px rgba(22, 36, 46, 0.15);
  cursor: grabbing;
}

.rl-joystick-axis {
  position: absolute;
  inset: 50% 16px auto;
  height: 1px;
  background: rgba(28, 48, 60, 0.18);
  transform: translateY(-50%);
}

.rl-joystick-axis.vertical {
  inset: 16px auto 16px 50%;
  width: 1px;
  height: auto;
  transform: translateX(-50%);
}

.rl-joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  aspect-ratio: 1;
  border: 1px solid rgba(64, 87, 99, 0.46);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 34%, rgba(255, 255, 255, 0.98), rgba(222, 232, 237, 0.96) 44%, rgba(147, 166, 177, 0.82));
  box-shadow: 0 8px 18px rgba(16, 24, 32, 0.2), inset 0 5px 10px rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 90ms ease-out;
}

.rl-joystick[data-active="true"] .rl-joystick-knob {
  transition: none;
}

.rl-joystick[data-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}

.rl-joystick[data-disabled="true"] .rl-joystick-knob {
  transform: translate(-50%, -50%) !important;
}

.rl-stage canvas.rl-learning-canvas {
  display: block;
  width: 100%;
  height: 270px;
  min-height: 240px;
  border-top: 1px solid var(--line);
  background: #101820;
  cursor: default;
}

.rl-stage canvas.rl-action-canvas {
  display: block;
  width: 100%;
  height: 230px;
  min-height: 210px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: #101820;
  cursor: default;
}

.rl-eval-report {
  min-height: 44px;
  padding: 12px 14px;
  color: var(--muted);
  background: #ffffff;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  line-height: 1.5;
}

.rl-eval-report strong {
  color: var(--ink);
}

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

.rl-action-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #bccad2;
  border-radius: 4px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.rl-action-button.primary {
  color: #05130f;
  border-color: var(--accent);
  background: var(--accent);
}

.rl-action-button.dark {
  color: #ffffff;
  border-color: var(--dark-2);
  background: var(--dark-2);
}

.rl-action-button.warn {
  color: #ffffff;
  border-color: var(--warn);
  background: var(--warn);
}

.rl-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

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

.rl-config-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.rl-config-grid span {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
}

.rl-config-grid input {
  width: 100%;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid #bccad2;
  border-radius: 4px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-size: 0.9rem;
}

.rl-buffer-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.controls {
  max-height: min(78vh, 780px);
  overflow: auto;
  padding: 18px;
}

.control-group {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.control-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.control-group h3 {
  font-size: 0.92rem;
  text-transform: uppercase;
}

.collapsible-control-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.collapsible-control-group summary::-webkit-details-marker {
  display: none;
}

.collapsible-control-group summary::after {
  content: "Show";
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.collapsible-control-group[open] summary::after {
  content: "Hide";
}

.collapsible-control-group summary h3 {
  margin: 0;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 750;
}

.control-value {
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

select,
button.reset-button {
  width: 100%;
  min-height: 38px;
  border: 1px solid #bccad2;
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

button.reset-button {
  margin-top: 16px;
  color: #ffffff;
  border-color: var(--dark-2);
  background: var(--dark-2);
  cursor: pointer;
}

.metric {
  min-height: 132px;
  padding: 24px;
}

.metric.compact {
  min-height: 118px;
}

.metric strong {
  display: block;
  color: var(--accent-2);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.5;
}

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

.results-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  align-items: start;
}

.result-subsection {
  grid-column: 1 / -1;
  margin: 18px 0 0;
  font-size: 1.35rem;
}

.result-figure {
  margin: 0;
  overflow: hidden;
}

.result-figure.wide img {
  background: #ffffff;
}

.result-table-card {
  overflow: auto;
  padding: 22px;
}

.result-table-card h3 {
  margin-bottom: 14px;
}

.table-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.learning-table-card {
  grid-column: 1 / -1;
}

.result-table-card table {
  min-width: 680px;
  font-size: 0.9rem;
}

.learning-table-card table {
  min-width: 1320px;
}

.result-table-card th,
.result-table-card td {
  padding: 11px 12px;
  vertical-align: top;
}

.result-table-card th[colspan] {
  text-align: center;
}

.result-table-card th[rowspan] {
  vertical-align: bottom;
}

.result-placeholder {
  min-height: 300px;
}

.plot-placeholder {
  aspect-ratio: 16 / 10;
}

.table-placeholder {
  min-height: 220px;
  aspect-ratio: 16 / 7;
}

.table-wrap {
  margin-top: 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

caption {
  padding: 16px 18px;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
}

th,
td {
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--ink);
  background: var(--panel-2);
}

pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e151c;
  color: #d8f7ef;
}

footer {
  padding: 30px clamp(18px, 4vw, 56px);
  color: rgba(255, 255, 255, 0.72);
  background: var(--dark);
}

@media (max-width: 1040px) {
  .overview-grid,
  .overview-results,
  .stack-layout,
  .contributions-grid,
  .demo-grid,
  .setup-layout,
  .signal-panel,
  .results-layout {
    grid-template-columns: 1fr;
  }

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

  .policy-pipeline,
  .equation-grid {
    grid-template-columns: 1fr;
  }

  .signal-chain {
    display: flex;
    flex-direction: column;
  }

  .switch-input-connector {
    display: none;
  }

  .reference-block,
  .impedance-block {
    height: auto;
  }

  .equation-popover,
  .reference-block .equation-popover,
  .impedance-block .equation-popover {
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 4px;
    transform: none;
  }

  .equation-popover::before {
    display: none;
  }

  .equation-scroll math {
    font-size: 0.92rem;
  }

  .stage-arrow,
  .flow-arrow {
    transform: rotate(90deg);
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .controls {
    max-height: none;
  }

  .trajectory-plot-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px 10px;
    overflow-x: visible;
    font-size: 0.8rem;
  }

  nav a {
    flex: 0 0 auto;
  }

  .hero {
    min-height: 92vh;
  }

  .hero h1 {
    max-width: min(100%, 20rem);
    font-size: clamp(1.75rem, 8.3vw, 2.35rem);
    line-height: 1.02;
    word-break: break-word;
  }

  .hero-copy {
    max-width: min(100%, 20rem);
    font-size: 0.96rem;
  }

  .abstract-statement,
  .problem-statement {
    grid-template-columns: 1fr;
  }

  .overview-grid,
  .overview-results,
  .readout {
    grid-template-columns: 1fr;
  }

  .rl-top-panel .rl-readout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .demo-stage canvas {
    min-height: 360px;
    height: 58vh;
  }

  .rl-stage canvas#rl-reach-canvas {
    min-height: 390px;
  }

  .rl-stage canvas.rl-learning-canvas {
    min-height: 240px;
    height: 270px;
  }

  .rl-stage canvas.rl-action-canvas {
    min-height: 210px;
    height: 230px;
  }

  .rl-actions,
  .rl-config-grid {
    grid-template-columns: 1fr;
  }

  .rl-spacemouse {
    justify-content: start;
  }

  .section {
    width: min(100% - 28px, 1180px);
  }

  .stack-section,
  .demo-section,
  .tasks-section,
  .results-section,
  .citation-section {
    padding-inline: 14px;
  }

  .task-grid,
  .task-gallery,
  .result-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .setup-photo img {
    min-height: 320px;
  }

  .plot-placeholder,
  .table-placeholder {
    aspect-ratio: auto;
  }

  pre,
  .equation-code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 520px) {
  .rl-top-panel .rl-readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
