:root {
  --ink: #171923;
  --muted: #667085;
  --primary: #4f46e5;
  --primary-2: #06b6d4;
  --accent: #4f46e5;
  --accent-soft: #eef1fd;
  --border: #e7e9f0;
  --bg: #ffffff;
  --bg-soft: #f8f9fd;
  --max-width: 820px;
  --shadow-sm: 0 1px 3px rgba(23,25,35,0.06), 0 1px 2px rgba(23,25,35,0.08);
  --shadow-md: 0 8px 24px rgba(79,70,229,0.10), 0 2px 8px rgba(23,25,35,0.06);
  --shadow-lg: 0 20px 48px rgba(79,70,229,0.16);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}

h1, h2, h3, h4, .nav-brand {
  font-family: 'Poppins', 'Inter', sans-serif;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

.icon { width: 18px; height: 18px; display: inline-block; vertical-align: -4px; }
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 16px rgba(23,25,35,0.05);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
  position: relative;
  max-width: 1180px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}
.nav-brand:hover { text-decoration: none; }
.nav-brand .dot { color: var(--primary); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 60;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 3px;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-links a.active { color: var(--primary); }
.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.25s ease;
}
.nav-links a:not(.nav-cta):hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600 !important;
  box-shadow: var(--shadow-sm);
}
.nav-cta:hover { box-shadow: var(--shadow-md); text-decoration: none; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 70px;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
}
.hero-blob-1 {
  width: 420px; height: 420px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  top: -160px; right: -120px;
}
.hero-blob-2 {
  width: 320px; height: 320px;
  background: linear-gradient(135deg, #ec4899, var(--primary-2));
  bottom: -140px; left: -100px;
  opacity: 0.22;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-photo-wrap {
  padding: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

.hero-photo img {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
}

.hero-text { flex: 1; min-width: 280px; }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin: 0 0 16px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.2;
}

.grad-text {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0 0 28px;
  max-width: 52ch;
}

.hero-links { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { box-shadow: var(--shadow-lg); }

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.social-links {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  transition: all 0.18s ease;
}
.social-links a:hover {
  text-decoration: none;
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: var(--muted);
  animation: bounce 2s infinite;
  z-index: 1;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: -36px;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 20px 12px;
  text-align: center;
  transition: transform 0.2s ease;
}
.stat-card:hover { transform: translateY(-4px); }

.stat-number {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Sections */
.section {
  padding: 56px 24px;
  border-top: 1px solid var(--border);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-2);
  margin: 0 0 6px;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 22px;
}

.justify {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.interests { margin-top: 26px; }
.interests h3 { font-size: 1rem; margin-bottom: 12px; }

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
}

.tag-list li {
  background: var(--accent-soft);
  color: var(--primary);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tag-list li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #067647;
  background: #e5f8ef;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.badge-muted {
  color: var(--muted);
  background: var(--accent-soft);
}

.section-intro {
  color: var(--muted);
  margin-top: -10px;
  margin-bottom: 22px;
  font-size: 0.95rem;
}

/* Publications & timeline */
.pub, .timeline-item {
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.pub:hover, .timeline-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.pub:last-child, .timeline-item:last-child { margin-bottom: 0; }

.pub h3, .timeline-item h3 {
  font-size: 1.08rem;
  margin: 0 0 8px;
}

.pub-meta {
  color: var(--muted);
  font-size: 0.87rem;
  margin: 0 0 12px;
}

.pub-abstract {
  font-size: 0.95rem;
  margin: 0 0 12px;
}

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

.pub-link {
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pub-link-muted {
  color: var(--muted);
  font-weight: 500;
}

.timeline-item ul { margin: 8px 0 0; padding-left: 20px; }
.timeline-item li { margin-bottom: 6px; font-size: 0.94rem; }

.course-term { margin-top: 18px; }
.course-term h4 {
  font-size: 0.88rem;
  color: var(--primary);
  margin: 0 0 8px;
  font-weight: 600;
}
.course-term .badge { margin: 0 0 0 6px; padding: 1px 8px; font-size: 0.66rem; vertical-align: middle; }

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.project-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.project-emoji {
  font-size: 1.5rem;
  display: inline-block;
  margin-bottom: 8px;
}

.project-card h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.project-card p:last-child {
  font-size: 0.9rem;
  margin: 8px 0 0;
}

.project-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.project-links .pub-link { font-size: 0.85rem; }

/* Skills */
.skill-group { margin-bottom: 22px; }
.skill-group h3 {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 600;
}

.soon {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.75rem;
}

.note {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

/* Contact */
.contact-card {
  background: linear-gradient(135deg, var(--accent-soft), #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px;
  text-align: left;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 12px;
}
.contact-list li {
  margin-bottom: 12px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Back to top */
#back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 40;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover { box-shadow: var(--shadow-lg); }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 28px 24px 60px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 780px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 24px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 10px 0; }
  .nav-cta { display: inline-block; margin-top: 6px; }
}

@media (max-width: 600px) {
  .hero { text-align: center; padding-top: 76px; }
  .hero-inner { justify-content: center; }
  .hero-links, .social-links { justify-content: center; }
  .hero h1 { font-size: 2rem; }
  .project-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: -24px; }
  .contact-card { padding: 28px 22px; }
}
