/* Cipher Markets — Custom Styles */

:root {
  --cipher: #FACC15;
  --cipher-glow: rgba(250, 204, 21, 0.35);
  --dark-bg: #050505;
  --dark-card: #111111;
  --dark-elevated: #1A1A1A;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--dark-bg);
  color: #e5e5e5;
}

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

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #262626;
  border-radius: 4px;
}

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

/* Grid background */
.bg-grid {
  background-image: 
    linear-gradient(rgba(255, 215, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 215, 0, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Header scroll state */
#header.scrolled #navbar {
  max-width: 900px;
  margin-top: 12px;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseSlow {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

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

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(250, 204, 21, 0.25);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse-slow {
  animation: pulseSlow 6s ease-in-out infinite;
}

.animate-gradient-text {
  background-size: 200% 200%;
  animation: gradientText 4s ease infinite;
}

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

.animate-glow {
  animation: glow 3s ease-in-out infinite;
}

.delay-1000 {
  animation-delay: 1s;
}

/* Marquee */
.marquee-track {
  animation: marquee 30s linear infinite;
  width: max-content;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* Reveal on scroll — CSS-first with JS enhancement */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback: ensure content is visible even if JS fails or page is captured */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  
  .reveal:nth-child(1) { animation-delay: 0.05s; }
  .reveal:nth-child(2) { animation-delay: 0.1s; }
  .reveal:nth-child(3) { animation-delay: 0.15s; }
  .reveal:nth-child(4) { animation-delay: 0.2s; }
  .reveal:nth-child(5) { animation-delay: 0.25s; }
  .reveal:nth-child(6) { animation-delay: 0.3s; }
}

/* Once JS has handled reveal, remove the CSS animation fallback so transitions work */
.reveal.visible {
  animation: none;
}

/* Feature card glow on hover */
.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0) 0%, rgba(250, 204, 21, 0.15) 50%, rgba(250, 204, 21, 0) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
  pointer-events: none;
}

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

/* Spotlight effect */
.spotlight {
  position: relative;
  overflow: hidden;
}

.spotlight::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  left: var(--mouse-x, 50%);
  top: var(--mouse-y, 50%);
  z-index: 0;
}

.spotlight:hover::after {
  opacity: 1;
}

.spotlight > * {
  position: relative;
  z-index: 1;
}

/* Mobile menu */
#mobile-menu.open {
  display: flex;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Selection */
::selection {
  background: rgba(250, 204, 21, 0.2);
  color: #FACC15;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(250, 204, 21, 0.6);
  outline-offset: 2px;
}

/* Custom utilities */
.text-shadow-glow {
  text-shadow: 0 0 40px rgba(250, 204, 21, 0.3);
}
