:root {
  --bg: #fdfdfc;
  --text: #1c1e21;
  --text-muted: #5c6470;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --border: #e6e8eb;
  --badge-bg: #eef1f4;
  --badge-text: #3d4552;
  --award-bg: #fdf0d5;
  --award-text: #8a5a00;
}

:root[data-theme="dark"] {
  --bg: #101215;
  --text: #e8eaed;
  --text-muted: #9aa3ad;
  --accent: #7aa2f7;
  --accent-soft: rgba(122, 162, 247, 0.12);
  --border: #24282e;
  --badge-bg: #1d2127;
  --badge-text: #b6bec8;
  --award-bg: #2e2410;
  --award-text: #e3b04b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  margin: 3rem 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Intro */

.intro {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}

.portrait {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.tagline {
  margin: 0.35rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}

#about p {
  margin: 0 0 1rem;
}

/* Experience timeline */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: flex;
  gap: 1.25rem;
  padding: 0.85rem 0;
}

.timeline li + li {
  border-top: 1px solid var(--border);
}

.timeline .period {
  flex: 0 0 6.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.2rem;
}

.timeline p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Publications */

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pub;
}

.pubs li {
  padding: 0.9rem 0;
}

.pubs li + li {
  border-top: 1px solid var(--border);
}

.pub-title {
  font-weight: 600;
  color: var(--text);
}

.pub-title:hover {
  color: var(--accent);
  text-decoration: none;
}

.authors {
  margin: 0.25rem 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.authors strong {
  color: var(--text);
  font-weight: 600;
}

.venue {
  margin: 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-weight: 500;
}

.badge.award {
  background: var(--award-bg);
  color: var(--award-text);
}

.more {
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

/* Footer */

footer {
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Theme toggle */

#theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.icon-moon {
  display: none;
}

:root[data-theme="dark"] .icon-moon {
  display: block;
}

:root[data-theme="dark"] .icon-sun {
  display: none;
}

/* Mobile */

@media (max-width: 560px) {
  main {
    padding-top: 3rem;
  }

  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .portrait {
    width: 92px;
    height: 92px;
  }

  .timeline li {
    flex-direction: column;
    gap: 0.15rem;
  }

  .timeline .period {
    flex: none;
  }
}
