:root {
  --void: #010103;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: #eaf2ff;
  font-family: 'Cormorant Garamond', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  cursor: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

/* Cinematic depth — a soft focus vignette over the render. */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(125% 95% at 50% 48%, transparent 38%, rgba(1, 2, 8, 0.62) 100%);
}

/* Subtle film grain for a modern, filmic texture. */
.grain {
  position: fixed;
  inset: -200%;
  width: 500%;
  height: 500%;
  pointer-events: none;
  z-index: 4;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.5s steps(2) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(-3%, 2%); }
}

/* Poetic words — appear and dissolve, never instruct. */
.word {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.6rem, 6vw, 3.4rem);
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  white-space: nowrap;
  color: rgba(236, 244, 255, 0.92);
  text-shadow: 0 0 28px rgba(150, 180, 255, 0.5);
  opacity: 0;
  transition: opacity 2.6s ease;
}
.word.show { opacity: 1; }
.word.outro { font-size: clamp(1.2rem, 4.4vw, 2.2rem); letter-spacing: 0.5em; text-indent: 0.5em; }

.restart {
  position: fixed;
  left: 50%;
  bottom: max(38px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 6;
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-style: italic;
  font-size: 0.92rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(220, 232, 255, 0.62);
  text-shadow: 0 0 18px rgba(150, 180, 255, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease, color 0.6s ease;
}
.restart.show { opacity: 1; pointer-events: auto; }
.restart:hover { color: rgba(255, 255, 255, 0.95); }

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}
