@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("fonts/martian-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* Tokens. --accent is always the lime fill; --accent-text is the accent that has to be readable as text. */
:root {
  --bg: #0c0f0d;
  --panel: #111612;
  --panel-raised: #171d18;
  --ink: #eeefe9;
  --ink-soft: #cfd4cb;
  --muted: #9aab9f;
  --accent: #b9f582;
  --accent-text: #b9f582;
  --accent-ink: #111a0c;
  --accent-edge: transparent;
  --button-edge: #b9f582;
  --border: #2a342d;
  --line: #5d6b61;
  --danger: #ff9478;
  --mono: "Martian Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Type scale: nothing on the page is set below 11px. */
  --fs-label: 11px;
  --fs-ui: 12px;
  --fs-small: 14px;
  --fs-body: 16px;
  --fs-lead: clamp(18px, 1.5vw, 21px);
  --fs-h3: 22px;
  --fs-h2: clamp(27px, 2.7vw, 40px);
  --fs-h1: clamp(34px, 4.5vw, 64px);

  /* 4pt spacing scale. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --gutter: clamp(20px, 4.2vw, 72px);
  --section: clamp(72px, 8.5vw, 120px);
  --header-height: 72px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-press: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
/* Light theme is its own design: paper and ink, with lime kept as a fill rather than a text colour. */
:root[data-theme="light"] {
  --bg: #f5f5ef;
  --panel: #ecece3;
  --panel-raised: #e2e2d8;
  --ink: #12160f;
  --ink-soft: #2c3328;
  --muted: #4d554a;
  --accent-text: #2d5a12;
  --accent-edge: #2d5a12;
  --button-edge: #12160f;
  --border: #cfd0c4;
  --line: #7c8377;
  --danger: #a3301a;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs-body)/1.6 var(--sans); }
::selection { color: var(--accent-ink); background: var(--accent); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; border: 0; background: none; }
button, a, summary, input { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 4px;
}
h1, h2, h3, p, pre { margin: 0; }
h1, h2, h3 { font-family: var(--mono); font-weight: 500; letter-spacing: -.04em; text-wrap: balance; }
p { text-wrap: pretty; }
.container { width: min(100% - var(--gutter) * 2, 1320px); margin-inline: auto; }
.mono { font-family: var(--mono); font-weight: 300; font-size: var(--fs-label); }
.accent { color: var(--accent-text); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: var(--gutter); padding: 10px 16px; background: var(--accent); color: var(--accent-ink); z-index: 20; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.js-control { display: none; }
.js .js-control { display: flex; }
.status-dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-edge); }

/* Header: opaque, one edge shared with the page. */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { min-height: var(--header-height); display: flex; align-items: center; gap: var(--s6); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); min-height: 44px; font: 500 20px/1 var(--mono); letter-spacing: -.05em; white-space: nowrap; }
.brand-mark { display: block; width: 36px; height: 30px; background: linear-gradient(90deg, var(--accent-text) 15%, var(--ink) 15%); mask: url("brand-mark.svg") center / contain no-repeat; }
nav { margin-left: auto; display: flex; align-items: center; gap: clamp(20px, 3vw, 44px); font: 300 var(--fs-ui) var(--mono); }
nav a { display: inline-flex; gap: var(--s2); align-items: center; min-height: 44px; color: var(--muted); transition: color .2s; }
nav a span { color: var(--accent-text); font-size: var(--fs-label); }
nav a:hover, .button-text:hover, .back-to-top:hover, .footer-link:hover { color: var(--accent-text); }
.theme-button { justify-content: center; align-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-left: 1px solid var(--border); padding-left: var(--s3); }
.theme-glyph { display: block; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

/* Hero: copy on the left, a small working demonstration on the right. Both are top-aligned so
   nothing in the demo can move the headline. */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: clamp(36px, 4.5vw, 76px); padding-block: clamp(56px, 6.5vw, 104px) clamp(56px, 6vw, 88px); }
.hero-copy { padding-top: clamp(8px, 2.4vw, 40px); }
.hero h1 { font-size: var(--fs-h1); line-height: 1.08; }
.hero-lead { margin-top: var(--s6); font-size: var(--fs-lead); font-weight: 500; letter-spacing: -.015em; line-height: 1.4; max-width: 30ch; }
.hero-description { margin-top: var(--s4); color: var(--muted); max-width: 48ch; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); align-items: center; margin-top: var(--s6); }
.button-primary { display: inline-flex; align-items: center; justify-content: space-between; gap: var(--s5); min-height: 48px; padding: var(--s3) 20px; font: 500 var(--fs-ui)/1.6 var(--mono); color: var(--accent-ink); background: var(--accent); border: 1px solid var(--button-edge); transition: transform .2s var(--ease-press), background-color .2s; }
.button-primary > span { display: inline-block; font-size: 16px; transition: transform .25s var(--ease-press); }
@media (hover: hover) and (pointer: fine) {
  .button-primary:hover { transform: translateY(-2px); }
  .button-primary:hover > span { transform: translateX(3px); }
}
.button-primary:active { transform: scale(.98); transition-duration: .08s; }
.button-text { display: inline-flex; gap: var(--s3); align-items: center; min-height: 44px; font: 300 var(--fs-ui) var(--mono); transition: color .2s; }

/* Terminal: a real computation on synthetic data, drawn as a dot plot. */
.terminal { min-width: 0; width: 100%; background: var(--panel); border: 1px solid var(--border); position: relative; }
.terminal-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s2) var(--s3); padding: 14px 20px; color: var(--muted); border-bottom: 1px solid var(--border); font-size: var(--fs-label); }
.terminal-bar > span:first-child { display: inline-flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.terminal-badge { letter-spacing: .02em; border: 1px solid var(--border); padding: 3px 7px; white-space: nowrap; }
.terminal-body { padding: 20px 20px 0; }
.terminal-command { font-size: var(--fs-ui); line-height: 2; overflow-wrap: anywhere; }
.prompt { color: var(--accent-text); }
.cursor { display: inline-block; width: 7px; height: 14px; margin-left: 4px; vertical-align: -2px; background: var(--accent-text); opacity: 0; }
.terminal.is-running .cursor { opacity: 1; }
.boot-output { padding-top: var(--s2); color: var(--muted); font-size: var(--fs-ui); }
.boot-output p { display: flex; align-items: baseline; gap: var(--s2); line-height: 2.1; }
.log-time { flex-shrink: 0; }
.log-text { min-width: 0; }
.log-result { color: var(--accent-text); margin-left: auto; font-size: var(--fs-label); }
.js .is-running [data-boot] { opacity: .45; }
.js .is-running [data-boot].boot-complete { opacity: 1; }
.plot { position: relative; height: 200px; margin-block: var(--s3) var(--s4); display: grid; place-items: center; border-block: 1px solid var(--border); overflow: hidden; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.p-used { fill: var(--ink); }
.p-out { fill: none; stroke: var(--muted); stroke-width: 1; }
.p-none { fill: var(--muted); }
.p-axis { stroke: var(--line); stroke-width: 1; }
.p-median { stroke: var(--accent-text); stroke-width: 1; }
.p-text { font: 300 var(--fs-label) var(--mono); fill: var(--muted); }
.p-text-accent { fill: var(--accent-text); }
.dotmark { display: grid; grid-template-columns: repeat(9, 17px); gap: 3px; }
.dotmark i { width: 8px; height: 8px; background: var(--ink); border-radius: 50%; margin: 4px; }
.dotmark .empty { visibility: hidden; }
.dotmark .accent-dot { background: var(--accent-text); }
.command-response { position: absolute; inset: 0; z-index: 1; overflow-y: auto; padding: var(--s3) var(--s4); background: var(--panel); color: var(--muted); font-size: var(--fs-ui); }
.command-response[hidden] { display: none; }
.command-response pre { font: inherit; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.response-close { float: right; min-height: 32px; margin: -4px 0 0 var(--s3); padding: 0 0 0 var(--s2); color: var(--muted); font-size: var(--fs-label); transition: color .2s; }
.response-close:hover { color: var(--accent-text); }
.terminal-result { display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--s2); min-height: 44px; font-size: var(--fs-ui); color: var(--accent-text); }
.terminal-result button { align-items: center; gap: var(--s2); margin-left: auto; min-height: 44px; padding: 0; color: var(--muted); font-size: var(--fs-ui); white-space: nowrap; transition: color .2s; }
.terminal-result button:hover { color: var(--accent-text); }
.command-form { align-items: center; gap: var(--s3); border-top: 1px solid var(--border); min-height: 52px; font-size: var(--fs-ui); }
.command-form label { flex: 0 0 auto; white-space: nowrap; }
.command-form input { min-width: 0; width: 100%; min-height: 44px; padding: 10px 4px; color: var(--ink); background: transparent; border: 0; border-radius: 0; }
.command-form input::placeholder { color: var(--muted); opacity: 1; }
.command-form input:focus-visible { outline-offset: 0; }
.command-form button { color: var(--accent-text); min-width: 44px; min-height: 44px; font-size: 18px; }

/* Operating fields: a quiet strip, not a navigation target. */
.fields-strip { border-block: 1px solid var(--border); }
.fields-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s3) var(--s6); min-height: 72px; padding-block: var(--s4); }
.fields-title { color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.fields-inner ul { display: flex; flex-wrap: wrap; gap: var(--s2) 0; list-style: none; padding: 0; margin: 0; font-size: var(--fs-ui); }
.fields-inner li:not(:last-child)::after { content: "+"; display: inline-block; width: clamp(28px, 3.4vw, 52px); text-align: center; color: var(--muted); }

/* Sections share one heading composition: title on seven columns, the companion on five. */
.section { padding-block: var(--section); }
.section-heading { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: var(--s5) var(--s7); margin-bottom: var(--s7); }
.section-index { margin-bottom: var(--s4); color: var(--muted); letter-spacing: .08em; }
.section-index .accent { margin-right: var(--s1); }
.section-heading h2 { font-size: var(--fs-h2); line-height: 1.15; }
.section-description { color: var(--muted); max-width: 46ch; line-height: 1.7; }
.grid-slot { align-self: stretch; min-height: 96px; }

/* Capabilities: two lead modules carry the transport positioning; the other four are a compact index. */
.module-lead { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 1px solid var(--border); border-top: 1px solid var(--border); background: var(--bg); }
.module { min-width: 0; }
.module-feature { display: flex; flex-direction: column; padding: var(--s6); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.module-number { color: var(--muted); letter-spacing: .06em; }
.module h3 { font-size: var(--fs-h3); line-height: 1.2; }
.module-feature h3 { font-size: 28px; margin-top: var(--s5); }
.module-label { margin-top: var(--s2); font-weight: 500; }
.module-figure { display: block; width: 100%; max-width: 280px; height: auto; margin-block: var(--s6); }
.figure-line { stroke: var(--line); stroke-width: 1; }
.figure-accent, .figure-route { stroke: var(--accent-text); stroke-width: 1; fill: none; }
.figure-dot { fill: var(--ink); }
.figure-hollow { fill: none; stroke: var(--muted); stroke-width: 1; }
.figure-lattice { fill: var(--line); }
.figure-end { fill: var(--accent); stroke: var(--accent-edge); stroke-width: 1; }
.module-copy { color: var(--ink-soft); line-height: 1.7; max-width: 62ch; }
.module-feature .module-copy + .module-copy { margin-top: var(--s3); color: var(--muted); }
.module-tags { color: var(--muted); font-size: var(--fs-ui); line-height: 1.8; }
.module-feature .module-tags { margin-top: auto; padding-top: var(--s5); }
.module-list { background: var(--bg); border-inline: 1px solid var(--border); }
.module-row { display: grid; grid-template-columns: 40px minmax(170px, 250px) minmax(0, 1fr) 290px; align-items: start; gap: var(--s3) var(--s6); padding: var(--s5) var(--s6); border-bottom: 1px solid var(--border); }
.module-row .module-number, .module-row .module-tags { padding-top: 6px; }
.module-row .module-label { color: var(--muted); font-size: var(--fs-small); font-weight: 400; }
.module-details { margin-top: var(--s1); }
.module-details summary { display: inline-flex; align-items: center; gap: var(--s3); list-style: none; min-height: 44px; color: var(--muted); font: 300 var(--fs-ui) var(--mono); transition: color .2s; }
.module-details summary::-webkit-details-marker { display: none; }
.module-details summary:hover { color: var(--accent-text); }
.module-details summary span { font-size: 16px; color: var(--accent-text); transition: transform .2s; }
.module-details[open] summary span { transform: rotate(45deg); }
.module-details p { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 62ch; padding-bottom: var(--s3); }

/* Architecture: one concrete reference flow. The ordered list is its own text equivalent. */
.architecture-section { border-top: 1px solid var(--border); background: var(--panel); }
.architecture { border: 1px solid var(--border); background: var(--bg); }
.architecture-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s1) var(--s3); border-bottom: 1px solid var(--border); padding: 14px var(--s5); color: var(--muted); }
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px; padding: 56px var(--s6) var(--s5); margin: 0; }
.pipeline-node { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 20px; border: 1px solid var(--border); background: var(--panel); }
.pipeline-node:not(:last-child)::after { content: "→"; position: absolute; left: 100%; top: 50%; width: 28px; margin-top: -10px; text-align: center; color: var(--accent-text); font: 300 14px/20px var(--mono); }
.node-number { color: var(--muted); letter-spacing: .04em; }
.pipeline-node h3 { margin-top: var(--s4); font-size: 16px; line-height: 1.3; letter-spacing: -.03em; }
.pipeline-node p { color: var(--muted); font-size: var(--fs-small); line-height: 1.6; margin-block: var(--s2) var(--s4); }
.node-footer { display: block; min-height: calc(5.1em + var(--s3)); margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-ui); line-height: 1.7; }
.node-catch { display: block; font-size: var(--fs-label); color: var(--accent-text); letter-spacing: .06em; text-transform: uppercase; }
.node-key { border-color: var(--accent-text); background: var(--panel-raised); }
/* The feedback loop is drawn as a real return path under the nodes. */
.feedback { position: relative; height: 28px; margin: 0 var(--s6) 36px; border: 1px solid var(--line); border-top: 0; color: var(--muted); font-size: var(--fs-ui); }
.feedback::before { content: "↑"; position: absolute; left: -5px; top: -15px; width: 9px; color: var(--accent-text); font: 300 var(--fs-label)/1 var(--mono); text-align: center; background: var(--bg); }
.feedback-label { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); padding-inline: var(--s3); background: var(--bg); white-space: nowrap; line-height: 18px; }

/* Contact. */
.contact-section { border-top: 1px solid var(--border); }
.contact-form { position: relative; display: none; width: 100%; max-width: 760px; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); background: var(--panel); }
.js .contact-form { display: grid; }
.contact-field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; padding: 20px var(--s5) var(--s4); border-bottom: 1px solid var(--border); }
.contact-field-name { border-right: 1px solid var(--border); }
.contact-field-wide { grid-column: 1 / -1; }
.contact-field label { font: 300 var(--fs-ui) var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.contact-field .optional { text-transform: none; letter-spacing: 0; }
.contact-field input, .contact-field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 8px 0 10px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font: 400 16px/1.6 var(--sans); }
.contact-field textarea { min-height: 148px; resize: vertical; }
.contact-field input:focus-visible, .contact-field textarea:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.contact-field [aria-invalid="true"] { border-bottom: 2px solid var(--danger); padding-bottom: 9px; }
.field-error { min-height: 20px; color: var(--danger); font-size: 13px; line-height: 20px; }
.field-error[hidden] { display: block; visibility: hidden; }
.contact-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s3) var(--s5); padding: var(--s4) var(--s5); }
.contact-status { min-height: 1.8em; color: var(--muted); font-size: var(--fs-ui); line-height: 1.8; }
.contact-status[data-state="success"] { color: var(--accent-text); }
.contact-status[data-state="error"] { color: var(--danger); }
.contact-form[aria-busy="true"] .button-primary { opacity: .72; }
.contact-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-fallback { color: var(--muted); font-size: var(--fs-small); }
.wave-slot { display: none; }
@media (min-width: 1101px) {
  .contact-section .section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 clamp(48px, 6vw, 112px); align-items: start; }
  .contact-section .section-heading { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s5); margin-bottom: 0; }
  .contact-section .contact-form, .contact-section .contact-fallback { grid-column: 2; justify-self: end; }
  .signal-on .wave-slot { display: block; width: 100%; height: 170px; }
}

/* Footer. */
.site-footer { padding-block: 40px var(--s5); border-top: 1px solid var(--border); background: var(--bg); }
.footer-main, .footer-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3) var(--s5); }
.footer-main { padding-bottom: var(--s5); }
.footer-brand { font-size: 18px; }
.footer-brand .brand-mark { width: 30px; height: 25px; }
.footer-line { color: var(--muted); font-size: var(--fs-ui); }
.footer-link, .back-to-top { display: inline-flex; align-items: center; gap: var(--s3); min-height: 44px; color: var(--muted); font-size: var(--fs-ui); transition: color .2s; }
.footer-link { margin-left: auto; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: var(--s4); color: var(--muted); font-size: var(--fs-ui); overflow-wrap: anywhere; }

/* Below 1101px the hero stacks, modules become two-line rows and the pipeline runs top to bottom. */
@media (max-width: 1100px) {
  :root { --fs-h1: clamp(34px, 7.6vw, 60px); --fs-h2: clamp(27px, 4.6vw, 38px); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .hero-copy { padding-top: 0; }
  .section-heading { grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: var(--s6); }
  .grid-slot { display: none; min-height: 0; }
  .signal-on .grid-slot { display: block; height: 40px; }
  .module-row { grid-template-columns: 32px minmax(0, 1fr); gap: var(--s2) var(--s4); padding-inline: var(--s5); }
  .module-row .module-body, .module-row .module-tags { grid-column: 2; }
  .module-row .module-tags { padding-top: 0; }
  .pipeline { grid-template-columns: minmax(0, 1fr); gap: var(--s3); padding: var(--s5); }
  .signal-on .pipeline { padding-left: 56px; }
  .pipeline-node { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr); column-gap: var(--s5); align-items: start; }
  .pipeline-node:not(:last-child)::after { content: none; }
  .pipeline-node h3 { grid-column: 1; margin-top: var(--s2); }
  .pipeline-node p { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  .node-footer { grid-column: 1 / -1; min-height: 0; margin-top: var(--s4); }
  .node-catch { display: inline; margin-right: var(--s2); }
  .feedback { height: auto; margin: 0 var(--s5) var(--s5); border: 0; }
  .feedback::before { position: static; display: inline-block; width: auto; margin-right: var(--s2); background: none; }
  .feedback-label { position: static; transform: none; padding: 0; background: none; white-space: normal; }
}
@media (max-width: 720px) {
  .module-lead { grid-template-columns: minmax(0, 1fr); }
  .module-feature { padding: var(--s5); }
}
@media (max-width: 580px) {
  :root { --header-height: 60px; }
  .header-inner { gap: var(--s3); }
  .brand { font-size: 18px; gap: var(--s2); }
  .brand-mark { width: 31px; height: 26px; }
  .nav-section { display: none; }
  .theme-button { border-left: 0; padding-left: 0; }
  .hero { padding-block: 40px 48px; gap: 40px; }
  .hero-lead { margin-top: var(--s5); }
  .hero-actions { margin-top: var(--s5); }
  .hero-actions .button-primary { width: 100%; }
  .terminal-bar { padding: 12px var(--s4); }
  .terminal-body { padding: var(--s4) var(--s4) 0; }
  .terminal-command, .boot-output { font-size: var(--fs-label); }
  .plot { height: 184px; }
  /* 16px keeps iOS from zooming the page when the field takes focus. */
  .command-form input { font-size: 16px; }
  .fields-inner { flex-direction: column; align-items: flex-start; }
  .module-row { padding-inline: var(--s4); }
  .pipeline { padding: var(--s4); }
  .signal-on .pipeline { padding-left: 44px; }
  .pipeline-node { display: flex; padding: var(--s4); }
  .pipeline-node p { margin-block: var(--s2) 0; }
  .feedback { margin-inline: var(--s4); }
  .contact-form { grid-template-columns: minmax(0, 1fr); }
  .contact-field-name { border-right: 0; }
  .contact-field { padding: var(--s4) var(--s4) var(--s3); }
  .contact-field textarea { min-height: 132px; }
  .contact-actions { display: grid; justify-content: stretch; gap: 0; padding: var(--s4); }
  .contact-actions .button-primary { order: -1; width: 100%; justify-content: center; gap: var(--s3); }
  .contact-status { min-height: 0; }
  .contact-status:not(:empty) { margin-top: var(--s3); }
  .footer-link { margin-left: 0; }
  .back-to-top { margin-left: auto; }
  .footer-line { order: 3; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Legal and error pages reuse the approved palette, header and typography. */
.legal-page { max-width: 860px; padding-block: 60px 72px; }
.legal-page h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.2; margin: 20px 0; }
.legal-page h2 { font-size: 20px; margin: 30px 0 10px; }
.legal-page p, .legal-page address, .legal-page li { font-size: var(--fs-body); color: var(--muted); line-height: 1.7; }
.legal-page p + p { margin-top: 14px; }
.legal-page address { font-style: normal; }
.legal-page ul { padding-left: 20px; }
.legal-page a:not(.button-primary) { text-decoration: underline; text-underline-offset: 3px; }
.legal-page .button-primary { margin-top: 24px; }

/* Motion. Everything below runs only without a reduced-motion preference. Content inside a block
   never animates on its own; the page moves as whole scenes, plus small feedback on controls. */
@media (prefers-reduced-motion: no-preference) {
  nav a { position: relative; }
  nav a::after { content: ""; position: absolute; left: var(--nav-index, 24px); right: 0; bottom: 10px; height: 1px; background: var(--accent-text); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease-out); }
  .back-to-top span, .footer-link span, .button-text span { display: inline-block; transition: transform .2s var(--ease-press); }
  .contact-field label { transition: color .25s var(--ease-out); }
  .contact-field:focus-within label { color: var(--accent-text); }
  .js .is-running [data-boot].boot-complete { transition: opacity .2s; }
  /* Module disclosure opens smoothly where the browser can animate to height: auto; elsewhere it stays instant. */
  :root { interpolate-size: allow-keywords; }
  .module-details::details-content { height: 0; overflow: clip; transition: height .35s var(--ease-out), content-visibility .35s allow-discrete; }
  .module-details[open]::details-content { height: auto; }
  @media (hover: hover) and (pointer: fine) {
    nav a:hover::after { transform: scaleX(1); transform-origin: left; }
    .back-to-top:hover span { transform: translateY(-3px); }
    .footer-link:hover span { transform: translateX(3px); }
    .button-text:hover span { transform: translateY(3px); }
  }
  /* Theme switch crossfades instead of cutting (theme.js uses a view transition when available). */
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; animation-timing-function: ease; }

  /* First screen arrives as one piece: copy and terminal together, no line-by-line cascade. */
  .hero-copy, .hero .terminal { animation: arrive 1s var(--ease-out) backwards; }
  .hero .terminal { animation-delay: .08s; }

  /* Signal field (signal.js): one canvas of dots behind the page. Content above it stays still and
     sits on opaque surfaces; the field shows only in the places reserved for it. */
  .signal-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
  .signal-canvas.is-live { opacity: 1; }
  .signal-on main, .signal-on .site-footer { position: relative; z-index: 1; }
  .signal-on .architecture-section { background: color-mix(in srgb, var(--panel) 40%, transparent); }
  /* Data streams through the pipeline frame: the frame lets the flow through, the nodes stay solid. */
  .signal-on .architecture { background: transparent; }
  .signal-on .feedback::before, .signal-on .feedback-label { background: color-mix(in srgb, var(--panel) 40%, var(--bg)); }
}

@keyframes arrive { from { opacity: 0; transform: translateY(14px); } }
