/* ============ Главная страница: сцена со скролл-хореографией ============ */

html, body {
  overflow: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg-gradient);
}

/* ---------- космический фон ---------- */
#cosmic-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.star {
  fill: var(--text-primary);
  opacity: 0.3;
  animation: twinkle var(--dur, 5s) ease-in-out var(--d, 0s) infinite;
  transform-origin: center;
}

.star--gold {
  fill: var(--accent-gold);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.constellation-line {
  stroke: var(--accent-silver);
  stroke-width: 0.6;
  opacity: 0.2;
}

.constellation-star {
  fill: var(--accent-silver);
  opacity: 0.55;
}

#comet-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ---------- силуэты: 4 фигуры, разнесённые по всей странице ---------- */
.fig-scatter {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.fig-silhouette {
  position: absolute;
  width: auto;
  max-width: none;
  opacity: 0.8;
  pointer-events: none;
  filter: drop-shadow(0 0 42px var(--silhouette-glow, rgba(227, 189, 103, 0.3)));
}

/* дальний верхний угол слева — небольшая, не на переднем плане */
.fig-silhouette--1 {
  left: 3%;
  top: 6%;
  height: 38vh;
  opacity: 0.68;
}

/* верхняя середина слева */
.fig-silhouette--2 {
  left: 25%;
  top: 9%;
  height: 40vh;
  opacity: 0.72;
}

/* нижняя середина справа */
.fig-silhouette--3 {
  left: 68%;
  bottom: 2%;
  height: 40vh;
  opacity: 0.72;
}

/* правая фигура, вверху у края */
.fig-silhouette--4 {
  right: 3%;
  top: 7%;
  height: 46vh;
}

/* ---------- шапка ---------- */
.site-header {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  pointer-events: none;
}

.site-header__mark {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: var(--tracking-wider);
  color: var(--text-primary);
}

.site-header__tag {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.62rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- заголовок ---------- */
.reveal-text {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  margin: 0;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  animation: reveal-in 1.4s var(--ease-soft) both;
  animation-delay: 0.2s;
}

.reveal-text__inner {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 9vw, 8.5rem);
  color: var(--text-primary);
  white-space: nowrap;
  text-shadow: 0 0 34px var(--glow-gold);
  letter-spacing: 0.01em;
}

.reveal-line {
  display: inline;
}

.reveal-line + .reveal-line::before {
  content: ' ';
}

@keyframes reveal-in {
  from {
    opacity: 0;
    letter-spacing: 0.34em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.02em;
  }
}

/* ---------- финальная кнопка ---------- */
.final-cta {
  position: fixed;
  bottom: 12%;
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  animation: cta-in 0.9s var(--ease-soft) both;
  animation-delay: 0.9s;
}

.final-cta__secondary {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.final-cta__secondary:hover {
  color: var(--accent-gold);
  border-color: var(--glow-gold);
}

@keyframes cta-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- доступность: уважение reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .star,
  .reveal-text,
  .final-cta {
    animation: none !important;
    opacity: 1;
  }
}

/* ---------- мобильная адаптация ---------- */
@media (max-width: 767px) {
  .site-header {
    top: 18px;
  }

  .fig-silhouette--1 {
    left: -4%;
    bottom: 0;
    height: 48vh;
  }

  .fig-silhouette--2,
  .fig-silhouette--3 {
    display: none;
  }

  .fig-silhouette--4 {
    right: -6%;
    top: auto;
    bottom: 0;
    height: 52vh;
  }

  .reveal-text {
    top: 40%;
    width: 100vw;
    padding: 0 8vw;
  }

  .reveal-text__inner {
    white-space: normal;
    font-size: clamp(2.4rem, 15vw, 4.2rem);
  }

  .reveal-text__inner,
  .reveal-line {
    display: flex;
    flex-direction: column;
  }

  .reveal-line {
    display: block;
    line-height: 1.08;
  }

  .reveal-line + .reveal-line::before {
    content: none;
  }

  .reveal-line:nth-child(1) { align-self: flex-start; }
  .reveal-line:nth-child(2) { align-self: center; }
  .reveal-line:nth-child(3) { align-self: flex-end; }

  .final-cta {
    bottom: 8%;
  }
}
