:root {
  color-scheme: light dark;
  --page: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #ece9e3;
  --ink: #151617;
  --muted: #65686d;
  --line: #c9c6bf;
  --line-strong: #92908b;
  --authority: #b51f32;
  --authority-soft: #f4d9dd;
  --verified: #166a4b;
  --verified-soft: #d7ebdf;
  --warning: #8a5b0e;
  --warning-soft: #f4e5c5;
  --info: #245e83;
  --info-soft: #dceaf3;
  --unknown: #5d6066;
  --shadow: 0 18px 56px rgb(18 22 26 / .10);
  --max: 1640px;
  --reading: 74ch;
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Charter, Georgia, Cambria, "Times New Roman", serif;
}

html[data-theme="dark"] {
  --page: #080a0c;
  --surface: #111417;
  --surface-2: #191d21;
  --ink: #f1f2f3;
  --muted: #a7adb4;
  --line: #353b41;
  --line-strong: #697078;
  --authority: #ef6675;
  --authority-soft: #3b171e;
  --verified: #68c89d;
  --verified-soft: #15372a;
  --warning: #e4b35b;
  --warning-soft: #3b2b12;
  --info: #77b9e2;
  --info-soft: #173044;
  --unknown: #a5aab0;
  --shadow: 0 24px 64px rgb(0 0 0 / .42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

.cs-skip {
  position: fixed;
  z-index: 200;
  left: 1rem;
  top: -5rem;
  background: var(--ink);
  color: var(--page);
  padding: .75rem 1rem;
  border-radius: 4px;
}
.cs-skip:focus { top: 1rem; }

.cs-dev-banner {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  padding: .55rem 1rem;
  background: var(--authority);
  color: #fff;
  font: 700 .72rem/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cs-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: blur(16px);
}
.cs-topbar__inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 68px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.cs-brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.cs-brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--page);
  border-radius: 4px;
  font: 800 .75rem var(--mono);
}
.cs-global-nav, .cs-local-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.cs-global-nav { margin-left: auto; }
.cs-global-nav a, .cs-local-nav a, .cs-local-nav button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 .82rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
}
.cs-global-nav a:hover, .cs-global-nav a:focus-visible,
.cs-local-nav a:hover, .cs-local-nav a:focus-visible,
.cs-local-nav button:hover, .cs-local-nav button:focus-visible,
.cs-local-nav [aria-current="page"] {
  color: var(--ink);
  background: var(--surface-2);
  outline: none;
}
.cs-theme {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.cs-main { overflow: clip; }
.cs-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 6rem 2rem;
}
.cs-section--tight { padding-top: 3rem; padding-bottom: 3rem; }
.cs-section--bleed {
  max-width: none;
  padding-left: max(2rem, calc((100vw - var(--max)) / 2 + 2rem));
  padding-right: max(2rem, calc((100vw - var(--max)) / 2 + 2rem));
}
.cs-section--ink { background: #101316; color: #f3f4f5; }
html[data-theme="dark"] .cs-section--ink { background: #050607; }
.cs-section--paper { background: var(--surface); }

.cs-eyebrow {
  margin: 0 0 1rem;
  font: 760 .72rem/1.4 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--authority);
}
.cs-display {
  margin: 0;
  max-width: 14ch;
  font: 650 clamp(3.4rem, 8vw, 8.6rem)/.91 var(--serif);
  letter-spacing: -.065em;
}
.cs-display--wide { max-width: 18ch; }
.cs-dek {
  max-width: 64ch;
  margin: 2rem 0 0;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  color: var(--muted);
}
.cs-section--ink .cs-dek { color: #b8bec5; }
.cs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2.25rem;
}
.cs-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .8rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 720;
  cursor: pointer;
}
.cs-button:hover, .cs-button:focus-visible { transform: translateY(-1px); box-shadow: 0 8px 24px rgb(0 0 0 / .10); outline: none; }
.cs-button--primary { border-color: var(--authority); background: var(--authority); color: #fff; }
.cs-button--quiet { background: transparent; }
.cs-section--ink .cs-button--quiet { color: #fff; border-color: #59616a; }

.cs-hero {
  min-height: min(900px, calc(100vh - 100px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
  align-items: center;
  gap: clamp(3rem, 7vw, 8rem);
}
.cs-hero__meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  color: var(--muted);
  font: .76rem var(--mono);
}

.cs-mind-system {
  position: relative;
  min-height: 620px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cs-mind-system::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .16;
}
.cs-person {
  position: absolute;
  left: 8%;
  top: 22%;
  width: 34%;
  aspect-ratio: .74;
  border: 2px solid var(--ink);
  border-radius: 48% 48% 42% 42% / 34% 34% 60% 60%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  background: var(--surface);
  z-index: 2;
  font-weight: 780;
}
.cs-person small { display: block; margin-top: .5rem; color: var(--muted); font: .68rem var(--mono); }
.cs-fragment {
  position: absolute;
  z-index: 3;
  max-width: 170px;
  padding: .65rem .75rem;
  border-left: 3px solid var(--authority);
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / .08);
  font: 700 .7rem/1.35 var(--mono);
}
.cs-fragment:nth-of-type(2) { left: 3%; top: 8%; transform: rotate(-3deg); }
.cs-fragment:nth-of-type(3) { left: 38%; top: 7%; transform: rotate(2deg); }
.cs-fragment:nth-of-type(4) { left: 2%; bottom: 8%; transform: rotate(2deg); }
.cs-fragment:nth-of-type(5) { left: 36%; bottom: 7%; transform: rotate(-2deg); }
.cs-continuity-core {
  position: absolute;
  right: 5%;
  top: 13%;
  width: 46%;
  min-height: 74%;
  padding: 2rem;
  background: #101316;
  color: #f1f2f3;
  z-index: 2;
}
.cs-continuity-core h2 { margin: 0 0 1.4rem; font: 640 clamp(1.6rem, 3vw, 2.8rem)/1 var(--serif); letter-spacing: -.04em; }
.cs-core-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
.cs-core-grid span { padding: .72rem; border: 1px solid #3c434a; font: 720 .68rem var(--mono); }
.cs-core-grid span:nth-child(3n + 1) { border-left-color: var(--authority); }
.cs-core-note { margin-top: 1.5rem; color: #b7bdc4; font-size: .9rem; }

.cs-snapshot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  padding: 1.25rem 1.4rem;
  border-top: 3px solid var(--authority);
  background: var(--authority-soft);
}
.cs-snapshot strong { display: block; margin-bottom: .3rem; }
.cs-snapshot p { margin: 0; max-width: 80ch; }
.cs-snapshot code { font: .72rem var(--mono); }

.cs-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: start;
}
.cs-prose { max-width: var(--reading); }
.cs-prose h2, .cs-heading {
  margin: 0 0 1.5rem;
  font: 640 clamp(2.4rem, 5vw, 5.4rem)/.98 var(--serif);
  letter-spacing: -.05em;
}
.cs-prose h3 { margin-top: 2.8rem; font-size: 1.5rem; }
.cs-prose p, .cs-prose li { font-size: clamp(1.03rem, 1.45vw, 1.22rem); }
.cs-prose p { margin: 0 0 1.35rem; }
.cs-prose blockquote {
  margin: 3rem 0;
  padding: 1.8rem 0 1.8rem 1.7rem;
  border-left: 5px solid var(--authority);
  font: 600 clamp(1.7rem, 3vw, 3rem)/1.12 var(--serif);
  letter-spacing: -.035em;
}

.cs-route-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cs-route-card {
  position: relative;
  min-height: 430px;
  padding: clamp(1.5rem, 3vw, 3rem);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.cs-route-card::after {
  content: attr(data-index);
  position: absolute;
  right: -1rem;
  bottom: -3rem;
  font: 700 12rem/.8 var(--serif);
  color: var(--surface-2);
  pointer-events: none;
}
.cs-route-card > * { position: relative; z-index: 1; }
.cs-route-card h2 { max-width: 12ch; margin: 1rem 0; font: 650 clamp(2.2rem, 4vw, 4.8rem)/.95 var(--serif); letter-spacing: -.05em; }
.cs-route-card p { max-width: 52ch; color: var(--muted); }
.cs-route-card--dark { background: #101316; color: #f3f4f5; border-color: #343a41; }
.cs-route-card--dark::after { color: #171b1f; }
.cs-route-card--dark p { color: #b8bec5; }

.cs-loop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.cs-loop {
  padding: 2rem;
  border: 1px solid var(--line);
  background: var(--surface);
}
.cs-loop--tax { box-shadow: inset 0 0 0 1px var(--authority-soft); }
.cs-loop h3 { margin: 0 0 1.5rem; font-size: 1.25rem; }
.cs-loop ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.cs-loop li { display: grid; grid-template-columns: 2.2rem 1fr; align-items: center; gap: .7rem; }
.cs-loop li::before { content: counter(list-item, decimal-leading-zero); font: .72rem var(--mono); color: var(--authority); }
.cs-loop li:not(:last-child)::after { content: "↓"; display: block; grid-column: 1; text-align: center; color: var(--line-strong); }

.cs-state-legend { display: flex; flex-wrap: wrap; gap: .55rem; }
.cs-state {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .58rem;
  border: 1px solid currentColor;
  font: 760 .65rem var(--mono);
  letter-spacing: .05em;
}
.cs-state::before { content: ""; width: .56rem; height: .56rem; background: currentColor; border-radius: 50%; }
.cs-state--operational { color: var(--verified); }
.cs-state--active { color: var(--info); }
.cs-state--partial, .cs-state--planned { color: var(--warning); }
.cs-state--blocked { color: var(--authority); }
.cs-state--unknown { color: var(--unknown); }

.cs-architecture {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
.cs-plane {
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--surface);
}
.cs-plane h3 { margin: .7rem 0; font-size: 1.1rem; }
.cs-plane p { margin: 0; color: var(--muted); font-size: .88rem; }
.cs-plane--core { background: #101316; color: #f3f4f5; border-color: #101316; }
.cs-plane--core p { color: #b8bec5; }
.cs-architecture__stack { display: grid; gap: 1rem; }

.cs-genome { display: grid; grid-template-columns: .9fr 1.4fr; gap: 2rem; }
.cs-genome__source { padding: 2rem; background: #101316; color: #fff; }
.cs-genome__source dl { display: grid; gap: .8rem; margin: 1.5rem 0 0; }
.cs-genome__source div { border-top: 1px solid #3e444a; padding-top: .7rem; }
.cs-genome__source dt { font: .7rem var(--mono); color: #aeb5bd; }
.cs-genome__source dd { margin: .25rem 0 0; font-weight: 720; }
.cs-phenotypes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; }
.cs-phenotype { min-height: 150px; padding: 1rem; border: 1px solid var(--line); background: var(--surface); }
.cs-phenotype strong { display: block; margin-top: 2rem; font-size: 1.05rem; }
.cs-phenotype small { color: var(--muted); font: .68rem var(--mono); }

.cs-capabilities { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .75rem; }
.cs-capability { padding: 1.1rem; border-top: 4px solid var(--line-strong); background: var(--surface); }
.cs-capability:nth-child(4n + 1) { border-top-color: var(--authority); }
.cs-capability h3 { margin: .5rem 0; font-size: 1rem; }
.cs-capability p { color: var(--muted); font-size: .85rem; }

.cs-studio-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.5rem; }
.cs-studio-controls { position: sticky; top: 92px; align-self: start; padding: 1.25rem; border: 1px solid var(--line); background: var(--surface); }
.cs-field { display: grid; gap: .45rem; margin-bottom: 1rem; }
.cs-field label { font: 720 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.cs-field select { min-height: 44px; padding: .6rem; border: 1px solid var(--line); background: var(--page); color: var(--ink); }
.cs-prompt-panel { min-width: 0; }
.cs-prompt-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.cs-prompt {
  min-height: 420px;
  width: 100%;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: #101316;
  color: #eef0f2;
  font: .84rem/1.7 var(--mono);
  resize: vertical;
}
.cs-status { min-height: 1.5rem; color: var(--muted); font: .75rem var(--mono); }

.cs-evidence-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.cs-evidence-table th, .cs-evidence-table td { padding: .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cs-evidence-table th { font: .68rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.cs-download-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.cs-download { padding: 1.5rem; border: 1px solid var(--line); background: var(--surface); }
.cs-download h3 { margin: .5rem 0; }
.cs-download p { color: var(--muted); }
.cs-download code { display: block; overflow-wrap: anywhere; font: .7rem var(--mono); }

.cs-footer { border-top: 1px solid var(--line); }
.cs-footer__inner { max-width: var(--max); margin: 0 auto; padding: 3rem 2rem 5rem; display: grid; grid-template-columns: 1fr auto; gap: 2rem; }
.cs-footer p { margin: .4rem 0; color: var(--muted); }
.cs-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }

.cs-mobile-only { display: none; }

@media (max-width: 1100px) {
  .cs-global-nav { display: none; }
  .cs-hero { grid-template-columns: 1fr; padding-top: 4rem; }
  .cs-mind-system { min-height: 560px; }
  .cs-intro-grid, .cs-genome { grid-template-columns: 1fr; }
  .cs-architecture { grid-template-columns: 1fr; }
  .cs-capabilities { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cs-studio-layout { grid-template-columns: 1fr; }
  .cs-studio-controls { position: static; }
}

@media (max-width: 760px) {
  .cs-topbar__inner { padding: 0 1rem; }
  .cs-local-nav { overflow-x: auto; padding-bottom: .35rem; }
  .cs-section, .cs-section--bleed { padding: 4rem 1rem; }
  .cs-display { font-size: clamp(3rem, 16vw, 5.5rem); }
  .cs-route-pair, .cs-loop-grid, .cs-download-grid { grid-template-columns: 1fr; }
  .cs-mind-system { min-height: 720px; }
  .cs-person { left: 8%; top: 8%; width: 45%; }
  .cs-fragment:nth-of-type(2) { left: 55%; top: 6%; }
  .cs-fragment:nth-of-type(3) { left: 52%; top: 20%; }
  .cs-fragment:nth-of-type(4) { left: 3%; top: 35%; bottom: auto; }
  .cs-fragment:nth-of-type(5) { left: 50%; top: 37%; bottom: auto; }
  .cs-continuity-core { left: 4%; right: 4%; top: 50%; width: auto; min-height: 45%; }
  .cs-core-grid { grid-template-columns: repeat(2, 1fr); }
  .cs-phenotypes { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cs-capabilities { grid-template-columns: 1fr; }
  .cs-snapshot { grid-template-columns: 1fr; }
  .cs-footer__inner { grid-template-columns: 1fr; }
  .cs-desktop-only { display: none; }
  .cs-mobile-only { display: block; }
}

@media (max-width: 390px) {
  .cs-dev-banner { justify-content: flex-start; gap: .5rem; font-size: .62rem; }
  .cs-display { font-size: 3.15rem; }
  .cs-mind-system { min-height: 760px; }
  .cs-person { width: 48%; padding: 1rem; }
  .cs-fragment { max-width: 142px; font-size: .62rem; }
  .cs-continuity-core { padding: 1.25rem; }
  .cs-core-grid span { padding: .55rem; font-size: .6rem; }
}

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

@media print {
  .cs-dev-banner, .cs-topbar, .cs-actions, .cs-theme, .cs-studio-controls { display: none !important; }
  body { background: #fff; color: #000; }
  .cs-section { padding: 2rem 0; break-inside: avoid; }
  .cs-mind-system, .cs-route-card, .cs-loop, .cs-plane, .cs-download { box-shadow: none; break-inside: avoid; }
  a { text-decoration: underline; }
}

/* Issue #356 CSP-safe presentation utilities. */
.cs-button:focus-visible,
.cs-theme:focus-visible,
.cs-global-nav a:focus-visible,
.cs-local-nav a:focus-visible,
.cs-local-nav button:focus-visible {
  outline: 3px solid var(--authority);
  outline-offset: 3px;
}
.cs-u-mt-2 { margin-top: 2rem; }
.cs-u-mt-15 { margin-top: 1.5rem; }
.cs-u-mt-3 { margin-top: 3rem; }
.cs-closing-quote {
  max-width: 900px;
  margin: 4rem 0 0;
  font: 600 clamp(2rem, 4vw, 4rem)/1.06 var(--serif);
  letter-spacing: -.045em;
}
.cs-engineering-title {
  font: 650 clamp(2.6rem, 5vw, 5.6rem)/.94 var(--serif);
  letter-spacing: -.055em;
  margin: .5rem 0 2rem;
}
.cs-loop--dark { background: #171b1f; border-color: #414850; }
.cs-engineering-closing-quote {
  max-width: 1000px;
  margin: 5rem 0 0;
  font: 600 clamp(2.1rem, 4.5vw, 4.7rem)/1.03 var(--serif);
  letter-spacing: -.055em;
}
.cs-divider { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.cs-muted-small { color: var(--muted); font-size: .86rem; }
.cs-meta-small { font: .68rem var(--mono); color: var(--muted); }
.cs-prompt-title {
  font: 650 clamp(2.2rem, 4vw, 4.5rem)/.98 var(--serif);
  letter-spacing: -.05em;
  margin: .5rem 0;
}
.cs-prompt-label { display: block; margin-top: 2rem; }
.cs-details {
  margin-top: 1.5rem;
  border: 1px solid var(--line);
  padding: 1rem;
  background: var(--surface);
}

