:root {
  --bg: #f7f4ee;
  --fg: #1f1d1a;
  --muted: #6b665d;
  --rule: #d9d3c7;
  --accent: #8a3b2a;
  --accent-hover: #5e2519;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --fg: #e9e4da;
    --muted: #a39c8f;
    --rule: #33302b;
    --accent: #d9926f;
    --accent-hover: #f0b58f;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  padding: clamp(2.5rem, 8vw, 6rem) 1.5rem 4rem;
  max-width: 42rem;
  margin-inline: auto;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--fg);
  color: var(--bg);
  z-index: 1;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.portrait {
  flex: 0 0 auto;
  width: 6rem;
  height: 6rem;
  object-fit: cover;
  border-radius: 50%;
  filter: saturate(0.9);
}

.masthead-text {
  min-width: 0;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.1;
}

.tagline {
  margin: 0.4rem 0 0.9rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.links a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}
.links a:hover,
.links a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

main {
  padding-top: 2.5rem;
}

h2 {
  font-size: 0.85rem;
  font-family: var(--sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

main p {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  text-wrap: pretty;
}

main p:first-of-type::first-letter {
  font-size: 3.1em;
  line-height: 0.8;
  float: left;
  padding: 0.12em 0.1em 0 0;
  color: var(--accent);
}

main a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color 120ms ease, color 120ms ease;
}
main a:hover,
main a:focus-visible {
  color: var(--accent-hover);
  border-bottom-color: currentColor;
}

footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}
footer p {
  margin: 0;
}

.error h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--fg);
}

@media (max-width: 30rem) {
  .masthead {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .portrait {
    width: 5rem;
    height: 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
