/* ██╗  ██╗██████╗  ██████╗ ███████╗
 * ██║ ██╔╝██╔══██╗██╔═══██╗██╔════╝
 * █████╔╝ ██║  ██║██║   ██║███████╗
 * ██╔═██╗ ██║  ██║██║   ██║╚════██║
 * ██║  ██╗██████╔╝╚██████╔╝███████║
 * ╚═╝  ╚═╝╚═════╝  ╚═════╝ ╚══════╝
 * ---------------------------------
 *   kdos.dev — the homepage's stylesheet
 * ---------------------------------
 *
 * EVERY COLOUR IS A CUSTOM PROPERTY OF THE ACCENT. mksite.py writes them into
 * the page from libkcolor's KCOL_SCHEMES, one rule per accent on
 * <html data-accent>: the nine fields as --pri --dim --sec --urg --deep
 * --text --var --pdark --bd, and the colours made from them (--muted, --line,
 * --line-soft, --glow, --scan, --crt-hue, --crt-sat), each held to WCAG AA
 * by the generator. A colour written here would be a second palette, and the
 * page would stop following the accent.
 *
 * Text is set only in --text, --muted or --pri, on --deep, --var, --bd or
 * --line-soft (inline code, KDOS's row of the comparison, and a hovered or
 * open item in the bar along the top): the pairs mksite.py checks.
 *
 * Body copy is the reader's own system face; headings, labels and the retro
 * furniture are Terminus, a bitmap face, at its sharp sizes (12 to 24 in
 * steps of 2, then 28 and 32 px); code is JetBrains Mono.
 */

@font-face {
  font-family: "Terminus";
  src: url(fonts/terminus.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Terminus";
  src: url(fonts/terminus-bold.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(fonts/jetbrains-mono.woff2) format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(fonts/jetbrains-mono-bold.woff2) format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-pixel: "Terminus", ui-monospace, "DejaVu Sans Mono", monospace;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1180px;
  --gutter: 16px;
  --radius: 6px;
  --top: 60px;
}

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

html {
  background: var(--deep);
  color: var(--text);
  scroll-padding-top: calc(var(--top) + 12px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--deep);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--font-body);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; }

a { color: var(--pri); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--line-soft);
  border-radius: 3px;
  padding: 0.08em 0.36em;
}
/* mksite.py marks a short code span, and each hyphenated word of a long one,
 * to stay on one line: a break after the hyphen splits a command's name. */
code.nw, code .nw { white-space: nowrap; }

kbd {
  font-family: var(--font-pixel);
  font-size: 14px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0 4px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

html:not(.js) .js-only { display: none !important; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--pri);
  color: var(--deep);
  font: 700 16px var(--font-pixel);
  padding: 10px 14px;
  text-decoration: none;
}
.skip:focus { top: 10px; }

/* ── the bar along the top ─────────────────────────────────────────── */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--deep);
  border-bottom: 1px solid var(--line-soft);
}
.top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 3px;
  border-top: 1px solid var(--line-soft);
  pointer-events: none;
}
.top__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--top);
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font: 700 22px/1 var(--font-pixel);
  letter-spacing: 0.08em;
}
/* image-rendering: pixelated goes only on art drawn at or above its own
 * size: shrinking by nearest neighbour drops whole rows and columns of
 * pixels, and with them strokes of the lettering on a cover or card. */
.brand img { image-rendering: pixelated; width: 32px; height: 32px; }

/* The menu: a group of one link is a link of the bar, a group of more a
 * <details> dropdown, which opens with no script and from the keyboard;
 * site.js closes it on Escape, on a click outside it and when another opens. */
.nav { flex: 1; }
.nav ul, .menu__nav ul { list-style: none; margin: 0; padding: 0; }
.nav__list { display: flex; gap: 2px; align-items: center; }
.nav__list > li { position: relative; }
.nav__link, .dd__panel a, .menu__nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font: 400 16px/1 var(--font-pixel);
  letter-spacing: 0.06em;
  padding: 10px 12px;
  border-radius: 3px;
}
.nav__link { text-transform: uppercase; cursor: pointer; }
.nav__link:hover, .dd[open] > .nav__link, .dd__panel a:hover, .menu__nav a:hover {
  background: var(--line-soft);
  color: var(--pri);
}
.nav__link[aria-current], .nav__link.is-here { color: var(--pri); }
.nav__link[aria-current]::after, .nav__link.is-here::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -11px;
  height: 3px;
  background: var(--pri);
}
.dd > summary { list-style: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd__caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s;
}
.dd[open] .dd__caret { transform: rotate(180deg); }
.dd__panel {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  min-width: 240px;
  background: var(--var);
  border: 1px solid var(--line);
  border-top: 2px solid var(--pri);
  box-shadow: 6px 6px 0 var(--line-soft);
  padding: 6px;
  z-index: 60;
  animation: dd-in 0.14s ease-out;
}
.dd__panel a { padding: 11px 12px; }
.dd__panel a[aria-current] { color: var(--pri); }
.dd__panel a[aria-current]::before { content: "> "; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } }

.menu { display: none; position: relative; }
.menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 400 16px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu__icon, .menu__icon::before, .menu__icon::after {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
}
.menu__icon { position: relative; }
.menu__icon::before, .menu__icon::after { content: ""; position: absolute; left: 0; }
.menu__icon::before { top: -5px; }
.menu__icon::after { top: 5px; }
.menu[open] summary { background: var(--line-soft); color: var(--pri); }
/* The phone's menu: every group open, the links of one beside each other. */
.menu__nav {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(320px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100vh - var(--top) - 24px);
  max-height: calc(100dvh - var(--top) - 24px);
  overflow-y: auto;
  background: var(--var);
  border: 1px solid var(--line);
  box-shadow: 6px 6px 0 var(--line-soft);
  padding: 8px;
  z-index: 60;
}
.menu__top { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 6px; border-bottom: 1px dotted var(--line); }
.menu__top a { text-transform: uppercase; }
.menu__group { padding: 6px 0; border-bottom: 1px dotted var(--line); }
.menu__group:last-child { border-bottom: 0; }
.menu__label {
  margin: 4px 12px 2px;
  font: 400 14px/1.2 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.menu__nav a { padding: 10px 12px; }
.menu__nav a[aria-current] { color: var(--pri); }

.crt-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 12px;
  font: 400 16px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.crt-toggle:hover { color: var(--pri); border-color: var(--pri); }
.crt-toggle__box {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  display: inline-block;
  position: relative;
}
.crt-toggle[aria-pressed="true"] { color: var(--pri); border-color: var(--pri); }
.crt-toggle[aria-pressed="true"] .crt-toggle__box::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: currentColor;
}

/* ── the hero ──────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(50% 70% at 76% 50%, var(--glow), transparent 70%),
    radial-gradient(130% 100% at 50% 0%, var(--bd), var(--deep) 72%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, var(--scan) 2px 4px);
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: 56px;
  padding-top: 64px;
  padding-bottom: 72px;
}
.hero__title { margin: 0; line-height: 0; }
.hero__banner {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  margin-left: -10px;
}
.hero__subtitle {
  display: block;
  margin: 6px 0 16px;
  font: 700 28px/1.15 var(--font-pixel);
  color: var(--pri);
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px var(--glow);
}
.hero__pitch {
  margin: 0;
  max-width: 42ch;
  font-size: 1.1875rem;
  line-height: 1.6;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0 0;
}
.hero__note {
  margin: 18px 0 0;
  font: 400 16px/1.4 var(--font-pixel);
  color: var(--muted);
  letter-spacing: 0.02em;
}
.hero__item { white-space: nowrap; }

/* The frame: a monitor's rounded bezel, lit by the accent, round the
 * desktop as it is in each accent in turn. site.js lays the next picture
 * over the last and fades it in; without script, or with reduced motion,
 * the frame holds the reader's accent. */
.hero__art { position: relative; }
.hero__frame { margin: 0; position: relative; }
.hero__bezel {
  position: relative;
  padding: 14px 14px 30px;
  border-radius: 22px;
  background: linear-gradient(160deg, var(--line-soft), var(--var) 40%, var(--deep));
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 1px var(--deep),
    0 0 60px var(--glow),
    0 30px 60px rgb(0 0 0 / 0.35);
}
.hero__screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px / 14px;
  background: var(--deep);
  box-shadow: inset 0 0 0 2px var(--deep);
}
.hero__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.1), transparent 34%),
    repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 0.14) 2px 3px),
    radial-gradient(ellipse at center, transparent 60%, rgb(0 0 0 / 0.45) 100%);
}
.hero__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero__shot.is-next { opacity: 0; transition: opacity 0.9s ease; }
.hero__shot.is-next.is-in { opacity: 1; }
.hero__led {
  position: absolute;
  right: 22px;
  bottom: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pri);
  box-shadow: 0 0 8px var(--pri);
}
.hero__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 6px 0 120px;
  font: 400 16px/1.3 var(--font-pixel);
  color: var(--muted);
}
.hero__cmd [data-hero-name] { color: var(--pri); }
.hero__pause {
  font: 400 14px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 9px;
  cursor: pointer;
}
.hero__pause:hover, .hero__pause.is-on { color: var(--pri); border-color: var(--pri); }
.hero__penguin {
  position: absolute;
  left: -26px;
  bottom: -14px;
  width: 128px;
  height: auto;
  filter: drop-shadow(0 0 18px var(--glow));
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border: 2px solid var(--pri);
  border-radius: 3px;
  background: var(--deep);
  color: var(--pri);
  font: 700 18px/1 var(--font-pixel);
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--line);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--line); text-decoration: none; }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--line); }
.btn--primary { background: var(--pri); color: var(--deep); }
.btn--primary::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url(art/pixel-floppy.png) center / contain no-repeat;
  mask: url(art/pixel-floppy.png) center / contain no-repeat;
}
.btn[aria-pressed="true"] { background: var(--pri); color: var(--deep); }

/* The accent picker under the hero's buttons. */
.look {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 30px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  width: fit-content;
  max-width: 100%;
  background: var(--deep);
}
.look__label {
  font: 400 14px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.look__swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  background:
    linear-gradient(var(--sw-pri), var(--sw-pri)) 6px 6px / 14px 8px no-repeat,
    linear-gradient(var(--sw-sec), var(--sw-sec)) 6px 16px / 8px 4px no-repeat,
    var(--sw-deep);
}
.swatch:hover { border-color: var(--pri); }
.swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 2px var(--deep), 0 0 0 4px var(--pri); }
/* The chosen swatch or card wears a solid ring in the primary; the keyboard's
 * focus is a dashed outline in the text colour outside that ring, so focus
 * and choice never look alike. */
.swatch:focus-visible { outline: 2px dashed var(--text); outline-offset: 6px; }
.look__name {
  font: 700 16px/1 var(--font-pixel);
  color: var(--pri);
  min-width: 9ch;
  white-space: nowrap;
}
.look__name::before { content: "> "; color: var(--muted); }
.look__via { font: 400 14px/1 var(--font-pixel); color: var(--muted); }
.look__via:empty { display: none; }

/* The 88x31 buttons. */
.badges {
  list-style: none;
  margin: 0;
  padding: 22px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--deep);
}
.badges li { line-height: 0; }
.badge {
  width: 88px;
  height: 31px;
  image-rendering: pixelated;
}

/* ── sections ──────────────────────────────────────────────────────── */

.section {
  padding: 68px 0;
  border-bottom: 1px solid var(--line-soft);
}
.section--help-and-contributing, .section--licence { padding: 52px 0; }
.section:nth-of-type(odd) { background: var(--bd); }

.section h2 {
  margin: 0 0 28px;
  font: 700 32px/1.1 var(--font-pixel);
  color: var(--pri);
  letter-spacing: 0.01em;
  text-shadow: 0 0 16px var(--glow);
  position: relative;
  padding-bottom: 18px;
  /* A wrapped heading's second line starts under the text, not the marker. */
  padding-left: 1.45em;
  text-indent: -1.45em;
  text-wrap: balance;
}
/* The marker's ▐ is inked in its right half alone, so it is pulled half a
 * cell left to start where the text column does; the space after it is a
 * margin, since a space in content: after an escape is read as the escape's
 * end. */
.section h2::before {
  content: "\2590\2591";
  content: "\2590\2591" / "";
  margin: 0 0.4em 0 -0.5ch;
  color: var(--line);
  text-shadow: none;
}
.section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 240px;
  max-width: 100%;
  height: 8px;
  background: var(--pri);
  opacity: 0.55;
  -webkit-mask: url(art/rule-dither.png) left center / 240px 8px no-repeat;
  mask: url(art/rule-dither.png) left center / 240px 8px no-repeat;
}
.section h3 {
  margin: 36px 0 12px;
  font: 700 22px/1.2 var(--font-pixel);
  color: var(--text);
}
.section p, .section li { max-width: 74ch; }
.section h2 + p { font-size: 1.125rem; }

.section ul:not([class]) {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}
.section ul:not([class]) > li {
  position: relative;
  padding-left: 1.6em;
  margin: 8px 0;
}
.section ul:not([class]) > li::before {
  content: "";
  position: absolute;
  left: 0.1em;
  top: 0.42em;
  width: 0.8em;
  height: 0.8em;
  background: var(--pri);
  -webkit-mask: url(art/bullet.png) center / contain no-repeat;
  mask: url(art/bullet.png) center / contain no-repeat;
}

/* Code: a terminal pane, with a copy button site.js adds. */
.code {
  position: relative;
  margin: 16px 0;
  max-width: 100%;
}
.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--var);
  border: 1px solid var(--line);
  border-left: 4px solid var(--pri);
  border-radius: 3px;
  font: 400 14px/1.6 var(--font-mono);
  color: var(--text);
  tab-size: 4;
}
.code code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
/* The copy button sits on the pane's top edge, above the first line of code
 * and clear of it however far the pane scrolls, and is always shown: a touch
 * screen has no hover to reveal it. */
.code:has(.code__copy) { margin-top: 28px; }
.code__copy {
  position: absolute;
  top: -13px;
  right: 10px;
  font: 400 12px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--var);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 8px;
  cursor: pointer;
}
.code__copy:hover, .code__copy.is-done { color: var(--pri); border-color: var(--pri); }

/* Tables. */
.table-wrap { overflow-x: auto; margin: 18px 0; max-width: 100%; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.table th, .table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.table thead th {
  font: 700 16px/1.2 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
}
.table tbody th { font-weight: 700; white-space: nowrap; }
/* The comparison: the distributions' names wrap in a narrow first column,
 * so the seven columns of facts get the width, and KDOS's own row is
 * marked. */
.section--side-by-side .table tbody th { white-space: normal; width: 9rem; }
.section--side-by-side .table tbody tr:first-child { background: var(--line-soft); box-shadow: inset 3px 0 0 var(--pri); }
.section--side-by-side .table tbody tr:first-child th { color: var(--pri); }
/* Code in the marked row would share its fill and lose its chip. */
.section--side-by-side .table tbody tr:first-child code { background: var(--deep); }
/* A command stays on one line only where the table is wide enough to give
 * its description column room; narrower, it wraps at its spaces. */
@media (min-width: 1041px) {
  .table td code { white-space: nowrap; }
}

/* The specification sheet. */
.facts {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: var(--deep);
}
.facts th, .facts td {
  text-align: left;
  vertical-align: top;
  padding: 11px 16px;
  border-bottom: 1px dotted var(--line);
}
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.facts th {
  width: 9.5em;
  font: 700 16px/1.6 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pri);
  border-right: 1px solid var(--line);
}

/* A terminal window. */
.term {
  margin: 0;
  background: var(--var);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--line-soft);
}
.term__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 8px 12px;
  font: 400 14px/1 var(--font-pixel);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--deep);
}
.term__bar::after {
  content: "\2013  \25A1  \2715";
  position: absolute;
  right: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
}
.term__body {
  margin: 0;
  padding: 16px 18px 18px;
  font: 400 14px/1.55 var(--font-mono);
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
}
.term__prompt { color: var(--pri); font-weight: 700; }
.term__cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.15em;
  vertical-align: text-bottom;
  background: var(--pri);
  animation: blink 1.1s steps(1) 4;
}
/* Four blinks, under the five seconds after which WCAG asks for a way to stop
 * a blink; the cursor then stays lit. */
@keyframes blink { 50% { opacity: 0; } }

/* Wide screens set a few text sections in two columns: Status and limits'
 * list, and Build it yourself's prose with its commands beside it. */
@media (min-width: 1041px) {
  .section--status-and-limits .wrap > ul { columns: 2; column-gap: 44px; }
  .section--status-and-limits .wrap > ul > li { max-width: none; break-inside: avoid; }
  .section--status-and-limits .wrap > ul > li:first-child { margin-top: 0; }
  /* The prose rows take their own height and the last one the rest, so the
   * column reads at the text's own spacing however tall the commands are. */
  .section--building .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    column-gap: 44px;
    row-gap: 0;
    align-items: start;
  }
  .section--building h2 { grid-column: 1 / -1; }
  .section--building .wrap > p, .section--building .wrap > ul { grid-column: 1; margin: 0 0 16px; }
  .section--building .wrap > .code { grid-column: 2; grid-row: 2 / span 3; margin-top: 0; }
}

/* The FAQ in two columns, each question kept with the start of its
 * answer. */
@media (min-width: 1041px) {
  [data-slug="faq"] .section .wrap { columns: 2; column-gap: 44px; }
  [data-slug="faq"] .section h2 { column-span: all; }
  [data-slug="faq"] .section h3 { break-after: avoid; }
  [data-slug="faq"] .section .wrap > :not(h2) { break-inside: avoid; }
  [data-slug="faq"] .section h2 + h3 { margin-top: 0; }
  /* Try KDOS: the words on the left, its buttons stacked on the right. */
  .section--try-kdos .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    column-gap: 56px;
    align-items: start;
  }
  .section--try-kdos h2 { grid-column: 1 / -1; }
  .section--try-kdos .wrap > p { grid-column: 1; }
  .section--try-kdos .actions {
    grid-column: 2; grid-row: 2 / span 2; margin: 0;
    flex-direction: column; align-items: stretch;
  }
  .section--try-kdos .actions .btn { justify-content: center; }
  /* The release list fills the width, two cards to a row. */
  .newslist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .newslist .release { max-width: none; height: 100%; }
}
.section--at-a-glance .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 0 36px;
  align-items: start;
}
.section--at-a-glance h2 { grid-column: 1 / -1; }
.section--at-a-glance .table-wrap { margin: 0; grid-column: 1; }
.section--at-a-glance .term { grid-column: 2; grid-row: 2; }
/* Beside the long specification sheet the terminal keeps to the top of the
 * screen, so the column beside the sheet is never empty. */
@media (min-width: 1041px) {
  .section--at-a-glance .term { position: sticky; top: calc(var(--top) + 24px); }
}
.facts code { white-space: nowrap; }

/* ── the gallery ───────────────────────────────────────────────────── */

.gallery__group { margin-top: 44px; }
/* mksite.py gives each group the column count that fills its rows on a
 * wide screen, and may feature its first picture across two columns and two
 * rows; narrower screens take two columns, which every such shape fills. */
.gallery__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 18px;
}
.gallery__grid > .is-featured { grid-column: span 2; }
/* A featured picture spans two rows, which its own 16:9 does not fill once
 * the rows' captions are counted, so its frame grows to their height and the
 * picture sits whole in the middle of it. */
@media (min-width: 1041px) {
  .gallery__grid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery__grid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery__grid[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .gallery__grid > .is-featured { grid-row: span 2; display: flex; }
  .gallery__grid > .is-featured figure { flex: 1; display: flex; flex-direction: column; }
  .gallery__grid > .is-featured .shot { flex: 1; min-height: 0; }
  .gallery__grid > .is-featured .shot__img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
  .gallery__grid > .is-featured figcaption { font-size: 18px; color: var(--text); }
}
.gallery figure { margin: 0; }
.gallery figcaption {
  margin-top: 9px;
  font: 400 16px/1.3 var(--font-pixel);
  color: var(--muted);
}
.shot {
  display: block;
  position: relative;
  line-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--deep);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 0.22) 2px 3px);
  opacity: 0;
  transition: opacity 0.15s;
}
.shot:hover, .shot:focus-visible {
  transform: translateY(-3px);
  border-color: var(--pri);
  box-shadow: 0 10px 30px var(--glow);
}
.shot:hover::after, .shot:focus-visible::after { opacity: 1; }
.shot__img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--deep);
}
/* A thumbnail with a focus: zoomed onto the point --fx, --fy, so the
 * window it is about fills the tile; .shot clips the rest. */
.shot__img--focus {
  transform: scale(var(--zoom, 1));
  transform-origin: var(--fx, 50%) var(--fy, 50%);
}
.gallery li:has(.shot:hover) figcaption,
.gallery li:has(.shot:focus-visible) figcaption { color: var(--pri); }

/* The lightbox site.js opens. */
.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--deep);
  color: var(--text);
}
.lightbox::backdrop { background: var(--deep); }
.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font: 400 16px/1 var(--font-pixel);
}
.lightbox__count { color: var(--muted); letter-spacing: 0.06em; }
/* The picture and its caption are one block in the middle of the space
 * under the bar: the picture shrinks to fit that space and keeps its shape,
 * and a picture smaller than the space keeps its caption under it rather
 * than at the foot of the screen. */
.lightbox__fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px 64px 12px;
  min-height: 0;
}
.lightbox__img {
  flex: 0 1 auto;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  background: var(--deep);
}
.lightbox__cap {
  flex: none;
  max-width: 80ch;
  padding: 12px 0 4px;
  text-align: center;
  color: var(--text);
}
.lightbox__tools { display: flex; gap: 10px; }
.lightbox__close, .lightbox__play, .lightbox__nav {
  font: 400 16px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--var);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 12px;
  cursor: pointer;
}
.lightbox__close:hover, .lightbox__play:hover, .lightbox__nav:hover { color: var(--pri); border-color: var(--pri); }
.lightbox__play.is-on { color: var(--pri); border-color: var(--pri); }
.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  padding: 18px 12px;
  font-size: 20px;
}
.lightbox__prev { left: 10px; }
.lightbox__next { right: 10px; }

/* ── feature cards ─────────────────────────────────────────────────── */

.cards {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 18px;
}
.card {
  position: relative;
  background: var(--var);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--line); transform: translateY(-2px); }
.card::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: -1px;
  height: 2px;
  background: var(--pri);
  opacity: 0.6;
}
.card h3 { margin: 16px 0 8px; font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.card p + p { margin-top: 10px; }

/* ── the accents ───────────────────────────────────────────────────── */

.accents {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin: 32px 0 36px;
}
.monitor { margin: 0; }
.monitor__frame { position: relative; width: 100%; }
.monitor__screen {
  position: absolute;
  overflow: hidden;
  background: var(--deep);
  border-radius: 1.6% / 2.8%;
}
.monitor__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(160deg, rgb(255 255 255 / 0.08), transparent 36%),
    repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 0.16) 2px 3px),
    radial-gradient(ellipse at center, transparent 62%, rgb(0 0 0 / 0.42) 100%);
}
.monitor__shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.monitor__bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.monitor__caption {
  margin: 14px auto 0;
  max-width: 60ch;
  min-height: 3.2em;
  text-align: center;
  font: 400 16px/1.45 var(--font-pixel);
  color: var(--muted);
}
.monitor__screen.is-degauss { animation: degauss 0.55s ease-out; }
@keyframes degauss {
  0% { filter: hue-rotate(80deg) saturate(3) blur(1.5px); transform: scale(1.012) skewX(1.2deg); }
  35% { filter: hue-rotate(-50deg) saturate(2) blur(0.6px); transform: scale(0.996) skewX(-0.6deg); }
  100% { filter: none; transform: none; }
}

.accents__cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 14px;
}
.accents__cards > li { display: flex; }
.acard {
  flex: 1;
  display: block;
  position: relative;
  padding: 18px 12px 12px;
  background: var(--c-deep);
  color: var(--c-text);
  border: 4px double var(--c-pri);
  border-radius: 2px;
  text-decoration: none;
  font: 400 16px/1.25 var(--font-pixel);
  transition: transform 0.12s, box-shadow 0.12s;
}
.acard:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgb(0 0 0 / 0.3); }
.acard[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--deep), 0 0 0 6px var(--pri);
}
.acard:focus-visible { outline: 2px dashed var(--text); outline-offset: 9px; }
.acard__tab {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-pri);
  color: var(--c-deep);
  font: 700 16px/1.4 var(--font-pixel);
  letter-spacing: 0.08em;
  padding: 0 8px;
  white-space: nowrap;
}
.acard__theme { display: block; }
.acard__theme small {
  white-space: nowrap;
  font: 400 12px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-deep);
  background: var(--c-text);
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: 2px;
}
.acard__chips { display: flex; gap: 4px; margin: 10px 0; }
.acard__chips i { flex: 1; height: 14px; display: block; }
.acard__cmd { display: block; color: var(--c-pri); font-size: 14px; }
.accents__crt { margin: 26px 0 0; }

/* ── steps ─────────────────────────────────────────────────────────── */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.step {
  counter-increment: step;
  position: relative;
  min-width: 0;
  max-width: none !important;
  background: var(--var);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px 26px 22px 96px;
}
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 24px;
  top: 20px;
  font: 700 32px/1 var(--font-pixel);
  color: var(--pri);
  text-shadow: 0 0 14px var(--glow);
}
.step h3 { margin-top: 0; }
.step > p:last-child, .step > .code:last-child { margin-bottom: 0; }

.note {
  border-left: 4px solid var(--pri);
  background: var(--var);
  padding: 14px 18px;
  margin: 18px 0;
}

/* ── the band at the top of a page ─────────────────────────────────── */

.pagehead {
  position: relative;
  isolation: isolate;
  padding: 64px 0 52px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(60% 120% at 88% 0%, var(--glow), transparent 70%),
    linear-gradient(var(--bd), var(--deep));
}
.pagehead::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, var(--scan) 2px 4px);
}
.pagehead h1 {
  margin: 0;
  font: 700 40px/1.1 var(--font-pixel);
  color: var(--pri);
  letter-spacing: 0.01em;
  text-shadow: 0 0 18px var(--glow);
}
.pagehead__icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  background: var(--pri);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  filter: drop-shadow(0 0 10px var(--glow));
}
/* A wide screen sets the page's icon large beside its heading, lit by the
 * band's glow; narrower, the small icon above the heading is the only one.
 * The icon sits at the top of the band and the glow is sized and placed
 * in px about the icon's centre (64px of padding, 20px, half of 192px), so a
 * band made tall by its text or a picture neither moves the icon away from
 * the heading nor stretches the glow into a smear. */
.pagehead__art { display: none; }
@media (min-width: 1041px) {
  .pagehead--art {
    background:
      radial-gradient(260px 260px at 82% 180px, var(--glow), transparent 70%),
      linear-gradient(var(--bd), var(--deep));
  }
  .pagehead--art .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 48px;
    align-items: start;
  }
  .pagehead--art .pagehead__icon { display: none; }
  .pagehead__wide { grid-column: 1 / -1; }
  .pagehead__wide > .figure:first-child { margin-top: 0; }
  .pagehead__art {
    display: block;
    justify-self: center;
    margin-top: 20px;
    width: 192px;
    height: 192px;
    background: var(--pri);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 22px var(--glow));
  }
}
.pagehead__crumb { margin: 0 0 10px; font: 400 16px/1 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.08em; }
.pagehead__crumb a::before { content: "< "; }
.pagehead__date { margin: 12px 0 0; font: 400 16px/1 var(--font-pixel); color: var(--muted); letter-spacing: 0.04em; }
.pagehead__lede > p { max-width: 68ch; margin: 18px 0 0; font-size: 1.1875rem; line-height: 1.6; }
.pagehead__lede .js-only > p { font-size: 1rem; color: var(--muted); }

/* ── the homepage's tiles, strip, books and release card ───────────── */

.tiles {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.tiles > li { display: flex; }
.tile {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 24px 24px 20px;
  background: var(--var);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tile::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: -1px;
  height: 2px;
  background: var(--pri);
  opacity: 0.6;
}
.tile:hover, .tile:focus-visible { border-color: var(--pri); transform: translateY(-3px); box-shadow: 0 12px 30px var(--glow); }
.tile__icon, .card__icon {
  display: block;
  width: 32px;
  height: 32px;
  background: var(--pri);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.section .tile__title { margin: 16px 0 8px; font-size: 20px; color: var(--text); }
.tile p { margin: 0 0 16px; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.tile__more {
  margin-top: auto;
  font: 400 14px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pri);
}
.tile__more::after { content: " \2192"; }

.strip {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 18px;
}
.strip__item { display: block; color: var(--muted); text-decoration: none; }
.strip__item:focus-visible { outline: none; }
.strip__item:hover .shot, .strip__item:focus-visible .shot {
  transform: translateY(-3px);
  border-color: var(--pri);
  box-shadow: 0 10px 30px var(--glow);
}
.strip__item:focus-visible .shot { outline: 2px solid var(--pri); outline-offset: 3px; }
.strip__title {
  display: block;
  margin-top: 10px;
  font: 400 16px/1.3 var(--font-pixel);
  color: var(--muted);
}
.strip__item:hover .strip__title { color: var(--pri); }

.books {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.bookcard {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding: 26px;
  background: var(--var);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.bookcard__cover { display: block; line-height: 0; transition: transform 0.2s; }
.bookcard__cover:hover { transform: translateY(-4px) rotate(-1deg); }
.bookcard__img {
  width: 100%;
  height: auto;
  filter: drop-shadow(8px 10px 0 var(--line-soft)) drop-shadow(0 0 22px var(--glow));
}
.section .bookcard h3 { margin: 4px 0 6px; font-size: 24px; }
.bookcard h3 a { color: var(--text); text-decoration: none; }
.bookcard h3 a:hover { color: var(--pri); }
.bookcard__stats {
  margin: 0 0 14px;
  font: 400 15px/1.4 var(--font-pixel);
  color: var(--pri);
  letter-spacing: 0.03em;
}
.bookcard p { color: var(--muted); font-size: 1rem; }
.bookcard__body { display: flex; flex-direction: column; height: 100%; }
/* The cards share a row's height; each ends on its buttons. */
.bookcard__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 20px; }
.bookcard__actions .btn { font-size: 16px; padding: 11px 16px; }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 6px; }

.release {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 20px;
  align-items: start;
  max-width: 760px;
  padding: 22px 24px;
  background: var(--var);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--pri);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.release:hover, .release:focus-visible { border-color: var(--pri); transform: translateX(3px); }
.release__icon {
  grid-row: span 3;
  width: 40px;
  height: 40px;
  background: var(--pri);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.release__meta { font: 400 15px/1.4 var(--font-pixel); color: var(--muted); letter-spacing: 0.04em; }
.release__tag { color: var(--deep); background: var(--pri); padding: 1px 6px; margin-right: 6px; }
.section .release__title { margin: 6px 0 4px; font: 700 22px/1.2 var(--font-pixel); color: var(--pri); }
.release__text { color: var(--muted); font-size: 1rem; }
.newslist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 18px; }
.section .newslist > li { max-width: none; }

/* ── the books' contents ───────────────────────────────────────────── */

/* Columns, not a grid: the parts differ in length from one chapter to
 * sixty, and a grid row would stretch each card to its longest neighbour. */
.toc {
  columns: 3 300px;
  column-gap: 18px;
  margin-top: 24px;
}
.toc__part {
  break-inside: avoid;
  margin: 0 0 18px;
  background: var(--var);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.section .toc__part h3 { margin: 0 0 10px; font-size: 18px; color: var(--pri); }
.toc__part h3 a { color: inherit; text-decoration: none; }
.toc__part h3 a:hover { text-decoration: underline; }
.toc__part ol, .toc__part ul { margin: 0; padding-left: 2.4em; font-size: 0.97rem; }
.toc__part ul { list-style: square; padding-left: 1.4em; }
.section .toc__part li { margin: 6px 0; }
.toc__text { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.section .toc__generated { margin: 8px 0 0; color: var(--muted); font-size: 0.93rem; }

/* ── a picture in a section, and the press kit's art ───────────────── */

.figure { margin: 22px 0 8px; max-width: 760px; }
/* A section with pictures: text and pictures side by side on a wide
 * screen, the pictures on alternate sides from one section to the next. */
@media (min-width: 1041px) {
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 0 48px;
    align-items: start;
  }
  .split__text > :first-child, .split__media > .figure:first-child { margin-top: 0; }
  .section:nth-of-type(even) .split__media { order: -1; }
}
.figure figcaption { margin-top: 10px; font: 400 16px/1.4 var(--font-pixel); color: var(--muted); }

.artkit { display: grid; gap: 22px; margin-top: 22px; }
.artkit__row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.artkit__row a {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 14px;
  background: var(--c-bd);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s;
}
.artkit__row a:hover { border-color: var(--pri); }
.artkit__img { width: 100%; height: 110px; object-fit: contain; }
.artkit__row--tall .artkit__img { height: 220px; }
.artkit__row span {
  font: 400 14px/1.3 var(--font-pixel);
  color: var(--text);
  background: var(--deep);
  padding: 4px 6px;
  align-self: flex-start;
}

/* ── footer ────────────────────────────────────────────────────────── */

.foot {
  padding: 48px 0 40px;
  border-top: 4px double var(--line);
  background: var(--deep);
}
.foot__inner {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.foot__brand { display: flex; flex-direction: column; gap: 12px; }
.foot__brand p { margin: 0; color: var(--muted); font: 400 16px/1.4 var(--font-pixel); }
.foot__brand strong { font: 700 20px var(--font-pixel); color: var(--pri); }
.foot__penguin { width: 91px; height: auto; }
/* Each column is as wide as its longest link, which keeps to one line; the
 * columns share what is left between them and wrap to a second row when the
 * screen cannot hold them. */
.foot__nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 28px; }
.foot__col a { white-space: nowrap; }
.foot__label {
  margin: 0 0 10px;
  font: 700 16px/1 var(--font-pixel);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pri);
}
.foot__col ul { list-style: none; margin: 0; padding: 0; }
.foot__col li { margin: 7px 0; font-size: 0.95rem; }
.foot__col a { color: var(--text); text-decoration: none; }
.foot__col a:hover { color: var(--pri); text-decoration: underline; }
.foot__col a[aria-current] { color: var(--pri); }
.foot__small { margin: 32px 0 0; padding-top: 18px; border-top: 1px dotted var(--line); color: var(--muted); font-size: 0.9rem; }

/* ── the 404 page ──────────────────────────────────────────────────── */

.section--not-found { min-height: 50vh; }
.notfound { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; }
.notfound__penguin {
  justify-self: center;
  width: 182px;
  height: auto;
  filter: drop-shadow(0 0 18px var(--glow));
}
@media (min-width: 800px) {
  .notfound { grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; }
}
.term--small { max-width: 640px; margin: 0 0 24px; }
/* The 404 terminal wraps: its error line holds whatever path was asked for,
 * and a phone shows no scrollbar to say the rest is off the edge. */
.term--small .term__body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── Phosphor mode ─────────────────────────────────────────────────────
 * The page as a CRT: the bitmap face everywhere, a phosphor glow on the
 * text, scanlines and a vignette over the whole screen, and every picture
 * tinted to the accent but the monitor's, which shows the real Phosphor mode
 * in its own green; those whose colours are what they show
 * (shot__img--colour: the accents' own and the ones the gallery's `colour:`
 * names); and the lightbox's, where a reader enlarges a picture to see its
 * real colours. Like `kdos phosphor on`, it keeps the accent unless that is
 * one of the accents a CRT does not suit (site.js and the head script read
 * them from <html data-crt-pairs>), which give way to phosphor.
 */

[data-phosphor="on"] body {
  font-family: var(--font-pixel);
  font-size: 18px;
  line-height: 1.55;
  text-shadow: 0 0 1px var(--pri), 0 0 9px var(--glow);
}
[data-phosphor="on"] .hero__pitch { font-size: 20px; }
[data-phosphor="on"] .code pre, [data-phosphor="on"] .term__body, [data-phosphor="on"] code {
  font-family: var(--font-pixel);
  font-size: 16px;
}
[data-phosphor="on"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 0.26) 2px 3px),
    radial-gradient(ellipse 120% 100% at center, transparent 58%, rgb(0 0 0 / 0.6) 100%);
}
[data-phosphor="on"] .shot__img:not(.shot__img--colour),
[data-phosphor="on"] .badge {
  filter: grayscale(1) sepia(1) hue-rotate(var(--crt-hue)) saturate(var(--crt-sat)) brightness(0.95) contrast(1.08);
}
[data-phosphor="on"] .acard { filter: saturate(0.85); }

/* The power-on: a line that opens to the whole screen. */
.crt-power::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background: var(--pri);
  animation: power 0.6s ease-out forwards;
}
@keyframes power {
  0% { transform: scale(0.02, 0.003); opacity: 1; }
  30% { transform: scale(1, 0.003); opacity: 1; }
  55% { transform: scale(1, 1); opacity: 0.55; }
  100% { transform: scale(1, 1); opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  [data-phosphor="on"] body::after { animation: flicker 7s steps(1) infinite; }
  @keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: 0.86; } 48% { opacity: 1; } }
  .hero__penguin { animation: idle 2.4s steps(2) 2; }
  .hero__frame { animation: power-on 0.7s ease-out both; }
  @keyframes power-on { from { opacity: 0; transform: scale(0.97); filter: brightness(2); } }
  @keyframes idle { 50% { transform: translateY(-4px); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .shot:hover, .card:hover, .acard:hover, .btn:hover { transform: none; }
}

/* ── narrower screens ──────────────────────────────────────────────── */

/* The bar's links and dropdowns need about 1040px beside the brand and the
 * Phosphor toggle; narrower, they fold into the one menu. */
@media (max-width: 1100px) {
  .nav { display: none; }
  .menu { display: block; }
  /* The Phosphor toggle, first of the two on the right, takes the free
   * space before it; without script it is hidden and the menu takes it. */
  html:not(.js) .menu { margin-left: auto; }
}

@media (max-width: 1040px) {
  .section--at-a-glance .wrap { grid-template-columns: minmax(0, 1fr); }
  .section--at-a-glance .term { margin-top: 28px; grid-column: 1; grid-row: auto; }
  .accents { grid-template-columns: minmax(0, 1fr); }
  .accents__cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* One column: the frame comes straight under the title and the pitch, so
   * the first screen of a phone shows the desktop, and the buttons and the
   * picker follow it. */
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 44px; }
  .hero__text { display: contents; }
  .hero__art { order: 1; max-width: 760px; margin-top: 32px; }
  .hero__actions, .hero__note, .hero .look { order: 2; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .books { grid-template-columns: minmax(0, 1fr); }
  .foot__inner { grid-template-columns: minmax(0, 1fr); }
  .foot__brand { flex-direction: row; align-items: center; }
}

/* Where a row cannot hold every button, rows of four (382px: four 88px
 * buttons and three 10px gaps), so none is left alone on a row. Under 420px
 * the gaps close to 4px and the sides to 8px: four then take 364px, which
 * a screen of 380px or more holds. */
@media (max-width: 820px) {
  .badges { padding-left: max(var(--gutter), calc((100% - 382px) / 2));
            padding-right: max(var(--gutter), calc((100% - 382px) / 2)); }
}
@media (max-width: 420px) {
  .badges { gap: 10px 4px; padding-left: 8px; padding-right: 8px; }
}

@media (max-width: 880px) {
  /* Hidden from sight only: the button is still named Phosphor mode, not
   * Phosphor, which is also an accent's swatch. */
  .crt-toggle__more {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .hero {
    background:
      radial-gradient(80% 40% at 50% 70%, var(--glow), transparent 70%),
      radial-gradient(130% 100% at 50% 0%, var(--bd), var(--deep) 72%);
  }
  .accents__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* The step's number goes above its title, so code panes get the card's
   * whole width. */
  .step { padding: 70px 18px 20px; }
  .step::before { top: 22px; left: 18px; }
}

/* The bar along the top holds the brand, the Phosphor toggle and the menu
 * in a row: with closer gaps they fit 360px, and below that the brand is its
 * penguin alone (the link keeps its name in aria-label). */
@media (max-width: 400px) {
  .top__inner { gap: 10px; }
}
@media (max-width: 359px) {
  .brand span { display: none; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .section { padding: 56px 0; }
  .section h2 { font-size: 28px; }
  .pagehead { padding: 44px 0 38px; }
  .pagehead h1 { font-size: 32px; }
  .pagehead__lede > p { font-size: 1.0625rem; }
  .hero__subtitle { font-size: 24px; }
  .hero__pitch { font-size: 1.0625rem; }
  .hero__banner { margin-left: -6px; max-width: 340px; }
  .hero__bezel { padding: 8px 8px 22px; border-radius: 14px; }
  .hero__led { right: 14px; bottom: 8px; }
  .hero__penguin { width: 84px; left: -6px; bottom: -8px; }
  .hero__cap { margin-left: 84px; font-size: 14px; }
  .btn { padding: 12px 16px; font-size: 16px; }
  /* Stacked buttons share one width, so their offset shadows line up. */
  .hero__actions .btn, .actions .btn, .bookcard__actions .btn { flex: 1 1 100%; justify-content: center; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .strip { gap: 18px 12px; }
  .strip__title { font-size: 14px; }
  .bookcard { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px; }
  .bookcard__cover { max-width: 150px; }
  .section .bookcard h3 { font-size: 22px; }
  .release { padding: 18px; column-gap: 14px; }
  .release__icon { width: 28px; height: 28px; }
  .facts th { width: auto; white-space: normal; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table th, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .table th, .table td { border: 0; padding: 4px 0; }
  /* KDOS's stacked row is a card, its text clear of the accent bar. */
  .section--side-by-side .table tbody tr:first-child { padding: 10px 12px 10px 14px; }
  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font: 400 14px/1.4 var(--font-pixel);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
  }
  .facts th, .facts td { display: block; border-right: 0; padding: 8px 14px; }
  .facts th { border-bottom: 0; padding-top: 12px; padding-bottom: 0; }
  /* The arrows move under the caption, and the figure keeps their height
   * clear below it so they never cover its words. */
  .lightbox__fig { padding: 12px 10px 66px; }
  .lightbox__nav { top: auto; bottom: 10px; transform: none; padding: 12px; }
  .acard__cmd { font-size: 12px; white-space: nowrap; }
  .acard__cmd > span { display: none; }
  .foot__brand { flex-direction: column; align-items: flex-start; }
  .gallery__grid { gap: 16px 12px; }
  .artkit__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artkit__row--tall .artkit__img { height: 160px; }
  .gallery figcaption { font-size: 14px; }
}

@media print {
  .top, .look, .crt-toggle, .accents__crt, .code__copy, .hero__pause { display: none !important; }
  .hero::after, [data-phosphor="on"] body::after { display: none; }
}
