/* DOS ex Machina - the literature that came in the box.
 *
 * Two pieces of print: the brochure (index.html) and the User's Guide
 * (manual.html), from a maker that never existed, Horizon Computer Systems,
 * whose badge is on the case.  With the lights on it is paper in the case's
 * own beige, set in the blue of a DOS text screen.  With the lights off it
 * is the room the machine sits in: dark, and lit by the tube.
 *
 * The palette is the machine's: the plastic (0xBF 0xAF 0x8A in params.h),
 * the VGA text blue, the turbo display's LED, the power lamp. */

/* ---- tokens: lights on -------------------------------------------------- */
:root {
  --paper: #ddd5bf;        /* the plastic, a few steps lighter: coated stock */
  --paper-2: #d2c9b0;      /* a panel on the paper */
  --paper-3: #c6bc9f;      /* a well in the panel */
  --ink: #1b1a16;
  --ink-2: #4a463b;        /* captions, secondary text */
  --ink-3: #6d6756;        /* rules' labels, the quietest text */
  --rule: rgba(27, 26, 22, 0.22);
  --rule-soft: rgba(27, 26, 22, 0.11);
  --blue: #0b1fa8;         /* VGA text blue, inked */
  --blue-ink: #ffffff;     /* text on the blue */
  --blue-soft: rgba(11, 31, 168, 0.09);
  --led: #ff5a2a;          /* the turbo display */
  --lamp: #23b455;         /* the power lamp */
  --key: #8b8478;          /* the keys' plastic */
  --key-hi: #a8a195;
  --key-lo: #5f594e;
  --key-ink: #f1ead6;      /* the legends' cream */
  --tube: #0a0c0b;         /* glass with nothing on it */
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 10px 30px rgba(40, 32, 10, 0.18);
  --photo-shadow: 0 30px 60px -20px rgba(40, 32, 10, 0.45), 0 2px 0 rgba(255, 255, 255, 0.4) inset;
  --glow: none;
  color-scheme: light;
}

/* ---- tokens: lights off ------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0e0d;
    --paper-2: #141613;
    --paper-3: #1b1d19;
    --ink: #dcd7c6;
    --ink-2: #a9a492;
    --ink-3: #7d796a;
    --rule: rgba(220, 215, 198, 0.2);
    --rule-soft: rgba(220, 215, 198, 0.09);
    --blue: #8ea6ff;
    --blue-ink: #0a0c18;
    --blue-soft: rgba(142, 166, 255, 0.1);
    --led: #ff6a3a;
    --lamp: #3ddc6a;
    --key: #4a463f;
    --key-hi: #625d54;
    --key-lo: #2c2a25;
    --key-ink: #e8e1cc;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px rgba(0, 0, 0, 0.5);
    --photo-shadow: 0 0 120px -10px rgba(120, 150, 255, 0.16), 0 30px 60px -20px rgba(0, 0, 0, 0.8);
    --glow: 0 0 18px rgba(255, 106, 58, 0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d0e0d;
  --paper-2: #141613;
  --paper-3: #1b1d19;
  --ink: #dcd7c6;
  --ink-2: #a9a492;
  --ink-3: #7d796a;
  --rule: rgba(220, 215, 198, 0.2);
  --rule-soft: rgba(220, 215, 198, 0.09);
  --blue: #8ea6ff;
  --blue-ink: #0a0c18;
  --blue-soft: rgba(142, 166, 255, 0.1);
  --led: #ff6a3a;
  --lamp: #3ddc6a;
  --key: #4a463f;
  --key-hi: #625d54;
  --key-lo: #2c2a25;
  --key-ink: #e8e1cc;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 30px rgba(0, 0, 0, 0.5);
  --photo-shadow: 0 0 120px -10px rgba(120, 150, 255, 0.16), 0 30px 60px -20px rgba(0, 0, 0, 0.8);
  --glow: 0 0 18px rgba(255, 106, 58, 0.55);
  color-scheme: dark;
}

/* ---- type --------------------------------------------------------------- */
:root {
  --display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 64ch;
  --gutter: clamp(18px, 4vw, 48px);
  --wide: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  transition: background-color 0.5s ease, color 0.5s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 0.06em; }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--blue); color: var(--blue-ink); }

h1, h2, h3 { font-family: var(--display); font-stretch: 112%; text-wrap: balance; margin: 0; }
h1 {
  font-weight: 800; font-style: italic; letter-spacing: -0.025em; line-height: 0.98;
  font-size: clamp(2.5rem, 6.4vw, 5.1rem);
}
h2 {
  font-weight: 800; font-style: italic; letter-spacing: -0.02em; line-height: 1.04;
  font-size: clamp(1.9rem, 3.9vw, 3.05rem);
}
h3 { font-weight: 700; font-size: 1.12rem; letter-spacing: -0.005em; line-height: 1.25; }
p { margin: 0; max-width: var(--measure); }
p + p { margin-top: 0.9em; }
code, kbd, pre, samp { font-family: var(--mono); font-size: 0.92em; }

/* the small caps a brochure labels things in */
.label {
  font: 500 0.72rem/1.2 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
}

.wrap { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }

/* ---- the masthead ------------------------------------------------------- */
.mast {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--rule-soft);
}
.mast .wrap { display: flex; align-items: center; gap: 1.2rem; min-height: 58px; flex-wrap: wrap; }
.brand {
  font: italic 800 1.06rem/1 var(--display); font-stretch: 118%; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; white-space: nowrap; padding-block: 0.4rem;
}
.brand i { color: var(--blue); font-style: italic; font-weight: 600; }
.nav { display: flex; gap: 1.15rem; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a {
  font: 500 0.78rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2); text-decoration: none; padding-block: 0.5rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); }

/* the room's light switch: a rocker, as on the back of the monitor */
.lights {
  display: inline-flex; align-items: center; gap: 0.55rem; cursor: pointer;
  background: none; border: 0; padding: 0.3rem 0; color: var(--ink-2);
  font: 500 0.72rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
}
.rocker {
  width: 38px; height: 20px; border-radius: 4px; position: relative; flex: none;
  background: linear-gradient(var(--key-lo), var(--key));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.25);
}
.rocker::before {
  content: ""; position: absolute; inset: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--key-hi) 0 50%, var(--key-lo) 50% 100%);
  transition: background 0.2s;
}
.rocker::after { /* the pip on the side that is pressed */
  content: ""; position: absolute; top: 7px; left: 8px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--key-ink); opacity: 0.9; transition: left 0.2s;
}
:root[data-theme="dark"] .rocker::before { background: linear-gradient(90deg, var(--key-lo) 0 50%, var(--key-hi) 50% 100%); }
:root[data-theme="dark"] .rocker::after { left: 24px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rocker::before { background: linear-gradient(90deg, var(--key-lo) 0 50%, var(--key-hi) 50% 100%); }
  :root:not([data-theme="light"]) .rocker::after { left: 24px; }
}

/* On a phone the masthead is one row: the brand, the guide, the source and
 * the switch.  The links to this page's own sections go - they are a
 * thumb's scroll away - or the bar wraps to three rows and, being sticky,
 * keeps a fifth of the screen. */
@media (max-width: 760px) {
  .mast .wrap { min-height: 50px; gap: 0.7rem; flex-wrap: nowrap; }
  .nav { gap: 0.9rem; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; font-size: 0.7rem; letter-spacing: 0.06em; }
  .brand { font-size: 0.98rem; }
  .nav a[href^="#"], .nav a[href^="./#"] { display: none; }
  .lights > span:first-child { display: none; } /* the rocker alone; its title names it */
}

/* ---- the cover ---------------------------------------------------------- */
.cover { padding-block: clamp(2.2rem, 6vw, 5rem) clamp(1.5rem, 4vw, 3rem); }
.cover-head { display: grid; gap: clamp(1.4rem, 3vw, 2.4rem); grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: end; }
.cover-head .label { margin-bottom: 1.1rem; display: block; }
.cover h1 em { font-style: italic; color: var(--blue); }
.lede { font-size: clamp(1.08rem, 1.5vw, 1.24rem); line-height: 1.55; color: var(--ink-2); }
.lede strong { color: var(--ink); font-weight: 600; }
@media (max-width: 860px) { .cover-head { grid-template-columns: 1fr; } }

/* the machine, and the keys that change what is on its tube */
.machine { margin-top: clamp(1.8rem, 4vw, 3.2rem); }
.frames {
  position: relative; aspect-ratio: 1600 / 1000; border-radius: 10px; overflow: hidden;
  background: var(--tube); box-shadow: var(--photo-shadow);
}
.frames img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.9s ease;
}
.frames img.on { opacity: 1; }
.channels {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.55rem; margin-top: 1.1rem;
}
.channels .label { margin-right: 0.5rem; }
.cap {
  font: 600 0.74rem/1 var(--text); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--key-ink); cursor: pointer; border: 0; border-radius: 4px; padding: 0.62rem 0.95rem;
  background: linear-gradient(var(--key-hi), var(--key) 45%, var(--key-lo));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 3px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
}
.cap:hover { filter: brightness(1.08); }
.cap[aria-pressed="true"] {
  transform: translateY(2px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(0, 0, 0, 0.35) inset, 0 1px 0 rgba(0, 0, 0, 0.28);
  background: linear-gradient(var(--key-lo), var(--key));
}
.cap[aria-pressed="true"]::before { /* its lamp */
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 0.5em;
  background: var(--led); box-shadow: 0 0 8px var(--led); vertical-align: 0.08em;
}
.caption { margin-top: 0.85rem; color: var(--ink-2); font-size: 0.95rem; min-height: 3.1em; }
.caption b { color: var(--ink); font-weight: 600; }

/* ---- buttons ------------------------------------------------------------ */
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.6rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 0.6em; text-decoration: none; cursor: pointer;
  font: 600 0.95rem/1 var(--text); padding: 0.95rem 1.35rem; border-radius: 5px;
  border: 1.5px solid var(--ink); color: var(--ink); background: transparent;
  transition: background 0.15s, color 0.15s, transform 0.08s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.btn.primary:hover { filter: brightness(1.12); background: var(--blue); color: var(--blue-ink); }
.btn small { font: 500 0.72rem/1 var(--mono); letter-spacing: 0.06em; opacity: 0.8; }

/* ---- the version plate: the turbo module, showing the release ------------ */
.plate {
  display: inline-flex; align-items: stretch; gap: 0.75rem; padding: 0.6rem 0.7rem; border-radius: 8px;
  background: linear-gradient(#34322d, #24221f);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 8px 22px rgba(0, 0, 0, 0.28);
}
.plate .lamps { display: grid; align-content: center; gap: 0.5rem; }
.plate .lamps span {
  display: flex; align-items: center; gap: 0.45rem; color: #b8b09c;
  font: 600 0.62rem/1 var(--text); letter-spacing: 0.12em;
}
.plate .lamps i {
  width: 8px; height: 8px; border-radius: 50%; background: #3a1d14;
  box-shadow: 0 0 0 1.5px #15130f, 0 1px 0 1.5px rgba(255, 255, 255, 0.1);
}
.plate .lamps .lit i { background: var(--led); box-shadow: 0 0 0 1.5px #15130f, 0 0 10px var(--led); }
.seg {
  display: flex; align-items: center; gap: 0.12rem; padding: 0.5rem 0.75rem; border-radius: 4px; min-height: 58px;
  background: radial-gradient(120% 140% at 50% 0%, #2a120b, #0f0705 70%);
  box-shadow: 0 0 0 1px #000, 0 2px 6px rgba(0, 0, 0, 0.7) inset, 0 -1px 0 rgba(255, 255, 255, 0.07) inset;
}
.seg svg { height: 40px; width: auto; overflow: visible; }
.seg .s-off { fill: rgba(255, 90, 42, 0.085); }
.seg .s-on { fill: #ff6a3a; filter: drop-shadow(0 0 3px rgba(255, 90, 42, 0.9)) drop-shadow(0 0 9px rgba(255, 90, 42, 0.45)); }
.plate-note { display: block; margin-top: 0.7rem; color: var(--ink-2); font-size: 0.9rem; max-width: 34ch; }
.chip {
  display: inline-block; font: 600 0.64rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.32rem 0.5rem; border-radius: 3px; border: 1px solid var(--rule); color: var(--ink-2); vertical-align: 0.15em;
}

/* ---- sections ----------------------------------------------------------- */
section { padding-block: clamp(3rem, 8vw, 6.5rem); }
section + section { border-top: 1px solid var(--rule-soft); }
.sec-head { display: grid; gap: 1rem clamp(1.5rem, 4vw, 4rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; margin-bottom: clamp(1.8rem, 4vw, 3.2rem); }
.sec-head .label { display: block; margin-bottom: 0.9rem; }
@media (max-width: 860px) { .sec-head { grid-template-columns: 1fr; } }
.muted { color: var(--ink-2); }

/* Figure 1: the front panel, numbered the way a manual numbers one */
.panel-fig { display: grid; gap: clamp(1.2rem, 3vw, 2.6rem); grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .panel-fig { grid-template-columns: 1fr; } }
.plan { position: relative; border-radius: 8px; overflow: hidden; box-shadow: var(--photo-shadow); }
.plan img { width: 100%; }
.pin {
  position: absolute; transform: translate(-50%, -50%); width: 1.75rem; height: 1.75rem; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; border: 2px solid #fff; padding: 0;
  background: var(--blue); color: #fff; font: 600 0.78rem/1 var(--mono);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); transition: transform 0.15s, background 0.15s;
}
:root[data-theme="dark"] .pin { background: #2439c9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pin { background: #2439c9; } }
.pin:hover, .pin.hot { transform: translate(-50%, -50%) scale(1.22); background: var(--led); }
@media (max-width: 760px) { /* nine of them on a small picture: smaller, or they sit on each other */
  .pin { width: 1.15rem; height: 1.15rem; font-size: 0.6rem; border-width: 1.5px; }
}
.legend { list-style: none; margin: 0; padding: 0; counter-reset: pin; display: grid; gap: 0.15rem; }
.legend li {
  counter-increment: pin; display: grid; grid-template-columns: 2.1rem 1fr; gap: 0.2rem 0.4rem; padding: 0.7rem 0.6rem;
  border-radius: 6px; border-top: 1px solid var(--rule-soft); transition: background 0.15s;
}
.legend li:first-child { border-top: 0; }
.legend li::before { content: counter(pin); font: 600 0.82rem/1.55 var(--mono); color: var(--blue); }
.legend li.hot { background: var(--blue-soft); }
.legend b { font-weight: 600; display: block; }
.legend span { color: var(--ink-2); font-size: 0.94rem; line-height: 1.45; grid-column: 2; }
.figcap { margin-top: 0.9rem; font: 400 0.82rem/1.45 var(--mono); color: var(--ink-3); letter-spacing: 0.01em; }
.figcap b { color: var(--ink-2); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 0.5em; }

/* the plates: details, pixel for pixel */
.plates { display: grid; gap: clamp(1rem, 2.4vw, 2rem); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .plates { grid-template-columns: 1fr; } }
.plates figure { margin: 0; }
.plates img { border-radius: 6px; box-shadow: var(--shadow); width: 100%; image-rendering: auto; }
.plates h3 { margin-top: 1rem; }
.plates p { color: var(--ink-2); font-size: 0.97rem; margin-top: 0.35rem; }

/* the signal path, left to right, as the tube's passes run */
.path { display: flex; flex-wrap: wrap; gap: 0; margin: clamp(2rem, 4vw, 3.2rem) 0 0; padding: 0; list-style: none; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.path li { flex: 1 1 8.6rem; padding: 0.95rem 1rem 1.05rem; border-right: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); margin: 0 -1px -1px 0; }
.path b { display: block; font: 600 0.74rem/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue); }
.path span { display: block; margin-top: 0.4rem; font-size: 0.9rem; line-height: 1.4; color: var(--ink-2); }

/* the specification sheet */
.spec { display: grid; gap: clamp(1.6rem, 4vw, 4rem); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .spec { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
caption { text-align: left; padding-bottom: 0.8rem; }
th, td { text-align: left; padding: 0.62rem 0.8rem 0.62rem 0; border-bottom: 1px solid var(--rule-soft); vertical-align: baseline; }
thead th { font: 500 0.7rem/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--rule); }
td.num, th.num { text-align: right; padding-right: 1.1rem; }
.chips td:first-child { font-weight: 600; white-space: nowrap; }
.bar { display: block; height: 7px; border-radius: 1px; background: var(--blue); min-width: 3px; }
.chips tr.default td:first-child::after { content: "default"; margin-left: 0.6em; font: 600 0.6rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--led); vertical-align: 0.2em; }
dl.sheet { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0; }
dl.sheet dt, dl.sheet dd { margin: 0; padding: 0.68rem 0; border-bottom: 1px solid var(--rule-soft); }
dl.sheet dt { font: 500 0.7rem/1.7 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding-right: 1.4rem; }
dl.sheet dd { font-size: 0.98rem; line-height: 1.45; }

/* software */
.two { display: grid; gap: clamp(1.4rem, 4vw, 4rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; }
@media (max-width: 960px) { .two { grid-template-columns: 1fr; } }
.two img { border-radius: 8px; box-shadow: var(--photo-shadow); }
.points { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1.15rem; }
.points li { padding-left: 1.3rem; position: relative; max-width: 56ch; }
.points li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.55rem; height: 2px; background: var(--blue); }
.points b { font-weight: 600; }

/* get it */
.get { display: grid; gap: clamp(1.6rem, 4vw, 4rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
@media (max-width: 960px) { .get { grid-template-columns: 1fr; } }
.dl-list { list-style: none; margin: 1.3rem 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.dl-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 0.7rem 0; border-bottom: 1px solid var(--rule-soft); }
.dl-list span { color: var(--ink-2); font-size: 0.92rem; }
pre {
  margin: 0; padding: 1.15rem 1.25rem; border-radius: 8px; overflow-x: auto; line-height: 1.65; font-size: 0.86rem;
  background: #0b0d12; color: #d5dcf5; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), var(--shadow); tab-size: 2;
}
pre .c { color: #7f89ac; }
.codebox { position: relative; }
.copy {
  position: absolute; top: 0.6rem; right: 0.6rem; font: 600 0.66rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: #d5dcf5; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 4px;
  padding: 0.42rem 0.6rem; cursor: pointer;
}
.copy:hover { background: rgba(255, 255, 255, 0.16); }
.codebox pre { padding-top: 2.7rem; } /* room for the button, clear of the first command */
.note { margin-top: 1.2rem; padding: 0.95rem 1.1rem; border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 0 6px 6px 0; font-size: 0.96rem; }
.note p { max-width: none; }

/* questions */
.qa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(1.5rem, 4vw, 4rem); }
@media (max-width: 860px) { .qa { grid-template-columns: 1fr; } }
.qa div { padding: 1.35rem 0; border-top: 1px solid var(--rule-soft); }
.qa h3 { margin-bottom: 0.45rem; }
.qa p { color: var(--ink-2); font-size: 0.98rem; }

/* the colophon */
footer { border-top: 1px solid var(--rule); padding-block: 2.6rem 3.4rem; color: var(--ink-2); font-size: 0.92rem; }
footer .wrap { display: grid; gap: 1.6rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }
footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; align-content: start; }
footer p { max-width: 62ch; }
.fine { font: 400 0.76rem/1.55 var(--mono); color: var(--ink-3); margin-top: 1rem; }

/* ======================================================================== */
/* The User's Guide                                                          */
/* ======================================================================== */
.guide-cover { padding-block: clamp(2.4rem, 6vw, 4.6rem) clamp(1.6rem, 4vw, 3rem); border-bottom: 1px solid var(--rule); }
.guide-cover .label { display: block; margin-bottom: 1rem; }
.guide-cover h1 { font-size: clamp(2.3rem, 5.6vw, 4.2rem); }
.guide-cover .lede { margin-top: 1.4rem; font-family: var(--serif); }
.guide-cover .part { margin-top: 1.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; font: 400 0.78rem/1.4 var(--mono); color: var(--ink-3); letter-spacing: 0.04em; }

.guide { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: clamp(1.6rem, 4vw, 4.5rem); padding-block: clamp(1.8rem, 4vw, 3.2rem) 5rem; align-items: start; }
@media (max-width: 900px) { .guide { grid-template-columns: 1fr; } }
.toc { position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow: auto; padding-right: 0.4rem; }
@media (max-width: 900px) { .toc { position: static; max-height: none; border: 1px solid var(--rule-soft); border-radius: 8px; padding: 1rem 1.1rem; } }
.toc .label { display: block; margin-bottom: 0.8rem; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.toc li { counter-increment: ch; }
.toc a {
  display: grid; grid-template-columns: 1.9rem 1fr; gap: 0.2rem; padding: 0.42rem 0.5rem 0.42rem 0; text-decoration: none;
  color: var(--ink-2); font-size: 0.93rem; line-height: 1.35; border-left: 2px solid transparent; padding-left: 0.7rem; margin-left: -0.7rem;
}
.toc a::before { content: counter(ch); font: 500 0.78rem/1.6 var(--mono); color: var(--ink-3); }
.toc a:hover { color: var(--blue); }
.toc a.here { color: var(--ink); border-left-color: var(--blue); font-weight: 600; }
.toc a.here::before { color: var(--blue); }

.chapter { padding-top: 0.4rem; scroll-margin-top: 84px; }
.chapter + .chapter { margin-top: clamp(2.8rem, 6vw, 4.6rem); padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--rule-soft); }
.chapter > header { display: grid; grid-template-columns: auto 1fr; gap: 0 1.1rem; align-items: baseline; margin-bottom: 1.5rem; }
.chapter .no { font: italic 800 clamp(2.6rem, 5vw, 3.8rem)/0.9 var(--display); font-stretch: 112%; color: var(--blue); letter-spacing: -0.03em; }
.chapter h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.prose { font: 400 1.09rem/1.68 var(--serif); }
.prose p { max-width: 66ch; }
/* a shelf inside a chapter: set apart by its rule and its space, and left
   unnumbered - the numbers belong to the chapters */
.prose h3 { font-size: 1.2rem; margin: 2.2em 0 0.9em; padding-top: 0.9em; max-width: 66ch;
            border-top: 1px solid var(--rule-soft); }
.prose h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p + p, .prose ul + p, .prose .tablewrap + p, .prose figure + p { margin-top: 1em; }
.prose strong { font-family: var(--text); font-weight: 600; font-size: 0.97em; letter-spacing: 0.005em; }
.prose ul { margin: 1em 0 0; padding: 0; list-style: none; max-width: 66ch; display: grid; gap: 0.7em; }
.prose li { padding-left: 1.4rem; position: relative; }
.prose li::before { content: ""; position: absolute; left: 0; top: 0.78em; width: 0.6rem; height: 2px; background: var(--blue); }
.prose code { font-size: 0.86em; padding: 0.12em 0.36em; border-radius: 3px; background: var(--paper-2); box-shadow: 0 0 0 1px var(--rule-soft); white-space: nowrap; }
.prose .tablewrap { margin-top: 1.3em; font: 400 0.96rem/1.5 var(--text); }
.prose td code { white-space: normal; }
.prose figure { margin: 1.8em 0 0; max-width: 46rem; }
.prose figure img { border-radius: 8px; box-shadow: var(--photo-shadow); width: 100%; }

/* a key, as a key */
kbd {
  display: inline-block; font: 600 0.74em/1 var(--text); letter-spacing: 0.04em; color: var(--key-ink); white-space: nowrap;
  padding: 0.34em 0.55em 0.4em; border-radius: 4px; vertical-align: 0.1em; margin-inline: 0.05em;
  background: linear-gradient(var(--key-hi), var(--key) 50%, var(--key-lo));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 255, 255, 0.28) inset, 0 2px 0 rgba(0, 0, 0, 0.3);
}
.plus { font: 500 0.8em/1 var(--mono); color: var(--ink-3); margin-inline: 0.12em; }

/* ======================================================================== */
/* Abort, Retry, Fail?                                                       */
/* ======================================================================== */
.dos {
  min-height: 100vh; margin: 0; background: #000; color: #aaa; display: grid; place-items: center; padding: 2rem;
  font: 400 clamp(0.95rem, 2.4vw, 1.25rem)/1.5 var(--mono);
}
.dos main { width: min(100%, 46rem); }
.dos p { max-width: none; margin: 0; white-space: pre-wrap; }
.dos a { color: #fff; }
.dos .hi { color: #fff; }
.dos .cur { display: inline-block; width: 0.6em; height: 0.12em; background: #aaa; vertical-align: -0.1em; animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
