/* ═══════════════════════════════════════════════════════════════════════════
   Page d'accueil
   ───────────────────────────────────────────────────────────────────────────
   Six blocs, dans cet ordre : hero, bande savoir-faire, catalogue, atelier,
   mosaïque des réalisations, déroulé, appel final.

   Les cartes produit, les en-têtes de section et les boutons viennent de
   base.css : on ne trouve ici que ce qui est propre à l'accueil.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════ Hero ═══════════════════════════════════ */

.hero {
    position: relative;
    padding-block: clamp(40px, 5.5vw, 86px) clamp(56px, 7vw, 104px);
    overflow: hidden;   /* contient le croissant filigrané ci-dessous */
}

/* Le croissant de la marque, immense et presque effacé, derrière le texte.
   Décoratif : il ne porte aucune information, d'où le masque CSS plutôt
   qu'une image dans le flux. */
.hero::before {
    content: "";
    position: absolute;
    top: -8%;
    left: -6%;
    width: min(480px, 42vw);
    aspect-ratio: 480 / 535;
    background: var(--prune);
    opacity: .05;
    -webkit-mask: url("../content/logo.svg") center / contain no-repeat;
            mask: url("../content/logo.svg") center / contain no-repeat;
    pointer-events: none;
}

.hero-grille {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(32px, 5vw, 76px);
}

.hero-texte { max-width: 36rem; }

.hero-titre {
    font-size: var(--t-display);
    font-weight: 300;
    line-height: 1.04;
    letter-spacing: -0.032em;
    margin-bottom: var(--e-5);
    /* L'axe optique de Fraunces durcit les empattements aux grandes tailles ;
       on le remet au niveau d'un titre pour garder le trait fin. */
    font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 72;
}

/* Ligne descriptive sous le titre (voir index.html). */
.hero-mots {
    margin: calc(var(--e-2) * -1) 0 var(--e-4);
    font-size: var(--t-petit);
    font-weight: 600;
    line-height: 1.5;
    color: var(--prune-700);
    max-width: 44ch;
}

.hero-lede { margin-bottom: var(--e-6); }

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--e-3);
    margin-bottom: var(--e-6);
}

.hero-arguments {
    display: flex;
    flex-wrap: wrap;
    gap: var(--e-2) var(--e-5);
    list-style: none;
    font-size: var(--t-mini);
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--encre-500);
}
.hero-arguments li {
    display: inline-flex;
    align-items: center;
}
/* Séparateur dessiné en CSS (un filet), plutôt qu'un caractère décoratif. */
.hero-arguments li + li { padding-left: var(--e-5); border-left: 1px solid var(--filet); }

/* Navigation du carrousel, posée en bas de la grande photo : flèches et
   points sur une pastille translucide. Pas de défilement automatique : un
   texte qui change tout seul se relit mal, et les lecteurs d'écran
   l'annoncent en boucle. */
.hero-photo-grande { position: relative; }
.hero-nav {
    /* En bas à droite : la petite photo déborde en bas à gauche. */
    position: absolute;
    right: var(--e-4);
    bottom: var(--e-4);
    display: flex;
    align-items: center;
    gap: var(--e-2);
    padding: 4px;
    border-radius: var(--r-rond);
    background: rgba(28, 22, 22, .42);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    z-index: 2;
}
.hero-nav[hidden] { display: none; }
.hero-fleche {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--sombre);   /* fond toujours blanc, même en mode sombre */
    cursor: pointer;
    transition: background-color var(--transition), transform var(--transition);
}
.hero-fleche svg { width: 18px; height: 18px; }
.hero-fleche:hover,
.hero-fleche:focus-visible { background: #fff; transform: scale(1.06); }
.hero-points {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-inline: var(--e-2);
}
.hero-point {
    position: relative;
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: var(--r-rond);
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
    transition: width 300ms var(--courbe-douce), background-color var(--transition);
}
/* Un point de 8 px est trop petit pour un doigt : la zone cliquable déborde
   du tracé visible. */
.hero-point::after {
    content: "";
    position: absolute;
    inset: -12px -4px;
}
.hero-point[aria-selected="true"] { width: 22px; background: #fff; }
.hero-point:hover { background: rgba(255, 255, 255, .85); }

/* Téléphone, tablette, écran tactile : chaque point et chaque flèche devient
   une cible de 44 px. Le bouton est transparent, le point visible est dessiné
   dedans (::after), à la même taille qu'avant. */
@media (max-width: 860px), (pointer: coarse) {
    .hero-nav { max-width: calc(100% - 2 * var(--e-4)); gap: 0; }
    .hero-fleche { width: 44px; height: 44px; flex-shrink: 0; }
    .hero-points { gap: 0; padding-inline: 0; min-width: 0; }
    .hero-point,
    .hero-point[aria-selected="true"] {
        display: grid;
        place-items: center;
        flex: 0 1 44px;
        width: 44px;
        min-width: 26px;
        height: 44px;
        background: none;
    }
    .hero-point:hover { background: none; }
    .hero-point::after {
        position: static;
        inset: auto;
        width: 8px;
        height: 8px;
        border-radius: var(--r-rond);
        background: rgba(255, 255, 255, .55);
        transition: width 300ms var(--courbe-douce), background-color var(--transition);
    }
    .hero-point[aria-selected="true"]::after { width: 22px; background: #fff; }
}

/* ── Composition photo ── */

.hero-images {
    position: relative;
    padding-bottom: clamp(34px, 5vw, 56px);
    padding-left: clamp(24px, 4vw, 48px);
}

.hero-photo { margin: 0; }

.hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--r-md);
}

.hero-photo-grande {
    aspect-ratio: 5 / 6;
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--ombre-3);
    background: var(--papier-2);
}

/* La petite photo déborde en bas à gauche. Le liseré crème la détache de la
   grande sans ombre supplémentaire. */
.hero-photo-petite {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40%;
    max-width: 210px;
    aspect-ratio: 1;
    padding: 7px;
    background: var(--papier);
    border-radius: calc(var(--r-md) + 7px);
    box-shadow: var(--ombre-2);
}
.hero-photo-petite img { border-radius: var(--r-sm); aspect-ratio: 1; }

/* ═══════════════════════════ Bande savoir-faire ═══════════════════════════ */

.savoir {
    background: var(--papier-2);
    border-block: 1px solid var(--filet);
}

.savoir-liste {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    list-style: none;
}

.savoir-liste li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--e-6) var(--e-5);
    border-left: 1px solid var(--filet);
}
/* Pas de filet au ras du bord gauche de la bande. */
.savoir-liste li:first-child { border-left: 0; padding-left: 0; }

.savoir-nom {
    font-family: var(--police-titre);
    font-size: 1.18rem;
    font-weight: 500;
    color: var(--encre-900);
}
.savoir-detail { font-size: var(--t-mini); color: var(--encre-500); }

/* ═══════════════════════════════ Catalogue ═══════════════════════════════ */

/* Message de repli quand /api/produits ne répond pas ou renvoie une liste
   vide : une grille vide sans phrase laisse croire à une panne. */
.creations-vide {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--e-8) var(--e-4);
    color: var(--encre-500);
}
.creations-vide a { color: var(--prune); border-bottom: 1px solid currentColor; }

/* ═══════════════════════════════ L'atelier ═══════════════════════════════ */

.atelier-grille {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(32px, 5vw, 72px);
}

.atelier-photo {
    margin: 0;
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--ombre-2);
    aspect-ratio: 4 / 5;
}
.atelier-photo img { width: 100%; height: 100%; object-fit: cover; }

.atelier-texte h2 { margin-bottom: var(--e-5); }
.atelier-texte p { color: var(--encre-500); max-width: 46ch; }
.atelier-texte .lien-fleche { margin-top: var(--e-3); }

/* ══════════════════════════ Mosaïque des réalisations ══════════════════════ */

.mosaique {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
    gap: var(--e-4);
}

/* La première tuile occupe quatre cases : sans elle, cinq vignettes de même
   taille donnent une planche contact, pas une mise en page. */
.cat-large {
    grid-column: span 2;
    grid-row: span 2;
}

.cat {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--r-md);
    background: var(--papier-2);
    aspect-ratio: 1;
    isolation: isolate;
}
.cat-large { aspect-ratio: auto; }

.cat-media { display: block; width: 100%; height: 100%; }
.cat-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 700ms cubic-bezier(.22, .61, .36, 1);
}
.cat:hover .cat-media img,
.cat:focus-visible .cat-media img { transform: scale(1.05); }

/* Dégradé plutôt qu'un voile uniforme : le bas de la photo s'assombrit juste
   assez pour que le libellé passe, le haut reste intact. */
.cat::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(36, 29, 25, .72) 0%, rgba(36, 29, 25, .25) 32%, rgba(36, 29, 25, 0) 62%);
    pointer-events: none;
}

.cat-label {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--e-3);
    padding: var(--e-4) var(--e-5);
    color: var(--clair);
}

.cat-nom {
    font-family: var(--police-titre);
    font-size: clamp(1rem, .92rem + .4vw, 1.3rem);
    font-weight: 500;
    line-height: 1.2;
}
.cat-large .cat-nom { font-size: clamp(1.25rem, 1rem + 1vw, 1.9rem); }



/* ═══════════════════════════════ Déroulé ═══════════════════════════════════ */

.etapes-sous { margin: var(--e-3) 0 0; color: var(--encre-500); }

.etapes-liste {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--e-7) var(--e-6);
    list-style: none;
    counter-reset: etape;
}

.etape {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: var(--e-4);
    padding-top: var(--e-5);
    border-top: 1px solid var(--filet);
}

/* Chiffre en creux : présent, mais il ne doit pas voler la vedette au titre
   de l'étape. */
.etape-num {
    font-family: var(--police-titre);
    font-size: 2.1rem;
    font-weight: 400;
    line-height: 1;
    color: var(--prune-300);
    font-variation-settings: "WONK" 1;
}

.etape-titre { margin-bottom: var(--e-2); font-size: 1.18rem; }
.etape-desc { font-size: var(--t-petit); color: var(--encre-500); margin: 0; }

/* ═══════════════════════════════ Appel final ═══════════════════════════════ */

.appel {
    position: relative;
    overflow: hidden;
    padding-block: clamp(56px, 7vw, 100px);
    text-align: center;
}

.appel-corps {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.appel-logo {
    width: 48px;
    height: 54px;
    margin-bottom: var(--e-5);
    background: var(--creme);
    opacity: .55;
    -webkit-mask: url("../content/logo.svg") center / contain no-repeat;
            mask: url("../content/logo.svg") center / contain no-repeat;
}

.appel-titre { font-size: var(--t-h2); font-weight: 400; margin-bottom: var(--e-4); }
.appel-texte { margin-bottom: var(--e-6); max-width: 46ch; }

/* ═══════════════════════════ Entrée du hero ════════════════════════════
   Au chargement, le texte monte ligne par ligne puis les photos se posent.
   Animation CSS pure : elle joue même avant que animations.js soit chargé,
   et « réduire les animations » la coupe (règle globale de base.css). */

@keyframes monter {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: none; }
}
@keyframes poser {
    from { opacity: 0; transform: translateY(28px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes devoiler {
    from { clip-path: inset(0 0 100% 0 round var(--r-md)); }
    to   { clip-path: inset(0 0 0 0 round var(--r-md)); }
}
@keyframes flotter {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-14px) rotate(-3deg); }
}

.hero-texte > * {
    animation: monter 800ms var(--courbe-douce) both;
}
.hero-texte > :nth-child(1) { animation-delay: 80ms; }
.hero-texte > :nth-child(2) { animation-delay: 180ms; }
.hero-texte > :nth-child(3) { animation-delay: 300ms; }
.hero-texte > :nth-child(4) { animation-delay: 420ms; }
.hero-texte > :nth-child(5) { animation-delay: 520ms; }

/* Les photos s'animent sur leur conteneur : la parallaxe d'animations.js
   écrit, elle, sur les figures elles-mêmes. Les deux ne se gênent pas. */
.hero-images { animation: poser 1000ms var(--courbe-douce) 250ms both; }
.hero-photo-grande img { animation: devoiler 1200ms var(--courbe-douce) 350ms both; }
/* Opacité seule : une animation de `transform` maintenue par `both`
   écraserait le décalage de parallaxe posé en style par animations.js. */
@keyframes apparaitre { from { opacity: 0; } to { opacity: 1; } }
.hero-photo-petite { animation: apparaitre 900ms var(--courbe-douce) 900ms both; }

/* Le croissant en filigrane se balance très lentement. */
.hero::before { animation: flotter 14s ease-in-out infinite; }

/* ═══════════════════════════════ Pour qui ? ═════════════════════════════ */

.pourqui-grille {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--e-5);
}

.pourqui-carte {
    display: flex;
    flex-direction: column;
    background: var(--blanc);
    border: 1px solid var(--filet);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: transform 450ms var(--courbe-douce), box-shadow 450ms var(--courbe-douce),
                border-color var(--transition);
}
.pourqui-carte:hover,
.pourqui-carte:focus-visible {
    transform: translateY(-5px);
    box-shadow: var(--ombre-3);
    border-color: var(--prune-300);
}

.pourqui-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--papier-2); }
.pourqui-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 800ms var(--courbe-douce);
}
.pourqui-carte:hover .pourqui-media img { transform: scale(1.06); }

.pourqui-corps { display: flex; flex-direction: column; gap: var(--e-2); padding: var(--e-4) var(--e-4) var(--e-5); }
.pourqui-nom {
    font-family: var(--police-titre);
    font-size: 1.2rem;
    color: var(--encre-900);
    transition: color var(--transition);
}
.pourqui-carte:hover .pourqui-nom { color: var(--prune); }
.pourqui-texte { font-size: var(--t-mini); line-height: 1.55; color: var(--encre-500); }

/* ═════════════════════════════ Confiance ════════════════════════════════ */

.confiance-section { padding-block: clamp(40px, 5vw, 64px); border-top: 1px solid var(--filet); }

@media (max-width: 1000px) {
    .pourqui-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .pourqui-grille { gap: var(--e-3); }
    .pourqui-texte { display: none; }   /* la place manque : le titre suffit */
    .pourqui-corps { padding: var(--e-3); }
    .pourqui-nom { font-size: 1.02rem; }
}

/* ═══════════════════════════ Points de rupture ═══════════════════════════ */

@media (max-width: 1000px) {
    .mosaique { grid-template-columns: repeat(2, 1fr); }
    .cat-large { grid-column: span 2; grid-row: span 1; aspect-ratio: 16 / 10; }
    .etapes-liste { grid-template-columns: 1fr; gap: var(--e-5); }
    .etape { padding-top: var(--e-4); }
}

@media (max-width: 860px) {
    /* Le texte passe au-dessus des photos : sur une colonne, lire d'abord et
       regarder ensuite vaut mieux que l'inverse. */
    .hero-grille,
    .atelier-grille { grid-template-columns: 1fr; }
    .hero-texte { max-width: none; }
    .hero-images { padding-left: clamp(30px, 9vw, 60px); max-width: 540px; }
    .hero-photo-grande { aspect-ratio: 4 / 3; }
    .atelier-photo { aspect-ratio: 16 / 10; order: 2; }
    .atelier-texte { order: 1; }
    .atelier-texte p { max-width: none; }
    .savoir-liste { grid-template-columns: 1fr; }
    .savoir-liste li {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        gap: var(--e-4);
        padding: var(--e-4) 0;
        border-left: 0;
        border-top: 1px solid var(--filet);
    }
    .savoir-liste li:first-child { border-top: 0; }
}

@media (max-width: 560px) {
    .hero::before { display: none; }  /* le filigrane passe sous le texte */
    .hero-titre { font-size: clamp(2.3rem, 1.3rem + 5vw, 3rem); }
    .hero-actions .btn { flex: 1 1 100%; }
    /* Une seule colonne : la grande tuile ne doit plus en couvrir deux, sinon
       la grille crée une seconde colonne vide et une tuile sur deux y tombe,
       large de 0 px. */
    .mosaique { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
    .cat-large { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 3; }
    .cat { aspect-ratio: 3 / 2; }
    /* Les trois arguments en pastilles : avec les filets de séparation, le
       retour à la ligne laissait un trait seul en début de ligne. */
    .hero-arguments { gap: var(--e-2); }
    .hero-arguments li,
    .hero-arguments li + li {
        padding: 6px 12px;
        border: 1px solid var(--filet);
        border-radius: var(--r-rond);
        background: var(--blanc);
    }
}
