:root {
  font: menu;
  font-family:
    "TX-02", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  /* agent-gossip's palette. light-dark() rather than a prefers-color-scheme
     query so color-scheme drives both these tokens and the UA's own rendering
     of the scrollbar from one switch. */
  color-scheme: light dark;
  line-height: 150%;

  --bg: light-dark(#ffffff, #272727);
  --fg: light-dark(#272727, #ffffff);
  /* gossip's --visited is dropped: a visited link keeps the --link color here. */
  --link: light-dark(#0f62c8, #5aaafa);
  --active: light-dark(#c62435, #ff7d87);
  --dim: light-dark(#595859, #a6a5a6);
  --code-bg: light-dark(#f6f6f6, #1e1d1e);
}

body {
  margin: 0;
  padding: 1rem;
  background: var(--bg);
  color: var(--fg);
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

a {
  color: var(--link);
}

a:active {
  color: var(--active);
}

/* The active state is listed too: `a:active` outweighs a bare `h1 a`, so
   without it the title turns red while it is being clicked. */
h1 a,
h1 a:active {
  color: inherit;
  text-decoration: none;
}

main {
  /* Narrower than the sibling site's 80ch: that width buys room for real
     80-column transcripts, and there are none here. */
  max-width: 66ch;
  /* As a flex item main defaults to min-width:auto, which is the min-content
     width of its widest child — so a pre block would refuse to shrink and set
     the whole page scrolling sideways on a phone. */
  min-width: 0;
  margin: 0 auto;
}

h1,
h2,
h3,
p,
ul,
li {
  font-size: 1em;
  font-weight: normal;
  margin: 0;
}

h1,
h2,
h3,
p,
ul {
  margin-block: 1em;
}

h1,
h2 {
  text-transform: uppercase;
  font-weight: bold;
}

/* Bold but not uppercased, so a subheading reads as one rank below h2
   rather than as another of them. */
h3 {
  font-weight: bold;
}

/* A command keeps its case inside a heading — /GOSSIP-CREATE is not a
   command anyone can type. */
h2 code {
  text-transform: none;
}

h2 {
  margin-bottom: 0;
}

/* A list zeroes its own top margin so it can sit flush under the paragraph
   that introduces it, so a heading directly above one has to pay for the gap
   itself. */
h2:has(+ ul) {
  margin-bottom: 1em;
}

ul {
  list-style: none;
  padding: 0;
  margin-top: 0;
}

li::before {
  content: " - ";
}

pre {
  /* The browser default shrinks pre below the OS UI size `font: menu` sets. */
  font: inherit;
  margin-block: 1em;
  /* The padding is paid for by an equal negative margin, so the content box
     keeps the full measure. rem, not em: this has to match body's 1rem padding
     exactly or the bleed pushes past the viewport on a phone, and `font: menu`
     means 1em is whatever the OS UI size happens to be. */
  margin-inline: -1rem;
  padding: 1rem;
  background: var(--code-bg);
  overflow-x: auto;
  border-radius: 4px;
}

code {
  background: var(--code-bg);
  /* Horizontal only: vertical padding on an inline box does not grow the line
     box, so it would run under the lines above and below. */
  padding: 0 0.3em;
  /* A span that wraps mid-sentence would otherwise be padded on its first and
     last fragment only; clone repaints the box on every line. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  border-radius: 4px;
}

.dim {
  color: var(--dim);
}

hr {
  border: none;
  margin-block: 2em;
  color: var(--fg);
}

hr::before {
  content: "---";
}
