/* Self-hosted fonts used by the original RedRuff design. */
@font-face {
  font-family: "Manrope Variable";
  src: url("./assets/fonts/manrope-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk Variable";
  src: url("./assets/fonts/space-grotesk-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono Variable";
  src: url("./assets/fonts/jetbrains-mono-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --ink: #080707;
  --ink-soft: #100d0d;
  --panel: rgba(16, 13, 13, 0.86);
  --paper: #f4efe7;
  --paper-muted: #bfb7ae;
  --red: #e41920;
  --red-bright: #ff3a32;
  --red-deep: #8f0911;
  --line: rgba(244, 239, 231, 0.14);
  --line-strong: rgba(244, 239, 231, 0.26);
  --success: #74d9a1;
  --warning: #ffb35c;
  --display: "Space Grotesk Variable", "Arial Narrow", sans-serif;
  --body: "Manrope Variable", Arial, sans-serif;
  --mono: "JetBrains Mono Variable", monospace;
  --frame: min(1240px, calc(100vw - 72px));
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 4%, rgba(126, 11, 18, 0.17), transparent 28rem),
    var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  font-synthesis: none;
  line-height: 1.6;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--red);
  color: white;
}

button,
a,
input {
  font: inherit;
}

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

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

button {
  color: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
pre:focus-visible {
  outline: 2px solid #ff6f64;
  outline-offset: 4px;
}

main {
  min-height: 100vh;
  overflow-x: clip;
  position: relative;
}

.skip-link {
  background: var(--paper);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  left: 18px;
  padding: 10px 16px;
  position: fixed;
  top: -80px;
  transition: top 180ms ease;
  z-index: 1000;
}

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

.section-frame {
  margin-inline: auto;
  position: relative;
  width: var(--frame);
}

.scene-canvas {
  height: 100svh;
  inset: 0;
  pointer-events: none;
  position: fixed;
  width: 100%;
  z-index: 0;
}

.scene-canvas canvas {
  height: 100%;
  width: 100%;
}

.scene-canvas[data-webgl="unavailable"] {
  background: radial-gradient(circle at 68% 45%, rgba(228, 25, 32, 0.32), transparent 23rem);
}

.scene-canvas--loading {
  background: radial-gradient(circle at 72% 46%, rgba(228, 25, 32, 0.22), transparent 24rem);
}

.page-vignette {
  background:
    linear-gradient(90deg, rgba(8, 7, 7, 0.94) 0%, rgba(8, 7, 7, 0.58) 43%, rgba(8, 7, 7, 0.08) 72%),
    linear-gradient(180deg, rgba(8, 7, 7, 0.15), rgba(8, 7, 7, 0.7));
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 1;
}

.scroll-progress {
  background: rgba(255, 255, 255, 0.08);
  height: 2px;
  inset: 0 0 auto;
  position: fixed;
  z-index: 100;
}

.scroll-progress i {
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  display: block;
  height: 100%;
  transform-origin: left;
  width: 100%;
}

.site-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(8, 7, 7, 0.88), rgba(8, 7, 7, 0.22));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 74px;
  left: 0;
  padding-inline: 36px;
  position: fixed;
  right: 0;
  top: 2px;
  z-index: 50;
}

.brand-lockup {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  justify-self: start;
}

.brand-lockup__mark {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  height: 32px;
  overflow: hidden;
  width: 32px;
}

.brand-lockup__mark img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.brand-lockup__words {
  align-items: baseline;
  display: flex;
  font-family: var(--display);
  font-size: 0.95rem;
  gap: 5px;
  letter-spacing: -0.03em;
}

.brand-lockup__words strong {
  font-weight: 760;
}

.brand-lockup__words span {
  color: var(--paper-muted);
  font-weight: 500;
}

.site-header nav {
  align-items: center;
  display: flex;
  gap: 34px;
}

.site-header nav a,
.header-guide-link {
  color: #d8d0c7;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  position: relative;
  text-transform: uppercase;
}

.site-header nav a::after {
  background: var(--red-bright);
  bottom: -7px;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
  width: 100%;
}

.site-header nav a:hover::after,
.site-header nav a:focus-visible::after {
  transform: scaleX(1);
}

.header-guide-link {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  justify-self: end;
}

.header-guide-link svg {
  transition: transform 180ms ease;
}

.header-guide-link:hover svg {
  transform: translate(2px, -2px);
}

.hero {
  align-items: center;
  display: flex;
  min-height: 100svh;
  padding: 120px max(36px, calc((100vw - 1240px) / 2)) 88px;
  position: relative;
  z-index: 2;
}

.hero__content {
  max-width: 760px;
  position: relative;
  z-index: 3;
}

.hero__eyebrow {
  align-items: center;
  color: #cfc6bd;
  display: flex;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 650;
  gap: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 30px;
  text-transform: uppercase;
}

.hero__eyebrow i {
  background: var(--red-bright);
  height: 3px;
  width: 3px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(4.2rem, 8.3vw, 8.2rem);
  font-weight: 520;
  letter-spacing: -0.075em;
  line-height: 0.86;
  margin: 0;
}

.hero h1 span,
.hero h1 em {
  display: block;
}

.hero h1 em {
  color: var(--red-bright);
  font-style: normal;
  font-weight: 720;
  text-shadow: 0 0 50px rgba(228, 25, 32, 0.23);
}

.hero__lede {
  color: #d8d0c7;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.72;
  margin: 36px 0 0;
  max-width: 630px;
}

.hero__actions,
.final-cta__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 780;
  gap: 9px;
  justify-content: center;
  letter-spacing: 0.055em;
  min-height: 48px;
  padding: 0 19px;
  text-transform: uppercase;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button--primary {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 10px 35px rgba(228, 25, 32, 0.17);
  color: white;
}

.button--primary:hover {
  background: var(--red-bright);
  border-color: var(--red-bright);
  box-shadow: 0 15px 42px rgba(228, 25, 32, 0.27);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-strong);
  color: var(--paper);
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.44);
}

.button--light {
  background: var(--paper);
  color: var(--ink);
}

.button--light:hover {
  background: white;
}

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

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

.hero__promise {
  border-left: 1px solid var(--red);
  color: #918982;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  margin: 32px 0 0;
  max-width: 620px;
  padding-left: 14px;
  text-transform: uppercase;
}

.semantic-readout {
  bottom: 112px;
  display: grid;
  gap: 8px;
  position: absolute;
  right: max(36px, calc((100vw - 1240px) / 2));
  width: 230px;
}

.semantic-readout div {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  font-family: var(--mono);
  font-size: 0.58rem;
  justify-content: space-between;
  letter-spacing: 0.1em;
  padding-top: 8px;
}

.semantic-readout span {
  color: #706967;
}

.semantic-readout strong {
  color: #e8ddd5;
  font-weight: 550;
}

.semantic-readout strong::before {
  background: var(--red-bright);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--red);
  content: "";
  display: inline-block;
  height: 5px;
  margin-right: 7px;
  width: 5px;
}

.hero__scroll {
  align-items: center;
  bottom: 30px;
  display: flex;
  gap: 12px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.hero__scroll span {
  color: #67605c;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__scroll i {
  background: rgba(255, 255, 255, 0.14);
  height: 38px;
  overflow: hidden;
  position: relative;
  width: 1px;
}

.hero__scroll i::after {
  animation: scrollLine 1.8s ease-in-out infinite;
  background: var(--red-bright);
  content: "";
  height: 16px;
  left: 0;
  position: absolute;
  top: -16px;
  width: 1px;
}

@keyframes scrollLine {
  0% { transform: translateY(0); }
  70%, 100% { transform: translateY(54px); }
}

.manifesto,
.story-intro,
.story-section,
.interlude,
.production,
.final-cta,
.site-footer {
  position: relative;
  z-index: 3;
}

.manifesto {
  background: var(--paper);
  color: #171313;
  padding: 150px 0 140px;
}

.manifesto__overline,
.eyebrow,
.lab-kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.manifesto__overline {
  color: var(--red);
  margin: 0 0 34px;
}

.manifesto blockquote {
  font-family: var(--display);
  font-size: clamp(3rem, 6.3vw, 6.4rem);
  font-weight: 540;
  letter-spacing: -0.067em;
  line-height: 0.98;
  margin: 0;
  max-width: 1150px;
}

.manifesto blockquote em {
  color: var(--red);
  font-style: normal;
}

.manifesto__copy {
  color: #655d57;
  font-size: 1.05rem;
  line-height: 1.78;
  margin: 50px 0 0 auto;
  max-width: 590px;
}

.stack-map {
  align-items: stretch;
  border-bottom: 1px solid #d7cec4;
  border-top: 1px solid #d7cec4;
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 90px 0.68fr;
  margin-top: 90px;
  padding: 34px 0;
}

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

.stack-map__pieces article {
  align-items: center;
  background: #e9e2d9;
  display: flex;
  gap: 14px;
  min-height: 88px;
  padding: 17px;
  transition: background 180ms ease, transform 180ms ease;
}

.stack-map__pieces article:hover {
  background: #ded5ca;
  transform: translateX(3px);
}

.stack-map__pieces svg {
  color: var(--red);
  flex: 0 0 auto;
}

.stack-map__pieces strong,
.stack-map__pieces span {
  display: block;
}

.stack-map__pieces strong {
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: -0.02em;
}

.stack-map__pieces span {
  color: #81786f;
  font-size: 0.68rem;
  margin-top: 2px;
}

.stack-map__bridge {
  align-items: center;
  color: var(--red);
  display: flex;
  gap: 7px;
  justify-content: center;
}

.stack-map__bridge i {
  background: #d7cec4;
  height: 1px;
  width: 20px;
}

.stack-map__solve {
  align-items: flex-start;
  background: var(--red);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 30px 34px;
  position: relative;
  transition: background 200ms ease;
}

.stack-map__solve:hover {
  background: #f02228;
}

.stack-map__mark {
  background: white;
  border-radius: 50%;
  height: 40px;
  margin-bottom: 26px;
  overflow: hidden;
  width: 40px;
}

.stack-map__solve p {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
  margin: 0;
}

.stack-map__solve h3 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 8px 0 12px;
}

.stack-map__solve > span:last-child {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.74rem;
  max-width: 280px;
}

.story-intro {
  background: #0b0909;
  border-bottom: 1px solid var(--line);
  padding: 125px 0 80px;
}

.story-intro__copy {
  display: grid;
  gap: 40px;
  grid-template-columns: 0.45fr 1fr;
}

.eyebrow {
  color: var(--red-bright);
  margin: 5px 0 0;
}

.story-intro h2,
.production h2,
.final-cta h2 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 5.2vw, 5.4rem);
  font-weight: 520;
  letter-spacing: -0.064em;
  line-height: 1;
  margin: 0;
}

.chapter-nav {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 78px;
}

.chapter-nav a {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 128px;
  padding: 18px;
  position: relative;
  transition: background 180ms ease, color 180ms ease;
}

.chapter-nav a:first-child {
  border-left: 1px solid var(--line);
}

.chapter-nav a:hover {
  background: rgba(228, 25, 32, 0.1);
}

.chapter-nav a span {
  color: #6f6863;
  font-family: var(--mono);
  font-size: 0.6rem;
}

.chapter-nav a strong {
  font-family: var(--display);
  font-size: 0.94rem;
  margin-top: auto;
}

.chapter-nav a svg {
  bottom: 17px;
  color: var(--red-bright);
  position: absolute;
  right: 16px;
  transition: transform 180ms ease;
}

.chapter-nav a:hover svg {
  transform: translateY(4px);
}

.story-section {
  background:
    linear-gradient(90deg, rgba(8, 7, 7, 0.98), rgba(8, 7, 7, 0.86) 62%, rgba(8, 7, 7, 0.42)),
    var(--ink);
  border-bottom: 1px solid var(--line);
  min-height: 100vh;
  padding: 150px 0 145px;
}

.story-section--protect {
  background: linear-gradient(115deg, #0c0808 0%, #160809 58%, #080707 100%);
}

.story-section--decide {
  background: linear-gradient(120deg, #080707 0%, #100909 58%, #080707 100%);
}

.story-section--coordinate {
  background: linear-gradient(120deg, #0a0808 0%, #120b0b 55%, #080707 100%);
}

.chapter-heading {
  align-items: start;
  display: grid;
  gap: 38px;
  grid-template-columns: 120px minmax(0, 820px);
  margin-bottom: 76px;
}

.chapter-heading__index {
  color: var(--red-bright);
  font-family: var(--display);
  font-size: 4.4rem;
  font-weight: 300;
  letter-spacing: -0.08em;
  line-height: 0.82;
  margin: 0;
}

.chapter-heading h2 {
  font-family: var(--display);
  font-size: clamp(2.7rem, 5vw, 5.2rem);
  font-weight: 510;
  letter-spacing: -0.065em;
  line-height: 0.98;
  margin: 15px 0 0;
}

.chapter-heading__body {
  color: #aaa19a;
  font-size: 1rem;
  line-height: 1.78;
  margin: 27px 0 0;
  max-width: 680px;
}

.lab-shell {
  backdrop-filter: blur(22px);
  background: linear-gradient(135deg, rgba(18, 14, 14, 0.94), rgba(11, 9, 9, 0.86));
  border: 1px solid var(--line-strong);
  box-shadow: 0 45px 100px rgba(0, 0, 0, 0.34);
  overflow: hidden;
  position: relative;
}

.lab-shell::before {
  background: linear-gradient(90deg, transparent, rgba(255, 58, 50, 0.48), transparent);
  content: "";
  height: 1px;
  left: 10%;
  position: absolute;
  right: 10%;
  top: 0;
}

.lab-shell__header {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.lab-shell__header h3 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  font-weight: 540;
  letter-spacing: -0.045em;
  line-height: 1.15;
  margin: 6px 0 0;
}

.lab-kicker {
  color: #877f79;
  margin: 0;
}

.runtime-status {
  align-items: center;
  color: #a79f98;
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.58rem;
  gap: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.runtime-status i {
  animation: statusPulse 1.8s ease-in-out infinite;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(116, 217, 161, 0.72);
  height: 5px;
  width: 5px;
}

@keyframes statusPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.model-lab {
  margin-left: 9.5%;
  max-width: 1050px;
  padding: 34px;
}

.tab-list {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0;
  margin-top: 34px;
}

.tab-list button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #6f6864;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  margin-bottom: -1px;
  padding: 12px 19px;
  text-transform: uppercase;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.tab-list button:hover {
  color: var(--paper);
}

.tab-list button.is-active {
  background: rgba(228, 25, 32, 0.07);
  border-bottom-color: var(--red-bright);
  color: var(--paper);
}

.code-window {
  background: #090808;
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-top: 18px;
  min-width: 0;
  overflow: hidden;
}

.code-window__bar {
  align-items: center;
  background: #111010;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #77706b;
  display: grid;
  font-family: var(--mono);
  font-size: 0.6rem;
  grid-template-columns: 1fr auto 1fr;
  min-height: 42px;
  padding: 0 13px;
}

.window-dots {
  display: flex;
  gap: 5px;
}

.window-dots i {
  background: #3e3735;
  border-radius: 50%;
  height: 6px;
  width: 6px;
}

.window-dots i:first-child {
  background: #6d1a1e;
}

.copy-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #76706b;
  cursor: pointer;
  display: flex;
  font-family: var(--mono);
  font-size: 0.58rem;
  gap: 6px;
  justify-self: end;
  padding: 7px;
  transition: color 180ms ease;
}

.copy-button:hover {
  color: var(--paper);
}

.code-window__body {
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1vw, 0.84rem);
  line-height: 1.72;
  margin: 0;
  max-height: 540px;
  overflow: auto;
  padding: 24px 0;
  tab-size: 4;
}

.code-line {
  display: grid;
  grid-template-columns: 54px minmax(max-content, 1fr);
  min-height: 1.72em;
  padding-right: 24px;
}

.code-line:hover {
  background: rgba(255, 255, 255, 0.025);
}

.line-number {
  color: #3f3a38;
  padding-right: 17px;
  text-align: right;
  user-select: none;
}

.line-source {
  color: #cfc8c2;
  white-space: pre;
}

.tok-keyword { color: #ff6256; }
.tok-string { color: #d6c987; }
.tok-number { color: #9bd6bd; }
.tok-type { color: #d9a6f0; }
.tok-value { color: #84bfff; }

.lab-insight,
.explanation-strip,
.runtime-note {
  align-items: center;
  background: rgba(228, 25, 32, 0.055);
  border-left: 1px solid var(--red);
  color: #a9a09a;
  display: flex;
  gap: 12px;
  margin-top: 18px;
  min-height: 48px;
  padding: 11px 14px;
}

.lab-insight svg,
.explanation-strip svg,
.runtime-note svg {
  color: var(--red-bright);
  flex: 0 0 auto;
}

.lab-insight p,
.explanation-strip p,
.runtime-note p {
  font-size: 0.72rem;
  line-height: 1.55;
  margin: 0;
}

.transaction-lab {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  margin-left: auto;
  max-width: 1130px;
}

.transaction-lab__controls,
.transaction-lab__code {
  padding: 36px;
}

.transaction-lab__controls {
  border-right: 1px solid var(--line);
}

.transaction-lab__code {
  background: rgba(0, 0, 0, 0.13);
}

.quantity-control {
  margin-top: 44px;
}

.quantity-control__label,
.inventory-meter__top,
.weight-control__legend {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

.quantity-control label,
.inventory-meter__top span,
.weight-control__legend span {
  color: #8e8680;
  font-size: 0.72rem;
}

.quantity-control output {
  color: var(--paper);
  font-family: var(--display);
  font-size: 2.8rem;
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 1;
}

input[type="range"] {
  accent-color: var(--red-bright);
  cursor: pointer;
  margin: 22px 0 5px;
  width: 100%;
}

.range-ends {
  color: #4e4946;
  display: flex;
  font-family: var(--mono);
  font-size: 0.56rem;
  justify-content: space-between;
}

.inventory-meter {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin: 34px 0 25px;
  padding: 20px 0;
}

.inventory-meter__top strong {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
}

.inventory-meter__track,
.score-track {
  background: #292323;
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  width: 100%;
}

.inventory-meter__track i,
.score-track i {
  background: linear-gradient(90deg, var(--red-deep), var(--red-bright));
  display: block;
  height: 100%;
  transition: width 600ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease;
}

.inventory-meter--committed .inventory-meter__track i {
  background: var(--success);
}

.inventory-meter--blocked .inventory-meter__track i {
  animation: ruleShake 300ms ease;
  background: var(--warning);
}

@keyframes ruleShake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.transaction-result {
  align-items: center;
  color: #77706b;
  display: flex;
  font-family: var(--mono);
  font-size: 0.61rem;
  gap: 9px;
  margin-top: 17px;
  min-height: 24px;
}

.transaction-result--committed { color: var(--success); }
.transaction-result--blocked { color: var(--warning); }
.transaction-result--checking { color: #d8c4bf; }

.spin {
  animation: spin 850ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.rule-seal {
  align-items: center;
  border: 1px solid rgba(255, 58, 50, 0.28);
  display: grid;
  grid-template-columns: auto 1fr auto;
  margin-top: 18px;
  min-height: 68px;
  padding: 14px 16px;
}

.rule-seal span,
.rule-seal small {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rule-seal span { color: var(--red-bright); }
.rule-seal strong { font-family: var(--display); font-size: 0.86rem; margin-left: 24px; }
.rule-seal small { color: #68615d; text-align: right; }

.event-lab {
  margin-left: 6%;
  max-width: 1130px;
  padding: 38px;
}

.event-payload {
  align-items: center;
  background: #090808;
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  gap: 18px;
  margin-top: 34px;
  min-height: 62px;
  overflow: hidden;
  padding: 0 18px;
}

.event-payload__tag {
  border-right: 1px solid var(--line);
  color: var(--red-bright);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  padding-right: 18px;
}

.event-payload code {
  color: #aaa29c;
  font-family: var(--mono);
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-track {
  counter-reset: stages;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  margin: 38px 0 0;
  padding: 0;
  position: relative;
}

.event-track::before {
  background: #322b2a;
  content: "";
  height: 1px;
  left: 12.5%;
  position: absolute;
  right: 12.5%;
  top: 19px;
}

.event-stage {
  min-width: 0;
  padding: 0 14px;
  position: relative;
  text-align: center;
}

.event-stage__icon {
  align-items: center;
  background: #131010;
  border: 1px solid #4c4140;
  border-radius: 50%;
  color: #5d5551;
  display: flex;
  height: 39px;
  justify-content: center;
  margin: 0 auto 16px;
  position: relative;
  transition: background 260ms ease, border-color 260ms ease, color 260ms ease, box-shadow 260ms ease, transform 260ms ease;
  width: 39px;
  z-index: 2;
}

.event-stage--active .event-stage__icon {
  background: var(--red);
  border-color: var(--red-bright);
  box-shadow: 0 0 25px rgba(228, 25, 32, 0.52);
  color: white;
  transform: scale(1.12);
}

.event-stage--complete .event-stage__icon {
  background: #123323;
  border-color: #276d4a;
  color: var(--success);
}

.event-stage span,
.event-stage strong,
.event-stage p {
  display: block;
}

.event-stage span {
  color: #504a46;
  font-family: var(--mono);
  font-size: 0.55rem;
}

.event-stage strong {
  font-family: var(--display);
  font-size: 0.9rem;
  margin-top: 5px;
}

.event-stage p {
  color: #716a65;
  font-size: 0.66rem;
  line-height: 1.45;
  margin: 4px 0 0;
}

.runtime-note {
  border-left-color: #444;
  margin-top: 34px;
}

.runtime-note svg {
  color: var(--success);
}

.feature-triptych {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 84px;
}

.feature-triptych article {
  border-right: 1px solid var(--line);
  min-height: 210px;
  padding: 30px;
}

.feature-triptych article:first-child {
  border-left: 1px solid var(--line);
}

.feature-triptych svg {
  color: var(--red-bright);
}

.feature-triptych span {
  color: #5d5652;
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  margin-top: 42px;
}

.feature-triptych h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.3;
  margin: 8px 0 0;
  max-width: 260px;
}

.solver-lab {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(380px, 0.85fr);
  max-width: 1200px;
}

.solver-lab__stage {
  border-right: 1px solid var(--line);
  padding: 38px;
}

.solver-lab > .code-window {
  align-self: center;
  margin: 30px;
}

.winner-readout {
  border-left: 1px solid var(--red);
  min-width: 110px;
  padding-left: 16px;
}

.winner-readout span,
.winner-readout strong {
  display: block;
}

.winner-readout span {
  color: #66605c;
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.winner-readout strong {
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.04em;
  margin-top: 2px;
}

.weight-control {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding: 19px 0 13px;
}

.weight-control__legend strong {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.66rem;
  margin-left: 5px;
}

.candidate-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 28px;
}

.candidate-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
  padding: 16px;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.candidate-card.is-winner {
  background: rgba(228, 25, 32, 0.12);
  border-color: rgba(255, 58, 50, 0.45);
  transform: translateY(-5px);
}

.candidate-card.is-invalid {
  filter: grayscale(0.8);
  opacity: 0.38;
}

.candidate-card__top {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.candidate-card__top strong {
  font-family: var(--display);
  font-size: 0.9rem;
}

.candidate-card__top span {
  color: var(--red-bright);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.candidate-card dl {
  margin: 16px 0 0;
}

.candidate-card dl div {
  display: flex;
  font-size: 0.59rem;
  justify-content: space-between;
  line-height: 1.8;
}

.candidate-card dt { color: #68615d; }
.candidate-card dd { color: #bcb4ad; margin: 0; }

.candidate-card p {
  color: #726a66;
  font-size: 0.57rem;
  margin: 11px 0 0;
}

.candidate-card.is-winner p {
  color: #e3b5b1;
}

.explanation-strip {
  margin-top: 26px;
}

.interlude {
  background: var(--red);
  color: white;
  padding: 120px 0;
}

.interlude .section-frame {
  display: grid;
  gap: 0;
}

.interlude p {
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  font-family: var(--display);
  font-size: clamp(3.4rem, 8vw, 8.5rem);
  font-weight: 540;
  letter-spacing: -0.075em;
  line-height: 1;
  margin: 0;
  padding: 16px 0;
}

.interlude p:nth-child(2) { padding-left: 11%; }
.interlude p:nth-child(3) { padding-left: 22%; }

.plan-lab {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  margin-left: 5%;
  max-width: 1140px;
}

.plan-lab__controls {
  border-right: 1px solid var(--line);
  padding: 38px;
}

.failure-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: #8a827c;
  cursor: pointer;
  display: flex;
  font-size: 0.7rem;
  gap: 11px;
  margin: 36px 0 18px;
  padding: 0;
  text-align: left;
}

.failure-toggle > span {
  background: #312b29;
  border: 1px solid #49413e;
  border-radius: 30px;
  display: block;
  height: 22px;
  padding: 3px;
  transition: background 180ms ease, border-color 180ms ease;
  width: 40px;
}

.failure-toggle i {
  background: #a29a94;
  border-radius: 50%;
  display: block;
  height: 14px;
  transition: background 180ms ease, transform 180ms ease;
  width: 14px;
}

.failure-toggle.is-active > span {
  background: rgba(228, 25, 32, 0.26);
  border-color: var(--red);
}

.failure-toggle.is-active i {
  background: var(--red-bright);
  transform: translateX(17px);
}

.plan-result {
  border-top: 1px solid var(--line);
  color: #756e69;
  font-family: var(--mono);
  font-size: 0.6rem;
  line-height: 1.5;
  margin-top: 28px;
  padding-top: 15px;
}

.plan-result--complete { color: var(--success); }
.plan-result--compensated { color: var(--warning); }

.plan-track {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 32px 38px;
}

.plan-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  min-height: 105px;
}

.plan-step__rail {
  align-items: center;
  display: flex;
  flex-direction: column;
}

.plan-step__rail > span {
  align-items: center;
  background: #151212;
  border: 1px solid #49403e;
  border-radius: 50%;
  color: #706863;
  display: flex;
  font-family: var(--mono);
  font-size: 0.62rem;
  height: 34px;
  justify-content: center;
  transition: all 230ms ease;
  width: 34px;
}

.plan-step__rail > i {
  background: #322c2a;
  flex: 1;
  width: 1px;
}

.plan-step--running .plan-step__rail > span {
  background: var(--red);
  border-color: var(--red-bright);
  box-shadow: 0 0 24px rgba(228, 25, 32, 0.5);
  color: white;
}

.plan-step--complete .plan-step__rail > span {
  background: #133524;
  border-color: #286d4b;
  color: var(--success);
}

.plan-step--failed .plan-step__rail > span {
  background: #401619;
  border-color: #a92e34;
  color: #ff847b;
}

.plan-step__content {
  border-bottom: 1px solid var(--line);
  margin-left: 19px;
  padding: 1px 0 25px;
}

.plan-step__content p {
  color: #5f5854;
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.09em;
  margin: 0;
  text-transform: uppercase;
}

.plan-step__content strong,
.plan-step__content span {
  display: block;
}

.plan-step__content strong {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 540;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.plan-step__content span {
  color: #6f6763;
  font-size: 0.62rem;
  margin-top: 4px;
}

.plan-step--running .plan-step__content span { color: #dfb7b2; }
.plan-step--complete .plan-step__content span { color: var(--success); }
.plan-step--failed .plan-step__content span { color: #ff847b; }

.trace-lab {
  margin-left: auto;
  max-width: 1100px;
  padding: 38px;
}

.trace-toggle {
  border: 1px solid var(--line);
  display: flex;
}

.trace-toggle button {
  background: transparent;
  border: 0;
  color: #716964;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  padding: 9px 12px;
  text-transform: uppercase;
}

.trace-toggle button + button {
  border-left: 1px solid var(--line);
}

.trace-toggle button.is-active {
  background: var(--paper);
  color: var(--ink);
}

.trace-console {
  background: #060606;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 32px;
}

.trace-console__bar {
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #77706b;
  display: flex;
  font-family: var(--mono);
  font-size: 0.59rem;
  justify-content: space-between;
  min-height: 45px;
  padding: 0 16px;
}

.trace-console ol {
  list-style: none;
  margin: 0;
  padding: 13px 0;
}

.trace-console li {
  animation: traceIn 320ms both;
  animation-delay: var(--trace-delay);
  display: grid;
  font-family: var(--mono);
  font-size: 0.65rem;
  gap: 18px;
  grid-template-columns: 88px 80px 1fr;
  min-height: 39px;
  padding: 10px 18px;
}

@keyframes traceIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.trace-console li:hover {
  background: rgba(255, 255, 255, 0.025);
}

.trace-console time { color: #4d4845; }
.trace-console li strong { color: var(--red-bright); font-weight: 550; }
.trace-console li span { color: #a69e98; }

.production {
  background: var(--paper);
  color: #171313;
  padding: 145px 0;
}

.production__heading {
  align-items: end;
  display: grid;
  gap: 70px;
  grid-template-columns: 1fr 0.42fr;
}

.production__heading > p {
  color: #7f756e;
  font-size: 0.76rem;
  line-height: 1.65;
  margin: 0 0 8px;
}

.metric-grid {
  border-bottom: 1px solid #d7cec4;
  border-top: 1px solid #d7cec4;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 75px;
}

.metric-grid article {
  border-right: 1px solid #d7cec4;
  min-height: 210px;
  padding: 24px;
  transition: background 180ms ease, color 180ms ease;
}

.metric-grid article:first-child {
  border-left: 1px solid #d7cec4;
}

.metric-grid article:hover {
  background: var(--red);
  color: white;
}

.metric-grid span,
.metric-grid strong,
.metric-grid p {
  display: block;
}

.metric-grid span {
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.metric-grid article:hover span { color: white; }

.metric-grid strong {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.2vw, 4.5rem);
  font-weight: 540;
  letter-spacing: -0.075em;
  line-height: 1;
  margin-top: 50px;
}

.metric-grid p {
  color: #7a716a;
  font-size: 0.7rem;
  margin: 12px 0 0;
}

.metric-grid article:hover p { color: rgba(255, 255, 255, 0.72); }

.production-grid {
  align-items: center;
  display: grid;
  gap: 85px;
  grid-template-columns: 0.8fr 1.2fr;
  margin-top: 110px;
}

.production-copy h3 {
  font-family: var(--display);
  font-size: clamp(2rem, 3.8vw, 4rem);
  font-weight: 520;
  letter-spacing: -0.06em;
  line-height: 1;
  margin: 12px 0 0;
}

.production-copy ul {
  display: grid;
  gap: 13px;
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
}

.production-copy li {
  align-items: center;
  border-bottom: 1px solid #dfd7ce;
  color: #5f5751;
  display: flex;
  font-size: 0.78rem;
  gap: 11px;
  padding-bottom: 12px;
}

.production-copy li svg {
  color: var(--red);
  flex: 0 0 auto;
}

.production .code-window {
  box-shadow: 0 30px 65px rgba(55, 30, 25, 0.17);
  margin-top: 0;
}

.final-cta {
  background: var(--red);
  color: white;
  padding: 135px 0 145px;
  text-align: center;
}

.final-cta__mark {
  background: white;
  border: 5px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  height: 78px;
  margin: 0 auto 38px;
  overflow: hidden;
  width: 78px;
}

.final-cta .eyebrow {
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.final-cta h2 {
  margin-top: 25px;
}

.final-cta h2 em {
  color: #501013;
  font-style: normal;
}

.final-cta__actions {
  justify-content: center;
}

.site-footer {
  background: #070606;
  color: var(--paper);
  padding: 50px 0 24px;
}

.site-footer__top,
.site-footer__bottom {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.site-footer__top {
  border-bottom: 1px solid var(--line);
  padding-bottom: 38px;
}

.site-footer nav {
  display: flex;
  gap: 26px;
}

.site-footer nav a {
  align-items: center;
  color: #8d8580;
  display: flex;
  font-size: 0.68rem;
  gap: 4px;
  transition: color 180ms ease;
}

.site-footer nav a:hover { color: white; }

.site-footer__bottom {
  color: #57514d;
  font-family: var(--mono);
  font-size: 0.56rem;
  padding-top: 22px;
}

.site-footer__bottom p { margin: 0; }

.site-footer__bottom a {
  align-items: center;
  display: flex;
  gap: 5px;
  text-transform: uppercase;
}

.site-footer__bottom a svg { transform: rotate(180deg); }

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 760ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 760ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  :root { --frame: min(100% - 48px, 1060px); }

  .site-header { padding-inline: 24px; }
  .site-header nav { gap: 22px; }
  .hero { padding-inline: 24px; }
  .semantic-readout { right: 24px; width: 190px; }
  .stack-map { grid-template-columns: 1.2fr 58px 0.8fr; }
  .candidate-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .candidate-card.is-winner { transform: translateY(-3px); }
  .solver-lab { grid-template-columns: 1fr; }
  .solver-lab__stage { border-bottom: 1px solid var(--line); border-right: 0; }
  .solver-lab > .code-window { margin: 30px 38px 38px; }
}

@media (max-width: 860px) {
  :root { --frame: calc(100% - 36px); }

  .site-header {
    grid-template-columns: 1fr auto;
    padding-inline: 18px;
  }

  .site-header nav { display: none; }
  .header-guide-link { grid-column: 2; }
  .hero { padding-inline: 18px; }
  .hero__content { max-width: 680px; }
  .hero h1 { font-size: clamp(4rem, 14vw, 7.2rem); }
  .semantic-readout { display: none; }
  .page-vignette { background: linear-gradient(180deg, rgba(8, 7, 7, 0.2), rgba(8, 7, 7, 0.79)); }
  .scene-canvas { opacity: 0.68; }

  .stack-map { grid-template-columns: 1fr; }
  .stack-map__bridge { min-height: 50px; transform: rotate(90deg); }
  .stack-map__solve { min-height: 270px; }
  .story-intro__copy { grid-template-columns: 1fr; gap: 18px; }
  .chapter-nav { grid-template-columns: repeat(3, 1fr); }
  .chapter-nav a:nth-child(3) { border-right: 1px solid var(--line); }
  .chapter-heading { grid-template-columns: 84px 1fr; }
  .chapter-heading__index { font-size: 3.4rem; }
  .model-lab,
  .event-lab,
  .plan-lab { margin-left: 0; }
  .transaction-lab,
  .plan-lab { grid-template-columns: 1fr; }
  .transaction-lab__controls,
  .plan-lab__controls { border-bottom: 1px solid var(--line); border-right: 0; }
  .event-track { grid-template-columns: repeat(2, 1fr); gap: 25px 0; }
  .event-track::before { display: none; }
  .feature-triptych { grid-template-columns: 1fr; }
  .feature-triptych article { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); min-height: 170px; }
  .interlude p:nth-child(2),
  .interlude p:nth-child(3) { padding-left: 0; }
  .production__heading,
  .production-grid { grid-template-columns: 1fr; gap: 36px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid article:nth-child(3) { border-left: 1px solid #d7cec4; }
}

@media (max-width: 600px) {
  :root { --frame: calc(100% - 28px); }

  body { font-size: 15px; }
  .site-header { height: 66px; }
  .brand-lockup__words { font-size: 0.86rem; }
  .brand-lockup__mark { height: 29px; width: 29px; }
  .header-guide-link { font-size: 0.64rem; }
  .hero { align-items: flex-end; min-height: 100svh; padding: 110px 14px 90px; }
  .hero h1 { font-size: clamp(3.55rem, 17vw, 5.2rem); line-height: 0.89; }
  .hero__eyebrow { margin-bottom: 23px; }
  .hero__lede { font-size: 0.93rem; line-height: 1.65; margin-top: 28px; }
  .hero__actions { align-items: stretch; flex-direction: column; }
  .hero__actions .button { width: 100%; }
  .hero__promise { font-size: 0.55rem; line-height: 1.6; margin-top: 25px; }
  .hero__scroll { display: none; }

  .manifesto { padding: 100px 0; }
  .manifesto blockquote { font-size: clamp(2.8rem, 14vw, 4.4rem); }
  .manifesto__copy { font-size: 0.9rem; margin-top: 35px; }
  .stack-map { margin-top: 58px; }
  .stack-map__pieces { grid-template-columns: 1fr; }
  .stack-map__pieces article { min-height: 76px; }
  .stack-map__solve { min-height: 240px; padding: 25px; }

  .story-intro { padding: 95px 0 56px; }
  .story-intro h2,
  .production h2,
  .final-cta h2 { font-size: 2.65rem; }
  .chapter-nav { grid-template-columns: repeat(2, 1fr); margin-top: 50px; }
  .chapter-nav a { min-height: 105px; }

  .story-section { min-height: auto; padding: 105px 0 95px; }
  .chapter-heading { gap: 12px; grid-template-columns: 1fr; margin-bottom: 48px; }
  .chapter-heading__index { border-bottom: 1px solid var(--line); font-size: 2.4rem; padding-bottom: 18px; }
  .chapter-heading h2 { font-size: 2.8rem; }
  .chapter-heading__body { font-size: 0.9rem; margin-top: 20px; }

  .lab-shell__header { align-items: flex-start; flex-direction: column; }
  .model-lab,
  .event-lab,
  .trace-lab { padding: 22px; }
  .runtime-status { align-self: flex-start; }
  .tab-list { overflow-x: auto; }
  .tab-list button { flex: 1; min-width: 90px; padding-inline: 12px; }
  .code-window__bar { grid-template-columns: auto 1fr auto; }
  .code-window__bar > span { overflow: hidden; padding-inline: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .copy-button span { display: none; }
  .code-window__body { font-size: 0.68rem; padding-block: 18px; }
  .code-line { grid-template-columns: 38px minmax(max-content, 1fr); padding-right: 16px; }
  .line-number { padding-right: 10px; }

  .transaction-lab__controls,
  .transaction-lab__code,
  .plan-lab__controls,
  .plan-track,
  .solver-lab__stage { padding: 24px; }
  .rule-seal { align-items: start; gap: 7px; grid-template-columns: 1fr; }
  .rule-seal strong { margin-left: 0; }
  .rule-seal small { text-align: left; }
  .event-payload { align-items: flex-start; flex-direction: column; gap: 7px; padding-block: 14px; }
  .event-payload__tag { border-bottom: 1px solid var(--line); border-right: 0; padding: 0 0 7px; width: 100%; }
  .event-payload code { font-size: 0.58rem; width: 100%; }
  .event-track { grid-template-columns: 1fr; gap: 0; }
  .event-stage { align-items: center; display: grid; grid-template-columns: 48px 1fr; min-height: 82px; text-align: left; }
  .event-stage__icon { margin: 0; }
  .event-stage span { display: none; }
  .event-stage p { max-width: none; }
  .runtime-note { align-items: flex-start; }

  .candidate-grid { grid-template-columns: 1fr 1fr; }
  .candidate-card { padding: 13px; }
  .candidate-card dl div { font-size: 0.55rem; }
  .solver-lab > .code-window { margin: 0 24px 24px; }
  .winner-readout { align-self: stretch; }
  .weight-control__legend { align-items: flex-start; flex-direction: column; gap: 5px; }

  .interlude { padding: 80px 0; }
  .interlude p { font-size: 3.4rem; }
  .trace-toggle { align-self: stretch; }
  .trace-toggle button { flex: 1; }
  .trace-console__bar { align-items: flex-start; flex-direction: column; gap: 6px; padding-block: 12px; }
  .trace-console li { gap: 7px; grid-template-columns: 1fr; padding: 11px 14px; }
  .trace-console time { display: none; }

  .production { padding: 100px 0; }
  .production__heading > p { font-size: 0.69rem; }
  .metric-grid { grid-template-columns: 1fr 1fr; margin-top: 52px; }
  .metric-grid article { min-height: 160px; padding: 17px; }
  .metric-grid strong { font-size: 2.3rem; margin-top: 35px; }
  .production-grid { margin-top: 70px; }

  .final-cta { padding: 100px 0; }
  .final-cta h2 br { display: none; }
  .final-cta__actions { align-items: stretch; flex-direction: column; }
  .site-footer__top,
  .site-footer__bottom { align-items: flex-start; flex-direction: column; gap: 25px; }
  .site-footer nav { flex-wrap: wrap; gap: 15px 22px; }
  .site-footer__bottom { line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
