@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --navy:    #1b3a5c;
  --navy-md: #2b5c8a;
  --navy-lt: #e8eff6;
  --navy-bg: #f4f7fb;
  --ink:     #1a1a1a;
  --mid:     #444;
  --muted:   #777;
  --rule:    #dde3ea;
  --white:   #ffffff;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  font-size: 0.93rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--white);
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: 'EB Garamond', serif; font-weight: 500; color: var(--ink); line-height: 1.25; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.45rem; color: var(--navy); margin-top: 2.5rem; margin-bottom: 0.8rem; padding-bottom: 0.35rem; border-bottom: 2px solid var(--navy-lt); }
h3 { font-size: 1.1rem; color: var(--navy); margin-top: 1.5rem; margin-bottom: 0.4rem; }
p { color: var(--mid); margin-bottom: 0.85rem; }
a { color: var(--navy-md); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--navy); }
strong { color: var(--ink); font-weight: 600; }

/* ── Navbar ── */
.navbar {
  background: var(--navy) !important;
  border-bottom: none !important;
  box-shadow: 0 2px 8px rgba(27,58,92,0.15);
  padding: 0.25rem 0;
}
.navbar-brand {
  font-family: 'EB Garamond', serif !important;
  font-size: 1.2rem !important;
  color: white !important;
  letter-spacing: 0.03em;
  font-weight: 500;
}
.navbar .nav-link {
  color: rgba(255,255,255,0.82) !important;
  font-size: 0.82rem !important;
  font-weight: 400;
  padding: 0.4rem 0.9rem !important;
  border-radius: 3px;
  transition: all 0.15s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: white !important;
  background: rgba(255,255,255,0.12) !important;
  text-decoration: none;
}

/* ── Page layout ── */
.quarto-title-meta, #title-block-header .description { display: none; }
#title-block-header h1.title {
  font-family: 'EB Garamond', serif;
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--navy);
  border-bottom: 2px solid var(--navy-lt);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* ── Home page hero ── */
.hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
.hero-photo {
  width: 150px;
  height: 200px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--rule);
  box-shadow: 0 2px 12px rgba(27,58,92,0.10);
}
.hero-photo-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--navy-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'EB Garamond', serif;
  font-size: 3rem;
  color: var(--navy);
  border: 4px solid var(--rule);
}
.hero-name {
  font-family: 'EB Garamond', serif;
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--navy);
  margin: 0 0 0.15rem;
  line-height: 1.1;
}
.hero-role {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.2rem;
  line-height: 1.6;
}
.hero-inst {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1rem;
}
.hero-desc {
  font-size: 0.93rem;
  color: var(--mid);
  line-height: 1.75;
  margin-bottom: 1.1rem;
  max-width: 560px;
}
.contact-row {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.contact-row a { color: var(--navy-md); }
.social-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.social-btn {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--navy);
  border: 1px solid var(--navy-md);
  padding: 0.22rem 0.7rem;
  border-radius: 2px;
  transition: all 0.15s;
  text-decoration: none;
}
.social-btn:hover {
  background: var(--navy);
  color: white;
  text-decoration: none;
}

/* ── News section ── */
.news-item {
  font-size: 0.88rem;
  color: var(--mid);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  padding-left: 1rem;
  position: relative;
  line-height: 1.6;
}
.news-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--navy-md);
}
.news-item:last-child { border-bottom: none; }
.news-item strong { color: var(--navy); }

/* ── Tags ── */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0 1.25rem; }
.tag {
  font-size: 0.72rem;
  color: var(--navy);
  background: var(--navy-lt);
  padding: 0.25rem 0.7rem;
  border-radius: 2px;
  font-weight: 500;
}

/* ── Research areas ── */
.area { margin-bottom: 1rem; padding-left: 1rem; border-left: 3px solid var(--navy-lt); }
.area strong { color: var(--navy); font-weight: 600; }

/* ── Publications ── */
.pub-year {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
}
.pub { padding: 0.65rem 0; border-bottom: 1px solid #f2f4f7; }
.pub:last-child { border-bottom: none; }
.pub-title { font-size: 0.91rem; color: var(--ink); line-height: 1.45; margin-bottom: 0.2rem; font-weight: 400; }
.pub-title a { color: var(--navy-md); }
.pub-title a:hover { color: var(--navy); text-decoration: underline; }
.pub-meta { font-size: 0.77rem; color: var(--muted); }
.pub-meta em { font-style: italic; }
.badge {
  display: inline-block;
  font-size: 0.61rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  margin-left: 0.35rem;
  vertical-align: middle;
  background: #fff8e1;
  color: #7d6608;
  border: 1px solid #ffe082;
}
.badge-wp { background: #f0f4f8; color: #546e8a; border: 1px solid #c8d8e8; }

/* ── Presentations ── */
.pres-section { margin-bottom: 1.25rem; }
.pres-item {
  font-size: 0.87rem;
  color: var(--mid);
  padding: 0.3rem 0 0.3rem 1.1rem;
  border-bottom: 1px solid #f2f4f7;
  position: relative;
}
.pres-item:last-child { border-bottom: none; }
.pres-item::before { content: "–"; position: absolute; left: 0; color: var(--navy-md); }

/* ── Projects ── */
.project-list { margin-top: 0.5rem; }
.project {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.project:last-child { border-bottom: none; }
.project-logo {
  width: 80px;
  flex-shrink: 0;
  padding-top: 0.15rem;
}
.project-logo img {
  width: 100%;
  max-height: 38px;
  object-fit: contain;
  object-position: left top;
}
.project-logo-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  background: var(--navy);
  padding: 0.25rem 0.45rem;
  border-radius: 2px;
  line-height: 1.3;
  text-align: center;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.project-body { flex: 1; }
.project-title { font-size: 0.91rem; font-weight: 500; color: var(--ink); margin-bottom: 0.2rem; line-height: 1.4; }
.project-meta { font-size: 0.77rem; color: var(--muted); margin-bottom: 0.3rem; }
.project-meta .role {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--navy-lt);
  color: var(--navy);
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  margin-left: 0.5rem;
}
.project-desc { font-size: 0.83rem; color: var(--muted); line-height: 1.65; }

/* ── Teaching ── */
.teach-institution {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy);
  margin: 1.5rem 0 0.5rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--navy);
}
.teach-item {
  font-size: 0.87rem;
  color: var(--mid);
  padding: 0.25rem 0;
  border-bottom: 1px solid #f5f7fa;
}

/* ── Students ── */
.student-item {
  font-size: 0.9rem;
  color: var(--mid);
  padding: 0.35rem 0;
  border-bottom: 1px solid #f5f7fa;
}
.student-item:last-child { border-bottom: none; }
.student-item span { color: var(--muted); font-size: 0.82rem; }

/* ── Back to top ── */
#back-to-top {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  font-size: 0.74rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--navy);
  background: white;
  border: 1px solid var(--navy-md);
  padding: 0.4rem 0.85rem;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(27,58,92,0.12);
  transition: all 0.15s;
  z-index: 999;
}
#back-to-top:hover { background: var(--navy); color: white; }

/* ── Footer ── */
.nav-footer { font-size: 0.78rem; color: var(--muted); border-top: 1px solid var(--rule) !important; }

/* ── Responsive ── */
@media (max-width: 620px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo, .hero-photo-placeholder { width: 120px; height: 120px; }
  .hero-name { font-size: 1.9rem; }
}

/* ── Left TOC ── */
#TOC {
  font-size: 0.8rem;
  padding: 0.5rem 0;
}
#TOC .toc-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
#TOC ul { list-style: none; padding: 0; margin: 0; }
#TOC li { margin: 0; }
#TOC a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0.5rem;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}
#TOC a:hover { color: var(--navy); border-left-color: var(--navy-lt); }
#TOC a.active { color: var(--navy); border-left-color: var(--navy); font-weight: 500; }