:root {
  --bg: #fbfaf7;
  --bg-alt: #f3f1ec;
  --text: #24211d;
  --text-muted: #746c60;
  --border: #e5e0d6;
  --accent: #8a3324;
  --accent-strong: #6b2519;
  --link: #8a3324;
  --card-bg: #ffffff;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17150f;
    --bg-alt: #1f1c16;
    --text: #ece7dc;
    --text-muted: #a89e8d;
    --border: #332e24;
    --accent: #e0a08e;
    --accent-strong: #eebbaa;
    --link: #e0a08e;
    --card-bg: #1c1912;
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0.15em;
}
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 2.1rem;
  margin: 0 0 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.3rem;
  font-style: italic;
  font-weight: 600;
  margin: 3rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent-strong);
}

h3 { font-size: 1.15rem; margin: 0 0 0.3rem; }

p { margin: 0 0 1.1rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.site-header .wrap { max-width: 920px; }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.35rem;
  padding-bottom: 1.35rem;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.site-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  letter-spacing: -0.01em;
}
.site-title:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.3rem;
  font-family: var(--sans);
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
}

/* Main */
main.wrap {
  padding-top: 2.75rem;
  padding-bottom: 5rem;
  min-height: 60vh;
}

.lede {
  color: var(--text-muted);
  font-size: 1.08rem;
  font-style: italic;
  margin-bottom: 2.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* News list */
.news-list { list-style: none; margin: 0; padding: 0; }

.news-item {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.2rem 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.news-item:first-child { padding-top: 0; }

.news-date {
  font-family: var(--sans);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 0.3rem;
}

.news-text { min-width: 0; }
.news-text p { margin: 0; }

.news-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 0.75rem 0 1.5rem;
}

/* Entry cards (publications, working papers, funded projects) */
.entry {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: none; }

.entry-title { font-size: 1.2rem; font-style: italic; font-weight: 600; margin: 0 0 0.4rem; }
.entry-meta {
  font-family: var(--sans);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}
.entry-links {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.75rem;
}
.entry-links a { margin-right: 1.25rem; }
.entry-abstract {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin: 0;
}
.entry-abstract ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}
.entry-abstract li { margin-bottom: 0.35rem; }
.entry-abstract strong { color: var(--text); }

/* Teaching / grouped lists */
.group-heading {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 2.5rem 0 0.75rem;
  border-bottom-color: var(--border);
}
.group-heading:first-of-type { margin-top: 0; }

.plain-list { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.plain-list li { margin-bottom: 0.4rem; font-size: 0.98rem; }

/* Profile */
.profile-header {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.profile-photo {
  width: 150px;
  height: 260px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.profile-facts p { margin: 0 0 0.35rem; font-size: 0.98rem; }
.profile-facts .name {
  font-size: 1.6rem;
  font-weight: 700;
  font-style: italic;
  margin-bottom: 0.2rem;
}

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.98rem;
}
.timeline li:last-child { border-bottom: none; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 640px) {
  body { font-size: 17px; }
  h1 { font-size: 1.7rem; }
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.75rem;
  }
  .site-nav.open { display: flex; }
  .news-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .news-date { font-size: 0.7rem; }
  .profile-header { gap: 1.25rem; }
  .profile-photo { width: 120px; height: 208px; }
}
