/* Parcours animé de l'accueil. Les animations ne s'appliquent qu'avec .anime
   (JavaScript actif et pas de réglage « réduire les animations »). */

/* Fil de progression sous l'en-tête */
.fil { position: fixed; left: 0; right: 0; top: 64px; height: 3px; z-index: 9; pointer-events: none; }
.fil span { display: block; height: 100%; background: var(--cuivre); transform-origin: 0 50%; transform: scaleX(var(--lu, 0)); }

/* 1. Ouverture */
.ouverture { position: relative; min-height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; overflow: hidden; padding: 3rem 1.25rem 7rem; }
.ouverture h1 { font-size: clamp(42px, 8.4vw, 112px); line-height: 1.04; max-width: 11em; margin: 0 auto .4em; }
.mot { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .14em; margin-bottom: -.14em; }
.mot > span { display: inline-block; }
.ouverture__sous { color: var(--gris); max-width: 32rem; margin: 0 auto 1.5rem; }
.ouverture__actions { display: flex; gap: .75rem; justify-content: center; align-items: center; flex-wrap: wrap; margin: 0; }
.ouverture__promo { background: var(--cuivre); color: var(--papier); font: 600 13px var(--texte); letter-spacing: .1em; padding: .35rem .7rem; border-radius: 6px; }
.ouverture__crayon { width: min(760px, 100%); margin-top: 2.5rem; }
.ouverture__crayon .crayon { width: 100%; height: auto; filter: drop-shadow(0 18px 14px rgba(30, 34, 38, .22)); }
.ouverture__descendre { position: absolute; bottom: 1.1rem; left: 50%; transform: translateX(-50%); font: 600 12px var(--texte); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--gris); display: grid; justify-items: center; gap: .5rem; }
.ouverture__descendre span { width: 1.5px; height: 40px; background: var(--graphite); }

/* Scènes */
.scene__colle { position: relative; }
.trace .scene__colle, .couleurs .scene__colle { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* 2. Le logo se dessine */
.trace { background: var(--graphite); color: var(--papier); }
.trace .scene__colle { padding: 3rem 1rem; }
.trace__mots { text-align: center; }
.phase { font: 600 clamp(30px, 6vw, 76px)/1.1 var(--titres); margin: 0; }
.trace__dessin { width: min(1000px, 100%); height: auto; overflow: visible; margin-top: clamp(1.5rem, 10vh, 7rem); }
.trace__dessin .contour { fill: none; stroke: var(--papier); stroke-width: 3; stroke-linecap: round; }
.trace__dessin .plein-logo { fill: var(--papier); fill-rule: evenodd; }

/* 3. Les couleurs */
.couleurs { --teinte: #3A3F46; --vif: #7A7E85; }
.couleurs .scene__colle { background: var(--teinte); transition: background-color .6s; padding: 1.5rem 1rem; overflow: hidden; }
.couleurs__geant { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; justify-content: center; font: 600 clamp(110px, 30vw, 430px)/1 var(--titres); color: var(--vif); opacity: .13; margin: 0; white-space: nowrap; pointer-events: none; }
.couleurs__titre { text-align: center; position: relative; }
.couleurs__titre h2 { margin: 0; }
.couleurs__crayon { position: relative; width: min(860px, 100%); margin: clamp(1rem, 5vh, 3rem) 0; }
.couleurs__crayon .crayon { width: 100%; height: auto; filter: drop-shadow(0 22px 16px rgba(30, 34, 38, .24)); }
.couleurs__choix { position: relative; display: grid; justify-items: center; gap: 1.1rem; margin-top: 1.25rem; }
.couleurs__points { display: flex; gap: .9rem; }
.couleurs__points button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; padding: 0; transition: transform .25s, box-shadow .25s; }
.couleurs__points button[aria-pressed="true"] { transform: scale(1.2); box-shadow: 0 0 0 3px var(--teinte), 0 0 0 5px var(--graphite); }

/* 4. Les mines */
.mines-chute { overflow: hidden; }
.chute { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.5rem, 2vw, 1.5rem); list-style: none; margin: 0; padding: 0; }
.chute a { display: grid; justify-items: center; gap: .5rem; background: #fff; border-radius: 16px; padding: 1rem .25rem; text-decoration: none; font: 500 18px var(--titres); transition: transform .25s; }
.chute a:hover { transform: translateY(-8px) rotate(-2deg); }
.chute img { width: min(100%, 170px); height: auto; }

/* 5. Parcours horizontal */
.gestes { background: var(--papier-fonce); }
.gestes .scene__colle { display: flex; flex-direction: column; justify-content: center; gap: clamp(.75rem, 3vh, 1.75rem); padding: 2rem 0; }
.gestes h2 { margin: 0; }
.piste { list-style: none; margin: 0; padding: 0 20px; display: grid; gap: 1rem; }
.piste li { background: var(--papier); border-radius: 16px; padding: clamp(1.25rem, 4vh, 2rem) 1.75rem; }
.piste li > span { display: block; font: 600 clamp(44px, 10vh, 92px)/1 var(--titres); color: var(--cuivre); }
.piste svg { display: block; width: clamp(52px, 10vh, 76px); height: auto; aspect-ratio: 1; margin: 1rem 0; fill: none; stroke: var(--graphite); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.piste p { margin: 0; color: var(--gris); }
.piste__barre { display: none; }

/* 7. Révélation de la gamme */
.revele .scene__colle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem 1rem; text-align: center; }
.revele h2 { margin: 0; }
.revele__cadre { width: min(680px, 100%, 70vh); aspect-ratio: 592 / 519; overflow: hidden; background: #fff; border-radius: 16px; }
.revele__cadre img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Final : la main qui grandit */
.final { background: var(--papier); }
.final .scene__colle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; padding: 2rem 1rem; overflow: hidden; }
.final__texte { text-align: center; position: relative; z-index: 1; }
.final__texte h2 { font-size: clamp(40px, 7.5vw, 96px); line-height: 1.04; margin: 0 0 .75rem; text-wrap: balance; }
.final__texte p { color: var(--gris); margin: 0 0 1rem; }
.final__main { display: block; height: min(44vh, 520px); width: auto; max-width: 100%; object-fit: cover; border-radius: 16px; }

/* Remplacer la mine : photos du fournisseur */
.changer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.6rem, 2vw, 1.25rem); list-style: none; margin: 0; padding: 0; }
.changer li { background: #fff; border-radius: 16px; overflow: hidden; }
.changer img { width: 100%; height: auto; }
.changer p { display: flex; gap: .6rem; align-items: baseline; margin: 0; padding: .8rem 1rem 1rem; font: 500 16px/1.35 var(--titres); }
.changer p span { color: var(--cuivre); font-weight: 600; font-size: 22px; }
.changer__note { text-align: center; margin: 1.25rem 0 0; }
@media (min-width: 860px) { .changer { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* 1 crayon ≈ 100 crayons */
.equivaut { text-align: center; }
.equivaut h2 { max-width: 16em; margin-inline: auto; text-wrap: balance; }
.equivaut img { width: min(600px, 100%); height: auto; margin: 1rem auto; border-radius: 16px; }

/* Photos de présentation */
.ambiance { display: grid; gap: 1.25rem; list-style: none; margin: 0 auto; padding: 0; max-width: 1040px; }
.ambiance figure { margin: 0; }
.ambiance img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; transition: transform .5s ease; }
.ambiance li:hover img { transform: scale(1.03) rotate(-.6deg); }
.ambiance figcaption { padding-top: .75rem; color: var(--gris); }
.ambiance figcaption strong { display: block; font: 500 1.15rem var(--titres); color: var(--graphite); }
@media (max-width: 719px) { .ambiance { max-width: 420px; } }
@media (min-width: 720px) { .ambiance { grid-template-columns: repeat(3, 1fr); } .ambiance li:nth-child(2) { margin-top: 2.5rem; } }
.garder { display: grid; gap: 2rem; align-items: center; justify-items: center; text-align: center; }
.garder h2 { font-size: clamp(32px, 4.6vw, 60px); text-wrap: balance; }
.garder img { width: min(100%, 440px); height: auto; border-radius: 16px; }
@media (min-width: 860px) { .garder { grid-template-columns: 1.2fr 1fr; justify-items: start; text-align: left; gap: 4rem; } .garder img { justify-self: end; } }
.photo-pro { display: block; width: min(100%, 317px); height: auto; border-radius: 16px; margin: 0 0 1.5rem; }

/* ===================== Animations ===================== */
.anime .scene { height: var(--hauteur); }
.anime .scene__colle { position: sticky; top: 64px; height: calc(100vh - 64px); overflow: hidden; }

.anime .mot > span { transform: translateY(120%); animation: monte .9s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--i) * .11s + .15s); }
@keyframes monte { to { transform: none; } }
.anime .ouverture__sous, .anime .ouverture__actions, .anime .ouverture .etiquette { animation: apparait .8s .95s both; }
@keyframes apparait { from { opacity: 0; transform: translateY(18px); } }
.anime .ouverture__texte { opacity: calc(1 - var(--p, 0) * 1.4); transform: translateY(calc(var(--p, 0) * -90px)); }
.anime .ouverture__crayon { animation: arrive 1.3s .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes arrive { from { opacity: 0; transform: translateX(-60vw) rotate(-30deg); } }
.anime .flotte { transform: translate(calc(var(--p, 0) * 46vw), calc(var(--p, 0) * -120px)) rotate(calc(-7deg - var(--p, 0) * 34deg)) scale(calc(1 + var(--p, 0) * .25)); }
.anime .flotte .crayon { animation: flotte 4.5s ease-in-out infinite; }
@keyframes flotte { 50% { transform: translateY(-14px) rotate(1.2deg); } }
.anime .ouverture__descendre span { animation: goutte 1.6s ease-in-out infinite; transform-origin: top; }
@keyframes goutte { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.anime .trace__mots { display: grid; }
.anime .phase { grid-area: 1 / 1; opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .45s, transform .45s; }
.anime .phase.active { opacity: 1; transform: none; }

.anime .couleurs__geant { transform: translate(calc((var(--q, .5) - .5) * -24vw), -50%); }
.anime .couleurs__crayon { transform: rotate(calc(-12deg + var(--q, .5) * 16deg)) scale(calc(.93 + var(--q, .5) * .1)); }
.anime .change { animation: surgit .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes surgit { from { opacity: 0; transform: translateX(-90px) scale(.92); } }

.anime .gestes .piste { display: flex; width: max-content; gap: 1.5rem; transform: translateX(var(--x, 0px)); will-change: transform; }
.anime .gestes .piste li { width: min(430px, 78vw); opacity: .35; transform: scale(.92) rotate(1.5deg); transition: opacity .4s, transform .4s; }
.anime .gestes .piste li.active { opacity: 1; transform: none; }
.anime .piste svg path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s ease; }
.anime .piste li.active svg path { stroke-dashoffset: 0; }
.anime .piste__barre { display: block; width: min(1120px, calc(100% - 40px)); margin: 0 auto; height: 3px; background: rgba(30, 34, 38, .15); }
.anime .piste__barre span { display: block; height: 100%; background: var(--graphite); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

.anime .revele__cadre { clip-path: inset(calc((1 - var(--r, 0)) * 34%) calc((1 - var(--r, 0)) * 40%) round calc(16px + (1 - var(--r, 0)) * 200px)); }
.anime .revele__cadre img { transform: scale(calc(1.5 - var(--r, 0) * .5)) rotate(calc((1 - var(--r, 0)) * -5deg)); }
.anime .revele h2 { opacity: var(--r, 0); transform: translateY(calc((1 - var(--r, 0)) * 40px)); }

.anime .final__texte h2 { transform: scale(calc(.62 + .38 * var(--p, 0))); }
.anime .final__main { transform: translateY(calc((1 - var(--p, 0)) * 30vh)) scale(calc(.45 + .65 * var(--p, 0))) rotate(calc((1 - var(--p, 0)) * 9deg)); transform-origin: 50% 20%; }

/* Apparitions à l'arrivée dans l'écran */
.anime [data-voir], .anime .item { opacity: 0; transform: translateY(46px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--rang, 0) * .11s); }
.anime [data-voir].vu, .anime .item.vu { opacity: 1; transform: none; }
.anime .chute .item { transform: translateY(-120px) rotate(-14deg); transition-timing-function: ease, cubic-bezier(.3, 1.6, .5, 1); }
.anime .chute .item.vu { transform: none; }
.anime tbody tr.item { transform: translateX(-60px); }
.anime tbody tr.item.vu { transform: none; }

@media (max-width: 719px) {
  .phase { min-height: 2.3em; }
  .chute { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
