/* ==========================================================================
   Gopi Sharma Portfolio - Unified Modern Stylesheet & Transitions
   ========================================================================== */

:root {
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: rgba(255, 255, 255, 0.8);
  --card-border: rgba(99, 102, 241, 0.1);
  --border: rgba(99, 102, 241, 0.1);
  --muted-text: #64748b;
  --primary-glow: rgba(99, 102, 241, 0.08);
  --secondary-glow: rgba(139, 92, 246, 0.08);
  --accent-glow: rgba(59, 130, 246, 0.08);
  --grid-color: rgba(99, 102, 241, 0.04);
}

html.dark {
  --background: #050816;
  --foreground: #ffffff;
  --card: rgba(15, 23, 42, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --muted-text: #94a3b8;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --secondary-glow: rgba(139, 92, 246, 0.15);
  --accent-glow: rgba(59, 130, 246, 0.15);
  --grid-color: rgba(255, 255, 255, 0.02);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--background);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.65);
}

/* Custom Grid Background Overlay */
.grid-bg {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
}

/* 3:4 Aspect Ratio Utility */
.aspect-3-4 {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
}

/* Sticky Header Glass System */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism Card Style & Smooth Hover Transitions */
.glass-panel {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s ease, 
              background-color 0.3s ease;
}

.glass-panel-hover:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 16px 40px -8px rgba(99, 102, 241, 0.2);
}

/* Radial Glow Elements */
.glow-spot-1 {
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
}
.glow-spot-2 {
  background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
}
.glow-spot-3 {
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
}

/* Custom Cursor Glow */
.cursor-glow {
  pointer-events: none;
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 9999;
  mix-blend-mode: screen;
  display: none;
  transition: opacity 0.3s ease;
}
html.dark .cursor-glow {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}
@media (min-width: 768px) {
  .cursor-glow {
    display: block;
  }
}

/* Reveal Animation Classes with Smooth Easing */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

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

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

/* Keyframe Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.5deg); }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(-0.5deg); }
}
@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.95) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}
.animate-float-slow {
  animation: float-slow 8s ease-in-out infinite;
}

/* Modal Popup Smooth Entrance */
.modal-animate {
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-backdrop-animate {
  animation: fadeIn 0.3s ease-out forwards;
}

/* Interactive Element Hover & Active Transitions */
button, a, .skill-pill, .stat-card, .budget-pill, .skill-tab {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.2s ease,
              border-color 0.2s ease,
              box-shadow 0.2s ease,
              color 0.2s ease;
}

button:active, a:active {
  transform: scale(0.97);
}

/* Timeline Line */
.timeline-line {
  background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.3), #6366f1, rgba(99, 102, 241, 0.3), transparent);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Heading underline */
.heading-underline {
  position: relative;
  display: inline-block;
}
.heading-underline::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.heading-underline:hover::after {
  width: 100%;
}

/* Skill pill hover transition */
.skill-pill {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.skill-pill:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Stat card hover transition */
.stat-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px -5px rgba(99, 102, 241, 0.2);
}

/* Mobile Responsive Optimization Utilities */
@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }
  
  button, a, input, select, textarea {
    min-height: 44px;
    touch-action: manipulation;
  }
  
  .skill-pill, .stat-card, .glass-panel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .hero-section {
    padding-top: 6rem;
    padding-bottom: 3rem;
  }
}

/* Floating Rounded Sticky Header */
.sticky-header-pill {
  position: fixed;
  top: 0.75rem;
  left: 1rem;
  right: 1rem;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  z-index: 40;
  border-radius: 1.25rem;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.75rem 1.25rem;
}

html.dark .sticky-header-pill {
  background-color: rgba(5, 8, 22, 0.85);
  border-color: rgba(30, 41, 59, 0.8);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
}

.sticky-header-pill.scrolled {
  top: 0.5rem;
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 16px 40px -10px rgba(99, 102, 241, 0.2);
}
