/* Viaje interactivo: el camino de la ludopatía — scrollytelling con ilustraciones de fondo. */

.viaje {
  position: relative;
  background: var(--teal-dark);
  color: #fff;
}

.viaje-intro {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(20,36,72,.45) 0%, rgba(5,10,22,.93) 65%),
    url('../img/viaje-ludopatia/1-chip.webp') center 32% / cover no-repeat;
}

.viaje-intro .container { position: relative; z-index: 2; max-width: 760px; }

.viaje-intro .eyebrow { color: var(--lime); }

.viaje-intro h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 20px;
  color: #fff;
}

.viaje-intro h1 strong { color: var(--lime); font-weight: 700; }

.viaje-intro p.lead {
  font-size: 1.1rem;
  color: #c9d2e6;
  max-width: 540px;
  margin: 0 0 28px;
}

.viaje-scrollcue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: .04em;
  color: #8fa0c4;
}

.viaje-scrollcue .dot-anim {
  width: 22px; height: 34px;
  border: 2px solid #8fa0c4;
  border-radius: 14px;
  position: relative;
  flex: none;
}

.viaje-scrollcue .dot-anim::after {
  content: '';
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: var(--lime);
  border-radius: 2px;
  animation: viaje-scroll-bounce 1.6s ease-in-out infinite;
}

@keyframes viaje-scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(10px); opacity: .3; }
}

/* ---------- Escenario pegado (una sola ventana fija + capas en crossfade) ---------- */

.viaje-track {
  position: relative;
}

.viaje-stage-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.viaje-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--teal-dark);
  overflow: hidden;
}

.viaje-bg-layer {
  position: absolute;
  inset: -8% -2%;
  opacity: 0;
  transition: opacity 1.3s cubic-bezier(.22,.9,.32,1);
  will-change: transform;
}

.viaje-bg-layer.is-active { opacity: 1; z-index: 1; }

.viaje-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 9s cubic-bezier(.22,.9,.32,1);
}

.viaje-bg-layer.is-active .viaje-bg-img { transform: scale(1.14); }

.viaje-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(5,10,22,.88) 0%, rgba(5,10,22,.4) 42%, rgba(5,10,22,.18) 65%, rgba(5,10,22,.55) 100%),
    radial-gradient(ellipse at center, rgba(5,10,22,0) 28%, rgba(5,10,22,.55) 100%);
  z-index: 1;
}

.viaje-card {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  max-width: 560px;
  width: calc(100% - 48px);
  background: rgba(5,10,22,.6);
  border: 1px solid rgba(232,196,104,.25);
  box-shadow: 0 30px 70px rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 34px 36px;
  overflow: hidden;
}

.viaje-card-inner {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .4s cubic-bezier(.22,.9,.32,1), transform .4s cubic-bezier(.22,.9,.32,1);
}

.viaje-card-inner.is-switching {
  opacity: 0;
  transform: translateY(16px);
  transition-duration: .28s;
}

.viaje-card .viaje-step {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 10px;
}

.viaje-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  margin: 0 0 14px;
  color: #fff;
}

.viaje-card p {
  color: #d3dbee;
  font-size: 1.02rem;
  line-height: 1.6;
  margin: 0;
}

/* Numeración lateral con barra de avance del paso actual */
.viaje-railnum {
  position: absolute;
  z-index: 3;
  right: clamp(20px, 4vw, 56px);
  bottom: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  color: #fff;
}

.viaje-railnum-current {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  min-width: 20px;
  text-align: right;
}

.viaje-railnum-bar {
  position: relative;
  width: 64px;
  height: 2px;
  background: rgba(255,255,255,.22);
  border-radius: 2px;
  overflow: hidden;
}

.viaje-railnum-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: var(--lime);
  transition: width .5s cubic-bezier(.22,.9,.32,1);
}

.viaje-railnum-total {
  font-size: 12px;
  color: #8fa0c4;
  letter-spacing: .02em;
}

/* ---------- Navegación de puntos ---------- */

.viaje-dots {
  position: fixed;
  left: 0; right: 0; bottom: 26px;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}

.viaje.is-active .viaje-dots { opacity: 1; pointer-events: auto; }

.viaje-dots-label {
  position: absolute;
  bottom: 28px;
  left: 24px;
  font-size: 12.5px;
  color: #aab6d4;
  letter-spacing: .03em;
}

.viaje-dot {
  position: relative;
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.viaje-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transition: background .3s cubic-bezier(.22,.9,.32,1), transform .3s cubic-bezier(.22,.9,.32,1), box-shadow .3s ease;
}

.viaje-dot:hover::before { background: rgba(255,255,255,.7); }

.viaje-dot.is-current::before {
  background: var(--lime);
  transform: scale(1.7);
  box-shadow: 0 0 0 4px rgba(232,196,104,.2);
}

.viaje-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--lime);
  z-index: 101;
  width: 0%;
  transition: width .15s linear;
}

/* ---------- Cierre ---------- */

.viaje-outro {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(20,36,72,.4) 0%, rgba(5,10,22,.93) 68%),
    url('../img/viaje-ludopatia/8-puerta.webp') center 38% / cover no-repeat;
  padding: 80px 24px;
}

.viaje-outro .container { max-width: 620px; }

.viaje-outro h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  color: #fff;
  margin: 0 0 18px;
}

.viaje-outro p {
  color: #c9d2e6;
  font-size: 1.08rem;
  margin: 0 0 32px;
}

.viaje-outro .viaje-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.viaje-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aab6d4;
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 26px;
}

.viaje-back:hover { color: var(--lime); }

@media (max-width: 760px) {
  .viaje-card { padding: 26px 24px; width: calc(100% - 32px); }
  .viaje-dots-label { display: none; }
  .viaje-railnum { display: none; }
}

/* Movimiento reducido: sin Ken Burns ni animación del cursor de scroll, solo el cambio de tarjeta */
@media (prefers-reduced-motion: reduce) {
  .viaje-scrollcue .dot-anim::after,
  .viaje-bg-img {
    animation: none !important;
    transition-duration: .01s !important;
  }
  .viaje-card-inner { transition-duration: .01s; }
}
