/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ballpit Canvas */
#ballpit-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Glass Effect Enhancements */
.glass-card {
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 8px 32px rgba(31, 38, 135, 0.1),
    0 4px 16px rgba(255, 255, 255, 0.2) inset;
}

/* Enhanced backdrop blur for Safari */
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
  .backdrop-blur-2xl {
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
  }
  
  .backdrop-blur-xl {
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    backdrop-filter: blur(24px) saturate(150%);
  }
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .backdrop-blur-2xl,
  .backdrop-blur-xl {
    background: rgba(255, 255, 255, 0.85);
  }
}

/* Shimmer animation for decorative lines */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Logo hover effect */
img[alt="Krishvik.com"]:hover {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

/* Smooth hover transitions */
.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Selection color */
::selection {
  background: rgba(99, 102, 241, 0.2);
  color: #1e293b;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  /* Reduce animation intensity on mobile for performance */
  .animate-float {
    animation-duration: 8s;
  }
  
  .animate-pulse-soft {
    animation-duration: 5s;
  }
  
  /* Ensure touch-friendly tap targets */
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve readability on small screens */
  body {
    font-size: 16px;
    line-height: 1.6;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-float,
  .animate-float-delayed,
  .animate-pulse-soft,
  .animate-shimmer {
    animation: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .backdrop-blur-2xl,
  .backdrop-blur-xl {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.3);
  }
  
  body {
    background: white;
  }
}

/* Print styles */
@media print {
  #ballpit-container,
  .animate-float,
  .animate-pulse-soft {
    display: none !important;
  }
  
  .backdrop-blur-2xl,
  .backdrop-blur-xl {
    backdrop-filter: none;
    background: white;
    border: 1px solid #e2e8f0;
  }
}
