/* ==========================================================
   Mariage coutumier — Horka & Hervé
   Site plein écran, esprit faire-part : ivoire, noir, or, brun et pagne
   ========================================================== */

:root {
  --ivoire: #f6f1e8;
  --papier: #fffdf9;
  --sable: #efe4d1;
  --encre: #1c1712;
  --texte: #4a3f35;
  --doux: #8a7d70;
  --or: #b98a35;
  --or-clair: #e3c272;
  --brun: #5a3a22;
  --nuit: #241912;
  --rouille: #9b3d25;
  --vert: #1f6f6a;
  --rouge: #b3261e;
  --filet: #ddd0bb;
  --serif: "Cormorant Garamond", Georgia, serif;
  --capitale: "Cinzel", "Cormorant Garamond", serif;
  --script: "Allura", "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", system-ui, sans-serif;
  --entete-h: 72px;
  /* motif « clé » du pagne, réutilisé en fond */
  --motif-cle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cpath d='M4 40V4h36v28H14V14h16v10' fill='none' stroke='%23b98a35' stroke-opacity='.08' stroke-width='2'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--entete-h); }
body {
  margin: 0;
  background: var(--ivoire);
  color: var(--texte);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--or); }
h1, h2, h3 { margin: 0; font-weight: 400; color: var(--encre); }
p { margin: 0 0 1em; }

/* ---------- En-tête ---------- */
.entete {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--entete-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 56px);
  transition: background .3s, box-shadow .3s, height .3s;
}
.entete.defile { background: rgba(255, 253, 249, .95); box-shadow: 0 2px 20px rgba(0,0,0,.07); backdrop-filter: blur(6px); height: 60px; }
.monogramme { font-family: var(--capitale); font-size: 22px; color: var(--encre); text-decoration: none; letter-spacing: 2px; }
.monogramme span { font-family: var(--script); color: var(--or); font-size: 28px; margin: 0 2px; }
.menu { display: flex; gap: 28px; align-items: center; }
.menu a { color: var(--encre); text-decoration: none; font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; font-weight: 500; position: relative; padding: 4px 0; }
.menu a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px; background: var(--or); transition: right .3s; }
.menu a:hover::after, .menu a.actif::after { right: 0; }
.menu a.actif { color: var(--or); }
.menu .menu-rsvp { border: 1px solid var(--or); padding: 8px 18px; border-radius: 40px; color: var(--or); }
.menu .menu-rsvp::after { display: none; }
.menu .menu-rsvp:hover, .menu .menu-rsvp.actif { background: var(--or); color: #fff; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 24px; height: 2px; background: var(--encre); margin: 5px 0; transition: transform .3s, opacity .3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Écrans plein format ---------- */
.ecran {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--entete-h) + 40px) clamp(16px, 5vw, 64px) 70px;
  overflow: hidden;
}
.conteneur { width: 100%; max-width: 1180px; margin: 0 auto; position: relative; z-index: 1; }
.ecran-papier { background: var(--papier); }
.ecran-sable { background: var(--sable) var(--motif-cle); }
.ecran-sombre { background: var(--nuit) var(--motif-cle); color: #d9cbb6; }

/* bande de pagne entre deux sections */
.bande {
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Crect width='18' height='18' fill='%23b98a35'/%3E%3Cpath d='M2 16V2h14v11H6V6h6v4' fill='none' stroke='%231c1712' stroke-width='2.4'/%3E%3C/svg%3E");
  border-top: 2px solid var(--encre); border-bottom: 2px solid var(--encre);
}

/* titres communs */
.eyebrow { font-family: var(--capitale); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--or); margin-bottom: 14px; }
.titre-section { font-family: var(--capitale); font-size: clamp(30px, 4.6vw, 54px); letter-spacing: 3px; text-transform: uppercase; line-height: 1.1; margin-bottom: 28px; }
.entete-section { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 48px; text-align: left; }
.entete-section .titre-section { margin-bottom: 0; }
.entete-section .eyebrow { margin-bottom: 6px; }
.deco-petite { width: 110px; flex: none; }
.prenoms { font-family: var(--script); font-size: clamp(52px, 7vw, 92px); color: var(--brun); line-height: 1.05; margin: 6px 0 0; }
.prenoms em { font-style: normal; color: var(--or); font-size: .55em; vertical-align: middle; margin: 0 .12em; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  padding: 16px 32px; border-radius: 40px; transition: transform .15s, box-shadow .2s, opacity .2s, background .2s, color .2s;
}
.bouton:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.14); }
.bouton:disabled { opacity: .6; cursor: wait; transform: none; }
.bouton-or { background: linear-gradient(135deg, #a77a2c, var(--or-clair) 55%, #a77a2c); color: #fff; }
.bouton-contour { border: 1px solid var(--encre); color: var(--encre); background: transparent; }
.bouton-contour:hover { background: var(--encre); color: var(--papier); }
.bouton-vert { background: var(--vert); color: #fff; width: 100%; margin-bottom: 12px; }
.bouton-rouge { background: var(--rouge); color: #fff; width: 100%; }

/* ---------- 1. Accueil ---------- */
.ecran-accueil {
  background:
    radial-gradient(ellipse at 72% 50%, rgba(255,255,255,.95), rgba(255,255,255,0) 55%),
    var(--ivoire) var(--motif-cle);
}
/* cadre doré façon faire-part, sur tout l'écran */
.cadre { position: absolute; inset: 18px; border: 1px solid var(--or); pointer-events: none; opacity: .55; }
.cadre::before { content: ""; position: absolute; inset: 6px; border: 1px solid var(--filet); }
.accueil-grille { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 40px; }
.accueil-texte { text-align: center; }
.sur-titre {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--capitale); font-size: 11.5px; letter-spacing: 3px; text-transform: uppercase; color: var(--doux); margin-bottom: 20px;
}
.filet { flex: 0 1 60px; height: 1px; background: var(--or); }
.titre-mariage { font-family: var(--capitale); font-size: clamp(50px, 8.4vw, 116px); line-height: .95; letter-spacing: 5px; }
.titre-mariage small { display: block; font-size: .2em; letter-spacing: .9em; margin: 16px 0 0 .9em; color: var(--texte); }
.date-couverture { font-family: var(--capitale); letter-spacing: 3px; font-size: 13.5px; text-transform: uppercase; color: var(--encre); margin: 22px 0; }
.compte { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; }
.compte div { min-width: 78px; padding: 12px 8px; border: 1px solid var(--filet); border-radius: 4px; background: rgba(255,255,255,.75); }
.compte b { display: block; font-family: var(--serif); font-weight: 500; font-size: 32px; color: var(--encre); line-height: 1; }
.compte span { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--doux); }
.boutons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.accueil-visuel { display: flex; justify-content: center; }
.illustration-couple { width: min(560px, 100%); max-height: calc(100svh - 160px); object-fit: contain; }
.defiler { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); width: 26px; height: 42px; border: 1.5px solid var(--encre); border-radius: 20px; opacity: .6; z-index: 2; }
.defiler span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--encre); animation: molette 1.8s infinite; }
@keyframes molette { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- 2. Invitation ---------- */
.invitation-grille { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.texte-invitation { font-family: var(--serif); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.7; color: var(--texte); max-width: 620px; }
.texte-invitation strong { color: var(--encre); font-weight: 600; }
.prenoms-grand { font-size: clamp(44px, 5.4vw, 74px); margin-top: 10px; }
.panneau-date { position: relative; text-align: center; padding: 44px 30px 38px; border: 1px solid var(--or); background: var(--ivoire); }
.panneau-date::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--filet); pointer-events: none; }
.panneau-date .deco { width: 170px; margin: -110px auto 12px; position: relative; }
.date-ligne { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--capitale); color: var(--encre); }
.date-ligne .jour, .date-ligne .mois { font-size: 18px; line-height: 1.15; text-transform: uppercase; }
.date-ligne small { font-family: var(--sans); font-size: 12px; letter-spacing: 1px; color: var(--doux); }
.date-ligne .num { font-family: var(--serif); font-size: 78px; line-height: 1; padding: 0 16px; border-left: 1px solid var(--encre); border-right: 1px solid var(--encre); }
.lieu-court { font-family: var(--serif); font-size: 24px; line-height: 1.3; color: var(--encre); margin: 20px 0 6px; }
.adresse { font-size: 11.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--doux); }
.lien-fleche { position: relative; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; text-decoration: none; }

/* ---------- 3. Programme (section sombre) ---------- */
.ecran-sombre .titre-section { color: var(--papier); }
.ecran-sombre .eyebrow { color: var(--or-clair); }
.frise { list-style: none; margin: 0 auto; padding: 0; max-width: 680px; position: relative; }
.frise::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--or); opacity: .6; }
.frise li { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 13px 0; position: relative; }
.frise li::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--or-clair); box-shadow: 0 0 0 5px var(--nuit); }
.frise svg { width: 54px; height: 54px; fill: none; stroke: var(--or-clair); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.frise time { display: block; font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--papier); letter-spacing: .5px; line-height: 1.2; }
.frise p { margin: 0; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; line-height: 1.5; color: #cdbda6; }
.frise li.d svg { justify-self: end; margin-right: 40px; }
.frise li.d div { text-align: left; padding-left: 40px; }
.frise li.g div { grid-column: 1; grid-row: 1; text-align: right; padding-right: 40px; }
.frise li.g svg { grid-column: 2; grid-row: 1; margin-left: 40px; }
.nb { font-size: 13px; color: #b3a38c; margin: 40px auto 0; max-width: 520px; text-align: center; }
.nb strong { color: var(--or-clair); }

/* ---------- 4. Dress code ---------- */
.dress-grille { display: grid; grid-template-columns: 1fr minmax(240px, 340px) 1fr; gap: clamp(24px, 4vw, 60px); align-items: center; }
.dress-col h3 { font-family: var(--capitale); font-size: 17px; letter-spacing: 2px; margin-bottom: 16px; }
.intro-dress { font-family: var(--serif); font-size: 19px; line-height: 1.6; margin-bottom: 28px; }
.pagne { margin: 0 0 14px; display: flex; align-items: center; gap: 16px; }
.pagne img { width: 130px; height: 86px; object-fit: cover; border-radius: 3px; box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.pagne figcaption { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--encre); }
.illustration-dress { width: 100%; max-height: calc(100svh - 260px); object-fit: contain; }
.palette { list-style: none; padding: 0; margin: 0 0 34px; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.palette li { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--encre); }
.pastille { width: 30px; height: 30px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6), 0 2px 6px rgba(0,0,0,.18); }
.note-cadeau { border-left: 2px solid var(--or); padding-left: 18px; }
.note-cadeau p { font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.55; margin: 0; }

/* ---------- 5. Lieu ---------- */
.lieu-grille { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.lieu-texte .lieu-court { font-size: 30px; margin-top: 0; }
.infos { list-style: none; padding: 0; margin: 26px 0 32px; border-top: 1px solid var(--filet); }
.infos li { display: flex; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--filet); font-family: var(--serif); font-size: 18px; color: var(--encre); }
.infos b { flex: 0 0 90px; font-family: var(--sans); font-weight: 600; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--or); padding-top: 4px; }
.carte-geo { position: relative; aspect-ratio: 4 / 3.2; border: 1px solid var(--or); padding: 8px; background: var(--ivoire); }
.carte-geo iframe { width: 100%; height: 100%; border: 0; filter: sepia(.25) saturate(.85); display: block; }

/* ---------- 6. Confirmation (écran partagé) ---------- */
.ecran-rsvp { padding: 0; align-items: stretch; display: grid; grid-template-columns: 1fr 1fr; }
.rsvp-gauche {
  background: var(--nuit) var(--motif-cle); color: #d9cbb6;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--entete-h) + 30px) clamp(20px, 5vw, 70px) 60px;
}
.rsvp-gauche .titre-section { color: var(--papier); }
.rsvp-gauche .eyebrow { color: var(--or-clair); }
.rsvp-gauche .prenoms { color: var(--or-clair); margin-bottom: 18px; font-size: clamp(46px, 4.6vw, 68px); white-space: nowrap; }
.rsvp-gauche .prenoms em { color: var(--papier); }
.echeance { font-family: var(--serif); font-size: 20px; margin-top: 24px; }
.echeance strong { color: var(--papier); font-weight: 600; font-size: 24px; }
.rsvp-gauche .deco { width: 150px; margin: 26px auto 0; opacity: .9; }
.rsvp-droite { background: var(--papier); display: flex; align-items: center; justify-content: center; padding: calc(var(--entete-h) + 30px) clamp(20px, 5vw, 80px) 60px; }
.formulaire { width: 100%; max-width: 460px; }
.formulaire label { display: block; font-size: 12px; letter-spacing: 1px; color: var(--encre); font-weight: 500; margin-bottom: 18px; }
.requis { color: var(--rouge); }
.facultatif { color: var(--doux); font-weight: 300; }
.formulaire input, .formulaire textarea {
  display: block; width: 100%; margin-top: 6px;
  font: 400 15px var(--sans); color: var(--encre);
  padding: 13px 0; border: 0; border-bottom: 1px solid var(--filet); border-radius: 0; background: transparent;
  transition: border-color .2s;
}
.formulaire textarea { resize: vertical; }
.formulaire input:focus, .formulaire textarea:focus { outline: none; border-bottom-color: var(--or); box-shadow: 0 1px 0 var(--or); }
.erreur { color: var(--rouge); font-size: 13px; margin: 0 0 6px; }
.consigne { text-align: center; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--doux); margin: 14px 0; }
/* Honeypot anti-spam : hors champ visuel mais présent dans le DOM */
.rsvp-hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; opacity: 0; }

/* ---------- Pied de page ---------- */
.pied { text-align: center; padding: 80px 16px 60px; background: var(--ivoire) var(--motif-cle); }
.bienvenue { font-family: var(--capitale); letter-spacing: 6px; text-transform: uppercase; font-size: 15px; color: var(--encre); margin-bottom: 0; }
.prenoms-pied { font-size: 56px; }
.credits { font-size: 12px; color: var(--doux); margin-top: 18px; }
#btn-espace-maries {
  margin-top: 6px; background: none; border: 1px solid var(--filet); border-radius: 40px;
  color: var(--doux); padding: 8px 18px; font: 500 10px var(--sans); letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer; transition: color .2s, border-color .2s;
}
#btn-espace-maries:hover { color: var(--brun); border-color: var(--or); }

/* ---------- Modale de confirmation ---------- */
.modale { position: fixed; inset: 0; z-index: 10001; background: rgba(28,23,18,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modale[hidden] { display: none; }
.modale-carte { background: var(--papier); border-radius: 8px; padding: 36px 30px 30px; max-width: 380px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: monter .35s ease; }
.modale-carte h3 { font-family: var(--capitale); font-size: 24px; margin: 6px 0 8px; letter-spacing: 2px; }
.coche svg { width: 64px; height: 64px; fill: none; stroke: #3a9b5c; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; margin: 0 auto; display: block; }
.coche path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: tracer .5s .2s forwards; }
@keyframes tracer { to { stroke-dashoffset: 0; } }
@keyframes monter { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Apparition au défilement ---------- */
.a-reveler { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.a-reveler.revele { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .a-reveler { opacity: 1; transform: none; transition: none; }
  .defiler span { animation: none; }
}

/* ---------- Espace Mariés ---------- */
#em-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 10000; align-items: center; justify-content: center; padding: 16px; }
#em-overlay.open { display: flex; }
#em-card { background: #fff; border-radius: 10px; padding: 36px 28px 28px; width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; position: relative; box-shadow: 0 12px 50px rgba(0,0,0,.3); }
#em-card h3 { font-family: var(--capitale); color: var(--brun); font-size: 22px; text-align: center; margin-bottom: 4px; letter-spacing: 2px; }
.em-sub { text-align: center; color: var(--doux); font-size: 13px; margin-bottom: 22px; }
#em-close { position: absolute; top: 12px; right: 16px; font-size: 20px; background: none; border: 0; cursor: pointer; color: #aaa; }
#em-login { text-align: center; }
#em-pwd-input { width: 100%; padding: 11px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 15px; margin-bottom: 14px; }
#em-pwd-input:focus { outline: none; border-color: var(--or); }
#em-pwd-btn, .em-actions button { background: var(--brun); color: #fff; border: 0; border-radius: 6px; padding: 10px 26px; font-size: 14px; cursor: pointer; }
#em-pwd-error { color: var(--rouge); font-size: 13px; margin-top: 8px; display: none; }
#em-panel { display: none; }
.em-stats { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.em-stat-box { flex: 1; min-width: 90px; background: var(--ivoire); border: 1px solid var(--filet); border-radius: 8px; padding: 12px 10px; text-align: center; }
.stat-num { display: block; font-size: 28px; font-weight: 600; color: var(--brun); line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--doux); text-transform: uppercase; letter-spacing: .5px; }
.em-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--or); border-bottom: 1px solid var(--filet); padding-bottom: 6px; margin: 16px 0 12px; font-weight: 600; }
.em-guest-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.em-guest-table th { background: var(--ivoire); color: var(--brun); padding: 8px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--filet); }
.em-guest-table td { padding: 8px; border-bottom: 1px solid #f0e8e2; vertical-align: top; }
.em-guest-table small { color: var(--doux); }
.em-voeux { color: #666; font-size: 12px; }
.em-date { color: #aaa; font-size: 11px; white-space: nowrap; }
.badge-oui, .badge-non { border-radius: 12px; padding: 2px 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-oui { background: #d4edda; color: #155724; }
.badge-non { background: #f8d7da; color: #721c24; }
.em-empty { text-align: center; color: #aaa; padding: 30px 0; font-style: italic; }
.em-actions { text-align: center; margin-top: 20px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.em-actions .contour { background: none; border: 1px solid var(--brun); color: var(--brun); }

/* Chiffres alignés (Cormorant utilise par défaut des chiffres elzéviriens) */
.frise time, .date-ligne .num, .compte b, .stat-num { font-variant-numeric: lining-nums; }

/* ---------- Tablette ---------- */
@media (max-width: 1024px) {
  .menu { gap: 18px; }
  .dress-grille { grid-template-columns: 1fr 1fr; }
  .dress-grille .illustration-dress { grid-row: span 2; order: 2; }
  .dress-col:last-child { order: 3; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  :root { --entete-h: 60px; }
  .burger { display: block; }
  .entete { background: rgba(255, 253, 249, .95); height: var(--entete-h); }
  .entete.defile { height: var(--entete-h); }
  .menu {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--papier); box-shadow: 0 12px 24px rgba(0,0,0,.08);
    max-height: 0; overflow: hidden; transition: max-height .35s;
  }
  .menu.ouvert { max-height: 380px; }
  .menu a { padding: 15px; width: 100%; text-align: center; border-top: 1px solid var(--sable); }
  .menu a::after { display: none; }
  .menu .menu-rsvp { border: 0; border-top: 1px solid var(--sable); border-radius: 0; }

  .ecran { padding: calc(var(--entete-h) + 36px) 16px 56px; }
  .cadre { inset: 10px; top: calc(var(--entete-h) + 6px); }
  .accueil-grille, .invitation-grille, .lieu-grille { grid-template-columns: 1fr; gap: 28px; }
  .ecran-accueil { padding-bottom: 90px; }
  .accueil-visuel { order: -1; }
  .illustration-couple { width: min(330px, 86%); max-height: 40svh; }
  .titre-mariage { font-size: clamp(46px, 14vw, 70px); }
  .compte div { min-width: 0; flex: 1; }
  .compte b { font-size: 24px; }
  .boutons .bouton { flex: 1 1 100%; }
  .defiler { bottom: 22px; }

  .invitation-texte { text-align: center; }
  .texte-invitation { margin: 0 auto; }
  .panneau-date { margin-top: 70px; }
  .date-ligne .num { font-size: 60px; }

  .entete-section { flex-direction: column; text-align: center; gap: 8px; margin-bottom: 36px; }
  .deco-petite { width: 86px; }
  .frise svg { width: 40px; height: 40px; }
  .frise li.d svg { margin-right: 18px; }
  .frise li.d div { padding-left: 18px; }
  .frise li.g div { padding-right: 18px; }
  .frise li.g svg { margin-left: 18px; }
  .frise time { font-size: 21px; }
  .frise p { font-size: 10.5px; letter-spacing: .6px; }

  .dress-grille { grid-template-columns: 1fr; text-align: center; }
  .dress-grille .illustration-dress { grid-row: auto; order: 0; width: 240px; margin: 0 auto; max-height: none; }
  .pagne { justify-content: center; }
  .palette { grid-template-columns: repeat(2, 1fr); max-width: 280px; margin: 0 auto 30px; text-align: left; }
  .note-cadeau { border-left: 0; border-top: 2px solid var(--or); padding: 18px 0 0; }

  .lieu-texte { text-align: center; }
  .infos li { text-align: left; }

  .ecran-rsvp { grid-template-columns: 1fr; padding: 0; }
  .prenoms-pied { font-size: 46px; }
  .rsvp-gauche { padding: calc(var(--entete-h) + 30px) 20px 40px; }
  .rsvp-gauche .deco { width: 110px; }
  .rsvp-droite { padding: 40px 20px 56px; }
}

/* ==========================================================
   Ouverture de l'invitation (animation d'entrée)
   Carte fermée par deux volets + ruban noué ; au toucher, le
   nœud tombe, les volets s'ouvrent, les rabats se replient.
   ========================================================== */
body.scelle { overflow: hidden; }
/* l'accueil reste caché derrière la carte, puis apparaît à l'ouverture */
body.scelle .ecran-accueil .a-reveler { opacity: 0; transform: scale(.96); }

.ouverture {
  position: fixed; inset: 0; z-index: 9000;
  perspective: 1800px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ouverture[hidden] { display: none; }
.ouverture.finie { opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s .6s; }

/* --- rabats haut / bas (sous les volets) --- */
.rabat {
  position: absolute; left: 0; right: 0; height: 24%;
  background: var(--papier) var(--motif-cle);
  backface-visibility: hidden;
  transition: transform 1.1s cubic-bezier(.6,.05,.3,1), opacity .5s ease .7s;
  z-index: 1;
}
.rabat::after { content: ""; position: absolute; inset: 12px; border: 1px solid var(--or); opacity: .5; }
.rabat img { position: absolute; left: 50%; width: 120px; transform: translateX(-50%); opacity: .7; }
.rabat-h { top: 0; transform-origin: top center; box-shadow: 0 6px 18px rgba(28,23,18,.12); }
.rabat-h img { bottom: 14px; }
.rabat-b { bottom: 0; transform-origin: bottom center; box-shadow: 0 -6px 18px rgba(28,23,18,.12); }
.rabat-b img { top: 14px; transform: translateX(-50%) rotate(180deg); }

/* --- volets gauche / droit --- */
.volet {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255,255,255,.9), rgba(255,255,255,0) 70%),
    var(--ivoire) var(--motif-cle);
  backface-visibility: hidden;
  transition: transform 1.5s cubic-bezier(.55,.06,.25,1), opacity .4s ease 1.15s;
  z-index: 2;
}
.volet::before { /* double filet doré façon faire-part */
  content: ""; position: absolute; top: 18px; bottom: 18px;
  border: 1px solid var(--or); opacity: .6;
}
.volet::after { /* ombre qui se creuse pendant l'ouverture */
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(28,23,18,.35), rgba(28,23,18,0));
  opacity: 0; transition: opacity 1.5s ease;
}
.volet-g { left: 0; transform-origin: left center; box-shadow: inset -1px 0 0 rgba(90,58,34,.25); }
.volet-d { right: 0; transform-origin: right center; box-shadow: inset 1px 0 0 rgba(90,58,34,.25); }
.volet-g::before { left: 18px; right: 22px; }
.volet-d::before { left: 22px; right: 18px; }
.volet-d::after { background: linear-gradient(270deg, rgba(28,23,18,.35), rgba(28,23,18,0)); }
/* bande de pagne le long de la fente : famille de la mariée à gauche, du marié à droite */
.pagne-bord { position: absolute; top: 0; bottom: 0; width: 12px; background-size: 60px auto; background-repeat: repeat-y; opacity: .9; }
.volet-g .pagne-bord { right: 0; background-image: url(../images/coutumier/pagne-mariee.svg); }
.volet-d .pagne-bord { left: 0; background-image: url(../images/coutumier/pagne-marie.svg); }

/* --- textes sur la carte fermée --- */
.carte-texte {
  position: absolute; left: 0; right: 0; z-index: 4; text-align: center; pointer-events: none;
  transition: opacity .6s ease, transform .8s ease;
}
.carte-haut { top: 15%; }
.carte-bas { bottom: 7%; }
/* cartouche ivoire posé sur la fente, pour que la bande de pagne ne traverse pas le texte */
.carte-haut, .carte-bas {
  left: 50%; right: auto; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 48px);
  padding: 16px clamp(22px, 5vw, 44px) 14px;
  background: var(--papier);
  border: 1px solid var(--or);
  outline: 1px solid var(--filet); outline-offset: -6px;
  box-shadow: 0 4px 18px rgba(28,23,18,.08);
}
.carte-haut small, .carte-bas { font-family: var(--capitale); font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--doux); }
.carte-haut small { display: block; margin-bottom: 6px; }
.carte-noms { font-family: var(--script); font-size: clamp(46px, 9vw, 84px); color: var(--brun); line-height: 1; white-space: nowrap; }
.carte-noms em { font-style: normal; color: var(--or); font-size: .55em; vertical-align: middle; margin: 0 .1em; }
.carte-bas b { display: block; font-family: var(--capitale); font-weight: 400; font-size: 17px; letter-spacing: 6px; color: var(--encre); margin-bottom: 4px; }

/* --- ruban + nœud --- */
.ruban {
  position: absolute; left: 0; right: 0; top: 50%; height: clamp(26px, 3.4vw, 38px); transform: translateY(-50%); z-index: 3;
  background: linear-gradient(180deg, #8a5a1e 0%, var(--or-clair) 30%, var(--or) 55%, #8a5a1e 100%);
  box-shadow: 0 3px 8px rgba(28,23,18,.25);
  transition: transform .9s cubic-bezier(.5,0,.75,0), opacity .6s ease .3s;
}
.ruban::before, .ruban::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--rouille); opacity: .6; }
.ruban::before { top: 5px; } .ruban::after { bottom: 5px; }
.noeud {
  position: absolute; left: 50%; top: 50%; z-index: 5;
  width: clamp(180px, 46vw, 300px); transform: translate(-50%, -46%);
  background: none; border: 0; padding: 0; cursor: pointer;
  transition: transform 1s cubic-bezier(.5,0,.75,0), opacity .6s ease .35s;
  filter: drop-shadow(0 6px 10px rgba(28,23,18,.3));
}
.noeud svg { width: 100%; height: auto; display: block; animation: respirer 2.6s ease-in-out infinite; }
.noeud:focus { outline: none; }
.noeud:focus-visible { outline: 2px dashed var(--or); outline-offset: 8px; border-radius: 12px; }
.indice { /* étiquette sous le nœud (dans le bouton : elle tombe avec lui) */
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 10px;
  white-space: nowrap; padding: 8px 18px; border-radius: 40px;
  background: var(--papier); border: 1px solid var(--or); box-shadow: 0 3px 12px rgba(28,23,18,.1);
  font-family: var(--capitale); font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--brun);
  animation: clignoter 2.2s ease-in-out infinite;
}
@keyframes respirer { 50% { transform: scale(1.04); } }
@keyframes clignoter { 50% { color: rgba(90,58,34,.6); border-color: rgba(185,138,53,.45); } }

/* --- séquence d'ouverture (classes posées par le script) --- */
.ouverture.denoue { cursor: default; }
.ouverture.denoue .noeud { transform: translate(-50%, 70vh) rotate(28deg); opacity: 0; }
.ouverture.denoue .noeud svg { animation: none; }
.ouverture.denoue .ruban { transform: translateY(70vh); opacity: 0; }
.ouverture.denoue .indice { animation: none; }
.ouverture.denoue .carte-texte { opacity: 0; transform: translate(-50%, -10px); }
.ouverture.ouvre .volet-g { transform: rotateY(-88deg); opacity: 0; }
.ouverture.ouvre .volet-d { transform: rotateY(88deg); opacity: 0; }
.ouverture.ouvre .volet::after { opacity: 1; }
.ouverture.replie .rabat-h { transform: rotateX(88deg); opacity: 0; }
.ouverture.replie .rabat-b { transform: rotateX(-88deg); opacity: 0; }

@media (max-width: 600px) {
  .volet::before { top: 12px; bottom: 12px; }
  .volet-g::before { left: 12px; right: 18px; }
  .volet-d::before { left: 18px; right: 12px; }
  .rabat img { width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .noeud svg, .indice { animation: none; }
  .ouverture * { transition-duration: .01s !important; transition-delay: 0s !important; }
  body.scelle .ecran-accueil .a-reveler { transform: none; }
}

/* ---------- Musique de fond : bouton flottant ---------- */
.bouton-musique {
  position: fixed; right: clamp(14px, 3vw, 28px); bottom: clamp(14px, 3vw, 28px); z-index: 9500; /* au-dessus de la carte d'ouverture */
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--papier); border: 1px solid var(--or); color: var(--brun);
  box-shadow: 0 6px 20px rgba(28,23,18,.18); cursor: pointer;
  opacity: 0; transform: scale(.6); pointer-events: none;
  transition: opacity .5s ease, transform .5s ease, background .3s;
}
.bouton-musique.visible { opacity: 1; transform: none; pointer-events: auto; }
.bouton-musique:hover { background: var(--sable); }
.bouton-musique:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; }
.bouton-musique .barres { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.bouton-musique .barres i { width: 3px; height: 6px; background: var(--or); border-radius: 2px; }
.bouton-musique.joue .barres i { animation: egaliseur 1s ease-in-out infinite; }
.bouton-musique.joue .barres i:nth-child(2) { animation-delay: -.3s; }
.bouton-musique.joue .barres i:nth-child(3) { animation-delay: -.6s; }
.bouton-musique.joue .barres i:nth-child(4) { animation-delay: -.15s; }
.bouton-musique .muet { display: none; width: 22px; height: 22px; fill: none; stroke: var(--brun); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bouton-musique:not(.joue) .barres { display: none; }
.bouton-musique:not(.joue) .muet { display: block; }
@keyframes egaliseur { 0%, 100% { height: 5px; } 50% { height: 18px; } }
@media (prefers-reduced-motion: reduce) {
  .bouton-musique.joue .barres i { animation: none; height: 12px; }
}
@media (max-width: 600px) {
  .bouton-musique { width: 44px; height: 44px; }
}

/* crédit de la musique (licence CC BY) */
.credit-musique { font-size: 11px; color: var(--doux); margin: 4px 0 14px; }
.credit-musique a { color: var(--doux); }

/* exposants (2ᵉ…) : sans effet sur la hauteur de ligne */
sup { font-size: .62em; line-height: 0; vertical-align: super; text-transform: lowercase; }
