/* ========================================
   RETRO GAMING ENHANCEMENTS
   ======================================== */

/* Power-Up Button Pulse */
.btn-primary {
  animation: powerUp 2s ease-in-out infinite;
}
@keyframes powerUp {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  50% { box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.2); }
}

/* 8-bit Press Effect */
.btn:active {
  transform: translate(4px, 4px) !important;
  box-shadow: none !important;
}
.btn:active::after {
  transform: translate(-4px, -4px) !important;
}

/* Pixel Border Scan Animation */
.feature-card {
  position: relative;
  overflow: hidden;
}
.feature-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--white), transparent);
}
.feature-card:hover::after {
  animation: scanBar 0.8s ease forwards;
}
@keyframes scanBar {
  to { left: 100%; }
}

/* Loading Bar Progress Effect */
.feature-icon {
  position: relative;
}
.feature-icon::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--white);
  transition: width 0.3s steps(8);
}
.feature-card:hover .feature-icon::after {
  width: 60px;
}

/* Stats Counter Glow Effect */
.stat-value, .metric-value {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  animation: statPulse 3s ease-in-out infinite;
}
@keyframes statPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
  50% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 30px rgba(255, 255, 255, 0.4); }
}

/* Achievement Star on Stats */
.stat, .metric-item {
  position: relative;
}
.stat::before, .metric-item::before {
  content: '\2605';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 1rem;
  color: var(--grey-500);
  opacity: 0;
  transform: scale(0) rotate(-180deg);
  transition: all 0.3s ease;
}
.stat:hover::before, .metric-item:hover::before {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Level-Up Comparison Cards */
.comparison-card {
  transition: all 0.2s steps(4);
  position: relative;
}
.comparison-card::before {
  content: 'LVL 1';
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: 'Press Start 2P', cursive;
  font-size: 0.5rem;
  color: var(--grey-600);
  opacity: 0.5;
}
.comparison-card.nextshift::before {
  content: 'LVL 2';
  color: var(--white);
  animation: levelUp 1s ease-out;
}
@keyframes levelUp {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); color: #00ff41; }
  100% { transform: scale(1); }
}
.comparison-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 0 var(--grey-700);
}

/* CTA Spotlight Animation */
.cta {
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.03), transparent 30%);
  animation: spotlight 10s linear infinite;
}
@keyframes spotlight {
  to { transform: rotate(360deg); }
}

/* Game Menu Footer Links */
.footer-column a {
  position: relative;
  display: inline-block;
}
.footer-column a::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--white);
  opacity: 0;
  transition: opacity 0.15s steps(4), left 0.15s steps(4);
}
.footer-column a:hover::before {
  opacity: 1;
  left: -20px;
}

/* Scroll Indicator Arrow */
.hero::after {
  content: '\25BC';
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.8rem;
  color: var(--grey-500);
  animation: scrollBounce 1.5s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(10px); opacity: 1; }
}

/* Pixelated Image Effect */
/* Removed pixelated to fix dithering */
.logo-icon, .logo-name {
}

/* Tier Card Hover */
.tier-card {
  transition: all 0.2s steps(4);
  position: relative;
}
.tier-card:hover {
  transform: translateY(-4px);
  border-color: var(--white);
}
.tier-card.featured {
  animation: bossGlow 2s ease-in-out infinite;
}
@keyframes bossGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  50% { box-shadow: 0 0 20px 0 rgba(255, 255, 255, 0.2); }
}

/* XP Bar Animation for Tier Features */
.tier-features li {
  position: relative;
  overflow: hidden;
}
.tier-features li::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--white);
  transition: width 0.3s steps(10);
}
.tier-card:hover .tier-features li::after {
  width: 100%;
}
.tier-card:hover .tier-features li:nth-child(1)::after { transition-delay: 0.05s; }
.tier-card:hover .tier-features li:nth-child(2)::after { transition-delay: 0.1s; }
.tier-card:hover .tier-features li:nth-child(3)::after { transition-delay: 0.15s; }
.tier-card:hover .tier-features li:nth-child(4)::after { transition-delay: 0.2s; }
.tier-card:hover .tier-features li:nth-child(5)::after { transition-delay: 0.25s; }

/* Glitch Effect on Section Headers */
.section-header h2:hover {
  animation: glitchText 0.3s steps(10);
}
@keyframes glitchText {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(2px, -2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(2px, 2px); }
}

/* Screen Flicker on Page Load */
body {
  animation: screenOn 0.5s steps(5);
}
@keyframes screenOn {
  0% { opacity: 0; filter: brightness(5); }
  20% { opacity: 0.2; filter: brightness(3); }
  40% { opacity: 0.5; filter: brightness(2); }
  60% { opacity: 0.8; filter: brightness(1.5); }
  100% { opacity: 1; filter: brightness(1); }
}

/* Coin Collect Effect on Nav */
.nav-menu a::after {
  content: '+1';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.4rem;
  color: var(--white);
  opacity: 0;
  pointer-events: none;
}
.nav-menu a:hover::after {
  animation: coinCollect 0.5s ease-out forwards;
}
@keyframes coinCollect {
  0% { opacity: 0; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Floating Power-Ups (Particles Enhancement) */
.particle {
  background: var(--terminal-green) !important;
  box-shadow: 0 0 5px var(--terminal-green);
  border-radius: 0;
}
.particle:nth-child(odd) {
  width: 6px !important;
  height: 6px !important;
}

/* Social Links Shine Effect */
.social-links a {
  position: relative;
  overflow: hidden;
}
.social-links a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.3s;
}
.social-links a:hover::before {
  left: 100%;
}

/* Button Sound Wave Effect */
.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}
.btn:hover::before {
  width: 200%;
  height: 200%;
}
/* Fix: Use dark wave for white primary buttons */
.btn-primary::before {
  background: rgba(0, 0, 0, 0.08);
}

/* CTA Blinking Cursor */
.cta h2::after {
  content: ' _';
  animation: blink 1s steps(1) infinite;
}

/* Retro Pixel Cursor */
body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='4' height='4' fill='%23fff'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23fff'/%3E%3Crect x='8' y='8' width='4' height='4' fill='%23fff'/%3E%3C/svg%3E"), auto;
}
a, button, .btn {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%2300ff41'/%3E%3Crect x='8' y='8' width='4' height='4' fill='%2300ff41'/%3E%3C/svg%3E"), pointer;
}

/* High Score Header Style */
.header.scrolled {
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.98) 0%, rgba(10, 10, 10, 0.9) 100%);
}

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

/* Section reveal on scroll */
.section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hero always visible */
.hero {
  opacity: 1 !important;
  transform: none !important;
}

/* Staggered children reveal */
.section.revealed .feature-card,
.section.revealed .comparison-card,
.section.revealed .service-detail,
.section.revealed .metric-item {
  opacity: 0;
  animation: slideUp 0.5s ease-out forwards;
}
.section.revealed .feature-card:nth-child(1),
.section.revealed .comparison-card:nth-child(1),
.section.revealed .metric-item:nth-child(1) { animation-delay: 0.1s; }
.section.revealed .feature-card:nth-child(2),
.section.revealed .comparison-card:nth-child(2),
.section.revealed .metric-item:nth-child(2) { animation-delay: 0.2s; }
.section.revealed .feature-card:nth-child(3),
.section.revealed .metric-item:nth-child(3) { animation-delay: 0.3s; }
.section.revealed .feature-card:nth-child(4),
.section.revealed .metric-item:nth-child(4) { animation-delay: 0.4s; }
.section.revealed .feature-card:nth-child(5) { animation-delay: 0.5s; }
.section.revealed .feature-card:nth-child(6) { animation-delay: 0.6s; }

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

/* Service detail stagger */
.section.revealed .service-detail:nth-child(1) { animation-delay: 0.1s; }
.section.revealed .service-detail:nth-child(2) { animation-delay: 0.2s; }
.section.revealed .service-detail:nth-child(3) { animation-delay: 0.3s; }
.section.revealed .service-detail:nth-child(4) { animation-delay: 0.4s; }
.section.revealed .service-detail:nth-child(5) { animation-delay: 0.5s; }
.section.revealed .service-detail:nth-child(6) { animation-delay: 0.6s; }

/* Section header slide-in */
.section-header {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.section.revealed .section-header {
  opacity: 1;
  transform: translateY(0);
}

/* CTA section special glow animation */
.cta.revealed {
  animation: ctaGlow 2s ease-in-out;
}
@keyframes ctaGlow {
  0% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: inset 0 0 100px 0 rgba(255,255,255,0.03); }
  100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
}

/* Smooth section dividers */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--grey-600), transparent);
  transition: width 0.8s ease-out;
}
.section.revealed::before {
  width: 80%;
}
.hero::before,
.cta::before {
  display: none;
}

/* Fix: Use dark wave for white primary buttons */
.btn-primary::before {
  background: rgba(0, 0, 0, 0.08);
}

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

/* Section reveal on scroll */
.section {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Hero always visible */
.hero {
  opacity: 1 !important;
  transform: none !important;
}

/* Staggered children reveal */
.section.revealed .feature-card,
.section.revealed .comparison-card,
.section.revealed .service-detail,
.section.revealed .metric-item {
  opacity: 0;
  animation: slideUp 0.5s ease-out forwards;
}
.section.revealed .feature-card:nth-child(1),
.section.revealed .comparison-card:nth-child(1),
.section.revealed .metric-item:nth-child(1) { animation-delay: 0.1s; }
.section.revealed .feature-card:nth-child(2),
.section.revealed .comparison-card:nth-child(2),
.section.revealed .metric-item:nth-child(2) { animation-delay: 0.2s; }
.section.revealed .feature-card:nth-child(3),
.section.revealed .metric-item:nth-child(3) { animation-delay: 0.3s; }
.section.revealed .feature-card:nth-child(4),
.section.revealed .metric-item:nth-child(4) { animation-delay: 0.4s; }
.section.revealed .feature-card:nth-child(5) { animation-delay: 0.5s; }
.section.revealed .feature-card:nth-child(6) { animation-delay: 0.6s; }

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

/* Service detail stagger */
.section.revealed .service-detail:nth-child(1) { animation-delay: 0.1s; }
.section.revealed .service-detail:nth-child(2) { animation-delay: 0.2s; }
.section.revealed .service-detail:nth-child(3) { animation-delay: 0.3s; }
.section.revealed .service-detail:nth-child(4) { animation-delay: 0.4s; }
.section.revealed .service-detail:nth-child(5) { animation-delay: 0.5s; }
.section.revealed .service-detail:nth-child(6) { animation-delay: 0.6s; }

/* Section header slide-in */
.section-header {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.section.revealed .section-header {
  opacity: 1;
  transform: translateY(0);
}

/* CTA section special glow animation */
.cta.revealed {
  animation: ctaGlow 2s ease-in-out;
}
@keyframes ctaGlow {
  0% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
  50% { box-shadow: inset 0 0 100px 0 rgba(255,255,255,0.03); }
  100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
}

/* ========================================
   MATRIX RAIN BINARY BACKGROUND
   ======================================== */

/* Matrix rain container */
.matrix-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  opacity: 0.15;
}

/* Individual rain columns */
.matrix-column {
  position: absolute;
  top: -100%;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  line-height: 1.2;
  color: var(--terminal-green, #00ff41);
  text-shadow: 0 0 8px var(--terminal-green, #00ff41);
  white-space: nowrap;
  animation: matrixFall linear infinite;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

@keyframes matrixFall {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(200vh);
    opacity: 0;
  }
}

/* Generate multiple columns with different speeds and positions */
.matrix-column:nth-child(1) { left: 5%; animation-duration: 8s; animation-delay: 0s; }
.matrix-column:nth-child(2) { left: 10%; animation-duration: 12s; animation-delay: 1s; }
.matrix-column:nth-child(3) { left: 15%; animation-duration: 10s; animation-delay: 2s; }
.matrix-column:nth-child(4) { left: 20%; animation-duration: 14s; animation-delay: 0.5s; }
.matrix-column:nth-child(5) { left: 25%; animation-duration: 9s; animation-delay: 1.5s; }
.matrix-column:nth-child(6) { left: 30%; animation-duration: 11s; animation-delay: 3s; }
.matrix-column:nth-child(7) { left: 35%; animation-duration: 13s; animation-delay: 0.8s; }
.matrix-column:nth-child(8) { left: 40%; animation-duration: 8s; animation-delay: 2.5s; }
.matrix-column:nth-child(9) { left: 45%; animation-duration: 15s; animation-delay: 1.2s; }
.matrix-column:nth-child(10) { left: 50%; animation-duration: 10s; animation-delay: 0.3s; }
.matrix-column:nth-child(11) { left: 55%; animation-duration: 12s; animation-delay: 2.8s; }
.matrix-column:nth-child(12) { left: 60%; animation-duration: 9s; animation-delay: 1.8s; }
.matrix-column:nth-child(13) { left: 65%; animation-duration: 14s; animation-delay: 0.6s; }
.matrix-column:nth-child(14) { left: 70%; animation-duration: 11s; animation-delay: 3.2s; }
.matrix-column:nth-child(15) { left: 75%; animation-duration: 8s; animation-delay: 2.1s; }
.matrix-column:nth-child(16) { left: 80%; animation-duration: 13s; animation-delay: 1.4s; }
.matrix-column:nth-child(17) { left: 85%; animation-duration: 10s; animation-delay: 0.9s; }
.matrix-column:nth-child(18) { left: 90%; animation-duration: 12s; animation-delay: 2.6s; }
.matrix-column:nth-child(19) { left: 95%; animation-duration: 9s; animation-delay: 1.1s; }
.matrix-column:nth-child(20) { left: 2%; animation-duration: 11s; animation-delay: 3.5s; }
