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

:root {
  --bg: #050510;
  --bg2: #0a0a1a;
  --primary: #7c3aed;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --glass: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.1);
  --glow-purple: rgba(124,58,237,0.4);
  --glow-cyan: rgba(6,182,212,0.4);
  --radius: 16px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  cursor: none;
}

/* ===== CUSTOM CURSOR ===== */
body::before {
  content: '';
  position: fixed;
  width: 18px; height: 18px;
  background: radial-gradient(circle, var(--primary), var(--secondary));
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  left: var(--cx, -100px);
  top: var(--cy, -100px);
  transition: width 0.2s, height 0.2s;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ===== GLASS ===== */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(5,5,16,0.75);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: padding 0.3s;
}
.navbar.scrolled { padding: 0.6rem 2.5rem; }
.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.dot { -webkit-text-fill-color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 500; transition: color 0.3s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.hamburger span { width: 25px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

/* ===== HERO ===== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#three-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 2rem; max-width: 800px;
}
.hero-badge {
  display: inline-block; padding: 0.4rem 1.2rem;
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.5);
  border-radius: 50px; font-size: 0.85rem; color: var(--secondary);
  margin-bottom: 1.5rem;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%,100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.4); }
  50%      { box-shadow: 0 0 0 8px rgba(6,182,212,0); }
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800; line-height: 1.1; margin-bottom: 1.2rem;
}
.hero-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-muted); margin-bottom: 2.5rem; min-height: 2rem;
}
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  padding: 0.8rem 2rem; border-radius: 50px;
  font-size: 0.95rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: none; transition: all 0.3s; display: inline-block;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff; box-shadow: 0 0 20px var(--glow-purple);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 40px var(--glow-purple), 0 0 60px var(--glow-cyan); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--glass-border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px); box-shadow: 0 0 20px var(--glow-purple); }
.hero-gradient-orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 1; }
.orb1 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(124,58,237,0.3), transparent); top: -100px; left: -100px; animation: float-orb 8s ease-in-out infinite; }
.orb2 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(6,182,212,0.25), transparent); bottom: -100px; right: -100px; animation: float-orb 10s ease-in-out infinite reverse; }
@keyframes float-orb { 0%,100% { transform: translate(0,0); } 50% { transform: translate(40px,40px); } }
.hero-scroll-hint { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); z-index: 2; }
.scroll-arrow { width: 24px; height: 24px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); animation: bounce-arrow 1.5s infinite; }
@keyframes bounce-arrow { 0%,100% { transform: rotate(45deg) translateY(0); opacity: 1; } 50% { transform: rotate(45deg) translateY(8px); opacity: 0.4; } }

/* ===== SECTIONS ===== */
.section { padding: 6rem 0; position: relative; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; text-align: center; margin-bottom: 3.5rem; }

/* ===== ABOUT ===== */
.about { background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%); }
.about-card { display: flex; gap: 3rem; align-items: center; padding: 3rem; flex-wrap: wrap; }

/* Avatar GIF */
.about-avatar-wrap {
  position: relative; flex-shrink: 0;
  width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.avatar-glow-ring {
  position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(var(--primary), var(--secondary), var(--primary));
  animation: spin-ring 4s linear infinite;
  filter: blur(6px); opacity: 0.7;
}
@keyframes spin-ring { to { transform: rotate(360deg); } }
.avatar-gif {
  width: 180px; height: 180px;
  border-radius: 50%; object-fit: cover;
  position: relative; z-index: 1;
  border: 3px solid rgba(255,255,255,0.1);
}
.avatar-fallback {
  display: none;
  width: 180px; height: 180px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 800; color: #fff;
  position: relative; z-index: 1;
}

.about-info h3 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.role { color: var(--secondary); font-size: 1rem; margin-bottom: 1rem; }
.bio { color: var(--text-muted); line-height: 1.8; margin-bottom: 1.5rem; }
.about-stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat { text-align: center; }
.stat-num {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat span { font-size: 1.5rem; color: var(--secondary); }
.stat p { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.about-social { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.social-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 1rem; border-radius: 50px; font-size: 0.85rem;
  background: rgba(124,58,237,0.12); border: 1px solid rgba(124,58,237,0.3);
  color: var(--text); text-decoration: none; transition: all 0.3s;
}
.social-link svg { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; }
.social-link:hover { background: rgba(124,58,237,0.28); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(124,58,237,0.3); }

/* ===== SKILLS ===== */
.skills { background: var(--bg2); }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; }
.skill-card {
  padding: 1.5rem; text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative; overflow: hidden;
}
.skill-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(6,182,212,0.1));
  opacity: 0; transition: opacity 0.3s;
}
.skill-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(124,58,237,0.2); }
.skill-card:hover::before { opacity: 1; }
.skill-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.skill-card h4 { font-size: 1rem; margin-bottom: 1rem; }
.skill-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.skill-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px var(--glow-cyan);
}

/* Skeleton loaders */
.skill-skeleton, .project-skeleton {
  border-radius: var(--radius);
  animation: shimmer 1.5s infinite;
}
.skill-skeleton { height: 140px; }
.project-skeleton { height: 220px; }
@keyframes shimmer {
  0%   { background: rgba(255,255,255,0.04); }
  50%  { background: rgba(255,255,255,0.08); }
  100% { background: rgba(255,255,255,0.04); }
}

/* ===== PROJECTS ===== */
.projects { background: var(--bg); }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 2rem; }
.project-card {
  padding: 2rem; position: relative; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s; cursor: pointer;
}
.project-glow {
  position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(circle at 50% 0%, rgba(124,58,237,0.15), transparent 70%);
  transition: opacity 0.4s;
}
.project-card:hover { transform: translateY(-8px); box-shadow: 0 30px 60px rgba(124,58,237,0.2); }
.project-card:hover .project-glow { opacity: 1; }
.project-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.project-tag {
  font-size: 0.75rem; color: var(--secondary);
  background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.3);
  padding: 0.2rem 0.8rem; border-radius: 50px;
}
.project-links { display: flex; gap: 0.8rem; }
.icon-link { color: var(--text-muted); text-decoration: none; font-size: 1.2rem; transition: color 0.3s; }
.icon-link:hover { color: var(--primary); }
.project-card h3 { font-size: 1.3rem; margin-bottom: 0.8rem; }
.project-card p { color: var(--text-muted); line-height: 1.7; margin-bottom: 1.2rem; font-size: 0.9rem; }
.project-tech { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.project-tech span {
  font-size: 0.75rem; padding: 0.2rem 0.7rem;
  background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3);
  border-radius: 50px; color: var(--primary);
}

/* ===== TERMINAL ===== */
.terminal-section { background: var(--bg2); }
.terminal { max-width: 700px; margin: 0 auto; overflow: hidden; }
.terminal-header {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid var(--glass-border);
}
.t-btn { width: 12px; height: 12px; border-radius: 50%; }
.t-btn.red { background: #ff5f57; }
.t-btn.yellow { background: #febc2e; }
.t-btn.green { background: #28c840; }
.t-title { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--text-muted); margin-left: 0.5rem; }
.terminal-body { padding: 1.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; line-height: 2; min-height: 280px; }
.t-line { display: flex; gap: 0.5rem; }
.prompt { color: var(--secondary); }
.cmd { color: var(--text); }
.t-output { color: #a3e635; padding-left: 1rem; white-space: pre-wrap; }
.t-cursor { display: inline-block; color: var(--secondary); animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ===== CONTACT ===== */
.contact { background: var(--bg); }
.contact-sub { text-align: center; color: var(--text-muted); margin-top: -2rem; margin-bottom: 3rem; }
.contact-grid { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 3rem; }
.contact-card {
  padding: 2rem; text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; width: 200px;
}
.contact-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(124,58,237,0.3); border-color: rgba(124,58,237,0.5); }
.contact-icon { margin-bottom: 0.8rem; display: flex; justify-content: center; }
.contact-icon svg { width: 48px; height: 48px; border-radius: 10px; transition: transform 0.3s, filter 0.3s; }
.contact-card:hover .contact-icon svg { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(124,58,237,0.6)); }
.contact-card h4 { margin-bottom: 0.4rem; }
.contact-card p { color: var(--text-muted); font-size: 0.85rem; }
.contact-form { padding: 2.5rem; max-width: 700px; margin: 0 auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: 0.9rem 1.2rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px; color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
  outline: none; transition: border-color 0.3s, box-shadow 0.3s;
  margin-bottom: 1rem;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
.contact-form textarea { resize: vertical; }
.contact-form .btn { width: 100%; font-size: 1rem; }
.form-status { text-align: center; margin-top: 1rem; font-size: 0.9rem; min-height: 1.4rem; }
.form-status.success { color: #10b981; }
.form-status.error   { color: #ef4444; }

/* ===== FOOTER ===== */
.footer { text-align: center; padding: 2rem; border-top: 1px solid var(--glass-border); color: var(--text-muted); font-size: 0.9rem; }
.api-status { margin-top: 0.5rem; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }
.api-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.api-dot.online  { background: #10b981; box-shadow: 0 0 6px #10b981; animation: pulse-dot 2s infinite; }
.api-dot.offline { background: #ef4444; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: rgba(5,5,16,0.95); padding: 1.5rem 2rem; border-bottom: 1px solid var(--glass-border); }
  .about-card { flex-direction: column; text-align: center; }
  .about-stats { justify-content: center; }
  .about-social { justify-content: center; }
  .projects-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
