:root {
  --bg: #faf8ff;
  --bg-alt: #f1ecff;
  --surface: #ffffff;
  --text: #1c1330;
  --text-dim: #5c5470;
  --border: rgba(28, 19, 48, 0.08);
  --c1: #6d28d9;
  --c2: #db2777;
  --c3: #ea580c;
  --c4: #0891b2;
  --c5: #16a34a;
  --c6: #ca8a04;
  --grad: linear-gradient(120deg, #6d28d9 0%, #db2777 50%, #f59e0b 100%);
  --shadow: 0 10px 30px rgba(109, 40, 217, 0.12);
  --radius: 20px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html[data-theme="dark"] {
  --bg: #120b22;
  --bg-alt: #180f2b;
  --surface: #1d1333;
  --text: #f3eeff;
  --text-dim: #b3a6d4;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #120b22;
    --bg-alt: #180f2b;
    --surface: #1d1333;
    --text: #f3eeff;
    --text-dim: #b3a6d4;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

a { color: inherit; text-decoration: none; }

ul { padding-left: 1.1em; margin: .6em 0 0; }
li { margin-bottom: .35em; color: var(--text-dim); }

/* ---------- Background blobs ---------- */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .35;
  z-index: 0;
  pointer-events: none;
}
.blob-1 { width: 500px; height: 500px; background: #6d28d9; top: -150px; left: -150px; }
.blob-2 { width: 450px; height: 450px; background: #db2777; top: 30%; right: -180px; }
.blob-3 { width: 400px; height: 400px; background: #f59e0b; bottom: -150px; left: 20%; }
html[data-theme="dark"] .blob { opacity: .25; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-weight: 500;
  font-size: .92rem;
  color: var(--text-dim);
  transition: color .2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--c2); }
.nav-controls { display: flex; align-items: center; gap: 10px; }

.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .8rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.pill-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.icon-btn:hover { transform: translateY(-1px) rotate(8deg); box-shadow: var(--shadow); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.nav-burger { display: none; }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .icon-sun { display: block; }
  html:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: transform .2s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--c2); color: var(--c2); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; margin-top: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 24px;
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
  align-items: center;
}
.eyebrow {
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--c2);
  margin: 0 0 14px;
}
.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.05;
  font-weight: 700;
  margin-bottom: 16px;
}
.hero-role {
  font-size: 1.25rem;
  font-weight: 600;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 16px;
}
.hero-tagline {
  color: var(--text-dim);
  max-width: 46ch;
  margin-bottom: 30px;
  font-size: 1.02rem;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-social { display: flex; gap: 14px; }
.hero-social a {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  transition: transform .2s, color .2s, border-color .2s;
}
.hero-social a svg { width: 19px; height: 19px; }
.hero-social a:hover { transform: translateY(-3px); color: var(--c2); border-color: var(--c2); }

.hero-photo-wrap {
  position: relative;
  justify-self: center;
  width: min(340px, 80vw);
  aspect-ratio: 1;
}
.hero-photo-ring {
  position: absolute;
  inset: -14px;
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  background: var(--grad);
  animation: morph 8s ease-in-out infinite;
  opacity: .8;
}
@keyframes morph {
  0%, 100% { border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%; }
  50% { border-radius: 60% 40% 45% 55% / 55% 60% 40% 45%; }
}
.hero-photo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 40% 60% 55% 45% / 45% 40% 60% 55%;
  border: 5px solid var(--bg);
  animation: morph 8s ease-in-out infinite;
  display: block;
  background: var(--surface);
}

.scroll-cue {
  align-self: center;
  margin-top: 30px;
  width: 26px; height: 42px;
  border: 2px solid var(--border);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-cue span {
  width: 4px; height: 8px;
  border-radius: 2px;
  background: var(--c2);
  animation: scrollcue 1.6s infinite;
}
@keyframes scrollcue {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ---------- Sections ---------- */
.section { position: relative; z-index: 1; padding: 110px 24px; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: 1180px; margin: 0 auto; }
.section-eyebrow {
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--c4);
  margin-bottom: 10px;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 46px;
  max-width: 20ch;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 50px;
  align-items: start;
}
.about-text { font-size: 1.08rem; color: var(--text-dim); max-width: 60ch; }
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label { font-size: .85rem; color: var(--text-dim); }

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 34px;
  border-left: 2px solid var(--border);
}
.tl-item { position: relative; margin-bottom: 42px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -41px;
  top: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--grad);
  border: 3px solid var(--bg-alt);
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 30px;
  box-shadow: var(--shadow);
}
.tl-date {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: var(--c1);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.tl-item[data-color="c2"] .tl-date { background: var(--c2); }
.tl-item[data-color="c3"] .tl-date { background: var(--c3); }
.tl-item[data-color="c4"] .tl-date { background: var(--c4); }
.tl-card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.tl-org { color: var(--text-dim); font-size: .92rem; font-weight: 500; margin: 0 0 4px; }

/* ---------- Education ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  border-top: 4px solid var(--c1);
  transition: transform .2s, box-shadow .2s;
}
.edu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.edu-card[data-color="c2"] { border-top-color: var(--c2); }
.edu-card[data-color="c3"] { border-top-color: var(--c3); }
.edu-card[data-color="c4"] { border-top-color: var(--c4); }
.edu-card[data-color="c5"] { border-top-color: var(--c5); }
.edu-card[data-color="c6"] { border-top-color: var(--c6); }
.edu-year { font-size: .8rem; font-weight: 700; color: var(--text-dim); letter-spacing: .04em; }
.edu-card h3 { font-size: 1.08rem; margin: 8px 0 4px; }
.edu-school { font-size: .88rem; color: var(--text-dim); margin: 0; }
.edu-thesis { font-size: .82rem; color: var(--text-dim); font-style: italic; margin-top: 8px; }

/* ---------- Skills ---------- */
.skills-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
.skills-block h3 { font-size: 1.1rem; margin-bottom: 22px; }
.skills-block h3.mt { margin-top: 34px; }
.bar-row { margin-bottom: 16px; }
.bar-row span { display: block; font-size: .88rem; font-weight: 500; margin-bottom: 6px; }
.bar { height: 9px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--grad);
  transition: width 1.1s cubic-bezier(.22,1,.36,1);
}
.bar-fill.in-view { width: var(--w); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 500;
}
.tag-highlight {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.lang-row { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.lang-row:last-child { border-bottom: none; }
.lang-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.lang-head em { font-style: normal; color: var(--c2); font-weight: 700; font-size: .85rem; }
.lang-levels { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.lvl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  min-width: 64px;
}
.lvl span { display: block; font-weight: 700; color: var(--c4); }
.lvl small { color: var(--text-dim); font-size: .7rem; }

/* ---------- Interests ---------- */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.interest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.interest-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.interest-icon { font-size: 2.2rem; margin-bottom: 12px; }
.interest-card h3 { font-size: 1rem; margin-bottom: 8px; }
.interest-card p { font-size: .85rem; color: var(--text-dim); margin: 0; }

/* ---------- Contact ---------- */
.section-contact { text-align: center; }
.section-contact .section-title { margin-left: auto; margin-right: auto; }
.contact-sub { color: var(--text-dim); max-width: 50ch; margin: 0 auto 40px; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: .92rem;
  transition: transform .2s, box-shadow .2s, color .2s;
}
.contact-card svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--c2); }
.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--c2); }
.contact-card-static:hover { transform: none; box-shadow: none; color: var(--text); cursor: default; }

/* ---------- Portfolio ---------- */
.nav-current { color: var(--c2) !important; }
.portfolio-hero {
  position: relative;
  z-index: 1;
  padding: 130px 24px 60px;
  text-align: center;
}
.pf-title { margin-left: auto; margin-right: auto; }
.pf-sub {
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 auto;
  font-size: 1.05rem;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.project-card-placeholder { border-style: dashed; }
.project-thumb-empty {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  background: var(--bg-alt);
}
.project-body { padding: 22px; }
.project-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--c2);
  margin-bottom: 10px;
}
.project-body h3 { font-size: 1.05rem; margin-bottom: 8px; }
.project-body p { font-size: .88rem; color: var(--text-dim); margin: 0; }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 24px;
  color: var(--text-dim);
  font-size: .85rem;
  border-top: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .icon-btn.nav-burger { display: flex; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-photo-wrap { order: -1; width: 220px; }
  .hero-social { justify-content: center; }
  .hero-actions { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-cols { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 900px) {
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 16px;
  }
}
