:root {
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --border: #e5e5e5;
  --accent: #1a4480;
  --accent-soft: #2c5282;
  --bg: #ffffff;
  --bg-alt: #f7f9fc;
  --max-width: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
a:hover { border-bottom-color: var(--accent); }

/* Header / nav */
header.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.85);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { border-bottom-color: transparent; }

nav.primary ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.4rem;
}
nav.primary a {
  color: var(--muted);
  font-size: 0.95rem;
}
nav.primary a:hover { color: var(--accent); }
nav.primary a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Layout */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
}

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 1.9rem;
  margin: 0 0 1.5rem;
  font-weight: 600;
}

h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 1rem;
  font-weight: 600;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  font-weight: 600;
}

p { margin: 0 0 1rem; }

main p,
.student-bio {
  text-align: justify;
}

/* Home hero */
.hero {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2.5rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.hero .who {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero .who > * {
  margin: 0;
}
.hero .who .role {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.hero .who .contact-links {
  margin-top: 0.85rem;
}

.hero img.headshot {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.hero .who .subtle {
  font-size: 1.1rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  margin-top: 0.7rem;
  font-size: 0.85rem;
}
.contact-links a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.contact-links a:hover { color: var(--accent); }
.contact-links svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: left;
  }
  .hero img.headshot {
    width: 140px; height: 140px;
  }
}

/* Publication list */
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pub-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-list li:last-child { border-bottom: none; }

.pub-title {
  font-weight: 600;
  color: var(--text);
}
.pub-venue {
  color: var(--muted);
  font-style: italic;
}
.pub-venue .year {
  font-style: normal;
  color: var(--muted);
}
.pub-authors {
  color: var(--muted);
  font-size: 0.93rem;
}
.pub-note {
  color: var(--accent);
  font-size: 0.88rem;
  display: block;
  margin-top: 0.25rem;
}

.pub-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
details.abstract { display: contents; margin: 0; padding: 0; }
details.abstract summary {
  display: inline-block;
  box-sizing: border-box;
  padding: 0.11rem 0.35rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--accent);
  background: var(--bg);
  list-style: none;
  user-select: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::marker { content: ""; }
details.abstract summary:hover {
  background: var(--bg-alt);
}
details.abstract[open] summary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-pdf,
.btn {
  display: inline-block;
  box-sizing: border-box;
  padding: 0.11rem 0.35rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--accent);
  background: var(--bg);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-pdf:hover,
.btn:hover {
  background: var(--bg-alt);
  border-bottom-color: var(--accent);
}
.abstract-body {
  flex-basis: 100%;
  display: none;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  color: var(--text);
  line-height: 1.6;
  font-size: 0.93rem;
}
.pub-actions:has(details.abstract[open]) .abstract-body {
  display: block;
}

/* Course / teaching */
.course {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.course:last-child { border-bottom: none; }
.course-title { font-weight: 600; }
.course-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

/* Students */
.student {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.student:last-child { border-bottom: none; }
.student-photo {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.student-name {
  font-weight: 600;
}
.student-bio {
  margin-top: 0.3rem;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 560px) {
  .student {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
  }
  .student-photo {
    width: 80px;
    height: 80px;
  }
}

/* Lab banner */
.lab-banner {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}
.lab-banner + h2 {
  margin-top: 0.75rem;
}

/* CV embed */
.cv-frame {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.cv-fallback {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.6rem;
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
footer.site-footer a { color: var(--muted); }

/* Utilities */
.subtle { color: var(--muted); }
.section-intro { color: var(--text); margin-bottom: 0.25rem; }
