/* Long-form reading first. No framework, no webfont, no script: the page is
   one document and every byte it costs is paid by a reader who came to read. */

:root {
  color-scheme: light dark;

  --ink: #16161a;
  --ink-soft: #4a4a55;
  --paper: #fbfaf7;
  --rule: #ddd9d0;
  --accent: #7a1c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e4df;
    --ink-soft: #a5a29a;
    --paper: #16161a;
    --rule: #33323a;
    --accent: #d98b8b;
  }
}

html {
  /* Fluid measure: 18px on a phone, 21px on a desktop, no media query. */
  font-size: clamp(1.05rem, 0.95rem + 0.35vw, 1.3rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

main {
  /* ~68 characters. Wider than this and the eye loses the line return. */
  max-width: 34rem;
  margin: 0 auto;
  padding: 4rem 1.4rem 6rem;
}

h1 {
  font-size: 2.1rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 3.2rem 0 1rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.05rem;
  margin: 2.2rem 0 0.7rem;
}

p {
  margin: 0 0 1.15rem;
}

/* The opening paragraph carries the thesis; give it room to be read slowly. */
main > p:first-of-type {
  font-size: 1.12em;
  color: var(--ink-soft);
}

blockquote {
  margin: 1.8rem 0;
  padding: 0 0 0 1.2rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}

ol,
ul {
  padding-left: 1.3rem;
  margin: 0 0 1.15rem;
}

li {
  margin-bottom: 0.45rem;
}

/* Numbered demands read as a list of commitments, not as prose that happens
   to be indented. Give each one a visible hinge. */
ol > li::marker {
  color: var(--accent);
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.16em;
}

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

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

strong {
  font-weight: 700;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.15rem;
  font-size: 0.94em;
}

th,
td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

footer {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 1.4rem 4rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

footer p {
  margin: 1.2rem 0 0;
}
