/* ---------- Parcours en étapes : plan de vol (docs/accueil-parcours.md) ----------
   Fond clair à quadrillage de points (motif SVG, pas de dégradé), nuages qui dérivent, tableau de bord collant,
   route centrale qui se dessine au scroll, cartes d'embarquement en zigzag. --jp : progression (journey.js). */
.journey { --jp: 0; --bounce: cubic-bezier(.34, 1.56, .64, 1); position: relative; isolation: isolate; overflow: clip; padding-block: clamp(5rem, 10vw, 8.5rem); background-color: var(--surface); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='2' cy='2' r='1.15' fill='%23041b51' fill-opacity='.1'/%3E%3C/svg%3E"); color: var(--ink); }
.journey-cloud { position: absolute; z-index: -1; width: clamp(9rem, 16vw, 15rem); color: white; pointer-events: none; }
.journey-cloud svg { display: block; width: 100%; height: auto; fill: currentColor; filter: drop-shadow(0 18px 30px #00000014); animation: cloud-drift 26s ease-in-out infinite alternate; }
.cloud-1 { top: 5%; left: -2%; }
.cloud-2 { top: 40%; right: -3%; width: clamp(7rem, 12vw, 11rem); }
.cloud-2 svg { animation-duration: 32s; animation-delay: -8s; }
.cloud-3 { bottom: 10%; left: 5%; width: clamp(6rem, 10vw, 9rem); opacity: .85; }
.cloud-3 svg { animation-duration: 22s; animation-delay: -4s; }
@keyframes cloud-drift { from { transform: translateX(-2.5rem); } to { transform: translateX(2.5rem); } }

.journey-head { display: grid; justify-items: center; max-width: 48rem; text-align: center; }
.journey-head h2 { scroll-margin-top: calc(var(--header-h) + 1.4rem); }
.journey-head .kicker { justify-content: center; }
.journey-intro { max-width: 34rem; margin-top: 1.2rem; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.12rem); }

/* Tableau de bord collant : départ, piste, arrivée, compteur */
.journey-hud-zone { position: relative; margin-top: clamp(2.5rem, 5vw, 4rem); }
.journey-hud { position: sticky; top: calc(var(--header-h) + 1.4rem); z-index: 5; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); max-width: 54rem; margin: 0 auto clamp(2.5rem, 5vw, 4rem); padding: .85rem clamp(1.1rem, 2.5vw, 1.7rem); border: 1px solid #ffffffd9; border-radius: 100vmax; background: #fffffff0; box-shadow: 0 24px 60px #0000001a; }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
    .journey-hud { background: #ffffffc7; backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%); }
}
.hud-city { display: grid; line-height: 1.15; }
.hud-city small, .hud-count small { color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hud-city strong { font-family: var(--font-display); font-size: 1.45rem; font-weight: 400; letter-spacing: .05em; }
.hud-city span { color: var(--muted); font-size: .78rem; }
.hud-city.is-end { text-align: right; }
.hud-track { position: relative; height: 0; margin-inline: 1rem; border-top: 2px dashed #00000033; }
.hud-fill { position: absolute; top: -2px; left: 0; width: calc(var(--jp) * 100%); height: 2px; border-radius: 2px; background: var(--accent); }
.hud-plane { position: absolute; top: -1px; left: calc(var(--jp) * 100%); width: 2.8rem; height: 1.2rem; object-fit: contain; filter: drop-shadow(0 2px 2px #0005); transform: translate(-50%, -50%); }
.hud-count { display: grid; padding-left: clamp(1rem, 2vw, 1.6rem); border-left: 1px solid var(--line); line-height: 1.1; }
.hud-count strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; }
.hud-count em { margin-left: .15rem; color: var(--muted); font-family: var(--font-body); font-size: .85rem; font-style: normal; }
[data-journey-count] { display: inline-block; }
.hud-count.is-flip [data-journey-count] { animation: count-flip .55s var(--ease-out); }
@keyframes count-flip { from { opacity: 0; transform: translateY(70%) rotateX(80deg); } }

/* Route sinueuse calculée à partir des stations. */
.journey-route { --route-rail: clamp(8.5rem, 14vw, 13rem); --route-connector: calc(var(--route-rail) / 2 - 1.6rem); position: relative; display: grid; gap: clamp(1.6rem, 3.5vw, 2.8rem); margin: 0; padding: 1rem 0 2rem; list-style: none; }
.route-line { position: absolute; inset: 0; pointer-events: none; }
.route-map { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; }
.route-map-guide { stroke: #827773; stroke-opacity: .48; stroke-width: 2; stroke-dasharray: 2 8; }
.route-map-progress { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 1 1; stroke-dashoffset: var(--route-offset, 1); }
.journey .route-plane { position: absolute; z-index: 3; top: 0; left: 0; width: clamp(3.75rem, 6.5vw, 5.8rem); aspect-ratio: 1; object-fit: contain; visibility: hidden; filter: drop-shadow(0 7px 5px #2224); }
.journey .route-plane.is-positioned { visibility: visible; }
@keyframes radar { from { opacity: 1; transform: scale(.8); } to { opacity: 0; transform: scale(1.9); } }

.journey-step { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--route-rail) minmax(0, 1fr); align-items: center; }
.route-node { position: relative; z-index: 1; grid-row: 1; grid-column: 2; justify-self: center; display: grid; place-items: center; width: 3.3rem; height: 3.3rem; border: 1px solid var(--line); border-radius: 50%; background: white; font-family: var(--font-display); font-size: 1.05rem; box-shadow: 0 10px 24px #00000014; }
.route-node::after { content: ""; position: absolute; inset: -7px; border: 1px solid var(--accent); border-radius: 50%; opacity: 0; }
.js .route-node[data-reveal] { transition: opacity .5s var(--ease-out), scale .8s var(--bounce), background-color .5s, color .5s, border-color .5s, box-shadow .5s; }
.js .route-node[data-reveal]:not(.is-in) { scale: .3; }  /* pas 0 : une taille nulle ne serait jamais vue par l’IntersectionObserver */
.journey-step.is-active .route-node { border-color: var(--accent); background: var(--accent); color: white; box-shadow: 0 0 0 6px #f115151f; }
.journey-step.is-active .route-node::after { animation: radar 2.2s var(--ease-out) infinite; }

/* Six escales illustrées, reliées aux mêmes stations. */
.pass {
    --pass-pad: clamp(1.1rem, 2.3vw, 1.55rem);
    --pass-accent: #625247;
    --pass-wash: #f3efeb;
    position: relative;
    grid-row: 1;
    display: grid;
    grid-template: "art" "copy" "action" / minmax(0, 1fr);
    width: 100%;
    max-width: 34rem;
    border: 1px solid var(--line);
    border-radius: 1.45rem;
    background: white;
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 20px 50px #00000012;
    scroll-margin-top: calc(var(--header-h) + 7rem);
}
.journey-step.is-left .pass { grid-column: 1; justify-self: end; }
.journey-step.is-right .pass { grid-column: 3; justify-self: start; }
.pass::before { content: ""; position: absolute; top: 50%; width: var(--route-connector); border-top: 2px dashed var(--line); transition: border-color .5s; }
.journey-step.is-left .pass::before { right: calc(-1 * var(--route-connector)); }
.journey-step.is-right .pass::before { left: calc(-1 * var(--route-connector)); }
.journey-step.is-active .pass::before { border-color: var(--accent); }
.js .pass[data-reveal] { transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out), filter .9s var(--ease-out), translate .5s var(--ease-out), border-color .5s, box-shadow .5s; }
.js .journey-step.is-left .pass[data-reveal]:not(.is-in, :focus-visible) { transform: translateX(-110px) rotate(-5deg) scale(.92); filter: blur(8px); }
.js .journey-step.is-right .pass[data-reveal]:not(.is-in, :focus-visible) { transform: translateX(110px) rotate(5deg) scale(.92); filter: blur(8px); }
.pass:hover { translate: 0 -6px; text-decoration: none; }
.js .journey .pass[data-reveal]:focus-visible { opacity: 1; transform: none; filter: none; transition: none; }
.pass:focus-visible { outline-offset: 5px; border-radius: 1.4rem; }
.journey-step.is-active .pass { border-color: #f1151538; box-shadow: 0 30px 70px #0000001f; }
.pass-content { grid-area: copy; min-width: 0; padding: var(--pass-pad) var(--pass-pad) 0; }
.pass-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .9rem; }
.pass-icon { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: .85rem; background: var(--pass-wash); color: var(--pass-accent); transition: transform .6s var(--ease-out), background-color .4s, color .4s; }
.pass-icon .icon { width: 1.25rem; height: 1.25rem; }
.journey-step.is-active .pass-icon { background: var(--accent); color: white; transform: rotate(-8deg); }
.pass h3 { font-size: clamp(1.4rem, 1.6vw + .4rem, 1.95rem); text-wrap: pretty; }
.pass p { margin-top: .55rem; color: var(--muted); font-size: .93rem; line-height: 1.62; }
.pass-art { grid-area: art; position: relative; display: block; min-width: 0; overflow: hidden; background: var(--pass-wash); }
.pass-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.journey-pass-actions { grid-area: action; position: relative; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; padding: .9rem var(--pass-pad) 1.15rem; }
.journey-pass-action { display: inline-flex; align-items: center; gap: .55rem; font-size: .85rem; font-weight: 700; }
.journey-pass-action .arrow { display: inline-grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--pass-wash); color: var(--pass-accent); transition: transform .45s var(--ease-out), background-color .3s, color .3s; }
.pass:is(:hover, :focus-visible) .journey-pass-action .arrow { background: var(--action); color: white; transform: translateX(4px); }
.pass-stamp { padding: .3rem .5rem; border: 2px solid currentColor; border-radius: .4rem; color: var(--ink); font-size: .57rem; font-weight: 800; letter-spacing: .11em; line-height: 1.15; text-align: center; text-transform: uppercase; opacity: 0; pointer-events: none; transform: rotate(-14deg) scale(1.9); transition: opacity .35s, transform .55s var(--bounce); }
.journey-step.is-active .pass-stamp { opacity: .75; transform: rotate(-14deg) scale(1); }

/* Carte des itinéraires, portrait de campus, chemise, carnet, photo de logement, billet. */
.pass--orientation { --pass-accent: #735b39; --pass-wash: #f4efe5; }
.pass--orientation .pass-art { aspect-ratio: 2.4; margin: .7rem .7rem 0; border: 1px solid #e6ded0; border-radius: .8rem; }
.pass--orientation .pass-icon { border: 1px dashed currentColor; border-radius: 50%; }

.pass--admission { --pass-accent: #704b3f; --pass-wash: #f5ebe6; grid-template: "copy art" 1fr "action art" auto / minmax(0, 1.45fr) minmax(0, 1fr); }
.pass--admission .pass-art { min-height: 16rem; border-radius: 0 1.35rem 1.35rem 0; }
.pass--admission .pass-art img { object-position: 50% 35%; }
.pass--admission .pass-icon { border-radius: .4rem; }

.pass--prise { --pass-accent: #52604a; --pass-wash: #edf0e8; grid-template-areas: "copy" "art" "action"; border-radius: .5rem 1.45rem 1.45rem 1.45rem; }
.pass--prise .pass-content { border-top: .36rem solid #bcc6b1; border-radius: .45rem 1.4rem 0 0; }
.pass--prise .pass-art { aspect-ratio: 2.2; margin: 1.05rem var(--pass-pad) 0; border: 1px solid #d4dacd; border-radius: .3rem; }
.pass--prise .pass-art img { object-position: 50% 25%; }

.pass--visa { --pass-accent: #7a2e43; --pass-wash: #f6e8ed; grid-template: "art copy" 1fr "art action" auto / minmax(0, .78fr) minmax(0, 1fr); border-radius: .65rem 1.7rem 1.7rem .65rem; }
.pass--visa .pass-art { min-height: 13rem; margin: .65rem 0 .65rem .65rem; border: 1px solid #deced2; border-inline-start: .3rem solid #7a2e43; border-radius: .4rem 1.05rem 1.05rem .4rem; }
.pass--visa .pass-icon { border-radius: .35rem .7rem .7rem .35rem; }

.pass--logement { --pass-accent: #485c44; --pass-wash: #eaf0e8; border-radius: 1.8rem 1.8rem 1rem 1rem; }
.pass--logement .pass-art { aspect-ratio: 2.1; border-radius: 1.7rem 1.7rem 0 0; }
.pass--logement .pass-icon { border-radius: 50% 50% .45rem .45rem; }
.pass--logement .journey-pass-actions { justify-self: start; }
.pass--logement .journey-pass-action { padding: .2rem .3rem .2rem .75rem; border: 1px solid #d5dfd1; border-radius: 2rem; }

.pass--billet { --pass-accent: var(--action); --pass-wash: var(--red-wash); grid-template-areas: "copy" "art" "action"; }
.pass--billet .pass-content { padding-bottom: 1rem; }
.pass--billet .pass-art { aspect-ratio: 3.35; }
.pass--billet .journey-pass-actions { border-top: 2px dashed var(--line); }
.pass--billet .journey-pass-actions::before, .pass--billet .journey-pass-actions::after { content: ""; position: absolute; top: -.65rem; width: 1.2rem; height: 1.2rem; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.pass--billet .journey-pass-actions::before { left: -.65rem; clip-path: inset(0 0 0 50%); }
.pass--billet .journey-pass-actions::after { right: -.65rem; clip-path: inset(0 50% 0 0); }
.pass-barcode { width: clamp(2.4rem, 10vw, 5.7rem); height: 1.2rem; fill: var(--ink); opacity: .65; }

.journey-cta { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; margin-top: clamp(2.5rem, 5vw, 4rem); text-align: center; }
.journey-cta p { max-width: 30rem; font-family: var(--font-display); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.3; }

@media (prefers-reduced-motion: reduce) {
    .journey-cloud svg, .journey-step.is-active .route-node::after { animation: none; }
    .js .route-node[data-reveal] { scale: 1 !important; }
}

@media (max-width: 62rem) {
    .journey-route { --route-rail: 4.2rem; --route-connector: calc(var(--route-rail) / 2 - .5rem); }
    .journey-step { grid-template-columns: var(--route-rail) minmax(0, 1fr); column-gap: .9rem; }
    .route-node { grid-column: 1; width: 2.8rem; height: 2.8rem; font-size: .9rem; }
    .journey-step.is-left .pass, .journey-step.is-right .pass { grid-column: 2; justify-self: stretch; max-width: none; }
    .journey-step.is-left .pass::before, .journey-step.is-right .pass::before { right: auto; left: calc(-1 * var(--route-connector)); }
    .journey .route-plane { width: 3.45rem; }
    .js .journey-step:is(.is-left, .is-right) .pass[data-reveal]:not(.is-in, :focus-visible) { transform: translateX(80px) rotate(3deg) scale(.94); }
    .journey-hud { gap: .8rem; padding: .7rem 1rem; }
    .hud-city small, .hud-city span, .hud-count small { display: none; }
    .hud-city strong { font-size: 1.1rem; }
    .hud-count strong { font-size: 1.2rem; }
}

@media (max-width: 34rem) {
    .journey { padding-block: 4rem; }
    .journey-route { --route-rail: 3.25rem; --route-connector: 1rem; }
    .journey-step { gap: .62rem; }
    .route-node { width: 2.45rem; height: 2.45rem; }
    .journey .route-plane { width: 2.55rem; }
    .hud-track { margin-inline: .7rem; }
    .hud-plane { width: 2rem; height: .85rem; }
    .pass--admission, .pass--visa { grid-template: "art" "copy" "action" / minmax(0, 1fr); }
    .pass--admission .pass-art { min-height: 0; aspect-ratio: 1.75; border-radius: 1.35rem 1.35rem 0 0; }
    .pass--admission .pass-art img { object-position: center 27%; }
    .pass--visa .pass-art { min-height: 0; aspect-ratio: 1.9; margin: .65rem .65rem 0; }
    .pass--visa .pass-art img { object-position: center 44%; }
    .journey-hud { top: calc(var(--header-h) + .9rem); }
    .cloud-2 { display: none; }
}
