/* nib — a primer. One stylesheet, no scripts, no requests.

   THE PALETTE, and every colour in it has a job. There are three accents and
   they are not interchangeable:

     cobalt    #1c39c4  STRUCTURE  — the bar under the wordmark, the rule above
                                    each section, the section numeral, the left
                                    rail on every code block, the closing bar.
                                    One job: mark a boundary or a number.
     vermilion #b8340c  MARKS      — links/anchors and the caption diamond.
                                    Nothing else. If it is not a link or a
                                    caption mark, it is not this colour.
     mustard   #ffd44a  HIGHLIGHT  — the marker pen behind inline `code`, and
                                    the text selection. Nothing else.

   Everything else is paper and ink: a warm near-white ground, a slightly
   deeper warm panel for code, near-black text, two warm greys between them.
   The code panel has its own four inks (plum types, teal functions, green
   strings, amber literals) and they are used nowhere outside `pre.code` — a
   syntax palette is read, not decorated with.

   THE HERO BAND is the one exception, and it is a diagram rather than
   decoration: on its deep ground the three layers of the language each take
   one colour and keep it — modules cobalt (pure), effectors vermilion (the
   only mutation), the wire mustard (the one place a name meets its answer).
   Those three hero tints (--h-*) are used nowhere outside header.band.

   STATUS is monochrome on purpose: "shipped" is a filled cobalt pill (it marks
   a boundary: this much is true), "designed for" a dashed outline in the
   quietest grey. A plan must never look like a claim.

   DARK: every token is redefined under prefers-color-scheme: dark, the
   drawings' --t-* layer colours included, so the inline figures (which carry
   classes, never colours) change theme with the page. */

:root {
  /* neutrals — the page is carried by these */
  --paper: #fbf8f1;
  --panel: #f2ecdd;
  --line: #e3dac5;
  --ink: #17150f;
  --ink-2: #4c4739;
  --ink-3: #6d6757;

  /* accents — three, each with one job (see the header) */
  --cobalt: #1c39c4;
  --vermilion: #b8340c;
  --mustard: #ffd44a;

  /* the code panel's own inks. Nothing outside pre.code uses these. */
  --c-keyword: #1c39c4;
  --c-type: #6b2a86;
  --c-function: #0d635c;
  --c-string: #36601c;
  --c-literal: #8a5300;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono",
    "Roboto Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans", Arial, sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --lift: 0 1px 2px rgb(72 54 20 / 0.05), 0 7px 20px rgb(72 54 20 / 0.05);

  /* the marker pen, as two strengths */
  --pen-wash: rgb(255 212 74 / 0.3);
  --pen-line: rgb(255 212 74 / 0.85);
  --link-line: rgb(184 52 12 / 0.45);

  /* the hero band and the run panel: a deep ground in both themes */
  --band: #16134a;
  --band-ink: #fbf8f1;
  --band-ink-2: #c9c6e6;
  --h-core: #9fb0ff;
  --h-shell: #ff9a6b;
  --h-wire: #ffd44a;
  --run-bg: #1a1838;
  --run-ink: #ece9f7;

  --card: #fffdf7;

  /* the drawings' layer colours, readable on paper */
  --t-core: #1c39c4;
  --t-core-bg: rgb(28 57 196 / 0.06);
  --t-shell: #b8340c;
  --t-shell-bg: rgb(184 52 12 / 0.06);
  --t-wire: #946a00;
  --t-wire-bg: rgb(255 212 74 / 0.18);
  --t-bad: #b8340c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13121a;
    --panel: #1c1b26;
    --line: #2f2d3d;
    --ink: #eeeae0;
    --ink-2: #c6c0b1;
    --ink-3: #9d978a;

    --cobalt: #8ea2ff;
    --vermilion: #ff8f63;
    --mustard: #ffd44a;

    --c-keyword: #9fb0ff;
    --c-type: #d8a6f2;
    --c-function: #63d2c6;
    --c-string: #a9d987;
    --c-literal: #f2b663;

    --lift: 0 1px 2px rgb(0 0 0 / 0.3), 0 7px 20px rgb(0 0 0 / 0.25);
    --pen-wash: rgb(255 212 74 / 0.14);
    --pen-line: rgb(255 212 74 / 0.6);
    --link-line: rgb(255 143 99 / 0.5);

    --band: #1b1852;
    --run-bg: #0d0c17;
    --card: #1a1924;

    --t-core: #9fb0ff;
    --t-core-bg: rgb(159 176 255 / 0.1);
    --t-shell: #ff9a6b;
    --t-shell-bg: rgb(255 154 107 / 0.09);
    --t-wire: #ffd44a;
    --t-wire-bg: rgb(255 212 74 / 0.08);
    --t-bad: #ff9a6b;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.68;
  letter-spacing: 0.002em;
  padding: 0 1.4rem 6rem;
}

main,
header.hero,
footer {
  max-width: 44rem;
  margin: 0 auto;
}

::selection {
  background: var(--mustard);
  color: #17150f;
}

/* ---- hero ---- */

header.hero {
  /* A column so the bar can sit between the wordmark and the lede without any
     extra markup: flex order puts the ::after bar straight after the h1. */
  display: flex;
  flex-direction: column;
  padding: 5rem 0 0;
}

/* The eyebrow is a stamp, not a badge: an ink outline, tilted a degree and a
   half off the grid, so the page opens with a hand rather than a logo. */
header.hero .top {
  order: 0;
  display: block;
  width: fit-content;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.75rem 0.32rem;
  margin: 0 0 1.6rem;
  transform: rotate(-1.5deg);
}

/* Solid ink, no gradient. The size is the joke; the colour would only
   compete with the bar underneath. `display: table` keeps the block from
   stretching to the column and lets the bar below hold the full measure. */
header.hero h1 {
  order: 1;
  margin: 0;
  max-width: 100%;
  font-family: var(--mono);
  font-size: clamp(3.6rem, 13vw, 6rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--ink);
}

/* The one place cobalt is unmissable: an 8px bar the width of the column. */
header.hero::after {
  content: "";
  order: 2;
  display: block;
  height: 8px;
  margin-top: 1.9rem;
  border-radius: 99px;
  background: var(--cobalt);
}

header.hero p {
  order: 3;
  margin: 1.7rem 0 0;
  font-size: clamp(1.02rem, 2.5vw, 1.16rem);
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 34rem;
}

/* ---- the hero band (index only; 404 keeps the plain hero above) ----
   Full bleed: the band escapes the body's side padding and carries its own. */

header.hero.band {
  display: block;
  max-width: none;
  margin: 0 -1.4rem;
  padding: 0;
  background: var(--band);
  color: var(--band-ink);
}

header.hero.band::after {
  display: none;
}

/* The pill and the site's one link share the band's first row: the link is
   the way into the reference (/std/), set right so the pill keeps the left
   edge it opens the page with. Vermilion stays a link's colour; on the deep
   band it is the hero's lighter shell tint, as the dark theme does. */
header.hero .topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

header.hero .site-nav a {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--h-shell);
  border-bottom-color: rgb(255 154 107 / 0.5);
}

header.hero .site-nav a + a {
  margin-left: 1.1rem;
}

header.hero .site-nav a:hover {
  border-bottom-color: var(--h-shell);
}

.band-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 4.2rem 1.4rem 3.6rem;
}

header.hero.band .top {
  color: var(--band-ink);
  border-color: var(--band-ink);
}

header.hero.band h1 {
  color: var(--band-ink);
  font-size: clamp(4.2rem, 16vw, 8.5rem);
  margin: 0 0 1.4rem;
}

/* The rule, as three sentences whose subjects are the three layers, each in
   its layer's colour: the same colours the rings below use. */
header.hero.band p.rule {
  margin: 0;
  max-width: 46rem;
  font-family: var(--mono);
  font-size: clamp(1.18rem, 3.3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: -0.015em;
  color: var(--band-ink);
}

header.hero.band p.rule .k {
  font-weight: 800;
}

/* Named, not positional: the sentence decides the order. Core is what the
   program sees (input), wire is the seam, shell is the world behind it. */
header.hero.band p.rule .k.core { color: var(--h-core); }
header.hero.band p.rule .k.shell { color: var(--h-shell); }
header.hero.band p.rule .k.wire { color: var(--h-wire); }

header.hero.band p.pitch {
  margin: 1.6rem 0 0;
  max-width: 40rem;
  font-size: clamp(1rem, 2.3vw, 1.14rem);
  line-height: 1.62;
  color: var(--band-ink-2);
}

/* ---- the onion: four nested layers, drawn with borders ----
   Not a picture file: it is markup, so it follows the reader's theme and font
   size, and its words are text a screen reader gets (the figure also carries
   one aria-label that says the whole thing). */

figure.onion {
  margin: 2.6rem 0 0;
  font-family: var(--mono);
}

.ring {
  position: relative;
  border-radius: 22px;
  padding: 0.95rem 1.05rem 1.05rem;
}

.ring .ring {
  margin-top: 0.9rem;
}

.ring-name {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-right: 0.7rem;
}

.ring-what {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--band-ink-2);
}

.ring-what b {
  color: var(--band-ink);
}

.ring.world {
  border: 1.5px dashed rgb(251 248 241 / 0.4);
}

.ring.world > .ring-name {
  color: var(--band-ink);
}

.ring.wire {
  border: 2px solid var(--h-wire);
  background: rgb(255 212 74 / 0.06);
}

.ring.wire > .ring-name {
  color: var(--h-wire);
}

.ring.shell {
  border: 2px solid var(--h-shell);
  background: rgb(255 154 107 / 0.08);
}

.ring.shell > .ring-name {
  color: var(--h-shell);
}

.ring.core {
  border: 2px solid var(--h-core);
  background: rgb(159 176 255 / 0.16);
}

.ring.core > .ring-name {
  color: var(--h-core);
}

.ring .sig {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--band-ink);
  overflow-wrap: anywhere;
}

/* What crosses a boundary: a tag sitting under the layer's caption, with a
   double arrow, because a crossing goes both ways — a request in, an answer
   out. */
.cross {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.55rem;
  padding: 0.12rem 0.55rem 0.16rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--band);
  background: var(--band-ink);
}

.cross::before {
  content: "\21C5  ";
}

/* ---- the ledger: what the structure buys ---- */

section.ledger-sec {
  max-width: 60rem;
  margin: 0 auto;
}

section.ledger-sec::before {
  display: none;
}

h2.plain {
  font-size: clamp(1.5rem, 4.6vw, 2.2rem);
  letter-spacing: -0.03em;
}

section.ledger-sec > p.lede,
section.ledger-sec > p.fineprint {
  max-width: 40rem;
}

ol.ledger {
  list-style: none;
  margin: 1.6rem 0 1.4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.9rem;
  counter-reset: buy;
}

ol.ledger li {
  counter-increment: buy;
  display: flex;
}

ol.ledger a.card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.05rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--cobalt);
  border-radius: var(--r-md);
  box-shadow: var(--lift);
  color: var(--ink);
  font-weight: 400;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease;
}

ol.ledger a.card:hover {
  transform: translateY(-2px);
  border-bottom-color: var(--line);
}

.card .cause {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card .cause::before {
  content: counter(buy, decimal-leading-zero) "  ";
  color: var(--cobalt);
}

.card .unlock {
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.38;
  color: var(--ink);
  flex: 1;
}

.card .status {
  align-self: flex-start;
}

.card .next {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink-3);
  border-left: 2px dashed var(--ink-3);
  padding-left: 0.55rem;
}

p.fineprint {
  font-size: 0.92rem;
  color: var(--ink-2);
}

/* ---- status: shipped, designed for, experimental ---- */

.status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  padding: 0.22rem 0.55rem 0.24rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status.shipped {
  background: var(--cobalt);
  color: var(--paper);
}

.status.next,
.status.next-tag {
  border: 1.5px dashed var(--ink-3);
  color: var(--ink-2);
  padding: 0.12rem 0.5rem 0.14rem;
}

.status.exp {
  border: 1.5px solid var(--ink-3);
  color: var(--ink-2);
  padding: 0.12rem 0.5rem 0.14rem;
}

dl.status-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.7rem 1rem;
  margin: 1.8rem 0 0;
  padding: 1rem 1.1rem;
  max-width: 40rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 0.94rem;
  line-height: 1.6;
}

dl.status-list dt {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  align-self: start;
  margin-top: 0.15rem;
  padding: 0.22rem 0.55rem 0.24rem;
  border-radius: 999px;
  white-space: nowrap;
}

dl.status-list dt.shipped {
  background: var(--cobalt);
  color: var(--paper);
}

dl.status-list dt.next {
  border: 1.5px dashed var(--ink-3);
  color: var(--ink-2);
  padding: 0.12rem 0.5rem 0.14rem;
}

dl.status-list dd {
  margin: 0;
  color: var(--ink-2);
}

/* ---- the roadmap, §10 ---- */

.roadmap {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.roadmap .row {
  display: grid;
  grid-template-columns: 9rem 1fr 1fr;
  gap: 0.4rem 1.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}

.roadmap h3 {
  margin: 0.1rem 0 0;
  font-size: 0.92rem;
}

.roadmap p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.roadmap p .status {
  display: table;
  margin-bottom: 0.35rem;
}

/* A two-process run: a terminal session, not a refusal beside its source. A
   deep ground in both themes, a mustard rail — the wire's colour, because the
   thing on show is what crosses the seam. */
pre.code.run {
  background: var(--run-bg);
  border-color: var(--run-bg);
  border-left: 4px solid var(--mustard);
  margin-top: -0.6rem;
  margin-bottom: 1.9rem;
}

pre.code.run code {
  color: var(--run-ink);
}

/* ---- sections ---- */

section {
  padding-top: 4.2rem;
}

/* A chunky cobalt tick, not a full rule: the hero bar is the page's one
   full-measure line, so a section opens with a short stroke instead of a
   second hairline. Eight ticks make a rhythm down the left edge. */
section::before {
  content: "";
  display: block;
  width: 7rem;
  height: 5px;
  border-radius: 99px;
  background: var(--cobalt);
  margin-bottom: 1.7rem;
}

h2 {
  font-family: var(--mono);
  font-size: clamp(1.35rem, 4.4vw, 1.78rem);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 1rem;
}

/* Outlined numerals: the stroke is the point, so the fill is dropped where
   the browser can do it and the solid cobalt stands in where it cannot. */
h2 .num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 2.15em;
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.05em;
  margin-right: 0.24em;
  vertical-align: 0;
  color: var(--cobalt);
}

@supports (-webkit-text-stroke: 2px red) {
  h2 .num {
    color: transparent;
    -webkit-text-stroke: 2px var(--cobalt);
  }
}

h3 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  margin: 2rem 0 0.4rem;
  color: var(--ink);
}

p {
  margin: 0 0 1.05rem;
  max-width: 38rem;
}

em {
  font-style: italic;
  color: var(--ink-2);
}

strong {
  font-weight: 700;
  color: var(--ink);
}

/* Links are the only vermilion in running text — a 2px underline doing the
   work, so the colour can stay light on the page. */
a {
  color: var(--vermilion);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--link-line);
  padding-bottom: 0.5px;
}

a:hover {
  border-bottom-color: var(--vermilion);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--ink);
}

/* Marker pen: a mustard band across the bottom half of the text box, cloned
   onto every fragment so a wrapped span is re-stroked instead of stretched. */
p code,
li code,
figcaption code,
td code {
  padding: 0.06em 0.28em 0.14em;
  border-radius: 3px;
  white-space: nowrap;
  background-color: var(--pen-wash);
  /* The pen, not a wall of paint: a thin strong stroke sitting on the
     baseline, over a light wash. Nine highlighted words in a paragraph read
     as a schoolbook otherwise. */
  box-shadow: inset 0 -0.2em 0 0 var(--pen-line);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* A nowrap span breaks nowhere, so one long compiler message in an inline
   span makes the whole document scroll sideways. gen/build_site.py marks any
   inline code over 40 characters .long, and those wrap inside their box. */
p code.long,
li code.long,
figcaption code.long {
  white-space: normal;
  overflow-wrap: anywhere;
}

ul.plain {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  max-width: 38rem;
}

ul.plain li {
  padding-left: 1.4rem;
  position: relative;
  margin-bottom: 0.35rem;
  color: var(--ink-2);
}

ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.35;
}

ul.plain li b {
  color: var(--ink);
  font-weight: 700;
}

/* ---- definition lists ----
   Three sections carry their spine as a dl: a term, one sentence. Two columns
   on a wide page, stacked on a phone. The term is a label, not a heading, so
   it sits at caption size in the body face's colour, not the heading's. */
dl.points {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7.5rem) 1fr;
  gap: 0.45rem 1.1rem;
  margin: 0 0 1.5rem;
  padding: 0;
  max-width: 38rem;
}

dl.points dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 0.22em;
}

dl.points dd {
  margin: 0;
  color: var(--ink-2);
}

/* ---- a stated limit ----
   The page's honesty notes. Monochrome on purpose: an accent would make a
   caveat look like a claim, and both accents have a job already. */
aside.limit {
  margin: 1.6rem 0 0;
  padding: 0 0 0 0.95rem;
  border-left: 2px solid var(--line);
  max-width: 38rem;
  font-size: 0.94rem;
  line-height: 1.62;
  color: var(--ink-2);
}

aside.limit .limit-tag {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.2rem;
}

/* ---- snippets ---- */

figure.snippet,
figure.diagram {
  margin: 1.9rem 0 1.7rem;
  padding: 0;
}

/* A diagram is drawn by the repo's own rendered source (gen/diagrams/*.puml) and
   carries the palette already, so it sits on the page rather than on a panel. */
/* ---- the drawings: hand-written SVG (gen/figures/), inlined ----
   A figure carries no colour of its own — no fill or stroke attribute, no
   style — only classes, so every drawing is in the reader's theme. The gate
   enforces that. Layer colours match the hero: core = modules (pure),
   shell = effectors (mutation), wire = the binding; --t-bad is a refusal. */

svg.fig {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  margin: 0 auto;
  overflow: visible;
  font-family: var(--mono);
}

.fig text { fill: var(--ink); font-size: 11px; }
.fig .head { font-size: 9.5px; font-weight: 700; letter-spacing: 0.07em; fill: var(--ink-2); }
.fig .small { font-size: 10px; }
.fig .b { font-weight: 700; }
.fig .dim { fill: var(--ink-3); }
.fig .mid { text-anchor: middle; }
.fig text.core, .fig tspan.core { fill: var(--t-core); }
.fig text.shell { fill: var(--t-shell); }
.fig text.wire { fill: var(--t-wire); }
.fig text.bad { fill: var(--t-bad); font-weight: 700; }

.fig .card { fill: var(--card); stroke: var(--line); stroke-width: 1.2; }
.fig .card.core { fill: var(--t-core-bg); stroke: var(--t-core); }
.fig .card.shell { fill: var(--t-shell-bg); stroke: var(--t-shell); }
.fig .card.wire { fill: var(--t-wire-bg); stroke: var(--t-wire); }
.fig .card.dash { stroke: var(--ink-3); stroke-dasharray: 5 4; fill: none; }
.fig .card.shell.dash { stroke: var(--t-shell); }
.fig .chip.core { fill: var(--t-core-bg); stroke: var(--t-core); stroke-width: 1; }
.fig .chip.shell { fill: var(--t-shell-bg); stroke: var(--t-shell); stroke-width: 1; }
.fig .slot { fill: var(--card); stroke: var(--t-core); stroke-width: 1.2; }
.fig .fold { fill: none; stroke: var(--t-wire); stroke-width: 1.2; }

.fig .edge { fill: none; stroke: var(--ink-3); stroke-width: 1.5; }
.fig .edge.core { stroke: var(--t-core); }
.fig .edge.bad { stroke: var(--t-bad); stroke-dasharray: 4 3; }
.fig .ah { fill: var(--ink-3); }
.fig .ah.core { fill: var(--t-core); }
.fig .cross-mark { fill: none; stroke: var(--t-bad); stroke-width: 2.2; stroke-linecap: round; }
.fig .cut { stroke: var(--t-bad); stroke-width: 1.5; stroke-dasharray: 6 4; }

figure.snippet figcaption,
figure.diagram figcaption {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.045em;
  line-height: 1.5;
  color: var(--ink-3);
  margin: 0 0 0.6rem;
  padding-left: 1.05rem;
  position: relative;
}

/* Caption mark: a small vermilion diamond. The only non-link use of the
   second accent, and it is 7px — a full stop, not a flag. */
figure.snippet figcaption::before,
figure.diagram figcaption::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.42em;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--vermilion);
  transform: rotate(45deg);
}

/* Code sits on a warmer panel than the page, with a cobalt rail holding the
   left edge — the same cobalt as the section rules, so a code block reads as
   part of the section rather than as an inset from somewhere else. */
pre.code {
  margin: 0;
  padding: 1.15rem 1.25rem 1.15rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cobalt);
  border-radius: var(--r-md);
  box-shadow: var(--lift);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  tab-size: 2;
  overscroll-behavior-x: contain;
}

pre.code code {
  font-size: inherit;
  color: var(--ink);
  white-space: pre;
  display: block;
}

/* A snippet's terminal: the command that produced it, and then the bytes it
   produced. It hangs directly under the code panel and is closed by default, so
   the page reads as before and the transcript is there when it is asked for.
   Native <details>/<summary>: it opens with no script, and a screen reader
   announces it as a control. Nothing new enters the palette — the open panel
   is the code panel's own ground and rail (a code block is a code block), just
   flat rather than lifted, and one size down: a transcript is evidence, not the
   text to read. */
details.term {
  /* pulled up under the panel it belongs to, and back to the page's rhythm
     underneath, so a closed terminal is one line inside the snippet's block
     rather than a paragraph of its own. */
  margin: -1.3rem 0 1.7rem;
}

details.term > summary {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  padding: 0.1rem 0.05rem 0.15rem;
  /* the target is the command, not the whole column: clicking beside it does
     nothing, which is what the line looks like. */
  width: fit-content;
  max-width: 100%;
  cursor: pointer;
}

details.term > summary code {
  /* the inline-code band is for prose, and this is a command line: no mustard,
     no padding, inheriting the summary's size and colour. */
  font-size: inherit;
  color: inherit;
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

details.term > summary:hover {
  color: var(--cobalt);
}

details.term[open] > summary {
  color: var(--ink);
  padding-bottom: 0.25rem;
}

pre.out {
  margin: 0;
  padding: 0.95rem 1.15rem 1rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cobalt);
  border-radius: var(--r-md);
  font-family: var(--mono);
  font-size: 12.6px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

/* ---- tree-sitter-nib classes -> the code panel's four inks ----
   ORDER IS MEANING: the grammar decides which class a token carries; this
   file only decides what that class looks like. All values measured against
   --panel; the lowest is the comment at 4.78:1. */

.keyword {
  color: var(--c-keyword);
  font-weight: 600;
}

.type {
  color: var(--c-type);
  font-weight: 600;
}

.type.builtin {
  font-style: italic;
  font-weight: 500;
}

.constructor {
  color: var(--c-literal);
  font-weight: 600;
}

.string {
  color: var(--c-string);
}

.string.special {
  color: var(--c-string);
  font-weight: 600;
}

.number,
.constant,
.constant.builtin {
  color: var(--c-literal);
}

.comment {
  color: var(--ink-3);
  font-style: italic;
}

.function,
.function.builtin {
  color: var(--c-function);
}

.property,
.property.builtin,
.attribute {
  color: var(--ink-2);
}

.variable,
.variable.builtin {
  color: var(--ink);
}

.variable.parameter {
  color: var(--ink-2);
  font-style: italic;
}

.operator {
  color: var(--ink-2);
}

.punctuation,
.punctuation.bracket,
.punctuation.delimiter,
.punctuation.special {
  color: var(--ink-3);
}

/* A boxed diagram is a picture of the language, not code: no panel, no rail,
   just ink on paper. */
pre.diagram {
  margin: 1.75rem 0;
  padding: 1.1rem 0.2rem;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  border: 0;
}

pre.diagram .box {
  color: var(--cobalt);
}

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4.5rem 0 0;
}

footer {
  margin-top: 4.5rem;
  padding-top: 2rem;
  position: relative;
  color: var(--ink-3);
  font-size: 0.86rem;
  line-height: 1.7;
}

/* The page closes with the bar it opened with. */
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  border-radius: 99px;
  background: var(--cobalt);
}

footer p {
  max-width: 38rem;
}

/* ---- small screens: the phone is the first-class view ---- */

@media (max-width: 640px) {
  body {
    padding: 0 1.1rem 4rem;
    font-size: 16px;
    line-height: 1.66;
  }
  header.hero {
    padding-top: 2.75rem;
  }
  header.hero::after {
    height: 7px;
    margin-top: 2.1rem;
  }
  header.hero h1 {
    font-size: clamp(3.4rem, 19vw, 4.8rem);
  }
  header.hero .top {
    font-size: 0.68rem;
    margin-bottom: 1.2rem;
  }
  header.hero.band {
    margin: 0 -1.1rem;
    padding: 0;
  }
  .band-inner {
    padding: 2.6rem 1.1rem 2.4rem;
  }
  header.hero.band h1 {
    font-size: clamp(3.8rem, 22vw, 5.5rem);
  }
  figure.onion {
    margin-top: 2rem;
  }
  .ring {
    border-radius: 16px;
    padding: 0.75rem 0.7rem 0.8rem;
  }
  .ring .ring {
    margin-top: 0.75rem;
  }
  .ring-name {
    display: block;
    margin: 0 0 0.1rem;
  }
  .ring-what {
    font-size: 0.76rem;
  }
  .ring .sig {
    font-size: 0.78rem;
  }
  .cross {
    font-size: 0.68rem;
    border-radius: 10px;
  }
  ol.ledger {
    grid-template-columns: 1fr;
  }
  dl.status-list {
    display: block;
    padding: 0.9rem 0.9rem 0.3rem;
  }
  dl.status-list dt {
    display: inline-block;
  }
  dl.status-list dd {
    margin: 0.35rem 0 0.9rem;
  }
  .roadmap .row {
    grid-template-columns: 1fr;
    padding: 0.9rem 0.9rem;
  }
  section {
    padding-top: 3.1rem;
  }
  section::before {
    width: 5.5rem;
    height: 4px;
    margin-bottom: 1.35rem;
  }
  h2 {
    font-size: 1.28rem;
    line-height: 1.24;
  }
  h2 .num {
    font-size: 2em;
    margin-right: 0.28em;
  }
  @supports (-webkit-text-stroke: 2px red) {
    h2 .num {
      -webkit-text-stroke-width: 1.6px;
    }
  }
  pre.code {
    font-size: 12.4px;
    line-height: 1.58;
    padding: 0.95rem 0.7rem 0.95rem 0.8rem;
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    border-radius: 10px;
  }
  details.term {
    margin: -1.1rem 0 1.4rem;
  }
  details.term > summary {
    font-size: 0.74rem;
    padding: 0.1rem 0 0.15rem;
  }
  pre.out {
    font-size: 12px;
    line-height: 1.52;
    padding: 0.8rem 0.6rem 0.85rem 0.7rem;
    margin-left: -0.35rem;
    margin-right: -0.35rem;
    border-radius: 10px;
  }
  dl.points {
    display: block;
  }
  dl.points dt {
    margin-top: 0.75rem;
  }
  dl.points dt:first-child {
    margin-top: 0;
  }
  dl.points dd {
    margin-bottom: 0.75rem;
  }
  dl.points dd:last-child {
    margin-bottom: 0;
  }
  figure.snippet,
  figure.diagram {
    margin: 1.5rem 0 1.4rem;
  }
  footer {
    margin-top: 3.25rem;
  }
  footer::before {
    height: 7px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* A drawing's caption sits under it, not above like a snippet's. */
figure.diagram figcaption {
  margin: 0.9rem auto 0;
  max-width: 30rem;
}

/* ---- the release: a line in the hero, a download in §11 ---- */

header.hero.band p.release {
  margin: 1.2rem 0 0;
  font-size: 0.95rem;
  color: var(--band-ink-2);
}

header.hero.band p.release a {
  color: var(--band-ink);
  text-underline-offset: 3px;
}

header.hero.band p.release .status {
  display: inline-block;
  margin-right: 0.35rem;
}

ul.downloads {
  list-style: none;
  margin: 1.4rem 0 1.2rem;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

ul.downloads li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1rem;
}

ul.downloads a.dl {
  display: inline-block;
  min-width: 13.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--r-md);
  background: var(--cobalt);
  color: var(--card);
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
}

ul.downloads a.dl:hover,
ul.downloads a.dl:focus-visible {
  background: var(--ink);
}

ul.downloads .dl-meta {
  min-width: 0;
  font-size: 0.88rem;
  color: var(--ink-2);
}

/* A digest is one 64-character word: let it break anywhere rather than push
   the page sideways at phone width. */
ul.downloads code.sha {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* Install steps: typed by the reader, not produced by a snippet. */
pre.code.shell {
  border-left-color: var(--mustard);
  margin-bottom: 1.2rem;
}
