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

:root {
  --bg: #07090f;
  --bg-soft: #0c1018;
  --bg-card: rgba(20, 26, 38, 0.55);
  --bg-card-solid: #121826;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(120, 170, 255, 0.35);
  --text: #e8edf5;
  --text-dim: #93a0b5;
  --text-faint: #5d6a80;
  --accent: #5eb3f6;
  --accent2: #a78bfa;
  --accent3: #34e3c4;
  --grad: linear-gradient(120deg, #5eb3f6 0%, #a78bfa 50%, #34e3c4 100%);
  --grad-soft: linear-gradient(120deg, rgba(94,179,246,.15), rgba(167,139,250,.15));
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --radius: 18px;
  --max: 1140px;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== CANVAS BG ===== */
#neural-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
  pointer-events: none;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(60% 50% at 20% 10%, rgba(94,179,246,.12), transparent 60%),
    radial-gradient(50% 50% at 85% 20%, rgba(167,139,250,.12), transparent 60%),
    radial-gradient(60% 60% at 60% 100%, rgba(52,227,196,.08), transparent 60%);
  pointer-events: none;
}

main, header, nav, footer, section { position: relative; z-index: 1; }

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad);
  z-index: 1000;
  box-shadow: 0 0 12px rgba(94,179,246,.6);
}

/* ===== CURSOR GLOW ===== */
.cursor-glow {
  position: fixed;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94,179,246,.10), transparent 65%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity .3s;
  opacity: 0;
}

/* ===== NAV ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px max(24px, 5vw);
  z-index: 100;
  transition: background .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
#navbar.scrolled {
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px max(24px, 5vw);
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.5px;
}
.logo-dot { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 30px;
  list-style: none;
}
.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  position: relative;
  transition: color .25s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--grad);
  transition: width .3s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-cv {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border-hover);
  border-radius: 30px;
  transition: all .25s;
}
.nav-cv:hover { background: var(--grad-soft); border-color: var(--accent); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--text); transition: .3s; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 30px;
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, background .25s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--grad);
  color: #06121f;
  box-shadow: 0 10px 30px -10px rgba(94,179,246,.6);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -10px rgba(94,179,246,.8); }
.btn-ghost {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-3px); background: var(--grad-soft); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px max(24px, 5vw) 60px;
  max-width: var(--max);
  margin: 0 auto;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 50px;
  align-items: center;
}
.hero-greeting {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.6rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -2px;
  margin-bottom: 18px;
}
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

.hero-role {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 22px;
  min-height: 1.8em;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.role-static { color: var(--text-dim); }
.role-dynamic { color: var(--text); font-weight: 600; }
.role-dynamic::after {
  content: "▋";
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-bio {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 540px;
  margin-bottom: 32px;
}
.hero-bio em { color: var(--accent3); font-style: normal; font-weight: 600; }
.hero-cta { display: flex; gap: 14px; margin-bottom: 34px; flex-wrap: wrap; }
.hero-socials { display: flex; gap: 16px; }
.hero-socials a {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  transition: all .25s;
}
.hero-socials svg { width: 20px; height: 20px; }
.hero-socials a:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-4px);
  background: var(--grad-soft);
}

/* Avatar */
.hero-visual { display: grid; place-items: center; }
.avatar-wrap {
  position: relative;
  width: min(360px, 80vw);
  aspect-ratio: 1;
}
.avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.1);
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow);
}
.avatar-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1.5px dashed rgba(94,179,246,.4);
  animation: spin 22s linear infinite;
}
.avatar-ring.ring2 {
  inset: -30px;
  border-color: rgba(167,139,250,.25);
  border-style: solid;
  border-width: 1px;
  animation-direction: reverse;
  animation-duration: 34s;
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar-badge {
  position: absolute;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 30px;
  background: rgba(12,16,24,.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-hover);
  color: var(--text);
  white-space: nowrap;
  box-shadow: var(--shadow);
  animation: float 5s ease-in-out infinite;
}
.badge-1 { top: 8%; left: -14%; animation-delay: 0s; }
.badge-2 { top: 48%; right: -22%; animation-delay: 1.4s; }
.badge-3 { bottom: 6%; left: -8%; animation-delay: 2.6s; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* Scroll hint */
.scroll-hint {
  margin: 50px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-faint);
}
.scroll-hint span {
  width: 24px; height: 38px;
  border: 2px solid var(--text-faint);
  border-radius: 14px;
  position: relative;
}
.scroll-hint span::before {
  content: "";
  position: absolute;
  top: 7px; left: 50%;
  width: 4px; height: 8px;
  background: var(--accent);
  border-radius: 4px;
  transform: translateX(-50%);
  animation: scrolldot 1.8s ease-in-out infinite;
}
@keyframes scrolldot { 0% { opacity: 0; top: 7px; } 40% { opacity: 1; } 80% { opacity: 0; top: 20px; } }
.scroll-hint p { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 2px; text-transform: uppercase; }

/* ===== STATS ===== */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px max(24px, 5vw);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat { text-align: center; }
.stat-num, .stat-plus {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--text-dim); font-size: .85rem; margin-top: 4px; }

/* ===== SECTIONS ===== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 100px max(24px, 5vw);
}
.section-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}
.section-index {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
  opacity: .7;
}
.section-index.center { display: block; text-align: center; }
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -1px;
}
.section-title.center { text-align: center; width: 100%; }
.section-link {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--accent);
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 30px;
  transition: all .25s;
}
.section-link:hover { border-color: var(--accent); background: var(--grad-soft); }

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
}
.about-text p { color: var(--text-dim); margin-bottom: 18px; font-size: 1.02rem; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}
.about-meta div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
}
.meta-key { display: block; font-size: .72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1px; }
.meta-val { font-weight: 600; font-size: .95rem; }

.about-interests {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
  height: fit-content;
}
.about-interests h3 { font-family: var(--font-display); margin-bottom: 18px; font-size: 1.2rem; }
.interest-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.interest-list li { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-weight: 500; }
.interest-list .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(94,179,246,.6);
  flex-shrink: 0;
}

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent2), transparent);
}
.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-dot {
  position: absolute;
  left: -34px; top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(94,179,246,.15);
}
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  backdrop-filter: blur(10px);
  transition: border-color .3s, transform .3s;
}
.timeline-card:hover { border-color: var(--border-hover); transform: translateX(6px); }
.timeline-date { font-family: var(--font-mono); color: var(--accent); font-size: .82rem; margin-bottom: 8px; }
.timeline-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 6px; }
.timeline-org { color: var(--text); font-weight: 500; margin-bottom: 6px; }
.timeline-desc { color: var(--text-dim); font-size: .94rem; }
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--grad-soft);
  border: 1px solid var(--border-hover);
  color: var(--accent3);
  vertical-align: middle;
  margin-left: 6px;
}

/* ===== PUBLICATIONS ===== */
.pub-list { display: flex; flex-direction: column; gap: 18px; }
.pub-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  backdrop-filter: blur(10px);
  transition: border-color .3s, transform .3s, box-shadow .3s;
}
.pub-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.pub-venue {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-right: 1px solid var(--border);
  padding-right: 18px;
  font-family: var(--font-display);
}
.pub-venue span { font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.pub-venue { color: var(--text-faint); font-size: 1.4rem; font-weight: 700; }
.pub-body { position: relative; }
.pub-body h3 { font-family: var(--font-display); font-size: 1.18rem; line-height: 1.35; margin-bottom: 10px; }
.pub-authors { color: var(--text); font-size: .95rem; margin-bottom: 4px; }
.pub-authors strong { color: var(--accent3); }
.pub-meta { color: var(--text-dim); font-size: .86rem; margin-bottom: 14px; }
.pub-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-tags span {
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: 4px 11px;
  border-radius: 20px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.pub-pdf {
  position: absolute;
  top: 0; right: 0;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--accent);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--border-hover);
  border-radius: 20px;
  transition: all .25s;
}
.pub-pdf:hover { background: var(--grad-soft); }

/* ===== EXPERIENCE ===== */
.exp-list { display: flex; flex-direction: column; gap: 18px; }
.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 30px;
  backdrop-filter: blur(10px);
  transition: border-color .3s, transform .3s;
}
.exp-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.exp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.exp-head h3 { font-family: var(--font-display); font-size: 1.25rem; }
.exp-date { font-family: var(--font-mono); color: var(--accent); font-size: .82rem; white-space: nowrap; }
.exp-org { color: var(--text-dim); font-weight: 500; margin: 4px 0 14px; }
.exp-points { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.exp-points li { position: relative; padding-left: 22px; color: var(--text-dim); font-size: .95rem; }
.exp-points li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }
.exp-points strong { color: var(--text); }

/* ===== PROJECTS ===== */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.proj-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
  transition: border-color .3s, transform .3s, box-shadow .3s;
  position: relative;
  overflow: hidden;
}
.proj-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-soft);
  opacity: 0;
  transition: opacity .3s;
}
.proj-card:hover { border-color: var(--border-hover); transform: translateY(-6px); box-shadow: var(--shadow); }
.proj-card:hover::before { opacity: 1; }
.proj-card > * { position: relative; z-index: 1; }
.proj-icon { font-size: 2rem; margin-bottom: 14px; }
.proj-card h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 10px; }
.proj-card p { color: var(--text-dim); font-size: .92rem; margin-bottom: 16px; }
.proj-card strong { color: var(--accent3); }
.proj-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.proj-tags span {
  font-family: var(--font-mono);
  font-size: .7rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

/* ===== SKILLS ===== */
.skills-wrap { display: flex; flex-direction: column; gap: 26px; margin-bottom: 50px; }
.skill-group h4 { font-family: var(--font-mono); color: var(--text-faint); font-size: .82rem; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 14px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tags span {
  padding: 9px 16px;
  border-radius: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: all .25s;
  cursor: default;
}
.skill-tags span:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-3px);
  background: var(--grad-soft);
}

/* Honors */
.honors h3 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 20px; }
.honor-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.honor-card {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  backdrop-filter: blur(10px);
  transition: border-color .3s, transform .3s;
}
.honor-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.honor-icon { font-size: 2.2rem; }
.honor-card h4 { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 4px; }
.honor-card p { color: var(--text-dim); font-size: .88rem; }

/* ===== CONTACT ===== */
.contact-section { text-align: center; }
.contact-inner { max-width: 620px; margin: 0 auto; }
.contact-sub { color: var(--text-dim); font-size: 1.08rem; margin: 18px 0 30px; }
.contact-email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 34px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  transition: background-position .5s;
}
.contact-email:hover { background-position: 100% center; }
.contact-socials { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 36px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: .88rem;
}

/* ===== REVEAL ANIM ===== */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .avatar-wrap { width: min(280px, 70vw); }
  .about-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 30px; }
  .nav-links, .nav-cv { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(7,9,15,.96);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
  }
  .nav-links.open li { padding: 12px 5vw; }
  .pub-card { grid-template-columns: 1fr; gap: 14px; }
  .pub-venue { flex-direction: row; gap: 8px; border-right: none; border-bottom: 1px solid var(--border); padding: 0 0 12px; justify-content: flex-start; }
  .pub-pdf { position: static; display: inline-block; margin-top: 12px; }
  .cursor-glow { display: none; }
}
@media (max-width: 520px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .avatar-badge { font-size: .68rem; padding: 5px 10px; }
  .badge-2 { right: -10%; }
  .section { padding: 70px max(20px, 5vw); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
