/* Pearl Classic. One stylesheet, system fonts only, no external requests. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --text: #1c1c1a;
  --muted: #5a5a55;
  --rule: #d8d8d2;
  --tint: #f3f3ef;
  --link: #1a4c9c;
  --visited: #5a3a8a;
  --classic: #0f6b5c;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    "URW Palladio L", P052, Charter, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas,
    "DejaVu Sans Mono", "Liberation Mono", monospace;

  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --text: #deded8;
    --muted: #a3a59e;
    --rule: #383b40;
    --tint: #1f2226;
    --link: #9dc1ff;
    --visited: #c5a8ea;
    --classic: #6fd0bd;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 2.25rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.62;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
}

/* Links: plain, underlined, with a visited colour. */

a {
  color: var(--link);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em;
}

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

a:hover {
  text-decoration-thickness: 0.12em;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 1px;
}

.skip {
  position: absolute;
  left: -999rem;
}

.skip:focus {
  position: static;
}

/* Site header: the name and a row of plain links. */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.6rem;
}

.site-name {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.005em;
}

.site-name:visited {
  color: var(--text);
}

.site-header nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.94em;
}

.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

/* Headings. One family; size and weight carry the hierarchy. */

h1,
h2,
h3 {
  line-height: 1.22;
  font-variant-numeric: lining-nums;
  text-wrap: balance;
}

h1 {
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0 0 1.1rem;
}

h2 {
  font-size: 1.36rem;
  font-weight: 700;
  margin: 2.9rem 0 0.7rem;
}

h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 1.9rem 0 0.4rem;
}

p,
ul,
ol,
dl,
table,
figure,
pre {
  margin: 0 0 1.05rem;
}

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

li {
  margin-bottom: 0.38rem;
}

li > ul {
  margin-top: 0.38rem;
  margin-bottom: 0;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
}

.tagline {
  font-size: 1.32rem;
  font-style: italic;
  line-height: 1.3;
  margin: -0.55rem 0 1.25rem;
}

.meta,
.updated {
  color: var(--muted);
  font-size: 0.92em;
  font-variant-numeric: lining-nums tabular-nums;
}

h2 + .meta,
h3 + .meta {
  margin-top: -0.35rem;
}

var {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.9em;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--tint);
  padding: 0.08em 0.3em;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

/* The status paragraph on the home page: set off by a rule, not a box. */

.status {
  border-left: 3px solid var(--classic);
  padding: 0.1rem 0 0.1rem 1rem;
  margin: 1.5rem 0;
}

.status p:last-child {
  margin-bottom: 0;
}

/* Tables: hairlines only, numbers lined up. */

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

.scroll > table,
.scroll > svg {
  margin-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.45;
  font-variant-numeric: lining-nums tabular-nums;
}

caption {
  caption-side: bottom;
  text-align: left;
  color: var(--muted);
  font-size: 0.95em;
  padding-top: 0.55rem;
}

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

th:last-child,
td:last-child {
  padding-right: 0;
}

thead th {
  border-bottom: 1px solid var(--text);
  font-weight: 700;
}

tbody th {
  font-weight: 400;
}

td.num,
th.num {
  text-align: right;
  white-space: nowrap;
}

/* Figure and the fork diagram. Colours come from the scheme variables. */

figure {
  margin: 1.6rem 0 1.8rem;
}

figcaption {
  color: var(--muted);
  font-size: 0.92em;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.fork {
  display: block;
  width: 100%;
  min-width: 35rem;
  height: auto;
  font-family: var(--mono);
  font-size: 12.5px;
}

.fork .line {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.5;
}

.fork .line-classic {
  stroke: var(--classic);
  stroke-width: 2.5;
}

.fork .lead {
  stroke-dasharray: 2 4;
}

.fork .block {
  fill: var(--bg);
  stroke: var(--text);
  stroke-width: 1.5;
}

.fork .block-classic {
  stroke: var(--classic);
  stroke-width: 2.5;
}

.fork .head {
  fill: var(--text);
}

.fork .head-classic {
  fill: var(--classic);
}

.fork text {
  fill: var(--text);
}

.fork .label {
  font-family: var(--serif);
  font-size: 15px;
}

.fork .label-strong {
  font-weight: 700;
}

.fork .note {
  font-family: var(--serif);
  font-size: 14px;
  fill: var(--muted);
}

/* Dated notes. */

.note-entry {
  border-top: 1px solid var(--rule);
  padding-top: 0.2rem;
  margin-top: 2.2rem;
}

.note-entry h2 {
  margin-top: 1.3rem;
}

/* FAQ: question as a heading, answer below. */

.faq h3 {
  margin-top: 1.7rem;
}

/* Footer. */

.site-footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.88em;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
}

.site-footer p {
  margin-bottom: 0.5rem;
}

@media (max-width: 30rem) {
  body {
    padding: 1.4rem 1.05rem 3rem;
    font-size: 1.0625rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .lede {
    font-size: 1.12rem;
  }

  .site-header {
    margin-bottom: 1.9rem;
  }
}

@media print {
  .site-header nav,
  .skip {
    display: none;
  }

  body {
    font-size: 11pt;
  }
}
