:root {
  --bg: #16151a;
  --surface: #1e1d24;
  --text: #f2f1ef;
  --text-muted: #a8a29e;
  --border: #2d2c34;
  --accent: #34d399;
  --accent-soft: rgba(52,211,153,0.14);
  --amber: #fbbf24;
  --amber-soft: rgba(251,191,36,0.14);
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
}
:root[data-theme="light"] {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #78716c;
  --border: #e7e5e4;
  --accent: #047857;
  --accent-soft: #d1fae5;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}
.page {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) 1.5rem 5rem;
}

/* ---- Site header ---- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}
.site-header .site-home {
  font-family: 'Source Serif 4', ui-serif, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
.site-header .site-home:hover { color: var(--accent); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.current { color: var(--text); }
.site-header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}
@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .hero .avatar { order: -1; }
}
.avatar {
  justify-self: center;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 55% 28%;
  transform: scale(0.95) translate(3%, -3%);
  border: 1px solid var(--border);
}
.hero-text { min-width: 0; }
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 1.1rem;
}
h1 {
  font-family: 'Source Serif 4', ui-serif, Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.pronunciation {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.7;
  font-style: italic;
  letter-spacing: 0.01em;
}
.role {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}
.role a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.role a:hover { border-bottom-color: var(--accent); }
.bio {
  max-width: 62ch;
  color: var(--text);
  font-size: 1rem;
  margin: 0;
}
.bio a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.bio a:hover { border-bottom-color: var(--accent); }
.placeholder-text { color: var(--text-muted); font-style: italic; }

nav.sections {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  margin-bottom: 3.5rem;
}
nav.sections a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
nav.sections a:hover { color: var(--accent); }

section { margin-bottom: 3.5rem; }
section + section {
  border-top: 5px double var(--border);
  padding-top: 2rem;
}
section > h2 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}
section > p.lead {
  max-width: 62ch;
  color: var(--text);
  margin: -0.5rem 0 1.5rem;
}
section > p.lead a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
section > p.lead a:hover { border-bottom-color: var(--accent); }

/* ---- News ---- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.news-item {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
}
.news-date {
  flex: 0 0 auto;
  width: 6.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.news-text {
  font-size: 0.92rem;
  color: var(--text);
}
.news-text a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.news-text a:hover { border-bottom-color: var(--accent); }
.see-more {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
}
.see-more .label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}
.see-more a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.see-more a:hover { text-decoration: underline; }

/* ---- Project cards ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.4rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card.pending {
  border-style: dashed;
  box-shadow: none;
  color: var(--text-muted);
}
.card .tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: auto;
  padding-top: 0.25rem;
}
.card-links a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.card-links a:hover { text-decoration: underline; }

/* ---- Education ---- */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.edu-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.edu-item:last-child { border-bottom: none; padding-bottom: 0; }
.edu-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.edu-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.edu-dates {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.edu-org {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.edu-detail {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.edu-org a, .edu-detail a { color: var(--accent); text-decoration: none; font-weight: 600; }
.edu-org a:hover, .edu-detail a:hover { text-decoration: underline; }

/* ---- Empty state ---- */
.empty-state {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--surface);
}

/* ---- Publications ---- */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.pub-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; padding-bottom: 0; }
.pub-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.pub-item h3 a { color: var(--text); text-decoration: none; }
.pub-item h3 a:hover { color: var(--accent); }
.pub-authors {
  margin: 0 0 0.3rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.pub-venue a { color: var(--accent); text-decoration: none; font-weight: 600; }
.pub-venue a:hover { text-decoration: underline; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
}
.footer-link:hover { color: var(--accent); }
.footer-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.site-footer .dot { opacity: 0.5; }
.site-footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}
.site-footer a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.site-footer #last-updated { font-variant-numeric: tabular-nums; }

a:focus-visible, .card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}
