/* ============================================================
   HERO 22 — SCROLL
   Plein écran, mobile compris. Une SCÈNE collée en haut de l'écran
   (position: sticky) pendant que la section, haute de plusieurs écrans,
   défile derrière : le défilement fait avancer un « film » (séquence
   d'images dessinée dans un <canvas>) et fait se succéder les textes, un
   chapitre à la fois.

   La MÉCANIQUE (hauteur, sticky, film, états `is-statique` /
   `is-epingle-js`) est partagée par les heros scroll : heros/main.css et
   heros/main.js, derrière `data-hero-scroll`. Ici, la mise en scène.

   Tout texte est posé sur une image : blanc, et le contraste est construit
   par le voile (§4.14).
   ============================================================ */

.hero-22 {
    --hero-22-gouttiere: clamp(1rem, 4vw, 3.5rem);

    background: var(--black);
    color: var(--white);
}

.hero-22__voile {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0, rgba(0, 0, 0, 0.12) 28%, rgba(0, 0, 0, 0.2) 55%, rgba(0, 0, 0, 0.82) 100%),
        color-mix(in srgb, var(--primary) 12%, transparent);
}

/* ---- Les étapes -------------------------------------------- */
.hero-22__etapes {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    padding: calc(var(--header-height, 80px) + 1.5rem) var(--hero-22-gouttiere) clamp(4.5rem, 10vh, 7rem);
}

/* Toutes les étapes occupent la même case : une seule est visible. */
.hero-22__etape {
    grid-area: 1 / 1;
    align-self: end;
    max-width: 44rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1.75rem);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.6s;
}

.hero-22__etape.is-actif {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.7s ease 0.1s, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s, visibility 0s;
}

.hero-22__etape--ouverture {
    align-self: center;
    justify-self: center;
    max-width: 56rem;
    text-align: center;
}

/* ---- Textes ------------------------------------------------ */
.hero-22__surtitre {
    margin: 0 0 1rem;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    line-height: 1.4;
    text-transform: uppercase;
}

.hero-22__titre,
.hero-22__titre:hover {
    margin: 0;
    color: var(--white);
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.hero-22__chapitre,
.hero-22__chapitre:hover {
    margin: 0;
    color: var(--white);
    font-family: var(--font-heading);
    font-size: clamp(1.9rem, 4.6vw, 3.4rem);
    font-weight: 600;
    line-height: 1.08;
    text-wrap: balance;
}

/* Le contrat ((…)) : le mot mis en valeur bascule en italique. */
.hero-22__titre .mcl-accent,
.hero-22__chapitre .mcl-accent {
    color: var(--white);
    font-style: italic;
}

.hero-22__texte {
    margin: 1.1rem 0 0;
    max-width: 34rem;
    color: var(--white);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.6;
}

/* ---- Indice de défilement ---------------------------------- */
.hero-22__indice {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: clamp(2rem, 6vh, 3.5rem) 0 0;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    line-height: 1;
    text-transform: uppercase;
}

.hero-22__indice-texte {
    color: var(--white);
}

.hero-22__indice-trait {
    position: relative;
    width: 1px;
    height: 3rem;
    overflow: hidden;
    background: color-mix(in srgb, var(--white) 30%, transparent);
}

.hero-22__indice-trait::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--white);
    animation: hero22Indice 2.2s cubic-bezier(0.6, 0, 0.3, 1) infinite;
}

@keyframes hero22Indice {
    from { transform: translateY(-100%); }
    to   { transform: translateY(100%); }
}

/* ---- Chiffres ---------------------------------------------- */
.hero-22__chiffres {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.25rem, 3vw, 2rem) clamp(1.5rem, 4vw, 3rem);
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}

.hero-22__chiffre {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 0.9rem;
    border-top: 1px solid color-mix(in srgb, var(--white) 35%, transparent);
    color: var(--white);
}

.hero-22__chiffre-valeur {
    color: var(--white);
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 600;
    line-height: 1;
}

.hero-22__chiffre-libelle {
    color: color-mix(in srgb, var(--white) 82%, transparent);
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ---- Conclusion -------------------------------------------- */
.hero-22__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.hero-22__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.1rem;
    padding: 0.85rem 1.6rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: inherit;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.hero-22__btn--principal {
    background: var(--accent);
    color: var(--on-accent);
}

.hero-22__btn--principal:hover,
.hero-22__btn--principal:focus-visible {
    background: color-mix(in srgb, var(--accent) 86%, var(--black));
    color: var(--on-accent);
    transform: translateY(-1px);
}

.hero-22__btn--secondaire {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--white) 70%, transparent);
    color: var(--white);
}

.hero-22__btn--secondaire:hover,
.hero-22__btn--secondaire:focus-visible {
    background: var(--white);
    color: var(--black);
}

.hero-22__btn:focus-visible,
.hero-22__passer:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}

.hero-22__points {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.5rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.hero-22__point {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.3;
}

.hero-22__point-icone {
    display: inline-flex;
    width: 1.1rem;
    height: 1.1rem;
    color: var(--white);
}

.hero-22__point-icone svg {
    width: 100%;
    height: 100%;
}

/* ---- Progression et sortie --------------------------------- */
.hero-22__progression {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: clamp(0.75rem, 2vw, 1.75rem);
    width: 2px;
    height: clamp(5rem, 22vh, 10rem);
    transform: translateY(-50%);
    background: color-mix(in srgb, var(--white) 25%, transparent);
}

.hero-22__progression-barre {
    position: absolute;
    inset: 0;
    background: var(--white);
    transform: scaleY(var(--hero-scroll-avance, 0));
    transform-origin: top;
}

.hero-22__passer {
    position: absolute;
    z-index: 3;
    right: var(--hero-22-gouttiere);
    bottom: clamp(1rem, 3vh, 1.75rem);
    padding: 0.4rem 0;
    border: 0;
    background: none;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-decoration: underline;
    text-underline-offset: 0.3em;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.hero-22__passer:hover,
.hero-22__passer:focus-visible {
    color: var(--white);
    opacity: 1;
}

/* ---- État statique : sans JS, ou mouvement réduit ---------- */
.hero-22.is-statique .hero-22__etapes {
    position: relative;
    inset: auto;
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 10vh, 6rem);
    min-height: 100vh;
    min-height: 100svh;
}

.hero-22.is-statique .hero-22__etape {
    /* En colonne flex, `end` hérité de la grille rétrécirait l'étape à la
       largeur de son contenu et la ferait déborder à droite. */
    align-self: stretch;
}

.hero-22.is-statique .hero-22__etape--ouverture {
    justify-self: auto;
    text-align: left;
}

.hero-22.is-statique .hero-22__voile {
    background: rgba(0, 0, 0, 0.6);
}

/* ---- Responsive -------------------------------------------- */
@media (min-width: 1024px) {
    .hero-22__chiffres {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hero-22__etape--chiffres {
        max-width: 60rem;
    }
}

@media (max-width: 768px) {
    .hero-22__progression {
        display: none;
    }

    .hero-22__btn {
        flex: 1 1 100%;
    }

    .hero-22__passer {
        left: var(--hero-22-gouttiere);
        right: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-22__indice-trait::after {
        animation: none;
    }
}

/* Accent du contrat ((…)) : la donnée du socle marque un mot, le composant
   décide de son rendu (sans cette règle il sort en texte nu). */
.hero-22__point .mcl-accent {
  color: inherit;
  font-weight: 700;
}

/* Enveloppe du texte : le parent est en flex ; sans elle, un accent ((…))
   deviendrait un élément flex (le gap remplacerait l'espace entre les mots). */
.hero-22__point-texte {
  color: inherit;
}
