:root {
  --paper: #f7f7f2;
  --paper-bright: #ffffff;
  --paper-deep: #ecece5;
  --ink: #151714;
  --ink-soft: #454a44;
  --ink-muted: #686e67;
  --line: #d7d8d0;
  --line-strong: #aeb2aa;
  --green: #176b59;
  --green-soft: #d8ebe4;
  --blue: #3f5ec7;
  --blue-soft: #dfe5fa;
  --violet: #725ca8;
  --violet-soft: #e8e1f4;
  --amber: #a85a22;
  --amber-soft: #f4e2d4;
  --red: #a63d35;
  --red-soft: #f2ddda;
  --dark: #14201c;
  --dark-soft: #21312b;
  --header-height: 68px;
  --page-max: 1440px;
  --content-max: 1180px;
  --reading-max: 790px;
  --radius: 6px;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.is-hidden {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 500;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 16px;
}

:focus-visible {
  outline: 3px solid #6b84df;
  outline-offset: 3px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.wordmark-glyph {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-template-rows: repeat(2, 6px);
  gap: 2px;
  width: 14px;
  height: 14px;
}

.wordmark-glyph i {
  display: block;
  border-radius: 1px;
  background: currentColor;
}

.wordmark-glyph i:nth-child(2) {
  opacity: 0.72;
}

.wordmark-glyph i:nth-child(3) {
  opacity: 0.48;
}

.wordmark-glyph i:nth-child(4) {
  opacity: 0.25;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-dark {
  background: var(--ink);
  color: white;
}

.button-dark:hover {
  background: var(--green);
}

.button-light {
  background: white;
  color: var(--dark);
}

.button-outline {
  border-color: var(--line-strong);
  background: transparent;
}

.button-outline:hover {
  border-color: var(--ink);
  background: white;
}

.button-outline-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.button-text {
  padding-left: 4px;
  padding-right: 4px;
  color: var(--ink-soft);
}

.button-text:hover {
  color: var(--green);
}

.button-danger-quiet {
  border-color: #d9aaa5;
  color: var(--red);
}

.button-danger-quiet:hover {
  border-color: var(--red);
  background: var(--red-soft);
}

.icon-button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--paper-bright);
}

/* Access */

.access-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 47%) 1fr;
  background: var(--paper-bright);
}

.access-copy-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 34px 48px 46px;
}

.access-wordmark {
  align-self: flex-start;
}

.access-copy-inner {
  width: min(100%, 650px);
  margin: auto 0;
}

.access-copy-inner h1 {
  max-width: 620px;
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 74px;
  font-weight: 400;
  line-height: 0.98;
}

.access-lede {
  max-width: 600px;
  margin: 26px 0 38px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.6;
}

.access-form {
  max-width: 560px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-row label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.field-row input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: white;
  color: var(--ink);
}

.field-row input:focus {
  border-color: var(--green);
}

.form-error {
  grid-column: 1 / -1;
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.access-submit {
  grid-column: 1 / -1;
  width: 100%;
}

.access-principles {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  margin-top: 34px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.access-principles span {
  position: relative;
  padding-left: 14px;
}

.access-principles span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.access-visual-column {
  position: relative;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 64px;
  background: var(--dark);
  color: white;
}

.access-visual-column::before,
.access-visual-column::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.09);
  pointer-events: none;
}

.access-visual-column::before {
  inset: 42px;
}

.access-visual-column::after {
  inset: 90px 42px;
  border-left: 0;
  border-right: 0;
}

.access-visual-label {
  position: absolute;
  left: 64px;
  top: 56px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.58;
}

.access-machine {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 56px 1fr 56px 1fr 56px 1fr;
  align-items: center;
  width: 100%;
}

.machine-stage {
  min-width: 0;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--dark);
}

.machine-stage small {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.65;
}

.machine-wire {
  position: relative;
  height: 1px;
  background: rgba(255, 255, 255, 0.28);
}

.machine-wire span {
  position: absolute;
  top: -3px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7bc3ac;
  animation: wire-pulse 2.6s linear infinite;
}

.wire-two span {
  background: #7f98ed;
  animation-delay: 0.45s;
}

.wire-three span {
  background: #e6a06c;
  animation-delay: 0.9s;
}

.token-stack {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.token-stack i {
  width: 9px;
  height: 44px;
  background: #7bc3ac;
  opacity: 0.45;
  animation: token-lift 2.4s ease-in-out infinite;
}

.token-stack i:nth-child(2) { height: 67px; animation-delay: 0.12s; }
.token-stack i:nth-child(3) { height: 31px; animation-delay: 0.24s; }
.token-stack i:nth-child(4) { height: 82px; animation-delay: 0.36s; }
.token-stack i:nth-child(5) { height: 54px; animation-delay: 0.48s; }

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

.model-grid i {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(127, 152, 237, 0.18);
  animation: model-cell 3s ease-in-out infinite;
}

.model-grid i:nth-child(3n + 2) { animation-delay: 0.25s; }
.model-grid i:nth-child(3n + 3) { animation-delay: 0.5s; }

.rack-lines {
  display: grid;
  gap: 5px;
}

.rack-lines i {
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(230, 160, 108, 0.14);
}

.service-pulse {
  width: 58px;
  height: 58px;
  align-self: center;
  border: 1px solid #7bc3ac;
  border-radius: 50%;
  animation: service-pulse 2s ease-out infinite;
}

.access-visual-caption {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 48px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  line-height: 1.35;
}

@keyframes wire-pulse {
  from { transform: translateX(0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  to { transform: translateX(49px); opacity: 0; }
}

@keyframes token-lift {
  0%, 100% { opacity: 0.35; transform: scaleY(0.82); transform-origin: bottom; }
  50% { opacity: 0.9; transform: scaleY(1); transform-origin: bottom; }
}

@keyframes model-cell {
  0%, 100% { background: rgba(127, 152, 237, 0.14); }
  50% { background: rgba(127, 152, 237, 0.58); }
}

@keyframes service-pulse {
  0% { box-shadow: 0 0 0 0 rgba(123, 195, 172, 0.45); }
  100% { box-shadow: 0 0 0 28px rgba(123, 195, 172, 0); }
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 242, 0.96);
  backdrop-filter: blur(14px);
}

.header-main,
.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 14px;
  cursor: pointer;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--ink);
}

.nav-link.is-active {
  text-decoration: underline;
  text-decoration-color: var(--green);
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

.lens-control {
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper-bright);
}

.lens-control button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
}

.lens-control button.is-active {
  background: var(--ink);
  color: white;
}

.mission-button {
  min-width: 190px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 10px 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--paper-bright);
  cursor: pointer;
}

.mission-button span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.mission-button small {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.mission-button strong {
  max-width: 145px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-button,
.mobile-menu,
.mobile-bottom-nav {
  display: none;
}

/* Journey */

.journey-page {
  overflow: hidden;
}

.journey-hero {
  position: relative;
  min-height: calc(100vh - var(--header-height));
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(560px, 1.08fr);
  align-items: center;
  gap: 64px;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 70px 48px 98px;
}

.hero-copy {
  max-width: 620px;
}

.hero-copy h1 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 82px;
  font-weight: 400;
  line-height: 0.94;
}

.hero-lede {
  max-width: 590px;
  margin: 28px 0 28px;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 26px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.hero-machine {
  position: relative;
  min-height: 560px;
  display: grid;
  grid-template-columns: 1fr 42px 1fr 42px;
  grid-template-rows: 44px 1fr 42px 1fr 94px;
  border: 1px solid var(--line-strong);
  background: var(--paper-bright);
}

.hero-machine-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
}

.live-indicator i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: live-dot 1.8s ease-in-out infinite;
}

@keyframes live-dot {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.hero-machine-stage {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.hero-machine-stage small {
  display: block;
  margin-bottom: 16px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.hero-source { grid-column: 1; grid-row: 2; margin: 16px 0 0 16px; }
.hero-weights { grid-column: 3; grid-row: 2; margin: 16px 16px 0 0; }
.hero-cluster { grid-column: 1; grid-row: 4; margin: 0 0 0 16px; }
.hero-output { grid-column: 3; grid-row: 4; margin: 0 16px 0 0; }

.hero-flow {
  position: relative;
  align-self: center;
  height: 1px;
  background: var(--line-strong);
}

.hero-flow i {
  position: absolute;
  left: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: hero-flow 2.5s linear infinite;
}

.flow-a { grid-column: 2; grid-row: 2; }
.flow-b { grid-column: 2; grid-row: 4; }
.flow-c {
  grid-column: 3;
  grid-row: 3;
  width: 1px;
  height: 42px;
  justify-self: center;
}

.flow-c i {
  top: 0;
  left: -3px;
  animation-name: hero-flow-down;
}

.flow-b i { background: var(--violet); animation-delay: 0.7s; }
.flow-c i { background: var(--amber); animation-delay: 1.1s; }

@keyframes hero-flow {
  from { transform: translateX(0); opacity: 0; }
  20%, 80% { opacity: 1; }
  to { transform: translateX(35px); opacity: 0; }
}

@keyframes hero-flow-down {
  from { transform: translateY(0); opacity: 0; }
  20%, 80% { opacity: 1; }
  to { transform: translateY(35px); opacity: 0; }
}

.source-tokens {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.source-tokens i {
  width: 23px;
  height: 11px;
  border-radius: 2px;
  background: var(--green-soft);
  animation: source-token 3s ease-in-out infinite;
}

.source-tokens i:nth-child(2n) { width: 34px; animation-delay: 0.3s; }
.source-tokens i:nth-child(3n) { background: var(--blue-soft); animation-delay: 0.6s; }

@keyframes source-token {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.weight-field {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.weight-field i {
  aspect-ratio: 1;
  border: 1px solid #bbc4e7;
  background: var(--blue-soft);
  animation: weight-update 4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 60ms);
}

@keyframes weight-update {
  0%, 100% { background: var(--blue-soft); }
  50% { background: #8ca0e4; }
}

.cluster-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.cluster-grid i {
  aspect-ratio: 1;
  border: 1px solid #b5a9d1;
  background: var(--violet-soft);
  animation: cluster-cell 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms);
}

@keyframes cluster-cell {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.output-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.output-stream span {
  height: 8px;
  background: var(--amber-soft);
  transform-origin: left;
  animation: output-line 2.8s ease-in-out infinite;
}

.output-stream span:nth-child(1) { width: 85%; }
.output-stream span:nth-child(2) { width: 62%; animation-delay: 0.2s; }
.output-stream span:nth-child(3) { width: 91%; animation-delay: 0.4s; }
.output-stream span:nth-child(4) { width: 47%; animation-delay: 0.6s; }

@keyframes output-line {
  0%, 100% { transform: scaleX(0.5); opacity: 0.4; }
  50% { transform: scaleX(1); opacity: 1; }
}

.hero-machine-readout {
  grid-column: 1 / -1;
  grid-row: 5;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 1px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.hero-machine-readout span {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 12px 14px;
  background: var(--paper-bright);
  font-size: 12px;
}

.hero-machine-readout small {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.hero-machine-readout b {
  color: var(--green);
  font-weight: 600;
}

.hero-progress {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-progress > span {
  position: relative;
  flex: 1;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.hero-progress > span::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress);
  background: var(--green);
}

.hero-progress small {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

/* Systems observatory */

.systems-observatory {
  --observatory-border: rgba(226, 235, 229, 0.18);
  --observatory-muted: #a7b2ac;
  padding: 108px max(48px, calc((100vw - 1344px) / 2));
  border-top: 1px solid #25342f;
  background: #101815;
  color: #f4f5ef;
}

.observatory-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 48px;
  margin-bottom: 52px;
}

.observatory-heading > div:first-child {
  max-width: 820px;
}

.observatory-heading .kicker {
  color: #79c2aa;
}

.observatory-heading h2 {
  max-width: 760px;
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 62px;
  font-weight: 400;
  line-height: 1;
}

.observatory-heading p:not(.kicker) {
  max-width: 740px;
  margin: 20px 0 0;
  color: #c2cac5;
  font-size: 18px;
  line-height: 1.65;
}

.observatory-mode {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  padding: 4px;
  border: 1px solid var(--observatory-border);
  background: #18231f;
}

.observatory-mode button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  color: var(--observatory-muted);
  cursor: pointer;
  font-weight: 600;
}

.observatory-mode button.is-active {
  background: #f4f5ef;
  color: #111815;
}

.observatory-mode svg {
  width: 16px;
  height: 16px;
}

.observatory-scale-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--observatory-border);
  border-bottom: 0;
}

.observatory-scale-tabs button {
  min-width: 0;
  min-height: 88px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border: 0;
  border-right: 1px solid var(--observatory-border);
  background: #131d19;
  color: var(--observatory-muted);
  cursor: pointer;
  text-align: left;
}

.observatory-scale-tabs button:last-child {
  border-right: 0;
}

.observatory-scale-tabs button:hover,
.observatory-scale-tabs button.is-active {
  background: #1b2924;
  color: #f4f5ef;
}

.observatory-scale-tabs button.is-active {
  box-shadow: inset 0 -3px #70bda3;
}

.observatory-scale-tabs button > span {
  color: #718078;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.observatory-scale-tabs button > svg {
  width: 18px;
  height: 18px;
  color: #70bda3;
}

.observatory-scale-tabs button > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.observatory-live-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(280px, 0.52fr);
  border: 1px solid var(--observatory-border);
  background: #111a17;
}

.observatory-stage {
  min-width: 0;
  border-right: 1px solid var(--observatory-border);
}

.observatory-stage-toolbar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px;
  border-bottom: 1px solid var(--observatory-border);
  color: var(--observatory-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.observatory-stage-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.observatory-stage-toolbar span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #70bda3;
  box-shadow: 0 0 0 6px rgba(112, 189, 163, 0.11);
  animation: live-dot 1.8s ease-in-out infinite;
}

.observatory-stage-toolbar b {
  color: #e2b086;
  font-weight: 500;
}

.observatory-scene {
  position: relative;
  min-height: 510px;
  overflow: hidden;
  isolation: isolate;
  background: #0d1512;
}

.observatory-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: calc(0.22 + var(--observatory-load) * 0.22);
  background-image:
    linear-gradient(rgba(164, 185, 175, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(164, 185, 175, 0.11) 1px, transparent 1px);
  background-size: 32px 32px;
}

.observatory-flowfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.observatory-flowfield path {
  fill: none;
}

.observatory-flowfield .flow-quiet {
  stroke: rgba(214, 228, 220, 0.18);
  stroke-width: 2;
}

.observatory-flowfield .flow-live {
  stroke: #70bda3;
  stroke-width: calc(2px + var(--observatory-load) * 2px);
  stroke-dasharray: 3 24;
  stroke-linecap: round;
  animation: observatory-flow var(--flow-speed) linear infinite;
}

@keyframes observatory-flow {
  to { stroke-dashoffset: -108; }
}

.observatory-scale-nodes {
  position: absolute;
  inset: 0 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  z-index: 2;
}

.observatory-node {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #7f8c85;
  text-align: center;
  transition: color 240ms ease, transform 240ms ease, opacity 240ms ease;
}

.observatory-node.is-downstream {
  opacity: 0.48;
}

.observatory-node.is-upstream {
  color: #a9b4ae;
}

.observatory-node.is-active {
  z-index: 3;
  color: #f4f5ef;
  transform: translateY(-8px);
}

.observatory-node-index {
  margin-bottom: 12px;
  color: #718078;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.observatory-node-visual {
  position: relative;
  width: clamp(72px, 7vw, 112px);
  aspect-ratio: 1;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 14px;
  margin-bottom: 17px;
  border: 1px solid rgba(218, 230, 223, 0.26);
  background: #16231e;
  box-shadow: 0 0 0 0 rgba(112, 189, 163, 0);
  transition: border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.observatory-node.is-active .observatory-node-visual {
  border-color: #8fd0ba;
  box-shadow:
    0 0 0 10px rgba(112, 189, 163, 0.08),
    0 0 calc(30px + var(--observatory-load) * 28px) rgba(112, 189, 163, 0.18);
  transform: scale(1.16);
}

.observatory-node-visual i {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(223, 232, 227, 0.18);
  background: rgba(112, 189, 163, 0.2);
  animation: observatory-cell calc(var(--flow-speed) * 1.4) ease-in-out infinite;
  animation-delay: calc(var(--cell) * 45ms);
}

.mode-serve .observatory-node-visual i {
  background: rgba(92, 126, 221, 0.24);
}

.node-token {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 12px);
}

.node-token i:nth-child(2n) {
  transform: translateY(5px);
}

.node-model {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.node-cluster {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.node-fleet {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.node-fleet i {
  border-radius: 50%;
}

@keyframes observatory-cell {
  0%, 100% { opacity: 0.35; }
  50% { opacity: calc(0.55 + var(--observatory-load) * 0.45); }
}

.observatory-node > strong {
  font-size: 14px;
  font-weight: 600;
}

.observatory-node > small {
  max-width: 130px;
  margin-top: 3px;
  color: currentColor;
  font-size: 11px;
}

.observatory-limiter {
  position: absolute;
  right: 22px;
  top: 24px;
  z-index: 4;
  min-width: 154px;
  padding: 11px 13px;
  border-left: 2px solid #e2a16c;
  background: rgba(24, 35, 31, 0.9);
}

.observatory-limiter span,
.observatory-limiter strong {
  display: block;
}

.observatory-limiter span {
  color: #adbbb4;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.observatory-limiter strong {
  margin-top: 4px;
  color: #f0c39d;
  font-size: 12px;
  font-weight: 600;
}

.observatory-load-sweep {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.observatory-load-sweep i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8%;
  width: 8%;
  background: linear-gradient(90deg, transparent, rgba(112, 189, 163, 0.07), transparent);
  animation: observatory-sweep calc(var(--flow-speed) * 2.7) linear infinite;
}

@keyframes observatory-sweep {
  to { transform: translateX(1350%); }
}

.observatory-stage-caption {
  min-height: 126px;
  padding: 26px 28px 29px;
  border-top: 1px solid var(--observatory-border);
  background: #131d19;
}

.observatory-stage-caption span {
  color: #79c2aa;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.observatory-stage-caption h3 {
  max-width: 700px;
  margin: 8px 0 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.08;
}

.observatory-console {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.observatory-control-block {
  padding: 26px 24px 28px;
  border-bottom: 1px solid var(--observatory-border);
}

.observatory-control-block label,
.observatory-pressure-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.observatory-control-block label span,
.observatory-pressure-heading span {
  color: #dce4df;
  font-size: 12px;
  font-weight: 600;
}

.observatory-control-block output,
.observatory-pressure-heading strong {
  color: #79c2aa;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
}

.observatory-control-block input {
  width: 100%;
  margin: 24px 0 7px;
  accent-color: #70bda3;
}

.range-ends {
  display: flex;
  justify-content: space-between;
  color: #718078;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.observatory-pressure {
  flex: 1;
  padding: 26px 24px;
}

.observatory-pressure-heading {
  margin-bottom: 24px;
}

.pressure-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.pressure-row small {
  color: #9aa8a1;
  font-size: 10px;
}

.pressure-row > span {
  height: 7px;
  overflow: hidden;
  background: rgba(214, 228, 220, 0.1);
}

.pressure-row > span i {
  display: block;
  width: var(--pressure);
  height: 100%;
  background: #70bda3;
  transition: width 180ms ease;
}

.pressure-row:nth-of-type(3) > span i {
  background: #7d98e2;
}

.pressure-row:nth-of-type(4) > span i {
  background: #b395dc;
}

.pressure-row:nth-of-type(5) > span i {
  background: #dea16f;
}

.pressure-row b {
  color: #d5ddd8;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  text-align: right;
}

.observatory-pressure > p {
  margin: 26px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--observatory-border);
  color: #87968e;
  font-size: 11px;
  line-height: 1.55;
}

.observatory-consequence-grid {
  display: grid;
  grid-template-columns: 0.8fr 1fr 1.45fr auto;
  border: 1px solid var(--observatory-border);
  border-top: 0;
  background: #17231f;
}

.observatory-consequence-grid > div,
.observatory-consequence-grid > button {
  min-width: 0;
  min-height: 108px;
  padding: 22px;
  border: 0;
  border-right: 1px solid var(--observatory-border);
  background: transparent;
  color: inherit;
  text-align: left;
}

.observatory-consequence-grid > div span,
.observatory-consequence-grid > div strong {
  display: block;
}

.observatory-consequence-grid > div span {
  color: #829088;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.observatory-consequence-grid > div strong {
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: #e8ece9;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.observatory-consequence-grid .is-decision strong {
  color: #f0c39d;
}

.observatory-consequence-grid > button {
  min-width: 190px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-right: 0;
  background: #f2f3ed;
  color: #131a17;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.observatory-consequence-grid > button:hover {
  background: #dcebe5;
}

@media (max-width: 1050px) {
  .observatory-heading {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .observatory-mode {
    justify-self: start;
  }

  .observatory-live-grid {
    grid-template-columns: 1fr;
  }

  .observatory-stage {
    border-right: 0;
    border-bottom: 1px solid var(--observatory-border);
  }

  .observatory-console {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  }

  .observatory-control-block {
    border-right: 1px solid var(--observatory-border);
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .systems-observatory {
    padding: 82px 22px;
  }

  .observatory-heading {
    gap: 30px;
    margin-bottom: 36px;
  }

  .observatory-heading h2 {
    font-size: 45px;
  }

  .observatory-heading p:not(.kicker) {
    font-size: 16px;
  }

  .observatory-mode {
    width: 100%;
  }

  .observatory-scale-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .observatory-scale-tabs button {
    min-height: 72px;
    padding: 14px;
    border-bottom: 1px solid var(--observatory-border);
  }

  .observatory-scale-tabs button:nth-child(2) {
    border-right: 0;
  }

  .observatory-scale-tabs button:nth-child(n + 3) {
    border-bottom: 0;
  }

  .observatory-scene {
    min-height: 650px;
  }

  .observatory-flowfield,
  .observatory-load-sweep {
    display: none;
  }

  .observatory-scale-nodes {
    inset: 86px 22px 24px;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    align-items: center;
  }

  .observatory-scale-nodes::before {
    content: "";
    position: absolute;
    left: 43px;
    top: 7%;
    bottom: 7%;
    width: 1px;
    background: rgba(214, 228, 220, 0.2);
  }

  .observatory-node {
    width: 100%;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: center;
    justify-items: start;
    column-gap: 16px;
    text-align: left;
  }

  .observatory-node.is-active {
    transform: translateX(6px);
  }

  .observatory-node-index {
    grid-column: 2;
    grid-row: 1;
    margin: 0 0 2px;
  }

  .observatory-node-visual {
    grid-column: 1;
    grid-row: 1 / 4;
    width: 72px;
    margin: 0;
    padding: 10px;
  }

  .observatory-node > strong,
  .observatory-node > small {
    grid-column: 2;
  }

  .observatory-node > strong {
    grid-row: 2;
  }

  .observatory-node > small {
    grid-row: 3;
    margin: 0;
  }

  .observatory-limiter {
    left: 16px;
    right: 16px;
    top: 16px;
  }

  .observatory-stage-caption {
    min-height: 0;
    padding: 22px;
  }

  .observatory-stage-caption h3 {
    font-size: 26px;
  }

  .observatory-console {
    grid-template-columns: 1fr;
  }

  .observatory-control-block {
    border-right: 0;
    border-bottom: 1px solid var(--observatory-border);
  }

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

  .observatory-consequence-grid > div,
  .observatory-consequence-grid > button {
    border-bottom: 1px solid var(--observatory-border);
  }

  .observatory-consequence-grid > div:nth-child(2),
  .observatory-consequence-grid > button {
    border-right: 0;
  }

  .observatory-consequence-grid > button {
    min-width: 0;
    border-bottom: 0;
  }
}

@media (max-width: 480px) {
  .observatory-scale-tabs button {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .observatory-scale-tabs button > svg {
    display: none;
  }

  .observatory-consequence-grid {
    grid-template-columns: 1fr;
  }

  .observatory-consequence-grid > div,
  .observatory-consequence-grid > button {
    min-height: 88px;
    border-right: 0;
  }
}

.story-preamble {
  padding: 104px 48px 112px;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.section-heading {
  max-width: var(--content-max);
  margin: 0 auto 46px;
}

.section-heading.narrow {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-heading h2 {
  max-width: 900px;
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 1.04;
}

.section-heading p:not(.kicker) {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.section-heading.narrow p:not(.kicker) {
  margin-left: auto;
  margin-right: auto;
}

.lifecycle-figure {
  position: relative;
  max-width: var(--content-max);
  margin: 70px auto 0;
}

.lifecycle-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 27px;
  height: 1px;
  background: var(--line-strong);
}

.lifecycle-line span {
  position: absolute;
  top: -3px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: lifecycle-trace 8s linear infinite;
}

@keyframes lifecycle-trace {
  from { left: 0; }
  to { left: calc(100% - 7px); }
}

.lifecycle-stages {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
}

.lifecycle-stage {
  min-width: 0;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.lifecycle-index {
  width: 55px;
  height: 55px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper-deep);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  transition: background-color 160ms ease, color 160ms ease;
}

.lifecycle-stage:hover .lifecycle-index,
.lifecycle-stage.is-active .lifecycle-index {
  background: var(--ink);
  color: white;
}

.lifecycle-stage strong {
  font-size: 14px;
}

.lifecycle-stage small {
  max-width: 110px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.35;
}

.lifecycle-detail {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 32px;
  padding-top: 23px;
  border-top: 1px solid var(--line-strong);
}

.lifecycle-detail span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
}

.lifecycle-detail small {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.lifecycle-detail p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-soft);
  font-family: "Newsreader", Georgia, serif;
  font-size: 23px;
  line-height: 1.4;
}

.story-body {
  position: relative;
  max-width: var(--page-max);
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 68px;
  margin: 0 auto;
  padding: 0 48px;
}

.chapter-rail {
  position: sticky;
  top: calc(var(--header-height) + 40px);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 72px);
  margin-top: 112px;
  padding-bottom: 20px;
  overflow-y: auto;
}

.chapter-rail > p {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.chapter-rail nav {
  display: flex;
  flex-direction: column;
}

.chapter-rail button {
  position: relative;
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  padding: 7px 6px 7px 13px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.chapter-rail button span {
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.chapter-rail button:hover,
.chapter-rail button.is-reading {
  color: var(--ink);
}

.chapter-rail button.is-reading::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--green);
}

.chapter-rail button.is-complete span::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: middle;
}

.chapters {
  min-width: 0;
}

.chapter-section {
  scroll-margin-top: calc(var(--header-height) + 22px);
  padding: 112px 0 104px;
  border-bottom: 1px solid var(--line);
}

.chapter-section:last-child {
  border-bottom: 0;
}

.chapter-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 32px;
  max-width: 980px;
}

.chapter-number {
  padding-top: 11px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 13px;
}

.chapter-question {
  margin: 0 0 17px;
  color: var(--green);
  font-size: 15px;
  font-weight: 600;
}

.chapter-header h2 {
  max-width: 900px;
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 58px;
  font-weight: 400;
  line-height: 1.03;
}

.chapter-lead {
  max-width: var(--reading-max);
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1.72;
}

.concept-visual {
  width: 100%;
  margin: 58px 0 52px;
  border: 1px solid var(--line-strong);
  background: var(--paper-bright);
}

.concept-visual figcaption {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

.concept-visual figcaption span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.chapter-reading {
  max-width: 870px;
  margin-left: 104px;
}

.lens-layer {
  display: none;
}

body[data-lens="foundation"] .lens-layer[data-layer="foundation"],
body[data-lens="systems"] .lens-layer[data-layer="systems"],
body[data-lens="operator"] .lens-layer[data-layer="operator"] {
  display: block;
}

.lens-label {
  margin: 0 0 13px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.lens-layer h3 {
  max-width: 760px;
  margin: 0 0 18px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
}

.lens-layer > p:not(.lens-label) {
  max-width: 760px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.75;
}

.lens-layer ul {
  max-width: 760px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.lens-layer li {
  position: relative;
  padding: 14px 14px 14px 29px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.lens-layer li::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 23px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.formula-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 54px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.formula-strip > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--paper-deep);
}

.formula-strip span {
  color: var(--ink-muted);
  font-size: 11px;
}

.formula-strip code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 12px;
}

.chapter-reference-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 48px;
  margin: 56px 0 0 104px;
}

.subsection-title {
  margin-bottom: 6px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
}

.term-table > div:not(.subsection-title) {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.term-table strong {
  font-size: 13px;
}

.term-table p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.chapter-check {
  padding: 22px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
}

.chapter-check h3 {
  margin: 0 0 24px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
}

.chapter-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.deep-dive-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
}

.deep-dive-links > span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.deep-dive-links button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  cursor: pointer;
}

.deep-dive-links svg {
  width: 13px;
  height: 13px;
}

.complete-chapter {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.complete-chapter.is-complete {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

/* Concept visuals */

.loop-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  padding: 44px 28px 36px;
}

.loop-track::before {
  content: "";
  position: absolute;
  left: 54px;
  right: 54px;
  top: 73px;
  height: 1px;
  background: var(--line-strong);
}

.loop-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.loop-step span {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: white;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.loop-step strong {
  font-size: 12px;
}

.loop-step.is-active span {
  transform: scale(1.08);
  background: var(--green);
  color: white;
}

.loop-step.is-past span {
  background: var(--green-soft);
  color: var(--green);
}

.token-context {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px 12px;
}

.token-context span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.token-context .token-open {
  border-style: dashed;
  color: var(--ink-muted);
}

.transformer-path {
  display: grid;
  grid-template-columns: minmax(104px, 0.8fr) 24px minmax(210px, 1.6fr) 24px minmax(112px, 0.9fr) 24px minmax(118px, 0.9fr);
  align-items: center;
  gap: 10px;
  padding: 16px 24px 24px;
}

.transformer-path > svg {
  width: 16px;
  color: var(--ink-muted);
  animation: token-arrow 1.8s ease-in-out infinite;
}

.transformer-node {
  min-width: 0;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
}

.transformer-node small,
.transformer-stack > span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.transformer-node strong {
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
}

.transformer-node span {
  color: var(--ink-soft);
  font-size: 10px;
}

.transformer-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  background: var(--canvas);
}

.transformer-stack > span {
  grid-column: 1 / -1;
}

.transformer-stack .transformer-node {
  min-height: 90px;
}

.node-attention {
  border-color: #9fbfb4;
  background: var(--green-soft);
}

.node-mlp {
  border-color: #babee1;
  background: var(--blue-soft);
}

.node-probability {
  border-color: #d4b57c;
  background: var(--amber-soft);
}

.token-candidates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 24px 24px;
  background: var(--line);
}

.token-candidates div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--paper);
  font-size: 11px;
}

.token-candidates span {
  position: relative;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding-right: 5px;
  color: var(--ink-soft);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.token-candidates span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--probability);
  background: var(--green-soft);
  animation: probability-grow 1.4s ease both;
}

.token-candidates span::after {
  content: attr(data-probability);
}

.token-candidates span {
  isolation: isolate;
}

.token-candidates span::before {
  z-index: -1;
}

@keyframes token-arrow {
  0%, 100% { transform: translateX(0); opacity: 0.4; }
  50% { transform: translateX(4px); opacity: 1; }
}

@keyframes probability-grow {
  from { width: 0; }
  to { width: var(--probability); }
}

.visual-control-row {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.visual-control-row p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.button-visual {
  border-color: var(--line-strong);
  background: var(--paper);
}

.button-visual:disabled {
  cursor: wait;
  opacity: 0.6;
}

.workstream-scale {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 18px 20px 10px 140px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.workstream-lanes {
  position: relative;
  padding: 0 20px 22px;
  overflow: hidden;
}

.workstream-lane {
  min-height: 50px;
  display: grid;
  grid-template-columns: 120px repeat(4, 1fr);
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.workstream-lane strong {
  font-size: 12px;
}

.workstream-lane span {
  padding: 7px 9px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  color: var(--ink-soft);
  font-size: 10px;
}

.workstream-lane:nth-child(2) span { border-color: var(--blue); background: var(--blue-soft); }
.workstream-lane:nth-child(3) span { border-color: var(--violet); background: var(--violet-soft); }
.workstream-lane:nth-child(4) span { border-color: var(--amber); background: var(--amber-soft); }
.workstream-lane:nth-child(5) span { border-color: var(--red); background: var(--red-soft); }

.workstream-playhead {
  position: absolute;
  top: 0;
  bottom: 22px;
  left: 140px;
  width: 1px;
  background: var(--ink);
  animation: workstream-play 8s ease-in-out infinite;
}

.workstream-playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

@keyframes workstream-play {
  0%, 100% { left: 140px; }
  50% { left: calc(100% - 24px); }
}

.visual-note {
  margin: 0;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 12px;
}

.pretrain-control-shell {
  height: 410px;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(210px, 0.68fr) minmax(0, 1.82fr);
  border-bottom: 1px solid var(--line);
}

.pretrain-control-tabs {
  display: grid;
  grid-template-rows: repeat(5, minmax(0, 1fr));
  border-right: 1px solid var(--line);
  background: var(--paper-deep);
}

.pretrain-control-tab {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.pretrain-control-tab:last-child {
  border-bottom: 0;
}

.pretrain-control-tab:hover {
  background: var(--paper-bright);
  color: var(--ink);
}

.pretrain-control-tab.is-active {
  background: var(--green-soft);
  box-shadow: inset 4px 0 0 var(--green);
  color: var(--ink);
}

.pretrain-control-tab span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.pretrain-control-tab strong {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pretrain-control-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px clamp(28px, 5vw, 72px);
  background: var(--paper-bright);
  box-shadow: inset 5px 0 0 var(--green);
}

.pretrain-control-panel[data-pretrain-panel="run-length"] {
  box-shadow: inset 5px 0 0 var(--amber);
}

.pretrain-control-panel[data-pretrain-panel="precision"] {
  box-shadow: inset 5px 0 0 var(--blue);
}

.pretrain-control-panel[data-pretrain-panel="distributed"] {
  box-shadow: inset 5px 0 0 var(--violet);
}

.pretrain-control-panel[data-pretrain-panel="evidence"] {
  box-shadow: inset 5px 0 0 var(--red);
}

.pretrain-control-panel > p {
  margin: 0 0 12px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.pretrain-control-panel h3 {
  max-width: 700px;
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 35px;
  font-weight: 400;
  line-height: 1.12;
}

.pretrain-panel-body {
  max-width: 760px;
  margin-top: 17px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.65;
}

.pretrain-control-panel > span {
  max-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
}

.pretrain-control-panel > span svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.isoflop-explainer {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  min-height: 310px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.isoflop-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px clamp(24px, 4vw, 52px);
  border-right: 1px solid var(--line);
}

.isoflop-copy > p {
  margin: 0 0 12px;
  color: var(--amber);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.isoflop-copy h3 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 31px;
  font-weight: 400;
  line-height: 1.12;
}

.isoflop-copy span {
  margin-top: 17px;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.isoflop-chart {
  width: 100%;
  height: 100%;
  min-height: 280px;
  padding: 24px 30px 18px 18px;
  overflow: visible;
}

.chart-axis {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.chart-label,
.curve-label {
  fill: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.isoflop-curve {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 560;
  stroke-dashoffset: 560;
  animation: draw-isoflop 2.8s ease forwards;
}

.curve-one {
  stroke: var(--green);
}

.curve-two {
  stroke: var(--blue);
  animation-delay: 220ms;
}

.curve-three {
  stroke: var(--violet);
  animation-delay: 440ms;
}

.isoflop-minimum {
  fill: var(--paper-bright);
  stroke-width: 3;
  opacity: 0;
  animation: reveal-minimum 400ms ease 1.8s forwards;
}

.minimum-one {
  stroke: var(--green);
}

.minimum-two {
  stroke: var(--blue);
  animation-delay: 2s;
}

.minimum-three {
  stroke: var(--violet);
  animation-delay: 2.2s;
}

@keyframes draw-isoflop {
  to { stroke-dashoffset: 0; }
}

@keyframes reveal-minimum {
  to { opacity: 1; }
}

.pretrain-budget-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: stretch;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.pretrain-budget-strip > div {
  min-width: 0;
  min-height: 98px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
}

.pretrain-budget-strip > b {
  align-self: center;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

.pretrain-budget-strip small {
  color: var(--ink-muted);
  font-size: 9px;
}

.pretrain-budget-strip strong {
  overflow-wrap: anywhere;
  font-family: "DM Mono", monospace;
  font-size: 13px;
}

.pretrain-budget-strip span {
  color: var(--ink-muted);
  font-size: 10px;
}

.pretrain-budget-strip .budget-result {
  border-color: #91c1b2;
  background: var(--green-soft);
}

.visual-inline-link {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.adaptation-axis {
  display: flex;
  justify-content: space-between;
  padding: 18px 20px 9px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.adaptation-methods {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  padding: 0 20px 22px;
  background: var(--line);
}

.adaptation-method {
  min-width: 0;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px;
  border: 0;
  background: var(--paper-bright);
  text-align: left;
  cursor: pointer;
}

.adaptation-method:hover,
.adaptation-method.is-active {
  background: var(--paper-deep);
}

.adaptation-method > span {
  margin-bottom: 28px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.adaptation-method strong {
  font-size: 14px;
}

.adaptation-method small {
  margin-top: 5px;
  color: var(--ink-muted);
  font-size: 11px;
}

.adaptation-method em {
  margin-top: auto;
  color: var(--ink-soft);
  font-size: 10px;
  font-style: normal;
}

.method-work {
  margin-top: 8px;
  padding: 3px 5px;
  border-radius: 2px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  font-style: normal;
}

.method-work.generate {
  background: var(--amber-soft);
  color: var(--amber);
}

.roofline-chart {
  position: relative;
  height: 410px;
  margin: 30px 40px 12px 64px;
  border-left: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.roofline-chart::before,
.roofline-chart::after {
  content: "";
  position: absolute;
  inset: 33.33% 0 auto;
  border-top: 1px solid var(--line);
}

.roofline-chart::after {
  top: 66.66%;
}

.roofline-y-label,
.roofline-x-label {
  position: absolute;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.roofline-y-label {
  left: -54px;
  top: 50%;
  transform: rotate(-90deg);
}

.roofline-x-label {
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
}

.roofline-bandwidth-line {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 63%;
  height: 2px;
  background: var(--blue);
  transform: rotate(-35deg);
  transform-origin: left center;
}

.roofline-compute-line {
  position: absolute;
  left: 52%;
  right: 0;
  top: 24%;
  height: 2px;
  background: var(--green);
}

.roofline-ridge {
  position: absolute;
  left: 55%;
  top: 24%;
  bottom: 0;
  border-left: 1px dashed var(--line-strong);
}

.roofline-ridge span {
  position: absolute;
  top: -20px;
  left: -14px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.roofline-point {
  position: absolute;
  z-index: 3;
  left: 28%;
  top: 56%;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: left 100ms linear, top 100ms linear;
}

.roofline-point i {
  width: 12px;
  height: 12px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.roofline-point span {
  padding: 2px 5px;
  background: var(--paper-bright);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.roofline-region {
  position: absolute;
  font-family: "Newsreader", Georgia, serif;
  font-size: 18px;
}

.roofline-region.memory { left: 11%; bottom: 31%; color: var(--blue); transform: rotate(-35deg); }
.roofline-region.compute { right: 11%; top: 16%; color: var(--green); }

.roofline-control {
  min-height: 66px;
  display: grid;
  grid-template-columns: 160px 1fr 140px;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}

.roofline-control label {
  color: var(--ink-soft);
  font-size: 12px;
}

.roofline-control input {
  width: 100%;
  accent-color: var(--blue);
}

.roofline-control strong {
  color: var(--blue);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  text-align: right;
  text-transform: uppercase;
}

.roofline-control strong.is-compute {
  color: var(--green);
}

.topology-map {
  position: relative;
  min-height: 430px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 12px;
  padding: 30px;
}

.topology-node {
  z-index: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9a9d9;
  background: var(--violet-soft);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.node-a { grid-area: 1 / 1 / 2 / 2; }
.node-b { grid-area: 1 / 3 / 2 / 4; }
.node-c { grid-area: 3 / 1 / 4 / 2; }
.node-d { grid-area: 3 / 3 / 4 / 4; }
.node-e { grid-area: 1 / 7 / 2 / 8; }
.node-f { grid-area: 1 / 9 / 2 / 10; }
.node-g { grid-area: 3 / 7 / 4 / 8; }
.node-h { grid-area: 3 / 9 / 4 / 10; }

.topology-switch {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #879cdc;
  background: var(--blue-soft);
  text-align: center;
}

.switch-left { grid-area: 2 / 2 / 3 / 3; }
.switch-right { grid-area: 2 / 8 / 3 / 9; }

.topology-switch strong,
.topology-fabric strong { font-size: 11px; }
.topology-switch small,
.topology-fabric small { color: var(--ink-muted); font-size: 9px; }

.topology-fabric {
  z-index: 2;
  grid-area: 5 / 3 / 6 / 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #c98759;
  background: var(--amber-soft);
}

.topology-map::before,
.topology-map::after {
  content: "";
  position: absolute;
  top: 42%;
  bottom: 18%;
  width: 38%;
  border: 1px solid var(--line-strong);
  border-top: 0;
}

.topology-map::before { left: 9%; }
.topology-map::after { right: 9%; }

.packet {
  position: absolute;
  z-index: 3;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: packet-travel 4s ease-in-out infinite;
}

.packet-a { left: 15%; top: 35%; }
.packet-b { right: 17%; top: 35%; animation-delay: 0.6s; background: var(--blue); }
.packet-c { left: 49%; bottom: 23%; animation-delay: 1.2s; background: var(--amber); }

@keyframes packet-travel {
  0%, 100% { transform: translateY(-15px); opacity: 0.2; }
  50% { transform: translateY(55px); opacity: 1; }
}

.topology-legend {
  display: flex;
  gap: 24px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 10px;
}

.topology-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.topology-legend i {
  width: 14px;
  height: 3px;
  background: var(--blue);
}

.topology-legend i.wide { background: var(--amber); }

.inference-timeline {
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1fr) minmax(300px, 1.4fr);
  align-items: stretch;
  padding: 30px;
}

.prompt-tokens,
.prefill-zone,
.decode-zone {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

.prompt-tokens {
  flex-wrap: wrap;
  gap: 6px;
  padding: 30px;
  background: var(--paper);
}

.prompt-tokens::before {
  content: "prompt";
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.prompt-tokens i {
  width: 22px;
  height: 12px;
  background: var(--blue-soft);
  animation: prompt-load 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 90ms);
}

@keyframes prompt-load {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.prefill-zone,
.decode-zone {
  flex-direction: column;
  gap: 7px;
}

.prefill-zone {
  border-left: 0;
  background: var(--green-soft);
}

.decode-zone {
  border-left: 0;
  background: var(--amber-soft);
}

.prefill-zone strong,
.decode-zone strong {
  font-family: "Newsreader", Georgia, serif;
  font-size: 30px;
  font-weight: 400;
}

.prefill-zone small,
.decode-zone small {
  color: var(--ink-muted);
  font-size: 11px;
}

.prefill-zone > span,
.decode-zone > span {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.decode-tokens {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.decode-tokens i {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--amber);
  animation: decode-token 3s step-end infinite;
}

.decode-tokens i:nth-child(2) { animation-delay: 0.35s; }
.decode-tokens i:nth-child(3) { animation-delay: 0.7s; }
.decode-tokens i:nth-child(4) { animation-delay: 1.05s; }
.decode-tokens i:nth-child(5) { animation-delay: 1.4s; }
.decode-tokens i:nth-child(6) { animation-delay: 1.75s; }

@keyframes decode-token {
  0%, 20% { opacity: 0.18; transform: translateY(5px); }
  21%, 100% { opacity: 1; transform: translateY(0); }
}

.inference-resource-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.inference-resource-row > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 7px auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  padding: 15px;
  background: white;
}

.resource-meter {
  grid-row: 1 / 3;
  width: 7px;
  height: 42px;
  align-self: center;
  background: var(--green);
}

.resource-meter.memory { background: var(--blue); }
.resource-meter.cache { background: var(--amber); }
.inference-resource-row strong { font-size: 12px; }
.inference-resource-row small { color: var(--ink-muted); font-size: 10px; }

.control-loop-map {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 40px 28px;
}

.control-loop-map::before {
  content: "";
  position: absolute;
  left: 60px;
  right: 60px;
  top: 50%;
  height: 1px;
  background: var(--line-strong);
}

.control-node {
  position: relative;
  z-index: 2;
  width: 112px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: white;
}

.control-node span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.control-node strong {
  font-size: 12px;
}

.control-node:nth-child(2),
.control-node:nth-child(3) { border-color: #8ea2e1; background: var(--blue-soft); }
.control-node:nth-child(4),
.control-node:nth-child(5) { border-color: #91c1b2; background: var(--green-soft); }
.control-node:nth-child(6),
.control-node:nth-child(7) { border-color: #d29a72; background: var(--amber-soft); }

.control-pulse {
  position: absolute;
  z-index: 3;
  top: calc(50% - 4px);
  left: 60px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  animation: control-travel 7s linear infinite;
}

@keyframes control-travel {
  from { left: 60px; }
  to { left: calc(100% - 68px); }
}

.control-equation {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.control-equation svg {
  width: 13px;
  height: 13px;
}

.journey-close {
  padding: 112px 48px;
  background: var(--dark);
  color: white;
  text-align: center;
}

.journey-close .kicker {
  color: #8fd0bc;
}

.journey-close h2 {
  max-width: 950px;
  margin: 0 auto;
  font-family: "Newsreader", Georgia, serif;
  font-size: 58px;
  font-weight: 400;
  line-height: 1.05;
}

.journey-close > p:not(.kicker) {
  max-width: 650px;
  margin: 24px auto 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
}

.journey-close-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

/* Standard pages */

.standard-page {
  min-height: calc(100vh - var(--header-height));
  padding: 84px 48px 120px;
}

.page-intro {
  max-width: var(--content-max);
  margin: 0 auto 86px;
}

.page-intro.split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.page-intro h1 {
  max-width: 930px;
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 68px;
  font-weight: 400;
  line-height: 1;
}

.page-intro > p:not(.kicker),
.page-intro > div > p:not(.kicker) {
  max-width: 690px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.atlas-stack,
.phase-matrix-section,
.atlas-chapters,
.reference-section {
  max-width: var(--content-max);
  margin: 0 auto 110px;
}

.atlas-stack .section-heading,
.phase-matrix-section .section-heading,
.atlas-chapters .section-heading,
.reference-section .section-heading {
  margin-left: 0;
}

.stack-diagram {
  border-top: 1px solid var(--line-strong);
}

.stack-diagram > div {
  display: grid;
  grid-template-columns: 70px 230px 1fr;
  gap: 22px;
  align-items: center;
  min-height: 95px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.stack-diagram > div:nth-child(1) { border-left: 6px solid var(--green); padding-left: 18px; }
.stack-diagram > div:nth-child(2) { border-left: 6px solid var(--blue); padding-left: 18px; }
.stack-diagram > div:nth-child(3) { border-left: 6px solid var(--violet); padding-left: 18px; }
.stack-diagram > div:nth-child(4) { border-left: 6px solid var(--amber); padding-left: 18px; }
.stack-diagram > div:nth-child(5) { border-left: 6px solid var(--red); padding-left: 18px; }

.stack-diagram span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.stack-diagram strong {
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  font-weight: 400;
}

.stack-diagram p {
  margin: 0;
  color: var(--ink-soft);
}

.phase-matrix-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.phase-matrix {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  text-align: left;
}

.phase-matrix th,
.phase-matrix td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  vertical-align: top;
}

.phase-matrix thead th {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.phase-matrix tbody th {
  color: var(--ink);
  font-size: 13px;
}

.atlas-chapter-list {
  border-top: 1px solid var(--ink);
}

.atlas-chapter-list button {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 70px 190px 1fr 44px;
  gap: 18px;
  align-items: center;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.atlas-chapter-list button:hover {
  background: var(--paper-bright);
}

.atlas-chapter-list span {
  padding-left: 14px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.atlas-chapter-list strong {
  font-size: 15px;
}

.atlas-chapter-list p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

/* Labs */

.build-intro {
  margin-bottom: 52px;
}

.model-workbench,
.planning-lab-section {
  max-width: var(--content-max);
  margin-right: auto;
  margin-left: auto;
}

.model-workbench {
  margin-bottom: 126px;
}

.build-studio-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 48px;
  align-items: end;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--ink);
}

.build-studio-heading h2,
.runtime-heading h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.08;
}

.build-studio-heading > div:first-child > p:last-child,
.runtime-heading > div > p:last-child {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.build-proof-summary {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.build-proof-summary > span {
  font-family: "DM Mono", monospace;
  font-size: 13px;
}

.build-proof-summary > span strong {
  color: var(--green);
  font-size: 24px;
}

.build-proof-summary p {
  margin: 2px 0 12px;
  color: var(--ink-muted);
  font-size: 10px;
}

.build-proof-summary button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  cursor: pointer;
}

.build-proof-summary button:disabled {
  color: var(--ink-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.build-proof-summary svg {
  width: 14px;
}

.build-stage-tabs {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
}

.build-stage-tabs button {
  min-width: 0;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 15px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--paper-bright);
  text-align: left;
  cursor: pointer;
}

.build-stage-tabs button:hover {
  background: var(--paper);
}

.build-stage-tabs button.is-active {
  background: var(--green-soft);
  box-shadow: inset 0 3px 0 var(--green);
}

.build-stage-tabs button.is-complete:not(.is-active) {
  background: #eef6f2;
}

.build-stage-tabs button > span {
  min-height: 19px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.build-stage-tabs button.is-complete > span {
  color: var(--green);
}

.build-stage-tabs button > span svg {
  width: 13px;
  height: 13px;
}

.build-stage-tabs strong {
  font-size: 11px;
  line-height: 1.2;
}

.build-stage-tabs small {
  color: var(--ink-muted);
  font-size: 8px;
  line-height: 1.35;
}

.build-studio-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  border: 1px solid var(--line-strong);
  border-top: 0;
  background: var(--paper-bright);
}

.build-artifact-rail {
  min-width: 0;
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: var(--paper-deep);
}

.artifact-progress {
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.artifact-progress span {
  width: var(--artifact-progress);
  height: 100%;
  display: block;
  background: var(--green);
  transition: width 220ms ease;
}

.build-artifact-rail > p {
  margin: 12px 0 20px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.build-artifact-rail ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.build-artifact-rail li {
  min-width: 0;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
}

.build-artifact-rail li:last-child {
  border-bottom: 0;
}

.build-artifact-rail li.is-complete {
  color: var(--green);
}

.build-artifact-rail li > svg {
  width: 15px;
  height: 15px;
}

.build-artifact-rail li span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.build-artifact-rail li strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.build-artifact-rail li small {
  overflow-wrap: anywhere;
  font-family: "DM Mono", monospace;
  font-size: 7px;
  line-height: 1.4;
}

.build-stage-panel {
  min-width: 0;
  min-height: 650px;
  padding: 42px clamp(28px, 4vw, 58px) 32px;
  background: var(--paper-bright);
}

.build-stage-heading {
  max-width: 820px;
}

.build-stage-heading > span {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.build-stage-heading h3 {
  margin: 8px 0 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 37px;
  font-weight: 400;
  line-height: 1.08;
}

.build-stage-heading p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.68;
}

.build-stage-heading code,
.build-explainer code {
  font-family: "DM Mono", monospace;
  font-size: 0.88em;
}

.build-lineage {
  margin: 30px 0 0;
  border: 1px solid var(--line-strong);
  background: var(--paper-bright);
}

.build-lineage > div:first-child {
  display: grid;
  grid-template-columns: 140px minmax(260px, 0.65fr) minmax(0, 1fr);
  gap: 22px;
  align-items: baseline;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.build-lineage > div:first-child > span,
.build-visual-instrument header > div:first-child > span {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.build-lineage h3 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.12;
}

.build-lineage p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.build-lineage-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}

.build-lineage svg {
  width: 100%;
  min-width: 900px;
  height: auto;
  display: block;
}

.build-lineage svg line {
  stroke: var(--line-strong);
  stroke-width: 2;
}

.build-lineage svg line.is-complete {
  stroke: var(--green);
  stroke-width: 4;
}

.build-lineage .lineage-baseline {
  stroke: var(--line);
  stroke-dasharray: 3 7;
}

.build-lineage .lineage-cursor {
  stroke: var(--amber);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.build-lineage a {
  color: var(--ink-muted);
  text-decoration: none;
  cursor: pointer;
}

.build-lineage a circle,
.build-lineage a rect {
  fill: var(--paper-bright);
  stroke: var(--line-strong);
  stroke-width: 2;
  transition: fill 180ms ease, stroke 180ms ease;
}

.build-lineage a:hover circle,
.build-lineage a:hover rect,
.build-lineage a.is-active circle,
.build-lineage a.is-active rect {
  fill: var(--amber-soft);
  stroke: var(--amber);
}

.build-lineage a.is-complete circle,
.build-lineage a.is-complete rect {
  fill: var(--green-soft);
  stroke: var(--green);
}

.build-lineage text {
  fill: currentColor;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-anchor: middle;
}

.build-lineage .lineage-label {
  fill: var(--ink-soft);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 10px;
  font-weight: 600;
}

.build-lineage .lineage-step {
  fill: var(--green);
  font-size: 7px;
}

.build-visual-instrument {
  margin-top: 30px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
  background: #fbfbf7;
}

.build-visual-instrument > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.42fr);
  gap: 28px;
  align-items: end;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.build-visual-instrument header > div:first-child {
  min-width: 0;
}

.build-visual-instrument h4 {
  margin: 7px 0 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 29px;
  font-weight: 400;
  line-height: 1.08;
}

.build-visual-instrument header p {
  max-width: 680px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.visual-controls {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.visual-controls label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.visual-controls label output {
  color: var(--green);
  font-size: 10px;
}

.visual-controls input[type="range"] {
  width: 100%;
  grid-column: 1 / -1;
  accent-color: var(--green);
}

.visual-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
}

.visual-segmented:has(button:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.visual-segmented button {
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--paper-bright);
  color: var(--ink-muted);
  font-size: 8px;
  cursor: pointer;
}

.visual-segmented button:last-child {
  border-right: 0;
}

.visual-segmented button:hover,
.visual-segmented button.is-active {
  background: var(--green-soft);
  color: var(--green);
}

.visual-chart-wrap {
  min-width: 0;
  padding: 16px 22px 8px;
  overflow-x: auto;
  background: var(--paper-bright);
}

.build-data-chart {
  width: 100%;
  min-width: 570px;
  height: auto;
  display: block;
}

.build-data-chart text {
  fill: var(--ink-soft);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 10px;
}

.build-data-chart .chart-axis-label,
.build-data-chart .chart-value,
.build-data-chart .chart-placeholder {
  fill: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.build-data-chart .chart-track {
  fill: var(--paper-deep);
}

.build-data-chart .chart-bar,
.build-data-chart .data-anchor-bar,
.build-data-chart .eval-pass-bar {
  fill: var(--green);
  transition: width 180ms ease;
}

.build-data-chart .tone-1 {
  fill: var(--blue);
}

.build-data-chart .tone-2 {
  fill: var(--amber);
}

.build-data-chart .tone-3 {
  fill: var(--violet);
}

.build-data-chart .tone-4 {
  fill: var(--red);
}

.build-data-chart .data-base-bar,
.build-data-chart .memory-base {
  fill: #c9ccc5;
}

.build-data-chart .memory-trainable {
  fill: var(--violet);
}

.build-data-chart g.is-selected .memory-base,
.build-data-chart g.is-selected .memory-trainable {
  stroke: var(--ink);
  stroke-width: 2;
}

.build-data-chart .chart-grid,
.build-data-chart .checkpoint-guide {
  stroke: var(--line);
  stroke-width: 1;
}

.build-data-chart .checkpoint-guide {
  stroke-dasharray: 3 5;
}

.build-data-chart .domain-line,
.build-data-chart .retention-line,
.build-data-chart .capacity-response-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.build-data-chart .retention-line {
  stroke: var(--blue);
}

.build-data-chart .domain-point,
.build-data-chart .retention-point {
  fill: var(--paper-bright);
  stroke: var(--green);
  stroke-width: 3;
}

.build-data-chart .retention-point {
  stroke: var(--blue);
}

.build-data-chart .eval-fail-bar {
  fill: var(--red);
}

.build-data-chart .eval-limit {
  stroke: var(--ink);
  stroke-width: 3;
}

.build-data-chart .prefill-block {
  fill: var(--blue-soft);
  stroke: var(--blue);
  stroke-width: 2;
}

.build-data-chart .decode-block {
  fill: var(--amber-soft);
  stroke: var(--amber);
  stroke-width: 2;
}

.build-data-chart .decode-tick {
  stroke: rgba(168, 90, 34, 0.42);
  stroke-width: 1;
}

.build-data-chart .timeline-arrow {
  fill: none;
  stroke: var(--ink-muted);
  stroke-width: 2;
}

.build-data-chart .capacity-response-line {
  stroke: var(--amber);
}

.build-data-chart .capacity-plan-line {
  stroke: var(--green);
  stroke-dasharray: 5 5;
}

.build-data-chart .capacity-slo-line {
  stroke: var(--blue);
  stroke-dasharray: 3 5;
}

.build-data-chart .capacity-point {
  fill: var(--paper-bright);
  stroke-width: 4;
}

.build-data-chart .capacity-point.is-stable {
  stroke: var(--green);
}

.build-data-chart .capacity-point.is-hot {
  stroke: var(--red);
}

.visual-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 18px;
  padding: 9px 22px 13px;
  border-top: 1px solid var(--line);
  background: var(--paper-bright);
}

.visual-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 7px;
}

.visual-legend i {
  width: 12px;
  height: 3px;
  display: block;
  background: var(--line-strong);
}

.visual-legend i.green { background: var(--green); }
.visual-legend i.blue { background: var(--blue); }
.visual-legend i.amber { background: var(--amber); }
.visual-legend i.violet { background: var(--violet); }
.visual-legend i.red { background: var(--red); }
.visual-legend i.black { background: var(--ink); }
.visual-legend i.gray { background: #b7bbb3; }

.visual-insight {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
}

.visual-insight svg {
  width: 15px;
  color: var(--green);
}

.objective-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 32px;
}

.objective-options button {
  min-width: 0;
  min-height: 142px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  text-align: left;
  cursor: pointer;
}

.objective-options button:hover,
.objective-options button.is-active {
  border-color: var(--green);
  background: var(--green-soft);
}

.objective-options svg {
  width: 19px;
}

.objective-options span {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.objective-options strong {
  font-size: 12px;
}

.objective-options small {
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.5;
}

.artifact-preview {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
  padding: 18px;
  border-radius: 4px;
  background: var(--dark);
  color: white;
}

.artifact-preview > span {
  color: #75d7b5;
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.artifact-preview code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.82);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.build-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.build-gate > div {
  min-width: 0;
}

.build-gate span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.build-gate.is-complete span {
  color: var(--green);
}

.build-gate span svg {
  width: 14px;
}

.build-gate p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.build-gate .button {
  flex: 0 0 auto;
  min-height: 44px;
}

.sentence-input {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.sentence-input > span,
.serve-request label > span,
.design-controls label > span,
.observe-controls label > span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.sentence-input textarea,
.serve-request textarea {
  width: 100%;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper-bright);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.sentence-presets,
.choice-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.sentence-presets button,
.choice-strip button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 9px;
  cursor: pointer;
}

.sentence-presets button:hover,
.choice-strip button:hover,
.choice-strip button.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.sentence-inspector {
  margin-top: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.sentence-source {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 18px;
  padding: 17px;
  border-bottom: 1px solid var(--line);
}

.sentence-source > span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.sentence-source blockquote {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  line-height: 1.35;
}

.token-strip {
  display: flex;
  gap: 5px;
  padding: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.token-strip > span {
  min-width: 72px;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  background: white;
}

.token-strip small,
.token-strip em {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 7px;
  font-style: normal;
}

.token-strip strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

.token-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.token-facts > div {
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.token-facts > div:last-child {
  border-right: 0;
}

.token-facts dt,
.serve-response dt {
  color: var(--ink-muted);
  font-size: 8px;
}

.token-facts dd,
.serve-response dd {
  margin: 3px 0 0;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.build-explainer {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
  margin-top: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.build-explainer strong {
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.build-explainer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.65;
}

.trained-model-contract {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  margin-top: 30px;
  border: 1px solid #9fbfb4;
  background: var(--green-soft);
}

.trained-model-contract > div {
  padding: 22px;
  border-right: 1px solid #9fbfb4;
}

.trained-model-contract > div > span,
.blueprint-heading > span {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.trained-model-contract h4,
.blueprint-heading h4 {
  margin: 8px 0 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.1;
}

.trained-model-contract p,
.blueprint-heading p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.6;
}

.trained-model-contract dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.trained-model-contract dl > div {
  min-width: 0;
  padding: 17px;
  border-right: 1px solid #b8d0c8;
  border-bottom: 1px solid #b8d0c8;
}

.trained-model-contract dl > div:nth-child(2n) { border-right: 0; }
.trained-model-contract dl > div:nth-last-child(-n + 2) { border-bottom: 0; }

.trained-model-contract dt {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 7px;
  text-transform: uppercase;
}

.trained-model-contract dd {
  margin: 7px 0 0;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.model-contract-equation {
  grid-column: 1 / -1;
  padding: 12px 18px;
  border-top: 1px solid #9fbfb4;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-align: center;
  overflow-wrap: anywhere;
}

.blueprint-heading {
  display: grid;
  grid-template-columns: 140px minmax(220px, 0.55fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--ink);
}

.blueprint-heading h4,
.blueprint-heading p { margin-top: 0; }

.design-workbench {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.28fr);
  gap: 24px;
  margin-top: 30px;
}

.design-controls {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.design-controls label,
.observe-controls label,
.serve-request > label {
  display: grid;
  gap: 9px;
}

.design-controls label > span,
.observe-controls label > span,
.serve-request label > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.design-controls output,
.observe-controls output,
.serve-request output {
  color: var(--green);
}

.design-controls input[type="range"],
.observe-controls input[type="range"],
.serve-request input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.design-controls .design-toggle {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.design-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.design-toggle > span {
  display: block !important;
  color: var(--ink-soft) !important;
  text-transform: none !important;
}

.parameter-ledger {
  border-top: 1px solid var(--ink);
}

.parameter-ledger > div {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(155px, 1fr) 84px;
  gap: 16px;
  align-items: center;
  min-height: 48px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
}

.parameter-ledger span {
  font-size: 10px;
}

.parameter-ledger code {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.parameter-ledger strong {
  text-align: right;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.parameter-ledger .parameter-total {
  background: var(--green-soft);
  color: var(--green);
}

.embedded-model-lab {
  margin-top: 28px;
}

.embedded-model-lab .browser-model-copy,
.embedded-model-lab .browser-model-output {
  padding: 28px;
}

.embedded-model-lab .browser-model-copy h4 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 30px;
  font-weight: 400;
}

.embedded-model-lab .browser-model-copy > p:not(.kicker) {
  margin-top: 12px;
}

.build-auto-gate {
  margin: 18px 0 0;
  padding: 13px 16px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--ink-soft);
  font-size: 10px;
}

.choice-strip {
  margin-top: 28px;
}

.continuation-grid,
.eval-board,
.observe-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
}

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

.continuation-grid > div,
.eval-board > div,
.observe-results > div {
  min-width: 0;
  min-height: 138px;
  display: flex;
  flex-direction: column;
  padding: 17px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.continuation-grid span,
.eval-board span,
.observe-results span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 7px;
  text-transform: uppercase;
}

.continuation-grid strong,
.eval-board strong,
.observe-results strong {
  margin-top: 9px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.continuation-grid p,
.eval-board p {
  margin: auto 0 0;
  padding-top: 14px;
  color: var(--ink-muted);
  font-size: 9px;
  line-height: 1.5;
}

.demo-pair {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) 24px minmax(0, 1.28fr);
  gap: 14px;
  align-items: stretch;
  margin-top: 22px;
}

.demo-pair > div {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.demo-pair > div:last-child {
  border-color: #9fbfb4;
  background: var(--green-soft);
}

.demo-pair > svg {
  align-self: center;
  width: 16px;
  color: var(--ink-muted);
}

.demo-pair span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.demo-pair p {
  margin: 11px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.eval-board {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
}

.eval-board > div {
  position: relative;
  min-height: 170px;
}

.eval-result.is-pass {
  background: var(--green-soft);
}

.eval-result.is-review {
  background: var(--amber-soft);
}

.eval-result em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 7px;
  font-style: normal;
  text-transform: uppercase;
}

.eval-result.is-review em {
  color: var(--amber);
}

.eval-result em svg {
  width: 11px;
}

.eval-empty {
  grid-column: 2 / -1;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.eval-empty svg {
  color: var(--ink-muted);
}

.serve-console {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  margin-top: 28px;
  border: 1px solid var(--line-strong);
}

.serve-request {
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.serve-request .button {
  justify-self: start;
}

.serve-response {
  min-width: 0;
  padding: 24px;
  background: var(--dark);
  color: white;
}

.serve-response > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, 0.55);
  font-family: "DM Mono", monospace;
  font-size: 8px;
}

.serve-response > div strong {
  color: #75d7b5;
}

.serve-response pre {
  min-height: 150px;
  max-height: 230px;
  margin: 20px 0;
  overflow: auto;
  color: rgba(255, 255, 255, 0.86);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.serve-response dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.serve-response dl > div {
  padding: 0 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.serve-response dl > div:first-child {
  padding-left: 0;
}

.serve-response dl > div:last-child {
  border-right: 0;
}

.serve-response dt {
  color: rgba(255, 255, 255, 0.48);
}

.observe-console {
  display: grid;
  grid-template-columns: minmax(230px, 0.68fr) minmax(0, 1.32fr);
  gap: 24px;
  margin-top: 28px;
}

.observe-controls {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
}

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

.observe-results > div {
  min-height: 110px;
}

.observe-results > div:last-child {
  grid-column: 1 / -1;
}

.observe-results > div.is-healthy {
  background: var(--green-soft);
  color: var(--green);
}

.observe-results > div.is-hot {
  background: var(--red-soft);
  color: var(--red);
}

.runtime-bridge {
  margin-top: 88px;
  border-top: 1px solid var(--ink);
}

.runtime-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: end;
  padding: 38px 0 26px;
}

.runtime-heading > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-decoration: none;
}

.runtime-heading > a svg {
  width: 13px;
}

.runtime-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-strong);
  border-bottom: 0;
}

.runtime-tabs button {
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  cursor: pointer;
}

.runtime-tabs button:last-child {
  border-right: 0;
}

.runtime-tabs button.is-active {
  background: var(--dark);
  color: white;
}

.runtime-lab-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 42px;
  min-height: 440px;
  padding: 34px;
  border: 1px solid var(--line-strong);
  background: var(--paper-bright);
}

.runtime-panel-copy,
.runtime-lab-panel > aside,
.runtime-panel-copy .code-shell,
.runtime-panel-copy pre {
  min-width: 0;
}

.runtime-panel-copy > span {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.runtime-panel-copy h3 {
  margin: 8px 0 10px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.15;
}

.runtime-panel-copy > p {
  max-width: 720px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.runtime-lab-panel > aside {
  align-self: start;
  padding: 20px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
}

.runtime-lab-panel > aside strong {
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.runtime-lab-panel > aside p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.build-pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr) 32px) minmax(0, 1fr);
  align-items: center;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line-strong);
}

.build-pipeline > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 19px 10px;
}

.build-pipeline > div:first-child {
  padding-left: 0;
}

.build-pipeline small,
.build-pipeline span {
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.build-pipeline strong {
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  font-weight: 400;
}

.build-pipeline > div.is-active small,
.build-pipeline > div.is-active strong {
  color: var(--green);
}

.build-pipeline > svg {
  width: 14px;
  color: var(--line-strong);
}

.browser-model-lab {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  margin-top: 58px;
  border: 1px solid var(--line-strong);
  background: white;
}

.browser-model-copy,
.browser-model-output {
  min-width: 0;
  padding: 38px;
}

.browser-model-copy {
  border-right: 1px solid var(--line);
}

.browser-model-copy h2 {
  max-width: 560px;
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 45px;
  font-weight: 400;
  line-height: 1.02;
}

.browser-model-copy > p:not(.kicker) {
  max-width: 590px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.68;
}

.browser-model-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.browser-model-specs > div {
  padding: 14px 12px;
  border-right: 1px solid var(--line);
}

.browser-model-specs > div:first-child { padding-left: 0; }
.browser-model-specs > div:last-child { border-right: 0; }
.browser-model-specs dt { color: var(--ink-muted); font-size: 9px; }
.browser-model-specs dd { margin: 4px 0 0; font-family: "DM Mono", monospace; font-size: 11px; }

.tiny-controls {
  display: grid;
  gap: 18px;
}

.tiny-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 14px;
  color: var(--ink-soft);
  font-size: 11px;
}

.tiny-controls output {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.tiny-controls input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--green);
}

.tiny-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.tiny-actions .button {
  min-height: 46px;
}

.browser-model-output {
  background: var(--dark);
  color: white;
}

.tiny-status-row,
.loss-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tiny-status-row {
  color: rgba(255, 255, 255, 0.64);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.tiny-status-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tiny-status-row span > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #808780;
}

.tiny-status-row span.is-running > i {
  background: #f2c46d;
  box-shadow: 0 0 0 5px rgba(242, 196, 109, 0.12);
}

.tiny-status-row span.is-trained > i {
  background: #75d7b5;
  box-shadow: 0 0 0 5px rgba(117, 215, 181, 0.12);
}

.tiny-progress {
  height: 3px;
  margin: 15px 0 34px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.13);
}

.tiny-progress i {
  width: 0;
  height: 100%;
  display: block;
  background: #75d7b5;
  transition: width 90ms linear;
}

.loss-heading span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
}

.loss-heading strong {
  color: #75d7b5;
  font-family: "DM Mono", monospace;
  font-size: 16px;
}

.loss-chart {
  width: 100%;
  height: auto;
  display: block;
  margin: 17px 0 25px;
  overflow: visible;
}

.loss-chart line {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
}

.loss-chart path {
  fill: none;
  stroke: #75d7b5;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.loss-chart .probability-path {
  stroke: #e6a977;
  stroke-width: 2.5;
}

.loss-chart .live-step-line {
  stroke: rgba(255, 255, 255, 0.38);
  stroke-dasharray: 3 5;
}

.loss-chart .live-step-dot {
  fill: #e6a977;
  stroke: var(--dark);
  stroke-width: 2;
}

.loss-chart text {
  fill: rgba(255, 255, 255, 0.58);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.loss-chart .loss-series-label {
  font-size: 8px;
  text-transform: uppercase;
}

.loss-chart .loss-series {
  fill: #75d7b5;
}

.loss-chart .probability-series {
  fill: #e6a977;
}

.sample-window {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 20px;
}

.sample-window > span {
  color: rgba(255, 255, 255, 0.48);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.sample-window pre {
  min-height: 105px;
  margin: 12px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  line-height: 1.62;
  white-space: pre-wrap;
}

.build-ladder {
  margin-top: 74px;
  border-top: 1px solid var(--ink);
}

.build-step {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) minmax(210px, 0.32fr);
  gap: 34px;
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}

.build-step-index {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.build-step-index span,
.build-step-index strong {
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.build-step-index span { color: var(--green); }
.build-step-index strong { color: var(--ink-muted); font-weight: 400; }

.build-step-copy h3 {
  margin: -5px 0 10px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 31px;
  font-weight: 400;
}

.build-step-copy > p {
  max-width: 680px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.code-shell {
  margin-top: 22px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--dark);
  color: white;
}

.code-shell > div {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.5);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.code-shell button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 8px;
  cursor: pointer;
}

.code-shell button svg { width: 12px; }

.code-shell pre {
  margin: 0;
  padding: 15px;
  overflow-x: auto;
  color: #d9e9e2;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  line-height: 1.65;
}

.build-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
}

.build-step-actions a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-decoration: none;
  text-transform: uppercase;
}

.build-step-actions svg { width: 13px; }

.build-step > aside {
  align-self: start;
  padding-left: 18px;
  border-left: 2px solid var(--green);
}

.build-step > aside strong {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.build-step > aside p {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.58;
}

.planning-lab-section {
  padding-top: 72px;
  border-top: 1px solid var(--ink);
}

.planning-lab-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 36px;
}

.planning-lab-heading h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 42px;
  font-weight: 400;
}

.planning-lab-heading p:not(.kicker) {
  max-width: 650px;
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.lab-selector {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
}

.lab-selector button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
}

.lab-selector button.is-active {
  background: var(--ink);
  color: white;
}

.lab-stage {
  max-width: var(--content-max);
  margin: 0 auto;
}

.lab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  border: 1px solid var(--line-strong);
  background: white;
}

.lab-inputs,
.lab-results {
  min-width: 0;
  padding: 34px;
}

.lab-inputs {
  border-right: 1px solid var(--line);
}

.lab-inputs h2 {
  margin: 0 0 30px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 40px;
  font-weight: 400;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.number-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 11px;
}

.number-input-wrap {
  height: 48px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--paper);
}

.number-input-wrap input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 11px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 13px;
  outline: 0;
}

.number-input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(23, 107, 89, 0.16);
}

.number-input-wrap em {
  padding-right: 11px;
  color: var(--ink-muted);
  font-size: 9px;
  font-style: normal;
}

.lab-caveat {
  margin: 28px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 11px;
}

.lab-results {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper-deep);
}

.result-hero {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-strong);
}

.result-hero > span {
  display: block;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.result-hero > strong {
  display: block;
  margin: 9px 0 3px;
  color: var(--green);
  font-family: "Newsreader", Georgia, serif;
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
}

.result-hero.is-negative > strong {
  color: var(--red);
}

.result-hero > small {
  color: var(--ink-muted);
  font-size: 10px;
}

.result-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
}

.result-row strong {
  color: var(--ink);
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.result-callout {
  margin-top: 24px;
  padding: 15px;
  border-left: 3px solid var(--green);
  background: white;
}

.result-callout strong {
  font-size: 11px;
}

.result-callout p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.waterfall-mini {
  display: grid;
  gap: 8px;
  margin: 24px 0 0;
}

.waterfall-mini div {
  position: relative;
  width: var(--width);
  min-width: 140px;
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 10px;
  background: var(--green-soft);
  font-size: 10px;
}

.waterfall-mini div:nth-child(2) { background: var(--blue-soft); }
.waterfall-mini div:nth-child(3) { background: var(--violet-soft); }
.waterfall-mini div:nth-child(4) { background: var(--amber-soft); }

/* Practice */

.practice-layout {
  max-width: var(--content-max);
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 0;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  background: white;
}

.question-queue {
  max-height: 720px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

.queue-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.question-queue > button {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  text-align: left;
  cursor: pointer;
}

.question-queue > button:hover,
.question-queue > button.is-active {
  background: var(--green-soft);
}

.question-queue > button > span {
  grid-row: 1 / 3;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.question-queue strong {
  font-size: 10px;
  text-transform: uppercase;
}

.question-queue p {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.practice-stage {
  min-width: 0;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  padding: 38px 42px;
}

.practice-meta {
  display: flex;
  justify-content: space-between;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.practice-stage > h2 {
  max-width: 760px;
  margin: 42px 0 34px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.13;
}

.answer-space {
  min-height: 155px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 0;
  border-top: 1px dashed var(--line-strong);
  border-bottom: 1px dashed var(--line-strong);
}

.answer-space p {
  max-width: 560px;
  margin: 0 0 18px;
  color: var(--ink-muted);
  font-size: 13px;
}

.model-answer {
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}

.model-answer > p:not(.kicker) {
  margin: 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

.answer-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.answer-signals span {
  padding: 5px 7px;
  border-radius: 3px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
}

.confidence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding-top: 28px;
  color: var(--ink-muted);
  font-size: 11px;
}

.confidence-row > div {
  display: flex;
  gap: 5px;
}

.confidence-row button {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: white;
  font-size: 10px;
  cursor: pointer;
}

.confidence-row button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

/* Sources */

.source-library {
  max-width: var(--content-max);
  margin: 0 auto 110px;
  border-top: 1px solid var(--ink);
}

.source-library a {
  min-height: 76px;
  display: grid;
  grid-template-columns: 60px 1fr 44px;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.source-library a:hover {
  background: white;
}

.source-library > a > span {
  padding-left: 13px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.source-library strong {
  font-size: 14px;
}

.source-library p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.reference-table {
  border-top: 1px solid var(--ink);
}

.reference-table > div {
  display: grid;
  grid-template-columns: 200px 360px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.reference-table strong {
  font-size: 12px;
}

.reference-table code {
  overflow-wrap: anywhere;
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.reference-table p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.glossary-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--line);
}

.glossary-list > div {
  min-height: 130px;
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.glossary-list strong {
  font-size: 12px;
}

.glossary-list p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

/* Dialogs */

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(12, 16, 14, 0.58);
  backdrop-filter: blur(3px);
}

.sheet-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--paper);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.dialog-header.compact {
  padding: 22px 28px;
}

.dialog-header h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
}

.dialog-header > div > p:not(.kicker) {
  max-width: 540px;
  margin: 10px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.mission-options {
  max-height: 54vh;
  overflow-y: auto;
}

.mission-option {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 48px 1fr 44px;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
}

.mission-option:hover,
.mission-option.is-current {
  background: var(--green-soft);
}

.mission-option-index {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

.mission-option > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mission-option strong {
  font-size: 13px;
}

.mission-option small {
  color: var(--ink-muted);
  font-size: 11px;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 20px;
  border-top: 1px solid var(--line-strong);
  background: white;
}

.dialog-footer > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dialog-footer strong {
  font-size: 11px;
}

.dialog-footer span {
  color: var(--ink-muted);
  font-size: 10px;
}

.deep-dive-dialog {
  width: min(900px, calc(100vw - 32px));
}

.deep-dive-body {
  max-height: calc(100vh - 150px);
  padding: 32px 46px 46px;
  overflow-y: auto;
}

.deep-dive-summary {
  max-width: 760px;
  margin: 0 0 28px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 25px;
  line-height: 1.4;
}

.deep-dive-mental,
.deep-dive-decision,
.deep-dive-interview {
  margin: 24px 0;
  padding: 18px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
}

.deep-dive-decision {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.deep-dive-interview {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.deep-dive-mental span,
.deep-dive-decision span,
.deep-dive-interview span {
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.deep-dive-mental p,
.deep-dive-decision p,
.deep-dive-interview p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.deep-dive-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.deep-dive-section h3,
.deep-dive-concepts h3,
.deep-dive-formulas h3 {
  margin: 0 0 12px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 28px;
  font-weight: 400;
}

.deep-dive-section p,
.deep-dive-section li {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.deep-dive-concepts,
.deep-dive-formulas {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.deep-dive-concepts > div,
.deep-dive-formulas > div {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.deep-dive-concepts strong,
.deep-dive-formulas code {
  font-size: 12px;
}

.deep-dive-concepts p,
.deep-dive-formulas p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.deep-dive-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 28px 0;
}

.deep-dive-sources a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 11px;
}

.deep-dive-sources svg {
  width: 13px;
  height: 13px;
}

.search-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  margin: 80px auto auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--paper);
}

.search-input-row {
  height: 64px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.search-input-row > svg {
  justify-self: center;
  color: var(--ink-muted);
}

.search-input-row input {
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
}

.search-results {
  max-height: 560px;
  overflow-y: auto;
}

.search-section-label {
  padding: 13px 16px 8px;
  color: var(--ink-muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.search-results button {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 48px 1fr 44px;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
  text-align: left;
  cursor: pointer;
}

.search-results button:hover {
  background: var(--green-soft);
}

.search-results button > span {
  color: var(--green);
  font-family: "DM Mono", monospace;
  font-size: 9px;
}

.search-results strong {
  font-size: 12px;
}

.search-results p {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 10px;
}

.search-empty {
  padding: 28px;
  color: var(--ink-muted);
  text-align: center;
}

/* Footer and toast */

.site-footer {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 24px 48px;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}

.site-footer > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-footer strong {
  font-size: 13px;
}

.site-footer span {
  color: var(--ink-muted);
  font-size: 11px;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.footer-actions button {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  cursor: pointer;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #30423a;
  border-radius: 4px;
  background: var(--dark);
  color: white;
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 16px;
  height: 16px;
}

/* Responsive */

@media (max-width: 1260px) {
  .header-actions {
    gap: 12px;
  }

  .journey-hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
    gap: 40px;
  }

  .hero-copy h1 {
    font-size: 68px;
  }

  .story-body {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 42px;
  }

  .chapter-header h2 {
    font-size: 52px;
  }

  .control-node {
    width: 88px;
  }
}

@media (max-width: 1050px) {
  .access-shell {
    grid-template-columns: 1fr;
  }

  .access-copy-column {
    min-height: 760px;
  }

  .access-visual-column {
    min-height: 640px;
  }

  .lens-control {
    display: none;
  }

  .journey-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 84px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-machine {
    min-height: 520px;
  }

  .hero-progress {
    position: static;
    grid-column: 1;
    margin-top: 8px;
  }

  .story-body {
    display: block;
  }

  .chapter-rail {
    display: none;
  }

  .chapter-reading,
  .chapter-reference-grid {
    margin-left: 104px;
  }

  .control-loop-map {
    flex-wrap: wrap;
    justify-content: center;
  }

  .control-loop-map::before,
  .control-pulse {
    display: none;
  }

  .lab-layout {
    grid-template-columns: 1fr;
  }

  .lab-inputs {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 820px) {
  :root {
    --header-height: 62px;
  }

  body {
    padding-bottom: 64px;
  }

  body.menu-open {
    overflow: hidden;
  }

  .site-header {
    padding: 0 12px;
  }

  .desktop-nav {
    display: none;
  }

  .header-main {
    gap: 10px;
  }

  .wordmark {
    font-size: 14px;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .mission-button {
    min-width: 154px;
  }

  .mission-button strong {
    max-width: 112px;
  }

  #search-button {
    display: none;
  }

  .mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    padding: 18px;
    background: var(--paper);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 180ms ease, transform 180ms ease;
  }

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

  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    text-transform: uppercase;
  }

  .mobile-menu nav {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .mobile-menu nav button {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    font-family: "Newsreader", Georgia, serif;
    font-size: 28px;
    text-align: left;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line-strong);
    background: rgba(247, 247, 242, 0.98);
  }

  .mobile-bottom-nav button {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--ink-muted);
    font-size: 9px;
  }

  .mobile-bottom-nav button.is-active {
    color: var(--green);
  }

  .mobile-bottom-nav svg {
    width: 18px;
    height: 18px;
  }

  .access-copy-column {
    min-height: 720px;
    padding: 24px;
  }

  .access-copy-inner h1 {
    font-size: 54px;
  }

  .access-form {
    grid-template-columns: 1fr;
  }

  .form-error,
  .access-submit {
    grid-column: 1;
  }

  .access-visual-column {
    display: none;
  }

  .journey-hero,
  .story-preamble,
  .story-body,
  .standard-page,
  .journey-close {
    padding-left: 20px;
    padding-right: 20px;
  }

  .journey-hero {
    padding-top: 42px;
    padding-bottom: 34px;
  }

  .hero-copy h1 {
    font-size: 54px;
  }

  .hero-lede {
    font-size: 17px;
  }

  .hero-metadata {
    display: none;
  }

  .hero-machine {
    min-height: 260px;
    grid-template-columns: 1fr 22px 1fr;
    grid-template-rows: 38px 1fr 22px 1fr 56px;
  }

  .hero-machine-stage {
    padding: 9px;
  }

  .hero-machine-stage small {
    margin-bottom: 7px;
    font-size: 7px;
  }

  .hero-source,
  .hero-weights,
  .hero-cluster,
  .hero-output {
    margin: 6px;
  }

  .hero-machine-readout {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .hero-machine-readout span:nth-child(n + 2) {
    display: none;
  }

  .hero-progress {
    left: 20px;
    right: 20px;
  }

  .section-heading h2,
  .journey-close h2 {
    font-size: 44px;
  }

  .lifecycle-stages {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .lifecycle-line {
    display: none;
  }

  .lifecycle-stage {
    min-height: 92px;
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-content: center;
    border-top: 1px solid var(--line-strong);
  }

  .lifecycle-index {
    grid-row: 1 / 3;
    width: 44px;
    height: 44px;
    margin: 0;
  }

  .lifecycle-detail {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chapter-section {
    padding-top: 82px;
    padding-bottom: 80px;
  }

  .chapter-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chapter-number {
    padding: 0;
  }

  .chapter-header h2 {
    font-size: 43px;
  }

  .chapter-lead {
    font-size: 17px;
  }

  .chapter-reading,
  .chapter-reference-grid {
    margin-left: 0;
  }

  .chapter-reference-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .formula-strip {
    grid-template-columns: 1fr;
  }

  .chapter-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .complete-chapter {
    align-self: flex-start;
  }

  .loop-track {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .loop-track::before {
    display: none;
  }

  .transformer-path {
    grid-template-columns: 1fr;
    padding: 16px 18px 22px;
  }

  .transformer-path > svg {
    justify-self: center;
    transform: rotate(90deg);
    animation: none;
  }

  .token-candidates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 18px 18px;
  }

  .workstream-scale {
    display: none;
  }

  .workstream-lane {
    grid-template-columns: 100px 1fr;
    padding: 10px 0;
  }

  .workstream-lane span {
    grid-column: 2;
  }

  .workstream-playhead {
    display: none;
  }

  .pretrain-control-shell {
    height: auto;
    grid-template-columns: 1fr;
  }

  .pretrain-control-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pretrain-control-tab {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    min-height: 70px;
    padding: 10px 7px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    text-align: center;
  }

  .pretrain-control-tab:last-child {
    border-right: 0;
  }

  .pretrain-control-tab.is-active {
    box-shadow: inset 0 4px 0 var(--green);
  }

  .pretrain-control-panel {
    height: auto;
    min-height: 340px;
  }

  .isoflop-explainer {
    grid-template-columns: 1fr;
  }

  .isoflop-copy {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pretrain-budget-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
  }

  .pretrain-budget-strip > b {
    display: none;
  }

  .adaptation-methods {
    grid-template-columns: 1fr;
  }

  .adaptation-method {
    min-height: 116px;
  }

  .adaptation-method > span {
    margin-bottom: 10px;
  }

  .roofline-chart {
    height: 320px;
    margin-left: 48px;
    margin-right: 22px;
  }

  .roofline-control {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .roofline-control strong {
    text-align: left;
  }

  .topology-map {
    min-height: 360px;
    padding: 18px;
  }

  .topology-node {
    font-size: 7px;
  }

  .inference-timeline {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 18px;
  }

  .prompt-tokens,
  .prefill-zone,
  .decode-zone {
    min-height: 150px;
  }

  .prefill-zone,
  .decode-zone {
    border-left: 1px solid var(--line);
    border-top: 0;
  }

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

  .control-loop-map {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .control-node {
    width: 100%;
    aspect-ratio: auto;
    min-height: 86px;
    border-radius: 4px;
  }

  .page-intro {
    margin-bottom: 60px;
  }

  .page-intro.split {
    align-items: stretch;
    flex-direction: column;
  }

  .page-intro h1 {
    font-size: 50px;
  }

  .lab-selector {
    width: 100%;
  }

  .lab-selector button {
    flex: 1;
  }

  .stack-diagram > div {
    grid-template-columns: 45px 1fr;
    gap: 10px;
  }

  .stack-diagram p {
    grid-column: 2;
  }

  .atlas-chapter-list button {
    grid-template-columns: 44px 1fr 36px;
  }

  .atlas-chapter-list p {
    grid-column: 2;
  }

  .atlas-chapter-list svg {
    grid-column: 3;
    grid-row: 1 / 3;
  }

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

  .practice-layout {
    grid-template-columns: 1fr;
  }

  .question-queue {
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .practice-stage {
    min-height: 620px;
    padding: 28px 22px;
  }

  .practice-stage > h2 {
    font-size: 34px;
  }

  .confidence-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .confidence-row > div {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .source-library a {
    grid-template-columns: 44px 1fr 36px;
  }

  .reference-table > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .glossary-list {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 28px 20px 88px;
  }

  .deep-dive-body {
    padding: 26px 20px 38px;
  }

  .deep-dive-concepts > div,
  .deep-dive-formulas > div {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

@media (max-width: 520px) {
  .mission-button {
    min-width: 128px;
    max-width: 142px;
  }

  .wordmark > span:last-child {
    display: none;
  }

  .hero-copy h1 {
    font-size: 46px;
  }

  .hero-actions,
  .journey-close-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-machine {
    min-height: 128px;
    grid-template-rows: 30px 1fr 34px;
  }

  .hero-machine-stage {
    padding: 6px;
  }

  .hero-machine-stage small {
    display: none;
  }

  .hero-weights .weight-field i:nth-child(n + 7) {
    display: none;
  }

  .weight-field {
    gap: 2px;
  }

  .hero-cluster,
  .hero-output,
  .flow-b,
  .flow-c {
    display: none;
  }

  .hero-machine-readout {
    grid-row: 3;
    margin-top: 2px;
  }

  .hero-source,
  .hero-cluster { margin-left: 8px; }
  .hero-weights,
  .hero-output { margin-right: 8px; }

  .story-preamble {
    padding-top: 76px;
    padding-bottom: 76px;
  }

  .section-heading h2,
  .journey-close h2 {
    font-size: 38px;
  }

  .lifecycle-stages {
    grid-template-columns: 1fr;
  }

  .chapter-header h2 {
    font-size: 38px;
  }

  .term-table > div:not(.subsection-title) {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .visual-control-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .transformer-stack {
    grid-template-columns: 1fr;
  }

  .token-candidates {
    grid-template-columns: 1fr;
  }

  .pretrain-control-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pretrain-control-tab {
    min-height: 62px;
    grid-template-columns: 28px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
  }

  .pretrain-control-tab:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .pretrain-control-panel {
    min-height: 510px;
    padding: 30px 22px;
  }

  .pretrain-control-panel h3 {
    font-size: 29px;
  }

  .isoflop-copy {
    padding: 30px 22px;
  }

  .isoflop-copy h3 {
    font-size: 27px;
  }

  .isoflop-chart {
    min-height: 220px;
    padding: 18px 14px 10px 8px;
  }

  .chart-label,
  .curve-label {
    font-size: 14px;
  }

  .pretrain-budget-strip {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .pretrain-budget-strip > b {
    display: block;
    padding: 6px 0;
    font-size: 14px;
  }

  .roofline-region {
    font-size: 14px;
  }

  .topology-map {
    min-height: 300px;
    padding: 10px;
    gap: 7px;
  }

  .topology-switch strong,
  .topology-fabric strong {
    font-size: 8px;
  }

  .topology-switch small,
  .topology-fabric small {
    display: none;
  }

  .page-intro h1 {
    font-size: 43px;
  }

  .lab-selector {
    flex-direction: column;
  }

  .lab-inputs,
  .lab-results {
    padding: 24px 18px;
  }

  .result-hero > strong {
    font-size: 43px;
  }

  .dialog-header {
    padding: 21px 18px;
  }

  .dialog-header h2 {
    font-size: 31px;
  }

  .dialog-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .mission-option {
    grid-template-columns: 38px 1fr 36px;
  }
}

@media (max-width: 1040px) {
  .build-stage-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .build-stage-tabs button {
    min-height: 88px;
    border-top: 1px solid var(--line);
  }

  .build-studio-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .design-workbench,
  .observe-console {
    grid-template-columns: 1fr;
  }

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

  .runtime-lab-panel {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .browser-model-lab {
    grid-template-columns: 1fr;
  }

  .browser-model-copy {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .build-step {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .build-step > aside {
    grid-column: 2;
  }

  .planning-lab-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 820px) {
  .toast-region {
    right: 12px;
    bottom: 76px;
    left: 12px;
    align-items: stretch;
  }

  .toast {
    width: 100%;
  }

  .build-studio-heading,
  .runtime-heading {
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
  }

  .build-lineage > div:first-child,
  .build-visual-instrument > header {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
  }

  .build-lineage > div:first-child {
    padding: 17px 18px;
  }

  .build-visual-instrument > header {
    padding: 18px;
  }

  .build-visual-instrument h4 {
    font-size: 27px;
  }

  .visual-controls {
    width: 100%;
    max-width: 420px;
  }

  .visual-chart-wrap {
    padding-right: 18px;
    padding-left: 18px;
  }

  .build-studio-heading h2,
  .runtime-heading h2 {
    font-size: 36px;
  }

  .build-proof-summary {
    padding: 16px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .build-studio-shell {
    grid-template-columns: 1fr;
  }

  .build-artifact-rail {
    padding: 18px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .build-artifact-rail > p {
    margin-bottom: 0;
  }

  .build-artifact-rail ol {
    display: none;
  }

  .build-stage-panel {
    min-height: 0;
    padding: 30px 20px 24px;
  }

  .build-stage-heading h3 {
    font-size: 32px;
  }

  .objective-options,
  .design-workbench,
  .serve-console,
  .observe-console {
    grid-template-columns: 1fr;
  }

  .trained-model-contract,
  .blueprint-heading {
    grid-template-columns: 1fr;
  }

  .trained-model-contract > div {
    border-right: 0;
    border-bottom: 1px solid #9fbfb4;
  }

  .blueprint-heading {
    gap: 9px;
  }

  .objective-options button {
    min-height: 104px;
  }

  .artifact-preview,
  .sentence-source,
  .build-explainer {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .token-facts {
    grid-template-columns: 1fr;
  }

  .token-facts > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .token-facts > div:last-child {
    border-bottom: 0;
  }

  .parameter-ledger > div {
    grid-template-columns: minmax(105px, 1fr) minmax(118px, 1fr) 70px;
    gap: 8px;
    padding-right: 7px;
    padding-left: 7px;
  }

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

  .demo-pair > svg {
    transform: rotate(90deg);
  }

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

  .eval-empty {
    grid-column: 2;
  }

  .serve-request {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .runtime-lab-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: 0;
    padding: 24px 20px;
  }

  .build-pipeline {
    grid-template-columns: 1fr;
  }

  .build-pipeline > div {
    min-height: 58px;
    display: grid;
    grid-template-columns: 34px 82px 1fr;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .build-pipeline > div:last-child { border-bottom: 0; }
  .build-pipeline > svg { display: none; }

  .browser-model-copy,
  .browser-model-output {
    padding: 26px 20px;
  }

  .browser-model-copy h2 {
    font-size: 38px;
  }

  .browser-model-specs {
    grid-template-columns: 1fr;
  }

  .browser-model-specs > div,
  .browser-model-specs > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .browser-model-specs > div:last-child { border-bottom: 0; }

  .build-step {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .build-step > aside {
    grid-column: 1;
  }

  .build-step-copy h3 {
    font-size: 28px;
  }

  .planning-lab-heading h2 {
    font-size: 36px;
  }

  .tiny-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tiny-actions .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .build-stage-tabs button {
    min-height: 76px;
    padding: 10px 8px;
  }

  .build-lineage {
    margin-top: 22px;
  }

  .build-lineage h3 {
    font-size: 23px;
  }

  .build-visual-instrument {
    margin-top: 24px;
  }

  .visual-chart-wrap {
    padding-right: 12px;
    padding-left: 12px;
  }

  .build-data-chart {
    min-width: 520px;
  }

  .capacity-curve {
    min-width: 420px;
  }

  .embedded-model-lab .browser-model-copy,
  .embedded-model-lab .browser-model-output {
    padding: 24px 18px;
  }

  .loss-chart text {
    font-size: 17px;
  }

  .loss-chart .loss-series-label {
    font-size: 15px;
  }

  .visual-legend,
  .visual-insight {
    padding-right: 16px;
    padding-left: 16px;
  }

  .build-stage-tabs small {
    display: none;
  }

  .build-gate {
    align-items: stretch;
    flex-direction: column;
  }

  .build-gate .button {
    width: 100%;
  }

  .parameter-ledger > div {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .parameter-ledger code {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .parameter-ledger strong {
    grid-column: 2;
    grid-row: 1;
  }

  .trained-model-contract dl {
    grid-template-columns: 1fr;
  }

  .trained-model-contract dl > div,
  .trained-model-contract dl > div:nth-child(2n),
  .trained-model-contract dl > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid #b8d0c8;
  }

  .trained-model-contract dl > div:last-child {
    border-bottom: 0;
  }

  .continuation-grid,
  .eval-board,
  .observe-results,
  .serve-response dl {
    grid-template-columns: 1fr;
  }

  .eval-empty {
    grid-column: 1;
  }

  .continuation-grid > div,
  .eval-board > div,
  .observe-results > div {
    min-height: 118px;
  }

  .serve-response dl > div,
  .serve-response dl > div:first-child {
    padding: 9px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .serve-response dl > div:last-child {
    border-bottom: 0;
  }

  .runtime-tabs button {
    min-height: 44px;
    padding: 0 5px;
    font-size: 8px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
