:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #22201c;
  --muted: #6b665d;
  --line: #e6e1d8;
  --accent: #8a3b12;
  --accent-soft: #f5e9df;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251, 250, 247, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 24px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 20px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }
.topbar nav a[aria-current="page"] { font-weight: 600; }

/* Hero */
main.wrap { padding-top: 48px; padding-bottom: 24px; }
.hero { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }
.portrait { width: 220px; height: 260px; object-fit: cover; object-position: 50% 30%; border-radius: 6px; }
.hero h1 { font-size: 38px; line-height: 1.15; margin: 0 0 8px; }
.role { font-family: var(--sans); color: var(--accent); font-weight: 600; font-size: 15px; margin: 0 0 2px; }
.affil { font-family: var(--sans); color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.hero-text > p:not(.role):not(.affil) { max-width: 68ch; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 18px; font-family: var(--sans); font-size: 15px; font-weight: 500; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; font-family: var(--sans); font-weight: 600;
  padding: 9px 18px; border-radius: 4px; font-size: 14px;
}
.btn:hover { background: #6f2e0c; text-decoration: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1, .page-head-pubs h1 { font-size: 36px; margin: 0 0 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-head a { font-family: var(--sans); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tools { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-top: 18px; }
.tools span { font-weight: 600; color: var(--text); }

.highlights { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 20px; }
.highlights strong a { color: inherit; text-decoration: underline; text-decoration-color: rgba(138,59,18,.35); text-underline-offset: 3px; }
.highlights li { border-top: 3px solid var(--accent); padding-top: 10px; }
.highlights strong { display: block; font-size: 17px; line-height: 1.3; margin-bottom: 4px; }
.highlights span { font-family: var(--sans); font-size: 13px; color: var(--muted); line-height: 1.45; display: block; }

/* Sections */
main { min-width: 0; }
section { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
section:last-child { border-bottom: none; }
h2 { font-size: 28px; margin: 0 0 18px; font-weight: 700; }
.h2-inner { margin-top: 40px; }
h3 { font-size: 19px; margin: 0; font-weight: 600; }
h3.sub {
  font-family: var(--sans); font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin: 28px 0 12px;
}
p { margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 16px; }
.callout { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 0 4px 4px 0; }

/* Research cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; }
.card h3 { font-size: 18px; margin-bottom: 6px; color: var(--accent); }
.card p { font-size: 16px; margin: 0; color: #3d3a34; }


/* Publications */
.pubs { padding-left: 22px; margin: 0; }
ul.pubs { list-style: disc; }
.pubs li { margin-bottom: 16px; padding-left: 4px; }
.pubs li::marker { color: var(--muted); font-family: var(--sans); font-size: 14px; }
.pubs span { display: block; }
.pubs .title { font-weight: 600; line-height: 1.4; }
.pubs .authors { color: #3d3a34; font-size: 16px; }
.pubs .venue { color: var(--muted); font-size: 16px; }
.pubs .venue a { font-family: var(--sans); font-size: 13px; font-weight: 600; margin-left: 4px; }

/* Experience */
.entry { display: grid; grid-template-columns: 150px 1fr; gap: 20px; margin-bottom: 22px; }
.when { font-family: var(--sans); font-size: 14px; color: var(--muted); padding-top: 3px; }
.where { color: var(--muted); font-style: italic; margin-bottom: 6px; font-size: 16px; }
.entry ul { margin: 0; padding-left: 20px; font-size: 16px; }
.entry li { margin-bottom: 4px; }
.entry p:not(.where) { font-size: 16px; }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding: 6px 0; font-size: 16px; }
.yr { font-family: var(--sans); font-size: 14px; color: var(--muted); padding-top: 2px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }

footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 24px; font-family: var(--sans); font-size: 14px; color: var(--muted); line-height: 1.6; }
footer strong { color: var(--text); }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }

/* Responsive */
@media (max-width: 900px) {
  .highlights { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  main.wrap { padding-top: 28px; }
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .portrait { width: 160px; height: 190px; }
  .hero h1 { font-size: 32px; }
  .cards { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; gap: 2px; }
  .plain li { grid-template-columns: 64px 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .highlights { grid-template-columns: 1fr 1fr; }
  .section-head { flex-direction: column; gap: 0; margin-bottom: 12px; }
  .section-head h2 { margin-bottom: 4px; }
}

@media print {
  .topbar, .btn, .gallery { display: none; }
}

.gallery-full { display: block; columns: 3; column-gap: 10px; margin-top: 20px; }
.gallery-full img { aspect-ratio: auto; height: auto; margin-bottom: 10px; break-inside: avoid; }
@media (max-width: 700px) { .gallery-full { columns: 2; } }

/* Mobile menu */
.menu-btn { display: none; background: none; border: 0; padding: 8px; margin-right: -8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .2s, opacity .2s; }
@media (max-width: 700px) {
  .menu-btn { display: block; }
  .topbar nav {
    display: none; position: absolute; top: 58px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 4px 16px 12px; box-shadow: 0 8px 16px rgba(0,0,0,.06);
  }
  .nav-open .topbar nav { display: flex; }
  .topbar nav a { font-size: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .topbar nav a:last-child { border-bottom: 0; }
  .nav-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .menu-btn span:nth-child(2) { opacity: 0; }
  .nav-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Typography: serif for headings, sans for body */
h1, h2, h3, .brand, .highlights strong { font-family: var(--serif); letter-spacing: -0.01em; }
h1, h2 { font-weight: 600; }
h3 { font-weight: 600; }
h3.sub { font-family: var(--sans); letter-spacing: 0.08em; }
.card h3 { font-size: 19px; }
.card p, .pubs .authors, .pubs .venue, .entry ul, .entry p:not(.where), .plain li, .muted { font-size: 15px; }
.pubs .title { font-weight: 600; font-size: 16px; }
.where { font-size: 15px; }

/* Mobile refinements */
@media (max-width: 700px) {
  body { font-size: 15.5px; }
  .hero { display: block; }
  .hero .portrait { float: left; width: 104px; height: 124px; margin: 0 16px 16px 0; }
  .hero h1 { font-size: 28px; margin-top: 2px; }
  .hero .role, .hero .affil { font-size: 14px; }
  .hero-text > p:not(.role):not(.affil) { clear: both; }
  .actions { gap: 10px 18px; }
  .actions .btn { flex: 1 0 100%; text-align: center; padding: 11px 18px; }
  #gallery .gallery { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .footer-inner { flex-direction: column; gap: 14px; }
  .footer-links { flex-direction: column; gap: 6px; }
}

.hero-text a:not(.btn):not(.link) { text-decoration: underline; text-decoration-color: rgba(138,59,18,.35); text-underline-offset: 3px; }
.hero-text a:not(.btn):not(.link):hover { text-decoration-color: currentColor; }
