/* ==========================================================================
   HoruSphere Systems - design system
   Single stylesheet. No build step, no external requests.
   One container width, one spacing scale. Composition varies, rhythm does not.
   ========================================================================== */

/* --- Fonts (self-hosted) -------------------------------------------------- */

@font-face {
  font-family: Onest;
  src: url("/fonts/OnestRegular1602-hint.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Onest;
  src: url("/fonts/OnestBold1602-hint.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Ground and surfaces */
  --bg: #0a0c10;
  --bg-raise: #10141b;
  --surface: #141922;
  --surface-2: #1a212c;

  /* Lines */
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);

  /* Ink on dark */
  --text: #eef1f5;
  --muted: #a6b1c2;

  /* Accent - reserved for things you can click, plus stage numbering */
  --accent: #58a6ff;

  /* Light band */
  --band: #f3f6fa;
  --band-2: #ffffff;
  --band-ink: #101720;
  --band-muted: #4d5a6b;
  --band-line: rgba(16, 23, 32, 0.14);
  --band-accent: #0a66d0;

  /* Type */
  --sans: Onest, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-h1: clamp(2.3rem, 5.4vw, 4.2rem);
  --fs-h2: clamp(1.65rem, 3.4vw, 2.75rem);
  --fs-h3: clamp(1.1rem, 1.7vw, 1.35rem);
  --fs-h4: 1.02rem;
  --fs-lead: clamp(1.05rem, 1.6vw, 1.25rem);
  --fs-small: 0.875rem;
  --fs-micro: 0.78rem;

  /* Spacing scale - the only one */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --sp-section: clamp(64px, 8.5vw, 118px);

  --max: 1200px;
  --max-prose: 68ch;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 6px;
  --radius-lg: 10px;
}

/* --- Reset ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img,
svg { display: block; max-width: 100%; }
img { height: auto; }

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

p, h1, h2, h3, h4, h5, h6, ul, ol, dl, figure, pre, table { margin-top: 0; }

h1, h2, h3, h4, h5, h6 { font-weight: 700; }

code, pre, kbd, samp { font-family: var(--mono); }

table { border-collapse: collapse; }

button { font: inherit; }

/* --- Accessibility -------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.band :focus-visible {
  outline-color: var(--band-accent);
}

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

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

/* --- Layout primitives ---------------------------------------------------- */

.container {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-narrow {
  width: min(900px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--sp-section);
}

.section--tight { padding-block: clamp(44px, 5.5vw, 76px); }

.section--raise { background: var(--bg-raise); }

/* Light inversion band. Used sparingly to break vertical rhythm. */
.band {
  background: var(--band);
  color: var(--band-ink);
}

.band a:not(.button) { color: var(--band-accent); }
.band .eyebrow { color: var(--band-accent); }
.band .muted,
.band p.muted { color: var(--band-muted); }

/* --- Type helpers --------------------------------------------------------- */

h1 {
  margin-bottom: var(--s-5);
  font-size: var(--fs-h1);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h2 {
  margin-bottom: var(--s-4);
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h3 {
  margin-bottom: var(--s-3);
  font-size: var(--fs-h3);
  line-height: 1.25;
}

h4 {
  margin-bottom: var(--s-2);
  font-size: var(--fs-h4);
  line-height: 1.3;
}

p { margin-bottom: var(--s-4); }
p:last-child { margin-bottom: 0; }

.eyebrow {
  margin-bottom: var(--s-4);
  color: var(--accent);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead {
  max-width: var(--max-prose);
  color: var(--text);
  font-size: var(--fs-lead);
  line-height: 1.5;
}

.band .lead { color: var(--band-ink); }

.muted { color: var(--muted); }

.prose { max-width: var(--max-prose); }
.prose p { color: var(--muted); }
.band .prose p { color: var(--band-muted); }

.small { font-size: var(--fs-small); }

/* Stage eyebrow: "1.0 Init ->" - numbering carries the system claim. */
.stage {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage-num {
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--accent);
}

.band .stage-num { color: var(--band-accent); }

.stage-name { color: var(--text); }
.band .stage-name { color: var(--band-ink); }

.stage-arrow { color: var(--muted); }
.band .stage-arrow { color: var(--band-muted); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-3) var(--gutter);
  background: rgba(10, 12, 16, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand svg { width: 26px; height: 26px; flex: none; }

/* Official brand mark. */
.brand img { width: 28px; height: 28px; flex: none; display: block; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 700;
  cursor: pointer;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  margin-left: var(--s-6);
  font-size: 0.93rem;
}

.primary-nav > a,
.nav-trigger {
  color: var(--muted);
  padding-block: 6px;
  transition: color 140ms ease;
}

.primary-nav > a:hover,
.primary-nav > a[aria-current="page"],
.nav-trigger:hover,
.nav-trigger[aria-current="page"] { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-left: auto;
  font-size: 0.93rem;
}

.nav-actions > a:not(.button) { color: var(--muted); }
.nav-actions > a:not(.button):hover { color: var(--text); }

/* Products dropdown - works on hover and on keyboard focus, no JS needed. */
.nav-group { position: relative; }

.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -14px;
  width: 330px;
  display: grid;
  gap: 2px;
  padding: var(--s-2);
  background: #0e1218;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
}

.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu-label {
  padding: var(--s-3) 10px var(--s-2);
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-menu a {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: var(--radius);
}

.nav-menu a:hover,
.nav-menu a:focus-visible { background: rgba(255, 255, 255, 0.06); }

.nav-menu a > span:first-child {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
}

.nav-menu a > span:last-child {
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.35;
}

/* --- Status badges -------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  white-space: nowrap;
}

.band .badge {
  border-color: var(--band-line);
  background: rgba(16, 23, 32, 0.05);
  color: var(--band-ink);
}

.badge--planned { color: var(--muted); }
.band .badge--planned { color: var(--band-muted); }

.badge--lg { padding: 4px 10px; font-size: 0.8rem; }

/* --- Buttons -------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.button--primary {
  background: var(--text);
  border-color: var(--text);
  color: #0a0c10;
}

.button--primary:hover { background: #ffffff; border-color: #ffffff; }

.button--ghost { background: rgba(255, 255, 255, 0.05); }
.button--ghost:hover { background: rgba(255, 255, 255, 0.11); }

.band .button--primary {
  background: var(--band-ink);
  border-color: var(--band-ink);
  color: var(--band);
}

.band .button--ghost {
  background: transparent;
  border-color: var(--band-line);
  color: var(--band-ink);
}

.band .button--ghost:hover { background: rgba(16, 23, 32, 0.06); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

/* Destination-specific inline link with arrow. */
.go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.go::after {
  content: "\2192";
  transition: transform 140ms ease;
}

.go:hover::after { transform: translateX(3px); }

.band .go { color: var(--band-accent); }

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

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(78vh, 720px);
  padding-block: clamp(72px, 12vw, 132px) var(--sp-section);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(96deg, rgba(10, 12, 16, 0.97) 0%, rgba(10, 12, 16, 0.9) 42%, rgba(10, 12, 16, 0.5) 100%),
    linear-gradient(0deg, var(--bg) 2%, rgba(10, 12, 16, 0) 62%);
}

.hero > .container {
  position: relative;
  z-index: 1;
}

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

/* Type-only hero for module and index pages: no photography, no overlay. */
.hero--type {
  min-height: 0;
  padding-block: clamp(56px, 8vw, 96px) clamp(48px, 6vw, 82px);
  background: var(--bg-raise);
  align-items: start;
}

.hero--type::after { display: none; }

.hero-flag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}

.hero-flag .eyebrow { margin-bottom: 0; }

/* --- Rules and section headers -------------------------------------------- */

.section-head {
  display: grid;
  gap: var(--s-4);
  max-width: 760px;
  margin-bottom: var(--s-8);
}

.section-head p { color: var(--muted); margin-bottom: 0; }
.band .section-head p { color: var(--band-muted); }

.section-head--wide { max-width: none; }

/* --- Split rows ----------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split--copy-right { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }

.split-sticky { position: sticky; top: 96px; }

/* --- Three-up value strip (text only, deliberately no card chrome) -------- */

.strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 64px);
}

.strip h3 { margin-bottom: var(--s-3); }
.strip p { color: var(--muted); margin-bottom: 0; }
.band .strip p { color: var(--band-muted); }

/* --- Capability facts row ------------------------------------------------- */

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.facts > div {
  padding: var(--s-6);
  background: var(--bg);
}

.band .facts { background: var(--band-line); border-color: var(--band-line); }
.band .facts > div { background: var(--band-2); }

.fact-value {
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.6vw, 2.05rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.fact-label {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.4;
}

.band .fact-label { color: var(--band-muted); }

/* --- Terminal / command blocks (mono only where content is literally code) - */

.term {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: #0d1117;
  overflow: hidden;
}

.band .term { border-color: rgba(16, 23, 32, 0.22); }

.term-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding: 10px var(--s-5);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.term-body {
  padding: var(--s-5);
  overflow-x: auto;
}

.term-body pre {
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.85;
  white-space: pre;
}

.term-body code { color: inherit; }

.term .cmd::before {
  content: "$ ";
  color: var(--accent);
}

.term .cmt { color: var(--muted); }

/* Annotated command list - each real command with what it does. */
.cmd-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  list-style: none;
  overflow: hidden;
}

.cmd-list li {
  display: grid;
  gap: 6px;
  padding: var(--s-4) var(--s-5);
  background: #0d1117;
}

.cmd-list code {
  font-size: 0.84rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.cmd-list span {
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.45;
}

/* Inline code in prose */
.band p code,
p code,
li code,
td code,
dd code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.87em;
  overflow-wrap: anywhere;
}

.band p code,
.band li code,
.band td code,
.band dd code {
  border-color: var(--band-line);
  background: rgba(16, 23, 32, 0.05);
}

/* Mono chips - short literal tokens (platform names, formats, flags). */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.band .chips li {
  border-color: var(--band-line);
  background: var(--band-2);
}

/* --- Tables --------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.band .table-scroll { border-color: var(--band-line); }

table.data {
  width: 100%;
  min-width: 560px;
  font-size: 0.94rem;
  text-align: left;
}

table.data caption {
  padding: var(--s-4) var(--s-5) 0;
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: left;
}

.band table.data caption { color: var(--band-muted); }

table.data th,
table.data td {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.band table.data th,
.band table.data td { border-bottom-color: var(--band-line); }

table.data thead th {
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.band table.data thead th {
  background: rgba(16, 23, 32, 0.045);
  color: var(--band-ink);
}

table.data tbody tr:last-child th,
table.data tbody tr:last-child td { border-bottom: 0; }

table.data td { color: var(--muted); }
.band table.data td { color: var(--band-muted); }

table.data tbody th {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.band table.data tbody th { color: var(--band-ink); }

table.data tbody th code { white-space: nowrap; }

/* --- Grouped index list (module index shape) ------------------------------ */

.index-group { margin-bottom: var(--s-8); }
.index-group:last-child { margin-bottom: 0; }

.index-group > h2,
.index-group > h3 {
  padding-bottom: var(--s-3);
  margin-bottom: 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: var(--fs-micro);
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.band .index-group > h2,
.band .index-group > h3 { border-bottom-color: var(--band-line); color: var(--band-muted); }

.index-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.index-list > li { border-bottom: 1px solid var(--line); }
.band .index-list > li { border-bottom-color: var(--band-line); }

.index-row {
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) minmax(0, 1.6fr) auto;
  align-items: baseline;
  gap: var(--s-5);
  padding: var(--s-5) 0;
}

.index-row .index-name {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0;
  font-size: 1.06rem;
}

.index-row .index-tag {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.band .index-row .index-tag { color: var(--band-muted); }

a.index-row:hover .index-name { color: var(--accent); }
.band a.index-row:hover .index-name { color: var(--band-accent); }

.index-row .go { font-size: 0.9rem; white-space: nowrap; }

.index-row--static { cursor: default; }

/* --- Definition list panels ----------------------------------------------- */

.fields {
  display: grid;
  gap: 0;
  margin: 0;
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.band .fields { border-color: var(--band-line); background: var(--band-2); }

.fields > div {
  display: grid;
  grid-template-columns: minmax(140px, 0.5fr) minmax(0, 1fr);
  gap: var(--s-4);
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--line);
}

.band .fields > div { border-bottom-color: var(--band-line); }

.fields > div:last-child { border-bottom: 0; }

.fields dt {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.band .fields dt { color: var(--band-accent); }

.fields dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.band .fields dd { color: var(--band-muted); }

/* --- Two-column honest status list ---------------------------------------- */

.ledger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ledger > div {
  padding: clamp(24px, 3.4vw, 40px);
  background: var(--bg);
}

.band .ledger { background: var(--band-line); border-color: var(--band-line); }
.band .ledger > div { background: var(--band-2); }

.ledger h3 {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ticks,
.opens {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.94rem;
}

.ticks li,
.opens li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: var(--s-3);
  color: var(--muted);
}

.band .ticks li,
.band .opens li { color: var(--band-muted); }

.ticks li::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.band .ticks li::before { background: var(--band-accent); }

.opens li::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: 0.6;
}

/* --- Comparison grid (three columns of literal rules) --------------------- */

.compare {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.compare > div {
  display: grid;
  align-content: start;
  gap: var(--s-4);
  padding: clamp(20px, 2.8vw, 30px);
  background: var(--bg);
}

.band .compare { background: var(--band-line); border-color: var(--band-line); }
.band .compare > div { background: var(--band-2); }

.compare h3 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--accent);
}

.band .compare h3 { color: var(--band-accent); }

.compare p { margin: 0; color: var(--muted); font-size: var(--fs-small); }
.band .compare p { color: var(--band-muted); }

.globs {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.band .globs { color: var(--band-ink); }

/* --- Numbered process rail (roadmap phases) ------------------------------- */

.rail {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: phase;
}

.rail > li {
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  padding-block: var(--s-7);
  border-top: 1px solid var(--line);
}

.band .rail > li { border-top-color: var(--band-line); }

.rail > li:last-child { border-bottom: 1px solid var(--line); }
.band .rail > li:last-child { border-bottom-color: var(--band-line); }

.rail-mark {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.band .rail-mark { color: var(--band-accent); }

.rail h3 { margin-bottom: var(--s-3); font-size: clamp(1.2rem, 2vw, 1.55rem); }

.rail-goal { color: var(--muted); margin-bottom: var(--s-5); }
.band .rail-goal { color: var(--band-muted); }

.rail ul {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.rail ul li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: var(--s-3);
  color: var(--muted);
  font-size: 0.94rem;
}

.band .rail ul li { color: var(--band-muted); }

.rail ul li::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 9px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

/* --- Log noise vs recorded fields (before/after pair) --------------------- */

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pair > figure {
  margin: 0;
  padding: 0;
  background: #0d1117;
}

.pair figcaption {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pair-body { padding: var(--s-5); overflow-x: auto; }

.pair-body pre {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.9;
  white-space: pre;
}

.pair-body .fields {
  padding: 0;
  border: 0;
  background: transparent;
}

/* --- Diagram wrappers ----------------------------------------------------- */

.figure {
  margin: 0;
  padding: clamp(20px, 3.4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.band .figure { border-color: var(--band-line); background: var(--band-2); }

.figure > svg { width: 100%; height: auto; }

.figure figcaption {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-small);
}

.band .figure figcaption { border-top-color: var(--band-line); color: var(--band-muted); }

/* SVG theming hooks */
.dg-box { fill: rgba(255, 255, 255, 0.04); stroke: var(--line-strong); }
.dg-box-accent { fill: rgba(88, 166, 255, 0.1); stroke: var(--accent); }
.dg-line { stroke: var(--line-strong); }
.dg-line-accent { stroke: var(--accent); }
.dg-title { fill: var(--text); font-family: var(--sans); font-size: 15px; font-weight: 700; }
.dg-sub { fill: var(--muted); font-family: var(--sans); font-size: 12.5px; }
.dg-mono { fill: var(--text); font-family: var(--mono); font-size: 12.5px; }
.dg-mono-dim { fill: var(--muted); font-family: var(--mono); font-size: 12px; }
.dg-num { fill: var(--accent); font-family: var(--mono); font-size: 12px; }

.band .dg-box { fill: rgba(16, 23, 32, 0.035); stroke: rgba(16, 23, 32, 0.24); }
.band .dg-box-accent { fill: rgba(10, 102, 208, 0.08); stroke: var(--band-accent); }
.band .dg-line { stroke: rgba(16, 23, 32, 0.28); }
.band .dg-line-accent { stroke: var(--band-accent); }
.band .dg-title { fill: var(--band-ink); }
.band .dg-sub { fill: var(--band-muted); }
.band .dg-mono { fill: var(--band-ink); }
.band .dg-mono-dim { fill: var(--band-muted); }
.band .dg-num { fill: var(--band-accent); }

/* CSS flow chain - the build report kernel */
.chain {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: link;
}

.chain > li {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-right: var(--s-3);
}

.chain > li::after {
  content: "\2192";
  color: var(--muted);
  font-size: 1rem;
}

.band .chain > li::after { color: var(--band-muted); }

.chain > li:last-child::after { content: none; }

.chain-node {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}

.band .chain-node { border-color: var(--band-line); background: var(--band-2); }

.chain-node b {
  counter-increment: link;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.chain-node b::before { content: counter(link) "."; }

.band .chain-node b { color: var(--band-accent); }

/* Stepped ladder - connected mode levels */
.ladder {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ladder > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.band .ladder > li { border-color: var(--band-line); background: var(--band-2); }

.ladder > li:nth-child(1) { margin-right: clamp(0px, 9vw, 150px); }
.ladder > li:nth-child(2) { margin-right: clamp(0px, 6vw, 100px); }
.ladder > li:nth-child(3) { margin-right: clamp(0px, 3vw, 50px); }
.ladder > li:nth-child(4) { border-color: var(--accent); }
.band .ladder > li:nth-child(4) { border-color: var(--band-accent); }

.ladder-step {
  flex: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.band .ladder-step { color: var(--band-accent); }

.ladder-name { font-weight: 700; }
.ladder-note { color: var(--muted); font-size: var(--fs-small); }
.band .ladder-note { color: var(--band-muted); }

/* --- Callout -------------------------------------------------------------- */

.callout {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.band .callout {
  border-color: var(--band-line);
  border-left-color: var(--band-accent);
  background: var(--band-2);
}

.callout p { color: var(--muted); }
.band .callout p { color: var(--band-muted); }
.callout p:first-child { color: var(--text); font-weight: 700; }
.band .callout p:first-child { color: var(--band-ink); }

/* --- Image panel ---------------------------------------------------------- */

.image-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.image-panel img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
}

/* --- Contact channel list ------------------------------------------------- */

.channels {
  display: grid;
  gap: var(--s-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.channels a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 140ms ease, background-color 140ms ease;
}

.channels a:hover { border-color: var(--line-strong); background: var(--surface-2); }

.channels strong { display: block; }

.channels span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
}

.channels a::after {
  content: "\2192";
  color: var(--accent);
}

/* --- Closing CTA band ----------------------------------------------------- */

.cta {
  padding-block: clamp(64px, 8vw, 108px);
  border-top: 1px solid var(--line);
  background: var(--bg-raise);
  text-align: center;
}

.cta h2 { margin-inline: auto; max-width: 22ch; }
.cta p { margin-inline: auto; max-width: 56ch; color: var(--muted); }
.cta .actions { justify-content: center; }

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

.site-footer {
  padding-block: var(--s-8) var(--s-6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-small);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: var(--s-7);
  padding-bottom: var(--s-7);
}

.footer-grid h2 {
  margin-bottom: var(--s-4);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.footer-grid ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid a:hover { color: var(--text); }

.footer-brand .brand { margin-bottom: var(--s-4); color: var(--text); }
.footer-brand p { max-width: 34ch; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}

.footer-legal p { margin: 0; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1040px) {
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  /* Nav is expanded by default so the page works with JavaScript disabled.
     The inline script adds .js to the header, which enables the collapse. */
  .site-header {
    position: static;
    flex-wrap: wrap;
    align-items: center;
    row-gap: var(--s-3);
  }

  .primary-nav,
  .nav-actions {
    width: 100%;
    display: grid;
    gap: var(--s-2);
    margin-left: 0;
    font-size: 1rem;
  }

  .primary-nav { order: 3; }
  .nav-actions { order: 4; padding-bottom: var(--s-2); }

  .primary-nav > a,
  .nav-trigger,
  .nav-actions > a:not(.button) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
  }

  .nav-group { width: 100%; }

  .nav-menu {
    position: static;
    width: 100%;
    margin-top: var(--s-2);
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }

  .site-header.js .nav-toggle { display: inline-flex; }
  .site-header.js .primary-nav,
  .site-header.js .nav-actions { display: none; }
  .site-header.js.nav-open .primary-nav,
  .site-header.js.nav-open .nav-actions { display: grid; }

  .split,
  .split--even,
  .split--copy-right,
  .strip,
  .facts,
  .ledger,
  .compare,
  .pair,
  .rail > li,
  .footer-grid,
  .index-row { grid-template-columns: minmax(0, 1fr); }

  .split-sticky { position: static; }

  .index-row { gap: var(--s-3); }
  .index-row .go { justify-self: start; }

  .hero { min-height: 0; padding-block: var(--s-8) var(--s-8); }

  .ladder > li:nth-child(1),
  .ladder > li:nth-child(2),
  .ladder > li:nth-child(3) { margin-right: 0; }

  .fields > div { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }

  .image-panel img { min-height: 260px; }
}

@media (max-width: 560px) {
  .strip { gap: var(--s-6); }
  .actions { display: grid; }
  .actions .button { width: 100%; }
  .facts > div { padding: var(--s-5); }
}

@media print {
  .site-header, .cta, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
}

/* Compact two-up rail. A six or eight item rail is unreadable as one tall
   column, so above 62rem it becomes a matrix while keeping the numbering and
   the hairline rules. Single column below that, unchanged. */
@media (min-width: 62rem) {
  .rail--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(32px, 4vw, 72px);
    align-items: start;
    border-bottom: 1px solid var(--line);
  }
  .band .rail--grid { border-bottom-color: var(--band-line); }
  .rail--grid > li {
    grid-template-columns: minmax(0, 2.6rem) minmax(0, 1fr);
    gap: var(--s-4);
    padding-block: var(--s-6);
  }
  .rail--grid > li:last-child,
  .rail--grid > li:nth-last-child(2) { border-bottom: 0; }
}

/* Simplified footer, identical in structure across all three sites: one brand
   row, one wrapping link row, one legal line. Replaced three different
   multi-column layouts that repeated the same links under different headings. */
.footer-simple {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 36px);
}

.footer-simple__nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 1.6vw, 26px);
  font-size: 0.92rem;
}

.footer-simple__legal {
  margin: clamp(22px, 3vw, 34px) 0 0;
  padding-top: clamp(16px, 2vw, 24px);
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--muted);
}
