:root {
  --bg: #f8f6ef;
  --surface: rgba(255, 252, 244, 0.88);
  --surface-strong: #fffdf7;
  --ink: #151515;
  --muted: #5c5c5c;
  --line: rgba(15, 15, 15, 0.12);
  --accent: #7b3ff2;
  --accent-2: #078b8f;
  --accent-3: #d97706;
  --shadow: 0 24px 60px rgba(26, 21, 9, 0.12);
  --radius: 28px;
  --max-width: 1360px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0d0f13;
  --surface: rgba(21, 24, 31, 0.88);
  --surface-strong: #161a22;
  --ink: #f4f0e8;
  --muted: #b7b1a7;
  --line: rgba(255, 255, 255, 0.13);
  --accent: #b897ff;
  --accent-2: #3bd0d2;
  --accent-3: #f0b35c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 0%, rgba(123, 63, 242, 0.16), transparent 28rem),
    radial-gradient(circle at 85% 12%, rgba(7, 139, 143, 0.14), transparent 24rem),
    linear-gradient(180deg, var(--bg), var(--bg));
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(15, 15, 15, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 15, 15, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-family: Georgia, serif;
  font-size: 20px;
}

.nav-links {
  gap: 18px;
  font-size: 14px;
  color: var(--muted);
}

.nav-links a:hover,
.authors a:hover,
.footer a:hover {
  color: var(--accent);
}

.nav-toggle,
.theme-toggle,
.button,
.tab,
.copy-button {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-toggle {
  display: none;
  padding: 8px 12px;
}

.theme-toggle {
  padding: 8px 12px;
}

.button:hover,
.nav-toggle:hover,
.theme-toggle:hover,
.tab:hover,
.copy-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}

.section-grid,
.content-section,
.strip,
.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: 22px;
}

.hero {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(560px, 560px);
  gap: 30px;
  padding-top: 84px;
  padding-bottom: 46px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px;
  font-weight: 800;
}

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

h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-title {
  max-width: 940px;
  font-size: clamp(2.45rem, 3.15vw, 3.05rem);
  line-height: 1.08;
}

.title-brand {
  font-variant-caps: small-caps;
  white-space: nowrap;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.subtitle {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2.2vw, 1.42rem);
}

.authors,
.affiliations {
  color: var(--muted);
  margin-bottom: 8px;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 650;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  position: relative;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
}

.button.primary {
  background: var(--ink);
  color: var(--bg);
}

.data-menu {
  position: relative;
}

.data-menu-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 50;
  width: min(330px, calc(100vw - 44px));
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.data-menu.open .data-menu-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.data-menu-panel a {
  display: block;
  padding: 9px 11px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.data-menu-panel a:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
}

.hero-panel,
.text-card,
.figure-card,
.table-card,
.bib-card,
.tool-card,
.insight-card,
.metric-card,
.strip,
.pipeline {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  border-radius: var(--radius);
  justify-self: end;
  width: 560px;
  max-width: 100%;
  padding: 24px;
  height: 430px;
  overflow: hidden;
  position: relative;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -70px -90px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 32%, transparent), transparent 67%);
}

.hero-slideshow,
.hero-slide {
  position: relative;
  z-index: 1;
}

.hero-slideshow {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hero-slide {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  width: 100%;
}

.hero-slide.active {
  display: flex;
}

.panel-header,
.figure-header,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-header {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.big-metric .value {
  display: block;
  font-size: clamp(3.75rem, 6vw, 5.9rem);
  line-height: 0.9;
  letter-spacing: 0;
  font-weight: 900;
}

.value {
  display: block;
  color: var(--ink);
  font-size: 2.3rem;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 900;
}

.value.small {
  font-size: 1.55rem;
}

.label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.mini-claim {
  position: relative;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 18px;
  z-index: 1;
}

.comparison-figure {
  display: grid;
  gap: 14px;
  width: 100%;
}

.compare-summary strong,
.compare-summary span,
.system-name,
.compare-system strong,
.compare-system span,
.compare-row span,
.compare-row strong {
  display: block;
}

.compare-summary strong {
  font-size: clamp(1.85rem, 2.45vw, 2.08rem);
  line-height: 1;
  white-space: nowrap;
}

.compare-summary span {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(0.7rem, 0.9vw, 0.78rem);
  line-height: 1.35;
  white-space: nowrap;
}

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

.compare-system {
  padding: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 74%, transparent);
}

.system-name {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.compare-system strong {
  margin-top: 8px;
  font-size: clamp(1.9rem, 3.1vw, 2.42rem);
  line-height: 1;
}

.compare-system span:last-child {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.compare-system.ours {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
}

.compare-bars {
  display: grid;
  gap: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.compare-row {
  display: grid;
  grid-template-columns: minmax(98px, 0.78fr) minmax(118px, 1.2fr) minmax(132px, 0.95fr);
  gap: 10px;
  align-items: center;
}

.compare-row span,
.compare-row strong {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.compare-row strong {
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

.bar-pair {
  display: grid;
  gap: 5px;
}

.bar-pair i {
  display: block;
  width: var(--bar);
  height: 8px;
  border-radius: 999px;
}

.bar-pair .ours {
  background: var(--accent);
}

.bar-pair .baseline {
  background: color-mix(in srgb, var(--ink) 34%, transparent);
}

.cost-row .bar-pair .ours {
  background: color-mix(in srgb, var(--accent-3) 78%, var(--surface-strong));
}

.slide-controls {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding-top: 12px;
}

.slide-arrow,
.slide-dot {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--ink);
  cursor: pointer;
}

.slide-arrow {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 1.4rem;
  line-height: 1;
}

.slide-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
}

.slide-dot.active {
  width: 24px;
  background: var(--ink);
}

.strip {
  padding-top: 18px;
  padding-bottom: 18px;
  border-radius: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.strip-item {
  padding: 10px 14px;
}

.strip-item strong,
.strip-item span {
  display: block;
}

.strip-item span {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.content-section {
  padding-top: 84px;
}

.section-heading {
  max-width: 940px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(2.45rem, 3.2vw, 3.15rem);
  line-height: 1.08;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.06rem;
}

.text-card {
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 46px);
  columns: 2 320px;
  column-gap: 44px;
}

.text-card p {
  break-inside: avoid;
  color: var(--muted);
  font-size: 1.06rem;
}

#abstract .text-card p {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.text-card strong,
.text-card code {
  color: var(--ink);
}

.pipeline {
  border-radius: var(--radius);
  padding: 22px;
}

.system-arch {
  position: relative;
  min-height: auto;
  aspect-ratio: 1.95;
  display: block;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: none;
}

.arch-node,
.arch-controller {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.1% 0.8%;
  border-radius: 8px;
  border: 2px solid #4b4b4b;
  background: #ffffff;
  text-align: center;
  line-height: 1.05;
  color: #000000;
}

.arch-node.question {
  left: 2.4%;
  top: 7.2%;
  width: 18%;
  height: 20.8%;
}

.arch-node.prompt {
  left: 22.6%;
  top: 7.2%;
  width: 18%;
  height: 20.8%;
}

.arch-node.budget {
  left: 42.4%;
  top: 7.2%;
  width: 18%;
  height: 20.8%;
}

.arch-node.agent {
  left: 20.8%;
  top: 38.5%;
  width: 21.6%;
  height: 23.6%;
}

.arch-node.answer {
  left: 22%;
  top: 69.6%;
  width: 19%;
  height: 14.8%;
}

.arch-controller {
  left: 46.2%;
  top: 38.5%;
  width: 30%;
  height: 42.8%;
  padding: 0.8% 1.4%;
}

.arch-node.search-engine {
  left: 79.7%;
  top: 38.5%;
  width: 18.8%;
  height: 20.8%;
}

.arch-caption {
  position: absolute;
  z-index: 2;
  left: 24%;
  right: 18%;
  bottom: 4%;
  margin: 0;
  color: #3f3f46;
  font-size: clamp(0.78rem, 1.28vw, 1.12rem);
  line-height: 1.25;
  text-align: left;
}

.arch-node strong,
.arch-node small,
.arch-controller > strong,
.arch-controller > small,
.arch-subnode strong,
.arch-subnode small {
  display: block;
}

.arch-node strong,
.arch-controller > strong,
.arch-subnode strong {
  color: #000000;
  font-size: clamp(0.82rem, 1.45vw, 1.45rem);
  line-height: 1.1;
}

.arch-node small,
.arch-controller > small,
.arch-subnode small {
  color: #000000;
  margin-top: 3px;
  font-size: clamp(0.72rem, 1.38vw, 1.28rem);
  line-height: 1.05;
}

.arch-node.pi,
.arch-controller.pi {
  border-color: #0000a8;
  background: #fbfbff;
}

.arch-subnode {
  margin-top: 4.2%;
  padding: 2.6% 3%;
  border: 2px solid #0000a8;
  border-radius: 6px;
  background: #ffffff;
}

.loop-glyph {
  display: inline-grid;
  place-items: center;
  width: 28%;
  margin-right: 5%;
  color: #737373;
  font-size: clamp(1.3rem, 3vw, 2.6rem);
  line-height: 1;
  vertical-align: -0.05em;
}

.arch-node.agent small {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pipe-arrow {
  align-self: center;
  color: var(--muted);
  font-weight: 800;
}

.arch-arrow {
  position: absolute;
  z-index: 3;
  height: 2px;
  background: #6a6a6a;
  transform-origin: left center;
  pointer-events: none;
}

.arch-arrow::after,
.arch-arrow.bidir::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.arch-arrow::after {
  right: -2px;
  border-left: 11px solid #6a6a6a;
  transform: translateY(-50%);
}

.arch-arrow.bidir::before {
  left: -2px;
  border-right: 11px solid #6a6a6a;
  transform: translateY(-50%);
}

.arch-arrow.question-agent {
  left: 12%;
  top: 28.3%;
  width: 10.9%;
  transform: rotate(31deg);
}

.arch-arrow.prompt-agent {
  left: 31.5%;
  top: 28%;
  width: 5.4%;
  transform: rotate(90deg);
}

.arch-arrow.budget-agent {
  left: 47.8%;
  top: 28%;
  width: 8.7%;
  transform: rotate(140deg);
}

.arch-arrow.agent-answer {
  left: 31.5%;
  top: 62.1%;
  width: 3.9%;
  transform: rotate(90deg);
}

.arch-arrow.agent-controller {
  left: 42.3%;
  top: 50.2%;
  width: 3.9%;
}

.arch-arrow.controller-engine {
  left: 76.2%;
  top: 50.2%;
  width: 3.5%;
}

.tool-grid,
.insight-grid,
.metric-grid {
  display: grid;
  gap: 16px;
}

.tool-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.tool-card,
.insight-card,
.metric-card {
  border-radius: 24px;
  padding: 22px;
}

.tool-number {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 900;
  margin-bottom: 18px;
}

.tool-card p,
.insight-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.metric-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

.metric-grid.compact {
  grid-template-columns: repeat(2, 1fr);
  margin: 26px 0;
}

.metric-card {
  min-height: 150px;
}

.figure-card,
.table-card,
.bib-card {
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 18px;
}

.figure-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.86rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button.legend-item {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

button.legend-item[aria-pressed="false"] {
  opacity: 0.48;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-color);
}

.chart-wrap {
  position: relative;
  margin-top: 20px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
}

#cost-accuracy-chart {
  width: 100%;
  height: 480px;
  display: block;
}

.chart-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.chart-axis,
.chart-grid {
  stroke: color-mix(in srgb, var(--ink) 20%, transparent);
}

.chart-grid {
  stroke-dasharray: 4 6;
}

.chart-grid.minor {
  opacity: 0.46;
  stroke-dasharray: 2 8;
}

.chart-text {
  fill: var(--muted);
  font-size: 12px;
}

.chart-label {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.chart-label.secondary {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.chart-point {
  cursor: pointer;
  outline: none;
}

.chart-marker {
  stroke: var(--surface-strong);
  stroke-width: 2;
  transition: opacity 160ms ease, stroke-width 160ms ease;
}

.chart-point:hover .chart-marker,
.chart-point:focus-visible .chart-marker,
.chart-point.active .chart-marker {
  stroke-width: 4;
}

.chart-point.dimmed {
  opacity: 0.2;
}

.chart-frontier {
  fill: none;
  stroke: #b91c1c;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 8 8;
}

.chart-frontier-ring {
  fill: none;
  stroke: #b91c1c;
  stroke-width: 1.8;
}

.chart-frontier-label {
  fill: #b91c1c;
  font-size: 12px;
  font-weight: 800;
}

.chart-tooltip {
  position: absolute;
  min-width: 210px;
  max-width: min(280px, calc(100% - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 4;
}

.chart-tooltip.visible {
  opacity: 1;
}

.chart-tooltip strong,
.chart-readout strong {
  display: block;
  color: var(--ink);
}

.chart-readout {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 68%, transparent);
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 13px;
  font-weight: 750;
}

.tab.active {
  background: var(--ink);
  color: var(--bg);
}

.table-scroll {
  overflow-x: auto;
  margin-top: 16px;
}

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

th,
td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

th[data-sort-index] {
  cursor: pointer;
  user-select: none;
}

th[data-sort-index]::after {
  content: "↕";
  display: inline-block;
  margin-left: 6px;
  color: color-mix(in srgb, var(--muted) 65%, transparent);
  font-size: 0.68rem;
}

th[data-sort-index][aria-sort="ascending"]::after {
  content: "↑";
  color: var(--accent);
}

th[data-sort-index][aria-sort="descending"]::after {
  content: "↓";
  color: var(--accent);
}

td {
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}

thead tr:first-child th {
  border-bottom-color: color-mix(in srgb, var(--ink) 24%, transparent);
}

th[colspan] {
  text-align: center;
}

td:nth-child(n+4),
th:nth-child(n+4) {
  text-align: right;
}

tr.hidden {
  display: none;
}

.insight-grid {
  grid-template-columns: repeat(2, 1fr);
}

.bib-card {
  position: relative;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 22px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
  font-size: 0.95rem;
}

.copy-button {
  margin-top: 16px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 36px;
  color: var(--muted);
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 24px);
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 40;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 940px) {
  .hero,
  .tool-grid,
  .metric-grid,
  .strip,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .system-arch {
    min-height: auto;
    aspect-ratio: auto;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    display: grid;
    padding: 22px;
  }

  .arch-node.question,
  .arch-node.prompt,
  .arch-node.budget,
  .arch-node.agent,
  .arch-node.answer,
  .arch-controller,
  .arch-node.search-engine,
  .arch-caption {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: auto;
    height: auto;
    grid-column: auto;
    grid-row: auto;
  }

  .arch-caption {
    text-align: center;
    font-size: 0.92rem;
  }

  .pipeline-lines,
  .arch-arrow {
    display: none;
  }

  .pipe-arrow {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    left: 22px;
    right: 22px;
    top: 64px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }

  .theme-toggle {
    width: fit-content;
  }

  .hero {
    padding-top: 58px;
  }

  .hero-panel {
    justify-self: stretch;
    width: 100%;
    height: auto;
    min-height: 430px;
  }

  .text-card {
    columns: 1;
  }

  .figure-header,
  .table-toolbar,
  .chart-readout,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .hero-title {
    font-size: clamp(2.25rem, 12vw, 3.2rem);
  }

  .compare-summary strong,
  .compare-summary span {
    white-space: normal;
  }

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

  .compare-row strong {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
