/* Tes racines, dans la ligne visuelle FeelnMove : aquarelle et encre sur
   papier crème, bleu nuit et orange de feu. L'arbre fait le fond de la page
   et descend à chaque réponse ; tant que l'image n'est pas livrée, un fond
   peint en CSS fait l'attente. La bande du haut reste celle du site. */
:root {
  --page: #FDFCF9;
  --papier: #F4ECDF;
  --encre: #1E3A5C;
  --encre-douce: rgba(30, 58, 92, 0.78);
  --feu: #D9622B;
  --feu-texte: #A9441A;
  --nuit: #0E1C30;
  --creme: #F4ECDF;
  --bord: rgba(30, 58, 92, 0.16);
  --focus: #1E3A5C;
  --duree: 260ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif; color: var(--encre); line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column; background: var(--papier);
}
a { color: var(--encre); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }

/* --- L'arbre de la descente (fond de page) --- */
.arbre {
  position: fixed; left: 0; right: 0; top: 0; height: 500vh; z-index: -1;
  /* La descente entre deux écrans : lente, pour donner envie de contempler
     (Alain, 13 novembre 2026 : « un peu plus lent entre les deux fenêtres »).
     L'origine en haut à gauche : app.js compose translate + zoom (la caméra). */
  transform: translateY(0); transform-origin: 0 0;
  transition: transform 2.8s cubic-bezier(0.3, 0, 0.3, 1);
  /* En attendant arbre-racines.webp (T2) : une coupe peinte en CSS. La
     lumière au-dessus du sol (0-22 %), la ligne du sol (22-24 %), la terre de
     plus en plus sombre où passent des veines de feu, l'eau d'encre en bas. */
  background:
    radial-gradient(ellipse 60% 6% at 35% 6%, rgba(217, 98, 43, 0.24), transparent 70%),
    radial-gradient(ellipse 45% 5% at 72% 13%, rgba(217, 98, 43, 0.16), transparent 70%),
    radial-gradient(ellipse 8% 30% at 46% 42%, rgba(217, 98, 43, 0.20), transparent 75%),
    radial-gradient(ellipse 6% 26% at 60% 58%, rgba(217, 98, 43, 0.16), transparent 75%),
    radial-gradient(ellipse 5% 22% at 34% 66%, rgba(217, 98, 43, 0.12), transparent 75%),
    radial-gradient(ellipse 35% 3% at 55% 92%, rgba(217, 98, 43, 0.14), transparent 70%),
    linear-gradient(to bottom,
      #F8F1E2 0%, #F2E4C8 18%, #E6CFA6 21.5%,
      #6B4A33 22.5%, #5A4334 23.5%,
      #4C3D36 30%, #3A3A44 45%, #283652 62%, #182B48 78%, #0E1C33 88%, #0A1526 100%);
}
/* L'arbre des racines (1024 × 1536, ligne du sol à 22 % de la hauteur) couvre
   une couche de 280 % de l'écran, en débordant sur les côtés : l'arbre et les
   grosses racines sont au centre, et la descente a de la place pour voyager. */
.arbre-image {
  height: 280vh;
  background: #E9E0CC;
  background-image: url("images/arbre-racines.webp");
  background-size: cover; background-position: center top; background-repeat: no-repeat;
}

/* Le fond vivant (fond-vivant.js) : deux canvas transparents — l'un dans la
   couche de l'arbre (il descend avec elle), l'autre fixé au viewport pour
   les particules en parallaxe et les rayons de lumière. */
.fond-vivant { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fond-air { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }

/* --- En-tête et pied (ceux des pages d'outils) --- */
.entete { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; height: 68px; background: var(--page); border-bottom: 0.5px solid rgba(70, 96, 94, 0.12); }
.logo { font-family: 'Cormorant Garamond', serif; font-size: 24px; color: #14201E; text-decoration: none; letter-spacing: 0.02em; }
.menu-burger { display: flex; flex-direction: column; gap: 5px; padding: 10px; margin-right: -10px; background: none; border: none; cursor: pointer; }
.menu-burger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: #14201E; }
.menu-site { position: absolute; top: 100%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 1.4rem; padding: 2rem 1.25rem 2.25rem; background: var(--page); border-bottom: 0.5px solid rgba(70, 96, 94, 0.12); box-shadow: 0 12px 24px -16px rgba(20, 32, 30, 0.35); }
.menu-site a { font-family: 'Cormorant Garamond', serif; font-size: 22px; color: #14201E; text-decoration: none; }
.menu-site a:hover { color: #A0543C; }
/* Le pied (mention « piste de réflexion » et liens) : uniquement tout en bas
   de la page, jamais pendant l'exercice (Alain, 13 novembre 2026) — main
   occupe tout l'écran, il faut faire défiler jusqu'au bout pour le voir. */
.pied { margin-top: auto; padding: 2rem 1.25rem 2.5rem; font-size: 13px; color: var(--encre-douce); text-align: center; background: rgba(253, 252, 249, 0.82); backdrop-filter: blur(3px); }
.pied-mention { max-width: 30rem; margin: 0 auto 1rem; line-height: 1.5; }
.pied-mention:empty { display: none; }
.pied-liens { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; justify-content: center; }
.pied-liens a { color: var(--encre-douce); }
body.dans-l-eau .pied { background: rgba(8, 44, 56, 0.6); color: rgba(244, 236, 223, 0.8); }
body.dans-l-eau .pied-liens a { color: rgba(244, 236, 223, 0.75); }

/* --- Le parcours --- */
main { width: 100%; max-width: 32rem; margin: 0 auto; padding: 1.4rem 1rem 3rem; flex: 1; min-height: calc(100vh - 68px); min-height: calc(100svh - 68px); }
.noscript { padding: 2rem 0; }
.ecran {
  animation: apparait 420ms ease-out;
  background: rgba(253, 252, 249, 0.86); backdrop-filter: blur(4px);
  border-radius: 14px; padding: 1.6rem 1.3rem 1.8rem;
  box-shadow: 0 14px 40px -24px rgba(14, 28, 48, 0.5);
  transition: background var(--duree), color var(--duree);
}
/* Au fond, le lac turquoise de l'image : la carte devient une eau profonde. */
body.dans-l-eau .ecran { background: rgba(8, 44, 56, 0.74); color: var(--creme); }
body.dans-l-eau .ecran h1, body.dans-l-eau .ecran h2,
body.dans-l-eau .accroche, body.dans-l-eau .question-descente { color: var(--creme); }
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ecran h1, .ecran h2 { font-family: 'Cormorant Garamond', serif; font-weight: 400; line-height: 1.12; text-align: center; color: var(--encre); }
.ecran h1 { font-size: 2.8rem; margin: 0.4rem 0 0.2rem; }
.ecran h2 { font-size: 1.9rem; margin: 0.1rem 0; }
.ecran h1:focus, .ecran h2:focus { outline: none; }
.accroche, .note { text-align: center; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.22rem; line-height: 1.35; color: var(--encre-douce); max-width: 26rem; margin: 0.4rem auto 0; }
.note { font-size: 1rem; }
.note-demo { text-align: center; font-size: 0.85rem; color: var(--feu-texte); margin-top: 0.8rem; }

/* --- Les quatre moments : des cartes vivantes qui donnent envie de toucher ---
   (Alain, 12 novembre 2026 : « les 4 cartes ne donnent pas envie de cliquer »).
   Pas de boîte autour : la phrase et les cartes posées sur l'arbre. Chaque
   image respire lentement (un léger zoom qui va et vient), un reflet de
   lumière passe sur les cartes l'une après l'autre, la carte réagit au doigt,
   et la carte choisie s'avance pendant que les autres s'effacent. */
.ecran-moments { background: none; backdrop-filter: none; box-shadow: none; padding: 0.4rem 0 0; }
.ecran-moments h2 { position: relative; z-index: 0; text-wrap: balance; padding: 0.5rem 0.6rem; text-shadow: 0 0 12px rgba(248, 241, 226, 0.9); }
/* Un halo de papier, flou, derrière la phrase : elle se lit sur le feuillage. */
.ecran-moments h2::before {
  content: ""; position: absolute; inset: 8% 6%; z-index: -1; border-radius: 50%;
  background: rgba(248, 241, 226, 0.88); filter: blur(16px);
}
.moments { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.2rem; }
.moment {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: flex-end; aspect-ratio: 3 / 4;
  padding: 0.85rem; text-align: left; cursor: pointer;
  border: none; border-radius: 16px; color: #FFF8EC;
  font-family: 'DM Sans', sans-serif;
  box-shadow: 0 16px 34px -20px rgba(14, 28, 48, 0.75), 0 0 0 1px rgba(255, 248, 236, 0.35) inset;
  transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 380ms, opacity 420ms, filter 420ms;
  animation: carte-arrive 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 110ms + 120ms);
  -webkit-tap-highlight-color: transparent;
}
@keyframes carte-arrive { from { opacity: 0; transform: translateY(22px) scale(0.96); } to { opacity: 1; transform: none; } }

.moment-cadre { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.moment-image {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: respire 9s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -2.4s);
  transition: filter 380ms;
}
@keyframes respire {
  from { transform: scale(1.04) translate(0, 0); }
  to { transform: scale(1.15) translate(-2%, -2%); }
}
/* L'encre en bas de la carte, pour que les mots se lisent sur l'image. */
.moment::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(10, 21, 38, 0.9) 0%, rgba(10, 21, 38, 0.5) 36%, rgba(10, 21, 38, 0) 64%);
}
/* Le reflet de lumière qui passe, une carte après l'autre. */
.moment::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 45%;
  z-index: 0; pointer-events: none; transform: skewX(-18deg);
  background: linear-gradient(90deg, rgba(255, 236, 206, 0), rgba(255, 236, 206, 0.38), rgba(255, 236, 206, 0));
  animation: reflet 6.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 1.6s + 1.4s);
}
@keyframes reflet { 0% { left: -60%; } 16% { left: 125%; } 100% { left: 125%; } }

.moment-titre {
  position: relative; z-index: 1;
  font-family: 'Cormorant Garamond', serif; font-size: 1.32rem; line-height: 1.12;
  text-wrap: balance; text-shadow: 0 1px 10px rgba(10, 21, 38, 0.8);
}
.moment-titre::after {
  content: ""; display: block; width: 1.6rem; height: 2px; margin-top: 0.45rem;
  border-radius: 2px; background: var(--feu); transition: width 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.moment:hover, .moment:focus-visible {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 22px 40px -18px rgba(14, 28, 48, 0.8), 0 0 0 2px rgba(217, 98, 43, 0.85) inset, 0 0 28px -6px rgba(217, 98, 43, 0.6);
}
.moment:hover .moment-image, .moment:focus-visible .moment-image { filter: saturate(1.2) brightness(1.06); }
.moment:hover .moment-titre::after, .moment:focus-visible .moment-titre::after { width: 3.4rem; }
.moment:active { transform: scale(0.97); transition-duration: 120ms; }

/* Le choix */
/* Après la carte choisie : tout l'écran s'efface, l'arbre seul un instant. */
.ecran-moments.plonge { opacity: 0; transition: opacity 900ms ease; }
.en-choix .moment { pointer-events: none; }
.en-choix .moment:not(.choisie) { opacity: 0; transform: scale(0.9); filter: blur(3px); }
.en-choix .moment.choisie {
  z-index: 3; transform: scale(1.07);
  box-shadow: 0 26px 50px -16px rgba(14, 28, 48, 0.85), 0 0 0 2px var(--feu) inset, 0 0 40px -4px rgba(217, 98, 43, 0.8);
}
.en-choix .moment.choisie .moment-titre::after { width: 100%; }
/* En attendant les images : quatre lavis peints en CSS */
.teinte-feu { background: radial-gradient(ellipse 90% 60% at 30% 25%, rgba(217, 98, 43, 0.30), transparent 75%), radial-gradient(ellipse 70% 50% at 80% 80%, rgba(217, 98, 43, 0.14), transparent 70%), #FAF3E4; }
.teinte-creme { background: radial-gradient(ellipse 80% 55% at 70% 20%, rgba(217, 98, 43, 0.12), transparent 70%), radial-gradient(ellipse 60% 45% at 25% 85%, rgba(30, 58, 92, 0.08), transparent 70%), #FBF6EB; }
.teinte-nuit { background: radial-gradient(ellipse 95% 70% at 50% 30%, rgba(30, 58, 92, 0.30), transparent 80%), radial-gradient(ellipse 40% 30% at 55% 60%, rgba(217, 98, 43, 0.18), transparent 70%), #EFE9DC; }
.teinte-scene { background: radial-gradient(ellipse 60% 90% at 50% 0%, rgba(244, 236, 223, 0.9), transparent 75%), radial-gradient(ellipse 90% 50% at 50% 100%, rgba(30, 58, 92, 0.26), transparent 80%), #F2EADA; }

/* La descente */
.question-descente { font-family: 'Cormorant Garamond', serif; font-size: 1.45rem; font-style: italic; line-height: 1.35; text-align: center; color: var(--encre); margin: 0.6rem auto 1rem; max-width: 26rem; }
.note-repli { text-align: center; font-size: 0.85rem; color: var(--feu-texte); margin-bottom: 0.8rem; }
body.dans-l-eau .note-repli { color: var(--feu); }
.reponse {
  width: 100%; padding: 0.85rem 1rem; font-family: 'DM Sans', sans-serif; font-size: 1rem;
  line-height: 1.55; color: var(--encre); background: rgba(253, 252, 249, 0.92);
  border: 0.5px solid var(--bord); border-radius: 10px; resize: vertical;
}
.reponse::placeholder { color: rgba(30, 58, 92, 0.45); font-style: italic; }
.mot-du-fond { text-align: center; font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; }

/* Pas de carte pendant le voyage, même au fond (la règle « eau sombre » de
   .ecran remettait un carré sombre) : seulement la phrase, dans un petit
   halo de papier qui la serre de près (Alain, 13 novembre 2026). */
.ecran.ecran-patiente, body.dans-l-eau .ecran.ecran-patiente {
  background: none; backdrop-filter: none; box-shadow: none; padding: 0.6rem; text-align: center;
}
.patiente {
  display: inline-block; margin-top: 0.8rem; padding: 0.3rem 1rem;
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.25rem; line-height: 1.3;
  color: var(--encre); background: rgba(250, 244, 231, 0.92); border-radius: 999px;
  box-shadow: 0 0 14px 6px rgba(250, 244, 231, 0.8);
}
body.dans-l-eau .patiente { color: var(--encre); }
.goutte { width: 7px; height: 7px; border-radius: 50%; background: var(--feu); margin: 1.4rem auto 1rem; animation: goutte 1.6s ease-in infinite; }
@keyframes goutte { 0% { transform: translateY(-14px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(26px); opacity: 0; } }

/* La racine */
.racine-nom { font-family: 'Cormorant Garamond', serif; font-size: 2.1rem; line-height: 1.15; text-align: center; color: var(--encre); margin: 0.8rem 0 0.4rem; }
.racine-phrase { text-align: center; font-size: 0.98rem; color: var(--encre-douce); max-width: 24rem; margin: 0 auto; }
body.dans-l-eau .racine-nom { color: var(--creme); }
body.dans-l-eau .racine-phrase { color: rgba(244, 236, 223, 0.78); }
.racines-finales { display: flex; flex-direction: column; gap: 1.3rem; margin: 1.4rem 0 0.6rem; }
.racine-finale { text-align: center; }
.racine-finale .racine-nom { font-size: 1.7rem; margin-top: 0.1rem; }
.racine-numero { display: inline-block; font-size: 0.75rem; letter-spacing: 0.2em; color: var(--feu); }

/* Boutons */
.actions { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; margin-top: 1.4rem; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.7rem 2rem; border: none; border-radius: 999px;
  background: var(--encre); color: var(--page); font-family: 'DM Sans', sans-serif;
  font-size: 1rem; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: transform var(--duree), box-shadow var(--duree), background var(--duree);
}
.bouton:hover, .bouton:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 26px -16px rgba(14, 28, 48, 0.7); }
.bouton:disabled { opacity: 0.5; cursor: default; transform: none; }
.bouton-second { background: transparent; color: var(--encre); border: 1px solid var(--encre); }
/* La carte du résultat et le partage */
.carte-resultat {
  display: block; width: 100%; max-width: 24rem; aspect-ratio: 4 / 5; margin: 1.2rem auto 0;
  border-radius: 14px; background: rgba(8, 44, 56, 0.6);
  box-shadow: 0 22px 44px -22px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 248, 236, 0.25);
}
.partage { margin-top: 1.3rem; text-align: center; }
.partage-titre { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.2rem; line-height: 1.3; margin-bottom: 0.8rem; }
.partage-reseaux { display: flex; justify-content: center; gap: 0.9rem; flex-wrap: wrap; }
.reseau {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; cursor: pointer; color: #FFF;
  border: 1px solid rgba(255, 248, 236, 0.35);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.8);
  transition: transform var(--duree), box-shadow var(--duree);
  -webkit-tap-highlight-color: transparent;
}
.reseau svg { width: 26px; height: 26px; }
.reseau:hover, .reseau:focus-visible { transform: translateY(-3px) scale(1.06); box-shadow: 0 14px 26px -12px rgba(0, 0, 0, 0.85); }
.reseau:active { transform: scale(0.94); }
.reseau-instagram { background: linear-gradient(135deg, #F2A33C, #D9462F 45%, #A8327E); }
.reseau-facebook { background: #2D5BA8; }
.reseau-whatsapp { background: #1F8A5B; }
.reseau-telecharger { background: rgba(255, 248, 236, 0.12); color: #FFF8EC; }
.partage-statut { min-height: 1.4em; margin-top: 0.7rem; font-size: 0.9rem; color: rgba(244, 236, 223, 0.85); }
.partage-statut:empty { margin-top: 0; }

/* La séance, tout en bas de la fin : une phrase, un bouton. */
.seance { margin-top: 1.8rem; padding-top: 1.3rem; border-top: 0.5px solid rgba(244, 236, 223, 0.25); text-align: center; }
.seance-texte { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; line-height: 1.3; margin-bottom: 0.8rem; }
.bouton-seance { max-width: 22rem; padding: 0.85rem 1.8rem; text-align: center; line-height: 1.35; }
.bouton-lien { background: transparent; color: var(--encre); border: none; text-decoration: underline; min-height: 0; }
body.dans-l-eau .bouton { background: var(--feu); color: #FFF6EA; }
body.dans-l-eau .bouton-second { background: transparent; color: var(--creme); border-color: rgba(244, 236, 223, 0.6); }
body.dans-l-eau .bouton-lien { background: none; color: rgba(244, 236, 223, 0.85); }

@media (min-width: 640px) {
  .entete { padding: 0 2rem; }
  main { padding-top: 2.2rem; }
  .ecran { padding: 2.2rem 2.4rem 2.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .arbre { transition: none; }
  .ecran { animation: none; }
  .moment, .moment-image, .moment::after { animation: none; }
  .moment::after { display: none; }
  .goutte { animation-duration: 3s; }
}
