/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a1a;
  --bg-alt: #0f0f25;
  --surface: #161630;
  --surface-hover: #1e1e40;
  --text: #e8eaf6;
  --text-dim: #9899b3;
  --accent: #7c6aff;
  --accent-glow: rgba(124, 106, 255, 0.35);
  --green: #4ade80;
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #a79bff; }

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

/* ===== PARTICLES ===== */
.particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}
.particle {
  position: absolute;
  width: var(--s, 4px); height: var(--s, 4px);
  background: var(--c, rgba(124,106,255,0.4));
  border-radius: 50%;
  animation: particleFloat var(--dur, 20s) linear infinite;
  opacity: 0;
}
@keyframes particleFloat {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== NAV ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10,10,26,0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(124,106,255,0.1);
}
.nav__logo {
  font-weight: 800; font-size: 1.15rem; color: var(--text);
  letter-spacing: -0.02em;
}
.nav__links { display: flex; gap: 1.5rem; }
.nav__links a {
  color: var(--text-dim); font-size: 0.9rem; font-weight: 500;
  transition: color .2s;
}
.nav__links a:hover { color: var(--accent); }

@media (max-width: 600px) {
  .nav { padding: 0.8rem 1rem; }
  .nav__links { gap: 0.8rem; }
  .nav__links a { font-size: 0.8rem; }
}

/* ===== HERO ===== */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 6rem 1.5rem 2rem;
}
.hero__glow {
  position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}
.hero__content { position: relative; }
.hero__avatar {
  position: relative; width: 110px; height: 110px; margin: 0 auto 1.5rem;
}
.hero__avatar-ring {
  position: absolute; inset: -4px;
  border-radius: 50%;
  background: conic-gradient(var(--accent), #ff6bcb, var(--accent));
  animation: spin 4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__avatar-inner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem;
  background: var(--surface); border-radius: 50%;
}
.hero__greeting {
  font-size: 1.1rem; color: var(--accent); font-weight: 600;
  font-family: 'Fira Code', monospace;
  letter-spacing: 0.05em;
}
.hero__name {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, #ff6bcb 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15; margin: 0.3rem 0 0.5rem;
}
.hero__role {
  font-family: 'Fira Code', monospace;
  font-size: 1.15rem; color: var(--text-dim);
  min-height: 1.6em;
}
.cursor {
  display: inline-block; color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__desc {
  font-size: 1.05rem; color: var(--text-dim);
  max-width: 480px; margin: 1rem auto 0;
}
.hero__cta { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }

.hero__scroll { position: absolute; bottom: 2rem; }
.scroll-indicator {
  width: 24px; height: 38px; border: 2px solid var(--text-dim);
  border-radius: 12px; display: flex; justify-content: center; padding-top: 6px;
}
.scroll-dot {
  width: 4px; height: 8px; background: var(--accent); border-radius: 2px;
  animation: scrollDown 1.5s ease-in-out infinite;
}
@keyframes scrollDown {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: 50px; font-weight: 600;
  font-size: 0.95rem; cursor: pointer; border: none;
  transition: all .25s ease;
}
.btn--primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn--primary:hover {
  background: #6a56f0; transform: translateY(-2px);
  box-shadow: 0 6px 30px var(--accent-glow);
  color: #fff;
}
.btn--ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid rgba(255,255,255,0.2);
}
.btn--ghost:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px);
}
.btn--large { padding: 1rem 2.5rem; font-size: 1.05rem; }

/* ===== SECTIONS ===== */
.section {
  position: relative; z-index: 1;
  padding: 6rem 1.5rem;
}
.section--alt { background: var(--bg-alt); }
.container { max-width: 1100px; margin: 0 auto; }

.section__title {
  font-size: 1.8rem; font-weight: 800; margin-bottom: 3rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.section__number {
  font-family: 'Fira Code', monospace; font-size: 1rem;
  color: var(--accent); font-weight: 500;
}

/* ===== ABOUT ===== */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.about__text p { color: var(--text-dim); margin-bottom: 1rem; font-size: 1.05rem; }
.about__facts { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.fact {
  display: flex; align-items: flex-start; gap: 0.8rem;
  padding: 1rem; background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid rgba(124,106,255,0.1);
  transition: border-color .2s, transform .2s;
}
.fact:hover { border-color: var(--accent); transform: translateX(4px); }
.fact__icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.fact strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.fact p { font-size: 0.85rem; color: var(--text-dim); margin: 0; }

@media (max-width: 768px) {
  .about { grid-template-columns: 1fr; }
}

/* Code block */
.code-block {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(124,106,255,0.15);
  overflow: hidden;
}
.code-block__header {
  display: flex; align-items: center; gap: 6px;
  padding: 0.8rem 1rem; background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot--red { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green { background: #28c840; }
.code-block__title { margin-left: auto; font-size: 0.8rem; color: var(--text-dim); font-family: 'Fira Code', monospace; }
.code-block__code {
  padding: 1.25rem; overflow-x: auto;
  font-family: 'Fira Code', monospace; font-size: 0.88rem;
  line-height: 1.7;
}
.kw { color: #c792ea; }
.var { color: #82aaff; }
.prop { color: #f78c6c; }
.str { color: #c3e88d; }
.num { color: #f78c6c; }

/* ===== SKILLS ===== */
.skills {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.skill-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.5rem; border: 1px solid rgba(255,255,255,0.06);
  transition: transform .25s, border-color .25s, box-shadow .25s;
  cursor: default;
}
.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(124,106,255,0.12);
}
.skill-card__icon { font-size: 2rem; margin-bottom: 0.75rem; }
.skill-card__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.3rem; }
.skill-card__desc { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 1rem; }
.skill-card__bar {
  height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden;
}
.skill-card__fill {
  height: 100%; width: 0; border-radius: 3px;
  background: var(--accent, var(--accent));
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.skill-card__fill.animated { width: var(--w); }

/* ===== PROJECTS ===== */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }

.project-card {
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden; border: 1px solid rgba(255,255,255,0.06);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  cursor: default;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  border-color: var(--accent);
}
.project-card__preview {
  height: 180px; display: flex; align-items: center; justify-content: center;
}
.project-card__emoji { font-size: 3.5rem; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.project-card__info { padding: 1.25rem; }
.project-card__title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.project-card__desc { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 0.8rem; line-height: 1.5; }
.project-card__tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag {
  padding: 0.25rem 0.65rem; font-size: 0.75rem; font-weight: 600;
  background: rgba(124,106,255,0.15); color: var(--accent);
  border-radius: 50px;
}

/* ===== CONTACT ===== */
.contact {
  text-align: center; padding: 2rem 0;
}
.contact__text {
  font-size: 1.2rem; color: var(--text-dim); margin-bottom: 2rem;
}
.contact__links {
  display: flex; justify-content: center; gap: 1.5rem;
  margin-bottom: 2.5rem; flex-wrap: wrap;
}
.contact__link {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.5rem; background: var(--surface);
  border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 500;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all .25s;
}
.contact__link:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-3px); box-shadow: 0 6px 20px rgba(124,106,255,0.15);
}
.contact__icon { font-size: 1.3rem; }

/* ===== FOOTER ===== */
.footer {
  position: relative; z-index: 1;
  text-align: center; padding: 2rem 1rem;
  color: var(--text-dim); font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ===== ANIMATIONS ===== */
.anim-fade-up {
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.7s ease forwards;
  animation-delay: var(--d, 0s);
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1; transform: translateY(0);
}
