/* =========================================================
   Mille Chemins — feuille de style
   Palette : papier crème, encre, vert profond (action), ambre (page du livre), corail (soleil).
   Typo : Fraunces (titres) + Outfit (texte), hébergées dans fonts/.
   ========================================================= */

@font-face { font-family: "Fraunces"; src: url("../fonts/Fraunces-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/Fraunces-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../fonts/Outfit-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../fonts/Outfit-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("../fonts/Outfit-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F5F2EA;
  --paper: #FCFBF7;
  --ink: #1C1C1A;
  --muted: #6A675E;
  --line: #E4DFD2;
  --accent: #1F5C45;
  --accent-deep: #174836;
  --on-accent: #F7F3EA;
  --accent-soft: #E3EDE6;
  --amber: #E8B04B;
  --amber-soft: #FBEFD3;
  --sun: #E0694A;
  --night: #1E2A3A;
  --night-2: #263448;
  --on-night: #F5F2EA;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --r-sm: 12px; --r-md: 20px; --r-lg: 28px; --r-full: 999px;
  --shadow-soft: 0 10px 30px -14px rgba(28, 28, 26, .22);
  --shadow-book: 0 30px 60px -24px rgba(28, 28, 26, .45);
  --ease: cubic-bezier(.22, .8, .26, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
body.menu-open { overflow: hidden; }
img, svg { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-head { display: grid; gap: 14px; max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.h2 { font-size: clamp(32px, 4.6vw, 54px); }
.h2 em { font-style: italic; font-weight: 500; color: var(--accent); }
.lead { font-size: clamp(17px, 1.3vw, 19px); color: var(--muted); max-width: 60ch; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: var(--r-full); border: 0; cursor: pointer;
  font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), background .2s, box-shadow .25s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -12px rgba(31, 92, 69, .7); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { transform: translateY(-2px); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }

/* =========================================================
   Barre de navigation flottante (se resserre au défilement)
   ========================================================= */
.nav-shell { position: sticky; top: 0; z-index: 50; padding-top: calc(12px + env(safe-area-inset-top, 0px)); pointer-events: none; }
.nav {
  pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto;
  padding: 10px 10px 10px 18px; border-radius: var(--r-full);
  background: rgba(252, 251, 247, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(28, 28, 26, .06), 0 10px 30px -18px rgba(28, 28, 26, .25);
  transition: width .4s var(--ease), padding .4s var(--ease), box-shadow .3s;
}
.nav.shrunk { width: min(980px, 100% - 2 * var(--gutter)); box-shadow: inset 0 0 0 1px rgba(28, 28, 26, .08), 0 18px 40px -20px rgba(28, 28, 26, .35); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand span { white-space: nowrap; font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.nav-links { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-links a { display: inline-block; white-space: nowrap; padding: 10px 14px; border-radius: var(--r-full); text-decoration: none; font-weight: 500; color: var(--ink); transition: background .2s; }
.nav-links a:hover { background: var(--accent-soft); }
.nav-cta { display: flex; align-items: center; gap: 8px; }
.burger { display: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.burger span:nth-child(1) { top: 15px; } .burger span:nth-child(2) { top: 21px; } .burger span:nth-child(3) { top: 27px; }
.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  padding: calc(96px + env(safe-area-inset-top, 0px)) var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-12px); transition: opacity .3s, transform .35s var(--ease), visibility 0s .35s;
}
.menu-open .mobile-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .35s var(--ease); }
.mobile-menu a { font-family: var(--serif); font-size: clamp(30px, 8vw, 40px); font-weight: 500; text-decoration: none; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mobile-menu .btn { margin-top: auto; font-family: var(--sans); font-size: 17px; border-bottom: 0; }

@media (max-width: 900px) {
  .nav-links, .nav-cta .btn { display: none; }
  .burger { display: block; }
  .nav { padding: 8px 8px 8px 14px; }
}

/* =========================================================
   Héros
   ========================================================= */
.hero { padding-block: clamp(28px, 7vw, 96px) clamp(56px, 8vw, 110px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(32px, 6vw, 80px); }
.hero-grid > * { min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: var(--r-full); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; color: var(--muted); }
.badge i { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--amber-soft); color: var(--accent); font-style: normal; font-size: 12px; font-weight: 700; }
.hero h1 { font-size: clamp(36px, 6vw, 76px); letter-spacing: -.025em; margin-top: 22px; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.hero .lead { margin-top: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 30px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust svg { width: 18px; height: 18px; color: var(--accent); flex: none; }

.hero-visual { display: grid; justify-items: center; gap: 22px; }
.try { width: min(100%, 360px); display: grid; gap: 8px; }
.try label { font-weight: 700; font-size: 14px; }
.try input { font-size: 16px; }

/* ---------- Le livre en 3D ---------- */
.book3d {
  --w: 300px; --h: 390px; --d: 34px;
  width: var(--w); height: var(--h); max-width: 100%;
  perspective: 1800px; position: relative;
}
.book3d .vol {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateY(-24deg) rotateX(6deg);
  transition: transform .6s var(--ease);
  will-change: transform;
}
.book3d .face { position: absolute; backface-visibility: hidden; }
.book3d .front, .book3d .back { inset: 0; border-radius: 6px 14px 14px 6px; overflow: hidden; }
.book3d .front { transform: translateZ(calc(var(--d) / 2)); background: var(--cover, var(--accent)); color: var(--on-accent); box-shadow: inset 14px 0 18px -14px rgba(0,0,0,.45), inset 22px 0 0 -20px rgba(255,255,255,.18); }
.book3d .back { transform: translateZ(calc(var(--d) / -2)) rotateY(180deg); background: var(--cover-dark, var(--accent-deep)); border-radius: 14px 6px 6px 14px; }
.book3d .spine { top: 0; bottom: 0; left: 0; width: var(--d); transform: translateX(calc(var(--d) / -2)) rotateY(-90deg); background: var(--cover-dark, var(--accent-deep)); border-radius: 4px 0 0 4px; }
.book3d .spine::after { content: ""; position: absolute; left: 35%; right: 35%; top: 10%; bottom: 10%; border-radius: 2px; background: rgba(255,255,255,.12); }
.book3d .edge { top: 2px; bottom: 2px; right: 0; width: calc(var(--d) - 4px); transform: translateX(calc(var(--d) / 2 - 2px)) rotateY(90deg); background: repeating-linear-gradient(to right, #F7F3EA 0 2px, #E4DFD2 2px 3px); }
.book3d .top { left: 2px; right: 2px; top: 0; height: calc(var(--d) - 4px); transform: translateY(calc(var(--d) / -2 + 2px)) rotateX(90deg); background: repeating-linear-gradient(to bottom, #F7F3EA 0 2px, #E4DFD2 2px 3px); }
.book3d .bottom { left: 2px; right: 2px; bottom: 0; height: calc(var(--d) - 4px); transform: translateY(calc(var(--d) / 2 - 2px)) rotateX(-90deg); background: #EDE8DC; }
.book3d .shadow { position: absolute; left: 8%; right: -4%; bottom: -34px; height: 44px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(28,28,26,.42), rgba(28,28,26,0) 70%); filter: blur(6px); transform: translateZ(-200px); }

.cover-inner { position: absolute; inset: 0; z-index: 0; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-start; padding: 26px 22px 0 34px; }
.cover-inner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--cover, var(--accent)) 0%, color-mix(in srgb, var(--cover, var(--accent)) 80%, transparent) 30%, transparent 58%); }
.cover-title, .cover-sub, .cover-kicker { text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.cover-kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.cover-title { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.04; margin-top: 10px; overflow-wrap: anywhere; }
.cover-title b { font-weight: 600; color: var(--amber); }
.cover-sub { font-size: 14px; font-weight: 500; opacity: .9; margin-top: 10px; }
.cover-art { position: absolute; inset: 0; z-index: -2; background: var(--art, none) center / cover no-repeat; }
.cover-badge { position: absolute; top: 16px; right: 14px; background: var(--amber); color: var(--ink); font-size: 11px; font-weight: 700; padding: 6px 10px; border-radius: var(--r-full); transform: rotate(6deg); }

.floaty .vol { animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: rotateY(-24deg) rotateX(6deg) translateY(0); } 50% { transform: rotateY(-18deg) rotateX(4deg) translateY(-10px); } }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .book3d { --w: 240px; --h: 312px; --d: 28px; }
  .cover-title { font-size: 24px; }
  .cover-inner { padding: 20px 16px 0 26px; }
}

/* =========================================================
   Champs de formulaire
   ========================================================= */
input[type="text"], input[type="email"], textarea, .sel-btn {
  width: 100%; font: 500 16px/1.3 var(--sans); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; min-height: 52px;
  transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 104px; resize: vertical; }
input:focus, textarea:focus, .sel-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: #A6A294; }

/* Menu déroulant personnalisé (style iOS) */
.ios-select { position: relative; }
.ios-select select { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.sel-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.sel-btn::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .2s; flex: none; }
.ios-select.open .sel-btn::after { transform: rotate(-135deg) translateY(-2px); }
.sel-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none;
  background: var(--paper); border-radius: 16px; box-shadow: 0 20px 50px -20px rgba(28,28,26,.35), inset 0 0 0 1px var(--line);
  max-height: 280px; overflow: auto; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top;
  transition: opacity .18s, transform .22s var(--ease), visibility 0s .22s;
}
.ios-select.open .sel-list { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .22s var(--ease); }
.sel-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; min-height: 44px; border-radius: 10px; cursor: pointer; font-weight: 500; }
.sel-list li:hover, .sel-list li.active { background: var(--accent-soft); }
.sel-list li[aria-selected="true"]::after { content: ""; width: 7px; height: 12px; border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(45deg); margin-right: 4px; }
.sel-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(28,28,26,.35); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
@media (max-width: 640px) {
  .ios-select.open ~ .sel-backdrop, body.sel-open .sel-backdrop { opacity: 1; visibility: visible; transition: opacity .25s; }
  .sel-list {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 70dvh;
    border-radius: 22px 22px 0 0; padding: 10px 10px calc(14px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%); transition: transform .35s var(--ease), opacity .2s, visibility 0s .35s;
  }
  .sel-list::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 10px; }
  .sel-list li { min-height: 50px; font-size: 17px; }
  .ios-select.open .sel-list { transform: none; }
}

/* =========================================================
   Comment ça marche
   ========================================================= */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; }
.step { position: relative; min-width: 0; padding: 30px 28px 32px; border-radius: var(--r-md); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 14px; align-content: start; }
.step .num { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--accent); letter-spacing: .04em; }
.step .num::before { content: ""; display: inline-block; width: 28px; height: 1px; background: var(--accent); vertical-align: middle; margin-right: 10px; }
.step h3 { font-size: 26px; }
.step p { color: var(--muted); }
.step-art { height: 120px; border-radius: 14px; background: var(--bg); display: grid; place-items: center; overflow: hidden; }
.step-art svg { width: 100%; height: 100%; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } .step { padding: 26px 22px; } }

/* =========================================================
   Un vrai livre (photo)
   ========================================================= */
.real { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.real > * { min-width: 0; }
.photo { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 5; max-width: 100%; background: var(--line); box-shadow: var(--shadow-book); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo figcaption { position: absolute; left: 16px; bottom: 16px; font-size: 12px; color: #fff; background: rgba(28,28,26,.55); padding: 6px 10px; border-radius: var(--r-full); backdrop-filter: blur(6px); }
.photo figcaption a { color: inherit; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 34px; }
.figure { padding: 20px 18px; border-radius: var(--r-md); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.figure strong { display: block; font-family: var(--serif); font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figure span { font-size: 14px; color: var(--muted); }
@media (max-width: 900px) { .real { grid-template-columns: 1fr; } .photo { aspect-ratio: 4 / 3; } }
@media (max-width: 560px) { .figures { grid-template-columns: 1fr 1fr; } .figures .figure:last-child { grid-column: 1 / -1; } }

/* =========================================================
   Offres
   ========================================================= */
.offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.offer { position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 28px; border-radius: var(--r-lg); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); transition: transform .4s var(--ease), box-shadow .4s; }
.offer:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft); }
.offer.premium { background: var(--night); color: var(--on-night); box-shadow: none; }
.offer.premium .muted, .offer.premium .price span { color: rgba(245,242,234,.7); }
.offer .mini { height: 190px; display: grid; place-items: center; perspective: 1200px; }
.offer .book3d { --w: 118px; --h: 154px; --d: 16px; }
.offer .book3d .vol { transform: rotateY(-28deg) rotateX(4deg); }
.offer:hover .book3d .vol { transform: rotateY(-8deg) rotateX(2deg) translateY(-6px); }
.offer .cover-inner { padding: 12px 10px 0 16px; }
.offer .cover-kicker { font-size: 7px; }
.offer .cover-title { font-size: 14px; margin-top: 4px; }
.offer .cover-sub { font-size: 8px; margin-top: 4px; }
.offer .tag { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent); }
.offer.premium .tag { background: var(--amber); color: var(--ink); }
.offer h3 { font-size: 28px; }
.price { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.price strong { font-family: var(--serif); font-size: 42px; font-weight: 600; letter-spacing: -.02em; }
.price span { color: var(--muted); font-size: 14px; }
.offer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; flex: 1; }
.offer li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: 15px; }
.offer li svg { width: 18px; height: 18px; margin-top: 3px; color: var(--accent); }
.offer.premium li svg { color: var(--amber); }
.offer .btn { width: 100%; }
.offer.premium .btn-ghost { color: var(--on-night); box-shadow: inset 0 0 0 1.5px rgba(245,242,234,.3); }
.offer.premium .btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--on-night); }
@media (max-width: 980px) { .offers { grid-template-columns: 1fr; max-width: 560px; } .offer.premium { order: -1; } }

/* =========================================================
   Le livre à choix (bande sombre)
   ========================================================= */
.band-night { background: var(--night); color: var(--on-night); }
.band-night .eyebrow { color: var(--amber); }
.band-night .lead { color: rgba(245,242,234,.72); }
.band-night .h2 em { color: var(--amber); }
.choice { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.choice > * { min-width: 0; }
.tree { margin-top: 30px; overflow-x: auto; }
.tree svg { display: block; width: 100%; min-width: 380px; height: auto; }
.tree .node { fill: var(--night-2); stroke: rgba(245,242,234,.18); stroke-width: 1.5; }
.tree .node.end { fill: rgba(232,176,75,.14); stroke: var(--amber); }
.tree .edge { fill: none; stroke: var(--amber); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 220; }
.in .tree .edge { animation: draw 1.4s var(--ease) forwards; }
.in .tree .edge:nth-of-type(2) { animation-delay: .15s; } .in .tree .edge:nth-of-type(3) { animation-delay: .5s; } .in .tree .edge:nth-of-type(4) { animation-delay: .6s; } .in .tree .edge:nth-of-type(5) { animation-delay: .7s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.tree text { fill: var(--on-night); font: 600 13px var(--sans); }
.tree text.small { fill: rgba(245,242,234,.6); font-weight: 500; font-size: 11px; }

/* Livre ouvert avec page qui se tourne */
.open-book { perspective: 2200px; display: grid; justify-items: center; container-type: inline-size; width: 100%; }
.spread { --pw: min(290px, 50cqw); --ph: 440px; position: relative; width: calc(var(--pw) * 2); height: var(--ph); max-width: 100%; transform-style: preserve-3d; transform: rotateX(8deg); }
.page { position: absolute; top: 0; width: var(--pw); height: var(--ph); background: var(--paper); color: var(--ink); padding: 26px 24px; overflow: hidden; }
.page-l { left: 0; border-radius: 10px 0 0 10px; box-shadow: inset -24px 0 30px -24px rgba(28,28,26,.35); }
.page-r { right: 0; border-radius: 0 10px 10px 0; box-shadow: inset 24px 0 30px -24px rgba(28,28,26,.35); }
.page-img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin-bottom: 14px; }
.page .pn { position: absolute; bottom: 14px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.leaf .pn { position: absolute; bottom: 14px; font-size: 12px; color: var(--muted); }
.page-l .pn, .leaf .side-back .pn { left: 24px; } .page-r .pn, .leaf .side-front .pn { right: 24px; }
.page p { font-family: var(--serif); font-weight: 500; font-size: 16px; line-height: 1.5; }
.leaf { position: absolute; top: 0; left: 50%; width: var(--pw); height: var(--ph); transform-origin: left center; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.65, .05, .36, 1); z-index: 2; }
.leaf.flipped { transform: rotateY(-180deg); }
.leaf.flipped .side-front { pointer-events: none; }
.leaf.flipped .side-back { pointer-events: auto; }
.leaf .side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--paper); color: var(--ink); padding: 26px 24px; overflow: hidden; }
.leaf .side-front { border-radius: 0 10px 10px 0; box-shadow: inset 24px 0 30px -24px rgba(28,28,26,.35); }
.leaf .side-back { pointer-events: none; transform: rotateY(180deg); border-radius: 10px 0 0 10px; box-shadow: inset -24px 0 30px -24px rgba(28,28,26,.35); }
.leaf .side p { font-family: var(--serif); font-weight: 500; font-size: 16px; line-height: 1.5; }
.choice-box { margin-top: 18px; border: 1.5px dashed var(--accent); border-radius: 14px; padding: 14px; display: grid; gap: 8px; background: var(--accent-soft); }
.choice-box .q { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.choice-box button { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--paper); text-align: left; font-weight: 500; cursor: pointer; transition: background .2s, box-shadow .2s; }
.choice-box button:hover { background: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); }
.choice-box button b { white-space: nowrap; background: var(--amber); padding: 2px 10px; border-radius: 999px; font-size: 13px; font-variant-numeric: tabular-nums; }
.page .ending { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.again { margin-top: 18px; }
@media (max-width: 980px) { .choice { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .spread { --pw: min(50cqw, 46vw, 200px); --ph: 380px; }
  .page, .leaf .side { padding: 18px 16px; }
  .page p, .leaf .side p { font-size: 14px; }
  .choice-box { padding: 10px; margin-top: 10px; }
  .choice-box button { min-height: 40px; font-size: 12px; padding: 6px 8px; }
  .choice-box button b { font-size: 11px; padding: 1px 7px; }
  .choice-box .q { font-size: 10px; }
}

/* =========================================================
   Créer son livre
   ========================================================= */
.builder { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: start; }
.builder > * { min-width: 0; }
.form { display: grid; gap: 34px; padding: clamp(22px, 3.5vw, 40px); border-radius: var(--r-lg); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 16px; }
legend { font-family: var(--serif); font-size: 24px; font-weight: 600; padding: 0; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
legend .n { font-family: var(--sans); font-size: 13px; font-weight: 700; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row > * { min-width: 0; }
.field { display: grid; gap: 8px; }
.field > label, .field .lbl { font-weight: 700; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--r-full); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 500; cursor: pointer; user-select: none; transition: all .2s; }
.chip input:checked + span { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.worlds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.world, .fmt { position: relative; }
.world input, .fmt input { position: absolute; opacity: 0; pointer-events: none; }
.world span { display: grid; gap: 4px; height: 100%; padding: 14px; border-radius: var(--r-sm); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: all .2s; }
.world b { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.world b i { width: 12px; height: 12px; border-radius: 50%; background: var(--dot); flex: none; }
.world small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.world input:checked + span, .fmt input:checked + span { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.world input:focus-visible + span, .fmt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.fmts { display: grid; gap: 10px; }
.fmt span { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 16px 18px; border-radius: var(--r-sm); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: all .2s; }
.fmt b { font-weight: 700; }
.fmt em { font-style: normal; font-family: var(--serif); font-weight: 600; font-size: 20px; grid-row: 1 / span 2; grid-column: 2; align-self: center; font-variant-numeric: tabular-nums; }
.fmt small { color: var(--muted); font-size: 13px; }
.fmt input:disabled + span { opacity: .45; cursor: not-allowed; }
.notice { font-size: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--amber-soft); color: var(--ink); }
@media (max-width: 980px) { .builder { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } .worlds { grid-template-columns: 1fr 1fr; } .world small { display: none; } }

.recap { position: sticky; top: calc(92px + env(safe-area-inset-top, 0px)); display: grid; gap: 22px; justify-items: center; padding: 28px 24px 24px; border-radius: var(--r-lg); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.recap .book3d { --w: 190px; --h: 247px; --d: 22px; margin-top: 10px; }
.recap .book3d .vol { transform: rotateY(-20deg) rotateX(5deg); }
.recap .cover-inner { padding: 16px 14px 0 22px; }
.recap .cover-kicker { font-size: 8px; }
.recap .cover-title { font-size: 19px; margin-top: 6px; }
.recap .cover-sub { font-size: 10px; margin-top: 6px; }
.recap dl { width: 100%; margin: 18px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 15px; }
.recap dt { color: var(--muted); }
.recap dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.total { width: 100%; display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; border-top: 1px solid var(--line); }
.total strong { font-family: var(--serif); font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.recap .btn { width: 100%; }
.recap .fine { font-size: 13px; color: var(--muted); text-align: center; }
.done { width: 100%; display: grid; gap: 10px; padding: 20px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--ink); }
.done h3 { font-size: 22px; }
.done p { font-size: 15px; color: var(--muted); }
.pay { display: grid; gap: 10px; margin-top: 6px; }
.pay .fine { text-align: left; }
@media (max-width: 980px) { .recap { position: static; } }

/* =========================================================
   Exemple de pages
   ========================================================= */
.sample { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; perspective: 1400px; }
.sp { min-width: 0; background: var(--paper); border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); transform-style: preserve-3d; transition: transform .5s var(--ease), box-shadow .5s; }
.sp:hover { transform: rotateY(-6deg) rotateX(3deg) translateY(-6px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft); }
.sp img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.sp p { padding: 16px 18px 20px; font-size: 15px; line-height: 1.5; }
.sp .pg { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--accent); margin-bottom: 6px; }
@media (max-width: 980px) { .sample { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .sample { grid-template-columns: 1fr; } }

/* =========================================================
   FAQ
   ========================================================= */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { background: var(--paper); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); padding: 0 22px; }
.faq details[open] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 0; font-weight: 700; font-size: 17px; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--serif); font-size: 28px; line-height: 1; color: var(--accent); flex: none; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 20px; color: var(--muted); max-width: 66ch; }

/* =========================================================
   Appel final + pied de page
   ========================================================= */
.cta { padding-block: 0 clamp(64px, 9vw, 120px); }
.cta-box { position: relative; overflow: hidden; display: grid; justify-items: center; text-align: center; gap: 22px; padding: clamp(40px, 7vw, 80px) var(--gutter); border-radius: var(--r-lg); background: var(--accent); color: var(--on-accent); }
.cta-box img { width: 56px; height: 56px; }
.cta-box h2 { font-size: clamp(30px, 4.4vw, 52px); max-width: 16ch; }
.cta-box .btn-light { color: var(--accent-deep); }
.cta-box .ring { position: absolute; border-radius: 50%; border: 1px solid rgba(247,243,234,.18); pointer-events: none; }
.cta-box .ring:nth-child(1) { width: 520px; height: 520px; right: -200px; top: -260px; }
.cta-box .ring:nth-child(2) { width: 360px; height: 360px; left: -160px; bottom: -200px; }

.foot { border-top: 1px solid var(--line); padding-block: 48px calc(40px + env(safe-area-inset-bottom, 0px)); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot-grid > * { min-width: 0; }
.foot p { color: var(--muted); font-size: 15px; max-width: 36ch; margin-top: 12px; }
.foot h4 { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.foot ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot-bottom a { color: var(--ink); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 420px) { .foot-grid { grid-template-columns: 1fr; } }
.foot a, .foot li { overflow-wrap: anywhere; }

/* Barre fixe mobile */
.mobile-bar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: rgba(252,251,247,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  gap: 10px;
}
.mobile-bar .btn { flex: 1; min-height: 48px; }
@media (max-width: 900px) { .mobile-bar { display: flex; } body { padding-bottom: 80px; } .menu-open .mobile-bar { display: none; } }

/* =========================================================
   Pages intérieures (légal, 404)
   ========================================================= */
.legal { max-width: 760px; }
.legal h1 { font-size: clamp(34px, 5vw, 54px); margin-bottom: 10px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-bottom: 36px; }
.legal h2 { font-size: 26px; margin: 36px 0 12px; }
.legal p, .legal li { color: #3F3D37; }
.legal p + p { margin-top: 12px; }
.legal ul { padding-left: 20px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--accent); }
.page-404 { min-height: 70dvh; display: grid; place-items: center; text-align: center; }
.page-404 h1 { font-size: clamp(44px, 10vw, 110px); }
.page-404 .book3d { --w: 160px; --h: 208px; --d: 20px; margin: 0 auto 24px; }

/* =========================================================
   Animations d'apparition
   ========================================================= */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: .1s; } .js .reveal[data-delay="2"] { transition-delay: .2s; } .js .reveal[data-delay="3"] { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .floaty .vol { animation: none; }
}

/* Choix du style d'illustration */
.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.style-card { position: relative; min-width: 0; }
.style-card input { position: absolute; opacity: 0; pointer-events: none; }
.style-card span { display: grid; gap: 4px; height: 100%; padding: 10px 10px 14px; border-radius: var(--r-sm); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: box-shadow .2s, background .2s; }
.style-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.style-card b { font-weight: 700; padding-inline: 4px; }
.style-card small { color: var(--muted); font-size: 13px; line-height: 1.35; padding-inline: 4px; }
.style-card input:checked + span { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.style-card input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 680px) { .page-img { margin-bottom: 8px; } }
@media (max-width: 400px) { .style-card small { display: none; } }
@media (max-width: 360px) { .spread { --ph: 470px; } }

.look-title { margin: 4px 0 -6px; }
