/* Home a schermata unica: un solo palco fisso, lo scroll fa evolvere le scene.
   Senza la classe .is-stage (niente JS, movimento ridotto, schermi troppo bassi)
   le scene restano sezioni normali una sotto l'altra. */

.stage { position: relative; }
.stage__bg,
.stage__dots,
.stage > .route { display: none; }

.scene .waypoint {
    position: absolute;
    width: 2px;
    height: 2px;
    pointer-events: none;
}
.scene--hero .waypoint { left: 84%; top: 80%; }

@media (max-width: 767.98px) {
    .scene .wrap { padding-left: calc(var(--rail) + var(--leg-pad)); }
    .scene--hero .topbar { margin-left: calc(-1 * var(--leg-pad)); }
    .scene--hero .waypoint { left: var(--rail); top: 62%; }
}

/* ---------- Modalità palco ---------- */

.journey.is-stage {
    position: relative;
    height: calc((var(--units, 6) + 1) * 100vh);
    height: calc((var(--units, 6) + 1) * 100svh);
}

.is-stage .stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: var(--asfalto);
}

.is-stage .stage__bg {
    display: block;
    position: absolute;
    inset: 0;
    transform: translate3d(0, 100%, 0);
    will-change: transform;
}
.is-stage .stage__bg:first-child { transform: none; }
.stage__bg--asfalto { background: var(--asfalto); }
.stage__bg--nebbia { background: var(--nebbia); }
.stage__bg--notte { background: var(--notte); }

.is-stage .stage > .route {
    display: block;
    z-index: 1;
}

.journey.is-stage .scene {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding-block: clamp(2rem, 6svh, 6rem);
    background: transparent;
    will-change: opacity, transform;
}
.journey.is-stage .scene:not(:first-of-type) { opacity: 0; visibility: hidden; }

.journey.is-stage .scene--hero {
    justify-content: space-between;
    padding-top: 0;
    padding-bottom: clamp(3rem, 10svh, 9rem);
}

.journey.is-measuring .scene {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}
.journey.is-measuring .leg__body { transform: none !important; }

/* ---------- Indicatore delle tappe ---------- */

.is-stage .stage__dots {
    position: absolute;
    right: max(12px, env(safe-area-inset-right));
    top: 50%;
    z-index: 5;
    display: flex;
    flex-direction: column;
    transform: translateY(-50%);
    color: var(--nebbia);
    transition: color 0.4s;
}
.stage[data-tone="light"] .stage__dots { color: var(--asfalto); }

.stage__dot {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}
.stage__dot::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.55;
    transition: background-color 0.3s, opacity 0.3s, transform 0.3s;
}
.stage__dot:hover::before { opacity: 1; }
.stage__dot[aria-current="step"]::before {
    background: var(--traverse);
    border-color: var(--traverse);
    opacity: 1;
    transform: scale(1.25);
}

@media (max-width: 767.98px) {
    .is-stage .stage__dots { display: none; }
}
