/* ===== Design tokens ===== */
:root {
  --bg: #0b0d12;
  --bg-alt: #0f131b;
  --surface: #151a24;
  --surface-2: #1b212d;
  --border: #262d3a;
  --text: #e7ebf3;
  --text-dim: #9aa4b6;
  --text-faint: #6b7587;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --grad: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  --radius: 16px;
  --maxw: 1080px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-alt: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --border: #e2e7f0;
  --text: #161a22;
  --text-dim: #4d5666;
  --text-faint: #8b95a7;
  --accent: #5457ea;
  --accent-2: #0ea5b8;
  --accent-soft: rgba(84, 87, 234, 0.10);
  --shadow: 0 18px 50px -24px rgba(20, 30, 60, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

/* ===== Navigation ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.nav__logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad); color: #fff; font-size: 14px; font-weight: 800;
}
.nav__name { font-size: 15px; }
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-size: 14px; color: var(--text-dim); font-weight: 500;
  position: relative; transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad); transition: width 0.25s ease;
}
.nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover { background: var(--surface-2); transform: translateY(-1px); }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 11px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: 1px solid transparent;
}
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 10px 28px -12px var(--accent); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -12px var(--accent); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { transform: translateY(-2px); background: var(--surface-2); }
.btn--lg { padding: 15px 30px; font-size: 16px; }
.btn--sm { padding: 9px 16px; font-size: 13px; }

/* ===== Hero ===== */
.hero { position: relative; padding: 150px 0 90px; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(620px 360px at 18% 12%, var(--accent-soft), transparent 70%),
    radial-gradient(560px 320px at 88% 8%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 820px; }
.hero__eyebrow {
  font-family: var(--mono); font-size: 13px; color: var(--accent-2);
  letter-spacing: 0.3px; margin-bottom: 18px;
}
.hero__title { font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__subtitle { font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-weight: 600; color: var(--text); margin-top: 14px; }
.hero__lead { font-size: 1.05rem; color: var(--text-dim); margin-top: 20px; max-width: 680px; }
.hero__tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.hero__tags span {
  font-family: var(--mono); font-size: 12.5px; padding: 6px 13px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); background: var(--surface);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero__socials { display: flex; gap: 16px; margin-top: 32px; }
.hero__socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  transition: 0.2s ease;
}
.hero__socials a:hover { color: var(--text); transform: translateY(-3px); border-color: var(--accent); }

/* ===== Sections ===== */
.section { padding: 88px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 720px; margin-bottom: 48px; }
.section__kicker {
  font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 0.5px;
  display: inline-block; margin-bottom: 12px;
}
.section__title { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.18; }

/* ===== About ===== */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: start; }
.about__text p { color: var(--text-dim); margin-bottom: 16px; font-size: 1.02rem; }
.about__text strong { color: var(--text); font-weight: 600; }
.about__facts { display: grid; gap: 14px; }
.fact {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; box-shadow: var(--shadow);
}
.fact__num { display: block; font-size: 1.7rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fact__label { display: block; font-size: 13.5px; color: var(--text-dim); margin-top: 4px; }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: transform 0.25s ease, border-color 0.25s ease;
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.skill-card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.skill-card h3::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--grad); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.chips li {
  font-family: var(--mono); font-size: 12px; padding: 5px 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
}

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 8px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--accent), transparent);
}
.tl-item { position: relative; padding-left: 38px; margin-bottom: 28px; }
.tl-marker {
  position: absolute; left: 0; top: 26px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow); transition: border-color 0.25s ease, transform 0.25s ease;
}
.tl-card:hover { border-color: var(--accent); transform: translateX(3px); }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.tl-head h3 { font-size: 1.12rem; font-weight: 700; }
.tl-date { font-family: var(--mono); font-size: 12.5px; color: var(--accent-2); white-space: nowrap; }
.tl-org { color: var(--text-dim); font-weight: 500; font-size: 14.5px; margin: 4px 0 14px; }
.tl-note { color: var(--text-faint); font-weight: 400; font-size: 13px; }
.tl-points { list-style: none; display: grid; gap: 9px; margin-bottom: 16px; }
.tl-points li { position: relative; padding-left: 20px; color: var(--text-dim); font-size: 14.5px; }
.tl-points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.tl-stack { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.tl-stack li {
  font-family: var(--mono); font-size: 11.5px; padding: 4px 10px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent-2); border: 1px solid transparent;
}
[data-theme="light"] .tl-stack li { color: var(--accent); }

/* ===== Projects ===== */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.proj-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform 0.25s ease, border-color 0.25s ease; display: flex; flex-direction: column;
}
.proj-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.proj-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.proj-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.proj-link { color: var(--text-faint); transition: color 0.2s ease; }
.proj-link:hover { color: var(--text); }
.proj-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.proj-card p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 18px; flex: 1; }
.proj-stack { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; }
.proj-stack li { font-family: var(--mono); font-size: 11.5px; padding: 4px 10px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim); }
.proj-card--cta { background: linear-gradient(160deg, var(--accent-soft), transparent); justify-content: center; }
.proj-cta-links { display: flex; flex-wrap: wrap; gap: 10px; }

/* ===== Education ===== */
.edu { 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: 26px; transition: transform 0.25s ease, border-color 0.25s ease;
}
.edu-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.edu-year { font-family: var(--mono); font-size: 12.5px; color: var(--accent-2); }
.edu-card h3 { font-size: 1.15rem; margin: 8px 0 4px; }
.edu-field { color: var(--text); font-weight: 500; font-size: 14.5px; }
.edu-school { color: var(--text-dim); font-size: 13.5px; margin-top: 4px; }

/* ===== Contact ===== */
.contact { max-width: 760px; }
.contact__title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 16px; }
.contact__lead { color: var(--text-dim); font-size: 1.08rem; margin-bottom: 34px; }
.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 36px; }
.contact__item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 16px 18px;
  color: var(--accent); transition: transform 0.2s ease, border-color 0.2s ease;
}
.contact__item:hover { transform: translateY(-3px); border-color: var(--accent); }
.contact__item span { display: flex; flex-direction: column; color: var(--text); font-weight: 600; font-size: 14.5px; }
.contact__item small { color: var(--text-faint); font-weight: 500; font-size: 12px; margin-bottom: 1px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; color: var(--text-faint); font-size: 13.5px; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 28px; }
  .nav__links {
    position: fixed; top: 66px; right: 16px; left: 16px;
    flex-direction: column; gap: 4px; padding: 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--shadow); transform: translateY(-10px); opacity: 0; pointer-events: none;
    transition: 0.25s ease;
  }
  .nav__links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 10px 8px; }
  .nav__links a::after { display: none; }
  .nav__burger { display: flex; }
}
@media (max-width: 520px) {
  .section { padding: 64px 0; }
  .hero { padding: 124px 0 70px; }
  .tl-head { flex-direction: column; gap: 2px; }
  .btn { width: 100%; justify-content: center; }
  .hero__cta { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
