/* ==========================================================================
   Viaje a 2TheMoon · Estilos
   Paleta: espacio profundo, dorado luna, cian estelar
   ========================================================================== */

:root {
  --space-deep: #000000;
  --space-mid: #050507;
  --space-blue: #1e3a8a;
  --moon-gold: #fbbf24;
  --star-cyan: #67e8f9;
  --moon-white: #f8fafc;
  --text-soft: rgba(248, 250, 252, 0.75);
  --text-faint: rgba(248, 250, 252, 0.4);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Space Grotesk', -apple-system, sans-serif;
}

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

html, body {
  background: var(--space-deep);
  color: var(--moon-white);
  font-family: var(--font-body);
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  position: relative;
  min-height: 100vh;
}

/* ==========================================================================
   Loader
   ========================================================================== */

#loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #0a0a0d 0%, var(--space-deep) 70%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

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

.loader-content {
  text-align: center;
}

.loader-orbit {
  width: 120px;
  height: 120px;
  margin: 0 auto 40px;
  position: relative;
  animation: spin 4s linear infinite;
}

.loader-planet {
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--star-cyan), var(--space-blue) 60%, var(--space-deep));
  box-shadow: 0 0 40px rgba(103, 232, 249, 0.4);
}

.loader-moon {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--moon-white), var(--moon-gold));
  box-shadow: 0 0 20px var(--moon-gold);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--star-cyan);
  margin-bottom: 16px;
}

.loader-progress {
  width: 280px;
  height: 1px;
  background: rgba(103, 232, 249, 0.2);
  margin: 0 auto 8px;
  overflow: hidden;
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--star-cyan), var(--moon-gold));
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--star-cyan);
}

.loader-percent {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-faint);
}

/* ==========================================================================
   Canvas 3D
   ========================================================================== */

#space-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
}

/* ==========================================================================
   UI Top
   ========================================================================== */

#ui-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: none;
}

#ui-top > * {
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 14px;
  color: var(--moon-white);
}

.brand-mark {
  color: var(--moon-gold);
  font-size: 18px;
  text-shadow: 0 0 12px var(--moon-gold);
}

.ui-controls {
  display: flex;
  gap: 12px;
}

#audio-toggle {
  width: 42px;
  height: 42px;
  background: rgba(10, 14, 39, 0.6);
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: 50%;
  color: var(--star-cyan);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

#audio-toggle:hover {
  border-color: var(--star-cyan);
  background: rgba(103, 232, 249, 0.1);
  box-shadow: 0 0 20px rgba(103, 232, 249, 0.3);
}

#audio-toggle.active {
  color: var(--moon-gold);
  border-color: var(--moon-gold);
}

/* ==========================================================================
   Scroll Hint
   ========================================================================== */

#scroll-hint {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 50;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

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

.scroll-hint-text {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--star-cyan);
  margin-bottom: 12px;
  animation: pulse 2s ease-in-out infinite;
}

.scroll-hint-arrow {
  font-size: 16px;
  color: var(--star-cyan);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

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

/* ==========================================================================
   Journey Progress
   ========================================================================== */

#journey-progress {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 50px;
  align-items: center;
}

.progress-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(103, 232, 249, 0.15);
  transform: translateX(-50%);
  z-index: -1;
}

.progress-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--star-cyan), var(--moon-gold));
  height: 0%;
  transition: height 0.3s ease;
  box-shadow: 0 0 8px var(--star-cyan);
}

.progress-stop {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.progress-stop span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--space-deep);
  border: 1px solid rgba(103, 232, 249, 0.4);
  transition: all 0.4s ease;
  position: relative;
  z-index: 1;
}

.progress-stop label {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  position: absolute;
  right: 20px;
}

.progress-stop:hover label {
  opacity: 1;
}

.progress-stop.active span {
  background: var(--moon-gold);
  border-color: var(--moon-gold);
  box-shadow: 0 0 12px var(--moon-gold);
  transform: scale(1.3);
}

.progress-stop.passed span {
  background: var(--star-cyan);
  border-color: var(--star-cyan);
}

.progress-stop.active label {
  opacity: 1;
  color: var(--moon-gold);
}

/* ==========================================================================
   Scroll container y escenas
   ========================================================================== */

#scroll-container {
  position: relative;
  z-index: 10;
}

.scene {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 60px;
  position: relative;
}

.scene-launch    { justify-content: center; text-align: center; }
.scene-earth     { justify-content: flex-start; }
.scene-asteroids { justify-content: flex-end; text-align: right; }
.scene-satellite { justify-content: flex-start; }
.scene-moon      { justify-content: center; text-align: center; }

.scene-content {
  max-width: 560px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  position: relative;
  padding: 36px 40px;
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(5, 5, 12, 0.65) 60%,
    rgba(10, 14, 39, 0.45) 100%);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 20px;
  box-shadow:
    0 0 60px rgba(0, 0, 0, 0.6),
    0 0 1px rgba(103, 232, 249, 0.3) inset;
}

/* Brillo sutil en el borde superior */
.scene-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(103, 232, 249, 0.6),
    rgba(251, 191, 36, 0.4),
    transparent);
}

/* Escena Tierra y Luna: viñeta extra para máximo contraste */
.scene-earth::before,
.scene-moon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(0, 0, 0, 0.4) 80%
  );
  pointer-events: none;
  z-index: -1;
}

/* Escena luna: panel del texto más opaco para asegurar legibilidad sobre el satélite */
.scene-moon .scene-content {
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(5, 5, 12, 0.85) 60%,
    rgba(10, 14, 39, 0.75) 100%);
  box-shadow:
    0 0 80px rgba(0, 0, 0, 0.85),
    0 0 1px rgba(251, 191, 36, 0.4) inset;
  border-color: rgba(251, 191, 36, 0.25);
}

/* Escena de despegue: título enorme sin backdrop card, solo sombras potentes */
.scene-launch .scene-content {
  max-width: 100%;
  padding: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

.scene-launch .scene-content::before {
  display: none;
}

.scene-launch .scene-title {
  text-shadow:
    0 0 1px rgba(0, 0, 0, 1),
    0 6px 30px rgba(0, 0, 0, 1),
    0 0 80px rgba(0, 0, 0, 1),
    0 0 140px rgba(103, 232, 249, 0.35);
  letter-spacing: -0.02em;
}

.scene-launch .scene-sub {
  font-size: 22px;
  font-weight: 500;
  color: rgba(248, 250, 252, 1);
  letter-spacing: 0.5px;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 1),
    0 0 30px rgba(0, 0, 0, 0.9),
    0 0 60px rgba(103, 232, 249, 0.2);
  padding: 12px 28px;
  display: inline-block;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 100px;
  border: 1px solid rgba(103, 232, 249, 0.2);
}

.scene-launch .countdown {
  margin-top: 50px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 14px 28px;
  display: inline-block;
  border-radius: 100px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 1),
    0 0 20px rgba(251, 191, 36, 0.6);
}

.scene.in-view .scene-content {
  opacity: 1;
  transform: translateY(0);
}

.scene-asteroids .scene-content ul {
  list-style: none;
  text-align: right;
}

.scene-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--moon-gold);
  margin-bottom: 16px;
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 0.9),
    0 0 18px rgba(251, 191, 36, 0.6);
}

.scene-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
  text-shadow:
    0 2px 12px rgba(0, 0, 0, 0.95),
    0 0 30px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(103, 232, 249, 0.15);
}

.scene-launch .scene-title {
  font-size: clamp(48px, 9vw, 110px);
  font-weight: 900;
  letter-spacing: -1px;
}

.moon-word {
  color: #fbbf24;
  -webkit-text-fill-color: #fbbf24;
  display: inline-block;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 1),
    0 4px 16px rgba(0, 0, 0, 1),
    0 0 30px rgba(251, 191, 36, 0.7),
    0 0 70px rgba(103, 232, 249, 0.45),
    0 0 120px rgba(251, 191, 36, 0.3);
  animation: moonGlow 4s ease-in-out infinite;
}

@keyframes moonGlow {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(103, 232, 249, 0.5));
  }
}

.scene-sub {
  font-size: 18px;
  line-height: 1.65;
  color: rgba(248, 250, 252, 0.92);
  margin-bottom: 32px;
  font-weight: 400;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.scene-list {
  list-style: none;
}

.scene-list li {
  padding: 12px 0;
  border-bottom: 1px solid rgba(103, 232, 249, 0.2);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: rgba(248, 250, 252, 0.95);
  position: relative;
  padding-left: 24px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.scene-asteroids .scene-list li {
  padding-left: 0;
  padding-right: 24px;
}

.scene-list li::before {
  content: '◇';
  position: absolute;
  left: 0;
  color: var(--star-cyan);
  font-size: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.scene-asteroids .scene-list li::before {
  left: auto;
  right: 0;
}

.countdown {
  margin-top: 60px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--moon-gold);
  text-shadow: 0 0 20px var(--moon-gold);
}

.countdown span {
  font-size: 24px;
  margin-left: 8px;
}

/* ==========================================================================
   CTA final
   ========================================================================== */

.cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 40px 0 60px;
}

.cta-primary, .cta-secondary {
  display: inline-block;
  padding: 18px 36px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-decoration: none;
  border-radius: 100px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.cta-primary {
  background: linear-gradient(135deg, var(--moon-gold), #f59e0b);
  color: var(--space-deep);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}

.cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.7);
}

.cta-secondary {
  background: transparent;
  color: var(--star-cyan);
  border: 1px solid var(--star-cyan);
}

.cta-secondary:hover {
  background: rgba(103, 232, 249, 0.1);
  box-shadow: 0 0 30px rgba(103, 232, 249, 0.3);
}

.footer-credit {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid rgba(103, 232, 249, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  height: 40px;
  opacity: 0.8;
}

.footer-credit p {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-faint);
  font-family: var(--font-display);
}

/* ==========================================================================
   Responsive · Mobile
   ========================================================================== */

@media (max-width: 768px) {
  #ui-top {
    padding: 16px 20px;
  }

  .brand-text {
    font-size: 12px;
    letter-spacing: 2px;
  }

  #journey-progress {
    right: 14px;
    gap: 30px;
  }

  .progress-stop label {
    display: none;
  }

  .scene {
    padding: 80px 24px;
  }

  .scene-asteroids {
    justify-content: flex-start;
    text-align: left;
  }

  .scene-asteroids .scene-content ul {
    text-align: left;
  }

  .scene-asteroids .scene-list li {
    padding-left: 24px;
    padding-right: 0;
  }

  .scene-asteroids .scene-list li::before {
    left: 0;
    right: auto;
  }

  .scene-sub {
    font-size: 16px;
  }

  .cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-primary, .cta-secondary {
    text-align: center;
    padding: 16px 24px;
  }

  #scroll-hint {
    bottom: 24px;
  }

  .scroll-hint-text {
    font-size: 9px;
    letter-spacing: 3px;
  }
}

@media (max-width: 480px) {
  .scene-launch .scene-title {
    font-size: 42px;
  }

  .scene-title {
    font-size: 32px;
  }

  .scene-sub {
    font-size: 15px;
  }
}

/* Reducir motion para accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
