/* Tokens come from DESIGN.md. Do not substitute values. */

@font-face { font-family: "Libre Caslon Text"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/libre-caslon-text-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/libre-caslon-text-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/libre-caslon-text-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Caslon Display"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/libre-caslon-display-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #1F1B16;
  --paper: #FFFFFF;
  --rubric: #A4241C;
  --muted: #675F56;
  --rule: #D9D4CC;

  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --body: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --utility: "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.25rem, 13vw, 13rem);
  --measure: 37rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.1875rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rubric);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
  font-family: var(--utility);
  font-size: 0.9375rem;
}
.skip:focus { top: 0.5rem; }

/* Running head */

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin: 0 1.25rem 0 var(--gutter);
  max-width: 56rem;
  padding: 1.75rem 0 1.1rem;
  border-bottom: 1px solid var(--rule);
}

.head .name {
  font-size: 1.0625rem;
  text-decoration: none;
}
.head .name:hover { text-decoration: underline; text-decoration-color: var(--rubric); }

.head nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--utility);
  font-size: 0.9375rem;
}
.head nav a { text-decoration: none; color: var(--muted); padding: 0.35rem 0; }
.head nav a:hover { color: var(--ink); }
.head nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rubric);
  text-underline-offset: 0.45em;
}

/* The page */

main {
  margin: 0 1.25rem 0 var(--gutter);
  max-width: var(--measure);
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3.5rem, 9vw, 6.5rem);
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4.4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0 0 1.75rem;
  text-wrap: balance;
}

h2 {
  font-family: var(--body);
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.35;
  margin: 2.75rem 0 0.5rem;
}

p { margin: 0 0 1.15rem; }
ul { margin: 0 0 1.15rem; padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--muted); }

/* The rubricated initial: one per page, on the opening paragraph. */
.open { min-height: 4.8em; }
.open::first-letter {
  font-family: var(--display);
  color: var(--rubric);
  margin-right: 0.07em;
  -webkit-initial-letter: 3;
  initial-letter: 3;
}
/* Firefox has no initial-letter yet: float a cap sized to three lines. */
@supports not ((initial-letter: 3) or (-webkit-initial-letter: 3)) {
  .open::first-letter {
    float: left;
    font-size: 5.45em;
    line-height: 0.74;
    padding: 0.07em 0.07em 0 0;
    margin-right: 0;
  }
}

.dated {
  font-family: var(--utility);
  font-size: 0.9375rem;
  color: var(--muted);
  margin: -1rem 0 2rem;
}

address { font-style: normal; margin: 0 0 1.15rem; }

/* Colophon */

.foot {
  margin: 0 1.25rem 0 var(--gutter);
  max-width: 56rem;
  padding: 1.25rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--utility);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}
.foot p { margin: 0 0 0.25rem; }
.foot a { text-decoration-color: var(--rule); }
.foot a:hover { color: var(--ink); text-decoration-color: var(--rubric); }

@media (max-width: 34rem) {
  body { font-size: 1.125rem; }
  .head { padding-top: 1.25rem; }
  .head nav { gap: 1.25rem; }
}

@media print {
  .head nav, .skip { display: none; }
  .head, main, .foot { margin-left: 0; }
}
