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

:root {
  --purple:      #a855f7;
  --purple-dark: #6d28d9;
  --purple-dim:  #a855f720;
  --cyan:        #06b6d4;
  --bg:          #0a0a0f;
  --bg2:         #0f0f1a;
  --bg3:         #13131f;
  --surface:     #1a1a2e;
  --border:      #ffffff12;
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --gradient:    linear-gradient(135deg, var(--purple-dark), var(--purple), var(--cyan));
}

html { scroll-behavior: smooth; }

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

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--purple-dark); border-radius: 999px; }

/* ===== SELECTION ===== */
::selection { background: var(--purple-dim); color: var(--purple); }

/* ===== NAV ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1rem 0;
  transition: all 0.3s ease;
}
#navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.nav-container {
  max-width: 1100px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem; font-weight: 600;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links {
  display: flex; gap: 2rem; list-style: none;
}
.nav-links a {
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute;
  bottom: -4px; left: 0; right: 0; height: 2px;
  background: var(--gradient);
  transform: scaleX(0); transition: transform 0.2s;
  border-radius: 999px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all 0.3s ease;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, #6d28d915 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, #06b6d410 0%, transparent 50%),
              radial-gradient(ellipse at 60% 80%, #a855f710 0%, transparent 40%);
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: 0.15;
  animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 400px; height: 400px; background: var(--purple-dark); top: -10%; left: -10%; animation-delay: 0s; }
.orb-2 { width: 300px; height: 300px; background: var(--cyan); bottom: 10%; right: -5%; animation-delay: -3s; }
.orb-3 { width: 200px; height: 200px; background: var(--purple); top: 60%; left: 40%; animation-delay: -5s; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}
.hero-content {
  position: relative; z-index: 1;
  text-align: center; max-width: 750px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--purple-dim);
  border: 1px solid var(--purple-dark);
  color: var(--purple);
  padding: 0.4rem 1rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 500;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease;
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900; line-height: 1.1;
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s 0.1s ease both;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-family: 'Fira Code', monospace;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-muted); margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s 0.2s ease both;
  min-height: 2em;
}
.typed-text { color: var(--purple); font-weight: 600; }
.typed-cursor {
  color: var(--purple); font-weight: 300;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-desc {
  font-size: 1.05rem; color: var(--text-muted); max-width: 560px;
  margin: 0 auto 2rem;
  animation: fadeInUp 0.6s 0.3s ease both;
}
.highlight { color: var(--text); font-weight: 500; }
.hero-cta {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s 0.4s ease both;
}
.btn {
  padding: 0.8rem 1.8rem; border-radius: 999px;
  font-size: 0.95rem; font-weight: 600;
  transition: all 0.25s ease; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-primary {
  background: var(--gradient); color: white;
  box-shadow: 0 0 30px #a855f740;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 40px #a855f760; }
.btn-outline {
  border: 1px solid var(--purple);
  color: var(--purple); background: transparent;
}
.btn-outline:hover {
  background: var(--purple-dim); transform: translateY(-2px);
}
.hero-socials {
  display: flex; gap: 1rem; justify-content: center;
  animation: fadeInUp 0.6s 0.5s ease both;
}
.social-link {
  width: 42px; height: 42px;
  border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: var(--surface);
  transition: all 0.25s ease;
}
.social-link svg { width: 18px; height: 18px; }
.social-link:hover {
  border-color: var(--purple); color: var(--purple);
  background: var(--purple-dim); transform: translateY(-3px);
  box-shadow: 0 0 15px var(--purple-dim);
}
.scroll-indicator {
  position: absolute; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  animation: fadeIn 1s 1s ease both;
}
.scroll-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--purple);
  animation: scrollBounce 2s ease infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: 0.3; }
}

/* ===== SECTIONS ===== */
.section { padding: 5rem 1.5rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem; color: var(--purple);
  font-weight: 500; display: block; margin-bottom: 0.5rem;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800; margin-bottom: 1rem;
}
.section-sub { color: var(--text-muted); max-width: 500px; margin: 0 auto; }

/* ===== ABOUT ===== */
.about { background: var(--bg2); }
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2rem; align-items: center;
}
.code-card {
  background: var(--bg3);
  border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden;
}
.code-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.code-filename {
  margin-left: auto; font-family: 'Fira Code', monospace;
  font-size: 0.8rem; color: var(--text-muted);
}
.code-block {
  padding: 1.5rem; font-family: 'Fira Code', monospace;
  font-size: 0.85rem; line-height: 1.8;
  overflow-x: auto;
}
.kw { color: #c792ea; }
.var { color: #82aaff; }
.prop { color: #f07178; }
.str { color: #c3e88d; }
.about-text {
  color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem;
}
.about-stats {
  display: flex; gap: 2rem; margin-top: 2rem;
}
.stat-item { text-align: center; }
.stat-num {
  display: inline-block;
  font-size: 2rem; font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  display: block; font-size: 0.8rem;
  color: var(--text-muted); margin-top: 0.25rem;
}

/* ===== SKILLS ===== */
.skills { background: var(--bg); }
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.skill-category {
  background: var(--bg3);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 1.5rem;
  transition: border-color 0.3s, transform 0.3s;
}
.skill-category:hover {
  border-color: var(--purple); transform: translateY(-4px);
}
.skill-cat-title {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 1rem; color: var(--text);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag {
  font-size: 0.78rem; font-weight: 500;
  background: var(--purple-dim);
  color: var(--purple); padding: 0.3rem 0.8rem;
  border-radius: 999px; border: 1px solid var(--purple-dark);
  transition: all 0.2s;
}
.skill-tag:hover {
  background: var(--purple); color: white;
  transform: scale(1.05);
}

/* ===== PROJECTS ===== */
.projects { background: var(--bg2); }
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin-bottom: 2rem;
}
.project-card {
  background: var(--bg3);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease; cursor: default;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.project-card:hover {
  border-color: var(--purple); transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(168, 85, 247, 0.1);
}
.project-card.coming-soon { opacity: 0.6; }
.project-top {
  display: flex; align-items: center; justify-content: space-between;
}
.project-icon { font-size: 2rem; }
.project-links { display: flex; gap: 0.75rem; }
.project-link {
  width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.2s;
}
.project-link svg { width: 16px; height: 16px; }
.project-link:hover {
  border-color: var(--purple); color: var(--purple);
  background: var(--purple-dim);
}
.project-title { font-size: 1.05rem; font-weight: 700; }
.project-desc { font-size: 0.88rem; color: var(--text-muted); flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.project-tags span {
  font-size: 0.75rem; font-family: 'Fira Code', monospace;
  color: var(--purple); background: var(--purple-dim);
  padding: 0.2rem 0.6rem; border-radius: 6px;
}
.projects-cta { text-align: center; }

/* ===== CONTACT ===== */
.contact { background: var(--bg); }
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.contact-card {
  background: var(--bg3);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 2rem 1.5rem; text-align: center;
  transition: all 0.3s; display: block;
}
.contact-card:hover {
  border-color: var(--purple); transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(168, 85, 247, 0.1);
}
.contact-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.contact-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.contact-card p { font-size: 0.85rem; color: var(--text-muted); word-break: break-all; }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem; text-align: center;
}
.footer p { font-size: 0.9rem; color: var(--text-muted); }
.footer a { color: var(--purple); }
.footer-sub { font-size: 0.8rem; margin-top: 0.5rem; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; gap: 1rem; }
  .nav-links.open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(10, 10, 15, 0.97);
    padding: 1.5rem; border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .about-stats { gap: 1rem; }
  .hero-cta { flex-direction: column; align-items: center; }
}
