@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --gold: #FFD700;
  --purple: #6B46C1;
  --dark-purple: #4C1D95;
}

* {
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.cosmic-bg {
  background: linear-gradient(135deg, #0F0C29 0%, #24243e 50%, #302B63 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

.cosmic-bg::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #FFD700, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #FFD700, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 160px 30px, #FFD700, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: twinkle 8s infinite;
  pointer-events: none;
  z-index: -1;
}

.cosmic-text {
  background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
  word-break: break-word;
}

.text-gold {
  color: var(--gold);
}

.border-gold {
  border-color: var(--gold);
}

.border-gold\/50 {
  border-color: rgba(255, 215, 0, 0.5);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.3; }
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out forwards;
}

.animate-twinkle {
  animation: twinkle 2s infinite;
}

/* Mobile-first responsive design - IMPROVED */
/* Base styles are mobile-first */
.cosmic-text {
  font-size: 2rem;
  line-height: 1.2;
  padding: 0 0.5rem;
}

/* Better spacing on all devices */
.max-w-2xl {
  padding: 0 1rem;
}

/* Larger touch targets for mobile */
a {
  min-height: 48px;
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Improved button and link sizing */
.link-card {
  padding: 1rem;
  margin-bottom: 0.75rem;
}

/* Better text sizing for mobile */
.mobile-text-sm {
  font-size: 0.875rem;
}

.mobile-text-base {
  font-size: 1rem;
}

.mobile-text-lg {
  font-size: 1.125rem;
}

/* Tablet breakpoint */
@media (min-width: 640px) {
  .cosmic-text {
    font-size: 2.5rem;
    padding: 0;
  }
  
  .link-card {
    padding: 1.25rem;
  }
}

/* Desktop breakpoint */
@media (min-width: 768px) {
  .cosmic-text {
    font-size: 3rem;
  }
}

/* Large desktop */
@media (min-width: 1024px) {
  .cosmic-text {
    font-size: 3.5rem;
  }
}

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #FFA500;
}

/* Hover effects - disabled on touch devices */
@media (hover: hover) and (pointer: fine) {
  .group:hover .fa-external-link-alt {
    transform: translateX(4px);
  }
}

/* Touch-friendly links */
a {
  -webkit-tap-highlight-color: rgba(255, 215, 0, 0.2);
  touch-action: manipulation;
  user-select: none;
}

/* Active state for better mobile feedback */
a:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* Focus states for accessibility */
input:focus,
a:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Better text wrapping */
h1, h2, h3, p, span {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Improved mobile input styling */
input {
  font-size: 16px; /* Prevents zoom on iOS */
  -webkit-appearance: none;
  border-radius: 0.75rem;
}

/* Better icon sizing */
.fa-star {
  font-size: 1rem;
}

@media (min-width: 640px) {
  .fa-star {
    font-size: 1.25rem;
  }
  
  input {
    font-size: 1rem;
  }
}

/* Optimize for iPhone notch and safe areas */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* Reduce animations on low-power devices */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Better contrast for readability */
@media (prefers-contrast: high) {
  .cosmic-text {
    -webkit-text-fill-color: #FFD700;
    background: none;
  }
  
  a {
    border-width: 2px;
  }
}