:root {
  --bg: #06080f;
  --bg-alt: #0a0e1a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf5;
  --text-dim: #8a93a8;
  --cyan: #22d3ee;
  --purple: #a855f7;
  --pink: #f472b6;
  --gradient: linear-gradient(120deg, var(--cyan), var(--purple));
  --font-head: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --max-w: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

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

::selection { background: var(--purple); color: #fff; }

/* Background decor */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  z-index: -1;
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  pointer-events: none;
}
.bg-glow--one { top: -10%; left: -10%; background: var(--cyan); }
.bg-glow--two { bottom: 0; right: -15%; background: var(--purple); opacity: 0.2; }

/* Progress bar */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 999;
  transition: width 0.1s ease-out;
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(6, 8, 15, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled {
  border-bottom-color: var(--surface-border);
  background: rgba(6, 8, 15, 0.85);
}
.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}
.nav__brand-dot { color: var(--cyan); }
.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav__link {
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
  position: relative;
}
.nav__link:hover { color: var(--text); }
.nav__link--cta {
  color: var(--bg);
  background: var(--gradient);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
}
.nav__link--cta:hover { color: var(--bg); opacity: 0.9; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 1.5rem 4rem;
  position: relative;
}
.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}
.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
.hero__title {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}
.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--cyan);
  min-height: 1.8rem;
  margin-bottom: 1.4rem;
}
.cursor { animation: blink 1s step-start infinite; color: var(--purple); }
@keyframes blink { 50% { opacity: 0; } }

.hero__desc {
  max-width: 46ch;
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2.2rem;
}
.hero__cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn--primary {
  background: var(--gradient);
  color: #06080f;
  box-shadow: 0 8px 30px -8px rgba(168, 85, 247, 0.5);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px -6px rgba(168, 85, 247, 0.6); }
.btn--ghost {
  border: 1px solid var(--surface-border);
  color: var(--text);
  background: var(--surface);
}
.btn--ghost:hover { border-color: var(--cyan); color: var(--cyan); transform: translateY(-2px); }

/* Avatar */
.hero__avatar-wrap { display: flex; justify-content: center; }
.avatar-ring {
  position: relative;
  width: 260px;
  height: 260px;
}
.avatar-ring::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--cyan), var(--purple), var(--pink), var(--cyan));
  animation: spin 8s linear infinite;
  filter: blur(2px);
}
.avatar-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--bg);
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #1a2035, #060810);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 1px solid var(--surface-border);
}
.avatar span {
  font-family: var(--font-head);
  font-size: 3.2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.avatar-badge {
  position: absolute;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--surface-border);
  color: var(--cyan);
  font-size: 1.1rem;
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 10px 25px -10px rgba(0,0,0,0.6);
}
.avatar-badge--1 { top: -6px; left: -6px; animation-delay: 0s; color: var(--cyan); }
.avatar-badge--2 { top: 10%; right: -18px; animation-delay: 0.6s; color: var(--purple); }
.avatar-badge--3 { bottom: 6%; left: -20px; animation-delay: 1.2s; color: var(--pink); }
.avatar-badge--4 { bottom: -8px; right: 6%; animation-delay: 1.8s; color: var(--cyan); }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
  animation: float 2.4s ease-in-out infinite;
}

/* Sections */
.section { padding: 7rem 1.5rem; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015), transparent); }
.section__inner { max-width: var(--max-w); margin: 0 auto; }
.section__eyebrow {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
}
.section__title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 1.6rem;
}
.section__lead {
  color: var(--text-dim);
  max-width: 60ch;
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

/* About */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about__text p {
  color: var(--text-dim);
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
}
.about__text strong { color: var(--text); }

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 1.4rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--cyan); }
.stat-card__num {
  font-family: var(--font-head);
  font-size: 2.1rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-card__suffix {
  font-family: var(--font-head);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--cyan);
}
.stat-card__label {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 0.3rem;
}
.stat-card--wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.stat-card--wide i { font-size: 1.5rem; color: var(--purple); }
.stat-card--wide .stat-card__label { margin: 0; color: var(--text); font-weight: 600; font-size: 0.95rem; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2.2rem;
  border-left: 2px solid var(--surface-border);
}
.timeline__item {
  position: relative;
  padding-bottom: 2.6rem;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: -2.55rem;
  top: 0.4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}
.timeline__card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 1.6rem 1.8rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.timeline__card:hover { transform: translateX(4px); border-color: var(--purple); }
.timeline__period {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--purple);
}
.timeline__card h3 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  margin: 0.3rem 0 0.1rem;
}
.timeline__role {
  color: var(--cyan);
  font-size: 0.92rem;
  margin-bottom: 0.7rem;
}
.timeline__card p:not(.timeline__role) { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 0.9rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--cyan);
}

/* Skills */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}
.skills__group {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.skills__group:hover { transform: translateY(-4px); border-color: var(--cyan); }
.skills__group h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-head);
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.skills__group h4 i { color: var(--purple); }

/* Traits */
.traits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}
.trait-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 1.8rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.trait-card:hover { transform: translateY(-4px); border-color: var(--pink); }
.trait-card i {
  font-size: 1.6rem;
  color: var(--pink);
  margin-bottom: 1rem;
  display: block;
}
.trait-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.trait-card p { color: var(--text-dim); font-size: 0.92rem; }

/* Contact */
.contact__inner { text-align: center; }
.contact .section__lead { margin-left: auto; margin-right: auto; }
.contact__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.contact-link i { color: var(--cyan); font-size: 1.1rem; }
.contact-link:hover {
  transform: translateY(-3px);
  border-color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--surface-border);
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 1.8rem;
  right: 1.8rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 90;
  box-shadow: 0 8px 24px -6px rgba(168, 85, 247, 0.6);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__desc { margin-left: auto; margin-right: auto; }
  .hero__cta { justify-content: center; }
  .hero__eyebrow { justify-content: center; }
  .about__grid { grid-template-columns: 1fr; }
  .nav__links {
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: rgba(6, 8, 15, 0.97);
    backdrop-filter: blur(14px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--surface-border);
    transform: translateY(-130%);
    transition: transform 0.3s ease;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__toggle { display: flex; }
}

@media (max-width: 480px) {
  .avatar-ring { width: 200px; height: 200px; }
  .avatar span { font-size: 2.4rem; }
}
