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

:root {
  --black:    #000000;
  --d1:       #0a0a0f;
  --d2:       #111118;
  --d3:       #1a1a24;
  --t1:       #f5f5f7;   /* Apple primary text  */
  --t2:       #86868b;   /* Apple secondary text */
  --t3:       #3a3a3d;
  --blue:     #0071e3;
  --cyan:     #00c7ff;
  --glow:     rgba(0,199,255,.14);
  --serif:    'Cormorant Garamond', Georgia, serif;
  --sans:     'DM Sans', sans-serif;
  --mono:     'JetBrains Mono', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--sans);
  background: var(--black);
  color: var(--t1);
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────
   NAV
───────────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 3.25rem;
  padding: 0 5vw;
  display: flex; align-items: center; justify-content: space-between;
  transition: background .4s, backdrop-filter .4s;
}
#nav.scrolled {
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.nav-logo {
  font-family: var(--serif); font-size: 1rem; font-weight: 300;
  letter-spacing: .06em; color: var(--t1); text-decoration: none;
  opacity: 0; transition: opacity .3s;
}
#nav.scrolled .nav-logo { opacity: 1; }

.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
  font-size: .72rem; font-weight: 400; letter-spacing: .04em;
  color: rgba(245,245,247,.65); text-decoration: none; transition: color .2s;
}
.nav-links a:hover { color: var(--t1); }

.lang-pill {
  display: flex; gap: .1rem; align-items: center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 2rem; padding: .18rem .28rem;
}
.lang-btn {
  font-size: .68rem; font-weight: 500; letter-spacing: .06em;
  padding: .2rem .52rem; border-radius: 1rem;
  border: none; background: transparent;
  color: rgba(245,245,247,.4); cursor: pointer;
  font-family: var(--sans); transition: background .2s, color .2s;
}
.lang-btn.on { background: rgba(255,255,255,.13); color: var(--t1); }

/* ─────────────────────────────────────────────────────
   HERO
───────────────────────────────────────────────────── */
#hero {
  position: relative; width: 100%; height: 100vh; min-height: 580px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
}

#wave-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-body { position: relative; z-index: 2; text-align: center; padding: 0 5vw; }

.hero-eyebrow {
  font-size: .72rem; font-weight: 400; letter-spacing: .2em;
  text-transform: uppercase; color: var(--cyan);
  margin-bottom: 1.4rem;
  opacity: 0; transform: translateY(18px);
  animation: up .8s ease .25s forwards;
}
.hero-name {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 8.5vw, 7.5rem);
  font-weight: 300; letter-spacing: -.02em; line-height: 1;
  color: var(--t1); margin-bottom: .85rem;
  opacity: 0; transform: translateY(28px);
  animation: up .9s ease .45s forwards;
}
.hero-sub {
  font-size: clamp(.85rem, 1.8vw, 1.1rem);
  font-weight: 300; letter-spacing: .07em; color: var(--t2);
  margin-bottom: 2.5rem;
  opacity: 0; transform: translateY(18px);
  animation: up .8s ease .75s forwards;
}
.hero-btns {
  display: flex; align-items: center; justify-content: center; gap: .85rem;
  opacity: 0; animation: up .8s ease 1.05s forwards;
}

.btn-solid {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .65rem 1.4rem; background: var(--blue); color: #fff;
  border-radius: 2rem; font-size: .78rem; font-weight: 500;
  letter-spacing: .02em; text-decoration: none;
  transition: background .2s, transform .15s, box-shadow .2s;
}
.btn-solid:hover { background: #0077ed; transform: scale(1.02); box-shadow: 0 0 28px rgba(0,113,227,.38); }

.btn-outline {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .65rem 1.4rem;
  border: 1px solid rgba(255,255,255,.22); color: var(--t1);
  border-radius: 2rem; font-size: .78rem; font-weight: 300;
  letter-spacing: .02em; text-decoration: none;
  transition: background .2s, border-color .2s;
}
.btn-outline:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.38); }

.scroll-hint {
  position: absolute; bottom: 2.25rem; left: 0; right: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  opacity: 0; animation: up .8s ease 1.5s forwards;
}
.scroll-hint span {
  font-size: .6rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan); text-shadow: 0 0 10px rgba(0,199,255,.45);
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  animation: pulse 2s ease infinite;
}



/* ─────────────────────────────────────────────────────
   SECTION COMMON
───────────────────────────────────────────────────── */
section { padding: clamp(5rem,10vw,9rem) 5vw; }

.s-label {
  font-size: .68rem; font-weight: 400; letter-spacing: .2em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: .9rem;
}
.s-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 300; letter-spacing: -.02em; line-height: 1.1;
  color: var(--t1); margin-bottom: 1.25rem;
}

.reveal { opacity: 0; transform: translateY(38px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: .1s; }
.d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; }
.d4 { transition-delay: .4s; }

/* ─────────────────────────────────────────────────────
   ABOUT
───────────────────────────────────────────────────── */
#about { background: var(--d1); }
.about-wrap { max-width: 860px; margin: 0 auto; }

.about-quote {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3.2vw, 2.6rem);
  font-weight: 300; line-height: 1.45;
  color: var(--t1); font-style: italic; margin-bottom: 2rem;
}
.about-quote em { color: var(--cyan); font-style: normal; }

.about-text {
  font-size: 1rem; font-weight: 300; line-height: 1.85;
  color: var(--t2); max-width: 660px; margin-bottom: 2rem;
}

.about-links { display: flex; flex-wrap: wrap; gap: .7rem; }
.alink {
  font-size: .76rem; color: var(--t2); text-decoration: none;
  border-bottom: 1px solid var(--t3); padding-bottom: .1rem;
  transition: color .2s, border-color .2s;
}
.alink:hover { color: var(--t1); border-color: var(--t2); }

/* ─────────────────────────────────────────────────────
   STATS
───────────────────────────────────────────────────── */
#stats { background: var(--black); padding: clamp(3.5rem,7vw,6rem) 5vw; }

.stats-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 1px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 1.1rem; overflow: hidden;
}
.stat {
  background: var(--d1);
  padding: 2.75rem 1.75rem; text-align: center;
}
.stat-n {
  font-family: var(--serif);
  font-size: clamp(2.4rem,3.8vw,3.8rem);
  font-weight: 300; line-height: 1; color: var(--t1);
  margin-bottom: .45rem; white-space: nowrap;
}
.stat-n .c { color: var(--cyan); }
.stat-l {
  font-size: .72rem; font-weight: 300; letter-spacing: .03em;
  color: var(--t2); line-height: 1.45;
}

/* ─────────────────────────────────────────────────────
   EXPERIENCE
───────────────────────────────────────────────────── */
#experience { background: var(--d1); }
.exp-wrap { max-width: 880px; margin: 0 auto; }

.exp-card {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 1.25rem; padding: 2.5rem;
  background: rgba(255,255,255,.018);
}
.exp-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding-bottom: 1.5rem; margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.exp-org-name { font-size: .7rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin-bottom: .35rem; }
.exp-role { font-family: var(--serif); font-size: 1.75rem; font-weight: 300; color: var(--t1); }
.exp-period { font-family: var(--mono); font-size: .7rem; color: var(--t3); white-space: nowrap; }

.exp-list { list-style: none; display: flex; flex-direction: column; gap: .85rem; }
.exp-list li {
  display: flex; align-items: flex-start; gap: .7rem;
  font-size: .88rem; font-weight: 300; line-height: 1.65; color: var(--t2);
}
.exp-list li::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--cyan); flex-shrink: 0; margin-top: .58rem;
}
.exp-list strong { color: var(--t1); font-weight: 500; }

/* ─────────────────────────────────────────────────────
   PUBLICATIONS
───────────────────────────────────────────────────── */
#publications { background: var(--black); }
.pub-list { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 3rem; }

.pub-card {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 1.25rem; overflow: hidden;
  background: var(--d2); min-height: 360px;
}
.pub-card.flip { direction: rtl; }
.pub-card.flip > * { direction: ltr; }

.pub-info { padding: 2.75rem; display: flex; flex-direction: column; justify-content: space-between; }
.pub-journal { font-size: .68rem; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: .9rem; }
.pub-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 300; line-height: 1.3; color: var(--t1); margin-bottom: 1rem; }
.pub-abstract { font-size: .83rem; font-weight: 300; line-height: 1.72; color: var(--t2); flex: 1; margin-bottom: 1.4rem; }
.pub-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.pub-doi-label { font-family: var(--mono); font-size: .68rem; color: var(--t3); }
.pub-link { font-size: .73rem; color: var(--blue); text-decoration: none; display: flex; align-items: center; gap: .3rem; transition: color .2s; }
.pub-link:hover { color: var(--cyan); }

.pub-viz { background: var(--d3); position: relative; overflow: hidden; }
.pub-viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ─────────────────────────────────────────────────────
   PROJECTS
───────────────────────────────────────────────────── */
#projects { background: var(--d1); }
.proj-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.25rem; margin-top: 3rem; }

.proj-card {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 1.25rem; padding: 1.85rem;
  background: rgba(255,255,255,.012);
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: .9rem;
  position: relative; overflow: hidden;
  transition: background .25s, border-color .25s, transform .25s;
}
.proj-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 60%, var(--glow), transparent 70%);
  opacity: 0; transition: opacity .35s;
}
.proj-card:hover { background: rgba(255,255,255,.025); border-color: rgba(0,199,255,.18); transform: translateY(-2px); }
.proj-card:hover::before { opacity: 1; }

.proj-top { display: flex; align-items: center; justify-content: space-between; }
.proj-icon {
  width: 2.4rem; height: 2.4rem; border-radius: .55rem;
  background: rgba(0,199,255,.1); border: 1px solid rgba(0,199,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.proj-gh { color: var(--t3); transition: color .2s; }
.proj-card:hover .proj-gh { color: var(--t2); }

.proj-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 400; color: var(--t1); }
.proj-desc { font-size: .8rem; font-weight: 300; line-height: 1.65; color: var(--t2); flex: 1; }
.proj-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
  font-family: var(--mono); font-size: .62rem; color: var(--t3);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-radius: .25rem; padding: .18rem .48rem;
}

/* ─────────────────────────────────────────────────────
   EDUCATION
───────────────────────────────────────────────────── */
#education { background: var(--black); }
.edu-list { max-width: 660px; margin: 2.5rem auto 0; display: flex; flex-direction: column; gap: 0; }

.edu-item { display: grid; grid-template-columns: 1rem 1fr; gap: 0 1.75rem; padding-bottom: 2.25rem; position: relative; }
.edu-item::after { content: ''; position: absolute; left: .44rem; top: 1.3rem; bottom: 0; width: 1px; background: rgba(255,255,255,.07); }
.edu-item:last-child::after { display: none; }

.edu-dot { width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid var(--cyan); background: var(--black); margin-top: .3rem; position: relative; z-index: 1; }
.edu-deg { font-family: var(--serif); font-size: 1.15rem; font-weight: 400; color: var(--t1); margin-bottom: .22rem; }
.edu-school { font-size: .8rem; color: var(--t2); margin-bottom: .22rem; }
.edu-meta { font-family: var(--mono); font-size: .68rem; color: var(--t3); }

/* ─────────────────────────────────────────────────────
   CONTACT
───────────────────────────────────────────────────── */
#contact { background: var(--d1); text-align: center; }
.contact-wrap { max-width: 560px; margin: 0 auto; }

.contact-body { font-size: .92rem; font-weight: 300; line-height: 1.75; color: var(--t2); margin-top: .5rem; }
.contact-email {
  font-family: var(--serif); font-size: clamp(1.3rem,2.8vw,2.2rem);
  font-weight: 300; color: var(--t1); text-decoration: none;
  display: inline-block; margin: 1.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,.18); padding-bottom: .15rem;
  transition: color .2s, border-color .2s;
}
.contact-email:hover { color: var(--cyan); border-color: var(--cyan); }
.social-row { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 1.5rem; }
.slink { font-size: .72rem; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--t2); text-decoration: none; transition: color .2s; }
.slink:hover { color: var(--t1); }

/* ─────────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────────── */
footer {
  background: var(--black);
  padding: 1.75rem 5vw;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,.05);
}
footer p { font-size: .7rem; color: var(--t3); }

/* ─────────────────────────────────────────────────────
   KEYFRAMES
───────────────────────────────────────────────────── */
@keyframes up   { to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

/* ─────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .pub-card { grid-template-columns: 1fr; }
  .pub-card.flip { direction: ltr; }
  .pub-viz { min-height: 200px; }
  .proj-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  footer { flex-direction: column; gap: .4rem; text-align: center; }
}