/* « On est là ! » : site de présentation.
   Mêmes couleurs que l'appli (flutter_app/lib/ui/theme.dart) : papier, encre, rouge affiche, ruban adhésif.
   La couleur ne sert qu'au mur d'affiches (les types d'événement) et aux actions ; le reste est papier et encre.
   Signature : le ruban adhésif jaune, qui tient les affiches et les notes. */

/* Polices de l'appli, réduites aux caractères français et servies par le site (rien n'est demandé à Google) */
@font-face { font-family: "Bricolage Grotesque"; src: url(polices/bricolage-800.woff) format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(polices/atkinson-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(polices/atkinson-700.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url(polices/spacemono-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url(polices/spacemono-700.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Kalam"; src: url(polices/kalam-700.woff) format("woff"); font-weight: 700; font-display: swap; }

/* Couleurs du village déclarées, pour que le cycle jour/nuit les fasse glisser au lieu de sauter */
@property --v1 { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --v2 { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --v3 { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --v4 { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --v5 { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --vf { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --vo { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --vc { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --ciel { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --etoiles { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --couchant { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --levant { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --soleil { syntax: "<color>"; inherits: true; initial-value: transparent; }

:root {
  color-scheme: light dark;
  --paper: #F5EFE3;
  --paper-raised: #FFFAF1;
  --paper-sunk: #EBE3D3;
  --ink: #221C15;
  --ink-muted: #6B6052;
  --line: #D9CFBD;
  --line-strong: #8F8371;
  --brand: #D63C1F;
  --brand-hover: #BB3218;
  --brand-ink: #B02E14;
  --on-brand: #FFFFFF;
  --tape: #F2C14E;
  --success-ink: #2A6F41;
  --passport: #6D1F2B;
  --on-passport: #F6ECD9;
  --on-cat: #FFFFFF;
  --c-marche: #B87008;
  --c-fete: #D1366E;
  --c-concert: #6A3FB5;
  --c-brocante: #8A5A33;
  --c-sport: #2A62C9;
  --c-nature: #3B8A3E;
  --poster-shadow: 0 1px 1px rgba(34, 28, 21, .12), 0 10px 18px -8px rgba(34, 28, 21, .45);
  /* Le village du fond, de jour : du plus loin au plus proche, puis fenêtres, portes, ciel de l'arche */
  --v1: #EAE1CF; --v2: #DFD4BE; --v3: #D2C5AC; --v4: #C2B293; --v5: #A3926F;
  --vf: #F5EFE3; --vo: #F5EFE3; --vc: #F5EFE3; --ciel: rgba(46, 42, 51, 0); --etoiles: 0; --soleil-o: .8;
  --couchant: rgba(255, 170, 90, 0); --levant: rgba(255, 170, 90, 0); --soleil: #F2C14E;

  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
  --hand: "Kalam", cursive;

  /* Espacements : une seule échelle */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: 96px;
}

/* Thème « Soir », comme dans l'appli */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1714;
    --paper-raised: #25211C;
    --paper-sunk: #12100E;
    --ink: #F3ECE0;
    --ink-muted: #B3A898;
    --line: #3A342C;
    --line-strong: #7D7262;
    --brand: #FF6A4A;
    --brand-hover: #FF8366;
    --brand-ink: #FF8A70;
    --on-brand: #1A1714;
    --tape: #E0AC34;
    --success-ink: #6FD093;
    --passport: #7A2632;
    --c-marche: #E09A2A;
    --c-fete: #EC6294;
    --c-concert: #9B78E6;
    --c-brocante: #B9835A;
    --c-sport: #5F93F0;
    --c-nature: #5CB35F;
    --on-cat: #1A1714;
    --poster-shadow: 0 1px 1px rgba(0, 0, 0, .4), 0 10px 20px -8px rgba(0, 0, 0, .8);
    --v1: #201C18; --v2: #26211C; --v3: #2E2822; --v4: #383128; --v5: #4E4438;
    --vf: #1A1714; --vo: #1A1714; --vc: #1A1714; --ciel: rgba(20, 18, 26, 0); --soleil-o: .55; --soleil: #E0AC34;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--tape); color: #221C15; }
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: var(--s2); top: -60px; background: var(--ink); color: var(--paper); padding: var(--s1) var(--s2); z-index: 20; }
.skip:focus { top: var(--s1); }

/* ---------- Logo : deux traits de feutre sous le « là » ---------- */
.logo { font: 800 26px/1 var(--display); letter-spacing: -0.035em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.logo .la { position: relative; display: inline-block; }
.logo .la svg { position: absolute; left: -12%; top: 92%; width: 124%; height: .42em; overflow: visible; }
.logo .la path { fill: none; stroke: var(--brand); stroke-linecap: round; }
.logo .bang { color: var(--brand-ink); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 0;
  background: var(--brand); color: var(--on-brand);
  font: 700 17px/1.1 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color .15s;
}
.btn:hover { background: var(--brand-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn small { font: 400 14px/1 var(--mono); opacity: .9; }

/* Selon que l'APK est en ligne ou pas (voir le script en bas de index.html) */
.sans-apk .si-apk, html:not(.sans-apk) .si-pas-apk { display: none !important; }

/* ---------- En-tête ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); height: 64px; }
.top nav { display: flex; align-items: center; gap: var(--s3); }
.top nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 16px; }
.top nav a:not(.btn):hover { color: var(--brand-ink); text-decoration: underline; }

/* ---------- Accroche ---------- */
.hero { padding: var(--s5) 0 0; }

/* ---------- Le village au fond ----------
   Un horizon en ombres chinoises, de la largeur du contenu, aux bords fondus.
   Cycle jour/nuit de 120 s : le soleil passe, la nuit tombe (couleurs --v*, fenêtres --vf allumées, étoiles),
   la lune passe, le jour revient. Les couleurs sont des propriétés déclarées (@property) pour glisser en douceur. */
.village {
  width: min(1120px, 100% - 32px); margin: var(--s4) auto 0;
  aspect-ratio: 16 / 3; min-height: 150px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.village { --cycle: 120s; --avance: -20s; }
.village svg { display: block; width: 100%; height: 100%; }
.village .v1 { fill: var(--v1); }
.village .v2 { fill: var(--v2); }
.village .v3 { fill: var(--v3); }
.village .v4 { fill: var(--v4); }
.village .vf { fill: var(--vf); }
.village .vo { fill: var(--vo); }
.village .vc { fill: var(--vc); }
.village .etoile { fill: #F6ECD9; opacity: var(--etoiles); }
.village [class^="va-"] { opacity: .85; }
.village .va-marche { fill: var(--c-marche); }
.village .va-fete { fill: var(--c-fete); }
.village .va-concert { fill: var(--c-concert); }
.village .va-brocante { fill: var(--c-brocante); }
.village .va-nature { fill: var(--c-nature); }
.village .va-ruban { fill: var(--tape); opacity: 1; }
.hero + section { border-top: 0; }

/* Le soleil et la lune tournent autour d'un point sous l'horizon : lever à gauche, coucher à droite */
.village .astre-soleil { fill: var(--soleil); opacity: var(--soleil-o); }
.village .astre-lune { fill: #F6ECD9; }
.village .halo { fill: #F6ECD9; opacity: .07; }
.village .soleil, .village .lune { transform-box: view-box; transform-origin: 800px 460px; }
.village .soleil { transform: rotate(-22deg); }
.village .lune { transform: rotate(60deg); }

/* Les passants : --x leur place au repos, --d la durée de la traversée, --t leur avance */
.village .passant { fill: var(--v5); transform: translateX(var(--x)); }
.village .anse { stroke: var(--v5); stroke-width: 1.5; stroke-linecap: round; }
.village .jambe { transform-box: fill-box; transform-origin: 50% 0; transform: rotate(10deg); }
.village .jambe.b { transform: rotate(-10deg); }
/* Les voitures de nuit : hors du dessin le jour (--x), phares allumés */
.village .voiture { transform: translateX(var(--x)); }
.village .faisceau { fill: url(#phare-degrade); }
.village .carrosserie { fill: var(--v5); }
.village .vitre { fill: rgba(255, 231, 166, .14); }
.village .roue { fill: #0C0A08; }
.village .phare { fill: #FFE9A8; }
.village .feu { fill: #E0452A; }

@media (prefers-reduced-motion: no-preference) {
  /* Toutes les horloges du village partent ensemble (--cycle, --avance) : on arrive en milieu de matinée */
  .village { animation: journee-clair var(--cycle) linear var(--avance) infinite; }
  .village .soleil { animation: course-soleil var(--cycle) linear var(--avance) infinite; }
  .village .lune { animation: course-lune var(--cycle) linear var(--avance) infinite; }
  /* Les passants (sortir, traverser, rentrer) et les voitures ont leurs keyframes dans le <style> du dessin */
  .village .jambe.a { animation: pas .55s ease-in-out infinite alternate; }
  .village .jambe.b { animation: pas .55s ease-in-out infinite alternate-reverse; }
}
@media (prefers-reduced-motion: no-preference) and (prefers-color-scheme: dark) {
  .village { animation-name: journee-sombre; }
}
@keyframes course-soleil { 0% { transform: rotate(-55deg); } 46%, 100% { transform: rotate(55deg); } }
@keyframes course-lune { 0%, 44% { transform: rotate(-47deg); } 93%, 100% { transform: rotate(55deg); } }
/* Le cycle (120 s), calé sur le soleil : il sort des collines vers 5 % (levé vers 8 %),
   commence à disparaître vers 38 % et a disparu vers 41 %. Les habitants sortent vers 3-7 % et rentrent vers 37-41 %.
   Nuit de 45 % à 94 % : la lune sort des collines dès 45 %, trois voitures passent entre 50 et 90 %. */
@keyframes journee-clair {
  45%, 94% {
    --v1: #2C2826; --v2: #211E1B; --v3: #34302A; --v4: #1E1B18; --v5: #141210;
    --vf: #F2C14E; --vo: #1E1B18; --vc: #2E2A33; --ciel: #2E2A33; --etoiles: 1;
    --couchant: rgba(255, 170, 90, 0); --levant: rgba(255, 170, 90, 0); --soleil: #E8672F;
  }
  0%, 98%, 100% {
    --v1: #6E5A5E; --v2: #5A4A4C; --v3: #6A5652; --v4: #4A3B38; --v5: #2E2523;
    --vf: #F2C14E; --vo: #3A2F2D; --vc: #8C6E7A; --ciel: #7E6478; --etoiles: 0.3;
    --couchant: rgba(255, 170, 90, 0); --levant: rgba(255, 176, 120, .6); --soleil: #F08A3C;
  }
  4% {
    --v1: #E3CDBB; --v2: #D8BFA8; --v3: #CDB49A; --v4: #B79D82; --v5: #8F7760;
    --vf: #F5EFE3; --vo: #F5EFE3; --vc: #F2D6BE; --ciel: rgba(235, 170, 140, .5); --etoiles: 0;
    --couchant: rgba(255, 170, 90, 0); --levant: rgba(255, 186, 120, .85); --soleil: #F08A3C;
  }
  9%, 34% {
    --v1: #EAE1CF; --v2: #DFD4BE; --v3: #D2C5AC; --v4: #C2B293; --v5: #A3926F;
    --vf: #F5EFE3; --vo: #F5EFE3; --vc: #F5EFE3; --ciel: rgba(46, 42, 51, 0); --etoiles: 0;
    --couchant: rgba(255, 170, 90, 0); --levant: rgba(255, 170, 90, 0); --soleil: #F2C14E;
  }
  37% {
    --v1: #E6CDB0; --v2: #DBBE9F; --v3: #D0B295; --v4: #BB9C7E; --v5: #94775A;
    --vf: #F5EFE3; --vo: #F5EFE3; --vc: #F3D9B8; --ciel: rgba(235, 170, 120, .35); --etoiles: 0;
    --couchant: rgba(255, 175, 90, .6); --levant: rgba(255, 170, 90, 0); --soleil: #F0A040;
  }
  40% {
    --v1: #D7A58C; --v2: #C79178; --v3: #BC8A70; --v4: #A2745C; --v5: #6E4D3E;
    --vf: #F2C14E; --vo: #5A4034; --vc: #E8A27A; --ciel: rgba(201, 120, 106, .9); --etoiles: 0.15;
    --couchant: rgba(255, 160, 80, .95); --levant: rgba(255, 170, 90, 0); --soleil: #E8672F;
  }
  43% {
    --v1: #6A4A4C; --v2: #563C3C; --v3: #64463F; --v4: #47302C; --v5: #2A1C19;
    --vf: #F2C14E; --vo: #3A2A27; --vc: #6E4A5A; --ciel: #5E3E50; --etoiles: 0.4;
    --couchant: rgba(230, 110, 70, .45); --levant: rgba(255, 170, 90, 0); --soleil: #E8672F;
  }
}
@keyframes journee-sombre {
  45%, 94% {
    --v1: #17151A; --v2: #121013; --v3: #1E1B18; --v4: #100E0C; --v5: #0A0908;
    --vf: #E0AC34; --vo: #100E0C; --vc: #14121A; --ciel: #14121A; --etoiles: 1;
    --couchant: rgba(255, 170, 90, 0); --levant: rgba(255, 170, 90, 0); --soleil: #D9602C;
  }
  0%, 98%, 100% {
    --v1: #241C22; --v2: #1C161A; --v3: #2A2024; --v4: #161115; --v5: #0D0A0C;
    --vf: #E0AC34; --vo: #161115; --vc: #33242E; --ciel: #2E2030; --etoiles: 0.3;
    --couchant: rgba(255, 170, 90, 0); --levant: rgba(224, 140, 90, .4); --soleil: #E07A3C;
  }
  4% {
    --v1: #2E2420; --v2: #2A211C; --v3: #352A22; --v4: #3A2F26; --v5: #4E4036;
    --vf: #1A1714; --vo: #1A1714; --vc: #3A2A24; --ciel: rgba(90, 50, 40, .5); --etoiles: 0;
    --couchant: rgba(255, 170, 90, 0); --levant: rgba(224, 140, 80, .5); --soleil: #E07A3C;
  }
  9%, 34% {
    --v1: #201C18; --v2: #26211C; --v3: #2E2822; --v4: #383128; --v5: #4E4438;
    --vf: #1A1714; --vo: #1A1714; --vc: #1A1714; --ciel: rgba(20, 18, 26, 0); --etoiles: 0;
    --couchant: rgba(255, 170, 90, 0); --levant: rgba(255, 170, 90, 0); --soleil: #E0AC34;
  }
  37% {
    --v1: #2E241C; --v2: #2E241D; --v3: #382B22; --v4: #3A2D22; --v5: #4A3A2C;
    --vf: #1A1714; --vo: #1A1714; --vc: #3A2A20; --ciel: rgba(90, 55, 35, .35); --etoiles: 0;
    --couchant: rgba(224, 130, 60, .35); --levant: rgba(255, 170, 90, 0); --soleil: #E09A3C;
  }
  40% {
    --v1: #3A2722; --v2: #301F1B; --v3: #3D2A23; --v4: #2A1C17; --v5: #1A110E;
    --vf: #E0AC34; --vo: #1A110E; --vc: #5A2E2A; --ciel: #4A2A2C; --etoiles: 0.15;
    --couchant: rgba(224, 120, 60, .6); --levant: rgba(255, 170, 90, 0); --soleil: #D9602C;
  }
  43% {
    --v1: #241A20; --v2: #1E1519; --v3: #281D1E; --v4: #170F11; --v5: #0C0809;
    --vf: #E0AC34; --vo: #170F11; --vc: #2E1E28; --ciel: #2A1A26; --etoiles: 0.4;
    --couchant: rgba(200, 90, 50, .3); --levant: rgba(255, 170, 90, 0); --soleil: #D9602C;
  }
}
@keyframes pas { from { transform: rotate(24deg); } to { transform: rotate(-24deg); } }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: center; }
h1 { font-size: clamp(46px, 6.4vw, 78px); line-height: .95; }
h1 em { font-style: normal; color: var(--brand-ink); }
.hero .lead { font-size: 21px; max-width: 30ch; margin: var(--s3) 0 var(--s4); }
.hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.hero .actions > a:not(.btn) { font-weight: 700; }
.meta { font: 16px/1.5 var(--body); color: var(--ink-muted); margin-top: var(--s2); }

/* ---------- Le mur : le seul endroit en couleurs ---------- */
.wall { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3) 20px; padding: var(--s2) 0 0; margin: 0; }
.poster {
  --c: var(--brand);
  position: relative; aspect-ratio: 3 / 4;
  background: var(--c); color: var(--on-cat);
  box-shadow: var(--poster-shadow);
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--tilt, 0deg));
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s;
  padding: 11% 10% 10%;
  display: flex; flex-direction: column;
  container-type: inline-size;
}
.poster::before { content: ""; position: absolute; inset: 5%; border: 1.5px solid color-mix(in srgb, var(--on-cat) 50%, transparent); border-radius: 2px; }
.poster .shape { position: absolute; inset: 0; overflow: hidden; }
.poster .shape i { position: absolute; background: var(--on-cat); opacity: .14; }
.poster > span { position: relative; }
.poster .k { font: 700 7cqi/1.1 var(--body); text-transform: uppercase; }
.poster .t { font: 800 13.5cqi/.95 var(--display); text-transform: uppercase; margin-top: auto; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.poster .d { font: 800 8.5cqi/1.05 var(--display); margin-top: 4cqi; }
.poster .p { font: 700 6.5cqi/1.2 var(--body); text-transform: uppercase; margin-top: 2cqi; }
.marche { --c: var(--c-marche); }
.fete { --c: var(--c-fete); }
.concert { --c: var(--c-concert); }
.brocante { --c: var(--c-brocante); }
.sport { --c: var(--c-sport); }
.nature { --c: var(--c-nature); }

/* Le ruban adhésif (signature) */
.tape { position: relative; }
.tape::after {
  content: ""; position: absolute; top: -9px; left: 30%; width: 40%; height: 20px;
  background: color-mix(in srgb, var(--tape) 88%, transparent);
  transform: rotate(-3deg); pointer-events: none;
}
.poster.tape::after { height: 9%; top: -6px; }

.hand { font: 700 26px/1.2 var(--hand); color: var(--brand-ink); transform: rotate(-4deg); display: inline-block; }
.wall-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); margin-top: var(--s1); }
.wall-tip { font-size: 15px; color: var(--ink-muted); max-width: 32ch; }

/* Le mur qu'on touche (vivant.js) */
.wall.vivant .poster { cursor: pointer; user-select: none; -webkit-user-select: none; }
@media (pointer: fine) { .wall.vivant .poster { cursor: grab; touch-action: none; } }
.wall .poster.decollee {
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(0deg) scale(1.05);
  transition: box-shadow .2s; z-index: 99 !important; cursor: grabbing;
  box-shadow: 0 2px 2px rgba(34, 28, 21, .15), 0 26px 30px -12px rgba(34, 28, 21, .5);
}
.poster.decollee::after { opacity: 0; }
.poster.recollee::after { animation: ruban .35s ease-out; }
@keyframes ruban { from { transform: rotate(-3deg) scaleX(0); } to { transform: rotate(-3deg) scaleX(1); } }
.poster.nouvelle { animation: colle .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes colle { from { opacity: 0; transform: translateY(-30px) rotate(-12deg) scale(1.15); } }
.poster > .jyvais {
  position: absolute; right: 4%; top: 30%; z-index: 2; max-width: 92%; white-space: nowrap;
  background: var(--tape); color: #221C15; padding: 2px 10px 4px;
  font: 700 clamp(14px, 11cqi, 22px)/1.2 var(--hand); transform: rotate(8deg);
  box-shadow: 0 2px 4px rgba(34, 28, 21, .3);
  animation: pop .3s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes pop { from { transform: rotate(8deg) scale(.3); opacity: 0; } }

/* ---------- Sections ---------- */
section { padding: var(--s6) 0; border-top: 1px solid var(--line); }
h2 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1; max-width: 18ch; }
.intro { font-size: 20px; color: var(--ink-muted); max-width: 46ch; margin-top: var(--s2); }

/* Comment ça marche : quatre étapes, numérotées comme sur une affiche */
.steps { list-style: none; margin: var(--s5) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4) var(--s3); counter-reset: step; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: block; font: 800 64px/.9 var(--display); color: var(--brand-ink); margin-bottom: var(--s2); }
.steps h3 { font-size: 24px; line-height: 1.1; margin-bottom: var(--s1); }
.steps p { font-size: 18px; }
.aside { margin-top: var(--s4); font-size: 17px; color: var(--ink-muted); max-width: 60ch; }

/* La démo : la porte de la boulangerie à gauche, la fiche à droite */
.demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--s4); margin-top: var(--s5); background: var(--paper-sunk); padding: var(--s4); }
.demo[hidden] { display: none; }
.demo-board { position: relative; display: grid; place-items: center; min-height: 420px; overflow: hidden; }
.demo-board::before { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 4; }
.demo-board.flash::before { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }
.demo-cible { position: relative; width: min(250px, 72%); }
.demo-cible .poster { transition: transform .6s cubic-bezier(.3, 1.2, .5, 1), filter .6s; filter: brightness(.82) saturate(.85); }
.demo-cible.cadree .poster { transform: rotate(0deg); filter: none; }
.coin { position: absolute; width: 26px; height: 26px; border: 4px solid var(--brand); opacity: 0; transition: opacity .3s .3s, inset .5s; z-index: 2; }
.c1 { left: -14px; top: -14px; border-right: 0; border-bottom: 0; }
.c2 { right: -14px; top: -14px; border-left: 0; border-bottom: 0; }
.c3 { left: -14px; bottom: -14px; border-right: 0; border-top: 0; }
.c4 { right: -14px; bottom: -14px; border-left: 0; border-top: 0; }
.demo-cible.cadree .coin { opacity: 1; }
.demo-cible.collee .coin { opacity: 0; transition-delay: 0s; }
.demo-cible::after {
  content: ""; position: absolute; left: -6%; right: -6%; top: 0; height: 4px; z-index: 3;
  background: var(--brand); box-shadow: 0 0 18px 4px color-mix(in srgb, var(--brand) 60%, transparent); opacity: 0;
}
.demo-cible.lecture::after { animation: balaye 1.4s ease-in-out; }
@keyframes balaye { 0% { top: 0; opacity: 1; } 100% { top: 100%; opacity: 1; } }

.demo-fiche { display: flex; flex-direction: column; }
.demo-titre { font: 800 22px/1.2 var(--display); }
.demo-titre small { display: block; font: 400 15px/1.4 var(--body); color: var(--ink-muted); margin-top: 4px; }
.fiche { margin: var(--s2) 0 0; background: var(--paper-raised); padding: var(--s1) var(--s3); box-shadow: var(--poster-shadow); }
.fiche > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s2); padding: 9px 0; border-bottom: 1px solid var(--line); transition: background-color .4s; }
.fiche > div:last-child { border-bottom: 0; }
.fiche dt { color: var(--ink-muted); font-size: 15px; padding-top: 2px; }
.fiche dd { margin: 0; font-weight: 700; min-height: 1.5em; }
.fiche > div.rempli dd { animation: encre .5s ease-out; }
@keyframes encre { from { background: color-mix(in srgb, var(--tape) 45%, transparent); } }
.fiche > div.manque dd { font-weight: 400; color: var(--brand-ink); }
.chip { display: inline-block; font: 700 14px/1 var(--body); padding: 6px 12px; border-radius: 999px; background: var(--c); color: var(--on-cat); }
.lien { background: none; border: 0; padding: 0; font: 700 16px/1.4 var(--body); color: var(--brand-ink); text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.demo-statut { min-height: 3em; margin: var(--s2) 0; font-size: 17px; }
.demo-action { align-self: flex-start; min-width: 240px; }
/* Tant qu'on ne l'a pas touché, le bouton de la démo s'agite toutes les 3 secondes pour inviter à essayer */
@media (prefers-reduced-motion: no-preference) {
  .demo-action.secoue { animation: secoue 3s ease-in-out 1s infinite; }
}
@keyframes secoue {
  0%, 76%, 100% { transform: none; }
  79% { transform: translateX(-5px) rotate(-3deg); }
  82% { transform: translateX(5px) rotate(3deg); }
  85% { transform: translateX(-4px) rotate(-2deg); }
  88% { transform: translateX(4px) rotate(2deg); }
  91% { transform: translateX(-2px) rotate(-1deg); }
  94% { transform: translateX(1px); }
}
.btn:disabled { opacity: .6; cursor: progress; }

/* Ce qu'il y a dans l'appli : trois moments, en listes */
.moments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4) var(--s5); margin-top: var(--s5); }
.moments h3 { font-size: 26px; line-height: 1.1; padding-bottom: var(--s2); border-bottom: 3px solid var(--ink); }
.moments ul { list-style: none; margin: 0; padding: 0; }
.moments li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 17px; }

/* Vie privée */
.privacy .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--s5); align-items: center; }
.checks { list-style: none; margin: var(--s4) 0 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.checks li > span:first-child { font: 700 22px/1.1 var(--body); color: var(--success-ink); }
.checks li.non > span:first-child { color: var(--brand-ink); }
.checks b { display: block; }
.checks small { display: block; color: var(--ink-muted); font-size: 16px; }
.privacy .small { margin-top: var(--s3); font-size: 16px; color: var(--ink-muted); max-width: 52ch; }

.passport {
  background: var(--passport); color: var(--on-passport);
  border-radius: 8px 16px 16px 8px; padding: 32px 28px 28px;
  box-shadow: var(--poster-shadow); width: min(360px, 100%); margin-inline: auto;
  transform: rotate(-2deg); position: relative;
  border-left: 10px solid color-mix(in srgb, #000 25%, var(--passport));
}
.passport .label { font: 400 14px/1.2 var(--mono); opacity: .85; }
.passport .name { font: 700 32px/1 var(--mono); margin: var(--s2) 0 6px; }
.passport .num { font: 14px/1 var(--mono); opacity: .85; }
.passport .qr { margin-top: var(--s3); width: 112px; height: 112px; background: var(--on-passport); padding: 10px; border-radius: 4px; }
.passport .qr svg { width: 100%; height: 100%; }
.passport .stamp {
  position: absolute; right: 22px; bottom: 26px; width: 104px; height: 104px;
  border: 3px solid var(--tape); color: var(--tape); border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  font: 700 12px/1.25 var(--mono); transform: rotate(var(--r, 14deg));
}
.passport .stamp.frappe { animation: tampon .35s cubic-bezier(.2, 1.5, .5, 1); }
@keyframes tampon { from { transform: rotate(var(--r, 14deg)) scale(1.8); opacity: 0; } 60% { opacity: 1; } }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line-strong); }
.btn.ghost:hover { background: transparent; border-color: var(--ink); }
.passport-outils { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: var(--s4); }
.passport-outils[hidden] { display: none; }
.passport-compte { flex-basis: 100%; text-align: center; color: var(--ink-muted); font-size: 16px; min-height: 1.5em; }

/* Organisateurs : une note scotchée */
.orga { background: var(--paper-sunk); }
.note {
  background: var(--paper-raised); max-width: 760px; margin-inline: auto;
  padding: var(--s5) var(--s5) var(--s4); box-shadow: var(--poster-shadow); transform: rotate(-.6deg);
}
.note p { font-size: 19px; margin-top: var(--s2); max-width: 54ch; }
.note .hand { margin-top: var(--s3); font-size: 24px; }

/* Questions */
.faq { max-width: 780px; margin-top: var(--s4); }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 0; display: flex; justify-content: space-between; gap: var(--s2);
  font: 800 22px/1.25 var(--display); letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-ink); font-size: 30px; line-height: .8; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--brand-ink); }
.faq details p { color: var(--ink-muted); padding-bottom: 20px; max-width: 62ch; }

/* Télécharger */
.download .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.download .icon { width: 88px; height: 88px; border-radius: 20px; box-shadow: var(--poster-shadow); margin-bottom: var(--s3); }
.download .intro { color: var(--ink); }
.download .btn { margin-top: var(--s4); }
.install { background: var(--paper-raised); padding: var(--s4) var(--s4) var(--s3); box-shadow: var(--poster-shadow); transform: rotate(.6deg); }
.install h3 { font-size: 24px; line-height: 1.15; }
.install ol { margin: var(--s2) 0 0; padding-left: 1.3em; }
.install li { padding: 6px 0; }
.install p { margin-top: var(--s2); font-size: 16px; color: var(--ink-muted); }

/* Pied de page */
footer { border-top: 1px solid var(--line); padding: var(--s4) 0 var(--s5); font-size: 16px; color: var(--ink-muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); justify-content: space-between; align-items: center; }
footer .logo { font-size: 22px; }
footer nav { display: flex; flex-wrap: wrap; gap: var(--s3); }
footer a { color: var(--ink-muted); }

/* ---------- Page « Mentions légales » ---------- */
.legal { padding: var(--s5) 0 var(--s6); }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(40px, 6vw, 60px); }
.legal h2 { font-size: 28px; margin-top: var(--s5); max-width: none; }
.legal p, .legal li { margin-top: 12px; max-width: 66ch; }
.legal ul { padding-left: 1.2em; margin: 0; }
.legal .updated { font: 14px/1.5 var(--mono); color: var(--ink-muted); margin-top: var(--s2); }

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

/* ---------- Tablette ---------- */
@media (max-width: 960px) {
  .hero .wrap, .privacy .wrap, .download .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: var(--s4); }
  .wall { max-width: 560px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moments { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .demo { grid-template-columns: minmax(0, 1fr); }
  section { padding: var(--s5) 0; }
}

/* ---------- Téléphone ---------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .top nav a:not(.btn) { display: none; }
  .hero .lead { font-size: 19px; }
  .hero .actions .btn, .download .btn { width: 100%; }
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s2); }
  .wall .poster:nth-child(n+5) { display: none; }
  .wall-foot { flex-direction: column; }
  .wall-foot .hand { align-self: flex-end; }
  .demo { padding: var(--s2); }
  .demo-board { min-height: 250px; }
  .demo-cible { width: 160px; }
  .fiche { padding: 4px var(--s2); }
  .fiche > div { grid-template-columns: 96px minmax(0, 1fr); padding: 7px 0; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .steps li { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: var(--s2); }
  .steps li::before { grid-row: span 2; font-size: 48px; margin: 0; }
  .note { padding: var(--s4) var(--s3) var(--s3); }
  .install { padding: var(--s3); }
  .passport .name { font-size: 26px; }
}
