/* ============================================================
   Bat Mitsva d'Ella — format STORY façon couverture de magazine
   Noir, blanc, rose poudré et fuchsia.
   ============================================================ */

:root {
  --noir:     #111111;
  --blanc:    #FFFFFF;
  --papier:   #FBF7F5;
  --rose:     #F3B8C6;
  --fuchsia:  #E0457B;
  --or:       #C9A45C;

  --titre:  'Bodoni Moda', 'Didot', Georgia, serif;
  --sans:   'Jost', 'Helvetica Neue', Arial, sans-serif;
  --plume:  'Mrs Saint Delafield', cursive;
  --hebreu: 'Frank Ruhl Libre', 'David', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--noir);
}

body {
  font-family: var(--titre);
  color: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

p { margin: 0; }

/* sur ordinateur, la couverture floutée en fond */
.decor {
  position: fixed;
  inset: -40px;
  background: url('images/couverture.jpg') center / cover;
  filter: blur(30px) brightness(.45);
}


/* ============================================================
   LE CADRE DE LA STORY
   ============================================================ */

.story {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--noir);
  container-type: inline-size;   /* les tailles en « cqw » suivent la largeur de la story */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* les barres de progression */
.barres {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 20;
  display: flex;
  gap: 4px;
}
.barre {
  flex: 1;
  height: 2.5px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, .35);
}
.barre i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blanc);
}

/* l'en-tête : avatar, nom, pause */
.entete {
  position: absolute;
  top: 20px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--sans);
  color: var(--blanc);
  transition: color .4s ease;
}

.entete__avatar {
  display: flex;
  width: 34px;
  height: 34px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(var(--rose), var(--fuchsia), var(--or), var(--rose));
}
.entete__avatar span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--noir);
  border: 2px solid var(--noir);
  font-family: var(--titre);
  font-weight: 800;
  font-size: 15px;
  color: var(--blanc);
}

.entete__nom {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
}
.entete__nom small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: .8;
}

.entete__pause {
  margin-left: auto;
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  font-size: 13px;
  color: inherit;
  cursor: pointer;
}

/* scènes claires : l'interface passe en noir */
.story.ton-clair .entete { color: var(--noir); }
.story.ton-clair .barre { background: rgba(0, 0, 0, .18); }
.story.ton-clair .barre i { background: var(--noir); }


/* ============================================================
   LES SCÈNES
   ============================================================ */

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .55s ease, visibility 0s linear .55s;
}
.scene.active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  transition: opacity .55s ease;
}

.scene__fond {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.scene__fond img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* le lent zoom « Ken Burns » sur la photo de la scène active */
.scene.active .kenburns img { animation: kenburns 16s ease-out both; }

@keyframes kenburns {
  from { transform: scale(1.14) translate(1.5%, 1%); }
  to   { transform: scale(1)    translate(0, 0); }
}

.scene__voile {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, .05) 30%, rgba(0, 0, 0, .25) 55%, rgba(0, 0, 0, .78) 100%);
}
.voile--couverture {
  background: linear-gradient(180deg, rgba(40, 10, 25, .45) 0%, rgba(40, 10, 25, .05) 35%, rgba(40, 10, 25, .1) 55%, rgba(25, 5, 15, .82) 100%);
}
.voile--fort  { background: rgba(20, 5, 12, .62); }
.voile--edito { background: linear-gradient(180deg, rgba(20, 0, 15, .15) 0%, rgba(20, 0, 15, 0) 30%, rgba(30, 0, 20, .55) 55%, rgba(15, 0, 10, .85) 100%); }
.voile--fin   { background: linear-gradient(180deg, rgba(15, 0, 15, .35) 0%, rgba(15, 0, 15, .2) 40%, rgba(10, 0, 10, .7) 100%); }

/* les éléments arrivent un par un quand la scène s'ouvre */
.entre { opacity: 0; }
.scene.active .entre {
  animation: monte .8s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * .13s + .25s);
}

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

.rubrique {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--fuchsia);
}
.rubrique::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: .5;
}
.rubrique--clair { color: var(--blanc); }


/* ---------- 1. La couverture ---------- */

.couv {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 64px 18px 20px;
}

.couv__infos {
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, .7);
  border-bottom: 1px solid rgba(255, 255, 255, .7);
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: .26em;
  text-align: center;
  text-transform: uppercase;
}

.couv__titre {
  margin: 4px 0 0;
  font-weight: 800;
  font-size: 37cqw;
  line-height: .82;
  letter-spacing: -.03em;
  text-align: center;
  text-shadow: 0 4px 24px rgba(60, 10, 30, .35);
}

.couv__hebreu {
  font-family: var(--hebreu);
  font-size: 20px;
  text-align: center;
  color: var(--blanc);
  text-shadow: 0 1px 8px rgba(60, 10, 30, .5);
}

.couv__lignes {
  max-width: 62%;
  margin-top: 16px;
}
.couv__lignes p {
  margin-top: 10px;
  font-style: italic;
  font-size: 15px;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
}
.couv__lignes b {
  display: inline-block;
  margin-right: 4px;
  padding: 2px 6px 1px;
  background: var(--fuchsia);
  font-family: var(--sans);
  font-style: normal;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--blanc);
  text-shadow: none;
}
.couv__lignes span { font-family: var(--sans); font-style: normal; font-size: 10px; opacity: .8; }

.couv__lignes .couv__une {
  margin-top: 0;
  font-style: normal;
  font-weight: 800;
  font-size: 11cqw;
  line-height: .9;
  text-transform: uppercase;
  color: var(--blanc);
  text-shadow: 3px 3px 0 var(--fuchsia), 0 4px 18px rgba(60, 10, 30, .4);
}

.couv__bas { margin-top: auto; }

.couv__rang {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.couv__date {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.compteur {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}
.compteur__case { display: flex; flex-direction: column; align-items: center; }
.compteur__libelle { font-family: var(--sans); text-transform: uppercase; letter-spacing: .14em; }

.compteur--couv { gap: 14px; margin-top: 6px; }
.compteur--couv .compteur__chiffre { font-size: 26px; font-weight: 600; line-height: 1.1; }
.compteur--couv .compteur__libelle { font-size: 8.5px; opacity: .8; }

/* le code-barres, comme sur un vrai magazine */
.code-barre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 7px 4px;
  background: var(--blanc);
  color: var(--noir);
}
.code-barre i {
  display: block;
  width: 64px;
  height: 26px;
  background: repeating-linear-gradient(90deg,
    #111 0 1px, transparent 1px 3px, #111 3px 5px, transparent 5px 6px,
    #111 6px 7px, transparent 7px 10px, #111 10px 13px, transparent 13px 14px);
}
.code-barre small { font-family: var(--sans); font-size: 7px; letter-spacing: .1em; }

.bouton-ouvrir {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 15px 20px;
  border: 0;
  border-radius: 40px;
  background: var(--blanc);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--noir);
  cursor: pointer;
}
.bouton-ouvrir span { color: var(--fuchsia); font-size: 16px; }
/* un reflet qui passe sur le bouton */
.bouton-ouvrir::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(243, 184, 198, .6), transparent);
  transform: skewX(-20deg);
  animation: reflet 2.6s ease-in-out infinite;
}

@keyframes reflet {
  0%, 40% { left: -40%; }
  100%    { left: 130%; }
}


/* ---------- 2. L'édito ---------- */

.edito {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 72px 16px 66px;
}

.edito__titre {
  margin: 12px 0 14px;
  font-weight: 400;
  font-size: 11cqw;
  line-height: 1;
  text-shadow: 0 2px 20px rgba(255, 60, 200, .45);
}
.edito__titre em { color: var(--rose); }

.edito__panneau { padding: 18px 18px 16px; }

.edito__texte {
  font-size: 15.5px;
  line-height: 1.45;
}

.edito__nom {
  margin: 6px 0 4px;
  font-weight: 800;
  font-size: 12cqw;
  line-height: 1;
}
.edito__nom span {
  margin-left: 8px;
  font-family: var(--hebreu);
  font-weight: 500;
  font-size: 22px;
  color: var(--rose);
}

.edito__signature {
  margin-top: 4px;
  font-family: var(--plume);
  font-size: 38px;
  line-height: 1.1;
  color: var(--rose);
}

.edito__famille {
  font-family: var(--sans);
  font-size: 11.5px;
  opacity: .8;
}


/* ---------- 3 & 4. Les lieux ---------- */

.lieu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 72px 16px 70px;
}

/* les mots qui défilent en grand */
.flash {
  margin: auto 0;
  min-height: 2.1em;
  display: flex;
  align-items: center;
  font-weight: 800;
  font-style: italic;
  font-size: 14cqw;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .4);
}
.flash.pop { animation: pop .45s cubic-bezier(.2, .9, .3, 1.3); }

@keyframes pop {
  from { opacity: 0; transform: scale(.85) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* le panneau en verre dépoli */
.panneau {
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 18px;
  background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}

.panneau__titre {
  margin: 0;
  font-style: italic;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.05;
}

.panneau__quand {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.panneau__hebreu {
  font-style: italic;
  font-size: 14px;
  color: var(--rose);
}

.panneau__lieu {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.35;
}
.panneau__lieu strong { font-weight: 600; }

.panneau__note {
  margin-top: 6px;
  font-style: italic;
  font-size: 14px;
  opacity: .9;
}

.panneau__boutons {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.panneau__boutons a {
  flex: 1;
  padding: 11px 6px;
  border: 1px solid var(--blanc);
  border-radius: 30px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  color: var(--blanc);
}
.panneau__boutons a:first-child { background: var(--blanc); color: var(--noir); }


/* ---------- 5. Le dress code ---------- */

.tendances {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 20px 70px;
}

.tendances__titre {
  margin: 10px 0 18px;
  font-weight: 800;
  font-style: italic;
  font-size: 15cqw;
  line-height: .95;
}

.nuancier {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nuancier li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nuancier span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--blanc);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

.in-out {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}
.in-out > div {
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 14px;
  background: rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 15px;
  line-height: 1.3;
}
.in-out > div p + p { margin-top: 6px; }

.in-out__titre {
  margin-bottom: 4px;
  font-weight: 800;
  font-style: italic;
  font-size: 30px;
  line-height: 1;
  color: var(--rose);
}
.in-out__titre--out { color: var(--blanc); }
.in-out > div:last-child p:not(.in-out__titre) { text-decoration: line-through; text-decoration-color: var(--fuchsia); opacity: .85; }


/* ---------- 6. Le mot de la fin ---------- */

.fin {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 16px 16px;
  text-align: center;
}

/* « À TRÈS » en capitales, « vite ! » en grand italique qui brille */
.fin__titre {
  margin: 14px 0 18px;
  font-weight: 400;
  line-height: .9;
}
.fin__titre span {
  display: block;
  font-weight: 800;
  font-size: 10cqw;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.fin__titre em {
  display: block;
  font-size: 24cqw;
  color: var(--rose);
  text-shadow: 0 0 18px rgba(255, 70, 160, .8), 0 0 40px rgba(255, 70, 160, .5);
}

/* le compte à rebours dans un panneau de verre */
.fin__compte { padding: 14px 8px 12px; }

.fin__sous {
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--rose);
}

.compteur--fin .compteur__case { flex: 1; }
.compteur--fin .compteur__case + .compteur__case { border-left: 1px solid rgba(255, 255, 255, .25); }
.compteur--fin .compteur__chiffre {
  font-weight: 600;
  font-size: 36px;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.compteur--fin .compteur__libelle {
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: .2em;
  opacity: .75;
}

/* les deux rendez-vous */
.agenda {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--sans);
  text-align: left;
}

.agenda__ligne {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 16px;
  background: rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-decoration: none;
  color: var(--blanc);
}

.agenda__heure {
  min-width: 52px;
  font-family: var(--titre);
  font-weight: 600;
  font-size: 20px;
  color: var(--rose);
}

.agenda__infos {
  flex: 1;
  font-size: 12px;
  opacity: .9;
}
.agenda__infos strong {
  display: block;
  font-family: var(--titre);
  font-style: italic;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.1;
}

.agenda__plus {
  padding: 7px 11px;
  border-radius: 20px;
  background: var(--blanc);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--noir);
  white-space: nowrap;
}

.revoir {
  align-self: center;
  margin-top: 18px;
  padding: 10px 22px;
  border: 1px solid var(--blanc);
  border-radius: 30px;
  background: transparent;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blanc);
  cursor: pointer;
}

.signature {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 10px;
  color: rgba(255, 255, 255, .55);
}


/* ============================================================
   FLÈCHES (sur ordinateur)
   ============================================================ */

.fleche {
  position: absolute;
  top: 50%;
  z-index: 25;
  display: none;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  font-size: 24px;
  line-height: 1;
  color: var(--noir);
  cursor: pointer;
}
.fleche--prec { left: 10px; }
.fleche--suiv { right: 10px; }


/* ============================================================
   LE BOUTON MUSIQUE (composant commun à tous les sites)
   — ici posé dans la story plutôt que sur la page
   ============================================================ */

.musique {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 25;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--fuchsia);
  background: var(--fuchsia);
  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, .25);
  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(--fuchsia);
  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; }
}


/* ============================================================
   SUR ORDINATEUR : la story dans un « téléphone » au centre
   ============================================================ */

@media (min-width: 600px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .story {
    width: min(430px, calc((100vh - 40px) * .5));
    height: calc(100vh - 40px);
    max-height: 900px;
    border-radius: 26px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
  }
  .fleche { display: block; }
}

/* petits écrans en hauteur : on resserre */
@media (max-height: 680px) {
  .couv__lignes p:not(.couv__une) { font-size: 13px; margin-top: 6px; }
  .edito__texte { font-size: 14.5px; }
  .compteur--fin .compteur__chiffre { font-size: 28px; }
  .fin__titre em { font-size: 20cqw; }
}


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