:root {
  --bg: #faf9f6;
  --surface: #f1efe9;
  --text: #1f221f;
  --muted: #5d645c;
  --rule: #e2dfd7;
  --accent: #2c6a4c;
  --accent-soft: #e3eee7;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141614;
    --surface: #1c1f1c;
    --text: #e7e5df;
    --muted: #a0a79d;
    --rule: #2c302c;
    --accent: #84c7a3;
    --accent-soft: #1f2d25;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 0 0 1rem; }
h2 { font-size: 1.55rem; margin: 3rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
h5 { font-size: 1rem; margin: 1.75rem 0 0.5rem; }

p, ul, ol, dl { margin: 0 0 1.1rem; }
li + li { margin-top: 0.3rem; }

img { max-width: 100%; height: auto; display: block; border-radius: 6px; }

/* Header and footer */

.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}
.site-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.4em; }

main.wrap { padding-top: 3rem; padding-bottom: 4rem; }

.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}
.links { display: inline-flex; flex-wrap: wrap; gap: 1rem; }

/* Home */

.intro {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.intro img { width: 7.5rem; height: 7.5rem; border-radius: 50%; }
.intro h1 { margin: 0 0 0.35rem; }
.intro .role { margin: 0; color: var(--muted); font-size: 1.1rem; }

.lede { font-size: 1.2rem; line-height: 1.6; }

.home .links { margin-bottom: 1rem; }
.home .links a {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  text-decoration: none;
  font-size: 0.95rem;
}
.home .links a:hover { border-color: var(--accent); background: var(--accent-soft); }

.section-title {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 3.5rem 0 1rem;
}

/* Timeline: years | role, org, one line */

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.timeline li:last-child { border-bottom: 1px solid var(--rule); }
.timeline .when { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.timeline strong { display: block; }
.timeline .org { color: var(--muted); }
.timeline p { margin: 0.35rem 0 0; }

/* Cards for highlights and projects */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
}
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card a { text-decoration: none; }
.card a:hover { text-decoration: underline; }

.post-list { list-style: none; padding: 0; }
.post-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-top: 1px solid var(--rule); margin: 0; }
.post-list li:last-child { border-bottom: 1px solid var(--rule); }
.post-list time { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

/* Long-form pages */

.page h2 { padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.page img { margin: 1.5rem 0; }

.eyebrow { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.eyebrow a { color: inherit; }

.role-head { margin-bottom: 0.6rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1rem; margin-top: 2rem; }
.role-head h3 { margin: 0; }
.role-head span { color: var(--muted); font-size: 0.9rem; }
.role-title { color: var(--muted); margin: 0.15rem 0 0.75rem; }

/* kramdown definition lists: term on the left, details on the right */
dl { display: grid; grid-template-columns: 9rem 1fr; gap: 0.4rem 1.25rem; }
dt { font-weight: 600; }
dd { margin: 0; }
dd + dd { grid-column: 2; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; }
.gallery figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; }

@media (max-width: 34rem) {
  main.wrap { padding-top: 2rem; }
  .intro { grid-template-columns: 1fr; gap: 1rem; }
  .intro img { width: 6rem; height: 6rem; }
  .timeline li, dl { grid-template-columns: 1fr; gap: 0.15rem; }
  dd + dd { grid-column: 1; }
  dd { margin-bottom: 0.5rem; }
}
