:root {
  --bg: #050508;
  --bg-deep: #020204;
  --fg: #e8e4dc;
  --fg-dim: #a09a90;
  --muted: #5a554e;
  --accent: #d4a04a;
  --accent-glow: rgba(212, 160, 74, 0.35);
  --teal: #2dd4a8;
  --teal-glow: rgba(45, 212, 168, 0.2);
  --card: rgba(12, 12, 18, 0.75);
  --border: rgba(100, 90, 80, 0.25);
  --crack: #ff6b35;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg);
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  line-height: 1.7;
}

.font-display { font-family: 'Orbitron', monospace; }

/* ===== Фон: звёздное поле ===== */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Туманности ===== */
.nebula-layer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  background:
    radial-gradient(ellipse 600px 400px at 15% 20%, rgba(212, 160, 74, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 60%, rgba(45, 212, 168, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 800px 300px at 50% 90%, rgba(180, 60, 30, 0.05) 0%, transparent 70%);
}

/* ===== Контент поверх фона ===== */
.content-layer {
  position: relative;
  z-index: 10;
}

/* ===== Scroll-reveal анимации ===== */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }
.reveal-delay-4 { transition-delay: 0.6s; }

/* ===== Hero ===== */
.hero-title {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 50%, var(--teal) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 200;
  color: var(--fg-dim);
  max-width: 600px;
}

/* ===== Стрелка-скролл ===== */
.scroll-hint { animation: scrollBounce 2.5s ease-in-out infinite; }
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(12px); opacity: 1; }
}

/* ===== Трещина-разделитель ===== */
.crack-divider {
  width: 100%;
  height: 120px;
  position: relative;
  overflow: hidden;
}
.crack-divider svg {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
}
.crack-line {
  stroke: var(--crack);
  stroke-width: 2;
  fill: none;
  filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.6)) drop-shadow(0 0 20px rgba(255, 107, 53, 0.3));
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
}
.crack-divider.visible .crack-line {
  animation: crackDraw 2s ease forwards;
}
@keyframes crackDraw {
  to { stroke-dashoffset: 0; }
}

/* ===== Карточки теорий ===== */
.theory-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}
.theory-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.theory-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 160, 74, 0.4);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px var(--accent-glow);
}
.theory-card:hover::before { opacity: 1; }

.theory-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
  flex-shrink: 0;
}

/* ===== Числовые факты ===== */
.fact-number {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1;
}
.fact-unit {
  font-size: 0.4em;
  font-weight: 400;
  color: var(--fg-dim);
  vertical-align: middle;
}

/* ===== Таймлайн ===== */
.timeline-line {
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--accent), var(--teal), transparent);
}
.timeline-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  position: relative;
  z-index: 2;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.timeline-dot.active {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== Разлом пространства ===== */
.space-rip {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.rip-core {
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, var(--crack) 30%, #fff 50%, var(--crack) 70%, transparent 100%);
  filter: blur(1px);
  box-shadow: 0 0 30px rgba(255,107,53,0.5), 0 0 80px rgba(255,107,53,0.2);
  animation: ripPulse 3s ease-in-out infinite;
}
@keyframes ripPulse {
  0%, 100% { opacity: 0.7; transform: scaleX(1); }
  50% { opacity: 1; transform: scaleX(2); }
}
.rip-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 53, 0.3);
  animation: ringExpand 4s ease-out infinite;
}
.rip-ring:nth-child(2) { animation-delay: 1s; }
.rip-ring:nth-child(3) { animation-delay: 2s; }
.rip-ring:nth-child(4) { animation-delay: 3s; }
@keyframes ringExpand {
  0% { width: 10px; height: 10px; opacity: 0.8; }
  100% { width: 600px; height: 600px; opacity: 0; }
}

/* ===== Плавающие частицы ===== */
.float-particle {
  position: absolute;
  width: 3px; height: 3px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: floatUp 6s ease-in-out infinite;
}
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(0); }
  20% { opacity: 0.6; transform: translateY(-30px) scale(1); }
  80% { opacity: 0.3; transform: translateY(-150px) scale(0.5); }
  100% { opacity: 0; transform: translateY(-200px) scale(0); }
}

/* ===== Навигация ===== */
.nav-link {
  position: relative;
  color: var(--fg-dim);
  transition: color 0.3s ease;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-link:hover { color: var(--fg); }
.nav-link:hover::after { width: 100%; }

/* ===== Кнопка ===== */
.btn-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, var(--accent), #b8862e);
  color: var(--bg);
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

/* ===== Акцентная линия ===== */
.accent-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  border-radius: 2px;
}

/* ===== Цитата ===== */
.quote-block {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  font-style: italic;
  color: var(--fg-dim);
  font-weight: 300;
  font-size: 1.15rem;
}

/* ===== Мобильное меню ===== */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.mobile-menu.open { transform: translateX(0); }

/* ===== Пульсирующая точка ===== */
.pulse-dot {
  width: 8px; height: 8px;
  background: var(--teal);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 168, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(45, 212, 168, 0); }
}

/* ===== Прогресс-бар скролла ===== */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ===== Свечение-орб ===== */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.15;
}

/* ===== Снижение анимаций ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 768px) {
  .theory-card { padding: 1.5rem; }
  .space-rip { height: 250px; }
}