/* all website */
body {
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1aa;
  --accent-primary: #c9a962;
  --accent-secondary: #8b7355;
  --accent-glow: rgba(201, 169, 98, 0.3);
}
*, *::before, *::after { box-sizing: border-box; }

/* Firefox scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--accent-secondary) var(--bg-secondary); }

/* WebKit scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--accent-secondary); border-radius: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Gradient text yellow */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-primary) 0%, #e8d5a3 50%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated background */
.hero-bg {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(201, 169, 98, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(139, 115, 85, 0.06) 0%, transparent 50%),
    var(--bg-primary);
}

/* Grid pattern overlay */
.grid-pattern {
  background-image:
    linear-gradient(rgba(201, 169, 98, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 169, 98, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* Card styles */
.glass-card {
  background: rgba(18, 18, 26, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 169, 98, 0.1);
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(201, 169, 98, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent-glow);
}

/* Button styles */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--bg-primary);
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

/* Typewriter effect */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1.2em;
  background: var(--accent-primary);
  margin-left: 4px;
  animation: blink 1s infinite;
  vertical-align: text-bottom;
}

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

/* Timeline */
.timeline-line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary), transparent);
}

.timeline-dot {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  background: var(--bg-primary);
  border: 3px solid var(--accent-primary);
  border-radius: 50%;
  z-index: 1;
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
  background: var(--accent-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Skill tags */
.skill-tag {
  background: rgba(201, 169, 98, 0.1);
  border: 1px solid rgba(201, 169, 98, 0.2);
  color: var(--accent-primary);
  transition: all 0.3s ease;
}

.skill-tag:hover {
  background: rgba(201, 169, 98, 0.2);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

/* Social icons */
.social-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid rgba(201, 169, 98, 0.2);
  border-radius: 12px;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: var(--accent-primary);
  color: var(--bg-primary);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px var(--accent-glow);
}

/* Scroll animations - FIXED: Start visible, animate when in view */
.fade-in,
.fade-in-left,
.fade-in-right {
  opacity: 1;
  transform: none;
}

/* Only apply animation if JS has initialized and not reduced motion */
.js-animations .fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-animations .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.js-animations .fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-animations .fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.js-animations .fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-animations .fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Nav link active state */
.nav-link {
  position: relative;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-primary);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Floating particles */
.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0.3;
  animation: float 15s infinite ease-in-out;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(120deg); }
  66% { transform: translateY(10px) rotate(240deg); }
}

/* Project card tech badges */
.tech-badge {
  background: rgba(201, 169, 98, 0.15);
  color: var(--accent-primary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
}

/* Stats counter */
.stat-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

/* Mobile menu🔥 */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%; /* Takes up 80% of screen width */
  max-width: 400px;
  height: 100vh;
  z-index: 50; /* Sits above the backdrop */

  /* Background Fixes */
  background-color: var(--bg-primary, #1a1a1a); /* Added a dark fallback */
  display: flex;
  flex-direction: column;

  transform: translateX(100%);
  transition: transform 0.3s ease;
  border-left: 1px solid rgba(201, 169, 98, 0.2);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Backdrop */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 40; /* Sits below the menu */
}

.mobile-menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Focus styles for accessibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent-primary);
  color: var(--bg-primary);
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* Utility classes */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.accent-primary { color: var(--accent-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }
.border-accent { border-color: rgba(201, 169, 98, 0.1); border-style: solid; }
.email-icon { color: #EA4335; }

/* Gradient backgrounds */
.gradient-gold { background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)); }
.gradient-red { background: linear-gradient(135deg, #A51C30, #8B0000); }
.gradient-python { background: linear-gradient(135deg, #3776AB, #FFD43B); }
.gradient-cpp { background: linear-gradient(135deg, #00599C, #004482); }
.gradient-ml { background: linear-gradient(135deg, #FF6F00, #FFA726); }
.gradient-web { background: linear-gradient(135deg, #E34F26, #F06529); }
.gradient-blue-purple { background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.1)); }
.gradient-green { background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.1)); }
.gradient-yellow { background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.1)); }
.gradient-red-light { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1)); }
.gradient-gold-light { background: linear-gradient(135deg, rgba(201, 169, 98, 0.2), rgba(139, 115, 85, 0.1)); }

/* Badge styles */
.badge-success { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.badge-info { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.badge-purple { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.badge-yellow { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .js-animations .fade-in,
  .js-animations .fade-in-left,
  .js-animations .fade-in-right {
    opacity: 1;
    transform: none;
  }
}
