/*
 * Recorrido inmersivo de la portada. Cada escena es una fotografía a pantalla completa con su texto.
 * Sin JS o con movimiento reducido las escenas se apilan una tras otra. Con JS (`voyage-on`) quedan fijas en un
 * único escenario y el scroll mueve la cámara: empuje hacia delante, fundido entre fotos, paralaje con el ratón y
 * luz tintada por escena (`voyage.js`).
 */

.voyage {
  position: relative;
  background: var(--abyss);
  color: #f4f1ea;
}
.voyage__pin {
  position: relative;
}

/* ---------- Escena (estática: apiladas) ---------- */
.vscene {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.vscene__photo {
  position: absolute;
  inset: 0;
  z-index: -1;
  margin: 0;
  background: var(--abyss);
  transform-origin: 50% 55%;
}
.vscene__photo img {
  display: block;
  width: 100%;
  height: 100%;
}
.vscene__photo img {
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
}
/* Velo de lectura: oscurece el lado del texto y los bordes sin apagar la foto. */
.vscene__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--sc, 90deg), rgba(6, 10, 9, 0.8) 0%, rgba(6, 10, 9, 0.46) 44%, rgba(6, 10, 9, 0) 76%),
    linear-gradient(0deg, rgba(6, 10, 9, 0.78) 0%, rgba(6, 10, 9, 0.34) 32%, rgba(6, 10, 9, 0) 56%),
    linear-gradient(180deg, rgba(6, 10, 9, 0.5) 0%, rgba(6, 10, 9, 0) 22%);
}
.vscene[data-align='right'] {
  --sc: 270deg;
}
.vscene[data-align='center'] .vscene__photo::after {
  background:
    radial-gradient(70% 62% at 50% 50%, rgba(6, 10, 9, 0.6), rgba(6, 10, 9, 0.1) 100%),
    linear-gradient(0deg, rgba(6, 10, 9, 0.66) 0%, rgba(6, 10, 9, 0) 46%),
    linear-gradient(180deg, rgba(6, 10, 9, 0.5) 0%, rgba(6, 10, 9, 0) 22%);
}

/* ---------- Texto de cada escena ---------- */
.vact {
  position: relative;
  align-self: end;
  display: grid;
  gap: 18px;
  max-width: min(780px, 100%);
  padding: 130px calc(var(--gut) + 56px) clamp(70px, 11vh, 130px) var(--gut);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.4);
}
.vscene[data-align='right'] .vact {
  justify-self: end;
  text-align: right;
  justify-items: end;
  padding: 130px var(--gut) clamp(70px, 11vh, 130px) calc(var(--gut) + 56px);
}
.vscene[data-align='center'] .vact {
  align-self: center;
  justify-self: center;
  justify-items: center;
  text-align: center;
  padding: 120px var(--gut) 96px;
}
.vact__kicker {
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: rgba(244, 241, 234, 0.8);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.vact__kicker b {
  font: italic var(--display-weight) 1.4rem / 1 var(--font-display);
  letter-spacing: 0.02em;
  color: var(--accent-hi);
}
.vact__kicker span::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-right: 14px;
  vertical-align: middle;
  background: currentColor;
  opacity: 0.55;
}
.vact__title {
  max-width: 14ch;
  font: var(--display-weight) clamp(2.6rem, 7vw, 6.6rem) / 0.98 var(--font-display);
  letter-spacing: var(--display-track);
  text-wrap: balance;
}
.vscene--hero .vact__title {
  font-size: clamp(3rem, 8.4vw, 8rem);
  max-width: 11ch;
}
.vact__title em {
  font-style: italic;
  color: var(--accent-hi);
}
.vact__text {
  max-width: 46ch;
  color: rgba(244, 241, 234, 0.88);
  font-size: clamp(1.02rem, 1.35vw, 1.22rem);
  text-wrap: pretty;
}
.vact__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.vscene[data-align='right'] .vact__cta {
  justify-content: flex-end;
}
.vscene[data-align='center'] .vact__cta {
  justify-content: center;
}

/* ---------- HUD: etiqueta, contador, progreso y raíl ---------- */
.vhud {
  display: none;
}
.voyage-on .vhud {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}
.in-hero .vhud {
  opacity: 1;
}
.vhud__where {
  position: absolute;
  left: var(--gut);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(244, 241, 234, 0.78);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.vhud__count {
  font: italic var(--display-weight) 1.2rem / 1 var(--font-display);
  letter-spacing: 0.04em;
  color: var(--accent-hi);
}
.vhud__bar {
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
}
.vhud__bar i {
  display: block;
  height: 100%;
  background: var(--accent-hi);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.rail {
  position: absolute;
  right: clamp(14px, 2.4vw, 32px);
  top: 50%;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  transform: translateY(-50%);
}
.rail li {
  width: 9px;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: transparent;
  transition:
    background 0.3s,
    transform 0.3s;
}
.rail li.is-on {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  transform: scale(1.35);
}
@media (max-width: 760px) {
  .rail {
    display: none;
  }
  .vact,
  .vscene[data-align='right'] .vact {
    padding: 110px var(--gut) 92px;
  }
  .vhud__where {
    bottom: 20px;
  }
}

/* ---------- Escenario fijo (voyage-on) ---------- */
.voyage-on .voyage {
  height: var(--voyage-h, 800svh);
}
.voyage-on .voyage__pin {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}
.voyage-on .vscene {
  position: absolute;
  inset: 0;
  min-height: 0;
  visibility: hidden;
}
.voyage-on .vscene.is-near {
  visibility: visible;
}
.voyage-on .vscene__photo {
  will-change: transform, opacity;
}
.voyage-on .vact {
  position: absolute;
  inset: 0;
  align-content: end;
  max-width: none;
  will-change: transform, opacity;
}
.voyage-on .vact > * {
  max-width: min(780px, 100%);
}
.voyage-on .vscene[data-align='right'] .vact > * {
  margin-left: auto;
}
.voyage-on .vscene[data-align='center'] .vact {
  align-content: center;
}
.voyage-on .vscene[data-align='center'] .vact > * {
  margin-inline: auto;
}
.voyage-on .vact:not(.is-live) .vact__cta {
  pointer-events: none;
}
.voyage__light {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background: radial-gradient(
    60% 55% at var(--lx, 62%) var(--ly, 38%),
    rgba(var(--tint, 255, 226, 186), 0.55),
    rgba(var(--tint, 255, 226, 186), 0) 70%
  );
}
.voyage-on .voyage__light {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .voyage-on .voyage {
    height: auto;
  }
}
