/* ── Tokens ───────────────────────────────────────────────────── */
:root {
  --bg:       #F4F1EB;
  --surface:  #FDFCF9;
  --text:     #1A1E2A;
  --muted:    #5A6478;
  --faint:    #8A96B0;
  --accent:   #1B5C8A;
  --accent-h: #144B73;
  --tint:     #EAF1F8;
  --border:   #D8D4CA;
  --nav-bg:   #141E2A;
  --nav-text: #9AAAB8;
  --shadow:   0 1px 3px rgba(20,30,42,.07), 0 4px 14px rgba(20,30,42,.05);
}
@media (prefers-color-scheme: dark) { :root {
  --bg:       #0F1219;
  --surface:  #161D28;
  --text:     #E0DDD6;
  --muted:    #7A8BA0;
  --faint:    #4A5868;
  --accent:   #4A9FD4;
  --accent-h: #5BAEE0;
  --tint:     #0E1826;
  --border:   #1E2A38;
  --nav-bg:   #090D14;
  --nav-text: #7080A0;
  --shadow:   0 1px 3px rgba(0,0,0,.25), 0 4px 14px rgba(0,0,0,.2);
}}
:root[data-theme="light"] {
  --bg:#F4F1EB; --surface:#FDFCF9; --text:#1A1E2A; --muted:#5A6478;
  --faint:#8A96B0; --accent:#1B5C8A; --accent-h:#144B73; --tint:#EAF1F8;
  --border:#D8D4CA; --nav-bg:#141E2A; --nav-text:#9AAAB8;
  --shadow:0 1px 3px rgba(20,30,42,.07),0 4px 14px rgba(20,30,42,.05);
}
:root[data-theme="dark"] {
  --bg:#0F1219; --surface:#161D28; --text:#E0DDD6; --muted:#7A8BA0;
  --faint:#4A5868; --accent:#4A9FD4; --accent-h:#5BAEE0; --tint:#0E1826;
  --border:#1E2A38; --nav-bg:#090D14; --nav-text:#7080A0;
  --shadow:0 1px 3px rgba(0,0,0,.25),0 4px 14px rgba(0,0,0,.2);
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; display: block; }

/* ── Nav ──────────────────────────────────────────────────────── */
#site-nav nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-name {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: .01em;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-name:hover { text-decoration: none; color: #fff; }
.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  flex-wrap: wrap;
}
.nav-links a {
  font-size: .71rem;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--nav-text);
  transition: color .14s;
}
.nav-links a:hover,
.nav-links a.active { color: #fff; text-decoration: none; }
.theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--nav-text);
  padding: 5px;
  line-height: 1;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color .14s;
}
.theme-btn:hover { color: #fff; }

/* ── Page wrapper ─────────────────────────────────────────────── */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px 96px;
}

/* ── Section label ────────────────────────────────────────────── */
.section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Page title (inner pages) ─────────────────────────────────── */
.page-header {
  padding: 52px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.page-title {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--text);
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .04em;
  padding: 7px 15px;
  border-radius: 2px;
  cursor: pointer;
  transition: all .14s;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-solid {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-solid:hover { background: var(--accent-h); border-color: var(--accent-h); color: #fff; text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--tint); text-decoration: none; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--faint);
  transition: all .12s;
}
.badge:hover { border-color: var(--accent); color: var(--accent); background: var(--tint); text-decoration: none; }

/* ── Tags ─────────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  background: var(--tint);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────────── */
/* HOME PAGE                                                       */
/* ─────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 52px;
  padding: 60px 0 52px;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.hero-left {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.photo-frame {
  width: 180px;
  height: 210px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--tint);
}
.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.side-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-link {
  font-size: .78rem;
  color: var(--muted);
  padding: 5px 8px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .12s;
  line-height: 1.3;
}
.side-link:hover { color: var(--accent); background: var(--tint); text-decoration: none; }
.side-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .12s;
}
.side-link:hover .side-icon { opacity: 1; }

.hero-right {
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero-name {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.12;
  color: var(--text);
  text-wrap: balance;
}
.hero-position {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.55;
}
.hero-bio {
  font-size: .9rem;
  line-height: 1.72;
  color: var(--text);
  max-width: 56ch;
}
.hero-bio em { color: var(--muted); font-style: italic; }
.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 56px;
  padding-top: 52px;
}

/* Paper list (home) */
.paper-list { display: flex; flex-direction: column; gap: 26px; }
.paper-title {
  font-family: 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  font-size: .98rem;
  font-weight: 400;
  line-height: 1.38;
  margin-bottom: 5px;
}
.paper-title a { color: var(--text); }
.paper-title a:hover { color: var(--accent); text-decoration: none; }
.paper-meta {
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 7px;
}
.paper-journal { font-style: italic; }
.paper-links { display: flex; gap: 6px; flex-wrap: wrap; }
.all-link { font-size: .8rem; margin-top: 6px; display: inline-block; }

/* News */
.news-list { display: flex; flex-direction: column; }
.news-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.news-text { font-size: .82rem; color: var(--text); line-height: 1.5; }

/* Employment */
.employment { margin-top: 36px; }
.emp-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
}
.emp-item:last-child { border-bottom: none; }
.emp-years {
  font-size: .72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  padding-top: 1px;
}
.emp-role { font-size: .84rem; color: var(--text); line-height: 1.4; }
.emp-inst { font-size: .78rem; color: var(--muted); }

/* ─────────────────────────────────────────────────────────────── */
/* RESEARCH PAGE                                                   */
/* ─────────────────────────────────────────────────────────────── */

.research-list { display: flex; flex-direction: column; gap: 12px; }
.research-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.research-card-header {
  padding: 22px 26px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  user-select: none;
}
.research-card-header:hover { background: var(--tint); }
.research-card-body {
  font-size: .86rem;
}
.research-card-title {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.38;
  color: var(--text);
  margin-bottom: 5px;
}
.research-card-coauthors {
  font-size: .78rem;
  color: var(--muted);
}
.research-card-coauthors a { color: var(--muted); }
.research-card-coauthors a:hover { color: var(--accent); }
.toggle-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--faint);
  margin-top: 4px;
  transition: transform .2s;
}
.research-card.open .toggle-icon { transform: rotate(180deg); }
.research-abstract {
  display: none;
  padding: 0 26px 22px;
  font-size: .86rem;
  line-height: 1.72;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.research-card.open .research-abstract { display: block; }
.research-abstract p + p { margin-top: .8em; }
.research-links { display: flex; gap: 6px; margin-top: 12px; }

/* ─────────────────────────────────────────────────────────────── */
/* PUBLICATIONS PAGE                                               */
/* ─────────────────────────────────────────────────────────────── */

.pub-year-group { margin-bottom: 48px; }
.pub-year {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--faint);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}
.pub-list { display: flex; flex-direction: column; gap: 22px; }
.pub-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.pub-num {
  font-size: .72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
  text-align: right;
}
.pub-content {}
.pub-title {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: .98rem;
  font-weight: 400;
  line-height: 1.38;
  margin-bottom: 4px;
  color: var(--text);
}
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); text-decoration: none; }
.pub-authors {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: 3px;
  line-height: 1.4;
}
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue {
  font-size: .76rem;
  color: var(--muted);
  margin-bottom: 7px;
}
.pub-venue em { font-style: italic; }
.pub-links { display: flex; gap: 6px; flex-wrap: wrap; }
#pub-loading { color: var(--muted); font-size: .9rem; padding: 20px 0; }

/* ─────────────────────────────────────────────────────────────── */
/* TALKS PAGE                                                      */
/* ─────────────────────────────────────────────────────────────── */

.talks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
}
.talk-list { display: flex; flex-direction: column; gap: 0; }
.talk-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.talk-item:last-child { border-bottom: none; }
.talk-year {
  font-size: .72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.talk-text { font-size: .84rem; color: var(--text); line-height: 1.45; }
.talk-venue { font-size: .76rem; color: var(--muted); }

/* ─────────────────────────────────────────────────────────────── */
/* TEACHING PAGE                                                   */
/* ─────────────────────────────────────────────────────────────── */

.teaching-section { margin-bottom: 48px; }
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 24px 28px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.course-title {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 4px;
}
.course-code {
  font-size: .75rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.course-desc { font-size: .86rem; color: var(--muted); line-height: 1.65; }

/* ─────────────────────────────────────────────────────────────── */
/* ADVISING PAGE                                                   */
/* ─────────────────────────────────────────────────────────────── */

.advising-body {
  max-width: 66ch;
}
.advising-body h2 {
  font-family: 'Palatino Linotype', Palatino, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text);
  margin: 36px 0 12px;
}
.advising-body h2:first-child { margin-top: 0; }
.advising-body p {
  font-size: .9rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: .9em;
}
.advising-body p:last-child { margin-bottom: 0; }
.advising-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}
.advising-body code {
  font-family: 'Courier New', Courier, monospace;
  font-size: .82rem;
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 10px 14px;
  display: block;
  margin: 12px 0;
  line-height: 1.7;
  color: var(--muted);
}

/* ─────────────────────────────────────────────────────────────── */
/* MEDIA PAGE                                                      */
/* ─────────────────────────────────────────────────────────────── */

.media-list { display: flex; flex-direction: column; gap: 12px; }
.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: border-color .14s;
}
.media-card:hover { border-color: var(--accent); text-decoration: none; }
.media-outlet {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 90px;
}
.media-content {}
.media-headline {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 4px;
}
.media-date { font-size: .75rem; color: var(--faint); }

/* ─────────────────────────────────────────────────────────────── */
/* FOOTER                                                          */
/* ─────────────────────────────────────────────────────────────── */

#site-footer footer {
  border-top: 1px solid var(--border);
  margin-top: 72px;
}
.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 28px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}
.footer-heading {
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.footer-body {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.65;
}
.footer-body a { color: var(--muted); }
.footer-body a:hover { color: var(--accent); }
.footer-copy {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px 28px;
  font-size: .72rem;
  color: var(--faint);
}

/* ─────────────────────────────────────────────────────────────── */
/* RESPONSIVE                                                      */
/* ─────────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 40px 0; }
  .hero-left { flex-direction: row; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .photo-frame { width: 120px; height: 140px; }
  .home-grid { grid-template-columns: 1fr; gap: 40px; }
  .talks-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: .65rem; }
  .page { padding: 0 18px 72px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
