:root {
  --bg: #f7f7f5;
  --bg-alt: #ffffff;
  --bg-hero: #eef2f7;
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --primary: #1e3a5f;
  --accent: #2b6cb0;
  --accent-hover: #2c5282;
  --accent-light: #ebf4ff;
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --nav-height: 64px;
  --max-width: 1120px;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ───── Typography ───── */

h1, h2, h3, h4, h5 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary);
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1em; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ───── Navigation ───── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(247, 247, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.nav-brand:hover { color: var(--primary); text-decoration: none; }

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

.nav-links a {
  display: block;
  padding: 0.5rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ───── Hero ───── */

.hero {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 3rem;
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  border: 4px solid var(--bg-alt);
  box-shadow: var(--shadow-md);
}

.hero-text h1 {
  font-size: 2.8rem;
  margin-bottom: 0.3rem;
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.hero-affiliation {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.2rem;
  max-width: 540px;
  font-style: italic;
}

.hero-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  background: var(--bg-alt);
  transition: all var(--transition);
  text-decoration: none;
}

.hero-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

/* ───── Sections ───── */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  font-size: 1.9rem;
  margin-bottom: 0.4rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1rem;
}

.section + .section {
  border-top: 1px solid var(--border-light);
}

/* ───── About ───── */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  margin-top: 2rem;
}

.about-bio p {
  font-size: 1.05rem;
  color: var(--text);
}

.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-block h3 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
}

.sidebar-block ul {
  list-style: none;
  padding: 0;
}

.sidebar-block ul li {
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

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

.edu-item {
  display: flex;
  gap: 1rem;
  padding: 0.4rem 0;
}

.edu-year {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 42px;
}

.edu-detail {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.edu-detail strong {
  display: block;
  color: var(--text);
}

/* ───── Research Highlights ───── */

.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.research-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.research-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border-light);
  background: #0d1117;
}

.research-card-body {
  padding: 1.5rem 1.75rem 1.75rem;
}

.research-card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.research-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.research-card p {
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.research-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.research-card-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.research-card-links a {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  transition: all var(--transition);
  text-decoration: none;
}
.research-card-links a:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  text-decoration: none;
}

/* ───── Publications ───── */

.pub-category {
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.pub-category h3 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.pub-subcategory {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.pub-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pub-item {
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: box-shadow var(--transition);
}

.pub-item:hover {
  box-shadow: var(--shadow-sm);
}

.pub-title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.25rem;
}

.pub-authors {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

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

.pub-links a,
.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all var(--transition);
}

.badge-arxiv { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-arxiv:hover { background: #fde68a; color: #78350f; text-decoration: none; }
.badge-doi { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-doi:hover { background: #bfdbfe; color: #1e3a8a; text-decoration: none; }
.badge-code { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-code:hover { background: #a7f3d0; color: #064e3b; text-decoration: none; }
.badge-data { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.badge-data:hover { background: #ddd6fe; color: #4c1d95; text-decoration: none; }
.badge-misc { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.badge-misc:hover { background: #e5e7eb; color: #1f2937; text-decoration: none; }

/* ───── Software & Data ───── */

.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.software-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.software-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.software-card h4 {
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.software-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.software-card .card-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.software-card .card-links a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.software-card .card-links a:hover { text-decoration: underline; }

.data-list {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.data-list li {
  padding: 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: box-shadow var(--transition);
}
.data-list li:hover { box-shadow: var(--shadow-sm); }

/* ───── Teaching ───── */

.teaching-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.teaching-block h3 {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.teaching-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.teaching-list li {
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.teaching-list li strong {
  color: var(--text);
}

/* ───── Talks ───── */

.talks-section .pub-category h3 {
  font-size: 1.1rem;
}

.talk-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.talk-list li {
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  border-bottom: 1px solid var(--border-light);
}

.talk-list li:last-child { border-bottom: none; }

.talk-list li strong { color: var(--text); }

.talk-links a {
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

/* ───── Media ───── */

.media-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}

.media-list li {
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* ───── Contact ───── */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: box-shadow var(--transition);
}

.contact-item:hover { box-shadow: var(--shadow-sm); }

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  flex-shrink: 0;
}

.contact-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--accent);
}

/* ───── Footer ───── */

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--bg);
}

.footer a { color: var(--accent); }

/* ───── Scroll Reveal ───── */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ───── Responsive ───── */

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }

  .hero-portrait {
    margin: 0 auto;
    width: 160px;
    height: 160px;
  }

  .hero-links { justify-content: center; }

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

  .about-sidebar { order: -1; }

  h1 { font-size: 2rem; }
  .hero-text h1 { font-size: 2.2rem; }

  .research-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    box-shadow: var(--shadow-md);
  }

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

  .nav-toggle { display: flex; }

  .section { padding: 3rem 1.25rem; }

  .hero-text h1 { font-size: 1.9rem; }

  .software-grid,
  .contact-grid,
  .data-list {
    grid-template-columns: 1fr;
  }
}

@media print {
  .nav, .hero-links { display: none; }
  body { font-size: 11pt; }
  .section { padding: 1.5rem 0; }
}
