/* Accueil : une journée au Grand Saule, du matin à la nuit.
   Chaque section prend la lumière de son heure (pêche, sauge, eau, miel, crépuscule, encre). */

/* ---------- Scènes (décor + Lanti posé sur son rocher) ---------- */
.accueil-haut { position: relative; }
.scene {
  position: relative;
  overflow: hidden;
  container-type: size;
  height: max(600px, min(100svh, 56.25vw));
  background: #EFCFAE;
}
.scene--nuit { height: max(520px, min(88svh, 56.25vw)); background: #1B2438; }

/* Plateau au format du décor, étiré pour couvrir la scène : Lanti reste sur son rocher. */
.plateau {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100cqw, 177.78cqh);
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
}
.plateau .decor { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Point d'appui 16:9 : x 0,34 / y 0,815 ; pattes à 93 % de la hauteur de l'image. */
.lanti-rocher {
  position: absolute;
  left: 34%;
  top: 81.5%;
  width: 25%;
  transform: translate(-50%, -93%);
  filter: drop-shadow(0 10px 8px rgb(60 36 20 / .28));
}
.ombre-rocher {
  position: absolute;
  left: 34%;
  top: 81.5%;
  width: 15%;
  height: 2.2%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(60 36 20 / .32), transparent);
}

/* Bulle de salutation : crème, couture, queue centrée vers Lanti. */
.bulle {
  position: absolute;
  left: 34%;
  bottom: 60.5%;
  width: max-content;
  max-width: min(20%, 330px);
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: 24px;
  background: var(--creme);
  color: var(--texte);
  font-weight: 700;
  font-size: clamp(1rem, .9rem + .35vw, 1.2rem);
  line-height: 1.35;
  box-shadow: var(--ombre-feutre);
  text-wrap: balance;
}
.bulle::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 20px;
  height: 20px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 5px 0;
}
.bulle::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.5px dashed var(--couture);
  border-radius: 19px;
  pointer-events: none;
}
.scene--nuit .bulle { background: #2A3348; color: #F6EBDD; }
.scene--nuit .bulle::after { border-color: #3E4B68; }

.entete--scene { position: absolute; inset: 0 0 auto; }

/* Feuille de feutre qui remonte sur le décor : la promesse et l'action. */
.feuille {
  position: absolute;
  right: max(var(--gouttiere), calc((100% - var(--largeur)) / 2));
  bottom: clamp(28px, 4.5vw, 80px);
  width: min(590px, 45vw);
  padding: clamp(26px, 3vw, 42px);
  border-radius: var(--rayon-feuille);
  background: var(--surface);
  box-shadow: 0 10px 30px rgb(var(--ombre) / .22);
}
.feuille::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px dashed var(--couture);
  border-radius: calc(var(--rayon-feuille) - 7px);
  pointer-events: none;
}
.feuille h1 { font-size: clamp(2.1rem, 1.2rem + 2.5vw, 3.55rem); }
.feuille .chapeau { margin-top: 16px; font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); color: var(--texte-2); }
.feuille .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 24px; }

/* ---------- Sections de la journée ---------- */
.heure { padding-block: clamp(64px, 10vw, 136px); }
.heure .intro { max-width: 34rem; }
.heure .intro p { margin-top: 18px; font-size: clamp(1.1rem, 1rem + .35vw, 1.28rem); }
.deux-colonnes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(36px, 6vw, 96px);
  align-items: center;
}
.note-douce { margin-top: 18px; color: var(--texte-2); font-size: 1.02rem; }

/* Matin : la météo intérieure tricote l'écharpe */
.heure--matin { background: var(--peche); }
.meteos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.meteo {
  --laine: var(--laine-nuages);
  background: var(--laine);
  color: #2A1B12;
  min-height: 50px;
  padding: .6em 1.1em;
}
.meteo .icone { width: 1.35em; height: 1.35em; }
.meteo[data-meteo="orage"] { --laine: var(--laine-orage); }
.meteo[data-meteo="pluie"] { --laine: var(--laine-pluie); }
.meteo[data-meteo="eclaircie"] { --laine: var(--laine-eclaircie); }
.meteo[data-meteo="soleil"] { --laine: var(--laine-soleil); }

.atelier-echarpe { display: grid; justify-items: center; gap: 18px; }
.echarpe {
  display: grid;
  gap: 0;
  width: min(100%, 420px);
  margin: 0;
  padding: 0;
  list-style: none;
  transform: rotate(-2.5deg);
}
.rang {
  display: grid;
  grid-template-columns: 230px auto;
  align-items: center;
  gap: 14px;
}
.rang .laine {
  height: 34px;
  background-color: var(--laine, var(--laine-nuages));
  background-image: url("/assets/img/maille.svg");
  background-size: 18px 21px;
  background-position: center;
  box-shadow: inset 0 -2px 0 rgb(59 42 33 / .12);
}
.rang:first-child .laine { border-radius: 14px 14px 0 0; }
.rang .nom { font-size: .95rem; font-weight: 700; color: #6B4A38; white-space: nowrap; }
.rang[data-meteo="orage"] { --laine: var(--laine-orage); }
.rang[data-meteo="pluie"] { --laine: var(--laine-pluie); }
.rang[data-meteo="nuages"] { --laine: var(--laine-nuages); }
.rang[data-meteo="eclaircie"] { --laine: var(--laine-eclaircie); }
.rang[data-meteo="soleil"] { --laine: var(--laine-soleil); }
.rang.nouveau .laine { animation: tricoter .7s cubic-bezier(.2, .8, .2, 1) both; transform-origin: left center; }
@keyframes tricoter { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.frange {
  width: 230px;
  height: 46px;
  justify-self: start;
  background: repeating-linear-gradient(90deg, #C9A77F 0 4px, transparent 4px 11px);
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.echarpe-legende { font-size: .95rem; color: #6B4A38; text-align: center; max-width: 30ch; }

/* Journée : les petits pas allument le bourgeon */
.heure--journee { background: var(--sauge); color: var(--sur-sauge); --ombre-feutre: 0 6px 16px rgb(24 36 22 / .28); }
.heure--journee .note-douce { color: #FFF8EE; }
.atelier-pas { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 24px; align-items: center; }
.pas-liste { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.pas {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 12px 18px;
  border-radius: 20px;
  background: var(--surface-enfoncee);
  font-weight: 750;
  cursor: pointer;
}
.pas input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.case {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px dashed var(--sauge);
  color: transparent;
  transition: background .2s, color .2s, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.case .icone { width: 20px; height: 20px; }
.pas input:checked + .case { background: var(--sauge); border-style: solid; color: var(--sur-sauge); transform: scale(1.08); }
.pas input:focus-visible + .case { outline: 3px solid var(--turquoise); outline-offset: 3px; }
.pas input:checked ~ .pas-titre { color: var(--texte-2); }

.bourgeon-demo { display: grid; justify-items: center; gap: 12px; text-align: center; }
.bourgeon-demo img {
  width: 170px;
  filter: brightness(.82) saturate(.8) drop-shadow(0 0 0 rgb(255 216 120 / 0));
  transition: filter .6s, transform .6s cubic-bezier(.3, 1.5, .5, 1);
}
.bourgeon-demo[data-lueurs="1"] img { filter: brightness(.95) saturate(.95) drop-shadow(0 0 10px rgb(255 216 120 / .55)); }
.bourgeon-demo[data-lueurs="2"] img { filter: brightness(1.05) drop-shadow(0 0 18px rgb(255 216 120 / .75)); }
.bourgeon-demo[data-lueurs="3"] img { filter: brightness(1.15) drop-shadow(0 0 30px rgb(255 216 120 / .95)); transform: scale(1.1); }
.lueurs { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lueurs li { width: 16px; height: 16px; border-radius: 50%; border: 2px dashed var(--or); transition: background .3s; }
.bourgeon-demo[data-lueurs="1"] .lueurs li:nth-child(-n+1),
.bourgeon-demo[data-lueurs="2"] .lueurs li:nth-child(-n+2),
.bourgeon-demo[data-lueurs="3"] .lueurs li { background: var(--or); border-style: solid; }
.reponse-lanti { min-height: 3.2em; font-weight: 750; font-size: 1rem; line-height: 1.35; color: var(--texte); }
.petales { position: relative; }
.bourgeon-demo[data-lueurs="3"] .petales::before,
.bourgeon-demo[data-lueurs="3"] .petales::after {
  content: "";
  position: absolute;
  left: 50%; top: 40%;
  width: 14px; height: 22px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--laine-eclaircie);
  animation: petale 1.4s ease-out both;
}
.bourgeon-demo[data-lueurs="3"] .petales::after { background: var(--laine-soleil); animation-name: petale2; }
@keyframes petale { from { transform: translate(-50%, 0) rotate(0); opacity: 1; } to { transform: translate(-190%, -120px) rotate(-70deg); opacity: 0; } }
@keyframes petale2 { from { transform: translate(-50%, 0) rotate(0); opacity: 1; } to { transform: translate(140%, -110px) rotate(80deg); opacity: 0; } }

/* Après-midi : la balade et son souvenir */
.heure--apresmidi { background: #236C73; color: #FFF8EE; --ombre-feutre: 0 6px 16px rgb(8 36 40 / .32); }
.heure--apresmidi .note-douce { color: #D8EEEC; }
.balade { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.balade .lanti-joie { width: min(100%, 420px); justify-self: center; filter: drop-shadow(0 16px 14px rgb(8 40 44 / .35)); }
.souvenir { margin-top: 30px; max-width: 36rem; }
.souvenir blockquote { margin: 0; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); line-height: 1.5; font-weight: 600; }
.souvenir figcaption { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.souvenir .nom-latin { font-style: italic; font-weight: 600; }
.texte-balade { margin-top: 18px; font-size: clamp(1.1rem, 1rem + .35vw, 1.28rem); color: #E6F3F1; max-width: 36rem; }

/* Toujours là : le SOS */
.heure--sos { background: var(--fond); }
.sos-rangee { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.sos-gestes { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.sos-gestes li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; }
.sos-gestes .pastille-icone {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--surface-enfoncee); color: var(--sos);
}
.sos-gestes h3 { margin-bottom: 4px; }
.faux-sos { pointer-events: none; margin-top: 26px; }
.avertissement { max-width: 62ch; margin-top: 24px; padding: 16px 20px; border-radius: var(--rayon-petit); background: var(--surface-enfoncee); font-size: 1rem; }

/* Soir : le journal */
.heure--soir { background: #F2D492; }
.journal-page { transform: rotate(1.5deg); max-width: 30rem; justify-self: center; width: 100%; }
.journal-page .question { font-size: clamp(1.25rem, 1.1rem + .5vw, 1.55rem); font-weight: 800; line-height: 1.3; }
.lignes { margin-top: 18px; height: 150px; background: repeating-linear-gradient(transparent 0 36px, var(--couture) 36px 38px); }
.lignes::before { content: ""; display: block; width: 2px; height: 26px; margin: 6px 0 0 2px; background: var(--abricot); animation: curseur 1.1s steps(1) infinite; }
@keyframes curseur { 50% { opacity: 0; } }
.journal-page .puce { margin-top: 18px; }

/* Crépuscule : les appareils */
.heure--partout { background: #3A3350; color: #F6EBDD; }
.appareils { display: grid; grid-template-columns: .62fr 1.25fr 1.6fr; gap: clamp(20px, 3vw, 44px); align-items: end; margin-top: clamp(36px, 5vw, 64px); }
.appareil figcaption { margin-top: 18px; font-size: 1rem; color: #E4D8CB; }
.appareil figcaption strong { display: block; font-size: 1.2rem; color: #F6EBDD; margin-bottom: 4px; }
.ecran { position: relative; overflow: hidden; background: #0E121B; border: 8px solid #0E121B; box-shadow: 0 18px 30px rgb(5 8 15 / .45); }
.ecran img.fond-ecran { width: 100%; height: 100%; object-fit: cover; }
.ecran .mini-lanti { position: absolute; transform: translate(-50%, -93%); }
.ecran--iphone { aspect-ratio: 9 / 19; border-radius: 34px; }
.ecran--iphone .mini-lanti { left: 51%; top: 79%; width: 62%; }
.ecran--duo { aspect-ratio: 951 / 669; border-radius: 26px; display: grid; grid-template-columns: 1fr 1fr; }
.ecran--duo .moitie { position: relative; overflow: hidden; }
.ecran--duo .moitie + .moitie { border-left: 2px solid #0E121B; background: #FBF3E6; padding: 14% 12%; display: grid; align-content: start; gap: 7px; }
.ecran--duo .mini-lanti { left: 50%; top: 84%; width: 70%; }
.mini-rang, .mini-ligne { display: block; }
.mini-rang { aspect-ratio: 6 / 1; background-color: var(--laine-soleil); background-image: url("/assets/img/maille.svg"); background-size: 8px 9px; }
.mini-rang:first-child { border-radius: 6px 6px 0 0; margin-bottom: -7px; }
.mini-rang + .mini-rang:not(:nth-child(3)) { margin-bottom: -7px; }
.mini-rang[data-laine="eclaircie"] { background-color: var(--laine-eclaircie); }
.mini-rang[data-laine="nuages"] { background-color: var(--laine-nuages); margin-bottom: 10px; }
.mini-ligne { aspect-ratio: 18 / 1; border-radius: 4px; background: #E3CDB2; }
.mini-ligne:nth-of-type(odd) { width: 78%; }
.ecran--tv { aspect-ratio: 16 / 9; border-radius: 10px; border-width: 10px; }
.ecran--tv .mini-lanti { left: 34%; top: 81.5%; width: 25%; }
.pied-tv { width: 22%; height: 12px; margin: 0 auto; background: #0E121B; border-radius: 0 0 8px 8px; }

/* Nuit : promesses, Plus, bientôt */
.heure--nuit { padding-top: clamp(56px, 8vw, 110px); padding-bottom: 0; }
.promesses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px clamp(28px, 5vw, 72px);
  margin: clamp(32px, 4vw, 52px) 0 0;
  padding: 0;
  list-style: none;
}
.promesses li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.promesses .icone { width: 28px; height: 28px; color: var(--or); margin-top: 2px; }
.promesses h3 { margin-bottom: 4px; }
.promesses p { color: var(--texte-2); }
.plus-honnete { margin-top: clamp(48px, 7vw, 88px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.plus-honnete h2 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem); }
.plus-honnete p { margin-top: 14px; color: var(--texte-2); max-width: 62ch; }
.bientot { text-align: center; padding-block: clamp(56px, 8vw, 110px) clamp(24px, 4vw, 48px); display: grid; justify-items: center; gap: 22px; }
.bientot h2 { max-width: 16ch; }
.bientot .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ---------- Tablettes et petits écrans : la feuille passe sous la scène, comme dans l'app ---------- */
@media (max-width: 1100px) {
  .scene { height: min(56.25vw, 72svh); min-height: 420px; }
  .feuille {
    position: relative;
    right: auto; bottom: auto;
    width: 100%;
    margin-top: -34px;
    border-radius: var(--rayon-feuille) var(--rayon-feuille) 0 0;
    padding: 38px max(var(--gouttiere), calc((100% - 44rem) / 2)) 40px;
    box-shadow: 0 -8px 20px rgb(var(--ombre) / .14);
  }
  .feuille::after { border-radius: calc(var(--rayon-feuille) - 7px) calc(var(--rayon-feuille) - 7px) 0 0; bottom: -10px; }
  .bulle { max-width: min(26%, 330px); }
}

/* ---------- Téléphones ---------- */
@media (max-width: 760px) {
  .scene { height: max(440px, 64svh); }
  .scene--nuit { height: max(460px, 72svh); }
  .plateau { width: max(100cqw, 56.25cqh); aspect-ratio: 9 / 16; }
  /* Point d'appui 9:16 : x 0,51 / y 0,79. */
  .lanti-rocher, .ombre-rocher { left: 51%; top: 79%; }
  .lanti-rocher { width: 50%; }
  .ombre-rocher { width: 30%; height: 1.3%; }
  .bulle { left: 51%; bottom: 49%; max-width: 78%; font-size: 1rem; padding: 12px 16px; }
  .feuille { padding: 34px var(--gouttiere) 36px; }
  .deux-colonnes, .balade, .sos-rangee, .plus-honnete { grid-template-columns: minmax(0, 1fr); }
  .atelier-pas { grid-template-columns: minmax(0, 1fr); }
  .bourgeon-demo { grid-row: 1; }
  .bourgeon-demo img { width: 130px; }
  .rang { grid-template-columns: 170px auto; }
  .frange { width: 170px; }
  .balade .lanti-joie { width: min(78%, 320px); }
  .appareils { grid-template-columns: .8fr 1.4fr; }
  .appareil--tv { grid-column: 1 / -1; }
  .promesses { grid-template-columns: 1fr; }
  .journal-page { transform: none; }
}
@media (max-width: 420px) {
  .rang { grid-template-columns: 120px auto; gap: 10px; }
  .rang .nom { font-size: .85rem; }
  .frange { width: 120px; }
  .appareils { grid-template-columns: 1fr; }
  .appareil--iphone .ecran { width: 62%; margin-inline: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .lignes::before { animation: none; }
  .bourgeon-demo[data-lueurs="3"] .petales::before,
  .bourgeon-demo[data-lueurs="3"] .petales::after { display: none; }
}
