/* Una secuencia: atravesar la marca y entrar al mapa de BikesExp.
 * El scroll es el reloj. No hay reproducción automática ni scroll secuestrado.
 * El estado sin script es una portada completa, no una pantalla de carga.
 */
.hero {
  position: relative;
  min-height: 100svh;
  isolation: isolate;
}
.hero__stage {
  position: relative;
  height: max(52rem, 100svh);
  overflow: clip;
  isolation: isolate;
  background: var(--bx-canvas);
}
.hero__scene { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero__ground {
  position: absolute;
  inset: -12%;
  background: var(--bx-map) url('../img/ciudad-vector.svg') 42% 65% / cover no-repeat;
  transform: scale(1.2) rotate(-7deg);
  transform-origin: 60% 55%;
}
.hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5,6,15,.3), transparent 82%),
    linear-gradient(0deg, var(--bx-canvas), transparent 62%);
}
.hero__portal { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 25%; }
.hero__portal-svg { display: block; overflow: visible; }
.hero__portal text { font-family: var(--bx-display); font-weight: 700; font-size: min(19vw, 22svh); letter-spacing: -.03em; }
.hero__outline { fill: none; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hero__copy {
  position: absolute;
  z-index: 2;
  left: var(--bx-margin);
  bottom: 8rem;
  max-width: 36rem;
  display: grid;
  gap: 1.5rem;
}
.hero h1 { font-size: clamp(3.5rem, 7.8vw, 6rem); line-height: .9; letter-spacing: -.025em; }
.hero h1 span { display: block; }
.hero h1 span:last-child { color: var(--bx-cyan); }
.hero .lead { max-width: 39ch; font-size: 1.125rem; color: var(--bx-ink-muted); }
.hero__note {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  font-size: .8125rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bx-silver);
}
.hero__device-wrap {
  position: absolute;
  right: 13%;
  bottom: 6rem;
  width: min(22vw, 20svh, 22rem);
  transform: perspective(1400px) rotateY(-22deg) rotateZ(12deg);
  transform-origin: center;
}
.hero .device { width: 100%; aspect-ratio: 9 / 20; border-width: 4px; }
.hero .device img { object-fit: contain; transform: none; }
.hero__caption {
  margin-top: 1rem;
  text-align: center;
  color: var(--bx-silver);
  font-size: .8125rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero__cue {
  position: absolute;
  left: var(--bx-margin);
  bottom: 4.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 44px;
  color: var(--bx-ink);
  text-decoration: none;
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .16em;
}
.hero__cue svg { transition: transform 180ms var(--bx-ease); }
.hero__cue:hover svg { transform: translateY(5px); }
/* Se activa después de inicializar las referencias: nunca oculta contenido. */
.has-scene .hero { height: 210svh; }
.has-scene .hero__stage { position: sticky; top: 0; height: 100svh; min-height: 44rem; }
.has-scene .hero__scene { contain: paint; }
.hero:focus-within .hero__cue { opacity: 1 !important; }

/* El resto cambia de escala y de ritmo; no repite una entrada por sección. */
#ciudad { padding-top: clamp(5rem, 12vw, 11rem); }
#ciudad .section__head { max-width: 68rem; margin-bottom: 5rem; }
#ciudad h2 { font-size: clamp(3.2rem, 7.6vw, 6rem); max-width: 11ch; }
#ciudad .section__head .body { max-width: 49ch; margin-left: auto; margin-top: 1.5rem; }
#ciudad .mapband {
  inset: 8rem 0 0;
  opacity: .48;
  background-position: 35% 70%;
  mask-image: linear-gradient(transparent, #000 23%, #000 70%, transparent);
}
#ciudad .split { gap: clamp(3rem, 10vw, 10rem); }
#ciudad .device {
  max-width: 23rem;
  margin-inline: auto;
  transform: rotate(-7deg);
  box-shadow: 24px 50px 90px -30px #000;
}
#ciudad .chapters { border-top: 0; }
#ciudad .chapter { padding-block: 2rem; }
#ciudad .chapter h3 { font-size: 1.75rem; }
#ciudad .aside { background: var(--bx-canvas); padding: 1rem; }
#juego { background: var(--bx-canvas-raised); }
#juego .section__head { max-width: 58rem; }
#juego h2 { font-size: clamp(3.2rem, 7vw, 6rem); max-width: 12ch; }
#juego .split { align-items: start; }
#juego .device { position: sticky; top: 4rem; max-width: 23rem; transform: rotate(5deg); }
#juego .chapter { padding-block: 2.75rem; }
#juego .chapter h3 { font-size: 1.75rem; }
#juego .seal { margin-left: 0; }
#rutas { padding-block: clamp(5rem, 12vw, 11rem); }
#rutas h2 { font-size: clamp(3.2rem, 6vw, 5.5rem); }
#rutas .steps li { padding-block: 2rem; }
.map-credit { max-width: 42ch; margin-top: .75rem; font-size: .75rem; }
.rail::before { width: 100%; transform: scaleX(var(--bx-progress, 0)); transform-origin: left; transition: none; }
.rail { padding-bottom: env(safe-area-inset-bottom); height: calc(var(--bx-rail-h) + env(safe-area-inset-bottom)); }
body { padding-bottom: calc(var(--bx-rail-h) + env(safe-area-inset-bottom)); }
@media (min-width: 90rem) {
  .hero__copy { bottom: 9rem; }
}
@media (max-width: 68rem) {
  .hero__copy { max-width: 29rem; }
  .hero__device-wrap { right: 8%; }
  #ciudad .split { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 3rem; }
  #juego .split { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 3rem; }
}
@media (max-width: 48rem) {
  .hero__stage { height: max(57rem, 100svh); }
  .has-scene .hero { height: 175svh; }
  .has-scene .hero__stage { min-height: 0; height: 100svh; }
  .hero__portal { display: none; }
  .hero__copy { top: 8rem; bottom: auto; right: var(--bx-margin); max-width: 32rem; gap: 1.25rem; }
  .hero h1 { font-size: clamp(3.5rem, 11vw, 5.5rem); }
  .hero .lead { max-width: 34ch; font-size: 1rem; }
  .hero__device-wrap { width: min(35vw, 13rem); right: 12%; bottom: 6rem; }
  .hero__caption { font-size: .75rem; letter-spacing: .06em; }
  .hero__ground { background-position: 40% 75%; transform: scale(1.3) rotate(-8deg); }
  .hero__veil { background: linear-gradient(180deg, rgba(5,6,15,.96) 2%, rgba(5,6,15,.6) 42%, rgba(5,6,15,.1) 70%, var(--bx-canvas)); }
  .hero__cue { bottom: 4.5rem; gap: .75rem; font-size: .75rem; }
  .hero__cue span { max-width: none; }
  .hero__caption { display: none; }
  #ciudad .section__head { margin-bottom: 3rem; }
  #ciudad .section__head .body { margin-left: 0; }
  #ciudad .split, #juego .split { grid-template-columns: 1fr; gap: 3rem; }
  #ciudad .device { width: min(70%, 20rem); }
  #juego .device { order: -1; position: relative; top: auto; width: min(70%, 20rem); margin: 1rem auto; }
  #juego .chapter { padding-block: 1.75rem; }
  #ciudad h2, #juego h2, #rutas h2 { font-size: clamp(3rem, 10vw, 4.5rem); }
  .state { letter-spacing: .06em; }
}
@media (max-height: 800px) and (min-width: 49rem) {
  .hero__device-wrap { width: min(22vw, 18svh); }
}
@media (max-height: 740px) and (min-width: 49rem) {
  .has-scene .hero__stage { min-height: 0; }
  .hero__copy { bottom: 6rem; max-width: 32rem; }
  .hero h1 { font-size: 4.75rem; }
  .hero__device-wrap { width: min(22vw, 18svh); bottom: 5rem; }
  .hero__portal { opacity: .55; }
  .hero__cue { bottom: 4.5rem; }
}
@media (max-height: 740px) and (max-width: 48rem) {
  .has-scene .hero { height: auto; }
  .has-scene .hero__stage { height: 55rem; position: relative; }
}
@media (prefers-reduced-motion: reduce) {
  .has-scene .hero { height: auto; }
  .has-scene .hero__stage { position: relative; height: max(52rem, 100svh); }
  .hero__scene { clip-path: none !important; }
  .hero__ground, .hero__device-wrap, .hero__copy { transform: none !important; opacity: 1 !important; }
  .hero__portal { display: none; }
  .hero__cue svg { transition: none; }
}
