/* moonzero — a control plane for a service framework.
   Two lights: the shell is always dark (it is the machine), the reading surface
   is paper by day and lifted ink by night. Signal colours never change, because
   the topology is always drawn on the dark screen. */

:root {
  --shell: #0c1116;
  --shell-2: #131a21;
  --shell-3: #0f151c;
  --shell-4: #1a2330;
  --shell-dot: #3a4650;
  --shell-ink: #c9d3db;
  --shell-ink-2: #7c8b99;
  --shell-ink-3: #55636f;
  --shell-ink-bright: #eef2f5;
  --shell-rule: #1c252e;
  --shell-rule-2: #2a3742;
  --accent: #6d5efc;
  --accent-ink: #d9d4ff;
  --accent-deep: #1a1636;
  --ok: #3ddc97;
  --warn: #f5b759;
  --fail: #ff5c5c;
  --egress-line: #2f5a4c;
  --egress-deep: #0f1a18;
  --egress-ink: #8fe3c0;
  --warn-line: #6a5230;
  --warn-deep: #1a1710;
  --code-bg: #0a0e13;
  --code-ink: #c9d3db;
  --code-dim: #6b7a87;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --grotesk: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --page-max: 1440px;
  --gutter: 40px;
  --bar-h: 44px;
  --rail-h: 64px;
  --radius: 3px;
  --radius-lg: 4px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --fast: 0.15s;
  --base: 0.22s;
  color-scheme: light;
}

/* Day is the default so a page with no resolved theme still renders; the script
   in <head> only ever sets day or night on top of this. */
:root,
:root[data-theme="day"] {
  --page: #efede6;
  --paper: #fbfaf7;
  --paper-2: #ffffff;
  --ink: #14181c;
  --ink-2: #5a646e;
  --ink-3: #8a9299;
  --rule: #e3e0d8;
  --rule-2: #cfcabf;
  --shadow: none;
}

:root[data-theme="night"] {
  --page: #0a0e13;
  --paper: #12181f;
  --paper-2: #161d26;
  --ink: #e7eaee;
  --ink-2: #aeb8c2;
  --ink-3: #7c8b99;
  --rule: #202a35;
  --rule-2: #2e3c49;
  --shadow: none;
  --accent: #8b7eff;
  color-scheme: dark;
}

/* Before the head script runs — or if it cannot run at all — the system decides. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --page: #0a0e13;
    --paper: #12181f;
    --paper-2: #161d26;
    --ink: #e7eaee;
    --ink-2: #aeb8c2;
    --ink-3: #7c8b99;
    --rule: #202a35;
    --rule-2: #2e3c49;
    --shadow: none;
    --accent: #8b7eff;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  font-variant-ligatures: no-contextual;
  background: var(--page);
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

/* A control is not text. Rather than naming every decorative surface — and
   missing one every time a new chip or readout is added — selection is refused
   at the root and handed back only to the things a reader might want to quote. */

html {
  -webkit-user-select: none;
  user-select: none;
}

/* The allow-list stays at zero specificity (:where) so a decorative label can
   always be switched back off by name below without a specificity fight. */
:where(.paper) :where(p, li, h1, h2, h3, h4, dt, dd, blockquote, pre, code, table, th, td),
:where(.hero) :where(h1, p),
:where(.section-head) :where(h1, h2, p),
:where(.document, .signals) :where(dt, dd, p, h2, h3, code),
.lab-note,
.bench .src,
.bench .out,
.install code,
.code pre {
  -webkit-user-select: text;
  user-select: text;
}

/* Small caps that name a region, not prose: never a quote target. */
.eyebrow,
.section-label,
.signals .label,
.code .cap,
.api .kind {
  -webkit-user-select: none;
  user-select: none;
}

/* Long-press menus belong to the machine, not to the prose. */
.bar,
.rail,
.minimap,
.screen,
.path,
.tiles,
.pager,
.palette {
  -webkit-touch-callout: none;
}

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

::selection {
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  color: inherit;
}

.screen ::selection,
.code ::selection,
.bench .out ::selection {
  background: color-mix(in srgb, var(--accent-ink) 28%, transparent);
  color: #fff;
}

h1,
h2,
h3,
h4,
button,
input,
select,
textarea {
  font-variant-ligatures: no-contextual;
}

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

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

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

/* ---------- scrollbars: webkit first, standard only where it does not fight it ---------- */

@supports selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: auto;
  }

  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    border-radius: 99px;
    border: 3px solid transparent;
    background-clip: content-box;
    background-color: color-mix(in srgb, var(--ink) 22%, transparent);
  }

  .screen ::-webkit-scrollbar-thumb,
  .code ::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, #c9d3db 22%, transparent);
  }

  /* The station strip scrolls sideways on a narrow screen, and a bar under it would
     be a second underline for the same thing. */
  .rail::-webkit-scrollbar {
    height: 0;
  }
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ink) 26%, transparent) transparent;
  }

  .rail {
    scrollbar-width: none;
  }
}

/* ---------- shell: the status bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--bar-h);
  background: var(--shell);
  border-bottom: 1px solid var(--shell-rule);
  color: var(--shell-ink);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  font-family: var(--mono);
  font-size: 11px;
  box-shadow: 0 1px 0 color-mix(in srgb, #ffffff 5%, transparent);
}

.bar a {
  color: inherit;
}

.bar .mark {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--shell-ink-bright);
}

.bar .mode {
  color: var(--shell-ink-3);
}

.bar .facts {
  margin-left: 24px;
  color: var(--shell-ink-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar .spacer {
  flex: 1;
}

.bar .pages {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bar .pages a {
  color: var(--shell-ink-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
}

.bar .pages a:hover {
  color: var(--shell-ink-bright);
}

.bar .crumb {
  color: var(--shell-ink-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar .crumb b {
  color: var(--shell-ink);
  font-weight: 500;
}

.theme {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 2px;
  border: 1px solid var(--shell-rule-2);
  border-radius: var(--radius-pill);
  background: var(--shell-2);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--shell-ink-2);
  flex: none;
  transition: border-color var(--fast) var(--ease);
}

.theme:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--shell-rule-2));
}

.theme span {
  position: relative;
  z-index: 1;
  padding: 0 9px;
  line-height: 18px;
  border-radius: var(--radius-pill);
  transition: color var(--fast) var(--ease);
}

.theme span[aria-current="true"] {
  background: var(--shell-ink-bright);
  color: var(--shell);
  font-weight: 500;
}

.theme:hover span[aria-current="true"] {
  background: #fff;
}

.kbd {
  border: 1px solid var(--shell-rule-2);
  border-radius: var(--radius);
  padding: 1px 5px;
  color: var(--shell-ink-2);
  font-size: 10px;
  background: transparent;
}

.bar button.plain {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.bar button.plain:hover {
  color: var(--shell-ink-bright);
}

@media (width <= 860px) {
  .bar .facts,
  .bar .mode,
  .bar .crumb {
    display: none;
  }

  .bar {
    gap: 10px;
    padding: 0 var(--gutter);
  }

  .bar .mark {
    margin-right: auto;
  }
}

@media (width <= 560px) {
  .bar {
    gap: 8px;
  }

  .bar .pages {
    gap: 8px;
  }

  .bar .pages a {
    font-size: 9px;
    letter-spacing: 0.02em;
  }

  .theme {
    font-size: 9px;
  }
}

/* ---------- the request rail ---------- */

.rail {
  position: sticky;
  top: var(--bar-h);
  z-index: 30;
  height: var(--rail-h);
  background: var(--shell);
  border-bottom: 1px solid var(--shell-rule);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 1px 0 color-mix(in srgb, #ffffff 4%, transparent);
}

.rail ol {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin: 0;
  padding: 22px var(--gutter) 0;
  list-style: none;
  min-width: max-content;
  width: 100%;
}

.rail ol::before {
  content: "";
  position: absolute;
  left: calc(var(--gutter) + 4px);
  right: var(--gutter);
  top: 31px;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--shell-rule-2),
    color-mix(in srgb, var(--shell-rule-2) 35%, transparent)
  );
}

.rail li {
  position: relative;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--shell-ink-3);
  padding-top: 22px;
  transition: color var(--fast) var(--ease);
}

.rail li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--shell-dot);
  transition: background var(--fast) var(--ease);
}

.rail li:not(.here):hover {
  color: var(--shell-ink);
}

.rail li:not(.here):hover::before {
  background: var(--shell-ink-2);
}

.rail li.here {
  color: var(--accent-ink);
  font-weight: 500;
}

.rail li.here::before {
  left: -3px;
  top: 2px;
  width: 15px;
  height: 15px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.rail li a {
  display: block;
  margin-top: -22px;
  padding-top: 22px;
}

/* ---------- page shell ---------- */

.shell {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px var(--gutter) 72px;
  display: grid;
  min-width: 0;
  grid-template-columns: 232px minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.shell.home {
  grid-template-columns: minmax(0, 1fr);
  padding: 0 0 0;
  max-width: none;
}

/* one column, one measure: reference, guide, lab, skills, 404 */
.shell.single {
  grid-template-columns: minmax(0, 1fr);
  padding-top: 32px;
}

.shell.single > .paper {
  padding: 40px 44px;
}

.shell.single > .paper + * {
  margin-top: 24px;
}

.shell.error {
  padding-top: 72px;
  padding-bottom: 96px;
}

.shell.error .paper {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- minimap ---------- */

.minimap {
  position: sticky;
  top: calc(var(--bar-h) + var(--rail-h) + 24px);
  background: var(--shell-3);
  border: 1px solid var(--shell-rule);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: var(--shell-ink-2);
  font-family: var(--mono);
  font-size: 10px;
}

.minimap .label {
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--shell-ink-3);
  margin: 0 0 14px;
}

.minimap .lane {
  margin-bottom: 16px;
}

.minimap .lane-name {
  display: flex;
  justify-content: space-between;
}

.minimap .lane-shut,
.minimap .lane.shut {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 8px;
  margin: 0 -8px;
  border-top: 1px solid var(--shell-rule);
  border-radius: 2px;
  color: var(--shell-ink-3);
  font-size: 8px;
  letter-spacing: 0.12em;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.minimap .lane.shut b {
  font-weight: 500;
  color: var(--shell-ink-2);
}

.minimap .lane.shut:hover,
.minimap .lane.shut:hover b {
  color: var(--accent-ink);
}

.minimap .lane.shut:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.minimap .lane.open .lane-name {
  color: var(--accent);
}

.minimap .lane-name {
  font-size: 7px;
  letter-spacing: 0.12em;
  color: var(--shell-ink-3);
  margin-bottom: 6px;
}

.minimap .nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.minimap .node {
  height: 18px;
  border: 1px solid var(--shell-rule-2);
  border-radius: 2px;
  background: var(--shell-4);
  padding: 0 6px;
  line-height: 16px;
  font-size: 8px;
  color: var(--shell-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
    background var(--fast) var(--ease);
}

.minimap .node:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.minimap .node.here {
  background: var(--accent-deep);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.minimap .toc {
  margin-top: 22px;
  border-top: 1px solid var(--shell-rule);
  padding-top: 14px;
}

.minimap .toc p {
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--shell-ink-3);
  margin: 0 0 10px;
}

.minimap .toc a {
  display: block;
  color: var(--shell-ink-2);
  padding: 4px 0 4px 10px;
  border-left: 2px solid transparent;
  font-size: 11px;
}

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

.minimap .toc a.active {
  color: var(--accent-ink);
  border-left-color: var(--accent);
}

/* ---------- paper ---------- */

.paper {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 40px;
  min-width: 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 14px;
  text-transform: uppercase;
}

.paper h1 {
  font-family: var(--grotesk);
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 18px;
}

.paper h2 {
  font-family: var(--grotesk);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
}

.lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 8px;
  max-width: 62ch;
}

.section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin: 40px 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* flow: where the package sits */

.flow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
}

.flow .node {
  padding: 8px 14px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  color: var(--ink-2);
  background: var(--paper-2);
}

.flow .node.here {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--paper));
  color: var(--accent);
  font-weight: 500;
}

.flow .arrow {
  width: 24px;
  height: 1px;
  background: var(--rule-2);
  position: relative;
}

.flow .arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 5px;
  height: 5px;
  border-top: 1px solid var(--rule-2);
  border-right: 1px solid var(--rule-2);
  transform: rotate(45deg);
}

/* api table */

.api {
  margin: 0;
}

.api .row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 8px 32px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}

.api .row:first-child {
  border-top: 1px solid var(--rule-2);
}

.api .sig {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
  display: block;
}

.api .sig .k {
  color: var(--accent);
}

.api .sig .ty {
  color: var(--ink);
  font-weight: 500;
}

.api .sig .op {
  color: var(--ink-3);
}

.api .doc {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.api .kind {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-right: 8px;
}

@media (width <= 720px) {
  .api .row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .bench .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bench .controls .control:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .screen .head,
  .screen .scene {
    padding: 12px 16px;
  }

  .screen .lane {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    gap: 8px;
    padding: 14px 16px;
  }

  .screen .lane + .lane {
    border-top: 1px solid var(--shell-rule);
  }

  .screen .chip {
    height: 28px;
    padding: 0 10px;
    font-size: 9px;
  }

  .screen .readouts {
    padding: 12px 16px 16px;
  }

  .screen .scene .hint {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* code */

.code {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--shell-rule);
  border-radius: var(--radius);
  margin: 0 0 8px;
  overflow: hidden;
}

.code pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--code-ink);
  tab-size: 2;
}

.code .cap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--shell-rule);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--shell-ink-3);
  text-transform: uppercase;
}

.code .copy {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--shell-ink-3);
  font: inherit;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 2px 0;
  min-width: 8ch;
  text-align: right;
  transition: color var(--fast) var(--ease);
}

.code .copy:hover {
  color: var(--accent-ink);
}

.code .k {
  color: color-mix(in srgb, var(--accent) 55%, #ffffff);
}

.code .s {
  color: color-mix(in srgb, var(--ok) 60%, #ffffff);
}

.code .c {
  color: var(--code-dim);
}

/* pager */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
}

.pager a {
  color: var(--ink-2);
  transition: color var(--fast) var(--ease);
}

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

.pager .next {
  margin-left: auto;
  text-align: right;
}

/* ---------- signals (spec column) ---------- */

.signals {
  position: sticky;
  top: calc(var(--bar-h) + var(--rail-h) + 24px);
  font-family: var(--mono);
  font-size: 11px;
  min-width: 0;
}

.signals .label {
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  margin: 0 0 12px;
}

.signals dl {
  margin: 0;
}

.signals .pair {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: baseline;
}

.signals dt {
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.signals dd {
  margin: 0;
  color: var(--accent);
  text-align: right;
  flex: none;
}

.signals .block {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.signals .block p {
  margin: 0 0 6px;
  color: var(--ink-3);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.signals .note {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 18px 0 0;
}

/* ---------- footer ---------- */

.foot {
  background: var(--shell);
  border-top: 1px solid var(--shell-rule);
  color: var(--shell-ink-3);
  font-family: var(--mono);
  font-size: 10px;
  padding: 26px var(--gutter);
  display: flex;
  gap: 24px;
  align-items: baseline;
  flex-wrap: wrap;
}

.foot .links {
  margin-left: auto;
  display: flex;
  gap: 22px;
  color: var(--shell-ink);
}

.foot .repo {
  color: var(--shell-ink-2);
}

.foot a:hover {
  color: var(--shell-ink-bright);
}

/* ---------- home ---------- */

.hero {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 52px var(--gutter) 0;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.hero .eyebrow {
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--grotesk);
  font-size: clamp(48px, 6vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 0 0 20px;
}

.hero .lead {
  font-size: 19px;
  line-height: 1.6;
  max-width: 34ch;
}

.install {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--shell);
  border: 1px solid var(--shell-rule);
  border-radius: var(--radius);
  padding: 15px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--shell-ink);
  margin: 28px 0 16px;
  overflow: hidden;
}

.install code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install .copy {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--shell-ink-3);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  flex: none;
  min-width: 8ch;
  text-align: right;
  transition: color var(--fast) var(--ease);
}

.install .copy:hover {
  color: var(--accent-ink);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--rule-2);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.btn:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn.primary:hover {
  background: #000;
  color: var(--paper);
}

.btn:active {
  transform: translateY(0.5px);
}

:root[data-theme="night"] .btn.primary {
  background: #e7eaee;
  border-color: #e7eaee;
  color: #0a0e13;
}

:root[data-theme="night"] .btn.primary:hover {
  background: #fff;
  border-color: #fff;
  color: #0a0e13;
}

.hero .meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 20px;
}

/* the screen */

.screen {
  background: var(--shell);
  border: 1px solid var(--shell-rule);
  border-radius: var(--radius-lg);
  color: var(--shell-ink);
  font-family: var(--mono);
  overflow: hidden;
}

/* at night the page and the machine share a colour; the edge has to carry it */
:root[data-theme="night"] .screen,
:root[data-theme="night"] .install {
  border-color: color-mix(in srgb, #ffffff 7%, var(--shell-rule));
}

.screen .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--shell-rule);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--shell-ink-3);
}

.screen .head .state {
  color: var(--ok);
  letter-spacing: 0.04em;
}

.screen .lane {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 0 20px;
  height: 72px;
}

.screen .lane-name {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--shell-ink-3);
}

.screen .chain {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.screen .chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--shell-rule-2);
  border-radius: var(--radius);
  background: var(--shell-2);
  color: var(--shell-ink);
  font-size: 10px;
  white-space: nowrap;
  transition: border-color var(--base) var(--ease), background var(--base) var(--ease),
    color var(--base) var(--ease);
}

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

.screen .chip.hot {
  border-color: var(--accent);
  background: var(--accent-deep);
  color: var(--accent-ink);
}

.screen .chip.egress {
  border-color: var(--egress-line);
  background: var(--egress-deep);
  color: var(--egress-ink);
}

.screen .chip.warn {
  border-color: var(--warn-line);
  background: var(--warn-deep);
  color: var(--warn);
}

.screen .link {
  width: 6px;
  height: 1px;
  background: var(--shell-dot);
  flex: none;
}

.screen .body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
}

.screen .body .lanes {
  border-right: 1px solid var(--shell-rule);
}

.screen .readouts {
  padding: 8px 20px 16px;
}

.screen .readout + .readout {
  margin-top: 18px;
}

.screen .readout .k {
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--shell-ink-3);
  display: block;
  margin-bottom: 2px;
}

.screen .readout .v {
  font-size: 24px;
  font-weight: 300;
  color: var(--shell-ink-bright);
  font-variant-numeric: tabular-nums;
}

.screen .readout .v.ok {
  color: var(--ok);
}

.screen .readout .v.warn {
  color: var(--warn);
}

.screen .scene {
  border-top: 1px solid var(--shell-rule);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 10px;
  flex-wrap: wrap;
}

.screen .scene .pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--shell-rule);
  background: transparent;
  color: var(--shell-ink-2);
  font: inherit;
  cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
    background var(--fast) var(--ease);
}

.screen .scene .pick:hover {
  color: var(--shell-ink);
  border-color: var(--shell-rule-2);
}

.screen .scene .pick:active {
  background: var(--shell-2);
}

.screen .scene .pick::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--shell-dot);
}

.screen .scene .pick[aria-pressed="true"] {
  background: var(--shell-2);
  border-color: var(--shell-rule-2);
  color: var(--shell-ink);
}

.screen .scene .pick[aria-pressed="true"]::before {
  background: var(--ok);
  border-color: var(--ok);
}

.screen .scene .pick[aria-pressed="true"].bad::before {
  background: var(--warn);
  border-color: var(--warn);
}

.screen .scene .hint {
  margin-left: auto;
  color: var(--shell-ink-3);
  font-size: 9px;
}

.trace {
  background: var(--shell);
  border-top: 1px solid var(--shell-rule);
  border-bottom: 1px solid var(--shell-rule);
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 var(--gutter);
  height: 40px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--shell-ink);
  overflow: hidden;
  white-space: nowrap;
}

.trace .tag {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--shell-ink-3);
  flex: none;
}

.trace .line {
  overflow: hidden;
  text-overflow: ellipsis;
}

.trace .right {
  margin-left: auto;
  color: var(--shell-ink-3);
  font-size: 9px;
  flex: none;
}

.section {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 64px var(--gutter) 0;
}

/* sections that follow a card share the card's inner edge, so one column has one baseline */
.section.inset {
  padding-left: calc(var(--gutter) + 44px);
  padding-right: calc(var(--gutter) + 44px);
}

.section-head {
  margin-bottom: 34px;
}

.section-head .eyebrow {
  margin-bottom: 10px;
}

.section-head h2 {
  font-family: var(--grotesk);
  font-size: clamp(26px, 3vw, 32px);
  letter-spacing: -0.01em;
  font-weight: 500;
  margin: 0 0 8px;
}

.section-head p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
  max-width: 70ch;
}

/* path */

.path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  padding-top: 44px;
}

.path::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 5px;
  height: 1px;
  background: var(--rule-2);
}

.path .stop {
  position: relative;
  padding-top: 26px;
}

.path .stop::before {
  content: "";
  position: absolute;
  left: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--page);
}

.path .stop:first-child::before {
  background: var(--ink);
}

.path .stop .n {
  position: absolute;
  top: -34px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}

.path .card {
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 14px;
  min-height: 76px;
}

.path .card:hover {
  border-color: var(--rule-2);
}

.path .card b {
  display: block;
  font-family: var(--grotesk);
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 2px;
}

.path .card span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
  display: block;
  line-height: 1.5;
}

.path .card.end {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.path .card.end span {
  color: color-mix(in srgb, var(--paper) 70%, transparent);
}

/* tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tile {
  display: block;
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  padding: 20px 22px 46px;
  min-height: 164px;
  overflow: hidden;
}

.tile:hover {
  border-color: var(--rule-2);
  color: inherit;
}

.tile .idx {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
}

.tile h3 {
  font-family: var(--grotesk);
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 8px;
}

.tile p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34ch;
}

.tile .figure {
  position: absolute;
  right: 22px;
  bottom: 14px;
  text-align: right;
  font-family: var(--mono);
  font-weight: 300;
  color: var(--rule-2);
  line-height: 1;
}

.tile .figure b {
  display: block;
  font-size: 26px;
  font-weight: 300;
}

.tile .figure small {
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

/* document section */

.document {
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.document .keys {
  font-family: var(--mono);
  font-size: 12px;
}

.document .keys .lead-row {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 18px;
}

.document .keys dt {
  color: var(--ink);
  font-weight: 500;
  margin-top: 20px;
}

.document .keys dd {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* ---------- guide ---------- */

.steps {
  counter-reset: step;
}

.step {
  position: relative;
  padding: 0 0 44px 52px;
  border-left: 1px solid var(--rule);
  margin-left: 10px;
}

.step:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -15px;
  top: -6px;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--rule-2);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
}

.step h2 {
  font-family: var(--grotesk);
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.step p {
  margin: 0 0 16px;
  color: var(--ink-2);
  max-width: 62ch;
}

.step .cmd {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  margin: 0 0 12px;
}

.step .cmd b {
  color: var(--ink-2);
  font-weight: 400;
}

/* ---------- lab ---------- */

.lab {
  display: grid;
  gap: 24px;
}

.bench {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper);
  padding: 36px 44px 32px;
}

.bench h2 {
  font-family: var(--grotesk);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 6px;
}

.bench .src {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  margin: 0 0 20px;
}

.bench .controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 26px;
  margin-bottom: 22px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
}

.bench .control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 150px;
}

.bench .control output {
  color: var(--accent);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  margin: 0;
  height: 2px;
  background: var(--rule-2);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}

.bench .out {
  margin-top: 18px;
  background: var(--shell);
  border: 1px solid var(--shell-rule);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--shell-ink);
  white-space: pre-wrap;
  line-height: 1.8;
  overflow-x: auto;
}

.bench .out .ok {
  color: var(--ok);
}

.bench .out .warn {
  color: var(--warn);
}

.bench .out .dim {
  color: var(--shell-ink-3);
}

.bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  max-width: 520px;
  height: 108px;
  margin: 22px 0 0;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
}

.bars::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  height: 1px;
  background: var(--rule);
}

.bars .barwrap {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.bars .bar {
  width: 100%;
  max-width: 96px;
  border-radius: 1px 1px 0 0;
  min-height: 2px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  transition: height 0.25s ease;
}

.bars .bar.hi {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}

.lab-note {
  max-width: var(--page-max);
  margin: 20px auto 48px;
  padding: 0 calc(var(--gutter) + 44px);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* ---------- command palette ---------- */

.palette {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  padding-top: 12vh;
  background: color-mix(in srgb, #05080b 62%, transparent);
  backdrop-filter: blur(3px);
}

.palette[open] {
  display: block;
}

.palette .box {
  width: min(620px, calc(100vw - 32px));
  margin: 0 auto;
  background: var(--shell);
  border: 1px solid var(--shell-rule-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--mono);
}

.palette input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--shell-rule);
  color: var(--shell-ink);
  font: inherit;
  font-size: 13px;
  padding: 16px 18px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color var(--fast) var(--ease);
}

.palette input:focus {
  border-bottom-color: var(--accent);
}

.palette input::placeholder {
  color: var(--shell-ink-3);
}

.palette ul {
  margin: 0;
  padding: 8px;
  list-style: none;
  max-height: 46vh;
  overflow-y: auto;
}

.palette li a {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--shell-ink-2);
  font-size: 11px;
}

.palette li a b {
  color: var(--shell-ink);
  font-weight: 500;
}

.palette li a small {
  margin-left: auto;
  color: var(--shell-ink-3);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.palette li a[aria-selected="true"],
.palette li a:hover {
  background: var(--shell-2);
  color: var(--shell-ink);
}

/* ---------- responsive ---------- */

@media (width <= 1180px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .signals {
    grid-column: 1 / -1;
    position: static;
    border-top: 1px solid var(--rule);
    padding-top: 20px;
  }

  .signals dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 28px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .document {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (width <= 860px) {
  :root {
    --gutter: 20px;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 16px;
  }

  .shell.single,
  .shell.error {
    padding-top: 16px;
  }

  .minimap {
    position: static;
    display: none;
  }

  .paper {
    padding: 24px 20px 28px;
  }

  .shell.single > .paper {
    padding: 24px 20px 28px;
  }

  .lab-note {
    padding: 0 var(--gutter);
  }

  .section.inset {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  .bench {
    padding: 24px 20px 28px;
  }

  .path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0;
  }

  .path::before {
    display: none;
  }

  .path .stop {
    padding-top: 0;
  }

  .path .stop:last-child {
    grid-column: 1 / -1;
  }

  .path .stop::before {
    display: none;
  }

  .path .stop .n {
    position: static;
    display: block;
    margin-bottom: 6px;
  }

  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-top: 32px;
  }

  .screen .body {
    grid-template-columns: minmax(0, 1fr);
  }

  .screen .body .lanes {
    border-right: 0;
    border-bottom: 1px solid var(--shell-rule);
  }

  .screen .readouts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 16px;
  }

  .screen .readout + .readout {
    margin-top: 0;
  }

  .rail ol {
    gap: 56px;
  }

  .foot {
    flex-direction: column;
    gap: 12px;
  }

  .foot .links {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
