/* ═══════════════════════════════════════════════════════════════════════════
   Quotum — accueil : ouverture, situation, récit au défilement, chapitre de nuit,
   éventail, registre des outils, bordereau, prix et questions.
   Jetons de quotum.css seulement (DESIGN.md, mouvement.defilement).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── La platine : le fond du bureau en CSS, le panneau détouré par-dessus ── */

.bureau {
  background-color:var(--fond-surface);
  background-image:image-set(url("images/scenes/fond-bureau-clair@1x.webp") 1x, url("images/scenes/fond-bureau-clair@2x.webp") 2x);
  background-size:cover;
  background-position:0 0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) .bureau {
    background-image:image-set(url("images/scenes/fond-bureau-sombre@1x.webp") 1x, url("images/scenes/fond-bureau-sombre@2x.webp") 2x);
  }
}
:root[data-theme="sombre"] .bureau {
  background-image:image-set(url("images/scenes/fond-bureau-sombre@1x.webp") 1x, url("images/scenes/fond-bureau-sombre@2x.webp") 2x);
}

/* 440 pt de large, le panneau à 44 pt du haut et centré : la pose du banc de capture. */
.platine {
  position:relative;
  width:440px;
  max-width:100%;
  margin:0 auto;
  padding:44px 0;
  border:1px solid var(--filet-discret);
  border-radius:12px;
  overflow:clip;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.platine picture { display:block; }
.platine img { width:320px; max-width:100%; height:auto; border:0; }

/* ── Ouverture ───────────────────────────────────────────────────────────── */

/* Sous 960 px, la scène passe entre le titre et la phrase : elle tient dans le premier écran
   d'un mobile, sous le titre, au lieu d'attendre sous les boutons. */
.ouverture {
  max-width:1120px;
  margin:0 auto;
  padding:32px var(--gouttiere) 0;
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:20px;
}
.ouverture-texte { display:contents; }
.ouverture-texte h1 { order:1; }
.ouverture-plan { order:2; margin:0; }
.ouverture-texte .phrase { order:3; }
.ouverture-texte .boutons { order:4; }
.ouverture-texte .garanties { order:5; margin:0; max-width:520px; }
.ouverture-texte h1 {
  font-size:clamp(30px, 4.4vw, 50px);
  line-height:1.08;
  letter-spacing:-0.025em;
  margin:0;
  text-wrap:balance;
}
/* Un seul titre : la marque et les mots cherchés en petit corps, l'accroche en grand. */
.h1-marque {
  display:block;
  margin:0 0 12px;
  font-size:15px;
  font-weight:500;
  line-height:1.4;
  letter-spacing:0;
  color:var(--encre-moyenne);
  text-wrap:pretty;
}
.h1-accroche { display:block; font-size:clamp(34px, 6vw, 64px); line-height:1.04; }
.ouverture-texte .phrase {
  font-size:18px;
  color:var(--encre-moyenne);
  max-width:520px;
  margin:0;
  text-wrap:pretty;
}
.ouverture-texte .boutons { margin:0; }
.ouverture-plan .echelle {
  margin:8px 0 0;
  text-align:center;
}
@media (min-width: 960px) {
  .ouverture {
    grid-template-columns:minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows:auto auto auto 1fr;
    column-gap:56px;
    row-gap:24px;
    align-items:start;
    padding-top:48px;
  }
  .ouverture-texte h1 { grid-column:1; grid-row:1; }
  .ouverture-texte .phrase { grid-column:1; grid-row:2; }
  .ouverture-texte .boutons { grid-column:1; grid-row:3; }
  .ouverture-texte .garanties { grid-column:1; grid-row:4; }
  .ouverture-plan { grid-column:2; grid-row:1 / -1; }
}

/* ── La situation : le montage du bureau (scenes.css) ─────────────────────── */

.situation {
  max-width:1040px;
  margin:96px auto 0;
  padding:0 var(--gouttiere);
}
.situation > h2 { margin-top:0; }
.situation > p { max-width:var(--lecture); color:var(--encre-moyenne); }
/* L'écart avant la scène se pose sur le paragraphe : scenes.css ne remet pas margin à zéro sur .scene. */
.situation > h2 + p { margin-bottom:24px; }

/* ── Récit ───────────────────────────────────────────────────────────────── */

.recit {
  max-width:1040px;
  margin:96px auto 0;
  padding:0 var(--gouttiere);
}
.recit-plan { margin:0 0 24px; }
.recit-texte { max-width:480px; margin:0 auto 72px; }
.recit-texte .num {
  display:block;
  margin:0 0 12px;
  padding-left:10px;
  border-left:2px solid var(--identite);
}
.recit-texte h2 {
  font-size:28px;
  line-height:1.15;
  margin:0 0 16px;
  text-wrap:balance;
}
.recit-texte p { font-size:17px; color:var(--encre-moyenne); margin:0 0 16px; }
.recit-texte p:last-child { margin-bottom:0; }
.recit-texte .boutons { margin:24px 0 0; }

/* Bureau, sans mouvement : une rangée par étape, la capture à côté de son texte. C'est ce que
   voient un navigateur sans défilement piloté, quiconque réduit les animations, et une fenêtre
   trop basse. */
@media (min-width: 880px) {
  .recit-grille {
    display:grid;
    grid-template-columns:440px minmax(0, 1fr);
    column-gap:72px;
    row-gap:64px;
    align-items:center;
  }
  .recit-plan, .recit-texte { margin:0; }
  .recit-plan { grid-column:1; }
  .recit-texte { grid-column:2; }
  .etape-1 { grid-row:1; }
  .etape-2 { grid-row:2; }
  .etape-3 { grid-row:3; }
  .etape-4 { grid-row:4; }
}

/* ── Le chapitre de nuit : l'étape 02 reprend le jeu sombre mesuré ────────────
   Les copies --nuit-* de quotum.css, posées propriété par propriété : redéfinir les jetons
   sémantiques sous .nuit rendrait indécidable l'ombre intérieure du cadre de prix, qui les
   cite. L'état final est le petit jour : la surface sombre, la lune couchée, le soleil levé. */

.nuit {
  background-color:var(--nuit-fond-surface);
  color:var(--nuit-encre-forte);
}
.recit-texte .nuit {
  padding:24px;
  border:1px solid var(--nuit-filet-discret);
  border-radius:12px;
}
.recit-texte .nuit h2 { color:var(--nuit-encre-forte); }
.recit-texte .nuit p { color:var(--nuit-encre-moyenne); }
.recit-texte .nuit .num { color:var(--nuit-encre-faible); border-left-color:var(--nuit-identite); }
.platine.nuit { border-color:var(--nuit-filet-discret); }
.ciel {
  position:relative;
  height:72px;
  margin:0 0 20px;
  border-bottom:1px solid var(--nuit-filet-action);
  overflow:clip;
}
.ciel svg { position:absolute; bottom:0; color:var(--nuit-encre-forte); }
.ciel .lune { left:8%; bottom:20px; opacity:0; translate:0 44px; }
.ciel .soleil { right:12%; }
/* Le voile de nuit, plus sombre que le petit jour, ne paraît que pendant le mouvement. */
.platine.nuit::before {
  content:"";
  position:absolute;
  inset:0;
  background:var(--nuit-fond-socle);
  opacity:0;
}
.platine.nuit picture { position:relative; }

/* ── L'éventail : les plans s'écartent, visuel de l'étape 04 ──────────────────
   Trois captures empilées ; celles des côtés glissent et tournent de 2°. L'écart se calcule sur
   la largeur de l'éventail : la moitié de la place libre, moins ce que la rotation de 2° ajoute
   à l'enveloppe d'un plan (moins de 4 % de sa largeur) et une marge de 12 px, pour qu'aucun plan
   ne touche le bord que la platine découpe. */

.eventail {
  display:grid;
  justify-items:center;
  width:100%;
  padding-bottom:14px;
  container-type:inline-size;
}
.eventail .plan {
  grid-area:1 / 1;
  display:block;
  --largeur:min(200px, 52cqi);
  --ecart:calc((100cqi - var(--largeur)) / 2 - var(--largeur) * 0.04 - 12px);
  width:var(--largeur);
}
.recit-plan .eventail .plan img { width:100%; max-height:none; rotate:none; }
.eventail .plan-c { z-index:1; }
.eventail .plan-g { translate:calc(var(--ecart) * -1) 14px; rotate:-2deg; }
.eventail .plan-d { translate:var(--ecart) 14px; rotate:2deg; }

/* ── Le registre des vingt-cinq outils ───────────────────────────────────── */

.registre {
  margin:0 0 20px;
  padding:12px 0;
  border-top:1px solid var(--encre-forte);
  border-bottom:1px solid var(--filet-discret);
}
.registre .liste {
  display:flex;
  flex-wrap:wrap;
  column-gap:20px;
  margin:0;
  counter-reset:outil;
  font-family:var(--police-donnee);
  font-size:13px;
  line-height:1.4;
  color:var(--encre-forte);
}
.registre .liste a {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:44px;
  color:var(--encre-forte);
  text-decoration:underline;
  text-decoration-color:var(--filet-discret);
  text-underline-offset:3px;
}
.registre .liste a::before {
  counter-increment:outil;
  content:counter(outil, decimal-leading-zero); content:counter(outil, decimal-leading-zero) / "";
  color:var(--encre-faible);
  font-variant-numeric:tabular-nums;
}
.registre .liste a:focus-visible { outline:2px solid var(--identite); outline-offset:2px; }
.registre .liste a:active { color:var(--identite); text-decoration-color:var(--identite); }
@media (hover:hover) and (pointer:fine) {
  .registre .liste a:hover { text-decoration-color:var(--encre-forte); }
}
/* Le « · » reste lu par les lecteurs d'écran, qui annoncent sinon les noms d'un seul tenant. */
.registre .sep {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}

/* Bureau, défilement piloté : les quatre platines s'empilent, collées au centre de la fenêtre.
   Le panneau qui part s'efface en montant, puis celui qui arrive se pose depuis le haut, sans
   que les deux se superposent ; remonter rembobine. --pas : hauteur de défilement d'une étape. Les deux rangées d'amorce
   (50svh − pas/2) mettent le premier texte au centre au début de la plage contain, le dernier
   à la fin : les plages ci-dessous ne dépendent pas de --pas. */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  @media (min-width: 880px) and (min-height: 760px) and (prefers-reduced-motion: no-preference) {
    .recit-grille {
      --platine-h:min(800px, calc(100svh - 48px));
      --pas:80svh;
      view-timeline:--recit block;
      grid-template-rows:calc(50svh - var(--pas) / 2) repeat(4, var(--pas)) calc(50svh - var(--pas) / 2);
      row-gap:0;
      align-items:stretch;
    }
    .recit-grille > .recit-plan {
      grid-row:1 / -1;
      align-self:start;
      position:sticky;
      top:calc((100svh - var(--platine-h)) / 2);
    }
    .recit-grille > .recit-texte.etape-1 { grid-row:2; }
    .recit-grille > .recit-texte.etape-2 { grid-row:3; }
    .recit-grille > .recit-texte.etape-3 { grid-row:4; }
    .recit-grille > .recit-texte.etape-4 { grid-row:5; }
    .recit-texte {
      display:flex;
      flex-direction:column;
      justify-content:center;
    }

    .recit-plan .platine { height:var(--platine-h); }
    /* Un panneau plus haut que la platine se réduit à elle, sans jamais être agrandi. */
    .recit-plan img {
      width:auto;
      max-height:calc(var(--platine-h) - 88px);
      transform-origin:50% 0;
    }

    .recit-plan.etape-1 { z-index:4; }
    .recit-plan.etape-2 { z-index:3; }
    .recit-plan.etape-3 { z-index:2; }
    .recit-plan.etape-4 { z-index:1; }
    /* Seule la platine du dessous garde le bureau : les autres le cacheraient, leur panneau parti.
       La nuit, opaque, n'est là que le temps de son étape. */
    .recit-plan:not(.etape-4) .platine.bureau { background:none; }

    .recit-plan.etape-1 img {
      animation:s-enleve linear both;
      animation-timeline:--recit;
      animation-range:contain 10% contain 20%;
    }
    .recit-plan.etape-2 img {
      animation:se-pose linear both, s-enleve linear both;
      animation-timeline:--recit, --recit;
      animation-range:contain 20% contain 30%, contain 43% contain 53%;
    }
    .recit-plan.etape-3 img {
      animation:se-pose linear both, s-enleve linear both;
      animation-timeline:--recit, --recit;
      animation-range:contain 53% contain 63%, contain 76% contain 86%;
    }
    .recit-plan.etape-4 img {
      animation:se-pose linear both;
      animation-timeline:--recit;
      animation-range:contain 86% contain 96%;
    }

    .recit-plan.etape-2 .platine {
      animation:nuit-entre linear both, nuit-sort linear both;
      animation-timeline:--recit, --recit;
      animation-range:contain 20% contain 30%, contain 43% contain 53%;
    }
    .platine.nuit::before {
      animation:voile-se-leve linear both;
      animation-timeline:--recit;
      animation-range:contain 30% contain 43%;
    }
    .ciel .lune {
      animation:lune-se-couche linear both;
      animation-timeline:--recit;
      animation-range:contain 26% contain 38%;
    }
    .ciel .soleil {
      animation:soleil-se-leve linear both;
      animation-timeline:--recit;
      animation-range:contain 32% contain 44%;
    }
    .eventail .plan-g {
      animation:plan-gauche linear both;
      animation-timeline:--recit;
      animation-range:contain 88% contain 100%;
    }
    .eventail .plan-d {
      animation:plan-droit linear both;
      animation-timeline:--recit;
      animation-range:contain 88% contain 100%;
    }

    /* Le texte de l'étape en cours, seul à pleine encre ; les autres à peine en retrait. */
    .recit-texte > * {
      animation:etape-en-cours linear both;
      animation-timeline:view();
      animation-range:cover 0% cover 100%;
    }
  }
}

@keyframes s-enleve {
  to { opacity:0; translate:0 -24px; }
}
@keyframes se-pose {
  from { opacity:0; scale:0.97; }
}
/* ⛔ Le texte ne s'efface jamais sous 4,5:1 : l'encre faible, la plus pâle, n'y tient qu'à 0,886
   d'opacité sur le fond de page (0,848 en sombre). L'effacement franc reste aux panneaux. */
@keyframes etape-en-cours {
  0%, 100% { opacity:0.9; }
  30%, 70% { opacity:1; }
}
@keyframes nuit-entre {
  from { opacity:0; }
}
@keyframes nuit-sort {
  to { opacity:0; }
}
@keyframes voile-se-leve {
  from { opacity:1; }
  to { opacity:0; }
}
@keyframes lune-se-couche {
  from { opacity:1; translate:0 0; }
  to { opacity:0; translate:0 44px; }
}
@keyframes soleil-se-leve {
  from { opacity:0; translate:0 30px; }
  to { opacity:1; translate:0 0; }
}
/* Sans image d'arrivée : les plans finissent sur leur écart au repos, celui de l'état final. */
@keyframes plan-gauche {
  from { translate:0 14px; rotate:0deg; }
}
@keyframes plan-droit {
  from { translate:0 14px; rotate:0deg; }
}

/* ── Bordereau : quatre chiffres ─────────────────────────────────────────── */

.bordereau {
  max-width:1040px;
  margin:96px auto 0;
  padding:0 var(--gouttiere);
}
.bordereau ul {
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  border-top:1px solid var(--encre-forte);
}
.bordereau li {
  margin:0;
  padding:16px;
  border-bottom:1px solid var(--filet-discret);
  border-right:1px solid var(--filet-discret);
}
.bordereau li:nth-child(2n) { border-right:0; }
.bordereau .valeur {
  display:block;
  font-family:var(--police-donnee);
  font-variant-numeric:tabular-nums;
  font-size:clamp(28px, 4vw, 40px);
  font-weight:600;
  line-height:1;
  letter-spacing:-0.015em;
  color:var(--encre-forte);
}
.bordereau .libelle {
  display:block;
  margin-top:8px;
  font-size:14px;
  color:var(--encre-moyenne);
}
@media (min-width: 720px) {
  .bordereau ul { grid-template-columns:repeat(4, minmax(0, 1fr)); }
  .bordereau li { padding:20px 16px 20px 24px; }
  .bordereau li:nth-child(2n) { border-right:1px solid var(--filet-discret); }
  .bordereau li:last-child { border-right:0; }
}

/* ── Texte courant, alerte, prix, questions ──────────────────────────────── */

.suite {
  max-width:var(--lecture);
  margin:96px auto 0;
  padding:0 var(--gouttiere);
}
.suite > h2:first-child { margin-top:0; }
.suite p, .suite li { color:var(--encre-moyenne); }
.suite strong { color:var(--encre-forte); font-weight:500; }
.suite .flux { margin-top:24px; }
.suite .boutons { margin:24px 0 0; }
.suite.faq { padding-bottom:96px; }
.suite.faq details { margin-top:8px; border-top:1px solid var(--filet-discret); padding-top:4px; }
.suite.faq summary { font-size:17px; }
.suite.faq details > p { margin:4px 0 16px 40px; }

/* Une notification dessinée, dite telle par sa légende : aucune n'est postée pour la photographier. */
.alerte { margin:24px 0 0; }
.alerte-carte {
  display:grid;
  grid-template-columns:32px minmax(0, 1fr);
  column-gap:12px;
  row-gap:2px;
  max-width:380px;
  padding:12px 14px;
  background:var(--fond-surface);
  border:1px solid var(--filet-discret);
  border-radius:16px;
}
.alerte-icone { grid-row:1 / 3; display:block; width:32px; height:32px; }
.suite .alerte-carte p { margin:0; font-size:14px; line-height:1.35; }
.suite .alerte-carte .alerte-titre { font-weight:600; color:var(--encre-forte); }

.bloc-prix {
  max-width:640px;
  margin:96px auto 0;
  padding:0 var(--gouttiere);
}
.bloc-prix > h2, .bloc-central h2 {
  font-size:12px;
  font-weight:500;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:var(--identite);
  margin:0 0 16px;
}
.bloc-prix .garanties { margin:0 0 16px; }
.bloc-prix .meta + .tertiaire { margin:16px 0 0; }
.bloc-central .tertiaire, .bloc-central .meta { text-align:left; }

@media (max-width: 720px) {
  .ouverture { padding-top:40px; gap:32px; }
  .platine { padding:32px 0; }
  .situation, .recit, .bordereau, .suite, .bloc-prix { margin-top:64px; }
  .suite.faq { padding-bottom:64px; }
}

/* ── Les captures du récit, posées de biais sur le bureau ────────────────────
   Une sur deux penche de l'autre côté : les plans se lisent comme posés l'un après l'autre.
   Sur mobile, la platine se borne à la vue ; le bas d'un long panneau est coupé, jamais réduit. */
.recit-plan.etape-1 img, .recit-plan.etape-3 img { rotate:-2deg; }
.recit-plan.etape-2 img, .recit-plan.etape-4 img { rotate:2deg; }
.recit-plan .eventail .plan img { rotate:none; }
/* Sur mobile, la platine laisse à son texte la hauteur qu'il prend à 390 px : capture et texte
   tiennent ensemble dans un écran de 664 px de haut. Le registre des outils allonge l'étape 04. */
@media (max-width: 879px) {
  .recit-plan { --texte-mobile:360px; }
  .recit-plan.etape-2 { --texte-mobile:380px; }
  .recit-plan.etape-4 { --texte-mobile:440px; }
  .recit-plan .platine { max-height:min(520px, calc(100svh - var(--texte-mobile))); justify-content:flex-start; }
  .recit-plan { margin-bottom:16px; }
  .platine.nuit { padding-top:16px; }
  .recit-texte .nuit { padding:16px; }
  .ciel { height:48px; margin-bottom:12px; }
  .ciel .lune { bottom:12px; }
  .recit-texte h2 { font-size:22px; margin-bottom:12px; }
  .recit-texte p { font-size:16px; margin-bottom:12px; }
  .recit-texte .boutons { margin-top:16px; }
}
