:root {
  /* Declaring both schemes stops Chrome's Auto Dark Mode force-darkening the
     light palette, and gives form controls and scrollbars the right colours. */
  color-scheme: light dark;

  --bg: #fdfdfc;
  --fg: #1c1b1a;
  --muted: #6b6a67;
  --accent: #1a5fb4;
  --rule: #e3e2df;
  --tag-bg: #f1f0ec;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --fg: #ebe9e3;
    --muted: #a3a099;
    --accent: #8ab4f8;
    --rule: #2e2c26;
    --tag-bg: #23221b;
  }
}

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

body {
  margin: 0 auto;
  padding: 4rem 1rem;
  max-width: 46rem;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.65 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 13rem;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 1rem;
}

.portrait {
  width: 100%;
  height: auto;
  border-radius: 6px;
  /* The source is a tall three-quarter portrait; bias the crop toward the face. */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 18%;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 abbr { text-decoration: none; }

.role {
  margin: 0 0 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.tagline {
  color: var(--muted);
  max-width: 34em;
}

.location {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin-top: 1.5rem;
}

.hero-links a {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--accent);
}

.hero-links a:hover,
.hero-links a:focus-visible { border-color: currentColor; }

/* Sections */

h2 {
  margin: 3.5rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

h3 {
  margin: 0 0 0.25rem;
  font-size: 1.02rem;
  line-height: 1.4;
  text-wrap: balance;
}

p { margin: 0 0 1rem; max-width: 36em; }
p:last-child { margin-bottom: 0; }

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

.meta {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Lists */

.items { margin: 0; padding: 0; list-style: none; }
.items > li { margin-bottom: 2rem; }
.items > li:last-child { margin-bottom: 0; }

.items.compact { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.items.compact > li { margin-bottom: 0; }

.pubs {
  margin: 0;
  padding-left: 1.5em;
}

.pubs li { margin-bottom: 1.2rem; }
.pubs li:last-child { margin-bottom: 0; }
.pubs li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }

.pubs h3 { font-weight: 600; }
.pubs .meta { margin-bottom: 0; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  background: var(--tag-bg);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Footer */

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

footer p { margin: 0; }

/* Narrow screens: portrait above the text, and smaller */

@media (max-width: 34rem) {
  body { padding-top: 2.5rem; }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .portrait {
    order: -1;
    width: 9rem;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
