﻿:root {
  --bg: #000000;
  --fg: #f4f6ff;
  --fg-soft: #c8d0e6;
  --accent: #77d6ff;
  --accent-soft: rgba(119, 214, 255, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", "Aptos", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  transition: opacity 360ms ease, filter 360ms ease;
}

#intro-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  transition: opacity 360ms ease, transform 360ms ease, filter 360ms ease;
}

.intro-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  pointer-events: none;
  z-index: 20;
  background:
    radial-gradient(1200px 720px at 20% 18%, rgba(104, 168, 230, 0.08), transparent 66%),
    radial-gradient(900px 560px at 82% 18%, rgba(144, 190, 240, 0.06), transparent 68%);
  transition: opacity 360ms ease, transform 360ms ease;
}

.intro-content {
  max-width: 720px;
  text-align: center;
  pointer-events: auto;
  backdrop-filter: blur(1px);
  position: relative;
  z-index: 21;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.75);
  animation: introAmbientBreath 8s ease-in-out infinite;
}

#intro-title {
  margin: 0 0 0.8rem;
  font-size: clamp(1.8rem, 3.8vw, 3.1rem);
  letter-spacing: 0.03em;
  text-shadow: 0 0 30px rgba(140, 220, 255, 0.28);
}

.scene-progress {
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  color: #9eb6d8;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scene-text {
  margin: 0;
  min-height: 2.2rem;
  font-size: clamp(1.45rem, 2.9vw, 2.25rem);
  line-height: 1.25;
  opacity: 0;
  transform: translateY(8px);
  color: #f8fbff;
  transition: opacity 600ms ease, transform 600ms ease;
}

.scene-subtext {
  margin: 0.55rem auto 0;
  min-height: 2rem;
  max-width: 64ch;
  font-size: clamp(1.02rem, 2.1vw, 1.24rem);
  color: #cad5ec;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.scene-text.visible,
.scene-subtext.visible {
  opacity: 1;
  transform: translateY(0);
}

.health-status,
.audio-status {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  color: #9eb6d8;
  letter-spacing: 0.01em;
}

.narration-controls {
  margin: 0.8rem auto 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(145, 211, 255, 0.32);
  background: rgba(9, 21, 37, 0.5);
}

.narration-controls[hidden] {
  display: none;
}

.narration-status {
  font-size: 0.8rem;
  color: #bad0ed;
  padding: 0 0.35rem;
}

.narration-controls button {
  padding: 0.34rem 0.75rem;
  font-size: 0.8rem;
}

.controls {
  margin-top: 1.1rem;
  display: inline-flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
}

.auto-continue-countdown {
  margin: 0.7rem 0 0;
  color: #9eb6d8;
  font-size: 0.86rem;
}

.intro-choice-panel {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(145, 211, 255, 0.35);
  background: rgba(9, 21, 37, 0.72);
}

.intro-choice-title {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  color: #d6e3f9;
}

.intro-choice-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  border: 1px solid rgba(145, 211, 255, 0.5);
  background: rgba(20, 40, 66, 0.4);
  color: var(--fg);
  padding: 0.62rem 1.15rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.96rem;
  box-shadow: inset 0 1px 0 rgba(227, 240, 255, 0.14);
  transition: background-color 220ms ease, transform 200ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

button:hover,
button:focus-visible {
  background: rgba(35, 72, 112, 0.54);
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(115, 188, 238, 0.16), 0 8px 18px rgba(3, 10, 22, 0.34);
}

button.secondary {
  border-color: rgba(160, 176, 209, 0.45);
  background: rgba(36, 40, 58, 0.42);
}

button:disabled {
  opacity: 0.65;
  cursor: default;
}

body.intro-leaving {
  opacity: 0;
  filter: saturate(0.94) brightness(0.96);
}

body.intro-leaving #intro-canvas {
  opacity: 0;
  transform: scale(1.01);
}

body.intro-leaving .intro-overlay {
  opacity: 0;
  transform: translateY(4px);
}

body.intro-arrival-hold #intro-canvas {
  filter: brightness(0.96);
}

body.intro-arrival-hold .intro-content {
  text-shadow: 0 0 24px rgba(140, 220, 255, 0.18), 0 1px 14px rgba(0, 0, 0, 0.75);
}

@keyframes introAmbientBreath {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.96; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-text,
  .scene-subtext,
  button {
    transition: none;
    transform: none;
  }
  .intro-content {
    animation: none;
  }
}
