:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #1c2233;
  --muted: #5b6478;
  --border: #e2e6ee;
  --primary: #2b2f9e;
  --primary-soft: #eceefe;
  --accent: #1aa0b8;
  --hero-from: #1e2178;
  --hero-to: #1a7f96;
  --radius: 12px;
  --max: 1080px;
  --shadow: 0 1px 2px rgba(20, 24, 60, .06), 0 4px 16px rgba(20, 24, 60, .06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10131c;
    --surface: #181c28;
    --text: #e7e9f0;
    --muted: #9aa2b5;
    --border: #2a3040;
    --primary: #9ea6ff;
    --primary-soft: #232848;
    --accent: #4fc8dc;
    --hero-from: #1a1d5c;
    --hero-to: #0f5566;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.brand img { height: 34px; width: auto; border-radius: 6px; background: #fff; padding: 2px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; line-height: 1.2; }

.nav { display: flex; gap: 2px; }
.nav a {
  padding: 8px 11px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--primary-soft); }
.nav a.active { color: var(--primary); background: var(--primary-soft); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
  color: #fff;
  padding: 72px 0 64px;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin: 0 0 16px; letter-spacing: -.02em; }
.hero p { max-width: 720px; font-size: 18px; opacity: .92; margin: 0; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; opacity: .8; margin-bottom: 12px; }
.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.stat {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 140px;
}
.stat b { display: block; font-size: 26px; line-height: 1.2; }
.stat span { font-size: 13.5px; opacity: .85; }

.page-head { padding: 48px 0 8px; }
.page-head h1 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 8px; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin: 0; max-width: 720px; }

main { flex: 1; padding-bottom: 64px; }

section { padding: 28px 0; }
h2 { font-size: 24px; margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font-size: 18px; margin: 0 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.objectives { counter-reset: obj; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.objectives li {
  counter-increment: obj;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.objectives li::before {
  content: counter(obj);
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--surface);
  font-weight: 700;
  font-size: 14px;
}

/* People */
.person { display: flex; gap: 14px; align-items: flex-start; }
.avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}
.person h3 { font-size: 16px; margin: 0 0 2px; }
.person p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.lead { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }

/* Publications */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 20px; }
.search {
  flex: 1 1 260px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.search:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--surface); }
.pub-count { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.pub-year { font-size: 20px; margin: 28px 0 10px; color: var(--primary); }
.pub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pub-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.55;
}
.pub-list .title { font-weight: 600; color: var(--text); }
.pub-list .authors { color: var(--muted); }
.pub-list .journal { font-style: italic; color: var(--muted); }
.pub-list mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 3px; }

/* Meetings timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; border-left: 2px solid var(--border); break-inside: avoid; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
}
@media (min-width: 760px) { .timeline { columns: 2; column-gap: 48px; } }
.timeline .year { font-weight: 700; color: var(--primary); margin-right: 8px; }
.timeline .note { color: var(--muted); font-size: 14px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.photo {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}
.photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.photo figcaption { padding: 10px 14px; font-size: 14px; }
.photo figcaption b { color: var(--primary); }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  display: none;
  place-items: center;
  z-index: 50;
  padding: 20px;
  cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 85vh; border-radius: 8px; }
.lightbox p { color: #fff; text-align: center; margin: 12px 0 0; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--surface);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.btn:hover { color: var(--surface); opacity: .9; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }

.callout {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  padding: 28px 0;
}
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
