/* ---------- Tokens ---------- */
:root {
  --bg: #0b0f17;
  --bg-alt: #0f1520;
  --surface: #131b28;
  --surface-2: #182234;
  --border: #223047;
  --text: #e6edf6;
  --muted: #93a3b8;
  --accent: #62d84e;
  --accent-2: #3ec6c0;
  --accent-ink: #06210a;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  --radius: 16px;
  --max: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-alt: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --border: #dbe3ee;
  --text: #0f1726;
  --muted: #56657a;
  --accent: #23a33a;
  --accent-2: #138f8a;
  --accent-ink: #ffffff;
  --shadow: 0 20px 50px -24px rgba(15, 23, 38, .25);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.02em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.container { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.accent { color: var(--accent); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: .95rem; border: 1px solid transparent;
  cursor: pointer; font-family: inherit;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px var(--accent); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn--small { padding: 8px 16px; font-size: .88rem; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-right: auto; }
.logo__mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  font-size: .85rem; font-weight: 800;
}
.logo__text { font-family: var(--mono); font-size: .95rem; }
.nav__links { display: flex; align-items: center; gap: 28px; font-size: .93rem; }
.nav__links a:not(.btn) { color: var(--muted); transition: color .2s; }
.nav__links a:not(.btn):hover, .nav__links a.active { color: var(--text); }
.nav__toggle { display: none; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  filter: blur(20px); pointer-events: none;
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px;
  padding: 6px 14px; border-radius: 999px; font-size: .85rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; margin-bottom: 20px; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 20px; color: var(--muted); font-size: .9rem; }
.hero__meta li { display: flex; align-items: center; gap: 8px; }

.code {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transform: rotate(1.2deg);
}
.code__bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.code__bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.code__bar span:nth-child(2) { background: #febc2e; }
.code__bar span:nth-child(3) { background: #28c840; }
.code__bar em { margin-left: 10px; font-style: normal; font-family: var(--mono); font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code pre { margin: 0; padding: 20px; font-family: var(--mono); font-size: .82rem; line-height: 1.7; overflow-x: auto; color: var(--text); }
.code .k { color: #c792ea; }
.code .c { color: #ffcb6b; }
.code .f { color: #82aaff; }
.code .s { color: var(--accent); }
:root[data-theme="light"] .code .k { color: #8a3fc7; }
:root[data-theme="light"] .code .c { color: #b26a00; }
:root[data-theme="light"] .code .f { color: #2c5fd6; }

.stats {
  margin-top: 64px; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.stats li { padding: 24px; text-align: center; border-left: 1px solid var(--border); }
.stats li:first-child { border-left: 0; }
.stats strong { display: block; font-size: 2rem; font-weight: 800; color: var(--accent); }
.stats span { color: var(--muted); font-size: .88rem; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { margin-bottom: 48px; }
.kicker { font-family: var(--mono); font-size: .85rem; color: var(--accent); margin: 0 0 10px; }
.section h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 800; max-width: 22ch; }

/* About */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; }
.about__body p { color: var(--muted); margin: 0 0 16px; }
.about__body strong { color: var(--text); font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.pills li { padding: 8px 16px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; font-size: .88rem; }

.about__photo { margin: 32px 0 0; max-width: 340px; position: relative; }
.about__photo::after { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--accent); border-radius: var(--radius); z-index: -1; }
.about__photo img { width: 100%; height: auto; border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; object-position: 50% 15%; background: var(--surface); }
.about__head { position: relative; z-index: 0; }
.socials { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 24px; font-weight: 600; font-size: .93rem; }
.socials a { color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.socials a:hover { color: var(--accent); border-color: var(--accent); }

/* Projects */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.project {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .25s, transform .25s;
}
.project:hover { border-color: var(--accent); transform: translateY(-4px); }
.project__img { aspect-ratio: 16 / 10; background: #fff; overflow: hidden; border-bottom: 1px solid var(--border); }
.project__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s; }
.project:hover .project__img img { transform: scale(1.04); }
.project__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.project__body h3 { font-size: 1.1rem; }
.project__body p { color: var(--muted); font-size: .93rem; margin: 10px 0 0; }
.project__body .chips { margin-top: 14px; }
.project__link { margin-top: auto; padding-top: 16px; color: var(--accent); font-weight: 600; font-size: .9rem; }
.project__link:hover { text-decoration: underline; }

/* Timeline */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 200px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.job { display: grid; grid-template-columns: 200px 1fr; gap: 40px; position: relative; padding-bottom: 32px; }
.job:last-child { padding-bottom: 0; }
.job::before {
  content: ""; position: absolute; left: 194px; top: 10px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--accent);
}
.job__when { text-align: right; padding-right: 24px; padding-top: 4px; }
.job__when span { display: block; font-weight: 600; font-size: .93rem; }
.job__when em { font-style: normal; color: var(--muted); font-size: .85rem; }
.job__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
  transition: border-color .25s, transform .25s;
}
.job__card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-2px); }
.job__card h3 { font-size: 1.25rem; }
.job__org { margin: 4px 0 16px; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.tag { font-size: .72rem; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.tag--live { background: var(--accent); color: var(--accent-ink); }
.job__points li { position: relative; padding-left: 20px; margin-bottom: 10px; color: var(--muted); font-size: .96rem; }
.job__points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.job__points strong { color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips li { font-family: var(--mono); font-size: .76rem; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.chips--lg li { font-size: .85rem; padding: 7px 12px; color: var(--text); }

/* Certifications */
.certs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cert {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  transition: border-color .25s, transform .25s;
}
.cert:hover { border-color: var(--accent); transform: translateY(-3px); }
.cert--featured { grid-column: 1 / -1; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface)); }
.cert h3 { font-size: 1.05rem; }
.cert__meta { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.cert__badge {
  flex-shrink: 0; display: grid; place-items: center; min-width: 84px; height: 84px; padding: 0 10px; border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  font-weight: 800; font-size: .88rem; font-family: var(--mono); text-align: center;
}
.cert__badge--alt { background: linear-gradient(135deg, #7c8cff, #c792ea); color: #fff; }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.skill-group h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 12px; }
.ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: .9rem; font-family: var(--mono); }

/* Education */
.edu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.edu__note { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.edu__card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; border-top: 3px solid var(--accent); }
.edu__years { font-family: var(--mono); font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
.edu__card h3 { font-size: 1.15rem; }
.edu__org { margin: 6px 0 0; color: var(--accent); font-weight: 600; }
.edu__grade { margin: 12px 0 0; display: inline-block; font-size: .82rem; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }

/* Contact */
.section--contact { text-align: center; background: radial-gradient(60% 80% at 50% 100%, color-mix(in srgb, var(--accent) 14%, transparent), transparent), var(--bg); }
.contact h2 { margin-inline: auto; max-width: 20ch; }
.contact .lead { margin: 18px auto 32px; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; }
.footer p { margin: 0; }
.footer a:hover { color: var(--accent); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__inner, .about { grid-template-columns: 1fr; }
  .hero__card { max-width: 520px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--border); }
  .timeline::before { left: 6px; }
  .job { grid-template-columns: 1fr; gap: 12px; padding-left: 32px; }
  .job::before { left: 0; }
  .job__when { text-align: left; padding: 0; }
  .certs, .skills, .edu { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav__toggle {
    display: grid; gap: 5px; width: 38px; height: 38px; place-content: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  }
  .nav__toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
    display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links li a:not(.btn) { display: block; padding: 12px 0; }
  .nav__links .btn { justify-content: center; margin-top: 8px; }
  .nav__inner { gap: 10px; }
  .hero { padding-top: 48px; }
  .section { padding: 72px 0; }
  .cert { flex-direction: column; }
  .footer__inner { flex-direction: column; align-items: center; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .stats li { border-left: 0 !important; }
  .stats li + li { border-top: 1px solid var(--border); }
  .code pre { font-size: .74rem; }
}
