/* Le Noël de Bibounette — nuit de Noël (entrée) et atelier en papier découpé (liste) */
@font-face { font-family: "Figtree"; src: url("polices/figtree-latin.202cfb54d4e6.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("polices/patrick-hand-latin.56bc7c81e5da.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --rouge: #c62f3b; --rouge-fonce: #9c1f2b; --vert: #2e9e5b; --vert-fonce: #1f6b40; --or: #f4c542;
  --encre: #3a2a25; --encre-douce: #6b574d; --papier: #fdf3e3; --kraft: #e9d3ac;
  --main: "Patrick Hand", "Comic Sans MS", cursive; --texte: "Figtree", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--texte); color: var(--encre); background: var(--papier); min-height: 100vh; min-height: 100dvh; }
h1, h2, p { margin: 0; }
a { color: var(--rouge-fonce); }
[hidden] { display: none !important; }

.enseigne { font-family: var(--main); font-weight: 400; line-height: .95; font-size: clamp(2.6rem, 11vw, 4.6rem); color: var(--rouge); text-shadow: 0 3px 0 #fff, 0 6px 0 rgba(0, 0, 0, .12); transform: rotate(-2deg); }
.enseigne span { display: block; font-size: .5em; color: var(--vert-fonce); letter-spacing: .02em; }

.bouton { display: inline-block; font: 700 1.02rem var(--texte); color: #fff; background: var(--rouge); border: 0; border-radius: 999px; padding: .7rem 1.3rem; cursor: pointer; text-decoration: none; text-align: center; box-shadow: 0 4px 0 var(--rouge-fonce); transition: transform .12s, box-shadow .12s; }
.bouton:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 6px 0 var(--rouge-fonce); }
.bouton:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rouge-fonce); }
.bouton:focus-visible, .guichet input:focus-visible, .passer:focus-visible, .pied button:focus-visible, .voir:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.bouton.discret { background: #fff; color: var(--encre-douce); box-shadow: 0 3px 0 rgba(0, 0, 0, .18); font-weight: 600; font-size: .9rem; padding: .45rem 1rem; }
.bouton[disabled] { opacity: .6; cursor: progress; }

/* ------------------------------------------------------------ la nuit de Noël */
body.nuit { background: #0b1a3a; color: #fff; overflow-x: hidden; }
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.scene > svg { width: 100%; height: 100%; display: block; }
.lanterne { opacity: .9; }

/* Le départ. Le traîneau est un calque à part, placé sur la grotte ; trois mouvements simples
   se superposent (avancer, monter, se cabrer), chacun avec sa propre courbe : la trajectoire
   est une courbe continue, sans étapes. --u = taille à l'écran d'une unité du décor. */
.scene { container-type: size; --u: max(100cqw / 1200, 100cqh / 700); }
.vol { position: absolute; left: calc(50cqw - 78 * var(--u)); top: calc(100cqh - 112 * var(--u)); width: 0; height: 0; pointer-events: none; }
.vol-x, .vol-y { width: 0; height: 0; will-change: transform; }
.scene .attelage { display: block; width: calc(235 * var(--u)); height: calc(70 * var(--u)); margin: calc(-40 * var(--u)) 0 0 calc(-125 * var(--u)); transform-origin: calc(125 * var(--u)) calc(40 * var(--u)); overflow: visible; will-change: transform, opacity; }
.vol-x { animation: depart-x 6.4s cubic-bezier(.55, 0, .9, .55) both, croisiere-x 26s linear 8s infinite; }
.vol-y { animation: depart-y 6.4s cubic-bezier(.25, .45, .3, 1) both, croisiere-y 26s linear 8s infinite; }
.attelage { animation: depart-pose 6.4s ease-in-out both, croisiere-pose 26s linear 8s infinite; }
@keyframes depart-x { to { transform: translateX(calc(900 * var(--u))); } }
@keyframes depart-y { to { transform: translateY(calc(-505 * var(--u))); } }
@keyframes depart-pose {
  0%   { transform: scale(.1) rotate(0deg); opacity: 0; }
  7%   { opacity: 1; }
  34%  { transform: scale(.62) rotate(-36deg); opacity: 1; }
  100% { transform: scale(1) rotate(-7deg); opacity: 1; }
}
@keyframes croisiere-x { from { transform: translateX(calc(-640 * var(--u))); } to { transform: translateX(calc(820 * var(--u))); } }
@keyframes croisiere-y { from { transform: translateY(calc(-330 * var(--u))); } to { transform: translateY(calc(-520 * var(--u))); } }
@keyframes croisiere-pose { from, to { transform: scale(.42) rotate(-8deg); opacity: 1; } }
.scintille circle { animation: poussiere .7s ease-in-out infinite alternate; }
.scintille circle:nth-child(2n) { animation-delay: -.35s; }
@keyframes poussiere { to { opacity: .15; } }
@keyframes clignote { 50% { opacity: .35; } }

.neige, .neige::after { position: absolute; inset: -100% 0 0 0; pointer-events: none; content: "";
  background-image: radial-gradient(circle, #fff 0 2px, transparent 2.5px), radial-gradient(circle, rgba(255, 255, 255, .8) 0 1.5px, transparent 2px), radial-gradient(circle, rgba(255, 255, 255, .6) 0 3px, transparent 3.5px);
  background-size: 190px 190px, 130px 130px, 310px 310px; background-position: 20px 30px, 80px 110px, 150px 60px;
  animation: tombe 14s linear infinite; }
.neige::after { inset: 0; background-size: 240px 240px, 170px 170px, 380px 380px; animation-duration: 23s; opacity: .7; }
@keyframes tombe { to { transform: translate(-40px, 50%); } }

.entree { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem 1rem 2.5rem; text-align: center; animation: apparait .9s 5.7s both; }
.nuit .enseigne { color: #fff; text-shadow: 0 3px 0 var(--rouge), 0 7px 14px rgba(0, 0, 0, .45); }
.nuit .enseigne span { color: var(--or); }
.annonce { font-family: var(--main); font-size: 1.35rem; max-width: 26rem; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
@keyframes apparait { from { opacity: 0; transform: translateY(24px) scale(.96); } }

.guichet { width: min(100%, 22rem); display: flex; flex-direction: column; gap: .5rem; text-align: left; background: #fffaf0; color: var(--encre); padding: 1.3rem 1.2rem 1.1rem; border-radius: 18px 22px 16px 24px; border: 3px solid var(--encre); box-shadow: 6px 7px 0 rgba(0, 0, 0, .35); transform: rotate(.6deg); }
.guichet label { font-weight: 700; font-size: .92rem; margin-top: .3rem; }
.guichet input[type="email"], .guichet input[type="password"], .guichet input[type="text"] { font: 1.05rem var(--texte); padding: .65rem .8rem; border: 2px solid var(--encre); border-radius: 12px; background: #fff; width: 100%; }
.guichet .bouton { margin-top: .8rem; }
.guichet ul { margin: 0; padding-left: 1.1rem; font-size: .85rem; color: var(--encre-douce); }
.petit { font-size: .85rem; color: var(--encre-douce); }
.erreur { background: #ffe1df; border: 2px solid var(--rouge); color: var(--rouge-fonce); border-radius: 12px; padding: .5rem .7rem; font-weight: 600; font-size: .92rem; }

.passer { position: fixed; z-index: 2; right: 1rem; bottom: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); font: 600 .9rem var(--texte); color: #fff; background: rgba(8, 20, 48, .6); border: 2px solid rgba(255, 255, 255, .7); border-radius: 999px; padding: .5rem 1rem; cursor: pointer; animation: disparait .4s 5.6s forwards; }
@keyframes disparait { to { opacity: 0; visibility: hidden; } }
@media (max-width: 600px) and (orientation: portrait) { .nuit:not(.simple) .entree { justify-content: flex-start; padding-top: min(31vh, 17rem); } }
/* animation déjà vue, passée, ou page sans décor */
.arrive .entree { animation: apparait .5s both; }
.arrive .passer { display: none; }
.arrive .vol-x { animation: croisiere-x 26s linear -9s infinite; }
.arrive .vol-y { animation: croisiere-y 26s linear -9s infinite; }
.arrive .attelage { animation: croisiere-pose 26s linear -9s infinite; }
.simple { background: linear-gradient(#081430, #16306b 55%, #3b5aa8); background-attachment: fixed; }

/* ------------------------------------------------------------ l'atelier : le pêle-mêle */
body.atelier { background-color: var(--papier);
  background-image: radial-gradient(rgba(198, 47, 59, .09) 2px, transparent 2.5px), radial-gradient(rgba(46, 158, 91, .09) 2px, transparent 2.5px);
  background-size: 46px 46px; background-position: 0 0, 23px 23px; padding-bottom: 2rem; }
.guirlande { display: flex; justify-content: space-around; height: 36px; border-top: 3px solid var(--vert-fonce); padding: 0 .5rem; }
.guirlande i { width: 13px; height: 20px; margin-top: 3px; border-radius: 50% 50% 50% 50% / 35% 35% 65% 65%; background: var(--c, var(--rouge)); box-shadow: 0 0 10px 2px var(--c, var(--rouge)); animation: clignote 1.6s ease-in-out infinite; }
.guirlande i:nth-child(4n+1) { --c: #e8424f; }
.guirlande i:nth-child(4n+2) { --c: var(--or); animation-delay: -.4s; margin-top: 7px; }
.guirlande i:nth-child(4n+3) { --c: #3fb873; animation-delay: -.8s; margin-top: 9px; }
.guirlande i:nth-child(4n) { --c: #4a9be8; animation-delay: -1.2s; margin-top: 6px; }
.guirlande i:nth-child(n+11) { display: none; }
@media (min-width: 700px) { .guirlande i:nth-child(n+11) { display: block; } }

.tete { text-align: center; padding: 1rem 1rem .4rem; display: flex; flex-direction: column; align-items: center; gap: .55rem; }
.bonjour { font-family: var(--main); font-size: 1.4rem; color: var(--encre-douce); transform: rotate(-1deg); }
.mot { font-family: var(--main); font-size: 1.3rem; max-width: 34rem; }
.compteurs { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .2rem; }
.etiquette { font-weight: 700; font-size: .9rem; padding: .35rem .85rem; border-radius: 999px; border: 2px solid var(--encre); background: #fff; box-shadow: 2px 3px 0 rgba(0, 0, 0, .15); }
.e-moi { background: #fff3c4; transform: rotate(-1.5deg); }
.e-reste { background: #d9f2e2; transform: rotate(1.2deg); }
.autres-listes { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.autres-listes a { font-family: var(--main); font-size: 1.15rem; text-decoration: none; padding: .15rem .8rem; border-radius: 999px; border: 2px dashed var(--encre-douce); color: var(--encre); }
.autres-listes a[aria-current] { background: var(--rouge); color: #fff; border-style: solid; border-color: var(--rouge-fonce); }

.messages { list-style: none; margin: .6rem auto 0; padding: 0 1rem; max-width: 34rem; display: grid; gap: .4rem; }
.messages li { padding: .55rem .9rem; border-radius: 14px; border: 2px solid var(--vert-fonce); background: #d9f2e2; font-weight: 600; }
.messages li.error { border-color: var(--rouge); background: #ffe1df; }
.ferme { margin: .8rem auto 0; max-width: 34rem; text-align: center; font-family: var(--main); font-size: 1.25rem; background: #fff3c4; border: 2px dashed var(--encre); border-radius: 14px; padding: .5rem 1rem; }

.pele-mele { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 1.5rem 1rem; padding: 1.6rem .9rem 1rem; max-width: 1180px; margin: 0 auto; align-items: start; }
@media (min-width: 700px) { .pele-mele { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 2.2rem 1.7rem; padding: 2rem 1.5rem; } }
.vignette { position: relative; background: var(--fond, #fff); padding: .7rem .7rem .9rem; border-radius: 4px 7px 5px 8px; box-shadow: 3px 5px 0 rgba(58, 42, 37, .16), 0 10px 22px rgba(58, 42, 37, .16); transform: rotate(var(--angle, 0deg)); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), box-shadow .25s; display: flex; flex-direction: column; gap: .4rem; text-align: center; }
.vignette:nth-child(3n+2) { margin-top: 1rem; }
.vignette:hover, .vignette:focus-within { transform: rotate(0deg) scale(1.04); z-index: 2; box-shadow: 4px 8px 0 rgba(58, 42, 37, .16), 0 18px 34px rgba(58, 42, 37, .24); }
.papier-0 { --fond: #ffe3e0; } .papier-1 { --fond: #dff3e4; } .papier-2 { --fond: #fff4c2; }
.papier-3 { --fond: #dcecfb; } .papier-4 { --fond: #fde1ee; } .papier-5 { --fond: #ffe6cc; }
.scotch { position: absolute; top: -12px; left: 50%; width: 74px; height: 24px; margin-left: -37px; background: rgba(255, 236, 170, .78); border-left: 2px dotted rgba(0, 0, 0, .12); border-right: 2px dotted rgba(0, 0, 0, .12); transform: rotate(calc(var(--angle, 0deg) * -1.6)); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.vignette:nth-child(even) .scotch { left: 28%; background: rgba(190, 228, 255, .78); }
.image { position: relative; aspect-ratio: 1; background: #fff; border-radius: 3px; display: grid; place-items: center; overflow: hidden; }
.image img { width: 100%; height: 100%; object-fit: contain; }
.dessin { font-size: clamp(3.4rem, 17vw, 5rem); line-height: 1; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .1)); }
.prix { position: absolute; right: 6px; bottom: 6px; background: var(--or); border: 2px solid var(--encre); border-radius: 999px; font-weight: 800; font-size: .8rem; padding: .1rem .5rem; transform: rotate(-6deg); }
.vignette h2 { font-family: var(--main); font-weight: 400; font-size: 1.4rem; line-height: 1.05; overflow-wrap: anywhere; }
.desc { font-size: .86rem; color: var(--encre-douce); }
.voir { font-size: .86rem; font-weight: 700; }
.idee { font-family: var(--main); font-size: 1rem; color: var(--vert-fonce); }
.vignette form { margin-top: auto; padding-top: .25rem; }
.vignette .bouton { width: 100%; }

.prise .image, .prise h2, .prise .desc, .prise .voir, .prise .idee, .prise .scotch { filter: grayscale(1); opacity: .45; }
.prise { --fond: #eceae6; box-shadow: 2px 3px 0 rgba(58, 42, 37, .1); }
.prise .voir, .prise .ouvrir { pointer-events: none; }
.tampon { position: absolute; top: 27%; left: 50%; width: max-content; max-width: 92%; transform: translateX(-50%) rotate(-11deg); font-family: var(--main); font-size: 1.3rem; line-height: 1.05; color: var(--rouge-fonce); background: rgba(255, 255, 255, .9); border: 3px double var(--rouge-fonce); border-radius: 10px; padding: .3rem .6rem; text-transform: uppercase; letter-spacing: .03em; }
.par { font-family: var(--main); font-size: 1.1rem; color: var(--encre); margin-top: auto; }
.a-moi { outline: 3px dashed var(--vert); outline-offset: 3px; }
.ruban { font-family: var(--main); font-size: 1.15rem; color: #fff; background: var(--vert); border-radius: 999px; padding: .15rem .6rem; box-shadow: 0 3px 0 var(--vert-fonce); margin-top: auto; }
.a-moi form { margin-top: 0; }
.vide { grid-column: 1 / -1; text-align: center; font-family: var(--main); font-size: 1.4rem; padding: 2rem 0; }

.pied { text-align: center; font-size: .9rem; color: var(--encre-douce); padding: 1rem; }
.pied form { display: inline; }
.pied button { font: inherit; color: var(--rouge-fonce); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: .3rem; }

/* ------------------------------------------------------------ la fiche d'un cadeau */
.ouvrir { display: flex; flex-direction: column; gap: .4rem; color: inherit; text-decoration: none; cursor: pointer; border-radius: 4px; }
.ouvrir:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.fenetre { border: 0; padding: 0; background: none; width: min(92vw, 26rem); max-height: 92dvh; overflow: visible; }
.fenetre::backdrop { background: rgba(58, 42, 37, .55); }
.fenetre[open] { animation: pop .3s cubic-bezier(.2, 1.4, .4, 1) both; }
.fenetre form { text-align: center; margin-top: .7rem; }
.fiche { background: var(--fond, #fff); border: 3px solid var(--encre); border-radius: 14px 18px 12px 20px; padding: 1rem; box-shadow: 6px 7px 0 rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: .5rem; text-align: center; max-height: 80dvh; overflow-y: auto; transform: rotate(-.6deg); }
.fiche .image { max-height: 38dvh; aspect-ratio: 4 / 3; }
.fiche h2 { font-family: var(--main); font-weight: 400; font-size: 1.6rem; line-height: 1.05; }
.fiche h3 { font-family: var(--main); font-weight: 400; font-size: 1.25rem; color: var(--vert-fonce); margin: .3rem 0 0; }
.offres { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; counter-reset: offre; }
.offres a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .1rem .6rem; text-align: left; text-decoration: none; color: var(--encre); background: #fff; border: 2px solid var(--encre); border-radius: 12px; padding: .5rem .7rem; box-shadow: 2px 3px 0 rgba(0, 0, 0, .15); }
.offres a:hover, .offres a:focus-visible { background: #fffbe6; outline: 0; transform: translateY(-1px); }
.offres li:first-child a { border-color: var(--vert-fonce); box-shadow: 2px 3px 0 var(--vert); }
.boutique { font-weight: 800; overflow-wrap: anywhere; }
.boutique::before { counter-increment: offre; content: counter(offre) ". "; color: var(--encre-douce); }
.modele { grid-column: 1; font-size: .84rem; color: var(--encre-douce); }
.tarif { grid-column: 2; grid-row: 1 / span 2; font-size: 1.05rem; color: var(--rouge-fonce); white-space: nowrap; }
.page-fiche { max-width: 28rem; margin: 0 auto; padding: 1.5rem 1rem; display: grid; gap: 1rem; text-align: center; }

/* ------------------------------------------------------------ le lutin prend la commande */
.lutin-scene { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6vh; background: radial-gradient(circle at 50% 78%, rgba(255, 244, 194, .96), rgba(253, 243, 227, .9) 45%, rgba(58, 42, 37, .55)); animation: voile .3s both; }
.lutin { width: min(62vw, 270px); height: auto; overflow: visible; transform-origin: 50% 100%; animation: saute .75s cubic-bezier(.2, 1.5, .4, 1) both, dandine 1.1s ease-in-out .75s infinite; filter: drop-shadow(0 6px 0 rgba(58, 42, 37, .12)); }
.bulle { position: relative; max-width: min(86vw, 22rem); margin-bottom: 1rem; font-family: var(--main); font-size: 1.55rem; line-height: 1.1; text-align: center; background: #fff; border: 3px solid var(--encre); border-radius: 22px; padding: .7rem 1.1rem; box-shadow: 4px 5px 0 rgba(58, 42, 37, .2); animation: pop .45s cubic-bezier(.2, 1.7, .4, 1) .55s both; }
.bulle::after { content: ""; position: absolute; left: 50%; bottom: -13px; width: 20px; height: 20px; margin-left: -10px; background: #fff; border-right: 3px solid var(--encre); border-bottom: 3px solid var(--encre); transform: rotate(45deg); }
.bras { transform-origin: 104px 130px; animation: ecrit .28s ease-in-out .7s 5 alternate; }
.coche { stroke-dasharray: 34; stroke-dashoffset: 34; animation: trace .45s ease-out 1.9s forwards; }
.grelot { transform-origin: 68px 16px; animation: tinte .5s ease-in-out infinite alternate; }
.lutin-scene.part { animation: voile .45s .1s reverse both; }
.lutin-scene.part .lutin { animation: file .45s ease-in both; }
.lutin-scene.part .bulle { animation: voile .25s reverse both; }
@keyframes voile { from { opacity: 0; } }
@keyframes saute { 0% { transform: translateY(120%) scale(.7, 1.3); } 60% { transform: translateY(-9%) scale(1.06, .94); } 100% { transform: none; } }
@keyframes dandine { 50% { transform: rotate(-2.5deg) scale(1.02, .98); } }
@keyframes pop { from { opacity: 0; transform: scale(.3) rotate(-8deg); } }
@keyframes ecrit { from { transform: rotate(-7deg); } to { transform: rotate(9deg); } }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes tinte { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes file { to { transform: translate(120vw, -20%) rotate(22deg) scale(.8); } }

.affichette { position: fixed; z-index: 21; left: 50%; bottom: 1.2rem; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 2rem); font-family: var(--main); font-size: 1.25rem; text-align: center; background: #fff; border: 3px solid var(--rouge-fonce); border-radius: 16px; padding: .6rem 1rem; box-shadow: 4px 5px 0 rgba(58, 42, 37, .25); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .vol { display: none; }
  .passer { display: none; }
}
