:root {
  --bg: #FAF9F6;
  --fg: #1F1E1C;
  --muted: #6B665D;
  --rule: #E5E2DA;
  --accent: #5C6E58;
  --portrait-bg: #DDD8CE;
  --max: 720px;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 24px 96px;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 56px;
  font-size: 0.9rem;
  gap: 16px;
}
nav .name { font-weight: 600; font-size: 1.05rem; }
nav .name a { text-decoration: none; }
nav .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
}
nav a { text-decoration: none; }
nav a:hover { color: var(--accent); }
nav a[aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
}


header.hero {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 72px;
}
header.hero:has(+ .hero-keywords) { margin-bottom: 0; }
.portrait {
  width: 170px;
  height: 170px;
  border-radius: 14px;
  background: var(--portrait-bg);
  object-fit: cover;
  display: block;
}
.hero h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.hero .role {
  color: var(--muted);
  margin: 0 0 14px;
  font-size: 1.15rem;
}
.hero p { margin: 0; }

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 32px;
  letter-spacing: -0.01em;
}

section {
  margin-bottom: 56px;
}
section h2 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.entry {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  margin-bottom: 14px;
  align-items: start;
}
.entry.hidden { display: none; }
.entry .meta { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.entry .body { margin: 0; }
.entry .body p { margin: 0; }
.entry .description {
  margin-top: 4px !important;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.page-lede {
  color: var(--muted);
  font-size: 0.95rem;
  margin: -16px 0 32px;
}

.hero-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 16px 0 56px;
}
.hero-keyword {
  border: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
}

.research-video {
  margin: 24px auto 0;
  max-width: 180px;
  text-align: center;
}
.research-video img {
  width: 100%;
  border-radius: 6px;
  display: block;
}
.research-video figcaption {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
}

h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 24px 0 10px;
  letter-spacing: -0.005em;
}

.cv-contact {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -10px 0 40px;
}

.cv-content section {
  margin-bottom: 44px;
}
.cv-content section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 24px;
}
.cv-content section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 0 12px;
}

.cv-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: -8px 0 36px;
  font-size: 0.9rem;
}
.cv-toc a {
  color: var(--muted);
  text-decoration: none;
  padding: 2px 0;
}
.cv-toc a:hover { color: var(--accent); }
/* CV section headings grouped by meaning, three desert hues */
.cv-content > section:nth-of-type(1) h2,  /* Employment             */
.cv-content > section:nth-of-type(2) h2 { /* Education              */
  color: #7A8B3F;  /* olive — training & positions */
}
.cv-content > section:nth-of-type(3) h2,  /* Awards and Fellowships */
.cv-content > section:nth-of-type(4) h2,  /* Mentoring              */
.cv-content > section:nth-of-type(5) h2,  /* Teaching and Outreach  */
.cv-content > section:nth-of-type(6) h2 { /* Funding                */
  color: #9C5E84;  /* mauve — service & recognition */
}
.cv-content > section:nth-of-type(7) h2,  /* Talks                  */
.cv-content > section:nth-of-type(8) h2 { /* Posters                */
  color: #C45D3D;  /* terracotta — research outputs */
}
.cv-content code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cv-content p { margin: 0 0 4px; }
.cv-content p + ul { margin-top: 4px; }
.cv-content ul {
  padding-left: 22px;
  margin: 0 0 18px;
}
.cv-content li { margin-bottom: 4px; }
.cv-content li ul { margin-top: 4px; padding-left: 22px; }
.cv-content em { color: var(--muted); font-style: italic; }

.cv-entry { margin-bottom: 22px; }
.cv-mentoring .cv-entry { margin-bottom: 6px; }
.cv-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.cv-entry-head strong { font-weight: 600; }
.cv-entry-head em { color: var(--fg); font-style: italic; }
.cv-entry-date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.92rem;
}
.cv-entry-detail {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 2px;
}
@media (max-width: 520px) {
  .cv-entry-head { flex-direction: column; align-items: flex-start; gap: 2px; }
}

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filter-btn {
  background: none;
  border: 1px solid var(--rule);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.filter-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.filter-btn.active {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
}

footer {
  margin-top: 80px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}

@media (max-width: 520px) {
  header.hero { grid-template-columns: 1fr; }
  .portrait { width: 96px; height: 96px; }
  nav { flex-wrap: wrap; }
  .entry { grid-template-columns: 1fr; gap: 2px; }
}
