:root {
  --bg: #faf9f6;
  --text: #1c1b19;
  --muted: #6b6861;
  --rule: #e2dfd8;
  --accent: #1f4f8f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: 76rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a;
    --text: #e9e7e2;
    --muted: #9a978f;
    --rule: #2c2e36;
    --accent: #8fb8f0;
  }
}

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

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

/* Smooth-scroll only after the visitor has interacted (e.g. clicked a nav
   link), so the browser restoring scroll position on reload doesn't animate. */
html:focus-within { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img { display: block; max-width: 100%; height: auto; }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

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

.site-header, main, .site-footer {
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.125rem;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  /* Extend the background to the viewport edges beyond the page width. */
  box-shadow: 0 0 0 100vmax var(--bg);
  clip-path: inset(0 -100vmax);
}

.site-title {
  font-family: var(--serif);
  font-size: 1.375rem;
  color: var(--text);
  text-decoration: none;
}

.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.site-header nav a:hover { color: var(--text); }

section { padding-block: clamp(3rem, 8vw, 5.5rem); border-top: 1px solid var(--rule); scroll-margin-top: 4rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
  border-top: 0;
  padding-top: clamp(1rem, 4vw, 3rem);
}

.portrait { width: 100%; border-radius: 4px; }

.hero h1 { font-size: clamp(3.5rem, 10vw, 6rem); letter-spacing: -0.02em; margin-bottom: 1.5rem; }
.hero p { font-size: clamp(1.125rem, 2vw, 1.3125rem); line-height: 1.6; max-width: 34em; }

h2 {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
}
.feature + .feature { margin-top: clamp(3rem, 7vw, 5rem); }
.feature:nth-of-type(even) .feature-image { order: 2; }
.feature-image.cover { justify-self: center; }
.feature-image.cover img { width: auto; max-height: 26rem; }

.feature h3 { font-size: clamp(1.625rem, 3.5vw, 2.125rem); margin-bottom: 1rem; }
.feature p { max-width: 34em; }

.more { display: inline-block; margin-top: 1.25rem; font-weight: 500; }
.more::after { content: " \2192"; }

.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0 1rem;
  padding-block: 0.875rem;
  border-top: 1px solid var(--rule);
}
.pubs li:first-child { border-top: 0; padding-top: 0; }
.year { color: var(--muted); font-variant-numeric: tabular-nums; }
.pubs a { white-space: nowrap; }

.note { margin-top: 2rem; color: var(--muted); }

.contact p {
  font-family: var(--serif);
  font-size: clamp(1.625rem, 4.5vw, 2.5rem);
  line-height: 1.25;
  max-width: 22em;
  text-wrap: balance;
}

.site-footer { padding-bottom: 3rem; }
.site-footer ul { list-style: none; margin: 0; padding: 2rem 0 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.site-footer a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }

.error { min-height: 60vh; display: grid; align-content: center; gap: 1rem; border-top: 0; }
.error h1 { font-size: clamp(2.5rem, 8vw, 4rem); }

@media (max-width: 720px) {
  .hero, .feature { grid-template-columns: minmax(0, 1fr); }
  .feature:nth-of-type(even) .feature-image { order: 0; }
  .portrait { max-width: 22rem; }
  .pubs li { grid-template-columns: minmax(0, 1fr); }
  .year { font-size: 0.875rem; }
}
