/* ============================================
   XO Development - Visual Enhancement Layer
   ADDITIVE ONLY - Does not override core styles
   ============================================ */

/* === 0. Page Load Transition === */
body {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
body.xo-loaded {
  opacity: 1;
}

/* === 1. Animated Background Grid === */
.xo-bg-grid {
  position: relative;
}
.xo-bg-grid::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 200%; height: 200%;
  background-image:
    linear-gradient(rgba(231, 205, 86, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 205, 86, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: xo-grid-drift 30s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes xo-grid-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-60px, -60px); }
}

/* === 2. Floating Gold Particles === */
.xo-particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.xo-particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 205, 86, 0.3), rgba(184, 134, 11, 0.1));
  animation: xo-float-up linear infinite;
  opacity: 0;
}

@keyframes xo-float-up {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0.5);
  }
  10% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.05;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

/* === 3. Hero Section Entrance === */
@keyframes xo-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h1 {
  animation: xo-fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}
.hero-tagline {
  animation: xo-fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}
.hero-description {
  animation: xo-fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.7s both;
}
.hero-cta {
  animation: xo-fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.9s both;
}
.hero-stats {
  animation: xo-fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) 1.1s both;
}

/* === 4. Section Scroll Reveals === */
.xo-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.xo-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.xo-reveal.visible:nth-child(2) { transition-delay: 0.08s; }
.xo-reveal.visible:nth-child(3) { transition-delay: 0.16s; }
.xo-reveal.visible:nth-child(4) { transition-delay: 0.24s; }
.xo-reveal.visible:nth-child(5) { transition-delay: 0.32s; }
.xo-reveal.visible:nth-child(6) { transition-delay: 0.40s; }

/* === 5. Card Hover Effects === */
.feature-card,
.card,
.api-card,
.xo-stat-card {
  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 cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover,
.card:hover,
.api-card:hover,
.xo-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(231, 205, 86, 0.15);
  border-color: rgba(231, 205, 86, 0.3);
}

/* === 6. Gold Shimmer Effect === */
.pricing-highlight,
.api-card {
  position: relative;
  overflow: hidden;
}
.pricing-highlight::after,
.api-card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(231, 205, 86, 0.06),
    transparent
  );
  transition: none;
  pointer-events: none;
}
.pricing-highlight:hover::after,
.api-card:hover::after {
  animation: xo-shimmer 0.8s ease-out;
}

@keyframes xo-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* === 7. Button Micro-interactions === */
.btn-primary,
.xo-btn-primary {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s ease;
}
.btn-primary:hover,
.xo-btn-primary:hover {
  box-shadow: 0 0 20px rgba(231, 205, 86, 0.3),
              0 4px 16px rgba(231, 205, 86, 0.2);
}
.btn-primary:active,
.xo-btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary,
.xo-btn-secondary {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s ease,
              color 0.3s ease;
}
.btn-secondary:active,
.xo-btn-secondary:active {
  transform: scale(0.97);
}

/* === 8. Step Number Glow === */
.step-number {
  animation: xo-pulse-glow 3s ease-in-out infinite;
}

@keyframes xo-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(231, 205, 86, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(231, 205, 86, 0.4),
                0 0 40px rgba(231, 205, 86, 0.1);
  }
}

/* === 9. Stat Value Emphasis === */
.stat-value {
  text-shadow: 0 0 20px rgba(231, 205, 86, 0.3);
}

/* === 10. Gold Accent Separator === */
.xo-gold-line {
  height: 2px;
  border: none;
  background: linear-gradient(90deg, transparent, #e7cd56, #c9a93e, #e7cd56, transparent);
  background-size: 200% 100%;
  animation: xo-line-shimmer 3s linear infinite;
}

@keyframes xo-line-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === 11. Loading Spinner === */
.xo-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(231, 205, 86, 0.2);
  border-top-color: #e7cd56;
  border-radius: 50%;
  animation: xo-spin 0.8s linear infinite;
}

@keyframes xo-spin {
  to { transform: rotate(360deg); }
}

/* === 12. Glassmorphism Utility === */
.xo-glass {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(17, 17, 17, 0.7);
  border: 1px solid rgba(231, 205, 86, 0.1);
}

/* === 13. Nav Link Hover Underline === */
.xo-header a:not(.xo-logo):not(.xo-btn-primary):not(.xo-btn-secondary) {
  position: relative;
}
.xo-header a:not(.xo-logo):not(.xo-btn-primary):not(.xo-btn-secondary)::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  width: 0; height: 2px;
  background: #e7cd56;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.xo-header a:not(.xo-logo):not(.xo-btn-primary):not(.xo-btn-secondary):hover::after {
  width: 100%;
  left: 0;
}

/* === 14. Typing Cursor Effect === */
.xo-typing-cursor::after {
  content: '|';
  display: inline-block;
  color: #e7cd56;
  animation: xo-blink 1s step-end infinite;
  margin-left: 2px;
  font-weight: 300;
}

@keyframes xo-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* === 15. CTA Section Enhancement === */
.cta-section {
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(231, 205, 86, 0.05) 0%, transparent 70%);
  animation: xo-cta-glow 6s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes xo-cta-glow {
  0% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* === 16. Section Title Enhancement === */
.section-title {
  position: relative;
}

/* === 17. Sidebar Active Link === */
.xo-sidebar a.active,
.xo-sidebar a:hover {
  position: relative;
}
.xo-sidebar a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: #e7cd56;
  border-radius: 0 2px 2px 0;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body {
    opacity: 1;
  }
  .xo-reveal {
    opacity: 1;
    transform: none;
  }
  .xo-particles {
    display: none;
  }
  .xo-bg-grid::before {
    animation: none;
  }
}

/* === Performance Hints === */
.xo-particles,
.xo-bg-grid::before {
  will-change: transform;
}
