:root {
  --bg: #0b0f14;
  --bg-2: #0f141b;
  --panel: #121922;
  --panel-2: #161e29;
  --border: #1f2935;
  --border-2: #2a3848;
  --text: #e6edf3;
  --text-dim: #9aa7b5;
  --text-mute: #6b7785;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --accent-warm: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-lg: 0 30px 80px -30px rgba(0,0,0,.6), 0 8px 24px -12px rgba(0,0,0,.4);
  --shadow-md: 0 12px 30px -18px rgba(0,0,0,.6);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --max: 1180px;
  --pad: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(94,234,212,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(56,189,248,.05), transparent 60%),
    var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(94,234,212,.35); color: #fff; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #022; padding: 10px 14px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { left: 16px; top: 16px; z-index: 100; }

/* ============== NAV ============== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(11,15,20,.7);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); background: rgba(11,15,20,.85); }

.nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.nav__brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.nav__mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04211c; font-weight: 800; letter-spacing: .5px;
}
.nav__name { font-size: 15px; }

.nav__links { display: flex; gap: 6px; }
.nav__links a {
  padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--text-dim);
  transition: color .2s ease, background .2s ease;
}
.nav__links a:hover { color: var(--text); background: rgba(255,255,255,.04); }

.nav__toggle {
  display: none; background: transparent; border: 1px solid var(--border); border-radius: 8px;
  width: 40px; height: 40px; padding: 8px; cursor: pointer;
}
.nav__toggle span { display: block; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav__mobile { display: none; flex-direction: column; padding: 8px var(--pad) 16px; gap: 4px; border-top: 1px solid var(--border); }
.nav__mobile a { padding: 10px 12px; border-radius: 8px; color: var(--text-dim); }
.nav__mobile a:hover { color: var(--text); background: rgba(255,255,255,.04); }

/* ============== HERO ============== */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--pad) clamp(40px, 6vw, 80px);
}
.hero__grid {
  display: grid; gap: clamp(32px, 5vw, 56px);
  grid-template-columns: 1.15fr .85fr; align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim); margin: 0 0 18px;
  font-family: var(--font-mono);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(94,234,212,.18);
  animation: pulse 2s infinite ease-in-out;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(94,234,212,0); } }

.hero__title {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0 0 18px;
  font-weight: 800;
}
.grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 50%, var(--accent-warm));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero__lede {
  font-size: clamp(16px, 1.4vw, 18px); color: var(--text-dim); max-width: 58ch; margin: 0 0 28px;
}
.hero__lede strong { color: var(--text); font-weight: 600; }

.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04211c;
}
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost {
  background: transparent; color: var(--text); border-color: var(--border-2);
}
.btn--ghost:hover { background: rgba(255,255,255,.04); border-color: #3a4a5e; }

.hero__meta {
  list-style: none; padding: 28px 0 0; margin: 28px 0 0;
  border-top: 1px dashed var(--border);
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px;
}
.hero__meta li { font-size: 14px; color: var(--text); }
.hero__meta li span { display: block; color: var(--text-mute); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }

/* hero card */
.hero__card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: perspective(1000px) rotateY(-2deg) rotateX(2deg);
  transition: transform .3s ease;
}
.hero__card:hover { transform: perspective(1000px) rotateY(0) rotateX(0); }
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02);
}
.card__tag { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.card__dots { display: flex; gap: 6px; }
.card__dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3848; display: inline-block; }
.card__dots i:nth-child(1) { background: #f87171; }
.card__dots i:nth-child(2) { background: #fbbf24; }
.card__dots i:nth-child(3) { background: #5eead4; }

.card__code {
  margin: 0; padding: 20px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.card__code .c { color: var(--text-mute); font-style: italic; }
.card__code .k { color: var(--accent-2); font-weight: 600; }
.card__code .s { color: var(--accent-warm); }
.card__code .t { color: var(--accent); }

.card__foot {
  padding: 14px 16px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 6px; background: rgba(255,255,255,.02);
}

/* photo card variant */
.hero__card--photo { padding: 0; }
.photo { position: relative; overflow: hidden; }
.photo img {
  width: 100%; height: auto; aspect-ratio: 1 / 1;
  object-fit: cover; object-position: center 25%;
  display: block;
  background: linear-gradient(180deg, #1a232f, #0f141b);
}
.photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(11,15,20,.85) 100%);
  pointer-events: none;
}
.photo__plate {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  display: flex; align-items: end; justify-content: space-between; gap: 12px;
  z-index: 1;
}
.photo__plate-head { display: flex; flex-direction: column; }
.photo__plate-head strong { font-size: 17px; letter-spacing: -.01em; }
.photo__plate-head span { font-size: 13px; color: var(--text-dim); font-family: var(--font-mono); }
.photo__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(94,234,212,.12); color: var(--accent);
  border: 1px solid rgba(94,234,212,.3);
  font-size: 12px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.photo__badge .dot { width: 7px; height: 7px; }
.pill {
  font-size: 11.5px; font-family: var(--font-mono);
  padding: 4px 9px; border-radius: 999px;
  background: rgba(94,234,212,.08); color: var(--accent);
  border: 1px solid rgba(94,234,212,.2);
}

/* ============== SECTIONS ============== */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(56px, 8vw, 100px) var(--pad);
}
.section__head { margin-bottom: clamp(28px, 4vw, 44px); }
.kicker {
  font-family: var(--font-mono); color: var(--accent);
  font-size: 13px; letter-spacing: .08em; margin: 0 0 10px;
}
.section h2 {
  font-size: clamp(26px, 3.2vw, 38px); margin: 0;
  letter-spacing: -.015em; font-weight: 700; line-height: 1.15;
}

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============== ABOUT ============== */
.about__grid {
  display: grid; gap: clamp(28px, 4vw, 56px);
  grid-template-columns: 1.2fr .8fr; align-items: start;
}
.about__lede {
  font-size: clamp(16px, 1.4vw, 18px); color: var(--text-dim); margin: 0; max-width: 58ch;
}
.stats {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.stats li {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px;
}
.stats strong {
  font-size: 28px; font-weight: 800; letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stats span { font-size: 13px; color: var(--text-dim); }

/* ============== TIMELINE ============== */
.timeline {
  list-style: none; padding: 0; margin: 0;
  position: relative;
}
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(180deg, var(--accent) 0%, transparent 100%);
  opacity: .35;
}
.timeline__item { position: relative; padding-left: 40px; margin-bottom: 36px; }
.timeline__marker {
  position: absolute; left: 4px; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(94,234,212,.12);
}
.timeline__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.timeline__item h3 { margin: 0; font-size: 19px; font-weight: 700; }
.timeline__date { font-family: var(--font-mono); font-size: 13px; color: var(--text-mute); }
.timeline__org { margin: 4px 0 12px; color: var(--accent); font-weight: 500; font-size: 14.5px; }
.timeline__list { margin: 0 0 14px; padding-left: 18px; color: var(--text-dim); }
.timeline__list li { margin-bottom: 6px; }
.timeline__list strong { color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.04); color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ============== PROJECTS ============== */
.cards {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.proj {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.proj:hover { transform: translateY(-4px); border-color: var(--border-2); background: var(--panel-2); }
.proj header { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.proj h3 { margin: 0; font-size: 18px; font-weight: 700; }
.proj__tag { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.proj p { color: var(--text-dim); margin: 0; }
.proj .link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--accent);
  font-weight: 600; font-size: 14px; margin-top: auto;
}
.proj .link svg { width: 16px; height: 16px; transition: transform .2s ease; }
.proj .link:hover svg { transform: translate(2px, -2px); }

/* ============== SKILLS ============== */
.skills {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.skills__group {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.skills__group h3 {
  margin: 0 0 14px; font-size: 14px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent);
}
.skills__group ul { list-style: none; padding: 0; margin: 0; }
.skills__group li {
  padding: 8px 0; border-bottom: 1px solid var(--border); color: var(--text);
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.skills__group li:last-child { border-bottom: 0; }
.skills__group small { color: var(--text-mute); font-size: 12.5px; }

/* ============== CREDENTIALS ============== */
.creds {
  display: grid; gap: clamp(28px, 4vw, 48px);
  grid-template-columns: 1fr 1fr;
}
.creds h3 {
  margin: 0 0 18px; font-size: 14px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent);
}
.edu {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 14px;
}
.edu__row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.edu h4 { margin: 0; font-size: 17px; }
.edu__row span { font-family: var(--font-mono); font-size: 13px; color: var(--text-mute); }
.edu__org { margin: 4px 0 12px; color: var(--accent); font-weight: 500; font-size: 14px; }
.edu ul { margin: 0; padding-left: 18px; color: var(--text-dim); }
.edu li { margin-bottom: 4px; }

.certs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.certs a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: transform .15s ease, border-color .2s ease, background .2s ease;
}
.certs a:hover { border-color: rgba(94,234,212,.4); background: var(--panel-2); transform: translateX(2px); }
.certs span { font-weight: 500; }
.certs small { color: var(--text-mute); font-family: var(--font-mono); font-size: 12px; }

/* ============== CONTACT ============== */
.contact {
  background:
    linear-gradient(180deg, rgba(94,234,212,.04), rgba(56,189,248,.02)),
    var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 48px);
}
.contact__lede { font-size: clamp(16px, 1.4vw, 18px); color: var(--text-dim); margin: 0 0 28px; max-width: 50ch; }
.contact__links {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.contact__link {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
  transition: transform .15s ease, border-color .2s ease, background .2s ease;
}
.contact__link:hover { transform: translateY(-2px); border-color: rgba(94,234,212,.4); background: rgba(94,234,212,.05); }
.contact__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(94,234,212,.15), rgba(56,189,248,.1));
  color: var(--accent); flex-shrink: 0;
}
.contact__icon svg { width: 22px; height: 22px; }
.contact__link strong { display: block; font-size: 14px; }
.contact__link span { color: var(--text-dim); font-size: 13px; font-family: var(--font-mono); }

/* ============== FOOTER ============== */
.foot { border-top: 1px solid var(--border); margin-top: 40px; }
.foot__inner {
  max-width: var(--max); margin: 0 auto; padding: 28px var(--pad);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--text-mute); font-size: 14px; flex-wrap: wrap;
}
.foot__top {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-dim);
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border);
  transition: color .2s ease, border-color .2s ease;
}
.foot__top:hover { color: var(--accent); border-color: rgba(94,234,212,.4); }

/* ============== RESPONSIVE ============== */
@media (max-width: 920px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__card { transform: none; max-width: 560px; }
  .about__grid { grid-template-columns: 1fr; }
  .creds { grid-template-columns: 1fr; }
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav__mobile.is-open { display: flex; }
  .hero__meta { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .timeline__row { flex-direction: column; gap: 2px; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}

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