/* Site vitrine « Faute qui peut ! » — fautequipeut.fr */

@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('polices/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url('polices/fredoka-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Playpen Sans'; font-weight: 500; font-display: swap; src: url('polices/playpen-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Playpen Sans'; font-weight: 700; font-display: swap; src: url('polices/playpen-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Kalam'; font-weight: 700; font-display: swap; src: url('polices/kalam-latin-700-normal.woff2') format('woff2'); }

:root {
  --bois: #22170f;
  --bois-2: #2b1d14;
  --bois-3: #1a110b;
  --papier: #f5ead3;
  --papier-2: #efe0c2;
  --carte: #fffaf0;
  --trait: #e3d3b3;
  --encre: #2b1d14;
  --encre-douce: #5a4636;
  --clair: #fff6e2;
  --clair-doux: #eadcc0;
  --orange: #e9a23b;
  --orange-clair: #f0b154;
  --orange-ombre: #b9771f;
  --vert: #3f7a4c;
  --rouge: #c0392b;
  --bleu: #2f5d9e;
  --titre: 'Fredoka', system-ui, sans-serif;
  --texte: 'Playpen Sans', system-ui, sans-serif;
  --main: 'Kalam', cursive;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bois); color: var(--encre); font: 500 16px/1.6 var(--texte); overflow-x: clip; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--titre); margin: 0; }
p { margin: 0; }
a { color: var(--rouge); }
a:hover { color: #8e2a1f; }
:focus-visible { outline: 3px solid var(--orange-clair); outline-offset: 3px; border-radius: 6px; }

.conteneur { max-width: 1120px; margin: 0 auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Téléphone */
.tel { position: relative; width: 100%; aspect-ratio: 923 / 2000; padding: 9px; border-radius: 42px; background: #110c08; box-shadow: 0 0 0 2px #3a2a1d, 0 30px 60px -20px rgba(0,0,0,.65), 0 10px 24px -10px rgba(0,0,0,.5); }
.tel img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 33px; }
.tel-seul { flex: 0 1 280px; max-width: 280px; width: 70%; }
.duo { display: flex; justify-content: center; align-items: flex-start; gap: 4%; }
.duo > div { flex: 0 1 240px; }
.duo > div + div { margin-top: 56px; }

/* Badges officiels des stores (même hauteur pour les deux, comme le demandent Apple et Google) */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 6px; }
.store { display: inline-flex; border-radius: 10px; }
.store img { display: block; height: clamp(42px, 12vw, 52px); width: auto; }
.store:hover img { filter: brightness(1.15); }

/* Accueil */
.heros { position: relative; padding: 36px 20px 64px; color: var(--papier); overflow-x: clip; }
@media (max-width: 699px) { .deco-goutte { display: none; } }
.heros-fond { position: absolute; inset: -80px -40px; z-index: 0; background: url('img/fond-flou.webp') center 30% / cover; opacity: .38; }
.heros-voile { position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(34,23,15,.15) 0%, rgba(34,23,15,.88) 100%); }
.deco { position: absolute; z-index: 1; pointer-events: none; }
.heros-grille { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 40px 64px; }
.heros-texte { flex: 1 1 340px; max-width: 540px; display: flex; flex-direction: column; gap: 20px; }
.heros h1 { line-height: 0; }
.heros h1 img { width: 100%; max-width: 520px; height: auto; filter: drop-shadow(0 4px 0 rgba(0,0,0,.35)); }
.heros-intro { font-size: 18px; line-height: 1.55; color: var(--clair-doux); }
.surtitre { font: 700 24px/1.2 var(--main); color: var(--orange-clair); }
.surtitre.rouge { color: var(--rouge); }
/* Les trois atouts : une rangée de trois colonnes, icône au-dessus, séparées par un trait fin */
.atouts { list-style: none; margin: 4px 0 0; padding: 14px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid rgba(245,234,211,.18); border-bottom: 1px solid rgba(245,234,211,.18); }
.atouts li { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 2px 6px; text-align: center; font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--clair); }
.atouts li + li { border-left: 1px solid rgba(245,234,211,.18); }
.atouts svg { color: var(--orange-clair); }
.heros-tel { flex: 0 1 300px; max-width: 300px; width: 74%; }

/* Piste de course */
.piste { position: relative; z-index: 2; margin-top: 56px; height: 132px; overflow: clip; border-bottom: 3px dashed rgba(245,234,211,.25); container-type: inline-size; }
.poursuite { position: absolute; left: calc(50% - 135px); bottom: 0; display: flex; align-items: flex-end; gap: 70px; width: 270px; }
.piste-legende { position: relative; z-index: 2; margin-top: 12px; font: 700 23px/1.3 var(--main); color: var(--clair-doux); text-align: center; }

/* Personnages animés (planches de 2 rangées x 11 images) */
.sprite { background-repeat: no-repeat; background-size: 1100% 200%; background-position: 0% 0%; }
.sp-gommeo { height: 120px; aspect-ratio: 357 / 420; background-image: url('img/gommeo-course.webp'); }
.sp-faute { height: 112px; aspect-ratio: 361 / 420; background-image: url('img/faute-course.webp'); }
.sp-ricane { height: 150px; aspect-ratio: 346 / 420; background-image: url('img/faute-ricane.webp'); }

/* Sections */
.section { position: relative; z-index: 2; padding: 80px 20px; }
.section.papier { background: var(--papier); }
.section.papier-2 { background: var(--papier-2); }
.section.sombre { background: var(--bois-2); color: var(--papier); }
.rangee { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px 72px; }
.rangee.inverse { flex-wrap: wrap-reverse; }
.texte { flex: 1 1 340px; max-width: 500px; display: flex; flex-direction: column; gap: 18px; }
.section h2 { font-size: clamp(32px, 8vw, 46px); line-height: 1.05; font-weight: 700; }
.sombre h2 { color: var(--clair); }
.section .texte p:not(.surtitre) { font-size: 17px; line-height: 1.65; color: var(--encre-douce); }
.sombre .texte p:not(.surtitre) { color: var(--clair-doux); }
.sombre strong { color: var(--clair); }

/* Promesses */
/* Les promesses : une feuille de cahier (lignes bleues, marge rouge), cochée à la main */
.promesses { position: relative; z-index: 2; background: var(--papier); padding: 72px 16px 80px; }
/* Le principe, juste sous l'accueil : le papier arrive avec des coins arrondis */
.section.haut-arrondi { border-radius: 28px 28px 0 0; padding-top: 64px; }
.cahier { --ligne: 32px; position: relative; max-width: 760px; margin: 0 auto; padding: calc(var(--ligne) * 1.5) 20px var(--ligne) 64px; background-color: #fffdf6; background-image: repeating-linear-gradient(180deg, transparent 0 calc(var(--ligne) - 1px), #cfdcf0 calc(var(--ligne) - 1px) var(--ligne)); background-position: 0 14px; border-radius: 6px; box-shadow: 0 1px 0 #e3d3b3, 0 18px 40px -22px rgba(43,29,20,.45); transform: rotate(-.6deg); }
.cahier::before { content: ''; position: absolute; top: 0; bottom: 0; left: 44px; width: 2px; background: #e5a3a3; }
.cahier h2 { font: 700 30px/var(--ligne) var(--main); color: var(--rouge); margin: 0 0 var(--ligne); }
.cahier ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--ligne); }
.cahier li { position: relative; }
.cahier .coche { position: absolute; left: -54px; top: -4px; color: var(--vert); }
.cahier h3 { font: 600 20px/var(--ligne) var(--titre); color: var(--encre); }
.cahier p { font-size: 16px; line-height: var(--ligne); color: var(--encre-douce); }
@media (min-width: 900px) {
  .cahier { padding-left: 84px; padding-right: 48px; }
  .cahier::before { left: 60px; }
  .cahier { max-width: 680px; }
  .cahier .coche { left: -62px; }
}

/* Étapes */
.etapes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.etapes li { display: flex; gap: 14px; align-items: flex-start; font-size: 17px; line-height: 1.5; }
.etapes li > span:first-child { flex: 0 0 36px; height: 36px; border-radius: 50%; background: var(--orange); display: flex; align-items: center; justify-content: center; font: 700 17px var(--titre); }
.etapes li > span:last-child { padding-top: 5px; }

/* Thématiques : par défaut, un carrousel qu'on fait glisser au doigt.
   Quand le navigateur sait lier une animation au défilement, la section reste à l'écran
   et les thématiques défilent de droite à gauche pendant qu'on descend (plus bas). */
.themes-defile { position: relative; z-index: 2; background: var(--papier); padding: 72px 0; }
.themes-collant { display: flex; flex-direction: column; gap: 24px; }
.themes-tete { width: 100%; padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }
.themes-tete h2 { font-size: clamp(30px, 7.5vw, 46px); line-height: 1.05; font-weight: 700; }
.themes-fenetre { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.themes-fenetre::-webkit-scrollbar { display: none; }
.themes-piste { list-style: none; margin: 0; padding: 0; display: flex; width: calc(100% * 9); }
.themes-tete p { font-size: 17px; line-height: 1.5; color: var(--encre-douce); }
.diapo { flex: 0 0 calc(100% / 9); scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 20px; }
.diapo .tel { height: min(60svh, 640px); width: auto; flex: none; border-radius: 36px; padding: 8px; }
.diapo .tel img { border-radius: 28px; }
.diapo .numero { font: 600 14px var(--titre); color: var(--encre-douce); letter-spacing: .08em; }
.themes-progres { display: none; }
@media (min-width: 900px) {
  .themes-tete { align-items: center; text-align: center; }
  .diapo .tel { height: min(64svh, 640px); }
}

/* Trophées */
.centre { display: flex; flex-direction: column; align-items: center; gap: 44px; }
.centre .texte { max-width: 620px; text-align: center; align-items: center; }
.centre .duo { width: 100%; max-width: 600px; }
.centre .duo > div { flex-basis: 260px; }

/* Appel final */
.final { position: relative; z-index: 2; background: var(--bois); color: var(--papier); padding: 72px 20px; text-align: center; }
.final .conteneur { max-width: 620px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.final h2 { font-size: clamp(36px, 9vw, 56px); line-height: 1; font-weight: 700; color: var(--clair); }
.final p { font-size: 18px; line-height: 1.5; color: var(--clair-doux); }
.final .stores { justify-content: center; }
.final .petit { font-size: 15px; font-weight: 700; color: #c9b48f; }

/* Pied de page */
.pied { background: var(--bois-3); color: #c9b48f; padding: 24px 20px 32px; font-size: 14px; }
.pied .conteneur { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; }
.pied nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.pied a { color: #e3d3b3; display: inline-flex; align-items: center; min-height: 44px; }
.pied a:hover { color: var(--clair); }

/* Page « Continue dans l'appli » (telecharger.html), après un défi ou un duel joué sur le site */
.appli { max-width: 520px; margin: 0 auto; padding: 28px 20px 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; color: var(--papier); }
.appli-logo { line-height: 0; }
.appli-logo img { width: min(250px, 70vw); height: auto; filter: drop-shadow(0 3px 0 rgba(0,0,0,.35)); }
.appli-course { display: flex; align-items: flex-end; gap: 30px; height: 84px; }
.appli-course .sp-faute { height: 74px; }
.appli-course .sp-gommeo { height: 80px; }
.appli-carte .store img { height: clamp(38px, 10.5vw, 48px); }
.appli h1 { font-size: clamp(30px, 8vw, 40px); line-height: 1.1; font-weight: 700; color: var(--clair); }
.appli-sous { font-size: 17px; line-height: 1.5; color: var(--clair-doux); }
.appli-carte { width: 100%; margin-top: 6px; padding: 22px 18px 20px; border-radius: 20px; background: var(--papier); color: var(--encre); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.appli-carte h2 { font: 700 26px/1.2 var(--main); color: var(--rouge); }
.appli-carte ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; text-align: left; width: 100%; }
.appli-carte li { display: flex; align-items: center; gap: 12px; font-size: 16px; line-height: 1.4; color: var(--encre-douce); }
.appli-carte li svg { flex: none; color: var(--vert); }
.appli-carte strong { color: var(--encre); }
.appli-petit { font-size: 14px; font-weight: 700; color: var(--encre-douce); }
.appli-liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 15px; color: #c9b48f; }
.appli-liens a { color: var(--papier); display: inline-flex; align-items: center; min-height: 44px; }

/* Animations : la course des personnages et la parallaxe au défilement */
@keyframes course16 { 0%{background-position:0% 0%} 6.25%{background-position:10% 0%} 12.5%{background-position:20% 0%} 18.75%{background-position:30% 0%} 25%{background-position:40% 0%} 31.25%{background-position:50% 0%} 37.5%{background-position:60% 0%} 43.75%{background-position:70% 0%} 50%{background-position:80% 0%} 56.25%{background-position:90% 0%} 62.5%{background-position:100% 0%} 68.75%{background-position:0% 100%} 75%{background-position:10% 100%} 81.25%{background-position:20% 100%} 87.5%{background-position:30% 100%} 93.75%{background-position:40% 100%} 100%{background-position:0% 0%} }
@keyframes course19 { 0%{background-position:0% 0%} 5.263%{background-position:10% 0%} 10.526%{background-position:20% 0%} 15.789%{background-position:30% 0%} 21.053%{background-position:40% 0%} 26.316%{background-position:50% 0%} 31.579%{background-position:60% 0%} 36.842%{background-position:70% 0%} 42.105%{background-position:80% 0%} 47.368%{background-position:90% 0%} 52.632%{background-position:100% 0%} 57.895%{background-position:0% 100%} 63.158%{background-position:10% 100%} 68.421%{background-position:20% 100%} 73.684%{background-position:30% 100%} 78.947%{background-position:40% 100%} 84.211%{background-position:50% 100%} 89.474%{background-position:60% 100%} 94.737%{background-position:70% 100%} 100%{background-position:0% 0%} }
@keyframes parallaxe { from { transform: translate3d(0, var(--d), 0); } to { transform: translate3d(0, calc(var(--d) * -1), 0); } }
@keyframes poursuite { from { transform: translate3d(calc(-50cqw - 140px), 0, 0); } to { transform: translate3d(calc(50cqw + 140px), 0, 0); } }

/* Les 9 thématiques : une pause sur chacune, puis glissement vers la suivante */
@keyframes defile-themes { 0.00%{transform:translate3d(0%,0,0)} 2.75%{transform:translate3d(0%,0,0)} 9.75%{transform:translate3d(-11.1111%,0,0)} 15.25%{transform:translate3d(-11.1111%,0,0)} 22.25%{transform:translate3d(-22.2222%,0,0)} 27.75%{transform:translate3d(-22.2222%,0,0)} 34.75%{transform:translate3d(-33.3333%,0,0)} 40.25%{transform:translate3d(-33.3333%,0,0)} 47.25%{transform:translate3d(-44.4444%,0,0)} 52.75%{transform:translate3d(-44.4444%,0,0)} 59.75%{transform:translate3d(-55.5556%,0,0)} 65.25%{transform:translate3d(-55.5556%,0,0)} 72.25%{transform:translate3d(-66.6667%,0,0)} 77.75%{transform:translate3d(-66.6667%,0,0)} 84.75%{transform:translate3d(-77.7778%,0,0)} 90.25%{transform:translate3d(-77.7778%,0,0)} 97.25%{transform:translate3d(-88.8889%,0,0)} 100.00%{transform:translate3d(-88.8889%,0,0)} }
@keyframes progres-themes { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: no-preference) {
  .sp-gommeo, .sp-faute { animation: course16 .667s steps(1, end) infinite; }
  .sp-ricane { animation: course19 .79s steps(1, end) infinite; }
  @supports (animation-timeline: view()) {
    /* Section épinglée : environ 70 % de hauteur d'écran de défilement par thématique */
    /* (Cyril, 25 octobre : de l'espace avant « Thématiques », comme pour les autres blocs) */
    .themes-defile { height: 660svh; padding: 56px 0 0; view-timeline: --themes block; }
    .themes-collant { position: sticky; top: 0; height: 100svh; justify-content: safe center; gap: 18px; overflow: clip; padding: 24px 0; }
    .themes-fenetre { overflow: visible; scroll-snap-type: none; }
    .themes-piste { animation: defile-themes linear both; animation-timeline: --themes; animation-range: contain 0% contain 100%; will-change: transform; }
    .themes-progres { display: block; width: min(240px, 60%); height: 6px; margin: 0 auto; border-radius: 3px; background: var(--trait); overflow: hidden; }
    .themes-progres span { display: block; height: 100%; background: var(--vert); transform-origin: left; animation: progres-themes linear both; animation-timeline: --themes; animation-range: contain 0% contain 100%; }
    .px { animation: parallaxe linear both; animation-timeline: view(); animation-range: cover; will-change: transform; }
    .poursuite { animation: poursuite linear both; animation-timeline: view(); animation-range: cover 10% cover 90%; will-change: transform; }
  }
}
