/* ─── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: #1a202c;
  background: #ffffff;
  line-height: 1.7;
}
a { color: #1d4e8f; text-decoration: none; }
a:hover { text-decoration: underline; color: #154070; }

/* ─── Variables ────────────────────────────────────── */
:root {
  --navy:      #1d3a6b;
  --blue:      #1d4e8f;
  --light-blue: #e8f0fb;
  --teal:      #2a7a7b;
  --bg-alt:    #f7f9fc;
  --border:    #dde3ee;
  --text:      #1a202c;
  --muted:     #5a6782;
  --tag-bg:    #e8f0fb;
  --tag-color: #1d4e8f;
}

/* ─── Layout ───────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }
section:nth-child(even) { background: var(--bg-alt); }

/* ─── Navigation ───────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
}
.nav-name {
  font-size: 0.95rem;
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a {
  font-size: 0.875rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--navy); text-decoration: none; }

/* ─── Hero ─────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0f2a5c 0%, #1d4e8f 60%, #2a7a7b 100%);
  color: #ffffff;
  padding: 80px 0 72px;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
.hero-avatar {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,0.7);
  font-family: -apple-system, sans-serif;
  overflow: hidden;
}
.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-name {
  font-size: 2.4rem;
  font-weight: normal;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}
.hero-title {
  font-size: 1.05rem;
  opacity: 0.9;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 4px;
}
.hero-inst {
  font-size: 0.95rem;
  opacity: 0.75;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 24px;
}
.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  font-size: 0.83rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #fff;
  opacity: 0.85;
  transition: opacity 0.2s, background 0.2s;
}
.hero-link:hover { opacity: 1; background: rgba(255,255,255,0.15); text-decoration: none; color: #fff; }

/* ─── Stats bar ────────────────────────────────────── */
.stats-bar {
  background: var(--navy);
  color: #fff;
  padding: 20px 0;
}
.stats-inner {
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}
.stat {
  flex: 1;
  text-align: center;
  padding: 0 16px;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-size: 1.8rem;
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1;
}
.stat-label {
  font-size: 0.78rem;
  opacity: 0.65;
  margin-top: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Section headings ─────────────────────────────── */
.section-title {
  font-size: 1.6rem;
  font-weight: normal;
  color: var(--navy);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue);
  display: inline-block;
}

/* ─── About ────────────────────────────────────────── */
.about-text p {
  margin-bottom: 16px;
  font-size: 1.025rem;
  color: var(--text);
}
.about-text p:last-child { margin-bottom: 0; }

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.interest-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--light-blue);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--navy);
  border: 1px solid var(--border);
}
.interest-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ─── Publications ─────────────────────────────────── */
.pub-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.83rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.pub-list { display: flex; flex-direction: column; gap: 0; }
.pub-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.pub-item:last-child { border-bottom: none; }
.pub-num {
  flex-shrink: 0;
  width: 36px;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding-top: 3px;
  text-align: right;
}
.pub-body { flex: 1; }
.pub-title {
  font-size: 0.98rem;
  color: var(--navy);
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 4px;
}
.pub-authors {
  font-size: 0.875rem;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 3px;
}
.pub-authors strong { color: var(--navy); font-weight: 600; }
.pub-venue {
  font-size: 0.83rem;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.pub-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.pub-tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.73rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--tag-bg);
  color: var(--tag-color);
  border: 1px solid #c5d5f0;
}
.pub-tag.q1 { background: #edf7ed; color: #276149; border-color: #b2dfc0; }
.pub-tag.doi { background: #fff; border: 1px solid var(--border); color: var(--muted); }
.pub-tag.doi a { color: inherit; font-size: inherit; }
.pub-tag.doi a:hover { color: var(--blue); }

.pub-hidden { display: none; }
.show-more-btn {
  margin-top: 24px;
  padding: 10px 24px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: #fff;
  color: var(--blue);
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.show-more-btn:hover { background: var(--blue); color: #fff; }

/* ─── Software / Project Cards ─────────────────────── */
.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.sw-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.sw-card:hover { box-shadow: 0 4px 20px rgba(29,78,143,0.1); transform: translateY(-2px); }
.sw-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sw-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--light-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.sw-name {
  font-size: 1.05rem;
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--navy);
}
.sw-desc {
  font-size: 0.9rem;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  margin-bottom: 14px;
}
.sw-links { display: flex; gap: 8px; }
.sw-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border: 1px solid var(--border);
  color: var(--blue);
  transition: all 0.2s;
}
.sw-link:hover { background: var(--blue); color: #fff; text-decoration: none; border-color: var(--blue); }

/* ─── Teaching ──────────────────────────────────────── */
.teaching-list { display: flex; flex-direction: column; gap: 16px; }
.teach-item {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 18px 20px;
}
.teach-name {
  font-size: 1rem;
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--navy);
  margin-bottom: 4px;
}
.teach-meta {
  font-size: 0.875rem;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.teach-period {
  font-size: 0.78rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.teach-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.73rem;
  background: #e8f7ed;
  color: #276149;
  border: 1px solid #b2dfc0;
}

/* ─── Timeline ──────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.tl-item { position: relative; padding-bottom: 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--blue);
}
.tl-date {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 4px;
}
.tl-role {
  font-size: 1rem;
  font-weight: bold;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--navy);
}
.tl-org {
  font-size: 0.9rem;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Contact ───────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.contact-icon { font-size: 1.2rem; flex-shrink: 0; }
.contact-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.contact-val {
  font-size: 0.9rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  word-break: break-all;
}
.contact-val a { color: var(--blue); }

/* ─── Footer ────────────────────────────────────────── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.82rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .hero-inner { flex-direction: column; gap: 24px; text-align: center; }
  .hero-links { justify-content: center; }
  .stats-inner { flex-wrap: wrap; }
  .stat { min-width: 45%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.15); }
  .stat:nth-child(even) { border-right: none; }
  .nav-links { display: none; }
  .hero-name { font-size: 1.9rem; }
}
