:root {
  --bg: #fafbff;
  --surface: #ffffff;
  --surface-alt: #f4f6fb;
  --text: #0f172a;
  --text-muted: #5b6478;
  --border: #e6e8ef;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #30cfd0;
  --accent-2: #330867;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 25px 60px rgba(15, 23, 42, 0.12);
  --container: 1120px;
  --gap: clamp(1rem, 2vw, 1.5rem);
  --font-sans: "Inter", "Heebo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #111832;
    --surface-alt: #0f1530;
    --text: #e8ecf5;
    --text-muted: #94a0bc;
    --border: #1f2745;
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
}

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }
section { scroll-margin-top: 90px; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.container-x {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.section {
  padding: clamp(3rem, 7vw, 6rem) 0;
}

.section-alt { background: var(--surface-alt); }

.section-head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
  text-align: center;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

.text-gradient {
  background: linear-gradient(100deg, #30cfd0 0%, #2563eb 50%, #330867 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ====== NAV ====== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}

.site-nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-brand img { width: 36px; height: 36px; border-radius: 8px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color .15s, background .15s;
}
.nav-links .nav-link:hover,
.nav-links .nav-link.active { color: var(--text); background: var(--surface-alt); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background .15s, transform .15s;
}
.nav-cta:hover { background: var(--primary-hover); transform: translateY(-1px); color: #fff; }

.lang-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background .15s;
}
.lang-toggle:hover { background: var(--surface-alt); }

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ====== HERO ====== */
.hero {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 70%;
  background:
    radial-gradient(60% 60% at 20% 30%, rgba(48, 207, 208, 0.18), transparent 60%),
    radial-gradient(45% 50% at 80% 20%, rgba(37, 99, 235, 0.18), transparent 60%),
    radial-gradient(40% 45% at 60% 80%, rgba(51, 8, 103, 0.14), transparent 60%);
  filter: blur(40px);
  z-index: -1;
}

.hero-kicker {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}
.hero-name {
  color: #fff;
  text-shadow: 0 2px 14px rgba(15, 23, 42, 0.55), 0 1px 3px rgba(15, 23, 42, 0.65);
}

.hero-subtitle { font-size: 1.15rem; color: var(--text-muted); font-weight: 500; margin: 0 0 0.75rem; }
.hero-tagline { font-size: 1.05rem; color: var(--text-muted); margin: 0 0 2rem; max-width: 52ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-actions .btn { border-radius: 999px; padding: 0.75rem 1.5rem; font-weight: 600; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.hero-avatar-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 1.25rem;
}
.hero-avatar-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 32% 68% 65% 35% / 40% 45% 55% 60%;
  background: linear-gradient(135deg, #30cfd0, #2563eb, #330867);
  opacity: 0.15;
  animation: blob 14s ease-in-out infinite;
  z-index: 0;
}
@keyframes blob {
  0%, 100% { border-radius: 32% 68% 65% 35% / 40% 45% 55% 60%; }
  50% { border-radius: 60% 40% 35% 65% / 55% 60% 40% 45%; }
}

.hero-avatar-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  z-index: 1;
}
.hero-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 1s ease, transform 1.2s ease;
  transform: scale(0.98);
}
.hero-avatar.active { opacity: 1; transform: scale(1); }

/* ====== ABOUT ====== */
.about-bio p { color: var(--text-muted); line-height: 1.75; font-size: 1rem; margin: 0 0 1rem; }
.about-subtitle { font-size: 1.25rem; font-weight: 700; margin: 0 0 1rem; letter-spacing: -0.01em; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text);
  transition: transform .15s, border-color .15s;
}
.chip:hover { border-color: var(--primary); transform: translateY(-1px); }

.lang-list { display: flex; flex-direction: column; gap: 1rem; }
.lang-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.95rem; margin-bottom: 0.35rem; gap: 0.75rem; }
.lang-head .text-muted { color: rgba(255, 255, 255, 0.6) !important; font-weight: 500; }
.lang-bar { height: 6px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.lang-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #30cfd0, #2563eb);
  border-radius: inherit;
  transition: width .6s ease;
}

.achievement-list { padding-left: 1.2rem; color: var(--text-muted); line-height: 1.8; margin: 0; }
.achievement-list li { margin-bottom: 0.25rem; }

/* ====== SKILLS ====== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}
.skill-icon { font-size: 2.4rem; }
.skill-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

/* ====== TIMELINE ====== */
.timeline {
  position: relative;
  padding-left: 2rem;
  max-width: 820px;
  margin: 0 auto;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), transparent);
}
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-marker {
  position: absolute;
  left: -1.62rem;
  top: 0.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent);
}
.timeline-period { font-size: 0.85rem; color: var(--primary); font-weight: 600; letter-spacing: 0.04em; }
.timeline-org { font-size: 1.15rem; font-weight: 700; margin: 0.25rem 0 0.25rem; }
.timeline-meta { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.5rem; }
.timeline-projects { margin: 0.25rem 0 0; padding-left: 1.2rem; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* ====== EDUCATION ====== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 2rem auto 0;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform .2s, box-shadow .2s;
}
.edu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.edu-date { font-size: 0.8rem; color: var(--primary); font-weight: 600; letter-spacing: 0.04em; }
.edu-degree { font-size: 1.05rem; font-weight: 700; margin: 0.35rem 0; }
.edu-school { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 0.5rem; }
.edu-thesis { color: var(--text-muted); font-size: 0.85rem; font-style: italic; margin: 0; }

/* ====== PUBLICATIONS ====== */
.publications-list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 900px; margin: 0 auto; }
.pub-card {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: border-color .2s, transform .2s;
}
.pub-card:hover { border-color: var(--primary); transform: translateX(4px); color: var(--text); }
.pub-year { font-weight: 700; color: var(--primary); font-size: 1.1rem; }
.pub-title { font-size: 1rem; font-weight: 600; margin: 0 0 0.2rem; line-height: 1.35; }
.pub-venue { font-size: 0.85rem; color: var(--text-muted); }
.pub-arrow { color: var(--text-muted); }

.events-list { max-width: 820px; margin: 0 auto; padding-left: 1.2rem; color: var(--text-muted); line-height: 1.9; }

/* ====== PROJECTS ====== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.project-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.project-desc { color: var(--text-muted); font-size: 0.95rem; margin: 0; line-height: 1.6; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { font-size: 0.75rem; padding: 0.2rem 0.55rem; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); border-radius: 6px; font-weight: 500; }
.project-link { font-weight: 600; font-size: 0.9rem; margin-top: auto; }

/* ====== CONTACT ====== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  text-align: center;
  transition: transform .2s, border-color .2s;
}
.contact-card:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--text); }
.contact-card i { font-size: 1.6rem; color: var(--primary); margin-bottom: 0.4rem; }
.contact-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.contact-value { font-weight: 600; font-size: 0.95rem; word-break: break-word; }

.contact-socials { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; }
.contact-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform .2s, background .2s, color .2s;
  font-size: 1.15rem;
}
.contact-socials a:hover { transform: translateY(-2px); background: var(--primary); color: #fff; border-color: var(--primary); }

/* ====== FOOTER ====== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    right: 1rem;
    left: 1rem;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links .nav-link { border-radius: 10px; }
  .nav-cta { justify-content: center; }
}

@media (max-width: 600px) {
  .pub-card { grid-template-columns: 1fr; gap: 0.5rem; }
  .pub-arrow { display: none; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}
