/* Long-form reading: lab notes, and the legal pages. Put .prose on the element that holds the text. It makes a centred
   column of about seventy characters a line (Inter Tight is narrow, so 30em holds about 72), and sets the headings,
   paragraphs, links, lists, quotes, code, figures and footnotes. Body text is a little softer than --fg (13:1 instead
   of 19:1): pure white on black glares over a long read. Headings, bold and quotes stay at --fg. */

.prose {
  --measure: 30em;
  width: min(100% - 2 * var(--pad), var(--measure));
  margin-inline: auto;
  font-size: clamp(17px, 16px + .3vw, 20px);
  line-height: 1.7;
  color: rgba(255, 255, 255, .8);
  overflow-wrap: break-word;
}

/* Rhythm: a blank line's worth between blocks, more above a heading than below it. */
.prose > * + * { margin-top: 1.15em; }

.prose h1 {
  font-size: clamp(40px, 5.6vw, 76px);
  font-weight: 600;
  line-height: .98;
  letter-spacing: -.045em;
  color: var(--fg);
  text-wrap: balance;
}
.prose h2 {
  margin-top: 2.2em;
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.028em;
  color: var(--fg);
  text-wrap: balance;
}
.prose h3 {
  margin-top: 1.9em;
  font-size: 1.16em;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.016em;
  color: var(--fg);
}
.prose :is(h2, h3) + * { margin-top: .6em; }

.prose p { text-wrap: pretty; }
.prose strong { font-weight: 600; color: var(--fg); }

/* Links in the text: white, underlined in red. Links with a class are the page's own parts and style themselves. */
.prose a:not([class]) {
  color: var(--fg);
  text-decoration-line: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: text-decoration-color .2s;
}
.prose a:not([class]):hover { text-decoration-color: currentColor; }

/* Lists: square red bullets, like the steps of the mark; numbers in mono, like the site's labels. */
.prose :is(ul, ol) { padding-left: 1.3em; }
.prose ul { list-style-type: square; }
.prose li { padding-left: .35em; }
.prose li + li, .prose li > :is(ul, ol) { margin-top: .5em; }
.prose li::marker { color: var(--red); }
.prose ol > li::marker { font-family: var(--mono); font-size: .8em; }

.prose blockquote {
  margin-block: 1.5em;
  padding-left: 1.1em;
  border-left: 2px solid var(--red);
  font-size: 1.14em;
  line-height: 1.55;
  letter-spacing: -.01em;
  color: var(--fg);
}

/* Code in JetBrains Mono, a little smaller than the text round it. A block keeps its spacing and scrolls sideways when
   a line is too long; give the <pre> tabindex="0", so the keyboard can scroll it too. */
.prose :is(code, pre) { font-family: var(--mono); }
.prose code { font-size: .86em; }
.prose :not(pre) > code {
  padding: .1em .36em;
  border-radius: 5px;
  background: rgba(255, 255, 255, .08);
  color: var(--fg);
}
.prose pre {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0b0b;
  font-size: .76em;
  line-height: 1.7;
  color: var(--fg);
  overflow-x: auto;
  tab-size: 4;
}
.prose pre code { font-size: 1em; }

/* Figures run the width of the column, framed by a hairline (a dark image has no edge of its own on black). The
   caption starts with its number in red mono: <b>Fig. 1</b>. */
.prose figure { margin-block: 2.2em; }
.prose figure > :is(img, svg, video) {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b0b0b;
}
.prose figcaption {
  margin-top: 14px;
  font-size: .8em;
  line-height: 1.55;
  color: var(--mute);
  text-wrap: pretty;
}
.prose figcaption b {
  margin-right: .7em;
  font: 400 .86em var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
}

/* The line under a title: the date, the reading time and the authors, or when a legal page last changed. */
.prose .byline { margin-top: 28px; }

/* Footnotes. The reference is a small red number, <sup><a class="footnote-ref" id="ref1" href="#fn1">1</a></sup>, and
   the note at the end, <li id="fn1">, links back with an arrow (.footnote-back). Each end lights up when a jump lands
   on it. */
.prose sup { font-size: .68em; line-height: 0; }
.footnote-ref {
  padding: 0 .2em;
  border-radius: 3px;
  font-family: var(--mono);
  color: var(--red);
}
.footnote-ref:hover { text-decoration: underline; }
.footnote-ref:target { background: rgba(255, 46, 62, .22); }

.prose .footnotes {
  margin-top: 3.4em;
  padding-top: 1.6em;
  border-top: 1px solid var(--line);
  font-size: .84em;
  line-height: 1.6;
  color: var(--mute);
}
.prose .footnotes h2 {
  margin: 0 0 1.4em;
  font: 400 11.5px/1.3 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
}
.footnotes li:target { color: var(--fg); }
/* The way back: an ↑ in mono, like the reference it returns to. It is text (both fonts have the glyph), so a no-break
   space keeps it with the last word, and it is padded to a 24 px target. */
.footnote-back { padding: 4px 7px; font-family: var(--mono); color: var(--red); }
.footnote-back:hover { color: var(--fg); }
