/* ==========================================================================
   GRUPO LOSIGO (losigo.pro) - INTRO 3D THREE.JS PARTICLES STYLES
   Narrativa cronológica de 15 escenas con morfismo de partículas y glifos mayas
   ========================================================================== */

#intro-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  z-index: 2000;
  background: #000000;
  overflow: hidden;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.85s;
  opacity: 1;
  visibility: visible;
  color: #ffffff;
  font-family: var(--font-ui, 'Inter', system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

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

#canvas-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

#canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 58%, rgba(0,0,0,0.55) 100%);
}

#ui {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* ---- Cartel editorial centrado (mismo tratamiento del prólogo) ---- */
#story-card {
  position: absolute;
  inset: 0;
  display: none !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 70px 28px;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .85s ease, transform .85s ease;
}

#story-card.show {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
}

#card-brand {
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: clamp(.72rem, 1.5vw, .9rem);
  font-weight: 600;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 24px;
}

#card-brand .hl {
  color: var(--fenix-orange, #ff7e00);
}

#card-text {
  font-family: var(--font-editorial, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.18rem, 2.6vw, 1.65rem);
  line-height: 1.55;
  color: #f3dcb0;
  max-width: 680px;
  margin: 0 0 22px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.95);
}

#card-sub {
  font-family: var(--font-ui, 'Inter', sans-serif);
  font-size: clamp(.65rem, 1.2vw, .78rem);
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #ff9a2e;
  margin: 0;
}

/* Botón secundario discreto: Ver Presentación Completa (15 escenas) - Debajo de #card-sub en slide 01/02 */
.btn-story-secondary {
  display: none;
  align-items: center;
  justify-content: center;
  margin-top: 28px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid rgba(242, 180, 105, 0.45);
  background: rgba(18, 9, 2, 0.85);
  color: #f3dcb0;
  font: 600 .74rem var(--font-ui, 'Inter', sans-serif);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
  pointer-events: auto !important;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .8s ease .15s, transform .8s ease .15s, background .25s ease, border-color .25s ease, color .25s ease;
}

#story-card.show .btn-story-secondary.show,
#story-card.show .btn-story-secondary {
  opacity: 1;
  pointer-events: auto !important;
  transform: translateY(0);
}

.btn-story-secondary:hover {
  background: linear-gradient(135deg, rgba(242, 180, 105, 0.25), rgba(255, 126, 0, 0.35));
  border-color: #ff9a2e;
  color: #ffffff;
  transform: translateY(-1px);
}

/* ---- Contenedor y Botón final al centro ---- */
#final-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 780px);
  z-index: 30;
}

#enter-final {
  opacity: 0;
  pointer-events: none;
  padding: 17px 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 160, 0.6);
  background: linear-gradient(135deg, #f2b469, #ff7e00);
  color: #140800;
  font: 600 .8rem var(--font-ui, 'Inter', sans-serif);
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 0 36px rgba(255,126,0,.5), 0 0 90px rgba(255,126,0,.22);
  transform: scale(.94);
  transition: opacity .9s ease, transform .9s ease;
}

#enter-final.show {
  opacity: 1;
  pointer-events: auto !important;
  transform: scale(1);
  animation: glow 2.8s ease-in-out infinite;
}

#enter-final.show:hover {
  transform: scale(1.05);
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 30px rgba(255,126,0,.42), 0 0 80px rgba(255,126,0,.18); }
  50% { box-shadow: 0 0 52px rgba(255,126,0,.75), 0 0 130px rgba(255,126,0,.34); }
}



/* ---- Leyenda final (bajo el botón central) ---- */
#final-tagline {
  margin-top: 36px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .9s ease .3s, transform .9s ease .3s;
  transform: translateY(8px);
}

#final-tagline.show {
  opacity: 1;
  pointer-events: auto !important;
  transform: translateY(0);
}

.ft-kicker {
  margin: 0 0 10px;
  font: 600 .7rem var(--font-ui, 'Inter', sans-serif);
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #ff9a2e;
}

.ft-text {
  margin: 0 0 16px;
  font-family: var(--font-editorial, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.5;
  color: #f3dcb0;
  text-shadow: 0 4px 24px rgba(0,0,0,0.95);
}




/* ---- Navegación inferior centrada: ‹ Anterior · 01 / 15 · Siguiente › ---- */
#bottom-bar {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 20;
  white-space: nowrap;
  pointer-events: none;
}

#step-counter {
  font: 600 .7rem var(--font-ui, 'Inter', sans-serif);
  letter-spacing: .22em;
  color: rgba(243, 220, 176, 0.65);
  min-width: 64px;
  text-align: center;
  pointer-events: none;
}

.nav-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(242, 180, 105, 0.32);
  background: rgba(18, 9, 2, 0.62);
  color: #f3dcb0;
  font: 600 .72rem var(--font-ui, 'Inter', sans-serif);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.55);
  transition: all .3s ease;
}

.nav-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #f2b469, #ff7e00);
  color: #140800;
  border-color: #ff9a2e;
}

.nav-btn:disabled {
  opacity: .28;
  cursor: default;
  box-shadow: none;
}

.nav-btn .arr {
  font-size: 1.2rem;
  line-height: 1;
  margin-top: -2px;
}

/* ---- Saltar Intro / Entrar al sitio (por encima de loading screen) ---- */
#skip-btn {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: calc(18px + env(safe-area-inset-right));
  z-index: 150;
  pointer-events: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(242, 180, 105, 0.5);
  background: rgba(18, 9, 2, 0.72);
  color: #f3dcb0;
  font: 600 .75rem var(--font-ui, 'Inter', sans-serif);
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,0.65), 0 0 15px rgba(255,126,0,0.14);
  transition: all .3s ease, opacity .6s ease;
}

#skip-btn:hover {
  background: linear-gradient(135deg, #f2b469, #ff7e00);
  color: #140800;
  border-color: #ff9a2e;
}

#skip-btn.hidden {
  opacity: 0;
  pointer-events: none !important;
  visibility: hidden;
}

/* Indicador de escenas lateral (Dots) */
#dots {
  position: absolute;
  right: calc(20px + env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 11px;
  pointer-events: auto;
}

.dot {
  position: relative;
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.2);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: all .45s ease;
}

.dot::after {
  content: '';
  position: absolute;
  inset: -9px;
}

.dot:hover {
  background: rgba(255,255,255,0.5);
}

.dot.active {
  background: var(--fenix-orange, #ff7e00);
  height: 18px;
  box-shadow: 0 0 10px var(--fenix-orange, #ff7e00);
}

/* Pantalla de carga / inicio */
.loading-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity .5s ease;
}

.brand-mark {
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 32px;
}

.brand-mark span {
  color: var(--fenix-orange, #ff7e00);
}

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.06);
  border-top-color: var(--fenix-orange, #ff7e00);
  border-right-color: #f2b469;
  animation: spin .9s linear infinite;
}

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

#leave-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .8s ease;
}

#intro-container.leaving #leave-overlay {
  opacity: 1;
}

/* ==========================================================================
   RESPONSIVIDAD MÓVIL
   ========================================================================== */
@media (max-width: 600px) {
  #skip-btn {
    padding: 8px 15px;
    font-size: .64rem;
    letter-spacing: .12em;
    top: calc(14px + env(safe-area-inset-top));
    right: calc(14px + env(safe-area-inset-right));
  }
  #bottom-bar {
    gap: 10px;
  }
  .nav-btn {
    padding: 9px 14px;
    font-size: .66rem;
    letter-spacing: .1em;
    gap: 6px;
  }
  #step-counter {
    min-width: 56px;
    font-size: .66rem;
    letter-spacing: .16em;
  }
  #dots {
    right: calc(8px + env(safe-area-inset-right));
    gap: 8px;
  }
  #story-card {
    padding: 70px 36px;
  }
  .ft-kicker {
    font-size: .62rem;
    letter-spacing: .24em;
  }
  .ft-text {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  #enter-final {
    padding: 15px 24px;
    font-size: .7rem;
    letter-spacing: .13em;
  }
  .final-link-pill {
    padding: 6px 12px;
    font-size: 0.62rem;
  }
}
