/* ghast.rs
   Night sky, a bone-white cube, one ember. Display type is a pixel face set only at multiples
   of 11px, where its pixels land on the screen's. Boxes have stepped corners, like the mascot. */

@font-face {
  font-family: "Departure Mono";
  src: url("fonts/departure-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --night: #15131f;
  --night-deep: #100e18;
  --dusk: #1e1b2c;
  --dusk-high: #2a2640;
  --line: #37324f;
  --bone: #efe9dc;
  --fog: #aaa4bd;
  --fog-dim: #7d7794;
  --ember: #ff8a5c;
  --ember-hot: #ff6a2b;
  --glow: #ffc46b;
  --match: #7fd8c4;
  --violet: #b9a8ff;

  --pixel: "Departure Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --step: 4px;
  --wide: 1180px;
  --top-h: 60px;
}

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

html {
  background: var(--night);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--top-h) + 20px);
}
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
body > main, body > .doc { flex: 1; }

h1, h2, h3, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a { color: var(--ember); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--glow); }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }

code, kbd { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code {
  background: var(--dusk-high);
  padding: 0.1em 0.35em;
  color: var(--bone);
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  background: var(--bone); color: var(--night); padding: 8px 14px; font-weight: 600;
}
.skip:focus { top: 12px; }

/* Stepped corners: one square notch out of each corner. */
.install, .button, pre.code, .tape, .layer-crates > li, .callout, .search input, .version,
.versions li, .pager a {
  clip-path: polygon(
    0 var(--step), var(--step) var(--step), var(--step) 0,
    calc(100% - var(--step)) 0, calc(100% - var(--step)) var(--step), 100% var(--step),
    100% calc(100% - var(--step)), calc(100% - var(--step)) calc(100% - var(--step)), calc(100% - var(--step)) 100%,
    var(--step) 100%, var(--step) calc(100% - var(--step)), 0 calc(100% - var(--step))
  );
}
/* A clipped box cannot show an outline outside itself. */
.button:focus-visible, .version:focus-visible, .pager a:focus-visible, .search input:focus-visible {
  outline-offset: -4px;
}

/* ---- top bar ---------------------------------------------------------------------------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--dusk-high);
}
.top-inner {
  max-width: var(--wide); margin: 0 auto; height: var(--top-h);
  padding: 0 24px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--bone); text-decoration: none; }
.brand-mark { width: 32px; height: 32px; }
.brand-name { font-family: var(--pixel); font-size: 22px; line-height: 1; }
.brand:hover { color: var(--bone); }
.brand:hover .brand-mark { animation: hop 0.4s steps(2) 1; }
@keyframes hop { 50% { transform: translateY(-4px); } }

.top-nav { display: flex; gap: 4px; margin-left: auto; }
.top-nav a {
  color: var(--fog); text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 6px 10px;
}
.top-nav a:hover { color: var(--bone); }
.top-nav a[aria-current] { color: var(--bone); box-shadow: inset 0 -2px 0 var(--ember); }
.version {
  font-family: var(--pixel); font-size: 11px; line-height: 1; text-decoration: none;
  color: var(--night); background: var(--match); padding: 7px 10px 6px;
}
.version:hover { color: var(--night); background: var(--bone); }

/* ---- the mascot ------------------------------------------------------------------------- */

.mascot { width: 100%; }
.mascot svg { width: 100%; height: auto; overflow: visible; }

@media (prefers-reduced-motion: no-preference) {
  /* The body floats in whole pixels of its own grid; the legs follow a beat later. */
  .hero .mascot, .lost .mascot { animation: float 3.2s steps(1) infinite; }
  .hero .m-leg, .lost .m-leg { animation: trail 3.2s steps(1) infinite; }
  .hero .m-leg-2, .hero .m-leg-5 { animation-delay: 0.2s; }
  .hero .m-leg-3 { animation-delay: 0.4s; }
  .mascot-shadow { animation: shadow 3.2s steps(1) infinite; }
}
/* One grid pixel of the hero mascot is 1/16 of its width. */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-3.125%); }
  50% { transform: translateY(-6.25%); }
  75% { transform: translateY(-3.125%); }
}
@keyframes trail {
  0%, 100% { transform: translateY(0); }
  25%, 50% { transform: translateY(1px); }
  75% { transform: translateY(0); }
}
@keyframes shadow {
  0%, 100% { transform: scaleX(1); opacity: 0.5; }
  25%, 75% { transform: scaleX(0.9); opacity: 0.42; }
  50% { transform: scaleX(0.8); opacity: 0.34; }
}

/* ---- landing: hero ---------------------------------------------------------------------- */

.hero {
  /* A few fixed stars, drawn as squares. */
  background:
    radial-gradient(circle at 50% 120%, #2b2147 0%, transparent 60%),
    url("stars.svg") 0 0 / 480px 320px,
    var(--night);
  border-bottom: 2px solid var(--dusk-high);
}
.hero-inner {
  max-width: var(--wide); margin: 0 auto; padding: 88px 24px 96px;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: center;
}
.hero h1 {
  font-family: var(--pixel); font-weight: 400;
  font-size: 44px; line-height: 55px; letter-spacing: -0.01em;
  max-width: 17em; text-wrap: balance;
}
.lede { margin-top: 28px; font-size: 20px; line-height: 1.5; color: var(--fog); max-width: 34em; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.install {
  display: flex; align-items: center; gap: 12px;
  background: var(--night-deep); padding: 0 6px 0 18px; min-height: 52px;
  box-shadow: inset 0 0 0 2px var(--line);
}
.install code { font-size: 16px; background: none; padding: 0; white-space: nowrap; margin-right: auto; }
.install-prompt { font-family: var(--mono); color: var(--ember); user-select: none; }
.copy {
  font-family: var(--pixel); font-size: 11px; line-height: 1;
  background: var(--dusk-high); color: var(--bone); border: 0; padding: 10px 12px 9px; cursor: pointer;
}
.copy:hover { background: var(--line); }
.copy[data-done] { background: var(--match); color: var(--night); }
.button {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 24px;
  background: var(--ember); color: var(--night); font-weight: 650; text-decoration: none;
}
.button:hover { background: var(--glow); color: var(--night); }
.hero-meta { margin-top: 24px; font-size: 14px; color: var(--fog-dim); }

.hero-mascot { position: relative; padding-bottom: 40px; }
.mascot-shadow {
  position: absolute; left: 21.875%; right: 21.875%; bottom: 0; height: 18px;
  background: #0b0a12; opacity: 0.5;
  clip-path: polygon(11% 0, 89% 0, 89% 33.4%, 100% 33.4%, 100% 66.7%, 89% 66.7%, 89% 100%, 11% 100%, 11% 66.7%, 0 66.7%, 0 33.4%, 11% 33.4%);
}

/* ---- landing: bands --------------------------------------------------------------------- */

.band { border-bottom: 2px solid var(--dusk-high); }
.band-inner { max-width: var(--wide); margin: 0 auto; padding: 80px 24px; }
.band h2, .plain-head h1, .lost h1 {
  font-family: var(--pixel); font-weight: 400; font-size: 33px; line-height: 44px;
  max-width: 22em; text-wrap: balance;
}
.band-lede { margin-top: 16px; color: var(--fog); max-width: 44em; }
.band h3 { font-size: 18px; font-weight: 650; line-height: 1.3; }
.band-inner > p:last-child { margin-top: 28px; }

.proof .band-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 40px 56px; align-items: start;
}
.proof-head p { margin-top: 16px; color: var(--fog); max-width: 36em; }
.proof-table, .after-table { grid-column: 1 / -1; }
.proof .band-inner > .after-table { color: var(--fog); font-size: 15px; margin-top: -12px; }

.tape { background: var(--night-deep); padding: 20px 22px 18px; box-shadow: inset 0 0 0 2px var(--line); }
.tape-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--pixel); font-size: 11px; line-height: 1; color: var(--fog-dim);
}
.tape-head b { font-weight: 400; color: var(--bone); }
.tape-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-family: var(--mono); font-size: 13px; }
.tape-table th, .tape-table td { padding: 5px 0; text-align: left; font-weight: 400; }
.tape-table thead th { color: var(--fog-dim); font-size: 12px; padding-bottom: 8px; }
.tape-table tbody th { color: var(--fog); padding-right: 14px; }
.tape-table td { font-variant-numeric: tabular-nums; color: var(--bone); }
.tape-table .tape-eq { color: var(--match); text-align: right; font-weight: 700; }
.tape-cells { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; margin-top: 14px; }
.tape-cells i { aspect-ratio: 1; background: var(--dusk-high); }
.tape-cells i[data-on] { background: var(--match); }
.tape figcaption { margin-top: 14px; font-size: 13px; line-height: 1.45; color: var(--fog-dim); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.proof-table th, .proof-table td, .prose th, .prose td {
  text-align: left; vertical-align: top; padding: 12px 20px 12px 0;
  border-bottom: 1px solid var(--line);
}
.proof-table thead th, .prose thead th {
  font-size: 14px; font-weight: 600; color: var(--fog); border-bottom: 2px solid var(--line);
}
.proof-table td:last-child { color: var(--fog); font-size: 15px; }
.proof-table td:first-child { font-weight: 500; }
.zero { font-family: var(--pixel); font-size: 11px; line-height: 27px; color: var(--match); white-space: nowrap; }
.proof-table td.zero { font-size: 22px; padding-right: 32px; }

.code-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 724px); gap: 48px; align-items: start; }
.code-grid pre.code { font-size: 13.5px; }
.code-notes > p { margin-top: 16px; color: var(--fog); }
.notes { margin-top: 28px; }
.notes dt { margin-top: 18px; }
.notes dt code { color: var(--ember); background: none; padding: 0; font-size: 15px; }
.notes dd { color: var(--fog); margin-top: 2px; }
.code-notes > p:last-child { margin-top: 28px; }

.versions { margin-top: 36px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.versions li { background: var(--dusk); padding: 18px 16px 16px; display: grid; gap: 4px; align-content: start; }
.v-name { font-family: var(--pixel); font-size: 22px; line-height: 1.2; }
.v-proto { font-family: var(--mono); font-size: 12px; color: var(--match); }
.v-also { font-size: 13px; color: var(--fog-dim); line-height: 1.35; }
/* The first three are the old family, the last three the current one. */
.versions li:nth-child(n + 4) { background: var(--dusk-high); }

.facts { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.facts p { margin-top: 8px; color: var(--fog); }

.tools { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.tools dt code { font-family: var(--pixel); font-size: 22px; background: none; padding: 0; color: inherit; }
.tools dt a { text-decoration: none; }
.tools dt a:hover { text-decoration: underline; }
.tools dd { margin-top: 8px; color: var(--fog); }

/* ---- code ------------------------------------------------------------------------------- */

pre.code {
  position: relative;
  background: var(--night-deep); box-shadow: inset 0 0 0 2px var(--line);
  padding: 20px 22px; overflow-x: auto;
  font-family: var(--mono); font-size: 14px; line-height: 1.6; tab-size: 4;
}
pre.code code { font-size: inherit; background: none; padding: 0; }
pre.code .copy { position: absolute; top: 10px; right: 10px; opacity: 0; }
pre.code:hover .copy, pre.code .copy:focus-visible, pre.code .copy[data-done] { opacity: 1; }

.s-comment { color: var(--fog-dim); font-style: italic; }
.s-string, .s-string .s-punctuation { color: var(--match); }
.s-keyword, .s-storage { color: var(--ember); }
.s-storage.s-type, .s-entity.s-name.s-type, .s-entity.s-name.s-struct, .s-entity.s-name.s-impl,
.s-support.s-type, .s-entity.s-name.s-trait, .s-entity.s-name.s-enum { color: var(--violet); }
.s-entity.s-name.s-function, .s-support.s-function, .s-support.s-macro,
.s-variable.s-function { color: var(--glow); }
.s-constant, .s-constant .s-punctuation { color: var(--glow); }
.s-entity.s-name.s-tag, .s-entity.s-name.s-table, .s-meta.s-tag { color: var(--violet); }
.s-keyword.s-operator, .s-punctuation { color: var(--fog); }
.s-variable.s-parameter { color: var(--bone); }
.s-meta.s-annotation, .s-meta.s-annotation * { color: var(--fog); }

/* ---- guide and changelog ---------------------------------------------------------------- */

.doc {
  max-width: 1320px; width: 100%; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 190px; gap: 48px; align-items: start;
}
.doc-side, .doc-toc {
  position: sticky; top: var(--top-h); max-height: calc(100vh - var(--top-h));
  overflow-y: auto; padding: 36px 0 48px; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.doc-menu > summary { display: none; }
.doc-side h2, .doc-toc h2 {
  font-family: var(--pixel); font-weight: 400; font-size: 11px; line-height: 1.4;
  color: var(--fog-dim); margin: 26px 0 8px;
}
.doc-toc h2 { margin-top: 0; }
.doc-side li a, .doc-toc li a {
  display: block; padding: 5px 12px; margin-left: -12px;
  color: var(--fog); text-decoration: none; font-size: 15px; line-height: 1.35;
  border-left: 2px solid transparent;
}
.doc-toc li a { font-size: 14px; }
.doc-side li a:hover, .doc-toc li a:hover { color: var(--bone); }
.doc-side li a[aria-current] { color: var(--bone); font-weight: 600; border-left-color: var(--ember); background: var(--dusk); }
.doc-toc li a[data-active] { color: var(--bone); border-left-color: var(--match); }

.search { position: relative; }
.search input {
  width: 100%; height: 40px; padding: 0 36px 0 14px; border: 0;
  background: var(--dusk); color: var(--bone); font: inherit; font-size: 15px;
}
.search input::placeholder { color: var(--fog-dim); }
.search kbd {
  position: absolute; right: 12px; top: 9px; color: var(--fog-dim);
  background: var(--dusk-high); padding: 0 6px; font-size: 12px; line-height: 22px; pointer-events: none;
}
.search input:focus + kbd { display: none; }
.search-results { margin-top: 8px; background: var(--dusk); }
.search-results li a {
  margin: 0; padding: 9px 14px; border-left: 2px solid transparent; display: block;
  color: var(--bone); font-size: 14px;
}
.search-results li a small { display: block; color: var(--fog-dim); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.search-results li a:hover, .search-results li a:focus-visible { background: var(--dusk-high); border-left-color: var(--ember); outline: 0; }
.search-results .search-none { padding: 10px 14px; color: var(--fog); font-size: 14px; }
.search-results mark { background: none; color: var(--glow); }

.doc-main { padding: 44px 0 80px; min-width: 0; }
.prose { max-width: 46rem; }
.prose pre.code { font-size: 13.5px; padding: 18px 18px; }
.crumb { font-family: var(--pixel); font-size: 11px; line-height: 1.4; color: var(--ember); margin-bottom: 14px; }
.prose h1 { font-family: var(--pixel); font-weight: 400; font-size: 44px; line-height: 55px; text-wrap: balance; }
.prose h2 { font-family: var(--pixel); font-weight: 400; font-size: 22px; line-height: 33px; margin-top: 56px; }
.prose h3 { font-size: 19px; font-weight: 650; line-height: 1.35; margin-top: 36px; }
.prose h4 { font-size: 17px; font-weight: 650; margin-top: 28px; }
.prose .anchor { color: inherit; text-decoration: none; }
.prose .anchor:hover::after { content: " #"; color: var(--fog-dim); }
.prose p, .prose ul, .prose ol, .prose pre, .prose .table-wrap, .prose blockquote { margin-top: 18px; }
.prose h1 + p { margin-top: 24px; font-size: 19px; color: var(--fog); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li { margin-top: 6px; }
.prose li::marker { color: var(--ember); }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose strong { font-weight: 650; }
.prose td, .prose th { font-size: 15px; padding: 10px 18px 10px 0; }
.prose td code, .prose th code { white-space: nowrap; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--line); color: var(--fog); }
.prose blockquote > :first-child { margin-top: 0; }
.prose .callout { border: 0; padding: 16px 20px; background: var(--dusk); color: var(--bone); }
.prose .callout > p:first-child > strong:first-child {
  display: block; font-family: var(--pixel); font-weight: 400; font-size: 11px; line-height: 1.4;
  color: var(--match); margin-bottom: 6px;
}
.prose .callout.warning > p:first-child > strong:first-child { color: var(--ember); }
.prose hr { border: 0; border-top: 2px solid var(--dusk-high); margin: 48px 0; }

.pager { max-width: 46rem; margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pager a { background: var(--dusk); padding: 16px 20px; color: var(--bone); text-decoration: none; font-weight: 600; }
.pager a:hover { background: var(--dusk-high); }
.pager a span { display: block; font-family: var(--pixel); font-weight: 400; font-size: 11px; line-height: 1.4; color: var(--fog-dim); margin-bottom: 4px; }
.pager-next { text-align: right; grid-column: 2; }

.release-list a { display: flex !important; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 14px !important; }
.release-list a span { color: var(--fog-dim); font-size: 12px; }
.changelog-intro { color: var(--fog); }
.release { margin-top: 64px; padding-top: 8px; border-top: 2px solid var(--dusk-high); }
.release > h2 { font-size: 33px; line-height: 44px; margin-top: 32px; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.release > h2 time { font-family: var(--mono); font-size: 14px; color: var(--fog-dim); }
.release h3 { font-family: var(--pixel); font-weight: 400; font-size: 22px; line-height: 33px; color: var(--match); }

/* ---- crates ----------------------------------------------------------------------------- */

.plain { max-width: var(--wide); width: 100%; margin: 0 auto; padding: 64px 24px 96px; }
.plain-head h1 { font-size: 44px; line-height: 55px; }
.plain-head code { white-space: nowrap; }
.plain-head p { margin-top: 20px; color: var(--fog); max-width: 44em; font-size: 19px; }
.stack { margin-top: 56px; display: grid; gap: 12px; counter-reset: layer; }
.layer { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; padding: 24px 0; border-top: 2px solid var(--dusk-high); }
.layer-head h2 { font-family: var(--pixel); font-weight: 400; font-size: 22px; line-height: 33px; }
.layer-head p { margin-top: 6px; font-size: 15px; color: var(--fog-dim); }
.layer-crates { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.layer-crates > li { background: var(--dusk); padding: 20px 22px; }
.layer-crates h3 { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.layer-crates p { margin-top: 8px; color: var(--fog); font-size: 15px; }
.layer-crates .feature { margin-top: 4px; font-size: 13px; color: var(--match); }
.layer-crates .feature code { background: none; padding: 0; color: inherit; }
.crate-links { display: flex; gap: 18px; font-size: 14px !important; }
.plain-foot { margin-top: 40px; color: var(--fog); }

/* ---- 404 -------------------------------------------------------------------------------- */

.lost { max-width: 40rem; margin: 0 auto; padding: 88px 24px 120px; text-align: center; }
.lost-mascot { width: 160px; margin: 0 auto 40px; transform: rotate(-8deg); }
.lost h1 { margin: 0 auto; }
.lost p { margin-top: 16px; color: var(--fog); }
.lost-links { margin-top: 32px !important; display: flex; gap: 24px; justify-content: center; align-items: center; flex-wrap: wrap; }

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

.foot { background: var(--night-deep); }
.foot-inner {
  max-width: var(--wide); margin: 0 auto; padding: 44px 24px 52px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center;
  font-size: 15px; color: var(--fog);
}
.foot-brand { display: flex; align-items: center; gap: 16px; }
.foot-mark { width: 40px; flex: none; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { color: var(--bone); }
.foot-legal { grid-column: 1 / -1; font-size: 13px; color: var(--fog-dim); max-width: 62em; }

/* ---- smaller screens -------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .doc { grid-template-columns: 230px minmax(0, 1fr); gap: 40px; }
  .doc-toc { display: none; }
  .versions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding: 48px 20px 64px; }
  .hero-mascot { width: 180px; order: -1; }
  .hero h1 { font-size: 33px; line-height: 44px; }
  .lede { font-size: 18px; }
  .band-inner { padding: 56px 20px; }
  .proof .band-inner, .code-grid, .facts, .tools { grid-template-columns: 1fr; gap: 32px; }
  .band h2 { font-size: 22px; line-height: 33px; }
  .top-inner { padding: 0 16px; gap: 14px; }
  .top-nav { overflow-x: auto; scrollbar-width: none; }
  .top-nav a { white-space: nowrap; padding: 6px 8px; }
  .version { display: none; }

  .doc { grid-template-columns: 1fr; gap: 0; padding: 0 20px; }
  .doc-side { position: static; max-height: none; padding: 16px 0 0; }
  .doc-menu > summary {
    display: block; cursor: pointer; padding: 12px 16px; background: var(--dusk);
    font-weight: 600; list-style: none;
  }
  .doc-menu > summary::-webkit-details-marker { display: none; }
  .doc-menu > summary::after { content: "+"; float: right; font-family: var(--pixel); color: var(--ember); }
  .doc-menu[open] > summary::after { content: "-"; }
  .doc-menu[open] > summary { margin-bottom: 16px; }
  .doc-main { padding: 28px 0 56px; }
  .prose h1, .plain-head h1 { font-size: 33px; line-height: 44px; }
  .layer { grid-template-columns: 1fr; gap: 16px; }
  .foot-inner { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
}

@media (max-width: 520px) {
  html { font-size: 16px; }
  .versions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-name { display: none; }
  .tape-table { font-size: 10.5px; }
  .tape-table td { padding-right: 8px; }
  .tape { padding: 16px 14px 14px; }
  .hero-actions > * { flex: 1 1 100%; }
  .button { justify-content: center; }
  .top-nav a[rel] { display: none; }
  .proof-table td.zero { font-size: 11px; padding-right: 16px; }
  .install { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
