/*
 * One column of text on paper. Size, weight and space carry the hierarchy;
 * one ink color marks links and the woodcut mark. Dark mode follows the
 * reader's system setting.
 */

/* Source Serif 4, latin subset, under the SIL Open Font License (fonts/OFL.txt). */
@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(/fonts/source-serif-4-latin.woff2) format("woff2-variations");
}

@font-face {
  font-family: "Source Serif 4 Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(/fonts/source-serif-4-latin-italic.woff2) format("woff2-variations");
}

:root {
  color-scheme: light dark;

  --paper: #f7f5ef;
  --paper-2: #efebe2;
  --ink: #1c1b18;
  --ink-2: #47443d;
  --ink-3: #69655c;
  --rule: #d8d3c8;
  --accent: #7a561c;

  --font-serif: "Source Serif 4 Variable", "Source Serif 4", Georgia, serif;

  --measure: 38rem;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131210;
    --paper-2: #211f1b;
    --ink: #ebe7de;
    --ink-2: #c3beb2;
    --ink-3: #9a958a;
    --rule: #34312b;
    --accent: #d8b06a;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}

@media (min-width: 40rem) {
  body {
    font-size: 1.125rem;
  }
}

.page {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main {
  display: block;
}

main:focus {
  outline: none;
}

/* Header and footer */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
  padding: 1.25rem 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.005em;
  text-decoration: none;
}

.mark {
  display: block;
  width: 4.75rem;
  height: auto;
}

.mark-ink {
  fill: var(--accent);
}

.mark-cut {
  fill: var(--paper);
}

.site-nav {
  display: flex;
  gap: 0.25rem;
  margin: 0 -0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.5rem;
  color: var(--ink-2);
  font-size: 1rem;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  margin-top: 6rem;
  padding: 1rem 0 2rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  margin-left: -0.5rem;
}

.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.5rem;
  color: var(--ink-3);
}

.site-footer nav a:hover {
  color: var(--ink);
}

/* Text */

.column {
  max-width: var(--measure);
}

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

h1 {
  /* A long headline balances badly around its unbreakable words; pretty only avoids a short last line. */
  text-wrap: pretty;
  margin: 4.5rem 0 1.5rem;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.375rem);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -0.012em;
}

h2 {
  margin: 4.5rem 0 1rem;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

h3 {
  margin: 2.25rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

p,
ul,
ol,
dl,
blockquote {
  margin: 0 0 1.1rem;
}

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

li + li {
  margin-top: 0.45rem;
}

.lede {
  color: var(--ink-2);
  font-size: 1.125em;
  line-height: 1.55;
}

.note {
  color: var(--ink-3);
  font-size: 0.9375rem;
  line-height: 1.55;
}

strong {
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

hr {
  height: 1px;
  margin: 3rem 0;
  border: 0;
  background: var(--rule);
}
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}
/* The one call to action, and links set as actions */

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--accent);
  color: var(--paper);
}

/* The About page */
.doc-head {
  margin-bottom: 2.5rem;
}

.doc-head h1 {
  margin-top: 4.5rem;
  margin-bottom: 1rem;
}

.prose h2 {
  margin-top: 3rem;
}

.prose h3 {
  margin-top: 2rem;
}

.prose blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-2);
}

.sources {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.sources h2 {
  margin-top: 1rem;
  font-size: 1.0625rem;
}

.sources ul {
  padding-left: 0;
  list-style: none;
}

/* The 404 page */

.message {
  max-width: var(--measure);
}

.message .button {
  margin-top: 0.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  a {
    transition:
      color 120ms ease,
      background-color 120ms ease;
  }
}

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