/* ── Variables ──────────────────────────────────────────────── */
:root {
  --navy:      #1a3554;
  --blue:      #2b6cb0;
  --blue-dark: #2a4a7f;
  --text:      #2d3748;
  --muted:     #718096;
  --border:    #e2e8f0;
  --bg:        #ffffff;
  --bg-alt:    #f7fafc;
  --radius:    8px;
  --nav-h:     60px;
  --max-w:     960px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

/* ── Navigation ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: -0.01em;
}
.nav-brand:hover { color: var(--blue); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--navy); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 32px;
  height: 32px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.2s;
}

/* ── Sections ───────────────────────────────────────────────── */
.section { padding-block: 5rem; padding-inline: 1.5rem; }
.section-alt { background: var(--bg-alt); }
.section-center { text-align: center; }

.container { max-width: var(--max-w); margin-inline: auto; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.section-header .section-title { margin-bottom: 0; }

.section-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
}
.section-link:hover { text-decoration: underline; }

.section-lead {
  color: var(--muted);
  margin-top: -1.25rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.muted { color: var(--muted); }

/* ── About ──────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4rem;
  align-items: start;
}

/* Sidebar */
.about-sidebar { text-align: center; }

.avatar-wrap {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  margin-inline: auto;
  margin-bottom: 1.25rem;
  border: 3px solid var(--border);
  background: var(--bg-alt);
}

.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-fallback {
  display: none;
  width: 100%;
  height: 100%;
  background: var(--navy);
  color: #fff;
  font-size: 2.25rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.profile-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.profile-org {
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.profile-org a { color: var(--blue); text-decoration: none; }
.profile-org a:hover { text-decoration: underline; }

/* Social links */
.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: all 0.15s;
  width: fit-content;
}
.social-link:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.social-link svg { flex-shrink: 0; }

/* About content */
.about-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.bio { margin-bottom: 0.9rem; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.grid-heading {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag-list li {
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.edu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.edu-list li { font-size: 0.85rem; line-height: 1.5; }
.edu-list strong { color: var(--navy); }

/* ── Publications ───────────────────────────────────────────── */
.pub-list { display: flex; flex-direction: column; gap: 1rem; }

.pub-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s;
}
.pub-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }

.pub-year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  padding-top: 0.15rem;
  line-height: 1.4;
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

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

.pub-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--blue);
  text-decoration: none;
  transition: all 0.15s;
}
.badge:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Publications expand/collapse */
.pub-extra {
  display: none;
  flex-direction: column;
  gap: 1rem;
}
.pub-extra.open { display: flex; }

.pub-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  padding: 0;
  transition: color 0.15s;
}
.pub-toggle:hover { color: var(--blue-dark); }

.toggle-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.pub-toggle[aria-expanded="true"] .toggle-chevron {
  transform: rotate(180deg);
}

/* ── Cards ──────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.card-placeholder {
  background: var(--bg-alt);
  border-style: dashed;
}

.card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blue);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
}

.card-body {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.pill {
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}

.pill-funded {
  background: #ebf8ff;
  border-color: #bee3f8;
  color: #2b6cb0;
}

.pill-link {
  color: var(--blue);
  transition: all 0.15s;
}
.pill-link:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Teaching ───────────────────────────────────────────────── */
.teaching-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.teaching-item {
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.teaching-item:last-child { border-bottom: none; }

.teaching-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.teaching-level {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blue);
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.teaching-semester {
  font-size: 0.8rem;
  color: var(--muted);
}

.course-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.course-desc {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── CV button ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.btn:hover { background: var(--blue-dark); color: #fff; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding-block: 2rem;
  padding-inline: 1.5rem;
  text-align: center;
  font-size: 0.82rem;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-sub a { color: rgba(255,255,255,0.6); }
.footer-sub a:hover { color: #fff; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  /* Mobile nav */
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  }

  .nav-links.open { display: flex; }

  .nav-links li { border-bottom: 1px solid var(--border); }

  .nav-links a {
    display: block;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-sidebar { text-align: center; }

  .social-links { flex-direction: row; flex-wrap: wrap; justify-content: center; }

  .profile-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  /* Publications */
  .pub-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .pub-year { font-size: 0.75rem; }

  /* Sections */
  .section { padding-block: 3rem; }

  .section-header { flex-direction: column; gap: 0.25rem; }

  /* Cards */
  .card-grid { grid-template-columns: 1fr; }
}
