@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/geist.19f9c925.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/geist-mono.684ad5b5.woff2") format("woff2");
}

/*
 * Design tokens of the blog: design system «Grano» (ADR 0019).
 *
 * The blog's CSS uses only these variables (no colours, sizes or fonts written by hand), so
 * a change of design is a change of this file. Dark theme first; the light one follows the
 * reader's system with prefers-color-scheme.
 *
 * Fonts: Geist and Geist Mono (OFL), served by the blog itself; the web adapter writes their
 * @font-face rules.
 *
 * Grid measures (content-max, renglon, baseline, grid-columns): BRND Grid System, de BRND®
 * (CC BY 4.0).
 */

:root {
  color-scheme: dark light;

  /* Colours: dark theme */
  --color-bg: #0a0a0b;
  --color-surface: #151517;
  --color-text: #ededeb;
  --color-text-muted: #9c9ca2;
  --color-border: #26262a;
  --color-border-strong: #64646b;
  --color-grid: #1c1c1f;
  --color-signal: #dcc6a0;
  --color-signal-text: #dcc6a0; /* the signal for small text: AA on bg and surface */
  --color-accent: #ededeb;
  --color-accent-hover: #dcc6a0;
  --color-on-accent: #0a0a0b;
  --color-focus: #dcc6a0;

  /* Colours: code highlighting */
  --color-code-bg: #151517;
  --color-code-text: #ededeb;
  --color-syntax-keyword: #ffffff;
  --color-syntax-string: #dcc6a0;
  --color-syntax-comment: #8c8c93;
  --color-syntax-number: #dcc6a0;
  --color-syntax-function: #cfcfcc;
  --color-syntax-type: #b5b5b2;
  --color-syntax-operator: #9c9ca2;
  --color-syntax-error: #ff8f85;

  /* Colours: identity (cover, social image) */
  --brand-ink: #202023;
  --brand-sand: #dcc6a0;
  --brand-ash: #8c8c93;

  /* Typography */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --font-size-xs: 0.75rem;
  --font-size-toc: 0.8125rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1.0625rem;
  --font-size-lg: 1.125rem;
  --font-size-md: 1.25rem;
  --font-size-lead: clamp(1.1875rem, 1.1rem + 0.5vw, 1.3125rem);
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2.75rem;
  --font-size-title: clamp(2rem, 1.25rem + 3vw, 2.75rem);
  --font-size-hero: clamp(4rem, 12vw, 7.5rem);
  --font-size-code-inline: 0.875em; /* relative to the text around it */
  --space-code-inline: 0.2em; /* side room of inline code: tight, so punctuation stays close */

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 600;

  --line-height-tight: 1.1;
  --line-height-heading: 1.25;
  --line-height-snug: 1.45;
  --line-height-code: 1.6;
  --line-height-prose: 1.65;
  --line-height-body: 1.7;

  --letter-spacing-tight: -0.035em;
  --letter-spacing-hero: -0.05em;
  --letter-spacing-label: 0.08em;

  --tab-size: 4;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-14: 3.5rem;
  --space-16: 4rem;
  --space-paragraph: 1.25em; /* between paragraphs: relative to the text */

  /* Shapes */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --border-width: 1px;
  --focus-width: 2px;

  /* Layout and grid */
  --measure: 40rem;
  /*
   * A long post (ADR 0031). measure-text is about 65 characters of Geist at --font-size-lg:
   * Geist's ch is the width of its zero, much wider than an average letter, so 65ch would
   * give about 88 characters. breakout is what code, figures, tables and callouts gain on
   * each side; toc-width is the side contents on wide screens.
   */
  --measure-text: 34rem;
  --breakout: 4rem;
  --toc-width: 13rem;
  /* The room of a post's scene above its title: the whole header on a wide screen, a band
     above the text on a phone, so the pieces never sit behind the title. */
  --scene-height: min(36rem, 72vh);
  --scene-band: 17rem;
  --content-max: 72rem;
  --renglon: 1.5rem;
  --baseline: 0.5rem;
  --grid-columns: 12;
}

@media (prefers-color-scheme: light) {
  :root {
    --color-bg: #eeeeec;
    --color-surface: #e3e3e0;
    --color-text: #0c0c0d;
    --color-text-muted: #55555b;
    --color-border: #d2d2ce;
    --color-border-strong: #7c7c80;
    --color-grid: #dcdcd8;
    --color-signal: #b8955a;
    --color-signal-text: #7a5a1c;
    --color-accent: #0c0c0d;
    --color-accent-hover: #6e5222;
    --color-on-accent: #eeeeec;
    --color-focus: #7a5a1c;

    --color-code-bg: #e3e3e0;
    --color-code-text: #0c0c0d;
    --color-syntax-keyword: #0c0c0d;
    --color-syntax-string: #6e5222;
    --color-syntax-comment: #626268;
    --color-syntax-number: #6e5222;
    --color-syntax-function: #2e2e33;
    --color-syntax-type: #45454b;
    --color-syntax-operator: #55555b;
    --color-syntax-error: #b42318;

    --brand-ink: #0c0c0d;
    --brand-ash: #9c9ca2;
  }
}

/*
 * The blog's own CSS, design «Grano» (ADR 0019). It goes after design/tokens.css in the single
 * app.<fingerprint>.css and uses only its variables: no colours, sizes or fonts written here.
 * The one exception is the breakpoints of the media queries, because a media query cannot read
 * a variable: 40rem, the same value as --measure, and 80rem, where a post has room for its
 * contents in the margin (--toc-width on each side of the wide column).
 */

/* Base */

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

html {
  overflow-x: clip; /* the scene of a post reaches the edges of the window */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-body);
}

h1,
h2,
h3,
h4 {
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-2xl);
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: var(--space-1);
}

a:hover {
  color: var(--color-accent-hover);
}

a:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-width);
  border-radius: var(--radius-xs);
}

body {
  /* Room for the fixed footer, so it never covers the end of a page. */
  padding-bottom: calc(var(--renglon) * 2);
}

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--renglon);
}

main.wrap {
  padding-block: var(--space-8) var(--space-12);
}

/* Labels: mono, upper case, for dates and tags. Never sentences. */

.meta,
.tag-list,
.card__role,
.site-footer {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Header: the name and three links, no bar. On the front page it floats over the scene. */

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--renglon);
}

.home .site-header {
  position: absolute;
  inset: 0 0 auto;
}

.site-name {
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  text-transform: lowercase;
}

.site-name::after {
  content: ".";
  color: var(--color-signal);
}

.site-nav {
  display: flex;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-accent-hover);
}

/* Footer: one small line, fixed to the bottom of the window. */

.site-footer {
  position: fixed;
  inset: auto 0 0;
  z-index: 2;
  padding: var(--space-2) var(--renglon);
  background: var(--color-bg);
}

.home .site-footer {
  background: transparent;
  pointer-events: none;
}

/* Always one line: on a narrow screen it is cut with an ellipsis. */
.site-footer p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Front page: the scene fills the window, and everything else floats on it. */

.scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--renglon) * 4) var(--renglon) calc(var(--renglon) * 2);
}

.scene__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.scene__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--measure) * 1.2);
  pointer-events: none;
}

.scene__content a {
  pointer-events: auto;
}

.scene__title {
  margin: 0;
  font-size: var(--font-size-hero);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-hero);
}

.scene__lead {
  max-width: calc(var(--measure) * 0.65);
  margin: var(--space-3) 0 var(--space-8);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-bg) 72%, transparent);
  backdrop-filter: blur(var(--space-1));
  pointer-events: auto;
  transition: border-color 0.3s ease;
}

.card:hover {
  border-color: var(--color-border-strong);
}

.card__role {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.card__role::before {
  content: "";
  width: var(--baseline);
  height: var(--baseline);
  border-radius: var(--radius-pill);
  background: var(--color-signal);
}

.card__title {
  margin: 0;
  font-size: var(--font-size-lg);
  letter-spacing: var(--letter-spacing-tight);
}

.card__title a {
  color: var(--color-text);
  text-decoration: none;
}

/* The whole card is the link to the post. */
.card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
}

.card:hover .card__title a {
  color: var(--color-accent-hover);
}

.card__title a:focus-visible {
  outline: none;
}

.card__title a:focus-visible::after {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-width);
}

.card .meta {
  margin: 0;
}

.card__description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.scene__all {
  margin: var(--space-4) 0 0;
  font-size: var(--font-size-sm);
}

/*
 * The intro (spec ESC): the script adds .scene-intro to <html> only when the scene starts.
 * The header and the cards wait until the drones have formed the first piece; then each card
 * shows its border (.is-traced) and its text (.is-built). Without the script, nothing is hidden.
 */
.scene-intro .site-header,
.scene-intro .card,
.scene-intro .scene__all {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.scene-intro .card {
  border-color: transparent;
  background: transparent;
  backdrop-filter: none;
  transition: opacity 0.8s ease, border-color 0.6s ease, background-color 0.8s ease;
}

.scene-intro .card.is-traced {
  opacity: 1;
  border-color: var(--color-border);
}

.scene-intro .card.is-traced > * {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.scene-intro .card.is-built {
  background: color-mix(in srgb, var(--color-bg) 72%, transparent);
}

.scene-intro .card.is-built > * {
  opacity: 1;
}

.scene-ready .site-header,
.scene-ready .scene__all {
  opacity: 1;
}

@media (max-width: 40rem) {
  /* The posts go under the scene: the first screen is the piece and the name. */
  .scene {
    display: block;
    padding-top: 55vh;
    padding-top: 55svh;
  }

  .scene__canvas {
    height: 100vh;
    height: 100svh;
  }

  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Lists of posts */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-summary + .post-summary {
  border-top: var(--border-width) solid var(--color-border);
  margin-top: var(--space-8);
  padding-top: var(--space-8);
}

.post-summary__title {
  font-size: var(--font-size-xl);
  margin: 0;
}

.post-summary__title a {
  color: var(--color-text);
  text-decoration: none;
}

.post-summary__title a:hover {
  color: var(--color-accent-hover);
}

.post-summary__description {
  margin: var(--space-2) 0 var(--space-3);
  color: var(--color-text-muted);
}

.meta {
  margin: var(--space-1) 0 0;
}

.empty {
  color: var(--color-text-muted);
}

/* Tags */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
}

.tag-list a {
  display: inline-block;
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  padding: 0 var(--space-2);
  text-decoration: none;
}

.tag-list a:hover {
  border-color: var(--color-accent-hover);
  color: var(--color-accent-hover);
}

.tag-index {
  padding-left: var(--space-6);
}

.tag-index li + li {
  margin-top: var(--space-2);
}

/*
 * A post (ADR 0031). Three widths on one grid: the text column (content), a wider one for code,
 * figures, tables and callouts (wide), and the whole window for the scene of the header (full).
 * The header and the body are subgrids, so their children pick a width by its name. On a phone
 * the side tracks are empty: wide is as narrow as the text, and code and tables scroll inside.
 */

main.post-page {
  padding-block: var(--space-8) var(--space-12);
}

.post {
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--renglon), 1fr)
    [wide-start] minmax(0, var(--breakout))
    [content-start] min(var(--measure-text), 100% - 2 * var(--renglon))
    [content-end] minmax(0, var(--breakout))
    [wide-end] minmax(var(--renglon), 1fr)
    [full-end];
}

.post > * {
  grid-column: content;
}

.post__header {
  grid-column: full;
  display: grid;
  grid-template-columns: subgrid;
  align-content: end;
  margin-bottom: var(--space-10);
}

.post__header > :not(.post__scene, .post__label) {
  grid-column: content;
}

.post__header h1 {
  margin: 0 0 var(--space-4);
  font-size: var(--font-size-title);
  line-height: var(--line-height-tight);
  text-wrap: balance;
}

.post__lead {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-lead);
  line-height: var(--line-height-snug);
  text-wrap: pretty;
}

/* The date and the reading time: a quiet line, no forced capitals. */
.post__header .meta {
  margin: var(--space-6) 0 0;
  letter-spacing: normal;
  text-transform: none;
}

.post__header .tag-list {
  margin-top: var(--space-3);
  letter-spacing: normal;
  text-transform: none;
}

/*
 * A post with a scene (spec ESC): its animation fills the back of the header, from edge to edge
 * of the window, and the title, date and tags sit on top. The room for it only opens when the
 * script has started the scene and marked the header with .is-live (spec ESC-08): without the
 * script or without WebGL the canvas stays empty and transparent, and the header is just its text.
 */
.post__header--scene {
  position: relative;
  isolation: isolate;
}

.post__header--scene.is-live {
  min-height: var(--scene-height);
  padding-top: var(--space-16);
}

.post__scene {
  position: absolute;
  z-index: -1;
  top: calc(var(--space-8) * -1);
  left: calc(50% - 50vw);
  width: 100vw;
  /* An explicit height: with "auto", a canvas keeps its own 2:1 ratio and ignores top and
     bottom, so it would spill over the start of the body. */
  height: calc(100% + var(--space-8) + var(--space-4));
  pointer-events: none;
}

.post__label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  padding-left: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  letter-spacing: var(--letter-spacing-label);
  color: var(--color-signal);
  white-space: nowrap;
  pointer-events: none;
}

.post__label.is-left {
  translate: -100% 0;
  padding-left: 0;
  padding-right: var(--space-3);
}

/* The caption of an act in a story (spec ESC-12): what is happening, centred over the story, in
   the colour of the text. */
.post__label--act {
  translate: -50% 0;
  padding-left: 0;
  color: var(--color-text);
}

/* A label of another act: hidden, and it fades in and out as its act comes and goes. */
.post__label {
  transition: opacity 0.6s ease;
}

.post__label.is-off {
  opacity: 0;
}

@media (max-width: 40rem) {
  .post > .post__header,
  .post > .toc {
    margin-bottom: var(--space-8);
  }

  /* On a phone the text fills the header: the scene gets a band of its own above it. */
  .post__header--scene.is-live {
    min-height: 0;
    padding-top: var(--scene-band);
  }

  .post__scene {
    height: calc(var(--scene-band) + var(--space-8));
  }
}

/*
 * Contents (spec POS): on a narrow screen, folded at the start of the post; from 80rem, open in
 * the left margin and fixed while the post scrolls. No JavaScript: ::details-content shows the
 * list of the closed <details> on wide screens; a browser without it keeps the fold.
 */
.toc {
  margin-bottom: var(--space-10);
  border-block: var(--border-width) solid var(--color-border);
  font-size: var(--font-size-toc);
  line-height: var(--line-height-snug);
}

.toc__title {
  padding-block: var(--space-3);
  cursor: pointer;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
}

.toc__title:hover {
  color: var(--color-text);
}

.toc__title:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-width);
  border-radius: var(--radius-xs);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc__list {
  padding-bottom: var(--space-4);
}

.toc li {
  margin-top: var(--space-2);
}

.toc li li {
  margin-top: var(--space-1);
  padding-left: var(--space-3);
}

.toc a {
  color: var(--color-text-muted);
  text-decoration: none;
  text-wrap: pretty;
}

.toc a:hover {
  color: var(--color-text);
}

@media (min-width: 80rem) {
  .toc {
    grid-column: full-start / wide-start;
    grid-row: 2;
    justify-self: end;
    align-self: start;
    position: sticky;
    top: var(--space-8);
    width: min(var(--toc-width), 100%);
    max-height: calc(100vh - var(--space-16) - var(--renglon) * 2);
    margin: 0 var(--space-8) 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border: 0;
  }

  .prose {
    grid-row: 2;
  }

  @supports selector(::details-content) {
    .toc__fold::details-content {
      content-visibility: visible;
      display: contents;
    }

    .toc__title {
      cursor: default;
      list-style: none;
      pointer-events: none;
    }

    .toc__title::-webkit-details-marker {
      display: none;
    }
  }
}

/* The body */

.prose {
  grid-column: wide;
  display: grid;
  grid-template-columns: subgrid;
  font-size: var(--font-size-lg);
  line-height: var(--line-height-prose);
}

.prose > * {
  grid-column: content;
  min-width: 0;
}

.prose > :is(pre, figure, table, .callout) {
  grid-column: wide;
}

/* Low specificity, so the rhythm below always wins. */
:where(.prose) :where(p, ul, ol, pre, table, blockquote, figure, aside, h2, h3, h4) {
  margin: 0;
}

.prose > * + * {
  margin-block-start: var(--space-paragraph);
}

.prose :is(p, li) {
  text-wrap: pretty;
}

.prose :is(h2, h3, h4) {
  position: relative;
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-heading);
  text-wrap: balance;
  scroll-margin-top: var(--space-8);
}

.prose > h2 {
  font-size: var(--font-size-xl);
  margin-block-start: var(--space-14);
}

.prose > h3 {
  font-size: var(--font-size-md);
  margin-block-start: var(--space-9);
}

.prose > h2 + * {
  margin-block-start: var(--space-4);
}

.prose > h3 + * {
  margin-block-start: var(--space-2);
}

/* The wide blocks get more room around them than a paragraph, except right under a heading. */
.prose > :where(pre, figure, table, .callout),
.prose > :where(pre, figure, table, .callout) + :where(:not(h2, h3)) {
  margin-block-start: var(--space-8);
}

/* The link of a heading to itself: quiet until the heading is hovered or the link focused. */
.anchor {
  margin-left: var(--space-2);
  color: var(--color-text-muted);
  font-weight: var(--font-weight-normal);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

:is(h2, h3):hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}

.anchor:hover {
  color: var(--color-signal-text);
}

@media (min-width: 40rem) {
  /* It hangs in the margin, so the heading starts where the text does. */
  .anchor {
    position: absolute;
    right: 100%;
    margin: 0 var(--space-2) 0 0;
  }
}

.prose ul,
.prose ol {
  padding-left: var(--space-6);
}

.prose li + li {
  margin-top: var(--space-2);
}

.prose li::marker {
  color: var(--color-text-muted);
}

.prose blockquote {
  border-left: var(--focus-width) solid var(--color-border-strong);
  color: var(--color-text-muted);
  padding-left: var(--space-4);
}

.prose strong {
  font-weight: var(--font-weight-bold);
}

/* Figures: an image on its own, maybe with a numbered caption (spec POS). */

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.prose figcaption:not(.code__title) {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-snug);
  text-wrap: pretty;
}

.figure__number {
  margin-right: var(--space-1);
  color: var(--color-signal-text);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
}

/* Callouts: told apart by their label, not by a colour per type. */

.callout {
  padding: var(--space-4) var(--space-6) var(--space-6);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--font-size-base);
}

.callout > * + * {
  margin-top: var(--space-3);
}

.callout ul,
.callout ol {
  padding-left: var(--space-6);
}

.callout__label {
  color: var(--color-signal-text);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
}

/* Tables: horizontal lines only, a mono header and figures that line up. */

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
  font-variant-numeric: tabular-nums;
}

.prose th,
.prose td {
  border-bottom: var(--border-width) solid var(--color-border);
  padding: var(--space-2) var(--space-3);
  vertical-align: top;
}

.prose :is(th, td):first-child {
  padding-left: 0;
}

.prose :is(th, td):last-child {
  padding-right: 0;
}

.prose th {
  text-align: left; /* the alignment of a column, if any, wins: see [align] below */
  border-bottom-color: var(--color-border-strong);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
}

@media (max-width: 40rem) {
  /* A table wider than the phone scrolls inside, not the page. */
  .prose table {
    display: block;
    overflow-x: auto;
  }

  .callout {
    padding: var(--space-4);
  }
}

/* The table extension writes the alignment as an attribute: the CSP blocks style="". */
.prose [align="left"] {
  text-align: left;
}

.prose [align="center"] {
  text-align: center;
}

.prose [align="right"] {
  text-align: right;
}

/* Code */

code,
pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

:not(pre) > code {
  background: var(--color-code-bg);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-code-inline);
  font-size: var(--font-size-code-inline);
}

pre {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  line-height: var(--line-height-code);
  overflow-x: auto;
  padding: var(--space-4) var(--space-6);
  tab-size: var(--tab-size);
}

/* A block with the name of its file: the name on top, joined to the code by the same border. */
.code__title {
  padding: var(--space-2) var(--space-6);
  border: var(--border-width) solid var(--color-border);
  border-bottom: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  overflow-wrap: anywhere;
}

@media (max-width: 40rem) {
  pre,
  .code__title {
    padding-inline: var(--space-4);
  }
}

.code__title + pre {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Highlighting: chroma's classes (Pygments names), by family. */
.chroma .err { color: var(--color-syntax-error); }

.chroma .k, .chroma .kc, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr,
.chroma .ow, .chroma .nt {
  color: var(--color-syntax-keyword);
}

.chroma .kt, .chroma .nc, .chroma .nn, .chroma .no, .chroma .nb, .chroma .bp {
  color: var(--color-syntax-type);
}

.chroma .nf, .chroma .fm, .chroma .nd, .chroma .na {
  color: var(--color-syntax-function);
}

.chroma .s, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .dl, .chroma .sd, .chroma .s2,
.chroma .se, .chroma .sh, .chroma .si, .chroma .sx, .chroma .sr, .chroma .s1, .chroma .ss {
  color: var(--color-syntax-string);
}

.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi, .chroma .il, .chroma .mo {
  color: var(--color-syntax-number);
}

.chroma .o, .chroma .p {
  color: var(--color-syntax-operator);
}

.chroma .c, .chroma .ch, .chroma .cm, .chroma .c1, .chroma .cs, .chroma .cp, .chroma .cpf {
  color: var(--color-syntax-comment);
  font-style: italic;
}

.chroma .gd { color: var(--color-syntax-error); }
.chroma .gi { color: var(--color-syntax-string); }
.chroma .ge { font-style: italic; }
.chroma .gs { font-weight: var(--font-weight-bold); }

/* Error pages */

.error-page {
  padding-block: var(--space-16);
  text-align: center;
}
