:root {
  --bg: #0b1020;
  --bg-elev: #121a33;
  --bg-elev-2: #1a2547;
  --fg: #e7ecf5;
  --fg-muted: #a4adc2;
  --accent: #6aa6ff;
  --accent-2: #5eead4;
  --border: #233158;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --maxw: 1100px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fc;
    --bg-elev: #ffffff;
    --bg-elev-2: #eef2fb;
    --fg: #0e1530;
    --fg-muted: #475069;
    --accent: #2255cc;
    --accent-2: #0f766e;
    --border: #dde3ef;
    --shadow: 0 8px 24px rgba(15, 30, 80, 0.08);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--fg); }
.brand img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border);
}
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: var(--fg-muted); padding: 8px 12px; border-radius: 8px; font-weight: 500;
}
.nav-links a:hover { background: var(--bg-elev); color: var(--fg); text-decoration: none; }
.nav-links a.active { color: var(--fg); background: var(--bg-elev); }

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

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav-links { display: none; position: absolute; top: 64px; right: 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 8px; flex-direction: column; min-width: 200px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
}

/* Hero */
.hero { padding: 64px 0 32px; }
.hero-grid {
  display: grid; gap: 32px;
  grid-template-columns: 220px 1fr;
  align-items: center;
}
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
}
.avatar {
  width: 220px; height: 220px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--bg-elev-2);
  box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 8px; letter-spacing: -0.02em; }
.hero .role { color: var(--fg-muted); margin: 0 0 16px; font-size: 1.05rem; }
.hero p { color: var(--fg); margin: 0 0 18px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) { .cta-row { justify-content: center; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--bg-elev); color: var(--fg);
  border: 1px solid var(--border);
  font-weight: 600;
}
.btn:hover { background: var(--bg-elev-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }

/* Sections */
section.block { padding: 40px 0; }
h2.section-title {
  font-size: 1.5rem; letter-spacing: -0.01em; margin: 0 0 20px;
  display: flex; align-items: center; gap: 12px;
}
h2.section-title::before {
  content: ""; display: inline-block; width: 6px; height: 22px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 4px;
}

/* Cards */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--fg-muted); font-size: .95rem; }
.card .meta { color: var(--fg-muted); font-size: .85rem; margin-top: 8px; }
.card img.cover { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; border: 1px solid var(--border); }

/* Timeline */
.timeline { position: relative; margin: 0; padding: 0 0 0 18px; list-style: none; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 22px 18px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.timeline .when { color: var(--fg-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.timeline h4 { margin: 4px 0 4px; font-size: 1.02rem; }
.timeline .where { color: var(--fg-muted); font-size: .92rem; margin: 0 0 6px; }
.timeline p { margin: 0; color: var(--fg); }

/* Publications */
.pub-controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--fg-muted); cursor: pointer; font-size: .9rem;
}
.chip.active { background: var(--accent); color: #fff; border-color: transparent; }
.pub-list { display: grid; gap: 12px; }
.pub {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.pub h3 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.35; }
.pub .authors { color: var(--fg-muted); font-size: .92rem; margin: 0 0 6px; }
.pub .venue { color: var(--accent-2); font-size: .9rem; font-weight: 600; }
.pub .links { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.pub .links a { font-size: .85rem; padding: 4px 10px; border-radius: 6px; background: var(--bg-elev-2); color: var(--fg); }
.pub .links a:hover { background: color-mix(in srgb, var(--accent) 25%, var(--bg-elev-2)); text-decoration: none; }
.pub h3 a { color: inherit; }
.pub h3 a:hover { color: var(--accent); text-decoration: none; }
.pub .cite { display: inline-block; margin-left: 8px; font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: var(--bg-elev-2); color: var(--fg-muted); border: 1px solid var(--border); vertical-align: middle; }
.pub .cite a { color: inherit; text-decoration: none; }
.pub .cite a:hover { color: var(--accent); }

.email {
  display: inline-block;
  font-family: var(--mono);
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 8px;
  user-select: all;
}
.email:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); color: var(--accent); }

/* Metrics strip */
.metrics {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 28px;
}
.metric {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; text-align: center;
}
.metric .num { font-size: 1.5rem; font-weight: 700; color: var(--fg); letter-spacing: -0.02em; }
.metric .num a { color: inherit; }
.metric .lbl { color: var(--fg-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* Selected work cards */
.work { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.work .card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.work .card .cover { width: 100%; height: 170px; object-fit: cover; border-radius: 0; border: 0; margin: 0; }
.work .card .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.work .card h3 { margin: 0; font-size: 1.05rem; }
.work .card p { margin: 0; }
.work .tag { display: inline-block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); font-weight: 700; }
.work .links { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.work .links a {
  font-size: .82rem; padding: 4px 10px; border-radius: 6px;
  background: var(--bg-elev-2); color: var(--fg); border: 1px solid var(--border);
}
.work .links a:hover { background: color-mix(in srgb, var(--accent) 20%, var(--bg-elev-2)); text-decoration: none; }

/* News feed */
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.news li {
  display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: baseline;
  padding: 12px 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px;
}
.news .date { color: var(--fg-muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.news .what { color: var(--fg); }
@media (max-width: 600px) {
  .news li { grid-template-columns: 1fr; }
}

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border); margin-top: 48px; padding: 28px 0;
  color: var(--fg-muted); font-size: .9rem;
}
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.social a { color: var(--fg-muted); margin-left: 14px; font-size: 1.15rem; }
.social a:hover { color: var(--accent); }

/* Research themes chips (static) */
.themes { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.themes li {
  font-size: .82rem; padding: 5px 11px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--fg-muted);
  font-weight: 500;
}

/* Year group headers within Publications */
.year-group { margin-top: 24px; }
.year-group .year {
  font-size: 1rem; margin: 0 0 10px; color: var(--fg-muted);
  letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.pub-controls .chip { font-weight: 600; }

/* Utilities */
.muted { color: var(--fg-muted); }
.kbd { font-family: var(--mono); background: var(--bg-elev-2); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; font-size: .85em; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* In the News - press list */
.press-intro { color: var(--fg-muted); margin: -4px 0 18px; max-width: 720px; }
.press-group { margin-top: 28px; }
.press-group .group-title {
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 700; margin: 0 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.press-group .group-title::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.press-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.press {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: start;
  padding: 14px 16px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; transition: border-color .15s ease, transform .15s ease;
}
.press:hover { border-color: var(--accent); transform: translateY(-1px); }
.press .year {
  font-family: var(--mono); font-size: .85rem; color: var(--fg-muted);
  letter-spacing: .04em; padding-top: 2px;
}
.press .body { min-width: 0; }
.press .outlet {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; color: var(--accent); margin-bottom: 4px;
}
.press h3 { margin: 0 0 4px; font-size: 1.02rem; line-height: 1.35; }
.press h3 a { color: var(--fg); }
.press h3 a:hover { color: var(--accent); text-decoration: none; }
.press .blurb { margin: 0; color: var(--fg-muted); font-size: .92rem; }
.press .read {
  align-self: center; font-size: .82rem; color: var(--fg-muted);
  white-space: nowrap; padding-top: 2px;
}
.press:hover .read { color: var(--accent); }
@media (max-width: 640px) {
  .press { grid-template-columns: 1fr; gap: 6px; }
  .press .read { display: none; }
}

/* Hero icon-only social buttons */
.hero-socials { display: inline-flex; gap: 6px; margin-left: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--fg);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Research statement */
.statement { max-width: 760px; margin: 0; color: var(--fg); }
.statement p { margin: 0 0 12px; }

/* Selected Publications inline list */
.sel-pubs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.sel-pubs li {
  padding: 12px 14px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 10px;
}
.sel-pubs .title { font-weight: 600; }
.sel-pubs .meta { display: block; color: var(--fg-muted); font-size: .9rem; margin-top: 2px; }
.sel-pubs .why { display: block; color: var(--fg-muted); font-size: .92rem; margin-top: 4px; font-style: italic; }

/* Mentoring list */
.mentees { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.mentees li {
  padding: 10px 14px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 8px;
}

/* Open-source cards */
.os-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.os-list li {
  padding: 14px 16px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 10px;
}
.os-list .os-title { display: block; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.os-list .os-desc { display: block; color: var(--fg-muted); font-size: .92rem; }
