/* ─── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg: #0d0f14;
  --bg-alt: #111418;
  --surface: #181c23;
  --surface-2: #1e232d;
  --border: rgba(255,255,255,0.07);
  --text: #e8eaf0;
  --text-muted: #7a8194;
  --accent: #6c63ff;
  --accent-2: #00d4aa;
  --accent-glow: rgba(108,99,255,0.25);
  --radius: 14px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'Fira Mono', monospace;
  --nav-h: 64px;
  --transition: 0.3s ease;
}
[data-theme="light"] {
  --bg: #f5f6fa;
  --bg-alt: #eef0f5;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --border: rgba(0,0,0,0.08);
  --text: #1a1d27;
  --text-muted: #5a6172;
  --accent: #5048e5;
  --accent-2: #00b899;
  --accent-glow: rgba(80,72,229,0.15);
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── CONTAINER ──────────────────────────────────────────────── */
.container {
  width: 92%;
  max-width: 1100px;
  margin: 0 auto;
}

/* ─── NAV ────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: transparent;
  transition: background var(--transition), backdrop-filter var(--transition), box-shadow var(--transition);
}
.nav.scrolled {
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}
[data-theme="light"] .nav.scrolled {
  background: rgba(245,246,250,0.85);
}
.nav__inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2rem;
}
.nav__logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-right: auto;
  color: var(--text);
}
.nav__links {
  display: flex;
  gap: 2rem;
}
.nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--transition);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.dot { color: var(--accent); }

/* theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background var(--transition);
}
.theme-toggle__icon::before {
  content: '☀';
  font-size: 1rem;
  color: var(--text-muted);
}
[data-theme="light"] .theme-toggle__icon::before { content: '🌙'; }
.nav__burger { display: none; }

/* ─── HERO ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__photo {
  position: absolute;
  top: calc(var(--nav-h) + 20px);
  left: 5%;
  right: 5%;
  bottom: 20px;
  width: 90%;
  height: calc(100% - var(--nav-h) - 40px);
  object-fit: cover;
  object-position: center 40%;
  border-radius: 24px;
  transform: translateZ(0);
  will-change: transform;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 10, 15, 0.72) 0%,
    rgba(8, 10, 15, 0.55) 50%,
    rgba(8, 10, 15, 0.80) 100%
  );
}
[data-theme="light"] .hero__overlay {
  background: linear-gradient(
    to bottom,
    rgba(20, 24, 40, 0.65) 0%,
    rgba(20, 24, 40, 0.45) 50%,
    rgba(20, 24, 40, 0.70) 100%
  );
}
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.45;
}
.hero__content {
  position: relative;
  z-index: 1;
  padding-top: var(--nav-h);
}
.hero__greeting {
  font-size: 1rem;
  font-family: var(--mono);
  color: var(--accent-2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.hero__name {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.hero__role {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-family: var(--mono);
  color: #ffffff;
  margin-bottom: 1.5rem;
  min-height: 2rem;
  text-shadow: 0 1px 12px rgba(0,0,0,0.8);
}
.cursor {
  animation: blink 1s step-end infinite;
  color: var(--accent-2);
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.hero__sub {
  font-size: 1.1rem;
  color: #e8eaf0;
  max-width: 540px;
  margin-bottom: 2.5rem;
  text-shadow: 0 1px 12px rgba(0,0,0,0.7), 0 0 40px rgba(0,0,0,0.4);
}
.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.hero__badges {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
}
.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  z-index: 1;
}
.hero__scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%,100%{transform:scaleY(1);opacity:1}
  50%{transform:scaleY(0.5);opacity:0.4}
}

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn--primary:hover {
  background: #5a52e0;
  transform: translateY(-2px);
  box-shadow: 0 0 36px var(--accent-glow);
}
.btn--ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ─── SECTIONS ───────────────────────────────────────────────── */
.section { padding: 7rem 0; }
.section--alt { background: var(--bg-alt); }
.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 3.5rem;
  position: relative;
  display: inline-block;
}
.section__title::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 0;
  width: 48px; height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

/* ─── ABOUT ──────────────────────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* portrait */
.portrait__frame {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 6px var(--accent-glow), 0 16px 48px rgba(0,0,0,0.3);
  transition: box-shadow var(--transition), transform var(--transition);
}
.portrait__frame:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 8px var(--accent-glow), 0 24px 56px rgba(0,0,0,0.4);
}
.portrait__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.about__text p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.about__tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 500;
}
.skills__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}
.skills__grid { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.skill-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  transition: transform var(--transition);
}
.skill-chip:hover { transform: translateY(-2px); }
.skill-chip--management { background: rgba(108,99,255,0.15); color: var(--accent); border: 1px solid rgba(108,99,255,0.3); }
.skill-chip--engineering { background: rgba(0,212,170,0.12); color: var(--accent-2); border: 1px solid rgba(0,212,170,0.3); }
.skill-chip--research { background: rgba(255,190,80,0.12); color: #ffbe50; border: 1px solid rgba(255,190,80,0.3); }
.skill-chip--technical { background: rgba(255,100,130,0.12); color: #ff6482; border: 1px solid rgba(255,100,130,0.3); }

/* ─── TIMELINE ───────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}
.timeline__item {
  position: relative;
  margin-bottom: 2.5rem;
}
.timeline__marker {
  position: absolute;
  left: -2rem;
  top: 1.5rem;
  width: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline__dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.timeline__card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.timeline__role {
  font-size: 1.15rem;
  font-weight: 700;
}
.timeline__company {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.25rem;
}
.timeline__meta { text-align: right; }
.timeline__period, .timeline__location {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.timeline__desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }

/* ─── EDUCATION ──────────────────────────────────────────────── */
.edu__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.edu__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: border-color var(--transition), transform var(--transition);
}
.edu__card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.edu__icon { font-size: 2rem; flex-shrink: 0; }
.edu__degree {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.edu__minor {
  font-size: 0.85rem;
  color: var(--accent-2);
  margin-bottom: 0.4rem;
}
.edu__institution {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.edu__meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* ─── PUBLICATIONS ───────────────────────────────────────────── */
.pub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.pub__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.pub__card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.pub__card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.pub__label {
  font-size: 0.72rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
}
.pub__title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.pub__venue {
  font-size: 0.82rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 0.75rem;
}
.pub__desc { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* ─── CONTACT ────────────────────────────────────────────────── */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.contact__text p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
}
.contact__links { display: flex; flex-direction: column; gap: 1rem; }
.contact__item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.contact__item:hover {
  border-color: var(--accent);
  transform: translateX(6px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.contact__icon {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── REVEAL ANIMATION ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1050px) {
  .about__grid { grid-template-columns: 1fr 1fr; }
  .about__portrait { grid-column: 1 / -1; display: flex; justify-content: center; }
}
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about__portrait { display: flex; justify-content: center; }
  .contact__grid, .edu__grid { grid-template-columns: 1fr; gap: 2.5rem; }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    padding: 1.5rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }
  .nav__burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }
  .nav__burger span {
    display: block;
    width: 24px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
  }
  .timeline { padding-left: 1.5rem; }
  .timeline__marker { left: -1.5rem; }
  .timeline__header { flex-direction: column; gap: 0.5rem; }
  .timeline__meta { text-align: left; }
}
