/* ============================================
   Рождение формы — Styles
   Canvas-based frame rendering
   ============================================ */

:root {
  --color-bg: #0D0D0D;
  --color-bg-deep: #080808;
  --color-text: #FFFFFF;
  --color-text-muted: rgba(255, 255, 255, 0.4);
  --color-silver: #A0A0A0;
  --color-gold: #C8A962;

  --font-display: Georgia, 'Times New Roman', 'Noto Serif', serif;
  --font-body: 'Segoe UI', 'Helvetica Neue', Arial, system-ui, sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  overflow-x: hidden;
  overscroll-behavior: none;
}

::selection {
  background: rgba(200, 169, 98, 0.3);
  color: var(--color-text);
}

/* ============================================
   Preloader
   ============================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--color-bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.preloader-bar {
  width: 160px;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.preloader-fill {
  height: 100%;
  width: 0%;
  background: var(--color-gold);
  transition: width 0.3s ease;
}

.preloader-text {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ============================================
   Canvas
   ============================================ */
#stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: var(--color-bg-deep);
}

/* ============================================
   Vignette
   ============================================ */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    transparent 0%,
    rgba(13, 13, 13, 0.3) 60%,
    rgba(13, 13, 13, 0.7) 100%
  );
}

/* ============================================
   Light Pulse
   ============================================ */
.light-pulse {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 60%
  );
  opacity: 0;
  will-change: opacity;
}

/* ============================================
   Text Layer
   ============================================ */
.text-layer {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.text-block {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  will-change: opacity, transform;
  width: 90%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.text-accent {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--color-text);
  text-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

.text-body {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.8vw, 1.25rem);
  font-weight: 300;
  letter-spacing: 0.15em;
  line-height: 1.6;
  color: var(--color-text-muted);
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
}

[data-text="finale"] {
  gap: 24px;
}

.text-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: var(--color-text);
  text-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
}

.text-subtitle {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  line-height: 1.6;
  color: var(--color-silver);
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
  max-width: 500px;
}

/* ============================================
   Scroll Spacer
   ============================================ */
.scroll-spacer {
  position: relative;
  z-index: 0;
  width: 1px;
  height: 600vh;
  pointer-events: none;
}

/* ============================================
   Scroll Hint
   ============================================ */
.scroll-hint {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 1;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.scroll-hint.hidden {
  opacity: 0;
}

.scroll-hint-text {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.scroll-hint-arrow {
  color: var(--color-text-muted);
  animation: scrollBounce 2s ease infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.05);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-silver));
  will-change: width;
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint-arrow {
    animation: none;
  }
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 768px) {
  .text-block {
    width: 92%;
  }

  .text-accent {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .text-body {
    font-size: clamp(0.8rem, 3vw, 1rem);
    letter-spacing: 0.1em;
  }

  .text-title {
    font-size: clamp(2.5rem, 12vw, 4.5rem);
  }

  .text-subtitle {
    font-size: clamp(0.75rem, 2.5vw, 0.95rem);
    letter-spacing: 0.12em;
  }

  .scroll-hint {
    bottom: 32px;
  }

  .vignette {
    background: radial-gradient(
      ellipse 80% 80% at 50% 50%,
      transparent 0%,
      rgba(13, 13, 13, 0.4) 60%,
      rgba(13, 13, 13, 0.8) 100%
    );
  }
}
