/* Site vitrine Memotivia.
   Jetons repris de docs/design/2026-11-25-palette-memotivia.md (D73), thèmes clair et sombre.
   Contrastes (WCAG 2.x, luminance relative) :
   Commun aux deux thèmes (en-tête, héros, bandeau « bientôt », pied de page) :
   - blanc sur mauve #8500FF : 6,1:1 ; encre #111111 sur mauve : 3,1:1, donc jamais de texte encre posé sur le mauve ;
   - encre sur jaune #FAFF00 : 17,4:1 (titres Permanent Marker, logo) ;
   - anneau de focus jaune sur mauve : 5,6:1 ; sur le pied #111111 : 17,4:1 ; blanc sur #111111 : 18,9:1.
   Clair :
   - texte #111111 sur fond #F6F4FA : 17,3:1, sur surface #FFFFFF : 18,9:1 ;
   - texte secondaire #575170 : 6,8:1 sur fond, 7,5:1 sur surface ;
   - lien #6A00CC : 7,7:1 sur fond, 8,5:1 sur surface ; focus #111111 : 17,3:1 ;
   - repère à compléter : encre sur #FFF3E0 17,2:1 ; statut : encre sur #EFE3FF 15,4:1.
   Sombre :
   - texte #F3F0F8 sur fond #121016 : 16,8:1, sur surface #1A1720 : 15,7:1, sur surface haute #24202C : 14,1:1 ;
   - texte secondaire #B3ACC2 : 8,6:1 sur fond, 8,1:1 sur surface ;
   - lien et focus #B57BFF : 6,5:1 sur fond, 6,1:1 sur surface ;
   - bordure #807990 sur surface : 4,3:1 ;
   - repère à compléter : #F3F0F8 sur #33281A 12,8:1 ; statut : #F3F0F8 sur #2E2147 13,1:1 ;
   - bouton mauve (texte blanc 6,1:1) contre le fond sombre : 3,1:1 (contour d'élément, seuil 3:1) ;
   - trait de surligneur : en sombre, bloc jaune plein derrière le titre, texte encre (17,4:1),
     car un texte clair sur un trait partiel deviendrait illisible. */

@font-face {
  font-family: "Permanent Marker";
  src: url("../fonts/PermanentMarker-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Overpass";
  src: url("../fonts/Overpass-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Overpass";
  src: url("../fonts/Overpass-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Thème clair (par défaut) */
:root {
  color-scheme: light;

  /* Marque : identiques dans les deux thèmes */
  --mauve: #8500FF;
  --mauve-fonce: #6A00CC;
  --jaune: #FAFF00;
  --encre: #111111;
  --blanc: #FFFFFF;

  /* Rôles qui changent avec le thème */
  --fond: #F6F4FA;
  --surface: #FFFFFF;
  --surface-haute: #ECE8F3;
  --texte: #111111;
  --texte-2: #575170;
  --lien: #6A00CC;
  --focus: #111111;
  --bordure: #857E96;
  --filet: #E2DCEC;
  --statut-fond: #EFE3FF;
  --todo-fond: #FFF3E0;
  --todo-bord: #B3261E;
  --pied-fond: #111111;
  --pied-filet: #3A3A3A;
  --trait: linear-gradient(transparent 52%, var(--jaune) 52%);

  --police-titre: "Permanent Marker", "Overpass", "Noto Sans", system-ui, sans-serif;
  --police-texte: "Overpass", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --e1: 0.25rem;
  --e2: 0.5rem;
  --e3: 0.75rem;
  --e4: 1rem;
  --e5: 1.5rem;
  --e6: 2rem;
  --e7: 3rem;
  --e8: 4.5rem;

  --rayon-s: 0.5rem;
  --rayon-m: 1rem;
  --rayon-l: 1.5rem;
  --largeur: 72rem;
  --largeur-texte: 42rem;
}

/* Thème sombre : choix explicite */
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #121016;
  --surface: #1A1720;
  --surface-haute: #24202C;
  --texte: #F3F0F8;
  --texte-2: #B3ACC2;
  --lien: #B57BFF;
  --focus: #B57BFF;
  --bordure: #807990;
  --filet: #2E2938;
  --statut-fond: #2E2147;
  --todo-fond: #33281A;
  --todo-bord: #FFB4AB;
  --pied-fond: #0B0A0E;
  --pied-filet: #2E2938;
  --trait: linear-gradient(var(--jaune), var(--jaune));
}

/* Thème sombre : préférence du système, sauf si le clair a été choisi */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #121016;
    --surface: #1A1720;
    --surface-haute: #24202C;
    --texte: #F3F0F8;
    --texte-2: #B3ACC2;
    --lien: #B57BFF;
    --focus: #B57BFF;
    --bordure: #807990;
    --filet: #2E2938;
    --statut-fond: #2E2147;
    --todo-fond: #33281A;
    --todo-bord: #FFB4AB;
    --pied-fond: #0B0A0E;
    --pied-filet: #2E2938;
    --trait: linear-gradient(var(--jaune), var(--jaune));
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--lien);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 0.16em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.sur-mauve :focus-visible,
.pied :focus-visible {
  outline-color: var(--jaune);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 var(--e4);
}
p,
ul,
ol {
  margin: 0 0 var(--e4);
}

.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0 var(--e5);
}

/* Lien d'évitement */
.evitement {
  position: absolute;
  left: var(--e4);
  top: -10rem;
  z-index: 10;
  background: var(--encre);
  color: var(--blanc);
  padding: var(--e3) var(--e4);
  border-radius: var(--rayon-s);
  font-weight: 700;
}
.evitement:focus {
  top: var(--e4);
}

/* Logo officiel (SVG de app/assets/brand, viewBox recadrée) : le nom au feutre sur le trait de surligneur.
   En-tête : version sans fond, posée sur le mauve. Pied : version avec son fond mauve. */
.logo {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}
.logo img {
  display: block;
  height: 2.25rem;
  width: auto;
}

/* En-tête */
.entete {
  background: var(--mauve);
  color: var(--blanc);
}
.entete .conteneur {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e3) var(--e4);
  padding-top: var(--e4);
  padding-bottom: var(--e4);
}
.entete-outils {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e2) var(--e4);
}
.entete-liens {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e2) var(--e4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.entete-liens a,
.bascule-langue {
  display: inline-block;
  min-height: 2.75rem;
  padding: var(--e3) var(--e1);
  color: var(--blanc);
  font-weight: 700;
}
.bascule-theme {
  display: inline-flex;
  align-items: center;
  gap: var(--e2);
  min-height: 2.75rem;
  padding: var(--e2) var(--e4);
  border: 2px solid var(--blanc);
  border-radius: 999px;
  background: transparent;
  color: var(--blanc);
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
}
.bascule-theme svg {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
}
.bascule-theme[aria-pressed="true"] {
  background: var(--blanc);
  color: var(--encre);
}

/* Boutons (liens) */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: var(--e3) var(--e5);
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  border: 2px solid transparent;
}
.bouton:hover {
  text-decoration: underline;
}
.bouton-clair {
  background: var(--blanc);
  color: var(--encre);
}
.bouton-plein {
  background: var(--mauve);
  color: var(--blanc);
}
.bouton-plein:hover {
  background: var(--mauve-fonce);
}

/* Héros */
.heros {
  background: var(--mauve);
  color: var(--blanc);
  padding: var(--e6) 0 var(--e8);
}
/* Capture dans le bandeau : grands écrans seulement (sur mobile, la galerie suffit). */
.heros-capture {
  display: none;
}
@media (min-width: 64rem) {
  .heros .conteneur {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--e7);
    align-items: center;
  }
  .heros-capture {
    display: block;
    width: 16rem;
    background: var(--surface);
    border-radius: var(--rayon-l);
    padding: var(--e2);
    transform: rotate(2deg);
  }
  .heros-capture img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--rayon-m);
  }
}
@media (prefers-reduced-motion: reduce) {
  .heros-capture {
    transform: none;
  }
}
.heros-surtitre {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: var(--e5);
}
.heros h1 {
  font-family: var(--police-titre);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 9vw, 4.5rem);
  line-height: 1.45;
  margin-bottom: var(--e5);
  max-width: 14ch;
}
.heros h1 span,
.stores .titre-section span {
  background: var(--jaune);
  color: var(--encre);
  padding: 0.02em 0.22em 0;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.heros-texte {
  font-size: 1.1875rem;
  max-width: 36rem;
}
.heros-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e4) var(--e5);
  margin-top: var(--e6);
}
.heros-actions p {
  margin: 0;
}
.heros a:not(.bouton),
.stores a:not(.bouton) {
  color: var(--blanc);
}
.note-test {
  font-size: 0.9375rem;
  margin-top: var(--e4);
}

/* Sections */
.section {
  padding: var(--e8) 0;
}
.section-claire {
  background: var(--surface);
}
.titre-section {
  font-family: var(--police-titre);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  line-height: 1.35;
  margin-bottom: var(--e5);
}
.titre-section span,
.page-legale h1 span {
  background: var(--trait);
  color: var(--encre);
  padding: 0 0.15em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.chapo {
  font-size: 1.1875rem;
  max-width: var(--largeur-texte);
  color: var(--texte-2);
}

/* Étapes */
.etapes {
  list-style: none;
  padding: 0;
  margin: var(--e6) 0 0;
  display: grid;
  gap: var(--e5);
  counter-reset: etape;
}
.etapes li {
  counter-increment: etape;
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--rayon-l);
  padding: var(--e5);
}
.etapes li::before {
  content: counter(etape);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--e4);
  border-radius: 50%;
  background: var(--mauve);
  color: var(--blanc);
  font-weight: 700;
  font-size: 1.125rem;
}
.etapes h3,
.points h3 {
  font-size: 1.25rem;
  margin-bottom: var(--e2);
}
.etapes p,
.points p {
  margin: 0;
  color: var(--texte-2);
}

/* Points forts */
.points {
  list-style: none;
  padding: 0;
  margin: var(--e6) 0 0;
  display: grid;
  gap: var(--e4);
}
.points li {
  border-radius: var(--rayon-m);
  background: var(--fond);
  padding: var(--e5);
}

/* Galerie de captures de l'app (format vertical ~640 × 1390) */
.galerie {
  list-style: none;
  padding: 0;
  margin: var(--e6) 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--e5) var(--e4);
}
/* Deux par ligne sur mobile, puis largeur fixe et centrage : la rangée reste équilibrée
   quel que soit le nombre de captures (4 ou 6). */
.galerie > li {
  flex: 0 1 calc(50% - var(--e4) / 2);
  min-width: 0;
}
@media (min-width: 40rem) {
  .galerie > li {
    flex-basis: 13rem;
  }
}

/* Fonctions avancées, regroupées */
.groupes {
  display: grid;
  gap: var(--e6);
  margin-top: var(--e6);
}
.groupe h3 {
  font-size: 1.4375rem;
  margin-bottom: var(--e3);
}
.fonctions {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--e3);
}
.fonctions li {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--rayon-m);
  padding: var(--e4) var(--e5);
}
.fonctions strong {
  display: block;
  margin-bottom: var(--e1);
}
.fonctions span {
  color: var(--texte-2);
}
@media (min-width: 64rem) {
  .groupes {
    grid-template-columns: repeat(3, 1fr);
  }
}
.galerie figure {
  margin: 0;
}
.cadre-capture {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--rayon-l);
  padding: var(--e2);
}
.cadre-capture img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--rayon-m);
}
.galerie figcaption {
  margin-top: var(--e3);
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--texte-2);
}

/* Bientôt disponible */
.stores {
  background: var(--mauve);
  color: var(--blanc);
}
.stores .titre-section {
  color: var(--blanc);
}
.pastilles {
  list-style: none;
  padding: 0;
  margin: var(--e5) 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--e3);
}
.pastilles li {
  border: 2px solid var(--blanc);
  border-radius: 999px;
  padding: var(--e2) var(--e4);
  font-weight: 700;
}

/* FAQ */
.faq {
  max-width: var(--largeur-texte);
  margin-top: var(--e5);
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--rayon-m);
  margin-bottom: var(--e3);
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.125rem;
  padding: var(--e4) var(--e5);
  min-height: 3rem;
  list-style-position: outside;
  margin-left: var(--e4);
}
.faq summary::marker {
  color: var(--lien);
}
.faq details > div {
  padding: 0 var(--e5) var(--e2);
}
.faq details[open] summary {
  border-bottom: 1px solid var(--filet);
  margin-bottom: var(--e4);
}

/* Pied de page */
.pied {
  background: var(--pied-fond);
  color: var(--blanc);
  border-top: 1px solid var(--pied-filet);
  padding: var(--e7) 0 var(--e6);
  font-size: 0.9375rem;
}
.pied a {
  color: var(--blanc);
  display: inline-block;
  min-height: 2rem;
  padding: var(--e1) 0;
}
.pied-grille {
  display: grid;
  gap: var(--e5);
}
.pied h2 {
  font-size: 1rem;
  margin-bottom: var(--e2);
}
.pied ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pied .logo {
  margin-bottom: var(--e4);
  padding: 0;
  min-height: 0;
}
.pied .logo img {
  height: 2.5rem;
  border-radius: var(--rayon-s);
}
.pied-bas {
  margin-top: var(--e6);
  padding-top: var(--e4);
  border-top: 1px solid var(--pied-filet);
  background: var(--pied-fond);
  color: var(--blanc);
}

/* Repère de texte à compléter : volontairement visible */
.a-completer {
  background: var(--todo-fond);
  color: var(--texte);
  border: 2px dashed var(--todo-bord);
  border-radius: 4px;
  padding: 0 0.3em;
  font-weight: 700;
}

/* Pages légales */
.page-legale {
  padding: var(--e7) 0 var(--e8);
}
.page-legale .conteneur {
  max-width: calc(var(--largeur-texte) + 3rem);
}
/* Titres des pages légales : longs, donc en Overpass et en casse normale
   (Permanent Marker et capitales réservés aux titres courts).
   Paliers d'au moins 1,25× : texte 17-18 px, h3 23 px, h2 30 px, h1 38-48 px. */
.page-legale h1 {
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: clamp(2.375rem, 7vw, 3rem);
  line-height: 1.25;
  margin-bottom: var(--e5);
}
.page-legale h2 {
  font-size: 1.875rem;
  line-height: 1.25;
  margin-top: var(--e7);
  margin-bottom: var(--e3);
}
.page-legale h3 {
  font-size: 1.4375rem;
  line-height: 1.3;
  margin-top: var(--e5);
  margin-bottom: var(--e2);
}
.page-legale ul {
  padding-left: 1.25rem;
}
.page-legale li {
  margin-bottom: var(--e2);
}
.statut {
  background: var(--statut-fond);
  border-radius: var(--rayon-s);
  padding: var(--e4);
  color: var(--texte);
}
.encadre {
  background: var(--surface);
  border: 1px solid var(--filet);
  border-radius: var(--rayon-m);
  padding: var(--e5);
  margin: var(--e5) 0;
}
.encadre h2 {
  margin-top: 0;
}

/* 404 */
.page-404 {
  padding: var(--e8) 0;
  min-height: 50vh;
}
.page-404 .autre-langue {
  margin-top: var(--e7);
  padding-top: var(--e5);
  border-top: 1px solid var(--filet);
}

/* Écrans moyens */
@media (min-width: 40rem) {
  .etapes {
    grid-template-columns: repeat(3, 1fr);
  }
  .points {
    grid-template-columns: repeat(2, 1fr);
  }
  .pied-grille {
    grid-template-columns: 2fr 1fr 1fr;
  }
  .logo img {
    height: 2.5rem;
  }
}

/* Grands écrans */
@media (min-width: 64rem) {
  body {
    font-size: 1.125rem;
  }
  .heros {
    padding: var(--e7) 0 calc(var(--e8) + var(--e4));
  }
  .points {
    grid-template-columns: repeat(3, 1fr);
  }
  .apercu {
    grid-template-columns: 1fr 1fr;
    gap: var(--e8);
  }
  .apercu-figure {
    order: 2;
  }
}

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Couleurs forcées (contraste élevé Windows) */
@media (forced-colors: active) {
  .heros h1 span,
  .stores .titre-section span {
    border: 2px solid CanvasText;
  }
  .bouton,
  .bascule-theme {
    border-color: ButtonText;
  }
}

@media print {
  .entete,
  .pied,
  .evitement {
    display: none;
  }
  body {
    background: #FFFFFF;
    color: #111111;
  }
}
