/* Minimal typographic page. No framework, no JS, light and dark. */

:root {
  --bg: #fdfdfc;
  --fg: #1a1a18;
  --muted: #6b6b66;
  --rule: #e4e4e0;
  --accent: #b2182b;   /* the spoofer colour from the paper's palette */
  --code-bg: #f4f4f1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14141a;
    --fg: #e8e8e6;
    --muted: #9a9a96;
    --rule: #2c2c34;
    --accent: #ef8a62;
    --code-bg: #1e1e26;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 1.5rem;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
        Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 5rem 0 3rem;
}

/* Headings ---------------------------------------------------------------- */

h1 {
  font-size: 2.4rem;
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 0.6rem;
  font-weight: 650;
}

h1 + .lede {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 3rem;
  line-height: 1.5;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.012em;
  margin: 3.5rem 0 1rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-weight: 620;
}

h3 {
  font-size: 1.05rem;
  margin: 2.2rem 0 0.6rem;
  font-weight: 620;
}

p { margin: 0 0 1.1rem; }

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
a:hover { color: var(--accent); }

strong { font-weight: 640; }

/* Figures ----------------------------------------------------------------- */

figure {
  margin: 2rem 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--rule);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.pair img { margin: 0; }

@media (max-width: 34rem) {
  .pair { grid-template-columns: 1fr; }
}

figcaption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.6rem;
  line-height: 1.5;
}

/* Code -------------------------------------------------------------------- */

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.87em;
  background: var(--code-bg);
  padding: 0.12em 0.36em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  border-radius: 5px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* Tables ------------------------------------------------------------------ */

.scroll { overflow-x: auto; margin: 1.5rem 0; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}

th {
  font-weight: 620;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:last-child td { border-bottom: none; }

/* A pulled-out remark ----------------------------------------------------- */

blockquote {
  margin: 1.6rem 0;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}
blockquote p:last-child { margin-bottom: 0; }

/* Footer ------------------------------------------------------------------ */

footer {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 0 4rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  color: var(--muted);
}
footer p { margin: 0; }
.sep { margin: 0 0.5rem; opacity: 0.5; }
