/* Layout: a single centered column of full-width bands, light wafer-grey ground,
   dark "die" panels wherever light is doing the computing. */
:root {
  --ground: #EEF1F4;
  --surface: #FFFFFF;
  --ink: #0D1B2A;
  --ink-soft: #2B3A4E;
  --muted: #47566B;
  --line: #C9D1DA;
  --line-strong: #76849A;
  --accent: #1F3FD6;
  --accent-hover: #162FA8;
  --signal: #F2A900;
  --signal-text: #7A4E00;
  --night-line: #2A3B52;
  --night-text: #D5DCE4;
  --night-muted: #B4C0CE;

  --font-body: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(56px, 7vw, 88px);
  --radius: 4px;

  color-scheme: light;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
}

img, svg { max-width: 100%; }
.sprite { position: absolute; }

h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }

h1, h2, h3 { font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.375rem, 4.7vw, 4.25rem); line-height: 1.03; font-stretch: 116%; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.1vw, 2.75rem); line-height: 1.1; font-stretch: 112%; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; line-height: 1.25; font-stretch: 108%; }

p { color: var(--ink-soft); }

a { color: var(--accent); }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

[id] { scroll-margin-top: 16px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--ink); color: #fff;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Shared pieces ---------- */

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }

.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stack-md { display: flex; flex-direction: column; gap: 40px; }
.stack-lg { display: flex; flex-direction: column; gap: 48px; }

.section-head { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }

.band--surface { background: var(--surface); border-block: 1px solid var(--line); }
.band--flush-top { border-top: 0; }
.band--flush-bottom { border-bottom: 0; }
.band--night { background: var(--ink); color: var(--ground); }
.band--night p, .band--night dd { color: var(--night-text); }
.band--night .eyebrow { color: var(--night-muted); }
.band--night a { color: var(--signal); font-weight: 600; }
.band--night a:hover { color: #fff; }

.eyebrow, .tag, .mono, .mono-note, .steps__n, .runs dt, .specs td, .fig-label, code {
  font-family: var(--font-mono);
}

.eyebrow {
  font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}

.mono-note { font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-strong); border-radius: 3px; padding: 2px 8px;
}
.tag--solid { color: #fff; background: var(--accent); border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn--small { min-height: 44px; padding: 0 18px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

.figure { display: block; width: 100%; height: auto; }
.fig-label { font-size: 12px; fill: var(--muted); }
.fig-label--night { fill: var(--night-muted); }
.fig-accent { fill: var(--accent); }
.waveguide { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-linecap: round; }

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--line); }
.site-header__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 32px; padding-block: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-stretch: 116%; letter-spacing: 0.01em;
}
.brand--night { color: #fff; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-size: 0.9375rem; font-weight: 500; }
.nav a:not(.btn) {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none;
}
.nav a:not(.btn):hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center; gap: 48px 56px;
  padding-block: clamp(48px, 6vw, 88px) clamp(56px, 7vw, 96px);
}
.hero__text { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.lede { max-width: 34em; font-size: 1.1875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 16px; padding-top: 8px; }

/* ---------- Signal chains ---------- */

.chain-block { display: flex; flex-direction: column; gap: 14px; }
.chain-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.chain { display: flex; align-items: stretch; gap: 10px; }
.stage {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px;
  background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius);
}
.stage span { font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.stage .stage__noise { color: var(--signal-text); }
.stage--chip { flex-grow: 2; background: var(--ink); border-color: var(--ink); color: var(--ground); }
.stage--chip span { color: var(--signal); }
.chain__arrow { flex: 0 0 24px; width: 24px; height: 24px; align-self: center; color: var(--line-strong); }
.chain__arrow--signal { color: #C98A00; }

/* ---------- Features ---------- */

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.feature {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
  border-top: 2px solid var(--ink); padding-top: 24px;
}
.feature h3 { font-size: 1.375rem; line-height: 1.2; }

/* ---------- Two-column sections ---------- */

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 72px; }
.split--specs { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
.split--contact { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }

.link-row { display: flex; flex-wrap: wrap; gap: 4px 28px; padding-top: 6px; }
.link-row a { display: inline-flex; align-items: center; min-height: 44px; }

.runs { border-bottom: 1px solid var(--night-line); }
.runs > div { display: flex; gap: 20px; padding: 18px 0; border-top: 1px solid var(--night-line); }
.runs dt {
  flex: 0 0 84px; padding-top: 3px;
  font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--signal);
}
.runs dd { flex: 1 1 0; min-width: 0; }

.equation {
  margin-top: 28px; padding: 20px 22px;
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--night-line); border-radius: var(--radius);
}
.equation__scroll { overflow-x: auto; }
.equation code { font-size: 1.125rem; white-space: nowrap; color: #fff; }
.equation figcaption { font-size: 0.875rem; line-height: 1.5; color: var(--night-muted); }

/* ---------- Projects ---------- */

.project { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 36px 64px; }
.project--minor { align-items: start; border-top: 1px solid var(--line); padding-top: 36px; }
.project__title { font-size: clamp(1.5rem, 2.3vw, 2rem); line-height: 1.15; font-stretch: 110%; letter-spacing: -0.01em; }
.project__figure { background: var(--ink); border-radius: 6px; padding: 12px; min-width: 0; }
.plain-steps { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-soft); }

/* ---------- Applications ---------- */

.rows { border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 6px 40px;
  padding: 22px 0; border-top: 1px solid var(--line);
}
.row h3 { line-height: 1.3; }

/* ---------- Specifications ---------- */

.table-scroll { overflow-x: auto; min-width: 0; }
.specs { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 1rem; }
.specs tr { border-top: 1px solid var(--line); }
.specs tr:last-child { border-bottom: 1px solid var(--line); }
.specs th { text-align: left; font-weight: 500; padding: 15px 16px 15px 0; color: var(--ink-soft); }
.specs td { padding: 15px 0; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

/* ---------- Process ---------- */

.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
.steps li { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.steps__n { font-size: 0.875rem; color: var(--muted); border-bottom: 1px solid var(--line-strong); padding-bottom: 10px; }
.steps h3 { margin-top: 6px; }

/* ---------- Contact ---------- */

.direct { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.direct span { font-size: 0.875rem; color: var(--muted); }
.direct a { overflow-wrap: anywhere; }

.form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.form__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.9375rem; font-weight: 500; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit;
}
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: #B3261E; box-shadow: 0 0 0 1px #B3261E; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form__status { flex: 1 1 220px; font-size: 0.875rem; color: var(--muted); }
.form__status.is-error { color: #B3261E; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: var(--night-muted); }
.site-footer p { color: var(--night-muted); }
.site-footer__row {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 28px 48px; padding-block: 48px;
}
.site-footer__about { display: flex; flex-direction: column; gap: 10px; flex: 1 1 280px; min-width: 0; font-size: 0.9375rem; }
.site-footer__about p { max-width: 26em; }
.site-footer .small, .site-footer__legal { font-size: 0.875rem; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 0 28px; font-size: 0.9375rem; }
.site-footer__nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ground); text-decoration: none; }
.site-footer__nav a:hover { color: var(--signal); }
.site-footer__legal { border-top: 1px solid var(--night-line); padding-block: 20px 40px; }

/* ---------- Narrow screens ---------- */

@media (max-width: 960px) {
  .hero, .split, .split--specs, .split--contact, .project { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .chain { flex-direction: column; }
  .chain__arrow { transform: rotate(90deg); }
  .row { grid-template-columns: minmax(0, 1fr); }
  .nav { gap: 0 20px; }
}

@media (max-width: 520px) {
  .steps, .form__pair { grid-template-columns: minmax(0, 1fr); }
  .btn { width: 100%; }
  .nav .btn { width: auto; }
}
