/* ==========================================================================
   AMUCAM : page d'accueil
   Charte : palette dérivée du logo (bleu #0078d8), jaune AMUCAM en accent,
   titres en Plus Jakarta Sans très gras comme le nom AMUCAM du logo.
   Fondations communes : css/base.css. Couleurs de base : css/layout.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HERO : carte photo arrondie, texte ancré en bas à gauche
   La photo reste naturelle ; seul un dégradé bleu nuit monte du bas pour
   porter le texte. Bouton pastille blanc à droite. Entrée en animations
   CSS, rejouée à chaque diapositive.
   -------------------------------------------------------------------------- */
:root {
    --hero-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --hero-gap: clamp(10px, 1.2vw, 18px);
}

.hero {
    position: relative;
    height: clamp(520px, calc(100vh - var(--nav-h) - 150px), 780px);
    height: clamp(520px, calc(100svh - var(--nav-h) - 150px), 780px);
    margin: var(--hero-gap) var(--hero-gap) 0;
    overflow: hidden;
    border-radius: 16px;
    background: var(--amu-navy);
    color: #fff;
    isolation: isolate;
}

/* Contour très fin : la carte garde sa forme même sur une photo claire */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 6;
    border: 1px solid rgba(9, 47, 78, 0.1);
    border-radius: inherit;
    pointer-events: none;
}

.hero__slide {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s var(--ease), visibility 1.2s;
}

.hero__slide.is-active {
    z-index: 2;
    opacity: 1;
    visibility: visible;
}

/* Photo : léger recul continu */
.hero__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--pos, center 20%);
}

.hero__slide.is-active .hero__bg img {
    animation: hero-zoom 8s linear both;
}

@keyframes hero-zoom {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}

/* Dégradé bleu nuit qui monte du bas, sous le texte uniquement */
.hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(9, 47, 78, 0.96) 0%, rgba(9, 47, 78, 0.82) 22%, rgba(9, 47, 78, 0.4) 46%, rgba(9, 47, 78, 0) 66%),
        linear-gradient(90deg, rgba(9, 47, 78, 0.25) 0%, rgba(9, 47, 78, 0) 50%);
}

/* Texte à gauche, bouton à droite, tous deux posés en bas */
.hero__content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-top: 40px;
    padding-bottom: clamp(36px, 5vh, 56px);
}

.hero__text {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title title"
        "lead  cta";
    align-items: start;
    column-gap: 48px;
    width: 100%;
}

.hero__title {
    grid-area: title;
    max-width: 920px;
    margin-bottom: 14px;
    font-size: clamp(2.3rem, 1.3rem + 3.2vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: #fff;
    text-wrap: balance;
}

/* Chaque ligne est un masque : le texte monte de dessous */
.hero__line {
    display: block;
    overflow: hidden;
    padding: 0 0.08em 0.1em 0;
    margin: 0 -0.08em -0.1em 0;
}

.hero__line > span {
    display: block;
}

.hero__accent {
    font-style: normal;
    color: var(--amu-yellow);
}

.hero__lead {
    grid-area: lead;
    max-width: 720px;
    font-size: clamp(1.02rem, 0.92rem + 0.4vw, 1.25rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
}

/* Bouton pastille blanc */
.hero__cta {
    grid-area: cta;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 17px 30px;
    border-radius: 999px;
    background: #fff;
    font-size: 16px;
    font-weight: 700;
    color: var(--amu-navy);
    white-space: nowrap;
    align-self: center;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.45);
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}

.hero__cta-arrow {
    display: flex;
}

.hero__cta-arrow svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s var(--ease);
}

.hero__cta:hover,
.hero__cta:focus-visible {
    background: var(--amu-yellow);
    transform: translateY(-1px);
}

.hero__cta:hover .hero__cta-arrow svg,
.hero__cta:focus-visible .hero__cta-arrow svg {
    transform: translateX(3px);
}

.hero__cta:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* Entrée de la diapositive active */
.hero__slide.is-active .hero__line > span {
    animation: hero-line 1.1s var(--hero-ease) backwards;
}

.hero__slide.is-active .hero__line:nth-child(1) > span { animation-delay: 0.2s; }
.hero__slide.is-active .hero__line:nth-child(2) > span { animation-delay: 0.32s; }

.hero__slide.is-active .hero__lead {
    animation: hero-fade 1s var(--hero-ease) 0.6s backwards;
}

.hero__slide.is-active .hero__cta {
    animation: hero-fade 1s var(--hero-ease) 0.78s backwards;
}

@keyframes hero-line {
    from { transform: translateY(105%); }
}

@keyframes hero-fade {
    from { opacity: 0; transform: translateY(14px); }
}

/* Diapositives : points façon boutons radio, posés directement sur la
   photo en haut à droite (mêmes points que le carrousel des missions).
   Point actif : anneau blanc, point bleu marine ; autour, un cercle jaune
   se remplit pendant la durée de la diapositive (figé pendant la pause).
   Un filet et une ombre légère détachent les points de la photo. */
.hero {
    --hero-delay: 6s;
}

.hero__dots {
    position: absolute;
    top: 18px;
    right: 16px;
    z-index: 5;
    display: flex;
    gap: 4px;
}

.hero__dot {
    position: relative;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
}

.hero__dot::before,
.hero__dot::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
}

.hero__dot::before {
    width: 15px;
    height: 15px;
    margin: -7.5px 0 0 -7.5px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 1px rgba(9, 47, 78, 0.2), 0 1px 5px rgba(9, 47, 78, 0.35);
    transition: background-color 0.3s var(--ease);
}

.hero__dot::after {
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    background: var(--amu-navy);
    transform: scale(0);
    transition: transform 0.3s var(--ease-out);
}

.hero__dot:hover::before { background: rgba(255, 255, 255, 0.85); }
.hero__dot[aria-selected="true"]::before { background: #fff; }
.hero__dot[aria-selected="true"]::after { transform: scale(1); }

/* Cercle de progression autour du point actif */
.hero__dot svg {
    position: absolute;
    left: 1px;
    top: 1px;
    width: 26px;
    height: 26px;
    overflow: visible;
    filter: drop-shadow(0 1px 2px rgba(9, 47, 78, 0.45));
}

.hero__pip {
    display: none;
}

.hero__ring-track,
.hero__ring {
    fill: none;
    stroke-width: 1.6;
}

.hero__ring-track {
    stroke: rgba(255, 255, 255, 0);
    transition: stroke 0.3s var(--ease);
}

.hero__ring {
    stroke: var(--amu-yellow);
    stroke-linecap: round;
    stroke-dasharray: 50.27;
    stroke-dashoffset: 50.27;
    transform: rotate(-90deg);
    transform-origin: 10px 10px;
}

.hero__dot[aria-selected="true"] .hero__ring-track {
    stroke: rgba(255, 255, 255, 0.4);
}

.hero.is-running .hero__dot[aria-selected="true"] .hero__ring {
    animation: hero-ring var(--hero-delay) linear forwards;
}

.hero.is-paused .hero__ring {
    animation-play-state: paused !important;
}

@keyframes hero-ring {
    to { stroke-dashoffset: 0; }
}

.hero__dot:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 0;
}

@media (max-width: 1023px) {
    .hero {
        height: clamp(480px, 68svh, 680px);
        border-radius: 14px;
    }

    .hero__text {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "title"
            "lead"
            "cta";
    }

    .hero__cta {
        justify-self: start;
        margin-top: 24px;
    }
}

@media (max-width: 767px) {
    .hero {
        height: clamp(460px, 72svh, 640px);
        border-radius: 12px;
    }

    .hero__content { padding-bottom: 28px; }
    .hero__title { margin-bottom: 12px; font-size: clamp(2rem, 1.3rem + 3.6vw, 2.6rem); line-height: 1.12; }
    .hero__lead { font-size: 1rem; }
    .hero__bg img { object-position: var(--pos-mobile, 50% 30%); }
    .hero__cta { margin-top: 20px; padding: 15px 26px; font-size: 15px; }
    /* Points seuls, sans cercle de progression ; zone de toucher de 28 px */
    .hero__dots { top: 12px; right: 10px; gap: 0; }
    .hero__dot svg { display: none; }
}

/* --------------------------------------------------------------------------
   2. CHIFFRES CLÉS : une ligne simple sous la carte, sur fond blanc
   Chiffre, libellé, filet. Rien d'autre.
   -------------------------------------------------------------------------- */
.stats {
    position: relative;
    z-index: 1;
    background: #fff;
}

.stats__panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 34px 0 38px;
}

.stat {
    position: relative;
    padding: 0 32px;
}

.stat:first-child {
    padding-left: 0;
}

.stat + .stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--hairline);
}

.stat__value {
    font-family: var(--font-nav);
    font-size: clamp(2.2rem, 1.8rem + 0.9vw, 2.75rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--amu-navy);
    font-variant-numeric: lining-nums tabular-nums;
    white-space: nowrap;
}

.stat__value sup {
    margin-left: 2px;
    font-size: 0.55em;
    vertical-align: 0.65em;
    line-height: 0;
    color: var(--amu-yellow);
}

.stat__label {
    margin-top: 10px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* Arrivée : les chiffres s'installent un par un après le titre */
.js .stat {
    animation: hero-fade 1s var(--hero-ease) backwards;
}

.js .stat:nth-child(1) { animation-delay: 0.9s; }
.js .stat:nth-child(2) { animation-delay: 1s; }
.js .stat:nth-child(3) { animation-delay: 1.1s; }
.js .stat:nth-child(4) { animation-delay: 1.2s; }

@media (max-width: 1023px) {
    .stats__panel {
        grid-template-columns: repeat(2, 1fr);
        align-items: stretch;
        padding: 8px 0 12px;
    }

    .stat {
        padding: 22px 0 22px 24px;
    }

    .stat:nth-child(odd) {
        padding-left: 0;
    }

    .stat:nth-child(3)::before {
        display: none;
    }

    .stat + .stat::before {
        top: 22px;
        bottom: 22px;
    }

    .stat:nth-child(n + 3) {
        border-top: 1px solid var(--hairline);
    }

    .stat__value { font-size: 2.1rem; }
    .stat__label { margin-top: 8px; font-size: 10.5px; letter-spacing: 0.12em; }
}

/* --------------------------------------------------------------------------
   3. MISSIONS : en-tête sur une rangée, trois colonnes numérotées
   -------------------------------------------------------------------------- */
/* Les chiffres sont désormais dans la bande du hero : plus de chevauchement */
.missions {
    --under: 0px;
    position: relative;
    overflow: hidden;
    margin-top: calc(var(--under) * -1);
    padding: calc(var(--under) + var(--section-y)) 0 var(--section-y);
    background: var(--surface-blue);
}

/* Emblème en filigrane, à droite de l'introduction, rogné par le bord */
.missions__mark {
    top: calc(var(--under) + 24px);
    right: -6%;
    width: min(560px, 42vw);
    opacity: 0.045;
}

.missions > .container {
    position: relative;
    z-index: 1;
}

.missions__head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 72px;
    margin-bottom: 64px;
}

.missions__head .heading-lead {
    margin-top: 0;
    max-width: 520px;
}

.missions__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mission {
    display: flex;
    flex-direction: column;
    padding-top: 28px;
    border-top: 1px solid rgba(9, 47, 78, 0.18);
}

.mission__num {
    font-family: var(--font-nav);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
    color: var(--amu-blue);
}

.mission__title {
    margin-top: 22px;
    font-family: var(--font-nav);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--amu-navy);
}

.mission__text {
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-soft);
}

.mission__link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;
    margin-top: auto;
    padding-top: 22px;
    font-size: 15px;
    font-weight: 700;
    color: var(--amu-blue);
    transition: color 0.2s var(--ease);
}

.mission__link i {
    font-size: 12px;
    transition: transform 0.25s var(--ease-out);
}

.mission__link:hover {
    color: var(--amu-navy);
}

.mission__link:hover i {
    transform: translateX(4px);
}

@media (max-width: 1023px) {
    .missions__head { grid-template-columns: 1fr; gap: 0; margin-bottom: 44px; }
    .missions__head .heading-lead { margin-top: 20px; max-width: 640px; }
    .missions__list { grid-template-columns: 1fr; gap: 36px; }
}

/* Position dans le carrousel des missions (mobile) : points façon boutons radio */
.swipe-dots {
    display: none;
}

@media (max-width: 767px) {
    .missions__head { margin-bottom: 28px; }
    .missions__head .heading-lead { margin-top: 14px; }
    .missions__mark { top: 12px; right: -30%; width: 90vw; }

    /* Carrousel au doigt : une carte par écran, la suivante dépasse */
    .missions__list {
        display: flex;
        gap: 28px;
        margin: 0 calc(var(--gutter) * -1);
        padding: 4px var(--gutter) 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 var(--gutter);
        scrollbar-width: none;
    }

    .missions__list::-webkit-scrollbar { display: none; }

    /* Même présentation que sur grand écran : un filet au-dessus, pas de boîte */
    .mission {
        flex: 0 0 82%;
        padding-top: 24px;
        scroll-snap-align: start;
    }

    .mission__num { font-size: 30px; }
    .mission__title { margin-top: 14px; font-size: 22px; }
    .mission__text { font-size: 15px; }
    .mission__link { padding-top: 18px; }

    /* Les cartes d'un carrousel entrent depuis la droite, en cascade */
    .js [data-carousel] > [data-reveal] {
        transform: translateX(24px);
    }

    .js [data-carousel] > [data-reveal].is-in {
        transform: none;
    }

    .swipe-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 12px;
        margin-top: 24px;
    }

    .swipe-dots span {
        position: relative;
        width: 15px;
        height: 15px;
        border-radius: 50%;
        background: rgba(9, 47, 78, 0.2);
        transition: background-color 0.3s var(--ease);
    }

    /* Point actif : anneau clair, point plein au centre */
    .swipe-dots span::after {
        content: '';
        position: absolute;
        inset: 4px;
        border-radius: 50%;
        background: var(--amu-navy);
        transform: scale(0);
        transition: transform 0.3s var(--ease-out);
    }

    .swipe-dots span.is-active { background: rgba(9, 47, 78, 0.14); }
    .swipe-dots span.is-active::after { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   4. PARTENAIRES (bandeau bleu profond)
   -------------------------------------------------------------------------- */
.partners {
    padding: 88px 0 96px;
    overflow: hidden;
    background:
        radial-gradient(900px 380px at 50% 0%, rgba(10, 120, 212, 0.35), transparent 65%),
        var(--amu-navy);
    color: #fff;
}

.partners .section-title {
    color: #fff;
}

.marquee {
    display: flex;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee__track {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 48px;
    padding-right: 48px;
    animation: marquee 40s linear infinite;
}

.marquee:hover .marquee__track {
    animation-play-state: paused;
}

.marquee__item {
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.85);
}

.marquee__sep {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amu-yellow);
}

@keyframes marquee {
    to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
    .marquee { justify-content: center; mask-image: none; -webkit-mask-image: none; }
    .marquee__track { flex-wrap: wrap; flex-shrink: 1; justify-content: center; animation: none; gap: 16px 32px; padding: 0 var(--gutter); }
    .marquee__track[aria-hidden="true"] { display: none; }
}

@media (max-width: 767px) {
    .partners { padding: 64px 0 72px; }
    .marquee__track { gap: 28px; padding-right: 28px; animation-duration: 30s; }
}

/* --------------------------------------------------------------------------
   5. FORMATIONS
   -------------------------------------------------------------------------- */
.courses {
    padding: var(--section-y) 0;
    background: #fff;
}

.courses__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 88px;
}

.courses__photo {
    overflow: hidden;
    border-radius: 24px;
    aspect-ratio: 4 / 5;
    box-shadow: var(--shadow-soft);
}

.courses__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 38% center;
    transition: transform 1.4s var(--ease-out);
}

.courses__photo:hover img {
    transform: scale(1.04);
}

.course-list {
    border-top: 1px solid var(--hairline);
}

.course-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 18px;
    min-height: 66px;
    padding: 10px 14px 10px 4px;
    border-bottom: 1px solid var(--hairline);
    transition: background-color 0.3s var(--ease), padding 0.3s var(--ease-out);
}

.course-row:hover,
.course-row:focus-visible {
    padding-left: 14px;
    background: var(--surface-blue);
}

.course-row__abbr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border-radius: 8px;
    background: rgba(10, 120, 212, 0.1);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--amu-blue);
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

.course-row:hover .course-row__abbr {
    background: var(--amu-logo);
    color: #fff;
}

.course-row__name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--amu-navy);
}

.course-row > i {
    font-size: 13px;
    color: var(--ink-soft);
    transition: transform 0.3s var(--ease-out), color 0.3s var(--ease);
}

.course-row:hover > i {
    transform: translateX(4px);
    color: var(--amu-logo);
}

.courses__more {
    margin-top: 36px;
}

@media (max-width: 1023px) {
    .courses__grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .courses__photo {
        max-width: 560px;
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 767px) {
    .courses__photo { border-radius: 20px; }
    .course-row { grid-template-columns: 50px 1fr auto; gap: 14px; }
    .course-row__name { font-size: 16px; }
    .courses__more { width: 100%; }
}

/* Retour tactile sur les liens des missions et le bouton du hero (voir css/base.css) */
@media (hover: none) {
    .mission__link,
    .hero__cta {
        -webkit-tap-highlight-color: transparent;
    }

    .mission__link:active,
    .hero__cta:active {
        scale: 0.98;
    }
}

/* --------------------------------------------------------------------------
   Mouvement réduit
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero__slide,
    .hero__pip,
    .hero__ring-track,
    .js [data-reveal] {
        transition: none !important;
    }

    .hero__slide.is-active .hero__bg img,
    .hero__slide.is-active .hero__line > span,
    .hero__slide.is-active .hero__lead,
    .hero__slide.is-active .hero__cta,
    .js .stat,
    .hero__ring {
        animation: none !important;
    }

    .hero__cta,
    .hero__cta-arrow svg { transition: none; }

    .hero__dot::before,
    .hero__dot::after,
    .swipe-dots span,
    .swipe-dots span::after { transition: none; }
}
