/* Page de vente : un grand titre, le livre, un bouton. */
:root {
  --mur: #4f1621;
  --bordeaux: #5a1621;
  --bordeaux-vif: #6e1c29;
  --ocre: #c08a2e;
  --ocre-vif: #d49c3a;
  --papier: #f4ede1;
  --papier-fonce: #e6dbc6;
  --page: #fbf7ef;
  --encre: #26221e;
  --encre-douce: #5b5247;
  --sauge: #4a6345;

  --serif: 'Fraunces', Georgia, serif;
  --texte: 'Atkinson Hyperlegible', system-ui, sans-serif;

  --marge: clamp(16px, 2.5vw, 32px);
  --espace: clamp(64px, 8vw, 120px);
  --debord: clamp(48px, 6vw, 96px);
  --rayon: clamp(20px, 2.2vw, 30px);
  --ratio: 1.339; /* hauteur des couvertures divisée par leur largeur */

  --t-titre: clamp(38px, 5vw, 76px);
  --t-moyen: clamp(32px, 3.2vw, 46px);
  --t-sous: clamp(21px, 1.8vw, 26px);
  --t-chapo: clamp(19px, 1.5vw, 22px);
  --t-texte: 18px;
  --t-petit: 15px;

  --fin: cubic-bezier(0.22, 1, 0.36, 1);
  --ressort: var(--fin);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root { --ressort: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.9%, 1); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 var(--t-texte) / 1.5 var(--texte);
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-underline-offset: 0.18em; }
h1, h2, h3, summary, .marque, .pied__marque, .chiffre, .scene__nombre, .scene__detail, .offre__nom, .offre__detail, .offre__prix {
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 50, 'WONK' 0;
  letter-spacing: -0.02em;
}
h1, h2 { font-weight: 800; line-height: 1; text-wrap: balance; }
h2 { font-size: var(--t-titre); text-align: center; }
h3 { font-size: var(--t-sous); font-weight: 700; line-height: 1.15; letter-spacing: -0.012em; }
p { text-wrap: pretty; }
main:focus { outline: none; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

.reserve { position: absolute; width: 0; height: 0; overflow: hidden; }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* taste-skill-ignore */
.pot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* taste-skill-ignore */
.insecable { white-space: nowrap; }
.evitement {
  position: fixed; top: -200px; left: var(--marge); z-index: 40;
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 20px;
  background: var(--encre); color: var(--papier); border-radius: 999px;
}
.evitement:focus { top: 12px; }

.main { font: 600 var(--t-moyen) / 1 'Caveat', cursive; color: var(--bordeaux); }
.main--clair { color: var(--ocre-vif); }

/* Le bouton */
.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 64px; padding: 14px 40px;
  background: var(--bordeaux); color: var(--papier);
  border: 0; border-radius: 999px;
  font: 700 20px/1.15 var(--texte);
  text-align: center; text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--fin), background-color 180ms ease;
}
.bouton:active { transform: scale(0.97); }
.bouton[aria-busy='true'] { cursor: progress; }
.bouton--ocre { background: var(--ocre); color: var(--encre); }
.bouton--contour { background: transparent; color: var(--papier); border: 2px solid var(--papier); }
@media (hover: hover) and (pointer: fine) {
  .bouton:hover { background: var(--bordeaux-vif); transform: translateY(-2px); }
  .bouton--ocre:hover { background: var(--ocre-vif); }
  .bouton--contour:hover { background: var(--bordeaux-vif); }
}

/* En-tête : le nom, et les offres toujours à portée */
.entete {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 68px; padding: 10px clamp(16px, 3vw, 40px);
  background: var(--mur); color: var(--papier);
}
.marque { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--t-sous); font-weight: 700; text-decoration: none; }
.entete__bouton {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 22px;
  background: var(--papier); color: var(--encre); border-radius: 999px;
  font-weight: 700; text-decoration: none;
  transition: background-color 180ms ease;
}
@media (hover: hover) and (pointer: fine) { .entete__bouton:hover { background: var(--page); } }

/* Premier écran : le titre, la phrase, le bouton, les carnets juste dessous */
.hero {
  position: relative; overflow-x: clip;
  padding: clamp(4px, 1vw, 16px) var(--marge) 0;
  background: var(--mur); color: var(--papier);
  text-align: center;
}
.hero__texte { display: grid; justify-items: center; gap: clamp(10px, 1.3vw, 18px); }
.hero__texte .main { rotate: -2deg; }
h1 { --h1: min(14.2vw, 20svh, 210px); font-weight: 900; }
.ligne { display: block; overflow: clip; padding: 0.05em 0.04em 0.17em; margin: -0.05em 0 -0.17em; }
.ligne > span { display: block; white-space: nowrap; }
.ligne--grand { font-size: var(--h1); line-height: 0.96; }
.ligne--suite { margin-top: -0.02em; font-size: calc(var(--h1) * 0.55); font-weight: 800; line-height: 1.05; }
.hero__phrase { max-width: 34em; font-size: var(--t-chapo); line-height: 1.4; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }
.rassure { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px; font-size: var(--t-petit); }

/* Les carnets : la place de chaque livre tient dans quelques variables */
.feuille {
  --x: 0; --y: 0%; --a: 0deg; --e: 1; --o: 1; --z: 0px;
  position: absolute; left: 50%; bottom: 0; z-index: 1;
  width: var(--l); margin-left: calc(var(--l) / -2);
  transform-origin: 50% 100%;
  transform: translateX(calc(var(--l) * var(--x))) translateY(var(--y)) translateZ(var(--z)) rotate(var(--a)) scale(var(--e));
  opacity: var(--o);
}
.feuille img {
  width: 100%;
  border: solid var(--papier-fonce); border-width: 0 5px 5px 0;
  border-radius: 2px 6px 6px 2px;
  filter: drop-shadow(0 14px 22px rgba(20, 4, 8, 0.45)); /* les livres sont posés les uns sur les autres */ /* taste-skill-ignore */
}

.eventail {
  --l: min(26vw, 44svh, 400px);
  position: relative; z-index: 2;
  height: calc(var(--l) * var(--ratio));
  margin: clamp(30px, 3.6vw, 52px) calc(var(--marge) * -1) calc(var(--debord) * -1);
  transform: perspective(1500px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
}

/* Un remède sur une page */
.exemple { padding: calc(var(--espace) + var(--debord)) var(--marge) var(--espace); background: var(--papier-fonce); }
.exemple__grille {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px) minmax(0, 1fr);
  grid-template-areas: 'gauche fiche droite';
  gap: clamp(16px, 2.6vw, 40px);
  max-width: 1280px; margin: clamp(32px, 4vw, 56px) auto 0;
}
.fiche { grid-area: fiche; display: grid; gap: 4px; padding: clamp(22px, 2.6vw, 38px); background: var(--page); rotate: -1.5deg; }
.fiche h3 { font-size: var(--t-moyen); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.fiche__note { display: flex; align-items: center; gap: 14px; margin: 10px 0 8px; font-size: var(--t-chapo); }
.fiche h4 { margin-top: 12px; font-size: var(--t-petit); font-weight: 700; color: var(--bordeaux); }
.fiche p { line-height: 1.35; }
.fiche__source { margin-top: 14px; font-family: var(--serif); font-size: var(--t-petit); color: var(--encre-douce); }
.cuillerees { display: flex; gap: 3px; fill: var(--sauge); stroke: var(--sauge); stroke-width: 2; }
.cuillerees svg { width: 15px; height: 56px; overflow: visible; }
.cuillerees svg.vide { fill: none; stroke: var(--encre-douce); }

.notes { display: grid; gap: clamp(28px, 4.4vw, 68px); font: 600 clamp(23px, 2vw, 26px) / 1.05 'Caveat', cursive; color: var(--bordeaux); }
.notes--gauche { grid-area: gauche; justify-items: end; text-align: right; }
.notes--droite { grid-area: droite; justify-items: start; }
.note { display: flex; align-items: center; gap: 10px; max-width: 13em; }
.notes--gauche .note:nth-child(odd) { rotate: -2deg; }
.notes--droite .note:nth-child(even) { rotate: 1.5deg; }
.fleche { flex: none; width: 58px; height: 31px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.notes--droite .fleche { scale: -1 1; }
.cassee { flex: none; width: 58px; height: 94px; fill: var(--bordeaux); }

/* Le livre : une scène et une caisse. */
.offres { padding: var(--espace) var(--marge); }
.boutique {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: stretch;
  gap: clamp(16px, 2.4vw, 36px);
  max-width: 1240px; margin: clamp(28px, 3.4vw, 48px) auto 0;
}
.scene {
  container-type: inline-size;
  position: relative; overflow: hidden;
  display: grid; align-content: start; justify-items: center; gap: 4px;
  min-height: clamp(310px, 44vw, 620px);
  padding: clamp(18px, 2.6vw, 38px) 16px 0;
  background: var(--bordeaux); color: var(--papier); border-radius: var(--rayon);
  text-align: center;
}
.scene__nombre { font-size: var(--t-titre); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.scene__detail { font-size: var(--t-chapo); font-weight: 500; letter-spacing: 0; }
.scene__livres {
  --l: min(46cqi, 340px);
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  margin-bottom: calc(var(--l) * -0.14);
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
}
.scene .feuille { --e: 1.1; }

.caisse { display: grid; align-content: start; gap: 12px; }
.offre {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px;
  min-height: 76px; padding: 11px 16px;
  border: 2px solid var(--papier-fonce); border-radius: 18px;
}
.offre__texte { display: grid; }
.offre__nom { font-size: var(--t-sous); font-weight: 700; line-height: 1.15; letter-spacing: -0.012em; }
.offre--meilleure .offre__nom { font-weight: 800; }
.offre__detail { font-size: var(--t-petit); line-height: 1.25; letter-spacing: 0; color: var(--encre-douce); }
.offre__prix { display: grid; justify-items: end; line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; }
.offre__prix strong { font-size: var(--t-sous); font-weight: 800; }
.caisse__bouton { width: 100%; margin-top: 2px; }
.caisse__message { min-height: 1.5em; text-align: center; font-weight: 700; color: var(--sauge); }
.caisse__suite { text-align: center; color: var(--encre-douce); }

/* Tu hésites : le Petit Carnet offert */
.essai { padding: 0 var(--marge) var(--espace); }
.essai__panneau {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); align-items: center;
  gap: clamp(24px, 5vw, 72px);
  max-width: 1240px; margin: 0 auto; padding: clamp(32px, 4.5vw, 64px) clamp(18px, 4.5vw, 64px);
  background: var(--papier-fonce); border-radius: var(--rayon);
}
.essai__livre {
  width: 100%; max-width: 280px; justify-self: center; rotate: 3deg;
  border: solid var(--page); border-width: 0 5px 5px 0; border-radius: 2px 6px 6px 2px;
  filter: drop-shadow(0 14px 22px rgba(38, 34, 30, 0.35)); /* taste-skill-ignore */
}
.essai__texte { display: grid; justify-items: start; gap: 12px; }
.essai h2 { text-align: left; }
.essai .main { rotate: -2deg; transform-origin: left bottom; }
.essai__phrase { font-size: var(--t-chapo); }
.inscription { display: grid; gap: 10px; width: 100%; max-width: 660px; margin-top: 12px; }
.champ__ligne { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.champ__ligne input {
  flex: 1 1 220px; min-width: 0; min-height: 64px; padding: 12px 26px;
  background: var(--page); color: var(--encre);
  border: 2px solid var(--encre-douce); border-radius: 999px;
  font: 400 18px/1.2 var(--texte);
}
.champ__ligne input::placeholder { color: var(--encre-douce); opacity: 1; }
.champ__ligne input[aria-invalid='true'] { border-color: var(--bordeaux); }
.champ__ligne .bouton { flex: 0 1 auto; padding-inline: 30px; }
.inscription__note { font-size: var(--t-petit); }
.erreur, .statut { font-weight: 700; }
.erreur:empty, .statut:empty { display: none; }

/* Questions */
.questions {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start;
  gap: 28px clamp(24px, 4vw, 64px);
  max-width: 1240px; margin: 0 auto; padding: 0 var(--marge) var(--espace);
}
.questions h2 { text-align: left; }
.questions__liste { display: grid; gap: 8px; }
details { padding: 8px 20px; background: var(--page); border-radius: 16px; }
summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 48px; font-size: var(--t-sous); font-weight: 700; line-height: 1.15; letter-spacing: -0.012em;
  cursor: pointer; list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; flex: none; font: 700 26px/1 var(--texte); color: var(--bordeaux); }
details[open] summary::after { content: '–'; }
details p { max-width: 58ch; margin: 6px 0 10px; }
.chiffre { letter-spacing: 0; }

/* Pied */
.pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 40px; padding: 24px var(--marge); background: var(--encre); color: var(--papier); }
.pied__marque { font-size: var(--t-sous); font-weight: 700; }
.pied nav { display: flex; flex-wrap: wrap; gap: 0 24px; font-size: var(--t-petit); }
.pied nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* Pages secondaires */
.barre { padding: 14px var(--marge); }
.fond-mur { background: var(--mur); color: var(--papier); }
.fond-mur .bouton { background: var(--ocre); color: var(--encre); }
.page { display: grid; justify-items: start; align-content: center; gap: 20px; min-height: 80svh; max-width: 760px; padding: 24px var(--marge) 48px; }
.page h1 { font-size: var(--t-titre); }
.page__phrase { font-size: var(--t-chapo); line-height: 1.4; }
.page-entete { background: var(--mur); color: var(--papier); }
.page--texte { display: block; max-width: none; min-height: 0; padding-top: 40px; padding-bottom: var(--espace); }
.page--texte > * { max-width: 62ch; }
.page--texte h1 { font-size: var(--t-titre); }
.page--texte h2 { margin-top: 44px; font-size: var(--t-sous); text-align: left; }
.page--texte h3 { margin-top: 22px; font-size: var(--t-texte); }
.page--texte p { margin-top: 10px; }
.a-completer { background: var(--ocre); color: var(--encre); padding: 0 0.25em; }

/* Bouton collant sur téléphone */
.collant { display: none; }
@media (max-width: 760px) {
  .collant:not([hidden]) {
    position: fixed; inset: auto 0 0; z-index: 20; display: block;
    padding: 10px var(--marge) calc(10px + env(safe-area-inset-bottom));
    background: var(--papier);
  }
  .collant .bouton { width: 100%; }
  body:has(.collant:not([hidden])) .pied { padding-bottom: 104px; }
}

/* Écrans en hauteur : les carnets prennent plus de largeur */
@media (max-aspect-ratio: 14/10) {
  .eventail { --l: min(40vw, 42svh, 400px); }
}
@media (max-width: 1100px) {
  .exemple__grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: 'fiche fiche' 'gauche droite';
    gap: clamp(24px, 4vw, 40px) clamp(16px, 3vw, 32px);
  }
  .fiche { justify-self: center; max-width: 560px; }
  .notes--gauche { justify-items: start; text-align: left; }
  .notes--gauche .fleche, .notes--droite .fleche { display: none; }
  .notes { align-self: start; gap: 18px; }
  .note { max-width: none; }
  .cassee { width: 42px; height: 68px; }
}
@media (max-width: 900px) {
  .boutique, .essai__panneau { grid-template-columns: minmax(0, 1fr); }
  .essai__livre { max-width: min(46vw, 240px); }
  .scene__livres { --l: min(44cqi, 310px); }
  .scene { min-height: calc(min(40vw, 310px) * 1.24 + 110px); }
  .questions { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 12px; }
  .entete { position: static; justify-content: center; min-height: 52px; padding-block: 4px; }
  .entete__bouton { display: none; }
  .hero__actions { display: grid; width: 100%; }
  .bouton { padding-inline: 20px; }
  .bouton--contour { min-height: 56px; }
  .eventail { --l: min(56vw, 300px); margin-top: 26px; }
  .exemple__grille { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'fiche' 'gauche' 'droite'; }
  .champ__ligne .bouton { flex: 1 1 100%; }
  .offre { padding-inline: 13px; }
}

/* Mouvement. Sans script, ou si la personne réduit les animations, tout reste visible et immobile. */

@media (prefers-reduced-motion: no-preference) {
  .js .hero__texte .main { animation: monte 700ms var(--fin) backwards; }
  .js .ligne > span { animation: leve 1000ms var(--fin) 60ms backwards; }
  .js .ligne--suite > span { animation-delay: 140ms; }
  .js .hero__phrase { animation: monte 800ms var(--fin) 300ms backwards; }
  .js .hero__actions { animation: monte 800ms var(--fin) 380ms backwards; }
  .js .hero .rassure { animation: monte 800ms var(--fin) 440ms backwards; }
  .js .eventail .feuille img { animation: sort 1300ms var(--ressort) 420ms backwards; }

  /* Au défilement, l'éventail s'ouvre */
  @supports (animation-timeline: scroll()) {
  }
}
@keyframes monte { from { opacity: 0; transform: translateY(18px); } }
@keyframes leve { from { transform: translateY(112%); } }
@keyframes sort { from { opacity: 0; transform: translateY(170px) rotate(calc(var(--a) * -1)); } }
@keyframes pose { from { scale: 0.5; } }
@keyframes ecarte-gauche { to { translate: -5vw 1vw; rotate: -5deg; } }
@keyframes ecarte-droite { to { translate: 5vw 1vw; rotate: 5deg; } }
@keyframes avance { to { translate: 0 -2vw; scale: 1.05; } }

@media (forced-colors: active) {
  .bouton, .champ__ligne input { border: 2px solid ButtonText; }
  .cuillerees svg, .cassee { fill: CanvasText; }
}
