/* ── Variables ── */
:root {
  --navy:       #0d1f3c;
  --dark-blue:  #1a3a5c;
  --mid-blue:   #1e5f8a;
  --accent:     #2e86c1;
  --accent-light: #5ba4cf;
  --white:      #ffffff;
  --off-white:  #f4f7fb;
  --surface:    #eef2f8;
  --text:       #1a2535;
  --text-muted: #5a6a7e;
  --border:     #d0dae8;
  --shadow-sm:  0 1px 4px rgba(13,31,60,0.08);
  --shadow-md:  0 4px 16px rgba(13,31,60,0.12);
  --shadow-lg:  0 8px 32px rgba(13,31,60,0.16);
  --radius:     10px;
  --nav-h:      64px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--mid-blue); }

img { max-width: 100%; display: block; }

/* ── Navbar ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transition: background 0.3s;
}

#navbar.scrolled {
  background: rgba(13,31,60,0.97);
  backdrop-filter: blur(8px);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
}

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

.nav-links a {
  color: rgba(255,255,255,0.82);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 4px 0;
  position: relative;
  transition: color 0.2s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent-light);
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ── Sections ── */
section {
  padding: 90px 5% 70px;
  min-height: 100px;
}

section:first-of-type { padding-top: calc(var(--nav-h) + 60px); }

section:nth-child(even) { background: var(--off-white); }

.section-header {
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  margin-top: 12px;
  border-radius: 2px;
}

/* ── Hero / Bio ── */
#intro {
  background: linear-gradient(135deg, var(--navy) 0%, var(--dark-blue) 60%, var(--mid-blue) 100%);
  color: var(--white);
  padding: calc(var(--nav-h) + 70px) 5% 80px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

#network-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

#intro .bio-grid {
  position: relative;
  z-index: 1;
}

.bio-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 60px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.bio-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.bio-email {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  word-break: break-all;
  text-align: center;
  transition: color 0.2s;
}

.bio-email:hover { color: var(--white); }

.bio-email svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.bio-photo {
  width: 300px; height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  background: var(--dark-blue);
}

.photo-placeholder {
  width: 300px; height: 300px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border: 4px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: rgba(255,255,255,0.4);
}

.bio-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.2s;
  background: rgba(255,255,255,0.06);
}

.social-btn:hover {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}

.bio-content { color: var(--white); }

.bio-name {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 6px;
}

.bio-title {
  font-size: 1.05rem;
  color: var(--accent-light);
  font-weight: 500;
  margin-bottom: 4px;
}

.bio-institution {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 28px;
}

.bio-text {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  margin-bottom: 28px;
  text-align: justify;
}

.bio-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interest-tag {
  padding: 4px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

/* ── Publications ── */
#publications { background: var(--white); }

/* ── Publication filter bar ── */
.pub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  max-width: 900px;
}

.pub-filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s;
}

.pub-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pub-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ── Publication cards ── */
.pub-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  max-width: 900px;
}

.pub-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.2s;
}

.pub-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pub-card.featured {
  border-top: 3px solid var(--accent);
}

.pub-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--surface);
  display: block;
}

.pub-thumb-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--surface), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--border);
}

.pub-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pub-venue-year {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}

.pub-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 6px;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pub-authors strong { color: var(--text); }

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.pub-tag {
  padding: 2px 10px;
  background: var(--surface);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--mid-blue);
  font-weight: 500;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark-blue);
  transition: all 0.2s;
  background: var(--white);
}

.pub-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* ── Experience ── */
#experience { background: var(--off-white); }

.exp-timeline {
  position: relative;
  padding-left: 28px;
  max-width: 800px;
}

.exp-timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 2px;
  height: calc(100% - 8px);
  background: linear-gradient(to bottom, var(--accent), var(--border));
}

.exp-card {
  position: relative;
  margin-bottom: 36px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s;
}

.exp-card::before {
  content: '';
  position: absolute;
  left: -34px; top: 24px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--accent);
}

.exp-card:hover { box-shadow: var(--shadow-md); }

.exp-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.exp-logo {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px;
  flex-shrink: 0;
}

.exp-logo-placeholder {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.exp-meta { flex: 1; }

.exp-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.badge-research  { background: #dbeafe; color: #1d4ed8; }
.badge-industry  { background: #dcfce7; color: #166534; }
.badge-teaching  { background: #fef9c3; color: #854d0e; }
.badge-education { background: #ede9fe; color: #5b21b6; }

.exp-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

.exp-org {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.exp-duration {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.exp-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 12px;
}

.exp-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.exp-highlights li {
  font-size: 0.85rem;
  color: var(--text);
  padding-left: 18px;
  position: relative;
}

.exp-highlights li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ── News ── */
#news { background: var(--white); }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1000px;
}

.news-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.news-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 12px;
}

.tag-Paper     { background: #dbeafe; color: #1d4ed8; }
.tag-Award     { background: #fef3c7; color: #92400e; }
.tag-Internship{ background: #dcfce7; color: #166534; }
.tag-Milestone { background: #ede9fe; color: #5b21b6; }
.tag-Talk      { background: #ffe4e6; color: #9f1239; }

.news-content {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── Footer ── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 28px 5%;
  font-size: 0.85rem;
}

footer a { color: rgba(255,255,255,0.7); }
footer a:hover { color: var(--white); }

/* ── Loading ── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .bio-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }

  .bio-photo-wrap { margin: 0 auto; }

  .bio-interests { justify-content: center; }

  .pub-list {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 16px 5% 24px;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

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

  .nav-links li { border-bottom: 1px solid rgba(255,255,255,0.07); }

  .nav-links a { display: block; padding: 12px 0; }

  .nav-links a::after { display: none; }

  .nav-toggle { display: flex; }

  .exp-timeline { padding-left: 20px; }

  .exp-card::before { left: -26px; }
}

@media (max-width: 480px) {
  section { padding: 70px 4% 50px; }
  #intro { padding: calc(var(--nav-h) + 50px) 4% 60px; }
  .news-grid { grid-template-columns: 1fr; }
}
