/* ============================================================
   Bar Mitsva de Raphaël — thème Désert bohème
   Sable, terracotta, brun, motifs berbères et soleil.
   ============================================================ */

:root {
  --sable:        #EAD9BF;
  --sable-clair:  #F5EBDA;
  --sable-fonce:  #D9BC8C;
  --terracotta:   #B5683C;
  --ocre:         #D9A55B;
  --brun:         #5B3A22;
  --brun-fonce:   #33200F;
  --olive:        #7A7D4A;

  --titre:  'Marcellus', Georgia, serif;
  --corps:  'Lora', Georgia, serif;
  --main:   'Amatic SC', cursive;   /* écriture à la main + hébreu */
  --hebreu: 'Frank Ruhl Libre', 'David', serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--corps);
  font-size: 17px;
  line-height: 1.7;
  color: var(--brun-fonce);
  /* un papier couleur sable, légèrement granuleux */
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .35), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(181, 104, 60, .07), transparent 45%),
    var(--sable-clair);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.pas-de-scroll { overflow: hidden; height: 100vh; }

p { margin: 0; }

.accent { color: var(--terracotta); }

.bsd {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 5;
  font-family: var(--hebreu);
  font-size: 18px;
  color: var(--brun);
}
.bsd--clair { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }

/* la bande de motifs berbères */
.bande {
  height: 40px;
  background: url('images/motif-tribal.svg') 0 0 / 100px 40px repeat-x, var(--sable);
}


/* ============================================================
   1. LA PAGE DE GARDE
   ============================================================ */

.couverture {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(51, 32, 15, .05), rgba(51, 32, 15, .35)),
    url('images/couverture.jpg') center / cover no-repeat,
    var(--sable-fonce);
  transition: opacity 1.2s ease;
}

.couverture.partie { opacity: 0; pointer-events: none; }

.couverture__contenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  text-align: center;
}

.bsd { }
.couverture .bsd { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }

.couverture__haut {
  font-family: var(--main);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}

/* la tablette encadrée de motifs, avec son secret sous le sable */
.tablette {
  position: relative;
  width: min(300px, 80vw);
  height: min(390px, 56vh);
  padding: 16px;
  background: url('images/motif-tribal.svg') 0 0 / 60px 24px, var(--sable);
  border: 3px solid var(--brun);
  border-radius: 150px 150px 10px 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .4);
}

.tablette__secret,
.tablette__sable {
  position: absolute;
  inset: 16px;
  border-radius: 134px 134px 4px 4px;
}

.tablette__secret {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--sable-clair);
  box-shadow: inset 0 0 0 2px var(--brun);
}

.tablette__soleil { width: 64px; margin-bottom: 8px; }

.tablette__sur {
  font-family: var(--titre);
  font-size: 13px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.tablette__nom {
  font-family: var(--titre);
  font-size: clamp(36px, 11vw, 46px);
  line-height: 1.1;
  color: var(--brun);
}

.tablette__hebreu {
  font-family: var(--main);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: var(--terracotta);
}

.tablette__date {
  margin-top: 10px;
  font-family: var(--titre);
  font-size: 19px;
  letter-spacing: .15em;
  color: var(--brun);
}

.tablette__lieu {
  font-style: italic;
  font-size: 15px;
  color: var(--brun);
}

.tablette__sable {
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  touch-action: none;
  cursor: grab;
  transition: opacity 1s ease;
}
.tablette__sable.envole { opacity: 0; pointer-events: none; }

.couverture__aide {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--main);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}

.couverture__main {
  display: inline-block;
  font-size: 22px;
  animation: balaye 1.6s ease-in-out infinite;
}

@keyframes balaye {
  0%, 100% { transform: translateX(-8px) rotate(-12deg); }
  50%      { transform: translateX(8px) rotate(12deg); }
}

.couverture__souffler {
  margin-top: -8px;
  padding: 4px 10px;
  border: 0;
  background: none;
  font-family: var(--corps);
  font-size: 14px;
  font-style: italic;
  text-decoration: underline;
  color: rgba(255, 255, 255, .9);
  cursor: pointer;
}

.couverture .bouton--entrer { display: none; }
.couverture.decouverte .bouton--entrer { display: inline-block; animation: arrive .8s ease both; }
.couverture.decouverte .couverture__aide,
.couverture.decouverte .couverture__souffler,
.couverture.decouverte .couverture__haut { display: none; }

@keyframes arrive {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* les grains de sable qui s'envolent sous le doigt */
.grain {
  position: fixed;
  z-index: 1100;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sable-fonce);
  pointer-events: none;
  animation: envol .9s ease-out forwards;
}

@keyframes envol {
  to { transform: translate(var(--dx), var(--dy)); opacity: 0; }
}


/* ---------- Le bouton commun ---------- */

.bouton {
  display: inline-block;
  padding: 13px 28px;
  border: 0;
  border-radius: 2px;
  background: var(--brun);
  font-family: var(--titre);
  font-size: 14px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sable-clair);
  box-shadow: 0 0 0 1px var(--brun), 0 0 0 4px var(--sable-clair), 0 0 0 5px var(--brun);
  cursor: pointer;
  transition: background-color .3s ease;
}
.bouton:hover { background: var(--terracotta); }


/* ============================================================
   2. LE GRAND VISUEL
   ============================================================ */

.hero {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 12vh 16px 0;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(51, 32, 15, .5) 0%, rgba(51, 32, 15, .15) 50%, rgba(51, 32, 15, .35) 100%),
    url('images/hero.jpg') center bottom / cover no-repeat;
}

.hero__soleil {
  width: 70px;
  margin-bottom: 6px;
  animation: tourne 40s linear infinite;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3));
}

@keyframes tourne {
  to { transform: rotate(360deg); }
}

.hero__sur {
  font-family: var(--titre);
  font-size: 14px;
  letter-spacing: .4em;
  text-transform: uppercase;
}

.hero__nom {
  margin: 4px 0 0;
  font-family: var(--titre);
  font-weight: 400;
  font-size: clamp(54px, 16vw, 104px);
  line-height: 1;
  letter-spacing: .04em;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .35);
}

.hero__hebreu {
  font-family: var(--main);
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  color: #FFE2B8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.hero__date {
  margin-top: 14px;
  font-family: var(--titre);
  font-size: 18px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

.hero__lieu {
  font-style: italic;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}

/* le compte à rebours posé sur un bandeau sable, dans le grand visuel */
.hero__compteur {
  margin-top: 22px;
  padding: 14px 10px 12px;
  background: rgba(245, 235, 218, .9);
  border: 1px solid var(--brun);
  outline: 1px solid rgba(245, 235, 218, .9);
  outline-offset: 3px;
  box-shadow: 0 10px 24px rgba(51, 32, 15, .25);
}
.hero__compteur .compteur { gap: 10px; flex-wrap: nowrap; }
.hero__compteur .compteur__chiffre { width: 62px; height: 62px; font-size: 21px; }
.hero__compteur .compteur__chiffre::before { inset: 7px; }
.hero__compteur .compteur__libelle { font-size: 10px; }


/* ============================================================
   3. L'INVITATION
   ============================================================ */

.invitation {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 22px 40px;
  text-align: center;
}

.invitation > p + p { margin-top: 18px; }

.invitation__salut {
  font-family: var(--titre);
  font-size: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brun);
}

.invitation__nom {
  font-family: var(--titre);
  font-size: clamp(48px, 14vw, 70px);
  line-height: 1;
  letter-spacing: .05em;
  color: var(--brun);
}

.invitation .invitation__hebreu {
  margin-top: 0;
  font-family: var(--main);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: var(--terracotta);
}

.invitation__date {
  font-family: var(--titre);
  font-size: 20px;
  letter-spacing: .06em;
  color: var(--terracotta);
}
.invitation__date span { font-family: var(--corps); font-style: italic; font-size: 16px; color: var(--brun); }

.verset {
  margin-top: 40px;
  padding: 26px 20px;
  border-top: 1px solid var(--sable-fonce);
  border-bottom: 1px solid var(--sable-fonce);
}

.verset__hebreu {
  font-family: var(--main);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--brun);
}

.verset__fr {
  margin-top: 8px;
  font-style: italic;
}

.verset__source {
  margin-top: 6px;
  font-family: var(--titre);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--terracotta);
}


/* ============================================================
   4. LE COMPTE À REBOURS EN SOLEILS
   ============================================================ */

.rebours {
  padding: 10px 16px 60px;
  text-align: center;
}

.petit-titre {
  margin-bottom: 18px;
  font-family: var(--main);
  font-size: 30px;
  font-weight: 700;
  color: var(--terracotta);
}

.compteur {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compteur__case {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* un médaillon à rayons, comme un petit soleil */
.compteur__chiffre {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: repeating-conic-gradient(var(--brun) 0 6deg, transparent 6deg 15deg);
  font-family: var(--titre);
  font-size: 24px;
  color: var(--sable-clair);
  isolation: isolate;
}
.compteur__chiffre::before {
  content: '';
  position: absolute;
  inset: 9px;
  z-index: -1;
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 3px var(--sable-clair), 0 0 0 4px var(--brun);
}

.compteur__libelle {
  margin-top: 8px;
  font-family: var(--titre);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brun);
}


/* ============================================================
   5. LA JOURNÉE
   ============================================================ */

.journee { padding: 60px 16px 70px; }

.titre {
  margin: 0 0 40px;
  font-family: var(--titre);
  font-weight: 400;
  font-size: clamp(26px, 7.4vw, 40px);
  line-height: 1.2;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
  color: var(--brun);
}

.frise-jour {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 52px;
}

/* la piste en pointillés, du matin au soir */
.frise-jour::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  border-left: 2px dashed var(--terracotta);
}

.frise-jour__soleil {
  position: absolute;
  top: 0;
  left: 1px;
  z-index: 2;
  width: 40px;
  transition: top .15s linear;
}

.etape + .etape { margin-top: 50px; }

/* chaque photo dans une arche */
.etape__photo {
  aspect-ratio: 4 / 4.4;
  overflow: hidden;
  border-radius: 999px 999px 6px 6px;
  border: 6px solid #fff;
  box-shadow: 0 0 0 1px var(--sable-fonce), 0 14px 28px rgba(91, 58, 34, .2);
}
.etape__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.etape__texte { padding-top: 16px; }

.etape__heure {
  font-family: var(--main);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--terracotta);
}

.etape__titre {
  margin: 6px 0 6px;
  font-family: var(--titre);
  font-weight: 400;
  font-size: 23px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--brun);
}

.lieu {
  max-width: 460px;
  margin: 60px auto 0;
  padding: 30px 22px 34px;
  text-align: center;
  background: var(--sable);
  border: 1px solid var(--brun);
  outline: 1px solid var(--brun);
  outline-offset: -8px;
}

.lieu__titre {
  font-family: var(--main);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--terracotta);
}

.lieu__nom {
  margin: 4px 0 4px;
  font-family: var(--titre);
  font-size: 28px;
  color: var(--brun);
}

.lieu .bouton { margin-top: 20px; }


/* ============================================================
   6. QUELQUES DÉTAILS
   ============================================================ */

.details {
  padding: 64px 16px 70px;
  background: url('images/motif-tribal.svg') 0 0 / 120px 48px, var(--sable);
  background-blend-mode: normal;
  position: relative;
}
.details::before {                 /* voile sable pour garder le texte lisible */
  content: '';
  position: absolute;
  inset: 22px 10px;
  background: var(--sable-clair);
  border: 1px solid var(--brun);
}
.details > * { position: relative; }

.details__liste {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 14px;
  list-style: none;
}

.details__liste li {
  position: relative;
  padding-left: 44px;
  text-transform: none;
}
.details__liste li + li { margin-top: 20px; }
.details__liste li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  background: url('images/soleil.svg') center / contain no-repeat;
}
.details__liste strong { font-weight: 500; color: var(--terracotta); }


/* ============================================================
   7. LA GALERIE EN ARCHES
   ============================================================ */

.galerie { padding: 60px 0 70px; }

.galerie__defile {
  display: flex;
  gap: 16px;
  padding: 0 16px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.galerie__defile::-webkit-scrollbar { display: none; }

.arche {
  flex: 0 0 62vw;
  max-width: 280px;
  margin: 0;
  aspect-ratio: 3 / 4.2;
  overflow: hidden;
  scroll-snap-align: center;
  border-radius: 999px 999px 6px 6px;
  border: 6px solid #fff;
  box-shadow: 0 0 0 1px var(--sable-fonce), 0 12px 24px rgba(91, 58, 34, .2);
}
.arche img { width: 100%; height: 100%; object-fit: cover; display: block; }


/* ============================================================
   8. LE PIED DE PAGE
   ============================================================ */

.pied { text-align: center; }

.pied__soleil { width: 64px; margin-top: 40px; }

.pied__mot {
  margin-top: 10px;
  padding: 0 20px;
  font-family: var(--main);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brun);
}

.pied__signe {
  margin: 6px 0 44px;
  font-style: italic;
  color: var(--terracotta);
}

.barre-signature {
  padding: 14px 16px 70px;
  background: var(--brun-fonce);
}
.barre-signature p {
  font-size: 12px;
  letter-spacing: .05em;
  color: rgba(245, 235, 218, .7);
}


/* ---------- Apparition au défilement ---------- */

.js .apparait {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease, transform 1s ease;
}
.js .apparait.visible { opacity: 1; transform: none; }


/* ============================================================
   LE BOUTON MUSIQUE (composant commun à tous les sites)
   ============================================================ */

.musique {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--terracotta);
  background: var(--terracotta);
  box-sizing: border-box;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
  transition: transform .2s ease, background-color .3s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.musique.visible { display: flex; }

/* l'onde qui s'echappe du bouton pendant la lecture */
.musique::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid var(--terracotta);
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
}

.musique.joue { animation: musique-respire 2s infinite ease-in-out; }
.musique.joue::before { animation: musique-onde 1.5s infinite ease-out; }

@keyframes musique-respire {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

@keyframes musique-onde {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: .8; }
  100% { transform: translate(-50%, -50%) scale(1.7); opacity: 0; }
}

/* les quatre barres de l'egaliseur */
.musique__barres {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 16px;
}

.musique__barres span {
  width: 2.5px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
}

/* a l'arret les barres restent basses ; en lecture elles montent en vague */
.musique.joue .musique__barres span {
  animation: musique-vague .45s infinite ease-in-out alternate;
}

.musique.joue .musique__barres span:nth-child(1) { animation-delay: 0s; }
.musique.joue .musique__barres span:nth-child(2) { animation-delay: .15s; }
.musique.joue .musique__barres span:nth-child(3) { animation-delay: .3s; }
.musique.joue .musique__barres span:nth-child(4) { animation-delay: .1s; }

@keyframes musique-vague {
  from { height: 3px; }
  to   { height: 16px; }
}


/* ============================================================
   ÉCRANS PLUS LARGES
   ============================================================ */

@media (min-width: 768px) {
  /* la frise passe au centre, les étapes alternent gauche / droite */
  .frise-jour { padding-left: 0; }
  .frise-jour::before { left: 50%; }
  .frise-jour__soleil { left: calc(50% - 19px); }

  .etape {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
  }
  .etape + .etape { margin-top: 70px; }
  .etape__photo { max-width: 340px; justify-self: end; width: 100%; }
  .etape__texte { padding-top: 0; }

  .etape:nth-child(odd) .etape__photo { order: 2; justify-self: start; }
  .etape:nth-child(odd) .etape__texte { order: 1; text-align: right; }

  .compteur { gap: 22px; }
  .compteur__chiffre { width: 96px; height: 96px; font-size: 30px; }

  .galerie__defile { justify-content: center; }
  .arche { flex-basis: 240px; }
}


/* Respecte les personnes qui ont désactivé les animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01s !important;
  }
}
