/* ==========================================================================
   ОГЛАВЛЕНИЕ (global.css)
   1. Сброс и базовая вёрстка
   2. Контейнер и типографика общая
   3. Кнопки (градиент оранжевый)
   4. Переходы между блоками (section-divider)
   5. Космический фон (звёзды — общий класс)
   6. Планета / луна (декор тёмных блоков)
   7. Утилиты (скрытие, якоря)
   ========================================================================== */

@import url("variables.css");

/* 1. Сброс */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body {
  margin: 0;
  font-family: var(--font-main);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg-deep);
  line-height: 1.55;
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent-light); text-decoration: none; transition: color var(--duration-fast); }
/* Обычные ссылки — оранжевеют; кнопки (.btn) — цвет задаётся классом кнопки */
a:hover:not(.btn) { color: var(--color-accent); }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

/* 2. Контейнер */
.container {
  width: var(--container);
  margin-inline: auto;
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--gap-md);
}
.section-title span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-lead {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: 52ch;
  margin-bottom: var(--gap-lg);
}

/* 3. Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast), filter var(--duration-fast);
}
.btn--primary {
  background: var(--gradient-accent);
  color: #0a0a0f;
  box-shadow: 0 4px 24px rgba(255, 107, 26, 0.35);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  color: #0a0a0f;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 32px rgba(255, 107, 26, 0.5);
}
.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-light);
}

/* 4. Переход между блоками */
.section-divider {
  position: relative;
  height: 72px;
  overflow: hidden;
  background: transparent;
}
.section-divider__line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120%;
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(255, 159, 61, 0.4), transparent);
  animation: dividerPulse 3s ease-in-out infinite;
}
.section-divider__orb {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--gradient-accent);
  box-shadow: 0 0 20px rgba(255, 107, 26, 0.8);
  animation: orbTravel 4s linear infinite;
}
@keyframes dividerPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
@keyframes orbTravel {
  0% { transform: translateX(-40vw); }
  100% { transform: translateX(40vw); }
}
/* Между блоком 1 и 2 — в 2 раза медленнее */
.section-divider--slow .section-divider__orb {
  animation: orbTravel 8s linear infinite;
}

/* 5. Звёздное небо (canvas создаётся в global.js) */
.cosmic-bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
}
.cosmic-bg canvas {
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

/* 6. Планета — декор */
.planet-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  filter: blur(0.5px);
  opacity: 0.35;
}
.planet-deco--moon {
  width: clamp(60px, 12vw, 120px);
  height: clamp(60px, 12vw, 120px);
  background: radial-gradient(circle at 30% 30%, #e8e8f0, #6a6a80 60%, transparent 70%);
  animation: planetDrift 28s linear infinite;
}
@keyframes planetDrift {
  0% { transform: translate(-10vw, 20vh) rotate(0deg); }
  50% { transform: translate(95vw, 60vh) rotate(180deg); }
  100% { transform: translate(-10vw, 20vh) rotate(360deg); }
}

/* 7. Утилиты */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.section-block {
  position: relative;
  min-height: var(--section-min-height);
  padding: var(--gap-xl) 0;
}

/* Появление секций (global.js + IntersectionObserver) */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
