/* ==========================================================
   Research website — shared styles
   Colors are defined as tokens so light/dark themes stay in sync.
   ========================================================== */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5b636e;
  --border: #e4e2dd;
  --accent: #1d4e89;
  --accent-soft: #e8eef7;
  --max-width: 880px;
  --radius: 10px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Serif 4", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171b;
    --surface: #1b1f24;
    --text: #e6e8eb;
    --muted: #9aa3ad;
    --border: #2c323a;
    --accent: #7fb0ec;
    --accent-soft: #1f2d3f;
  }
}

:root[data-theme="dark"] {
  --bg: #14171b;
  --surface: #1b1f24;
  --text: #e6e8eb;
  --muted: #9aa3ad;
  --border: #2c323a;
  --accent: #7fb0ec;
  --accent-soft: #1f2d3f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--font-serif); line-height: 1.25; font-weight: 600; }
h1 { font-size: 2.2rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header / navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: var(--text); }

.menu-toggle { display: none; }

@media (max-width: 640px) {
  .menu-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 10px 0; }
}

/* ---------- Main ---------- */

main { padding: 3rem 0 4rem; }

.page-intro { color: var(--muted); margin: 0 0 2rem; max-width: 640px; }

/* ---------- About (home) ---------- */

.profile {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 3rem;
}

.title-line { color: var(--muted); margin: 0 0 1.25rem; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.contact-links a {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--surface);
}
.contact-links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

@media (max-width: 640px) {
  .profile { grid-template-columns: 1fr; gap: 1.5rem; }
  .profile-photo { width: 140px; height: 140px; font-size: 2.2rem; }
  h1 { font-size: 1.8rem; }
}

.news-list, .timeline { list-style: none; padding: 0; margin: 0; }
.news-list li, .timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.news-list time, .timeline .when { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

@media (max-width: 480px) {
  .news-list li, .timeline li { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* ---------- Research ---------- */

.research-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.75rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.research-item:first-of-type { padding-top: 0; }

.research-figure {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.research-item p { margin: 0.4rem 0; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.tag {
  font-size: 0.78rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 640px) {
  .research-item { grid-template-columns: 1fr; gap: 1rem; }
  .research-figure { aspect-ratio: 16 / 9; }
}

/* ---------- Home: research interests ---------- */

.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.interest {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.interest h3 { color: var(--accent); font-size: 1.05rem; }
.interest ul { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.93rem; }
.interest li { margin: 0.3rem 0; }

/* ---------- Research: grants ---------- */

.grant-list { list-style: none; padding: 0; margin: 0; }
.grant-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
.grant-title { margin: 0 0 0.3rem; font-weight: 600; }
.grant-meta { margin: 0; font-size: 0.9rem; color: var(--muted); }
.grant-meta .tag { margin-right: 0.4rem; }

/* ---------- Publications ---------- */

.pub-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.pub-controls input,
.pub-controls select {
  font: inherit;
  font-size: 0.92rem;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.pub-controls input { flex: 1 1 240px; min-width: 0; }

.pub-count { color: var(--muted); font-size: 0.85rem; margin: -0.75rem 0 0; }

.pub-section { font-size: 1.3rem; margin: 2.25rem 0 0.25rem; }
.pub-section-count {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.35rem;
}
.pub-num { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }

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

.pub {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-title { font-weight: 600; margin: 0 0 0.2rem; }
.pub-authors { margin: 0; font-size: 0.93rem; color: var(--muted); }
.pub-authors .me { color: var(--text); font-weight: 600; }
.pub-venue { margin: 0.15rem 0 0; font-size: 0.93rem; font-style: italic; }

.pub-links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.pub-links a, .pub-badge {
  font-size: 0.78rem;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
}
.pub-links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.pub-badge { border-color: transparent; background: var(--accent-soft); color: var(--accent); }

.pub-empty { color: var(--muted); padding: 2rem 0; }

.pub-note { color: var(--muted); font-size: 0.88rem; margin-top: 1.5rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}
