/* nuntio — pocket reference card. */

@font-face {
  font-family: "Archivo";
  src: url(fonts/archivo.woff2) format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url(fonts/jetbrains-mono.woff2) format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --desk: #D9D3C4;
  --stock: #EDE9DF;
  --stock-2: #E3DED1;
  --ink: #141414;
  --ink-2: #4A4740;
  --rule: #B9B2A2;
  --signal: #EA5F1E;
  --signal-ink: #B23C0A;
  --on-signal: #141414;
  --back: #141414;
  --back-ink: #EDE9DF;

  --sans: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  --line: 1.5px;
  --panel-pad: clamp(4rem, 8vw, 7.5rem);
  --gutter: clamp(20px, 4vw, 56px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #0A0A09;
    --stock: #121110;
    --stock-2: #1C1A17;
    --ink: #ECE6D8;
    --ink-2: #A8A194;
    --rule: #3A362F;
    --signal: #F26A2A;
    --signal-ink: #F58A4F;
    --back: #0A0A09;
    --back-ink: #ECE6D8;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--signal); color: var(--on-signal); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

a { color: var(--ink); text-decoration: underline 2px var(--signal); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

code, kbd, pre, samp, .term, .chip { font-family: var(--mono); font-variant-ligatures: none; }

/* Index labels: condensed caps, the voice of the card's running heads. */
.nav a, .thumb-index a, .dl-tabs label, .spec-band dt, .docs-nav .label, .crease span {
  font-family: var(--sans);
  font-stretch: 75%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.lc { text-transform: none; }

kbd {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 2px 7px;
  border: var(--line) solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 2px;
  background: var(--stock);
  color: var(--ink);
  white-space: nowrap;
}
kbd + kbd { margin-left: 3px; }

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

.skip {
  position: absolute; left: var(--s4); top: -100px; z-index: 50;
  background: var(--ink); color: var(--stock); padding: var(--s2) var(--s4);
}
.skip:focus { top: var(--s4); }

/* ---------- Card shell ---------- */

.desk { padding: clamp(0px, 3vw, 40px); }

.card {
  margin: 0 auto;
  background: var(--stock);
  border: var(--line) solid var(--ink);
  border-radius: 20px;
  overflow: clip;
}
@media (min-width: 1100px) {
  .card { max-width: min(1280px, 100vw - 112px); }
}
@media (max-width: 720px) {
  .desk { padding: 0; }
  .card { border: 0; border-radius: 0; }
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  gap: var(--s5);
  padding: var(--s4) var(--gutter);
  border-bottom: var(--line) solid var(--ink);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  text-decoration: none;
  font-stretch: 75%;
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand img { width: 28px; height: 28px; }
.nav { display: flex; gap: var(--s5); margin-right: auto; margin-left: var(--s5); }
.nav a {
  font-size: .875rem;
  text-decoration: none;
  padding-block: var(--s1);
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--signal); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

@media (max-width: 720px) {
  .masthead { flex-wrap: wrap; row-gap: var(--s3); }
  .masthead .btn-primary { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; margin: 0; gap: var(--s4); }
  .nav .nav-config { display: none; }
}

/* ---------- Buttons ---------- */

.btn-primary, .btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  font-family: var(--sans);
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.15;
  border: var(--line) solid var(--ink);
  border-radius: 0;
  padding: 18px 24px;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.btn-primary { background: var(--ink); color: var(--stock); }
.btn-primary:hover { background: var(--stock); color: var(--ink); }
.btn-primary:active { transform: translateY(1px); }
.btn { background: transparent; color: var(--ink); }
.btn:hover { background: var(--ink); color: var(--stock); }
.btn-primary small {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: .8;
}
.btn-small { padding: 10px 16px; font-size: .9375rem; }

@media (prefers-reduced-motion: reduce) {
  .btn-primary, .btn { transition: none; }
}

/* ---------- Thumb index ---------- */

.thumb-index ul { list-style: none; margin: 0; padding: 0; }
.thumb-index a {
  display: block;
  font-size: .8125rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--stock-2);
  white-space: nowrap;
}
.thumb-index a[aria-current="true"] { background: var(--signal); color: var(--on-signal); }
.thumb-index a:focus-visible { outline-offset: -3px; }
.thumb-index a[aria-current="true"]:focus-visible { outline-color: var(--on-signal); }

@media (min-width: 1100px) {
  .thumb-index {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
  }
  .thumb-index li + li { margin-top: -1px; }
  .thumb-index a {
    width: 44px;
    min-height: 88px;
    padding: var(--s3) 0;
    writing-mode: vertical-rl;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--line) solid var(--ink);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
  }
  .thumb-index a:hover { transform: translateX(-4px); }
  .thumb-index a[aria-current="true"] { transform: translateX(-6px); }
}
@media (max-width: 1099px) {
  .thumb-index {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--stock-2);
    border-bottom: var(--line) solid var(--ink);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .thumb-index::-webkit-scrollbar { display: none; }
  .thumb-index ul { display: flex; }
  .thumb-index li + li a { border-left: 1px solid var(--rule); }
  .thumb-index a { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .thumb-index a { transition: none; }
}

/* ---------- Panels ---------- */

.panel {
  position: relative;
  padding: var(--panel-pad) var(--gutter);
  view-timeline: --fold block;
}

.crease {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-top: 1px dashed var(--rule);
}
.crease::before, .crease::after {
  content: "";
  position: absolute;
  top: -4px;
  width: var(--line);
  height: 8px;
  background: var(--ink);
}
.crease::before { left: 0; }
.crease::after { right: 0; }
.crease span {
  position: absolute;
  left: var(--gutter);
  top: -.7em;
  padding: 0 var(--s2);
  background: var(--stock);
  font-size: .8125rem;
  line-height: 1.4;
  color: var(--ink);
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .crease {
      animation: crease-draw linear forwards;
      animation-timeline: --fold;
      animation-range: entry 0% entry 40%;
    }
    @keyframes crease-draw {
      from { clip-path: inset(-12px 100% -12px 0); }
      to { clip-path: inset(-12px 0 -12px 0); }
    }
  }
}

.panel-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s4) var(--s6);
  align-items: start;
  margin-bottom: var(--s7);
}
.panel-head h2 {
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 4.5vw, 4rem);
  line-height: .95;
  letter-spacing: -0.005em;
  max-width: 18ch;
}
.panel-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
  padding-top: var(--s1);
  font-family: var(--mono);
  font-size: .8125rem;
  color: var(--ink-2);
}
.panel-key .or { padding-inline: var(--s1); }

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 600;
  padding: 3px 9px;
  border: var(--line) solid var(--ink);
  background: var(--stock-2);
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .panel-head { grid-template-columns: 1fr; }
  .panel-key { justify-content: flex-start; grid-row: 2; }
}

.panel-body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s7) var(--s6);
  align-items: start;
}
.panel-text { grid-column: 1 / span 5; display: grid; gap: var(--s4); }
.panel-fig { grid-column: 6 / span 7; }
.panel--mirror .panel-text { grid-column: 8 / span 5; grid-row: 1; }
.panel--mirror .panel-fig { grid-column: 1 / span 7; grid-row: 1; }
.panel-wide { grid-column: 1 / -1; }

.panel-text p, .panel-text ul { max-width: 62ch; }
.panel-text p code, .panel-text li code, .legend code {
  font-size: .9em;
  background: var(--stock-2);
  padding: .08em .3em;
  white-space: nowrap;
}
.panel-text ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.panel-text li { padding-left: var(--s5); position: relative; }
.panel-text li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .62em;
  width: 9px;
  height: 9px;
  background: var(--signal);
  border: 1px solid var(--ink);
}
.panel-text .links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }

@media (max-width: 900px) {
  .panel-text, .panel-fig,
  .panel--mirror .panel-text, .panel--mirror .panel-fig { grid-column: 1 / -1; grid-row: auto; }
}

/* Code card */
.code {
  margin: 0;
  padding: var(--s4) var(--s5);
  background: var(--stock-2);
  border: var(--line) solid var(--ink);
  font-size: .875rem;
  line-height: 1.55;
  overflow-x: auto;
}
.code .k { color: var(--signal-ink); font-weight: 600; }
.code .s { color: var(--ink-2); }

/* ---------- Tables ---------- */

table.spec, table.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  line-height: 1.45;
}
table.spec th, table.matrix th {
  text-align: left;
  font-stretch: 75%;
  font-weight: 800;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 12px;
}
table.spec td, table.matrix td {
  padding: 10px 12px;
  border-top: 1px solid var(--rule);
  vertical-align: top;
}
table.spec th { background: var(--stock-2); border-bottom: var(--line) solid var(--ink); }
table.spec { border-top: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink); }
table.spec td:first-child { font-family: var(--mono); font-size: .8125rem; white-space: nowrap; font-weight: 600; }

.matrix-wrap { border: var(--line) solid var(--ink); overflow-x: auto; }
table.matrix th { background: var(--signal); color: var(--on-signal); }
table.matrix td:first-child { font-weight: 600; }
table.matrix tr:first-child td { border-top: var(--line) solid var(--ink); }
table.matrix td.mark { font-family: var(--mono); font-size: .8125rem; white-space: nowrap; }
table.matrix td:last-child { color: var(--ink-2); }
table.matrix { min-width: 640px; }
@media (max-width: 720px) {
  table.matrix { min-width: 0; }
  table.matrix thead { display: none; }
  table.matrix tr { display: flex; flex-wrap: wrap; column-gap: 12px; border-top: 1px solid var(--rule); }
  table.matrix tr:first-child { border-top: 0; }
  table.matrix td, table.matrix tr:first-child td { border: 0; }
  table.matrix td:first-child { flex: 1; }
  table.matrix td:last-child { flex-basis: 100%; padding-top: 0; }
  table.matrix td:last-child:empty { display: none; }
}

/* ---------- Figures ---------- */

.fig { margin: 0; display: grid; gap: var(--s4); }
.fig-frame { position: relative; }
.fig-frame > img { border: var(--line) solid var(--ink); width: 100%; }
.fig-frame > img.plain { border: 0; }

.marker {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--signal);
  color: var(--on-signal);
  border: var(--line) solid #141414;
  box-shadow: 0 0 0 2px var(--stock);
  font-family: var(--mono);
  font-weight: 700;
  font-size: .8125rem;
  line-height: 1;
  z-index: 2;
}
.marker.inline {
  position: static;
  transform: none;
  flex: none;
  box-shadow: none;
}

ol.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s2);
  font-size: .9375rem;
  line-height: 1.45;
}
ol.legend li { display: flex; gap: var(--s3); align-items: flex-start; }
ol.legend .marker { width: 22px; height: 22px; font-size: .75rem; margin-top: 1px; }

.fig figcaption {
  font-stretch: 87.5%;
  font-size: .875rem;
  line-height: 1.45;
  color: var(--ink-2);
  border-top: 1px solid var(--rule);
  padding-top: var(--s2);
}
.fig figcaption b {
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  margin-right: var(--s1);
}
.fig figcaption kbd { font-size: .75rem; padding: 0 5px; }

.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-desktop { display: none; }
  .hint-touch { display: inline; }
}

/* ---------- Terminal figures ---------- */

.term {
  --t-bg: #1a1b26;
  --t-fg: #c0caf5;
  --t-blue: #7aa2f7;
  --t-green: #9ece6a;
  --t-comment: #565f89;
  --t-strip: #16161e;
  --t-active: #24283b;
  --t-divider: #3b4261;
  --a-blocked: #e06c75;
  --a-done: #98c379;
  --a-working: #61afef;
  position: relative;
  background: var(--t-bg);
  color: var(--t-fg);
  border: var(--line) solid var(--ink);
  font-family: var(--mono);
  line-height: 1.5;
}
.term-tabs {
  display: flex;
  align-items: stretch;
  background: var(--t-strip);
  font-size: .75rem;
  min-height: 30px;
}
.term-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 16px;
  color: var(--t-comment);
}
.term-tab.active { background: var(--t-active); color: var(--t-fg); }
.term-tab.plus { padding-inline: 12px; }
.term-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.term-panes { display: grid; grid-template-columns: 1fr 1fr; }
.term-pane {
  container-type: inline-size;
  min-width: 0;
  padding: 12px;
}
.term-pane + .term-pane { border-left: 1px solid var(--t-divider); }
.term-pane pre, .term-pane .lines {
  margin: 0;
  font-size: min(.8125rem, (100cqw - 24px) / 20);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}
.term-pane .ln { display: block; position: relative; }
.term .t-blue { color: var(--t-blue); }
.term .t-green { color: var(--t-green); }
.term .t-dim { color: var(--t-comment); }
.term .t-path { color: var(--t-blue); text-decoration: underline 1px; text-underline-offset: 2px; }
.term .t-cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: text-bottom; background: var(--t-fg); }
.term .marker { box-shadow: 0 0 0 2px var(--t-bg); }

@media (max-width: 720px) {
  .term-panes { grid-template-columns: 1fr; }
  .term-pane + .term-pane { border-left: 0; border-top: 1px solid var(--t-divider); }
  .term-pane pre, .term-pane .lines { font-size: min(.8125rem, (100cqw - 24px) / 26); }
}

/* Fig. 1 — the paste demo */
.demo .ln-mark { position: absolute; right: -6px; top: 50%; transform: translate(0, -50%); }
.demo .ln:has(.ln-mark) { padding-right: 26px; }
.demo .demo-image-wrap { position: relative; margin: 8px 0; width: min(100%, 11em); }
.demo img[data-demo-image] {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  background: #24283b;
  padding: 6px;
}
.demo .demo-image-wrap .marker { left: auto; right: -13px; top: 0; transform: translateY(-30%); }
#paste-demo[data-state="path"] [data-demo-step="attached"],
#paste-demo[data-state="path"] [data-demo-step="done"],
#paste-demo[data-state="attached"] [data-demo-step="done"] { visibility: hidden; }

/* Fig. 3 — herdr replica */
.herdr .term-body { padding: 12px; min-height: 9.5em; font-size: .8125rem; white-space: pre-wrap; }
.herdr .banner {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  background: #1f5fa8;
  color: #fff;
  font-size: .8125rem;
  padding: 5px 12px;
}
.herdr .statusbar {
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  background: var(--t-strip);
  font-size: .75rem;
  padding: 5px 12px;
  color: var(--t-comment);
  white-space: nowrap;
}
.herdr .statusbar .agents { color: var(--a-blocked); }
.herdr .statusbar .right { display: flex; gap: var(--s4); }
@media (max-width: 720px) {
  .herdr .statusbar .right { display: none; }
}
.herdr .marker {
  position: static;
  display: inline-grid;
  vertical-align: middle;
  transform: none;
  width: 20px;
  height: 20px;
  font-size: .6875rem;
  margin-left: 6px;
}

/* ---------- Cover ---------- */

.cover { padding: 0; }
.cover-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.cover-field {
  grid-column: 1 / span 6;
  background: var(--signal);
  color: var(--on-signal);
  padding: var(--s8);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s6);
  border-right: var(--line) solid var(--ink);
}
.cover-field a { color: var(--on-signal); text-decoration-color: var(--on-signal); }
.cover-field a:hover { text-decoration-thickness: 3px; }
.cover-field :focus-visible { outline-color: var(--on-signal); }
.cover h1 { display: grid; gap: var(--s4); }
.cover-name {
  font-stretch: 62%;
  font-weight: 900;
  font-size: clamp(5.5rem, 15vw, 13.5rem);
  line-height: .82;
  letter-spacing: -0.01em;
  text-transform: lowercase;
  margin-left: -.04em;
}
.cover-hook {
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.cover-offer { font-size: 1.125rem; line-height: 1.5; max-width: 44ch; }
.cover-actions { display: grid; gap: var(--s4); justify-items: start; }
.cover-field .btn-primary { background: #141414; color: #EDE9DF; border-color: #141414; min-width: 18rem; }
.cover-field .btn-primary:hover { background: transparent; color: #141414; }
.cover-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-weight: 600; }
.cover-meta { font-family: var(--mono); font-size: .75rem; letter-spacing: .02em; }

.cover-fig {
  grid-column: 7 / span 6;
  padding: var(--s7);
  display: flex;
  align-items: center;
}
.cover-fig .fig { width: 100%; }

.spec-band {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: var(--line) solid var(--ink);
  margin: 0;
}
.spec-band div { padding: var(--s4) var(--s5); border-left: 1px solid var(--rule); }
.spec-band div:first-child { border-left: 0; }
.spec-band dt {
  font-size: .75rem;
  color: var(--ink-2);
}
.spec-band dd {
  margin: 2px 0 0;
  font-stretch: 75%;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
}

@media (min-width: 1100px) {
  .cover-grid > .cover-field, .cover-grid > .cover-fig { min-height: min(860px, calc(100svh - 220px)); }
}
@media (max-width: 1099px) {
  .cover-field, .cover-fig { grid-column: 1 / -1; }
  .cover-field { border-right: 0; border-bottom: var(--line) solid var(--ink); padding: var(--s7) var(--gutter); }
  .cover-fig { padding: var(--s7) var(--gutter); }
  .spec-band { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec-band div:nth-child(3n + 1) { border-left: 0; }
  .spec-band div:nth-child(n + 4) { border-top: 1px solid var(--rule); }
}
@media (max-width: 720px) {
  .cover-field .btn-primary { min-width: 0; width: 100%; }
  .spec-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-band div:nth-child(3n + 1) { border-left: 1px solid var(--rule); }
  .spec-band div:nth-child(2n + 1) { border-left: 0; }
  .spec-band div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}

/* ---------- Download ---------- */

.panel.download { background: var(--signal); color: var(--on-signal); }
.download .crease { border-top-color: #141414; }
.download .crease span { background: var(--signal); color: var(--on-signal); }
.download .panel-key { color: var(--on-signal); }
.download > .panel-head a, .download .after a { color: var(--on-signal); text-decoration-color: var(--on-signal); }
.download :focus-visible { outline-color: var(--on-signal); }

.dl-insert {
  background: var(--stock);
  color: var(--ink);
  border: var(--line) solid #141414;
}
.dl-insert :focus-visible { outline-color: var(--ink); }
.dl-insert input { position: absolute; opacity: 0; pointer-events: none; }
.dl-tabs { display: flex; border-bottom: var(--line) solid var(--ink); background: var(--stock-2); }
.dl-tabs label {
  cursor: pointer;
  padding: var(--s3) var(--s5);
  font-size: .875rem;
  border-right: 1px solid var(--rule);
}
.dl-tabs label:hover { background: var(--stock); }
.dl-panel { display: none; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s6); padding: var(--s6); }
#dl-linux:checked ~ .dl-panel[data-os="linux"],
#dl-mac:checked ~ .dl-panel[data-os="mac"],
#dl-windows:checked ~ .dl-panel[data-os="windows"] { display: grid; }
#dl-linux:checked ~ .dl-tabs label[for="dl-linux"],
#dl-mac:checked ~ .dl-tabs label[for="dl-mac"],
#dl-windows:checked ~ .dl-tabs label[for="dl-windows"] { background: var(--ink); color: var(--stock); }
#dl-linux:focus-visible ~ .dl-tabs label[for="dl-linux"],
#dl-mac:focus-visible ~ .dl-tabs label[for="dl-mac"],
#dl-windows:focus-visible ~ .dl-tabs label[for="dl-windows"] { outline: 3px solid var(--ink); outline-offset: -6px; outline-color: var(--stock); }

.dl-files { display: grid; gap: var(--s3); align-content: start; }
.file {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s4);
  padding: var(--s3) var(--s4);
  border: var(--line) solid var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.file:hover { background: var(--ink); color: var(--stock); }
.file.primary { background: var(--ink); color: var(--stock); padding-block: var(--s4); font-size: 1.125rem; font-stretch: 87.5%; font-weight: 700; }
.file.primary:hover { background: var(--stock); color: var(--ink); }
.file-meta { font-family: var(--mono); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.dl-hint { font-size: .875rem; color: var(--ink-2); }
.dl-cmd {
  margin: 0;
  padding: var(--s4) var(--s5);
  background: #1a1b26;
  color: #c0caf5;
  border: var(--line) solid var(--ink);
  font-size: .8125rem;
  line-height: 1.6;
  overflow-x: auto;
}
.dl-cmd .c { color: #565f89; }
.dl-cmd .p { color: #9ece6a; }
.download .after { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s5); font-weight: 600; }
.download .fallback { display: grid; gap: var(--s5); justify-items: start; }
.download .fallback .btn-primary { background: #141414; color: #EDE9DF; border-color: #141414; }

@media (max-width: 900px) {
  .dl-panel { grid-template-columns: 1fr; padding: var(--s5); }
}

/* ---------- Back cover ---------- */

.backcover {
  background: var(--back);
  color: var(--back-ink);
  padding: var(--s8) var(--gutter) var(--s7);
  display: grid;
  gap: var(--s4);
  font-size: .9375rem;
}
.backcover a { color: var(--back-ink); }
.backcover :focus-visible { outline-color: var(--back-ink); }
.backcover .links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); font-weight: 600; }
.backcover .statement {
  font-stretch: 75%;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.5rem;
  line-height: 1.1;
}
.backcover .small { font-size: .8125rem; opacity: .75; }

/* ---------- Docs ---------- */

.docs {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--s8);
  padding: var(--s8) var(--gutter) var(--s9);
}
.docs-nav { position: sticky; top: var(--s5); align-self: start; }
.docs-nav .label {
  font-size: .8125rem;
  color: var(--ink-2);
  padding-bottom: var(--s2);
  border-bottom: var(--line) solid var(--ink);
  margin-bottom: var(--s2);
}
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav > ul > li > a {
  display: flex;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}
.docs-nav > ul > li > a .n { font-family: var(--mono); font-size: .75rem; color: var(--ink-2); padding-top: .2em; }
.docs-nav > ul > li > a:hover { background: var(--stock-2); }
.docs-nav > ul > li > a[aria-current="page"] { background: var(--signal); color: var(--on-signal); }
.docs-nav > ul > li > a[aria-current="page"] .n { color: var(--on-signal); }
.docs-nav .toc { padding: var(--s2) 0 var(--s3) calc(var(--s3) + 2.1em); font-size: .875rem; }
.docs-nav .toc a { display: block; padding: 3px 0; text-decoration: none; color: var(--ink-2); }
.docs-nav .toc a:hover { color: var(--ink); text-decoration: underline 2px var(--signal); }

@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: var(--s5); padding-top: var(--s5); }
  .docs-nav { position: static; overflow-x: auto; scrollbar-width: none; }
  .docs-nav .label { display: none; }
  .docs-nav > ul { display: flex; border: var(--line) solid var(--ink); width: max-content; min-width: 100%; }
  .docs-nav > ul > li > a { border-bottom: 0; border-right: 1px solid var(--rule); white-space: nowrap; }
  .docs-nav .toc { display: none; }
}

/* ---------- Prose ---------- */

.prose { min-width: 0; max-width: 78ch; }
.prose > * + * { margin-top: var(--s4); }
.prose h1 {
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: .95;
  letter-spacing: -0.01em;
  margin-bottom: var(--s6);
}
.prose h2 {
  font-stretch: 75%;
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.1;
  border-top: 2px solid var(--ink);
  padding-top: var(--s4);
  margin-top: var(--s8);
}
.prose h3 {
  font-stretch: 87.5%;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
  margin-top: var(--s6);
}
.prose h4 { font-size: 1.0625rem; margin-top: var(--s5); }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: var(--s3); }
.prose p, .prose li { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--s1); }
.prose li::marker { color: var(--signal-ink); }
.prose code {
  font-size: .9em;
  background: var(--stock-2);
  padding: .08em .3em;
}
.prose pre {
  background: var(--stock-2);
  border: var(--line) solid var(--ink);
  padding: var(--s4) var(--s5);
  font-size: .875rem;
  line-height: 1.55;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose img { border: 1px solid var(--ink); }
.prose blockquote {
  margin-inline: 0;
  padding-left: var(--s4);
  border-left: 1px solid var(--ink);
  color: var(--ink-2);
}
.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .9375rem;
  line-height: 1.45;
  border-top: var(--line) solid var(--ink);
  border-bottom: var(--line) solid var(--ink);
}
.prose th {
  text-align: left;
  font-stretch: 75%;
  font-weight: 800;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--stock-2);
  padding: 10px 12px;
  border-bottom: var(--line) solid var(--ink);
}
.prose td { padding: 10px 12px; border-top: 1px solid var(--rule); vertical-align: top; }
.prose kbd { font-size: .75rem; padding: 1px 5px; }
@media (max-width: 720px) {
  .prose table { display: block; border-bottom: 0; }
  .prose thead { display: none; }
  .prose tbody { display: block; }
  .prose tr { display: flex; flex-wrap: wrap; column-gap: 12px; border-bottom: 1px solid var(--rule); }
  .prose td { border: 0; padding: 10px 0 4px; }
  .prose td:last-child { flex-basis: 100%; padding-top: 0; padding-bottom: 12px; }
  .prose td:first-child { font-weight: 600; }
}

.plain-page { padding: var(--s8) var(--gutter) var(--s9); max-width: calc(72ch + 2 * var(--gutter)); }
.section-page { padding: var(--s8) var(--gutter) var(--s9); }
