/* ===========================
   Design Tokens
   =========================== */
:root {
  --bg-deep: #0a0e1a;
  --bg-surface: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1e2a42;
  --accent-cyan: #00d4ff;
  --accent-teal: #64ffda;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-mono: 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--accent-cyan);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   Navigation
   =========================== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background 0.3s, padding 0.3s, box-shadow 0.3s;
}

#navbar.scrolled {
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 0;
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.4);
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-teal);
  letter-spacing: 2px;
}

.nav-logo:hover {
  color: var(--accent-cyan);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent-teal);
}

.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: 2px;
  background: var(--text-secondary);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===========================
   Hero
   =========================== */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 0 40px rgba(0, 212, 255, 0.2);
  margin-bottom: 20px;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--accent-teal);
  letter-spacing: 1px;
  opacity: 0.85;
}

.hero-contact-hint {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-top: 16px;
}

.hero-callout {
  display: inline-block;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.25);
  padding: 10px 24px;
  border-radius: 8px;
  transition: background 0.3s, box-shadow 0.3s;
}

.hero-callout:hover {
  background: rgba(0, 212, 255, 0.14);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
  color: var(--accent-cyan);
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  color: var(--text-muted);
  animation: bobble 2s ease-in-out infinite;
}

@keyframes bobble {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===========================
   Sections (shared)
   =========================== */
section {
  padding: 100px 0;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--accent-teal);
  margin-top: 8px;
  opacity: 0.6;
}

/* ===========================
   About
   =========================== */
#about {
  background: var(--bg-surface);
}

.about-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 64px;
}

.about-image img {
  border-radius: 12px;
  border: 2px solid rgba(100, 255, 218, 0.15);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.08);
}

.about-text p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.about-text a {
  border-bottom: 1px solid rgba(100, 255, 218, 0.3);
}

.about-text a:hover {
  border-bottom-color: var(--accent-cyan);
}

.pronouns {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  margin-top: 8px;
}

/* ===========================
   Timeline
   =========================== */
.timeline-heading {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  letter-spacing: 0.5px;
}

.timeline {
  position: relative;
  padding-left: 160px;
  margin-bottom: 48px;
}

.timeline-line {
  position: absolute;
  left: 131px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-teal));
  opacity: 0.2;
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-year {
  position: absolute;
  left: -56px;
  transform: translateX(-100%);
  top: 5px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  white-space: nowrap;
}

.timeline-node {
  position: absolute;
  left: -40px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--text-muted);
  transition: border-color 0.5s, box-shadow 0.5s, background 0.5s;
  z-index: 1;
}

.timeline-item.visible .timeline-node,
.timeline-node.active-node {
  border-color: var(--accent-teal);
  background: rgba(100, 255, 218, 0.1);
  box-shadow: 0 0 12px rgba(100, 255, 218, 0.3);
}

.timeline-node.active-node {
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.15);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
}

.timeline-label {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-teal);
  display: block;
  margin-bottom: 2px;
}

.timeline-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.outside-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  border-left: 2px solid rgba(100, 255, 218, 0.15);
  padding-left: 16px;
  max-width: 700px;
}

/* ===========================
   Publications
   =========================== */
#publications {
  background: var(--bg-deep);
}

.pub-card {
  background: var(--bg-card);
  border: 1px solid rgba(100, 255, 218, 0.08);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 20px;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  position: relative;
}

.pub-card:hover {
  border-color: rgba(100, 255, 218, 0.2);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.08);
  transform: translateY(-2px);
}

/* Featured publication */
.pub-card.featured {
  border-color: rgba(0, 212, 255, 0.25);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 212, 255, 0.04) 100%);
  margin-bottom: 36px;
  animation: featuredGlow 4s ease-in-out infinite;
}

.pub-card.featured:hover {
  animation: none;
  box-shadow: 0 0 25px rgba(0, 212, 255, 0.2), 0 0 50px rgba(0, 212, 255, 0.06);
}

@keyframes featuredGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.1), 0 0 30px rgba(0, 212, 255, 0.04);
  }
  50% {
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.15), 0 0 40px rgba(100, 255, 218, 0.06);
  }
}

.pub-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 16px;
}

.pub-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.pub-title a {
  color: var(--text-primary);
}

.pub-title a:hover {
  color: var(--accent-teal);
}

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

.pub-journal {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.pub-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.pub-highlight {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  margin-top: 12px;
  opacity: 0.9;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.pub-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-teal);
  border: 1px solid rgba(100, 255, 218, 0.2);
  padding: 6px 16px;
  border-radius: 6px;
  transition: background 0.3s, box-shadow 0.3s;
}

.pub-link:hover {
  background: rgba(100, 255, 218, 0.08);
  box-shadow: 0 0 12px rgba(100, 255, 218, 0.12);
  color: var(--accent-cyan);
}

/* Clickable pub cards (grid cards only) */
.pub-grid .pub-card[data-href] {
  cursor: pointer;
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.scholar-link {
  text-align: center;
  margin-top: 40px;
}

.btn-glow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-teal);
  border: 1px solid rgba(100, 255, 218, 0.3);
  padding: 12px 28px;
  border-radius: 8px;
  display: inline-block;
  transition: background 0.3s, box-shadow 0.3s, color 0.3s;
}

.btn-glow:hover {
  background: rgba(100, 255, 218, 0.08);
  box-shadow: 0 0 20px rgba(100, 255, 218, 0.15);
  color: var(--accent-cyan);
}

/* ===========================
   Interests
   =========================== */
#interests {
  background: var(--bg-surface);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-teal);
  background: rgba(100, 255, 218, 0.05);
  border: 1px solid rgba(100, 255, 218, 0.15);
  padding: 10px 20px;
  border-radius: 30px;
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
  animation: tagFloat 6s ease-in-out infinite;
}

.tag:nth-child(2) { animation-delay: -0.8s; }
.tag:nth-child(3) { animation-delay: -1.6s; }
.tag:nth-child(4) { animation-delay: -2.4s; }
.tag:nth-child(5) { animation-delay: -3.2s; }
.tag:nth-child(6) { animation-delay: -4.0s; }
.tag:nth-child(7) { animation-delay: -4.8s; }
.tag:nth-child(8) { animation-delay: -5.6s; }

@keyframes tagFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.tag:hover {
  background: rgba(100, 255, 218, 0.1);
  box-shadow: 0 0 15px rgba(100, 255, 218, 0.15);
  transform: translateY(-3px);
  animation-play-state: paused;
}

/* ===========================
   Connect / Footer
   =========================== */
#connect {
  background: var(--bg-deep);
  text-align: center;
}

.connect-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto 40px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 64px;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid rgba(100, 255, 218, 0.12);
  padding: 12px 24px;
  border-radius: 8px;
  transition: color 0.3s, border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.social-btn:hover {
  color: var(--accent-teal);
  border-color: rgba(100, 255, 218, 0.3);
  box-shadow: 0 0 20px rgba(100, 255, 218, 0.1);
  background: rgba(100, 255, 218, 0.04);
}

.social-btn svg {
  flex-shrink: 0;
}

footer {
  padding: 32px 24px;
  text-align: center;
}

.land-acknowledgment {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ===========================
   Scroll Reveal Animations
   =========================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Stagger children in grids */
.pub-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.pub-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.pub-grid .reveal:nth-child(4) { transition-delay: 0.3s; }
.pub-grid .reveal:nth-child(5) { transition-delay: 0.4s; }
.pub-grid .reveal:nth-child(6) { transition-delay: 0.5s; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    transition: right 0.3s ease;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    font-size: 1rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .about-image img {
    max-width: 200px;
    margin: 0 auto;
    display: block;
  }

  .timeline {
    padding-left: 40px;
  }

  .timeline-line {
    left: 11px;
  }

  .timeline-year {
    position: static;
    width: auto;
    text-align: left;
    margin-bottom: 4px;
    display: block;
  }

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

  .social-links {
    flex-direction: column;
    align-items: center;
  }

  section {
    padding: 72px 0;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.8rem;
  }

  .pub-card {
    padding: 20px;
  }

  .tags {
    gap: 10px;
  }

  .tag {
    font-size: 0.78rem;
    padding: 8px 16px;
  }
}
