/**
 * Глобальные стили - Премиальный космический дизайн
 */

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

html, body {
  font-family: 'Tenor Sans', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #080C1B;
  color: #E9ECEF;
  overflow-x: hidden;
  /* Предотвращение белых артефактов при скролле */
  min-height: 100vh;
  height: auto;
}

/* Предотвращение белых артефактов при скролле на мобильных */
@media (max-width: 768px) {
  html, body {
    background: #080C1B;
    /* Убеждаемся, что нет белого фона */
    background-color: #080C1B !important;
  }
  
  /* Предотвращение белой полосы внизу */
  body::after {
    content: '';
    display: none;
  }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

/* Pulse Animation */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Shimmer Effect */
@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

/* Glow Animation */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(93, 56, 243, 0.4); }
  50% { box-shadow: 0 0 40px rgba(93, 56, 243, 0.8); }
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: rgba(23, 25, 33, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #E5C789, #5D38F3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #FFEFBD, #7D58FF);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Selection Color */
::-moz-selection {
  background: rgba(93, 56, 243, 0.3);
  color: #FFEFBD;
}
::selection {
  background: rgba(93, 56, 243, 0.3);
  color: #FFEFBD;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

/* ============================================
   УЛУЧШЕННЫЕ АНИМАЦИИ (Этап 3)
   ============================================ */

/* Subtle Glow для статистических карточек (3s вместо 2s) */
@keyframes subtle-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(93, 56, 243, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(93, 56, 243, 0.5);
  }
}

/* Shimmer Smooth для заголовков (4s вместо 2s) */
@keyframes shimmer-smooth {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Классы для улучшенных анимаций */
.stat-card {
  animation: subtle-glow 3s ease-in-out infinite;
  will-change: box-shadow;
  transition: all 0.3s ease;
}

.shimmer-text {
  background: linear-gradient(
    90deg,
    rgba(229, 199, 137, 0.3),
    rgba(229, 199, 137, 0.8),
    rgba(229, 199, 137, 0.3)
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-smooth 4s ease-in-out infinite;
}

/* ============================================
   МОБИЛЬНАЯ ОПТИМИЗАЦИЯ (Этап 4)
   ============================================ */

@media (max-width: 768px) {
  /* Отключить лишние анимации на мобильном */
  .decorative-symbols {
    animation: none !important;
    opacity: 0.4;
  }

  /* Замедлить все анимации на 20% на мобильном */
  .logo-breathing {
    animation-duration: 7.2s !important; /* Было 6s, стало 7.2s */
  }

  .stat-card {
    animation-duration: 3.6s !important; /* Было 3s, стало 3.6s */
    box-shadow: 0 0 15px rgba(93, 56, 243, 0.2) !important;
    /* Уменьши intensity свечения на мобильном */
  }

  .shimmer-text {
    animation-duration: 5s !important; /* Было 4s, стало 5s */
  }

  /* Убрать сложные фильтры на мобильном */
  .testimonial-card {
    filter: none;
    box-shadow: 0 0 10px rgba(93, 56, 243, 0.15);
  }

  /* Увеличить tap-target для кнопок */
  button, [role="button"] {
    min-height: 44px;
    min-width: 44px;
    padding: 0.75rem 1.5rem;
  }

  /* Увеличить font-size на мобильном */
  p, span {
    font-size: 16px; /* Минимум для мобильных */
  }
}

/* ============================================
   ДОСТУПНОСТЬ - Уважение к prefers-reduced-motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .logo-breathing {
    animation: none !important;
    filter: drop-shadow(0 0 8px rgba(229, 199, 137, 0.3));
  }
}

/* КРИТИЧНО: Стили для canvas CosmicBackground */
.cosmic-background-canvas {
  display: block !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999 !important; /* ОЧЕНЬ ВЫСОКИЙ чтобы быть поверх всего */
  pointer-events: none !important;
  background-color: rgba(255, 0, 0, 1.0) !important; /* КРАСНЫЙ фон */
}

