:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --accent: #7a2a2a;
  --border: #e6e2dc;
  --card: #faf8f5;
  --max: 760px;
}

body.dark {
  --bg: #16171a;
  --text: #e8e6e3;
  --muted: #a3a099;
  --accent: #d98c8c;
  --border: #2c2e33;
  --card: #1e2024;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.65;
  font-size: 17px;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3 { font-family: "Newsreader", Georgia, serif; font-weight: 600; line-height: 1.25; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

#theme-toggle {
  position: fixed;
  top: 1rem; right: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
}

.hero {
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.nav {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  padding: 1.2rem 0;
  font-size: 0.95rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--muted);
  cursor: pointer;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.headshot {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.hero-text h1 { margin: 0 0 0.3rem; font-size: 2.4rem; }
.title { margin: 0; font-weight: 500; }
.affiliation { margin: 0.1rem 0 0.8rem; color: var(--muted); }
.tagline { margin: 0 0 1.2rem; font-style: italic; color: var(--muted); font-size: 1.05rem; }

.links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.links a {
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
.links a:hover { border-color: var(--accent); text-decoration: none; }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

section { padding: 2.5rem 0 1rem; }
main section { display: none; }
main section.active { display: block; }

section h2 {
  font-size: 1.5rem;
  margin: 0 0 1.2rem;
  color: var(--accent);
}

.paper {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.paper h3 { margin: 0 0 0.3rem; font-size: 1.12rem; }
.paper .meta { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.paper p:last-child { margin-bottom: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.7rem; }
.tag {
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

h3.sub { margin: 1.8rem 0 0.6rem; font-size: 1.15rem; }

.course-label {
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0.9rem 0 0.4rem;
}
.courses {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 1rem;
}
.courses-single { grid-template-columns: 1fr; }
.courses li {
  position: relative;
  padding-left: 1rem;
  margin: 0;
  font-size: 0.95rem;
}
.courses li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.course-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.7rem 0 0;
}
@media (max-width: 560px) {
  .courses { grid-template-columns: 1fr; }
}

ul { padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; }

.hl { color: var(--accent); }

.legend {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.star { color: var(--accent); font-weight: 600; }

.conf-year {
  display: flex;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.conf-year:last-child { border-bottom: none; }
.conf-y {
  font-family: "Newsreader", serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--accent);
  min-width: 3.2rem;
  flex-shrink: 0;
}
.conf-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.conf-list li {
  margin: 0 0 0.35rem;
  font-size: 0.97rem;
}
.conf-list li:last-child { margin-bottom: 0; }

.education {
  list-style: none;
  padding: 0;
  margin: 0;
}
.education li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.education li:last-child { border-bottom: none; }
.edu-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.edu-degree { font-weight: 500; }
.edu-year {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.edu-school {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.cv-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.3rem;
  border-radius: 6px;
  font-weight: 500;
}
.cv-button:hover { text-decoration: none; opacity: 0.9; }

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  .hero-inner { flex-direction: column; text-align: center; align-items: center; }
  .links { justify-content: center; }
  .hero-text h1 { font-size: 2rem; }
}
