:root {
  --ink: #1f1f1f;
  --muted: #6a6a6a;
  --teal: #1f8a7a;        /* headings & name */
  --teal-dark: #176a5e;
  --rule: #e7e7e7;
  --bg: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }

/* ===================== Layout ===================== */
.layout {
  display: flex;
  gap: 64px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 72px 40px 96px;
  align-items: flex-start;
}

/* ===================== Sidebar ===================== */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
}

.avatar {
  width: 100%;
  max-width: 230px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-bottom: 22px;
}

.sidebar h1 {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--teal);
  margin: 0 0 10px;
}

.role {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.45;
}

/* ===================== Top bar ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 13px 40px;
  display: flex;
  justify-content: flex-end;
}

/* external links (Scholar · GitHub · CV) — now in the top bar */
.ext-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 0.95rem;
  font-weight: 500;
}

.ext-links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.ext-links a:hover {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* nav (in-page anchor links) */
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.98rem;
}

.nav a:hover { color: var(--teal); }

/* ===================== Content ===================== */
.content {
  flex: 1;
  max-width: 680px;
  min-width: 0;
}

.content > section:first-child { margin-top: 4px; }

section { margin-bottom: 44px; }

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--teal);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

p { margin: 0 0 16px; }

.content a {
  color: var(--teal-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(31,138,122,0.35);
}
.content a:hover { border-bottom-color: var(--teal); }

/* ---------- Work in progress ---------- */
.project { margin-bottom: 24px; }

.project h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.project .authors,
.project p { margin: 0; color: var(--muted); }

.subprojects {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--rule);
}

.subprojects li { margin-bottom: 10px; }
.subprojects li:last-child { margin-bottom: 0; }
.subprojects .ptitle { display: block; font-weight: 500; color: var(--ink); }
.subprojects .authors { display: block; font-size: 0.92rem; }

/* ---------- Publications ---------- */
.year {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin: 22px 0 10px;
}

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

.pubs li { margin-bottom: 18px; }

.pubs .authors { display: block; color: var(--ink); }
.pubs .ptitle  { display: block; font-weight: 500; }
.pubs .venue   { display: block; color: var(--muted); font-size: 0.95rem; }

/* ---------- Footer ---------- */
footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

/* ===================== Responsive ===================== */
@media (max-width: 820px) {
  .layout {
    flex-direction: column;
    gap: 36px;
    padding: 40px 24px 72px;
  }
  .sidebar {
    position: static;
    width: 100%;
    max-width: 680px;
    text-align: center;
  }
  .avatar { margin-left: auto; margin-right: auto; }
  .nav { align-items: center; }
  .role { max-width: 420px; margin-left: auto; margin-right: auto; }
  .topbar-inner { justify-content: center; padding: 12px 24px; }
}
