/* ============================================
   MODERN DESIGN SYSTEM
   Premium Portfolio UI/UX Enhancement
   ============================================ */

/* CSS Custom Properties (Design Tokens) */
:root {
  /* Primary Colors */
  --primary-500: #b42c1d;
  --primary-400: #d4342a;
  --primary-300: #ff5a4d;
  --primary-600: #8a2116;
  --primary-glow: rgba(180, 44, 29, 0.4);
  
  /* Accent Colors */
  --accent-orange: #ff7e5f;
  --accent-gold: #ffc857;
  --accent-cyan: #4fc1ff;
  --accent-purple: #a855f7;
  
  /* Neutral Colors */
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-950: #0a0a0a;
  
  /* Background Colors */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #111111;
  --bg-card: rgba(17, 17, 17, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.3);
  
  /* Border Colors */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --border-accent: rgba(180, 44, 29, 0.3);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 40px var(--primary-glow);
  --shadow-glow-sm: 0 0 20px var(--primary-glow);
  
  /* Typography Scale */
  --font-display: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
  --text-5xl: 3rem;      /* 48px */
  --text-6xl: 3.75rem;   /* 60px */
  --text-7xl: 4.5rem;    /* 72px */
  
  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-splash: 9999;
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* Base Reset Enhancements */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Selection Styling */
::selection {
  background: var(--primary-500);
  color: var(--text-primary);
}

/* ============================================
   GLASSMORPHISM COMPONENTS
   ============================================ */

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
}

.glass-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.glass-card-glow {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glow-sm);
  transition: all var(--transition-base);
}

.glass-card-glow:hover {
  box-shadow: var(--shadow-glow);
  border-color: var(--primary-400);
  transform: translateY(-4px);
}

/* ============================================
   ENHANCED BUTTONS
   ============================================ */

.btn-modern {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-base);
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-modern:hover::before {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(180, 44, 29, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(180, 44, 29, 0.4);
}

.btn-secondary {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

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

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered Animation */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ============================================
   ENHANCED SECTION HEADERS
   ============================================ */

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-glass);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--primary-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

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

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

.section-title-enhanced {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--neutral-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

.section-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================
   ENHANCED NAVBAR
   ============================================ */

.navbar-enhanced {
  background: rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.navbar-enhanced.scrolled {
  background: rgba(0, 0, 0, 0.9) !important;
  box-shadow: var(--shadow-lg);
}

.nav-link-enhanced {
  position: relative;
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4) !important;
  transition: color var(--transition-fast);
}

.nav-link-enhanced::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-500);
  transform: translateX(-50%);
  transition: width var(--transition-base);
}

.nav-link-enhanced:hover,
.nav-link-enhanced.active {
  color: var(--text-primary) !important;
}

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

/* ============================================
   FLOATING ELEMENTS & DECORATIONS
   ============================================ */

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

.orb-primary {
  background: radial-gradient(circle, var(--primary-glow), transparent 70%);
}

.orb-accent {
  background: radial-gradient(circle, rgba(79, 193, 255, 0.2), transparent 70%);
}

.grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  pointer-events: none;
}

/* ============================================
   CURSOR EFFECTS
   ============================================ */

.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(180, 44, 29, 0.08), transparent 50%);
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body:hover .cursor-glow {
  opacity: 1;
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   ENHANCED CARDS
   ============================================ */

.card-enhanced {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-500), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.card-enhanced:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow-sm);
}

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

/* ============================================
   ENHANCED SKILL BADGES
   ============================================ */

.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.skill-badge:hover {
  background: var(--bg-glass-hover);
  border-color: var(--primary-500);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.skill-badge i {
  color: var(--primary-400);
}

/* ============================================
   TIMELINE ENHANCEMENTS
   ============================================ */

.timeline-enhanced {
  position: relative;
  padding-left: var(--space-8);
}

.timeline-enhanced::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary-500), var(--primary-600), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-8);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-8) - 5px);
  top: 0;
  width: 12px;
  height: 12px;
  background: var(--primary-500);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--primary-glow);
}

/* ============================================
   HOVER GLOW EFFECTS
   ============================================ */

.glow-on-hover {
  position: relative;
  transition: all var(--transition-base);
}

.glow-on-hover::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-orange));
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  filter: blur(15px);
  transition: opacity var(--transition-base);
}

.glow-on-hover:hover::after {
  opacity: 0.5;
}

/* ============================================
   TEXT GRADIENT EFFECTS
   ============================================ */

.text-gradient-primary {
  background: linear-gradient(135deg, var(--primary-400), var(--accent-orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-accent {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
  .cursor-glow {
    display: none;
  }

  .section-title-enhanced {
    font-size: var(--text-3xl);
  }

  .glass-card, .glass-card-glow {
    backdrop-filter: blur(10px);
  }
}

