/* lindg.re: white, small lowercase
   Geist Mono at 10pt, a fixed menu on the left with every entry by year,
   and grey for everything secondary. Bold is the Light cut over the Thin.

   Geist Mono and Geist Pixel are by Vercel, under the SIL Open Font
   License (fonts/OFL.txt). */

@font-face {
  font-family: "font";
  src: url("/fonts/GeistMono-Thin.woff2") format("woff2");
  font-weight: 100 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "font2";
  src: url("/fonts/GeistMono-Light.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Geist Pixel, for the name in the menu: one letter shape, five ways of
   drawing its pixels. Square is the one at rest; the others are for the
   wave (see `.logo`). The files hold only the name's letters ("lindg.re"),
   about 3KB each; after changing the name, subset them again from the
   full fonts (geist on npm), e.g.
   pyftsubset GeistPixel-Square.woff2 --text="lindg.re" --flavor=woff2 */
@font-face { font-family: "pixel-square"; src: url("/fonts/GeistPixel-Square.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "pixel-grid"; src: url("/fonts/GeistPixel-Grid.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "pixel-circle"; src: url("/fonts/GeistPixel-Circle.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "pixel-triangle"; src: url("/fonts/GeistPixel-Triangle.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "pixel-line"; src: url("/fonts/GeistPixel-Line.woff2") format("woff2"); font-display: swap; }

:root {
  --content-width: 840px;
  /* menu, content and contents keep together as one group, 1280px wide;
     on screens wider than that, the whole group moves to the middle, with
     the room left over split evenly on both sides */
  --shift: max(0px, calc((100vw - 1280px) / 2));
  --ink: #000;
  /* the reference's `gray` (#808080) is only 3.94:1 on white, and fainter
     still in the Thin cut: these pass WCAG AA (4.5:1) on white and on the
     pills */
  --gray: #5e5e5e;
  --pill: #efefef;
  /* the site's red, a striking one: pure red for graphics
     and fills, and a hair darker for text, where pure red is only 4:1 on
     white (this is 4.97:1, and looks the same) */
  --red: #ff0000;
  --accent: #e10600;
  --red-wash: rgba(255, 0, 0, .15);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --page: #fff;
  --menu-width: 190px;
  --content-left: 200px;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--page);
}

body {
  font: 10pt/1.275 "font", monospace;
  min-height: 100vh;
  text-transform: lowercase;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  overflow-x: hidden;
}

/* selected text: black on a light red, whatever colour it was (thin white
   strokes on full red were hard to read) */
::selection {
  background: #ffb8b8;
  color: #000;
  text-shadow: none;
}

/* only for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

p { margin: 0; }

.bold, strong, b { font-family: "font2", monospace; font-weight: 400; }
em, i { font-style: normal; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

.gray, .label { color: var(--gray); }

a { color: inherit; text-decoration: none; }
.content a { transition: color .15s; }
.content a:hover { color: var(--accent); }
/* links in text: a faint underline, and a red one that draws across it,
   left to right, when pointed at */
.content :is(p, li, td, blockquote) a:not(.footnote-ref, .footnote-back) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: #bbb;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 100% / 0 1px;
  transition: color .15s, background-size .3s var(--ease-out), text-decoration-color .15s;
}
.content :is(p, li, td, blockquote) a:not(.footnote-ref, .footnote-back):hover {
  background-size: 100% 1px;
  text-decoration-color: transparent;
}

/* ------------------------------------------------------------- layout */

.container {
  display: flex;
  width: 100%;
}

.menu {
  position: fixed;
  left: var(--shift);
  top: 0;
  height: 100vh;
  padding: 15px 15px 15px 15px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  width: var(--menu-width);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  scrollbar-width: none;
}

/* the content: up to 840px wide (the text, and the margin notes' column),
   a fixed step after the menu. With the contents column right after it,
   the three keep together; on wide screens the room left over gathers on
   the right, not between them. */
.content {
  display: flex;
  flex-direction: column;
  padding: 15px 15px 100px 0;
  margin-left: calc(var(--content-left) + var(--shift));
  box-sizing: border-box;
  width: calc(100% - var(--content-left));
  max-width: var(--content-width);
  min-width: 0;
}

/* ---------------------------------------------------------------- menu */

/* the name, in Geist Pixel Square, black; red when pointed at. A wave
   runs through it on load and on hover (`waving`, set by site.js): each
   letter steps through the five pixel styles in turn, a beat after the one
   before, and settles back. The styles share one letter shape, so nothing
   moves. */
.logo {
  display: inline-flex;
  align-self: flex-start;
  font: 20px/1 "pixel-square", "font", monospace;
  text-transform: none;
  color: var(--ink);
  transition: color .15s;
}
.logo:hover, .logo:focus-visible { color: var(--accent); }
.logo .ch { white-space: pre; }
@keyframes wave {
  0% { font-family: "pixel-grid"; }
  20% { font-family: "pixel-circle"; }
  40% { font-family: "pixel-triangle"; }
  60% { font-family: "pixel-line"; }
  80%, 100% { font-family: "pixel-square"; }
}
.logo.waving .ch { animation: wave .6s steps(1); }
.logo.waving .ch:nth-child(2) { animation-delay: .045s; }
.logo.waving .ch:nth-child(3) { animation-delay: .09s; }
.logo.waving .ch:nth-child(4) { animation-delay: .135s; }
.logo.waving .ch:nth-child(5) { animation-delay: .18s; }
.logo.waving .ch:nth-child(6) { animation-delay: .225s; }
.logo.waving .ch:nth-child(7) { animation-delay: .27s; }
.logo.waving .ch:nth-child(8) { animation-delay: .315s; }
.zero { height: 1.275em; }

/* years in black; between them, a blank line */
.menu-year { color: var(--ink); }
.menu-year:not(:first-child) { margin-top: 1.275em; }

/* an entry: the month in light grey, its title in a column of its own
   (long titles wrap inside it), and its catalogue number at the end. The
   one you're pointing at turns into a black block, white on black, and
   the one you're on a red one: the block reaches 1ch
   past the text on each side, so the text doesn't move. */
.item {
  position: relative;
  display: grid;
  grid-template-columns: 4ch 1fr auto;
  gap: 0 1ch;
  margin: 0 -1ch;
  padding: 0 1ch;
  transition: background-color .12s, color .12s;
}
.item-month, .item-no { color: #767676; transition: color .12s; }
.item-no { font-variant-numeric: tabular-nums; text-transform: uppercase; }
.item:is(:hover, :focus-visible) { background: var(--ink); color: #fff; outline: none; }
.item.selected { background: var(--accent); color: #fff; font-family: "font2", monospace; }
.item:is(:hover, :focus-visible, .selected) :is(.item-month, .item-no) { color: inherit; }

/* ------------------------------------------------------------- content */

.label { margin-bottom: 1.275em; }

/* blocks and the comments set apart by a dashed rule */
.block + .block, .comments {
  margin-top: 1.9em;
  padding-top: 1.9em;
  border-top: 1px dashed #ccc;
}

/* catalogue numbers: LG–001, in capitals, figures of even width */
.catno {
  color: var(--gray);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.content :is(h1, h2, h3, h4, h5, h6) {
  font: inherit;
  margin: 2.55em 0 1.275em;
}
.content :is(h1, h2, h3, h4, h5, h6):first-child { margin-top: 0; }
.content :is(h2, h3, h4, h5, h6) { font-family: "font2", monospace; }
.content :is(h3, h4, h5, h6) { color: var(--gray); }

.content :is(p, ul, ol, blockquote, pre, .codeblock, dl) { margin: 0 0 1.275em; }
.content :is(p, ul, ol):last-child { margin-bottom: 0; }

.content :is(ul, ol) { padding-left: 2ch; }
.content ul { list-style: none; }
.content ul > li::before {
  content: "-";
  display: inline-block;
  width: 2ch;
  margin-left: -2ch;
  color: var(--gray);
}
.content ol li::marker { color: var(--gray); }

.content blockquote {
  margin-left: 0;
  padding-left: 2ch;
  color: var(--gray);
  border-left: 1px solid var(--pill);
}

.content hr { border: 0; border-top: 1px dashed #ccc; margin: 2.55em 0; }

.content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

/* lines: a list without dashes, a line per thing */
.content ul.lines { padding: 0; }
.content ul.lines > li::before { content: none; }
.content ul.lines > li + li { margin-top: .6em; }

/* the intro's own headings would shout: the label says what it is */
.intro :is(h1, h2) { font-family: "font2", monospace; margin-top: 0; }

/* a status: a pixel-art icon (Site/Pixel.lean) beside a grey line */
.status {
  display: flex;
  align-items: center;
  gap: 1.5ch;
  color: var(--gray);
}
.status img { flex: none; image-rendering: pixelated; }
.content .status { margin-bottom: 1.275em; }

/* a skeleton: lines of ░ with a darker wave running through them, so the
   blocks seem to thicken (▒, ▓) as it passes */
.skeleton > div { display: flex; flex-direction: column; }
.shimmer {
  width: max-content;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.275;
  color: transparent;
  background: linear-gradient(90deg, #d4d4d4 35%, #5e5e5e 50%, #d4d4d4 65%) 100% 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { to { background-position: 0 0; } }

@media (scripting: none) {
  .script-only { display: none !important; }
}

/* -------------------------------------------------------------- plates */

/* A plate (see `plate` in Site/Pages.lean): a print, always upright, set
   beside the text it opens as a newspaper sets a picture: on the left (the
   right is the margin notes' column), with the text running down its
   right. Shown as a 1-bit dither at its own size (240px wide), its credit
   always under it; pointing at it brings in the scan over the dither, once
   site.js has fetched it (`ready`). The image sizes in the markup keep its
   shape while it loads. */
.plate {
  float: left;
  clear: left;
  width: 240px;
  margin: .2em 2.5ch 1.275em 0;
}
.plate-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 3px;
}
.plate-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  pointer-events: none;
}
.content .plate img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}
.plate-dither { image-rendering: pixelated; }
.content .plate .plate-scan {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s var(--ease-out);
}
.plate.ready:is(:hover, :focus-within) .plate-scan { opacity: 1; }
.plate-credit { margin-top: .6em; color: var(--gray); }

/* code blocks and rules beside a plate keep their own box beside it,
   instead of their background running under the picture. Lists and quotes
   start below it: their indents would break beside it, and the margin
   notes they hold would be swallowed by a box of their own. Footnotes and
   later sections start below it too. */
.post-body > :is(.codeblock, pre, hr) { display: flow-root; }
.post-body > :is(ul, ol, blockquote) { clear: left; }
.post-body > .footnotes, .comments, .block + .block { clear: both; }

}

/* ------------------------------------------------------------- buttons */

/* The site's buttons (see `button` and `toggles` in Site/Pages.lean): 18px
   pills with 3px
   corners, the grey text on light grey, black with white text when pointed
   at. Plain grey on the pill is only 3.4:1, so these use the site's darker
   one. */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
  align-items: center;
  /* the toggles' pills sit behind them (z-index -1): keep them in the row */
  isolation: isolate;
}
.button-row + .button-row { margin-top: 6px; }

.button, .toggle {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: max-content;
  height: 18px;
  margin: 0;
  padding: 0 3px;
  border: none;
  border-radius: 3px;
  outline: none;
  box-sizing: border-box;
  color: var(--gray);
  font: 10pt/16px "font", monospace;
  text-transform: inherit;
  text-align: center;
  text-decoration: none;
  appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .2s, color .2s;
}
.button:focus-visible, .toggle:focus-visible { outline: 1px solid var(--ink); outline-offset: 1px; }

/* the solid one: a pill, and a slow diagonal shine across it */
.button {
  min-width: 45px;
  background-color: var(--pill);
  z-index: 1;
  overflow: hidden;
}
.content .button:hover { background-color: #000; color: #fff; }
.button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: linear-gradient(45deg,
    transparent 0%, transparent 38%,
    rgba(255, 255, 255, .07) 47%, rgba(255, 255, 255, .16) 50%, rgba(255, 255, 255, .07) 53%,
    transparent 62%, transparent 100%);
  background-size: 220% 220%;
  background-repeat: no-repeat;
  background-position: -90% 50%;
  animation: button-shine 10s linear infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes button-shine {
  0% { background-position: -90% 50%; }
  100% { background-position: 190% 50%; }
}

/* olive */
.button.olive { background-color: #4a5238; color: #e4e6dc; }
.content .button.olive:hover { background-color: #5c6649; color: #f5f6f0; }
.button.olive::before {
  background-image: linear-gradient(45deg,
    transparent 0%, transparent 38%,
    rgba(255, 255, 255, .1) 47%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .1) 53%,
    transparent 62%, transparent 100%);
}

/* the toggle: its pill is drawn behind it, a pixel low; black while open */
.toggle {
  min-width: 60px;
  background-color: transparent;
}
.toggle::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 1px;
  height: 18px;
  background-color: var(--pill);
  border-radius: 3px;
  pointer-events: none;
  z-index: -1;
  transition: background-color .2s;
}
.toggle:hover, .toggle[aria-expanded="true"] { color: #fff; }
.toggle:hover::before, .toggle[aria-expanded="true"]::before { background-color: #000; }

/* on phones, a bigger target than the pill */
@media (max-width: 767px) {
  .button::after, .toggle::after {
    content: "";
    position: absolute;
    top: -13px;
    bottom: -13px;
    left: -3px;
    right: -3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button::before { animation: none; opacity: 0; }
}

/* a toggle's panel, under the row. Without JavaScript they all show, each
   under its label; with it, only the open one, without. */
.toggle-panel {
  margin: 10px 0 30px;
  transition: opacity .25s, translate .25s var(--ease-out);
}
@starting-style {
  .toggle-panel { opacity: 0; translate: 0 4px; }
}
.toggle:active, .button:active { translate: 0 1px; }
/* the toggle flashes red as it opens */
.toggle[aria-expanded="true"]::before { animation: toggle-flash .4s; }
@keyframes toggle-flash { from { background-color: var(--red); } }
.toggle-panel[hidden] { display: none; }
@media (scripting: enabled) {
  .toggle-label { display: none; }
}

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

.content :is(code, pre) { font-family: "font2", monospace; text-transform: none; }
.content :not(pre) > code {
  padding: 0 3px;
  background: var(--pill);
  border-radius: 3px;
}

.codeblock { position: relative; border-radius: 3px; background: var(--pill); }

/* the colours (Site/Highlight.lean): keywords and numbers in a dark red,
   strings marked in a light one, comments grey, type names heavier. All
   pass contrast on the block's grey. */
.content .codeblock pre { margin: 0; }
/* code as typed: no ligatures (Geist Mono would draw => as an arrow) */
.content :is(code, pre) { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.codeblock .tok-k, .codeblock .tok-n { color: #c40000; }
.codeblock .tok-s { background: #ffd9d9; border-radius: 2px; }
.codeblock .tok-c { color: #6b6b6b; }
.codeblock .tok-t { font-family: "font2", monospace; font-weight: 500; }

/* the copy button (site.js adds it): top right, a white pill, black when
   pointed at */
.code-copy {
  position: absolute;
  top: 5px;
  right: 6px;
  height: 18px;
  padding: 0 6px;
  border: 0;
  border-radius: 3px;
  background: #fff;
  color: var(--gray);
  font: 10pt/18px "font", monospace;
  text-transform: lowercase;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.code-copy:hover, .code-copy:focus-visible { background: var(--ink); color: #fff; }
.code-copy.done { background: var(--accent); color: #fff; }
.codeblock:not(:has(.codeblock-bar)) pre { padding-right: 70px; }
.codeblock-bar { padding: 6px 10px 0; color: var(--gray); }
.codeblock pre, .content > pre, article > pre {
  margin: 0;
  padding: 8px 10px 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

/* -------------------------------------------------------------- a post */

.post-title { margin-bottom: .2em !important; }
/* An article is formal (see `post` in Site/Pages.lean): written as it is
   written, not lowercased, its number, date and reading time on a line of
   their own, its summary as an abstract, and its sections numbered (1, 1.1,
   1.1.1), as in a paper. A blog post stays informal and lowercase. */
.formal { text-transform: none; }
.formal .post-meta { margin-top: .3em; }
.formal .abstract { margin-top: 1.9em; max-width: 64ch; }
.formal .abstract .label { margin-bottom: .6em; text-transform: lowercase; }
.formal .comments .label, .formal .footnotes { text-transform: lowercase; }
.formal .post-body { counter-reset: h2; }
.formal .post-body h2 { counter-increment: h2; counter-reset: h3; }
.formal .post-body h3 { counter-increment: h3; counter-reset: h4; }
.formal .post-body h4 { counter-increment: h4; }
.formal .post-body h2::before { content: counter(h2) "\2003"; }
.formal .post-body h3::before { content: counter(h2) "." counter(h3) "\2003"; }
.formal .post-body h4::before { content: counter(h2) "." counter(h3) "." counter(h4) "\2003"; }
.formal .post-body :is(h2, h3, h4)::before { color: var(--gray); font-variant-numeric: tabular-nums; }

/* the post's header, set apart from its body by a dashed rule */
.content article > :is(.summary, .abstract, .post-meta:has(+ .post-body), .post-title:has(+ .post-body)) {
  margin-bottom: 1.9em !important;
  padding-bottom: 1.9em;
  border-bottom: 1px dashed #ccc;
}

/* Margin notes (`^[…]` in Markdown): a small number in the text and the
   note just below the line, indented, in grey. With room, they sit in a
   column to the right of the text. The numbers are CSS counters. */
.post-body, .content > article { counter-reset: note; }
.note-ref { counter-increment: note; }
.note-ref::after {
  content: counter(note);
  font-size: .75em;
  vertical-align: super;
  line-height: 0;
  color: var(--gray);
}
.sidenote {
  display: block;
  margin: .4em 0 .6em 2ch;
  font-size: inherit;
  color: var(--gray);
}
.sidenote-text::before { content: counter(note) " "; color: var(--ink); }
.note-cover, .note-room { display: none; }
.note-anchor:is(:hover, :focus-within) .sidenote { color: var(--ink); }
.note-anchor:is(:hover, :focus-within) .note-ref::after { color: var(--ink); }
.sidenote img { margin: .4em 0; }

@media (min-width: 1000px) {
  .post-body { padding-right: 200px; }
  .post-body .sidenote {
    float: right;
    clear: right;
    width: 170px;
    margin: 0 -200px .6em 0;
  }
  .post-body blockquote { margin-right: 0; }
}

/* Footnotes (`[^label]`): a small bracketed number, raised; listed at the
   end under a dashed line. */
.footnote-ref {
  font-size: .75em;
  vertical-align: super;
  line-height: 0;
  color: var(--gray);
}
.footnote-ref:hover { color: var(--ink); }
.footnotes {
  margin-top: 2.55em;
  padding-top: 1.275em;
  border-top: 1px dashed #ccc;
  color: var(--gray);
}
.footnotes ol { margin: 0; padding-left: 3ch; }
.footnotes li { margin: .3em 0; }
.footnote-back { color: var(--gray); }
.footnote-back:hover { color: var(--ink); }
:is(.footnotes li, .footnote-ref):target { color: var(--ink); animation: target-flash 1.6s ease-out; }
@keyframes target-flash { from { background-color: var(--red-wash); } }
:is(.footnotes li, .footnote-ref) { scroll-margin-top: 2em; }

/* ------------------------------------------------------------ comments */

/* border-box: giscus sets its container to `width: 100%` */
.giscus { box-sizing: border-box; min-height: 2.55em; }

/* ------------------------------------------------------------ the home */

.now { margin-top: 1.275em; }

.news li { display: grid; grid-template-columns: max-content 1fr; gap: 2ch; }
.news li > div > :last-child { margin-bottom: 0; }

/* recently played: track, artist, when; the one playing now in green */
/* recently played: each track's cover beside its name, artist and when */
.tracks .track-now { color: var(--accent); }
.plays { margin-top: 1.275em; }
.content ul.tracks > li.track {
  display: grid;
  grid-template-columns: max-content 1fr;
  align-items: center;
  gap: 1.5ch;
}
.content ul.tracks > li + li { margin-top: 8px; }
.track-text { min-width: 0; }

/* the cover: pixelated and grey (a 10×10 canvas, scaled up hard), with the
   image itself over it, hidden; pointing at the track brings it in, in
   colour */
.cover {
  position: relative;
  display: block;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--pill);
}
.cover.large { width: 48px; height: 48px; }
.cover :is(canvas, img) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.cover canvas {
  image-rendering: pixelated;
  filter: grayscale(1) contrast(1.1);
  opacity: 0;
  transition: opacity .3s;
}
.cover.loaded canvas { opacity: 1; }
.cover img { opacity: 0; filter: grayscale(1); transition: opacity .25s, filter .4s; }
.track:is(:hover, :focus-within) .cover.loaded img { opacity: 1; filter: none; }
/* a hairline frame, so light covers don't melt into the page */
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  pointer-events: none;
}
/* no cover (or not yet): a 1-bit dither, like a block of ░ */
.cover-none, .skeleton .cover {
  background: repeating-conic-gradient(#cfcfcf 0 25%, transparent 0 50%) 0 0 / 2px 2px;
}
.cover-none { position: absolute; inset: 0; }
.skeleton .cover { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* activity: a dot per day, a column per week, darker for busier days */
.dots {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 1.275em;
}
.week { display: flex; flex-direction: column; gap: 3px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pill); }
.dot.pad { background: none; }
.dot.l1 { background: #c4c4c4; }
.dot.l2 { background: #8a8a8a; }
.dot.l3 { background: #4a4a4a; }
.dot.l4 { background: var(--red); }

/* ---------------------------------------------------------- contents */

/* The page's contents (see `contents` in Site/Pages.lean): a column right
   after the content, mirroring the menu, its entries numbered like the menu's months,
   with the same highlights: black when pointed at, red for the section
   you're reading (marked by site.js). Only where there's room for it. */
.contents {
  position: fixed;
  top: 0;
  /* right after the content, not at the window's edge */
  left: calc(var(--shift) + var(--content-left) + var(--content-width) + 20px);
  width: 220px;
  max-height: 100vh;
  padding: 15px;
  box-sizing: border-box;
  overflow-y: auto;
  scrollbar-width: none;
}
.contents .label { margin-bottom: 1.275em; }
.contents ol { margin: 0; padding: 0; list-style: none; }
.contents .item { grid-template-columns: 4ch 1fr; }
.contents .item.d1 .item-title { padding-left: 2ch; }
@media (max-width: 1299px) {
  .contents { display: none; }
}

/* jumping to a section leaves a little room above it */
:is(h2, h3, h4, .block, .footnotes, .comments)[id] { scroll-margin-top: 15px; }
html { scroll-behavior: smooth; }

/* ------------------------------------------------------------- phones */

/* Geist Mono Regular: on phones the text is set in Light, so bold needs
   the next weight up (only fetched there, and only when used) */
@font-face {
  font-family: "font3";
  src: url("/fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

.menu-toggle, .menu-contents { display: none; }

/* Phones and narrow tablets: the menu becomes a bar at the top that stays
   put, with the name and an "index" button. The button (site.js) opens a
   panel with the page's contents and every entry; without JavaScript the
   panel just shows. The text is larger and a weight heavier, taps are
   finger-sized, plates use the screen's width, and margin notes open when
   their number is tapped instead of breaking up the sentence. */
@media (max-width: 767px) {
  :root { --content-left: 0px; --shift: 0px; }
  body { font-size: 14.5px; }
  .container { flex-direction: column; }

  .menu {
    position: static;
    z-index: 1000;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 10px 16px;
    background: var(--page);
    border-bottom: 1px dashed #ccc;
    /* a quick fade in, not the page's slow arrival */
    animation: rise .18s var(--ease-out) both;
  }
  /* the bar stays at the top only when its panel can close (with
     JavaScript); otherwise the whole menu would ride along */
  .js .menu { position: sticky; top: 0; }
  .menu > .logo { align-self: center; padding: 6px 0; }
  .menu-toggle {
    display: block;
    min-width: 64px;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 3px;
    background: var(--pill);
    color: var(--ink);
    font: inherit;
    text-transform: lowercase;
    cursor: pointer;
  }
  .menu.open .menu-toggle { background: var(--ink); color: #fff; }
  .menu-panel { flex-basis: 100%; }
  .menu.collapsible .menu-panel { display: none; }
  /* open, it lies over the page below the bar (taking no room, so the
     page doesn't move when it closes) */
  .menu.collapsible.open .menu-panel {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: .6em 16px 1em;
    background: var(--page);
    border-bottom: 1px dashed #ccc;
  }
  .menu-contents { display: block; margin: .6em 0 1.275em; }
  .menu-contents ol { margin: 0; padding: 0; list-style: none; }
  .menu-contents .label { margin-bottom: .3em; }
  .menu-contents .item { grid-template-columns: 4ch 1fr; }
  .menu-contents .item.d1 .item-title { padding-left: 2ch; }
  /* finger-sized entries */
  .menu .item { padding-top: 13px; padding-bottom: 13px; }
  .menu-year:not(:first-child) { margin-top: .9em; }

  .content {
    margin: 0;
    width: 100%;
    max-width: none;
    padding: 24px 16px 80px;
    font-family: "font2", monospace;
  }
  .content :is(.bold, strong, b, h1, h2, h3, h4, h5, h6), .item.selected { font-family: "font3", monospace; }
  :is(h2, h3, h4, .block, .footnotes, .comments)[id] { scroll-margin-top: 70px; }

  .plate { float: none; width: 100%; max-width: 100%; margin: 0 0 1.5em; }

  /* margin notes: just the number, until it's tapped (the note stays in
     the page for screen readers) */
  .js .note-ref { padding: 6px 4px; margin: -6px -2px; cursor: pointer; }
  .js .note-anchor:not(.open) .sidenote {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .js .note-anchor.open .note-ref::after { color: #fff; background: var(--accent); }
  .js .note-anchor.open .sidenote { color: var(--ink); }

  .code-copy { height: 28px; line-height: 28px; padding: 0 10px; }
}

/* ---------------------------------------------------------- arrival */

/* the page settles in: the menu, then the content's blocks, one after
   another, each fading up a few pixels; the activity dots fill in left to
   right */
@keyframes rise { from { opacity: 0; translate: 0 4px; } }
.menu > *, .content > * { animation: rise .5s var(--ease-out) both; }
.menu > :nth-child(3) { animation-delay: .06s; }
.content > :nth-child(1) { animation-delay: .08s; }
.content > :nth-child(2) { animation-delay: .14s; }
.content > :nth-child(3) { animation-delay: .2s; }
.content > :nth-child(4) { animation-delay: .26s; }
.content > :nth-child(5) { animation-delay: .32s; }
.content > :nth-child(n + 6) { animation-delay: .38s; }

@keyframes reveal { from { clip-path: inset(0 100% 0 0); } }
.dots { animation: reveal 1.2s var(--ease-out) .4s both; }

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