*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root { --transition: 0.45s cubic-bezier(0.4,0,0.2,1); }

[data-theme="dark"] {
  --bg: #080c14;
  --bg-alt: #0d1320;
  --bg-card: #111a2b;
  --bg-card-h: #152035;
  --text: #dce1ec;
  --text-dim: #8892a8;
  --text-muted: #576070;
  --accent: #00e5b0;
  --accent-soft: rgba(0,229,176,0.08);
  --accent-glow: rgba(0,229,176,0.25);
  --border: rgba(255,255,255,0.055);
  --nav-bg: rgba(8,12,20,0.85);
  --cvpr: #ff6b6b; --cvpr-bg: rgba(255,107,107,0.1);
  --icassp: #5fa0f5; --icassp-bg: rgba(95,160,245,0.1);
  --grain: 0.03;
}
[data-theme="light"] {
  --bg: #f7f4f0;
  --bg-alt: #efeae4;
  --bg-card: #ffffff;
  --bg-card-h: #faf8f5;
  --text: #1a1a28;
  --text-dim: #585870;
  --text-muted: #8a8a9c;
  --accent: #009e7a;
  --accent-soft: rgba(0,158,122,0.07);
  --accent-glow: rgba(0,158,122,0.2);
  --border: rgba(0,0,0,0.07);
  --nav-bg: rgba(247,244,240,0.88);
  --cvpr: #c94444; --cvpr-bg: rgba(201,68,68,0.08);
  --icassp: #3a7bd5; --icassp-bg: rgba(58,123,213,0.08);
  --grain: 0.015;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.75;
  transition: background var(--transition), color var(--transition);
}

/* Subtle grain texture overlay */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain);
}

h1, h2, h3 { font-family: 'Source Serif 4', serif; font-weight: 700; letter-spacing: -0.015em; }
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* -- NAV -- */
nav {
  position: fixed; top: 0; width: 100%; z-index: 100;
  background: var(--nav-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); transition: background var(--transition);
}
.nav-in { max-width: 860px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; height: 58px; }
.nav-nm { font-family: 'Source Serif 4', serif; font-weight: 700; font-size: 1rem; color: var(--text); text-decoration: none; }
.nav-nm span { color: var(--accent); }
.nav-ul { display: flex; gap: 1.5rem; align-items: center; list-style: none; }
.nav-ul a { color: var(--text-dim); font-size: 0.82rem; font-weight: 500; text-decoration: none; position: relative; transition: color 0.25s; }
.nav-ul a::after { content:''; position: absolute; bottom: -3px; left: 0; width: 0; height: 1.5px; background: var(--accent); transition: width 0.3s; }
.nav-ul a:hover { color: var(--accent); opacity: 1; }
.nav-ul a:hover::after { width: 100%; }
.t-btn { background: none; border: 1px solid var(--border); color: var(--text-dim); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; transition: all 0.25s; }
.t-btn:hover { border-color: var(--accent); color: var(--accent); }
.mob-btn { display: none; background: none; border: none; color: var(--text); font-size: 1.3rem; cursor: pointer; }

/* -- HERO -- */
.hero {
  position: relative; overflow: hidden;
  min-height: 100vh; display: flex; align-items: center;
}
#particles { position: absolute; inset: 0; pointer-events: none; }

/* Subtle gradient orbs */
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; opacity: 0.12;
}
.hero::before { width: 500px; height: 500px; background: var(--accent); top: -100px; right: -100px; }
.hero::after { width: 400px; height: 400px; background: #5f5fff; bottom: -80px; left: -60px; }

.hero-wrap {
  position: relative; z-index: 2;
  max-width: 860px; margin: 0 auto; width: 100%;
  padding: 8rem 1.5rem 5rem;
  display: grid; grid-template-columns: 200px 1fr; gap: 3rem; align-items: center;
}

.photo-wrap { position: relative; width: 200px; height: 200px; }
.photo-ring {
  position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid var(--accent); opacity: 0.35;
  animation: glow-pulse 4s ease-in-out infinite;
}
.photo-ring:nth-child(2) { inset: -13px; opacity: 0.15; animation-delay: 1.5s; }
@keyframes glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50% { transform: scale(1.03); opacity: 0.45; }
}
.photo {
  width: 200px; height: 200px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow: 0 0 50px var(--accent-glow), 0 0 100px rgba(0,229,176,0.08);
  transition: box-shadow 0.4s;
}

.hero-info h1 { font-size: 2.4rem; line-height: 1.15; margin-bottom: 0.4rem; }

.hero-type {
  display: flex; align-items: center; gap: 0.5ch;
  color: var(--accent); font-size: 0.95rem; font-weight: 500;
  height: 1.6em; margin-bottom: 1.25rem;
}
.tw-text { border-right: 2px solid var(--accent); padding-right: 2px; animation: blink 0.75s step-end infinite; }
@keyframes blink { 50% { border-color: transparent; } }

.hero-bio { color: var(--text-dim); font-size: 0.93rem; line-height: 1.85; margin-bottom: 1.5rem; }
.hero-bio strong { color: var(--text); font-weight: 600; }

.hero-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.hero-links a {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.95rem; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-dim);
  font-size: 0.78rem; font-weight: 500; transition: all 0.25s;
  background: rgba(255,255,255,0.02);
}
.hero-links a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); opacity: 1; transform: translateY(-2px); box-shadow: 0 4px 16px var(--accent-soft); }
.hero-links svg { width: 14px; height: 14px; }

/* -- SECTIONS -- */
.sec { max-width: 860px; margin: 0 auto; padding: 4rem 1.5rem; border-top: 1px solid var(--border); }
.sec-t { font-size: 1.5rem; margin-bottom: 2rem; }

/* Reveal */
.rv { opacity: 0; transform: translateY(20px); transition: opacity 0.65s ease, transform 0.65s ease; }
.rv.v { opacity: 1; transform: translateY(0); }
.rv.d1 { transition-delay: 0.1s; } .rv.d2 { transition-delay: 0.2s; } .rv.d3 { transition-delay: 0.3s; }

/* -- PUBLICATIONS -- */
.pub-list { display: flex; flex-direction: column; gap: 1.25rem; }
.pub {
  padding: 1.4rem 1.6rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-card); border-left: 3px solid transparent;
  transition: all 0.3s; position: relative; overflow: hidden;
}
.pub {
  display: block;
  text-decoration: none;
  color: inherit;
}
.pub::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--accent-soft), transparent 60%); opacity: 0; transition: opacity 0.3s; }
.pub:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.15); background: var(--bg-card-h); }
.pub:hover::before { opacity: 1; }
.pub.cvpr { border-left-color: var(--cvpr); }
.pub.icassp { border-left-color: var(--icassp); }
.pub-v { position: relative; display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; padding: 0.2em 0.65em; border-radius: 4px; margin-bottom: 0.6rem; }
.pub.cvpr .pub-v { background: var(--cvpr-bg); color: var(--cvpr); }
.pub.icassp .pub-v { background: var(--icassp-bg); color: var(--icassp); }
.pub-n { position: relative; font-family: 'Source Serif 4', serif; font-weight: 600; font-size: 1rem; line-height: 1.4; margin-bottom: 0.35rem; }
.pub-a { position: relative; color: var(--text-muted); font-size: 0.8rem; }
.pub-a strong { color: var(--text); font-weight: 600; }
.pub-d { position: relative; color: var(--text-dim); font-size: 0.82rem; margin-top: 0.4rem; }

/* -- EXPERIENCE -- */
.exp-list { display: flex; flex-direction: column; gap: 1.75rem; }
.exp { display: grid; grid-template-columns: 145px 1fr; gap: 1.25rem; }
.exp-dt { font-size: 0.78rem; color: var(--text-muted); padding-top: 0.2rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.exp-body { position: relative; padding-left: 1.25rem; border-left: 2px solid var(--border); transition: border-color 0.3s; }
.exp:hover .exp-body { border-left-color: var(--accent); }
.exp-body::before {
  content: ''; position: absolute; left: -5px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); opacity: 0.6; transition: opacity 0.3s;
}
.exp:hover .exp-body::before { opacity: 1; }
.exp-role { font-family: 'Source Serif 4', serif; font-weight: 600; font-size: 0.98rem; }
.exp-co { color: var(--accent); font-size: 0.85rem; font-weight: 500; }
.exp-loc { color: var(--text-muted); font-size: 0.78rem; }
.exp-desc { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.35rem; line-height: 1.6; }

/* -- EDUCATION -- */
.edu-list { display: flex; flex-direction: column; gap: 1.25rem; }
.edu { display: grid; grid-template-columns: 145px 1fr; gap: 1.25rem; }
.edu-yr { font-size: 0.78rem; color: var(--text-muted); padding-top: 0.2rem; font-weight: 500; }
.edu-deg { font-family: 'Source Serif 4', serif; font-weight: 600; font-size: 0.95rem; }
.edu-sc { color: var(--accent); font-size: 0.85rem; font-weight: 500; }
.edu-det { color: var(--text-dim); font-size: 0.82rem; margin-top: 0.2rem; }
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 0.68rem; font-weight: 600; padding: 0.15em 0.55em; border-radius: 4px; margin-left: 0.4rem; vertical-align: middle; }

/* -- AWARDS -- */
.aw-list { display: flex; flex-direction: column; gap: 0.6rem; }
.aw { display: flex; align-items: baseline; gap: 0.75rem; font-size: 0.88rem; color: var(--text-dim); padding: 0.5rem 0; border-bottom: 1px solid var(--border); transition: all 0.25s; }
.aw:last-child { border-bottom: none; }
.aw:hover { padding-left: 0.5rem; }
.aw strong { color: var(--text); }
.aw-yr { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; width: 44px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* -- TALKS -- */
.tk-list { display: flex; flex-direction: column; gap: 0.6rem; }
.tk { font-size: 0.88rem; color: var(--text-dim); padding: 0.4rem 0; }
.tk strong { color: var(--text); font-weight: 600; }

/* -- FOOTER -- */
.foot { max-width: 860px; margin: 0 auto; padding: 2.5rem 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.75rem; border-top: 1px solid var(--border); }

/* -- RESPONSIVE -- */
@media (max-width: 680px) {
  .hero-wrap { grid-template-columns: 1fr; text-align: center; justify-items: center; padding-top: 6rem; gap: 1.5rem; }
  .photo-wrap { width: 150px; height: 150px; }
  .photo { width: 150px; height: 150px; }
  .hero-links { justify-content: center; }
  .hero-info h1 { font-size: 1.8rem; }
  .nav-ul { display: none; }
  .nav-ul.open { display: flex; flex-direction: column; position: absolute; top: 58px; left: 0; right: 0; background: var(--nav-bg); backdrop-filter: blur(20px); padding: 1rem 1.5rem; gap: 1rem; border-bottom: 1px solid var(--border); }
  .mob-btn { display: block; }
  .exp, .edu { grid-template-columns: 1fr; gap: 0.15rem; }
  .sec { padding: 2.5rem 1.25rem; }
}