/* =========================================
   1. FONTS & RESET
   ========================================= */
* {
  font-family: 'Inter', sans-serif;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* =========================================
   2. THEME VARIABLES
   ========================================= */
/* Dark Mode (Default) */
:root {
  --bg-primary: #0b1121; /* Updated to match Tech Background */
  --bg-secondary: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.06);
  --card-bg: rgba(255, 255, 255, 0.02);
}

/* Light Mode */
.light-mode {
  --bg-primary: #fafafa;
  --bg-secondary: #f4f4f5;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --glass-bg: rgba(0, 0, 0, 0.02);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-strong: rgba(0, 0, 0, 0.04);
  --card-bg: rgba(255, 255, 255, 0.8);
}

/* =========================================
   3. BODY & BACKGROUND ANIMATION SETUP
   ========================================= */
html, body {
  width: 100%;
  max-width: 100%; /* Strict width control */
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Ensures no horizontal scroll on mobile */
  position: relative;
}

body {
  /* Tech Background Base */
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.5s ease;

  /* Subtle Tech Grid Overlay */
  background-image: 
    linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.9)),
    repeating-linear-gradient(0deg, transparent, transparent 1px, #1e293b 1px, #1e293b 2px),
    repeating-linear-gradient(90deg, transparent, transparent 1px, #1e293b 1px, #1e293b 2px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
}

/* Canvas for Particles */
#techCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none; /* Allows clicking through canvas */
}

/* Light Mode Override for Background */
.light-mode body {
  background: linear-gradient(135deg, #ffffff 0%, #f4f4f5 50%, #ffffff 100%);
  background-image: none; /* Remove grid in light mode for cleaner look */
}

/* =========================================
   4. GLASS & UTILITY CLASSES
   ========================================= */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.glass-strong {
  background: var(--glass-strong);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.light-mode .glass-strong {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glow-purple {
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.3), 0 0 80px rgba(124, 58, 237, 0.1);
}

.light-mode .glow-purple {
  box-shadow: 0 4px 40px rgba(124, 58, 237, 0.15);
}

.glow-cyan {
  box-shadow: 0 0 40px rgba(6, 182, 212, 0.3), 0 0 80px rgba(6, 182, 212, 0.1);
}

.light-mode .glow-cyan {
  box-shadow: 0 4px 40px rgba(6, 182, 212, 0.15);
}

.text-gradient {
  background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-adaptive { color: var(--text-primary); }
.text-adaptive-secondary { color: var(--text-secondary); }
.text-adaptive-muted { color: var(--text-muted); }

/* =========================================
   5. NAVIGATION
   ========================================= */
nav {
  width: 100%;
  z-index: 50;
  /* No overflow hidden here to allow mobile menu to show */
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Theme Toggle */
.theme-toggle {
  position: relative;
  width: 50px;
  height: 26px;
  border-radius: 15px;
  background: linear-gradient(135deg, #1a1a2e 0%, #0a0a0f 100%);
  cursor: pointer;
  transition: all 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .theme-toggle {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-toggle-circle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #7c3aed;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.light-mode .theme-toggle-circle {
  left: 26px;
  background: #ffffff;
}

/* =========================================
   6. ANIMATIONS & EFFECTS
   ========================================= */
/* Hover Effects */
.hover-lift { transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.hover-lift:hover { transform: translateY(-10px) scale(1.02); }

.hover-rotate { transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.hover-rotate:hover { transform: rotate(5deg) scale(1.05); }

.hover-glow { transition: all 0.4s ease; }
.hover-glow:hover { box-shadow: 0 0 50px rgba(124, 58, 237, 0.5), 0 0 100px rgba(6, 182, 212, 0.3); }

.hover-scale { transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.hover-scale:hover { transform: scale(1.1); }

.hover-tilt { transition: all 0.3s ease; transform-style: preserve-3d; }

.tech-icon { transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.tech-icon:hover { 
  transform: translateY(-12px) rotate(5deg);
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.4); 
}

/* Entry Animations */
.slide-up { opacity: 0; transform: translateY(60px); }
.slide-left { opacity: 0; transform: translateX(-60px); }
.slide-right { opacity: 0; transform: translateX(60px); }
.scale-in { opacity: 0; transform: scale(0.8); }

/* Floating Animation */
.float-animation { animation: floatElement 6s ease-in-out infinite; }
@keyframes floatElement {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Cursor Glow */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
}
.light-mode .cursor-glow {
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
}

/* =========================================
   7. SPECIFIC COMPONENTS
   ========================================= */
/* Timeline */
.timeline-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, #7c3aed 0%, #06b6d4 100%);
  opacity: 0.3;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  border: 3px solid var(--bg-primary);
  z-index: 10;
}

/* Project Carousel */
.carousel-container {
  position: relative;
  /* width and height are handled by Tailwind classes in HTML */
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
}

.carousel-track img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Stats Numbers */
.stat-number {
  background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Inter', sans-serif;
}

/* Mobile Menu specific fix */
#mobileMenu {
  position: fixed; /* Taaki scroll karne par menu sath rahe */
  top: 64px;       /* Navbar ke theek niche */
  left: 0;
  width: 100%;
  z-index: 999;    /* Sabse upar dikhne ke liye */
  background: var(--bg-primary); /* Phone par readability ke liye solid background */
}

@media (max-width: 640px) {
  /* Hero section ka gap kam karne ke liye */
  #hero {
    padding-top: 5rem !important;
  }
  
  /* Grid ko single column karne ke liye */
  .grid-cols-2, .lg\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  
  /* Stats ko 2 column mein dikhane ke liye */
  .md\:grid-cols-4 {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Image size chhota karne ke liye */
  #tiltCard .w-72, #tiltCard .w-80 {
    width: 260px !important;
    height: 260px !important;
  }
}
