@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;700&family=Syne:wght@700;800&display=swap');

:root {
  --bg: #080808;
  --bg-card: #111111;
  --bg-card2: #161616;
  --primary: #A855F7;
  --primary-dim: #7C3AED;
  --primary-glow: rgba(168, 85, 247, 0.25);
  --primary-glow-strong: rgba(168, 85, 247, 0.5);
  --text: #F0F0F0;
  --text-muted: #888888;
  --text-dim: #555555;
  --border: rgba(168, 85, 247, 0.2);
  --border-dim: rgba(255,255,255,0.06);
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; }

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

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-dim); border-radius: 2px; }

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 4rem;
  background: rgba(8,8,8,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-dim);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.nav-logo span { color: var(--text-muted); }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--primary);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 8rem 4rem 4rem;
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(168,85,247,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,85,247,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(168,85,247,0.15) 0%, transparent 70%);
  top: -100px; right: -100px;
  animation: orbFloat 8s ease-in-out infinite;
}

.hero-orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(124,58,237,0.1) 0%, transparent 70%);
  bottom: 0; left: -50px;
  animation: orbFloat 10s ease-in-out infinite reverse;
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(168,85,247,0.05);
  animation: fadeSlideDown 0.8s ease both;
}

.hero-tag::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  animation: fadeSlideUp 0.8s 0.2s ease both;
}

.hero-name .glitch {
  position: relative;
  display: inline-block;
  color: var(--text);
}

.hero-name .glitch::before,
.hero-name .glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

.hero-name .glitch::before {
  color: var(--primary);
  animation: glitch1 4s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.hero-name .glitch::after {
  color: #00FFFF;
  animation: glitch2 4s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch1 {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  92% { transform: translate(-3px, 1px); opacity: 0.8; }
  94% { transform: translate(3px, -1px); opacity: 0.8; }
  96% { transform: translate(-2px, 0); opacity: 0.8; }
  98% { transform: translate(0); opacity: 0; }
}

@keyframes glitch2 {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  93% { transform: translate(3px, 2px); opacity: 0.6; }
  95% { transform: translate(-3px, -1px); opacity: 0.6; }
  97% { transform: translate(2px, 0); opacity: 0.6; }
  99% { transform: translate(0); opacity: 0; }
}

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--primary);
  margin-bottom: 1.5rem;
  animation: fadeSlideUp 0.8s 0.4s ease both;
}

.hero-role .cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--primary);
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  animation: fadeSlideUp 0.8s 0.6s ease both;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeSlideUp 0.8s 0.8s ease both;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  box-shadow: 0 0 20px var(--primary-glow);
}

.btn-primary:hover {
  background: #B97EF9;
  box-shadow: 0 0 40px var(--primary-glow-strong);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(168,85,247,0.05);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-dim);
  animation: fadeSlideUp 0.8s 1s ease both;
}

.stat-item { text-align: left; }

.stat-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
}

/* ── SECTION BASE ── */
section {
  padding: 6rem 4rem;
  position: relative;
  z-index: 1;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--primary);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

.section-title span { color: var(--primary); }

.container { max-width: 1100px; margin: 0 auto; }

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

/* ── WORK / EXPERIENCE ── */
#work { background: var(--bg); }

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--primary), transparent);
}

.timeline-item {
  position: relative;
  padding: 2rem 2rem 2rem 2.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  transition: border-color 0.3s, transform 0.3s;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.6rem;
  top: 2.2rem;
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary-glow-strong);
}

.timeline-item:hover {
  border-color: var(--border);
  transform: translateX(6px);
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.job-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.job-company {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.job-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg-card2);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--border-dim);
  white-space: nowrap;
}

.job-bullets {
  list-style: none;
  margin-top: 1rem;
}

.job-bullets li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.3rem 0;
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.6;
}

.job-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 0.7rem;
  top: 0.4rem;
}

/* ── PROJECTS ── */
#projects { background: var(--bg); }

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

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  cursor: pointer;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(168,85,247,0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.project-card:hover {
  border-color: var(--border);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(168,85,247,0.15);
}

.project-card:hover::before { opacity: 1; }

.project-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  filter: grayscale(30%) brightness(0.8);
  transition: filter 0.4s;
}

.project-card:hover .project-img {
  filter: grayscale(0%) brightness(1);
}

.project-body {
  padding: 1.5rem;
}

.project-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--primary);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.project-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── STACK ── */
#stack { background: var(--bg); }

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.stack-item {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stack-item::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.3s;
}

.stack-item:hover {
  border-color: var(--border);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px var(--primary-glow);
}

.stack-item:hover::before { transform: scaleX(1); }

.stack-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.stack-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ── XP BAR (ABOUT) ── */
#about { background: var(--bg); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.xp-bars { display: flex; flex-direction: column; gap: 1.2rem; }

.xp-item {}

.xp-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.xp-skill {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
}

.xp-level {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary);
}

.xp-track {
  height: 6px;
  background: var(--bg-card2);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--border-dim);
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dim), var(--primary));
  border-radius: 100px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 0 8px var(--primary-glow);
}

.xp-fill.animated { width: var(--xp-width); }

/* ── CONTACT ── */
#contact {
  background: var(--bg);
  text-align: center;
}

.contact-box {
  max-width: 600px;
  margin: 0 auto;
  padding: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}

.contact-box::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(168,85,247,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.contact-box h3 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.contact-box p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.contact-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── FOOTER ── */
footer {
  padding: 2rem 4rem;
  border-top: 1px solid var(--border-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--primary); }

/* ── KEYFRAMES ── */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.2rem; }
  .nav-links a { font-size: 0.7rem; }

  section { padding: 4rem 1.5rem; }
  #hero { padding: 7rem 1.5rem 3rem; }

  .hero-name { font-size: clamp(2.8rem, 12vw, 4rem); }
  .hero-stats { gap: 1.5rem; flex-wrap: wrap; }

  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: repeat(3, 1fr); }

  footer { padding: 1.5rem; flex-direction: column; text-align: center; }
}
