:root {
  --paper: #fafbfc;
  --ink: #16222b;
  --muted: #566771;
  --rule: #d9e1e6;
  --accent: #00677a;
  --wash: #edf1f4;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 38rem;   /* text column */
  --wide: 56rem;      /* page frame, and how far images may stretch */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1519;
    --ink: #dde6ea;
    --muted: #94a5ae;
    --rule: #26333b;
    --accent: #5cc3cf;
    --wash: #172026;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.65 var(--serif);
}

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* ---- header ---- */
.site-header {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 2rem;
  font-family: var(--sans);
}
.site-title {
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; font-size: .95rem; }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  padding: .2rem 0;
  border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---- content ---- */
main {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
main > * { max-width: var(--measure); }
main > figure, main > pre, main > table, main > iframe, main > video { max-width: 100%; }

h1, h2, h3, h4 { font-family: var(--sans); line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.1rem); font-weight: 750; letter-spacing: -0.03em; margin: 0 0 1.25rem; }
h2 { font-size: 1.6rem; font-weight: 700; margin: 2.75rem 0 .75rem; }
h3 { font-size: 1.25rem; font-weight: 700; margin: 2rem 0 .5rem; }
h4 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
p, ul, ol, blockquote { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: .25rem 0; }
li > ul, li > ol { margin: .25rem 0; }
strong { font-weight: 700; }

figure { margin: 2rem 0; }
img { max-width: 100%; height: auto; display: block; border-radius: 3px; }
figcaption { font: .9rem/1.4 var(--sans); color: var(--muted); margin-top: .6rem; max-width: var(--measure); }

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

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

code { font: .88em var(--mono); background: var(--wash); padding: .12em .35em; border-radius: 3px; }
pre { background: var(--wash); padding: 1rem 1.1rem; border-radius: 4px; overflow-x: auto; margin: 0 0 1.4rem; font-size: .9rem; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: inherit; }

table { border-collapse: collapse; margin: 0 0 1.4rem; font: .95rem/1.4 var(--sans); display: block; overflow-x: auto; }
th, td { text-align: left; padding: .5rem .9rem .5rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; }

/* ---- footer ---- */
.site-footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--rule);
  font: .875rem/1.4 var(--sans);
  color: var(--muted);
}
.site-footer a { color: inherit; }

@media (max-width: 36rem) {
  body { font-size: 1.0625rem; }
  main { padding-top: 1rem; }
}
