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

/* ── Tokens ── */
:root {
  --bg:        #2d2f36;
  --bg-alt:    #252729;
  --card-bg:   #33353d;
  --accent:    #5b9bd5;
  --accent-dk: #1565c0;
  --text:      #ffffff;
  --text-dim:  #bdbdbd;
  --text-muted:#9e9e9e;
  --divider:   rgba(255,255,255,0.08);
  --font:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg:        #ffffff;
  --bg-alt:    #f8f9fa;
  --card-bg:   #ffffff;
  --accent:    #1565c0;
  --accent-dk: #0d47a1;
  --text:      #212529;
  --text-dim:  #495057;
  --text-muted:#6c757d;
  --divider:   rgba(0,0,0,0.1);
}

/* ── Base ── */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; height: 56px;
}
.nav-brand { font-size: 17px; font-weight: 500; color: var(--text); white-space: nowrap; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { font-size: 15px; color: var(--text-muted); transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.theme-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; padding: 4px 8px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); }

/* ── Hero ── */
.hero {
  display: flex; gap: 56px;
  padding: 56px 80px 48px;
  max-width: 1100px; margin: 0 auto;
  align-items: flex-start;
}
.hero-left {
  display: flex; flex-direction: column;
  align-items: center; min-width: 170px; text-align: center;
}
.avatar-photo {
  width: 160px; height: 160px; border-radius: 50%;
  object-fit: cover; object-position: center 3%;
  border: 3px solid var(--accent);
  margin-bottom: 18px;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--divider);
}
.avatar-placeholder {
  width: 150px; height: 150px; border-radius: 50%;
  border: 2px solid var(--divider);
  background: #3a4452;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 300; color: var(--accent);
  margin-bottom: 18px;
}
.avatar-img {
  width: 150px; height: 150px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--divider);
  margin-bottom: 18px;
}
.hero-name { font-size: 20px; font-weight: 500; color: var(--text); margin-bottom: 6px; line-height: 1.35; }
.hero-role { font-size: 15px; color: var(--text-muted); margin-bottom: 4px; }
.hero-inst { font-size: 15px; color: var(--accent); margin-bottom: 20px; display: block; }
.social-icons { display: flex; gap: 16px; justify-content: center; }
.social-icons a { color: var(--text-muted); font-size: 22px; transition: color 0.2s; }
.social-icons a:hover { color: var(--accent); text-decoration: none; }

/* ── Hero Right ── */
.hero-right { flex: 1; }
.section-heading { font-size: 25px; font-weight: 500; color: var(--text); margin-bottom: 14px; }
.bio-text { font-size: 16px; color: var(--text-dim); line-height: 1.8; margin-bottom: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 8px; }
.col-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.interest-list { list-style: none; }
.interest-list li {
  font-size: 15px; color: var(--text-dim); padding: 3px 0;
  display: flex; align-items: center; gap: 8px;
}
.interest-list li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.edu-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.edu-icon { color: var(--accent); font-size: 17px; margin-top: 2px; flex-shrink: 0; }
.edu-degree { font-size: 15px; color: var(--text); font-weight: 500; }
.edu-school { font-size: 14px; color: var(--text-muted); }

/* ── Band (alternating section) ── */
.band { background: var(--bg-alt); padding: 48px 80px; }
.band-inner { max-width: 1100px; margin: 0 auto; }

/* ── Section title ── */
.section-title {
  font-size: 25px; font-weight: 500; color: var(--text);
  margin-bottom: 24px; padding-bottom: 10px;
  border-bottom: 1px solid var(--divider);
}

/* ── Publications ── */
.pub-list { list-style: none; }
.pub-item { padding: 18px 0; border-bottom: 1px solid var(--divider); }
.pub-item:last-child { border-bottom: none; }
.venue-tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 3px;
  background: var(--accent-dk); color: #fff;
  margin-bottom: 6px;
}
.pub-title { font-size: 17px; font-weight: 500; color: var(--text); line-height: 1.5; margin-bottom: 4px; }
.pub-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.pub-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.pub-authors { font-size: 15px; color: var(--text-muted); margin-bottom: 3px; }
.pub-venue { font-size: 15px; color: var(--text-muted); font-style: italic; margin-bottom: 10px; }
.pub-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-solid {
  font-size: 12px; font-weight: 500; padding: 3px 12px; border-radius: 3px;
  background: var(--accent-dk); color: #fff; cursor: pointer; transition: opacity 0.2s;
}
.btn-outline {
  font-size: 12px; font-weight: 500; padding: 3px 12px; border-radius: 3px;
  background: transparent; border: 1px solid var(--accent-dk); color: var(--accent);
  cursor: pointer; transition: opacity 0.2s;
}
.btn-solid:hover, .btn-outline:hover { opacity: 0.8; text-decoration: none; }

/* ── Year heading in pub page ── */
.pub-year-heading {
  font-size: 20px; font-weight: 500; color: var(--text-muted);
  margin: 32px 0 4px; padding-bottom: 6px;
  border-bottom: 1px solid var(--divider);
}

/* ── Contact ── */
.contact-section {
  padding: 48px 80px; max-width: 1100px; margin: 0 auto;
}

/* ── Footer ── */
footer {
  background: var(--bg-alt); border-top: 1px solid var(--divider);
  padding: 20px; text-align: center;
  font-size: 15px; color: var(--text-muted);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }

/* ── Projects ── */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-top: 8px;
}
.project-card {
  background: var(--card-bg); border-radius: 8px;
  border: 1px solid var(--divider); padding: 24px;
  transition: border-color 0.2s;
}
.project-card:hover { border-color: var(--accent); }
.project-tag {
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 3px;
  background: var(--accent-dk); color: #fff; margin-bottom: 12px; display: inline-block;
}
.project-title { font-size: 18px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.project-desc { font-size: 15px; color: var(--text-dim); line-height: 1.7; }

/* ── Page header for inner pages ── */
.page-header {
  padding: 40px 80px 0; max-width: 1100px; margin: 0 auto;
}

/* ── Hamburger button (hidden on desktop) ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .navbar { padding: 0 16px; gap: 8px; }
  .nav-brand {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
  }
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 999;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 2px solid var(--accent);
    padding: 8px 0 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }

  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 20px; font-size: 15px; color: var(--text); }
}

@media (max-width: 768px) {
  body { padding-top: 56px; }

  /* Navbar */
  .navbar {
    padding: 0 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 1000;
  }
  .nav-brand { flex: 1; }
  .hamburger { display: flex; }

  /* Nav links: hidden by default on mobile, dropdown when opened via JS */
  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 0; right: 0;
    z-index: 999;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 2px solid var(--accent);
    padding: 8px 0 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 20px; font-size: 15px; color: var(--text); }

  /* Hero (index page) */
  .hero { flex-direction: column; padding: 28px 16px; gap: 24px; align-items: center; }
  .hero-right { width: 100%; }
  .hero-name { font-size: 24px; }

  /* Layouts */
  .two-col { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  /* Sections */
  .band, .contact-section, .page-header { padding: 24px 16px; }

  /* Research inner pages */
  .page-content { padding: 24px 16px !important; }
  .story-section { margin-bottom: 40px; }
  .body-text { font-size: 14px; }

  /* Flex rows → stack vertically */
  .flex-hero { flex-direction: column !important; gap: 20px !important; }
  .flex-hero video { width: 100% !important; }
  .flex-row { flex-direction: column !important; }

  /* Inline-style grids on index.html */
  div[style*="grid-template-columns: repeat(3"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, 1fr) !important; }
  div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="grid-column: span 3"] { grid-column: span 1 !important; }
  div[style*="grid-column: span 2"] { grid-column: span 1 !important; }
  div[style*="padding: 64px 80px"] { padding: 24px 16px 0 !important; }
  div[style*="padding: 48px 80px"] { padding: 24px 16px !important; }
  div[style*="padding: 0 80px 64px"] { padding: 0 16px 40px !important; }

  /* Grid class layouts */
  .img-grid-2 { grid-template-columns: 1fr !important; }
  .img-grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .img-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .img-grid-5 { grid-template-columns: repeat(2, 1fr) !important; }
  .placeholder-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Video grids on index page */
  .vid-grid-3 { grid-template-columns: 1fr !important; }
  .vid-grid-2 { grid-template-columns: 1fr !important; }
  .videos-section { padding: 24px 16px 0 !important; }
}
