/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #000000;
  --bg2: #080808;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --text: #e8e8e8;
  --text-muted: #666;
  --accent: #7c3aed;
  --accent2: #06b6d4;
  --accent3: #f59e0b;
  --glow: rgba(124,58,237,0.3);
  --glow2: rgba(6,182,212,0.2);
  --gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
  --font: 'Space Grotesk', sans-serif;
  --mono: 'Space Mono', monospace;
  --radius: 16px;
  --nav-h: 70px;
}
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  cursor: none;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ===== CURSOR ===== */
#cursor {
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%,-50%);
  transition: transform 0.1s, width 0.2s, height 0.2s, background 0.2s;
}
#cursor-trail {
  width: 36px; height: 36px;
  border: 1px solid rgba(124,58,237,0.5);
  border-radius: 50%;
  position: fixed; top: 0; left: 0;
  pointer-events: none; z-index: 9998;
  transform: translate(-50%,-50%);
  transition: transform 0.15s ease, width 0.3s, height 0.3s;
}
body.hovering #cursor { width: 20px; height: 20px; background: var(--accent2); }
body.hovering #cursor-trail { width: 50px; height: 50px; border-color: var(--accent2); }

/* ===== LOADER ===== */
#loader {
  position: fixed; inset: 0; z-index: 10000;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
#loader-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.loader-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.loader-logo {
  font-family: var(--mono);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.7;transform:scale(0.97)} }
.loader-bar-wrap {
  width: min(300px, 80vw); height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px; overflow: hidden;
}
.loader-bar {
  height: 100%; width: 0%;
  background: var(--gradient);
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px var(--accent);
}
.loader-text {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--text-muted); letter-spacing: 0.15em;
}

/* ===== BG CANVAS ===== */
#bg-canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ===== NAVBAR ===== */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 5vw, 60px);
  z-index: 1000;
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
}
#navbar.scrolled {
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--mono); font-size: 1.4rem; font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.dot { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.nav-links {
  display: flex; gap: 36px; align-items: center;
}
.nav-link {
  font-size: 0.875rem; letter-spacing: 0.05em;
  color: var(--text-muted);
  position: relative; transition: color 0.3s;
}
.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--gradient); transform: scaleX(0);
  transition: transform 0.3s;
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: none; padding: 4px;
}
.nav-toggle span {
  width: 26px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform 0.3s, opacity 0.3s;
  display: block;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== SECTIONS ===== */
.section {
  position: relative; z-index: 1;
  padding: clamp(80px, 12vw, 140px) clamp(20px, 8vw, 120px);
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
}
.section-label {
  font-family: var(--mono); font-size: 0.7rem;
  letter-spacing: 0.2em; color: var(--accent);
  margin-bottom: 20px; text-transform: uppercase;
}
.section-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700; line-height: 1.15;
  margin-bottom: 40px;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ===== HERO ===== */
#hero {
  min-height: 100vh; position: relative; z-index: 1;
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: calc(var(--nav-h) + 40px) clamp(20px, 8vw, 120px) 60px;
  gap: 40px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid rgba(124,58,237,0.4);
  background: rgba(124,58,237,0.1);
  font-size: 0.8rem; color: #a78bfa;
  font-family: var(--mono);
  animation: fadeInUp 0.6s ease forwards;
}
.hero-badge::before {
  content: ''; width: 7px; height: 7px;
  background: #4ade80; border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.hero-name {
  font-size: clamp(2.8rem, 8vw, 7rem);
  font-weight: 700; line-height: 1.05;
  animation: fadeInUp 0.7s 0.1s ease both;
}
.hero-name .line { display: block; }
.hero-roles {
  font-family: var(--mono); font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--accent2);
  animation: fadeInUp 0.7s 0.2s ease both;
  min-height: 2rem;
}
.cursor-blink { animation: blink 0.8s step-end infinite; }
.hero-sub {
  color: var(--text-muted); font-size: 0.95rem;
  animation: fadeInUp 0.7s 0.3s ease both;
  margin-bottom: 32px;
}
.hero-cta {
  display: flex; gap: 16px; flex-wrap: wrap;
  animation: fadeInUp 0.7s 0.4s ease both;
  margin-bottom: 10px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600;
  cursor: none; transition: all 0.3s;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 0 30px rgba(124,58,237,0.3);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 40px rgba(124,58,237,0.5); }
.btn-outline {
  border: 1px solid var(--border); color: var(--text);
  background: var(--surface);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.hero-scroll-hint {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 0.8rem;
  animation: fadeInUp 0.7s 0.5s ease both;
}
.scroll-line {
  width: 40px; height: 1px; background: var(--text-muted);
  position: relative; overflow: hidden;
}
.scroll-line::after {
  content: ''; position: absolute; inset: 0;
  background: var(--accent);
  animation: scrollSlide 1.5s ease-in-out infinite;
}
@keyframes scrollSlide { 0%{transform:translateX(-100%)} 100%{transform:translateX(200%)} }
.hero-stats {
  display: flex; gap: 20px; flex-wrap: wrap;
  animation: fadeInUp 0.7s 0.6s ease both;
}
.stat-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, transform 0.3s;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.stat-num {
  font-family: var(--mono); font-size: 1.8rem; font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

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

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: center;
}
.about-text p { color: var(--text-muted); line-height: 1.8; margin-bottom: 20px; }
.about-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.tag {
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-muted);
  background: var(--surface);
  transition: border-color 0.3s, color 0.3s;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.about-card {
  position: relative; padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  backdrop-filter: blur(20px);
}
.card-glow {
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: var(--glow); border-radius: 50%;
  filter: blur(60px); pointer-events: none;
}
.about-avatar {
  width: 80px; height: 80px; border-radius: 20px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 1.6rem; font-weight: 700;
  color: #fff; margin-bottom: 28px;
  overflow: hidden;
}
.about-avatar img { width: 100%; height: 100%; object-fit: cover; }
.info-row {
  display: flex; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  gap: 16px;
}
.info-row:last-child { border-bottom: none; }
.info-key { color: var(--text-muted); flex-shrink: 0; }
.info-val { color: var(--text); text-align: right; }

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, transform 0.3s;
}
.skill-category:hover { border-color: rgba(124,58,237,0.4); transform: translateY(-4px); }
.skill-cat-icon { font-size: 2rem; margin-bottom: 12px; display: flex; align-items: center; }
.skill-cat-icon img { width: 36px; height: 36px; object-fit: contain; }
.skill-category h3 { font-size: 1rem; margin-bottom: 24px; color: var(--text); }
.skill-list { display: flex; flex-direction: column; gap: 16px; }
.skill-item span { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 6px; }
.skill-bar { height: 3px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.skill-fill { height: 100%; width: 0; border-radius: 3px; background: var(--gradient); transition: width 1.2s cubic-bezier(0.16,1,0.3,1); }

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  backdrop-filter: blur(10px);
  cursor: none;
  transition: border-color 0.4s, transform 0.4s;
}
.project-card:hover { border-color: rgba(124,58,237,0.5); transform: translateY(-6px); }
.project-glow {
  position: absolute; top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: var(--glow); border-radius: 50%;
  filter: blur(80px);
  opacity: 0; transition: opacity 0.4s;
  pointer-events: none;
}
.project-card:hover .project-glow { opacity: 1; }
.project-num {
  font-family: var(--mono); font-size: 0.75rem;
  color: var(--text-muted); margin-bottom: 16px;
  letter-spacing: 0.1em;
}
.project-content h3 {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 12px;
}
.project-content p {
  color: var(--text-muted); font-size: 0.9rem; line-height: 1.7;
  margin-bottom: 20px;
}
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.project-tags span {
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem; color: var(--accent2);
  background: rgba(6,182,212,0.06);
}
.project-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.875rem; font-weight: 600; color: var(--accent);
  transition: gap 0.3s;
}
.project-link:hover { gap: 10px; }
.project-link svg { width: 16px; height: 16px; transition: transform 0.3s; }
.project-link:hover svg { transform: translate(3px,-3px); }
.project-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.04), transparent);
  pointer-events: none;
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative; padding-left: 32px;
  display: flex; flex-direction: column; gap: 0;
}
.timeline::before {
  content: ''; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 1px; background: var(--border);
}
.timeline-item {
  position: relative; padding-left: 36px; padding-bottom: 48px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; left: -37px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  border: 2px solid #000;
}
.timeline-period {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--accent2); letter-spacing: 0.1em;
  margin-bottom: 8px; text-transform: uppercase;
}
.timeline-content h3 { font-size: 1.2rem; margin-bottom: 10px; }
.timeline-content p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; margin-bottom: 14px; }
.timeline-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline-tags span {
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text-muted);
}

/* ===== CONTACT ===== */
.contact-wrap {
  text-align: center;
  max-width: 700px; margin: 0 auto;
}
.contact-sub {
  color: var(--text-muted); margin-bottom: 48px;
  font-size: 1rem; line-height: 1.7;
}
.contact-links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem; font-weight: 600;
  transition: all 0.3s; cursor: none;
}
.contact-btn svg { width: 18px; height: 18px; }
.contact-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(124,58,237,0.1);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(124,58,237,0.15);
}

/* ===== FOOTER ===== */
#footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px clamp(20px, 8vw, 120px);
}
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; text-align: center;
}
.footer-logo {
  font-family: var(--mono); font-size: 1.2rem;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.footer-inner p { font-size: 0.8rem; color: var(--text-muted); }
.license a { color: var(--accent); }

/* ===== REVEAL ANIMATIONS ===== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .nav-links {
    display: none; flex-direction: column;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(30px);
    padding: 24px; gap: 20px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  body { cursor: auto; }
  #cursor, #cursor-trail { display: none; }
}
@media (max-width: 480px) {
  .hero-name { font-size: clamp(2rem, 10vw, 4rem); }
  .hero-cta { flex-direction: column; }
  .hero-stats { gap: 12px; }
  .stat-card { padding: 12px 18px; }
  .contact-links { flex-direction: column; align-items: center; }
}
