/* Couleurs : définies dans app/contenu.php (theme) et injectées en variables CSS. */
:root {
  --principale: #7d6b57;
  --fond: #faf6f0;
  --accent: #c8a96a;
  --carton: #f5ecde;        /* papier à lettre cartonné */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .37  0 0 0 0 .28  0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --texte: #3b342d;
  --doux: #8a8178;
  --blanc: #fffdf9;
  --rayon: 14px;
  --ombre: 0 8px 30px rgba(60, 45, 30, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  font-family: "Lato", system-ui, sans-serif;
  font-weight: 300;
  color: var(--texte);
  background: var(--blanc);
  line-height: 1.65;
  font-size: 17px;
}
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; color: var(--principale); line-height: 1.2; }
h1 { font-size: clamp(2.6rem, 8vw, 4.4rem); margin: .2em 0; font-weight: 400; }
h2 { font-size: clamp(2rem, 5vw, 2.8rem); text-align: center; margin: 0 0 1.2em; font-weight: 400; }
h2::after { content: ""; display: block; width: 60px; height: 1px; background: var(--accent); margin: .5em auto 0; }
h3 { font-size: 1.6rem; margin: 0 0 .2em; }
h4 { font-family: "Lato", sans-serif; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--doux); margin: 1.2em 0 .4em; }
a { color: var(--principale); }
img { max-width: 100%; display: block; }
strong { font-weight: 700; }

/* ---------- boutons & champs ---------- */
.bouton, button {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--principale); color: #fff; font: 400 .95rem "Lato", sans-serif;
  letter-spacing: .1em; text-transform: uppercase; padding: .95em 2em; border-radius: 999px;
  transition: transform .15s, box-shadow .15s;
}
.bouton:hover, button:hover { transform: translateY(-1px); box-shadow: var(--ombre); }
.bouton-secondaire { background: transparent; color: var(--principale); border: 1px solid var(--principale); }
.lien-bouton { background: none; color: var(--principale); padding: 0; text-transform: none; letter-spacing: 0; text-decoration: underline; font-size: .9rem; }
.lien-bouton:hover { box-shadow: none; transform: none; }
input, textarea {
  width: 100%; font: inherit; color: inherit; padding: .7em .9em; border: 1px solid #ddd3c6;
  border-radius: 10px; background: #fff; margin-top: .3em;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
input[type=radio], input[type=checkbox] { width: auto; margin: 0 .5em 0 0; accent-color: var(--principale); }
label { display: block; font-size: .95rem; margin-bottom: 1em; }

/* ---------- repères « à compléter » (prototype) ---------- */
.a-completer {
  background: #fff2b8; color: #7a5b00; border: 1px dashed #d9b400; border-radius: 6px;
  padding: 0 .4em; font-size: .85em; font-weight: 400; white-space: nowrap;
}

/* ---------- page du code d'accès ---------- */
.page-code {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 30% 20%, #fff 0, var(--fond) 60%);
}
.carte-code {
  background: #fff; padding: 48px 32px; border-radius: 24px; box-shadow: var(--ombre);
  max-width: 440px; width: 100%; text-align: center; border-top: 4px solid var(--accent);
}
.sur-titre { text-transform: uppercase; letter-spacing: .25em; font-size: .78rem; color: var(--doux); margin: 0; }
.date-code { font-family: "Cormorant Garamond", serif; font-size: 1.4rem; font-style: italic; margin-top: 0; }
.form-code { margin-top: 28px; text-align: left; }
.form-code button { width: 100%; margin-top: .5em; }
.erreur { color: #a3362a; font-size: .95rem; }
.aide-code { font-size: .85rem; color: var(--doux); margin: .4em 0 1em; }
.form-message { margin-top: 36px; padding-top: 24px; border-top: 1px solid rgba(184, 149, 90, .4); }
.form-message h2 { font-size: 1.5rem; margin: 0 0 .4em; text-align: center; }
.form-message .aide-code { margin: 0 0 1.2em; text-align: center; }
.carte-code .confirmation { margin: 28px 0 0; }

/* ---------- menu ---------- */
.menu {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: rgba(255, 253, 249, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid #efe7dc;
}
.menu-marque { display: block; width: 56px; height: 56px; text-decoration: none; }

/* ---------- monogramme (initiales entrelacées) ---------- */
.monogramme { width: 100%; height: 100%; display: block; overflow: visible; }
.monogramme text { font-family: "Great Vibes", "Cormorant Garamond", cursive; font-size: 46px; font-weight: 400; }
.mono-cercle { fill: none; stroke: var(--accent); stroke-width: 1.2; }
.mono-cercle-fin { stroke-width: .5; }
.mono-l1 { fill: #5e4f3f; }   /* première initiale (T) : brun foncé */
.mono-l2 { fill: #c4a46a; }   /* seconde initiale (B) : doré clair */
/* liseré couleur du fond autour de la lettre du dessus : crée l'effet d'entrelacement */
.mono-halo { stroke: var(--blanc); stroke-width: 2.2px; paint-order: stroke fill; stroke-linejoin: round; }
.logo-code { width: 120px; height: 120px; margin: 0 auto 14px; }
.logo-code .mono-halo { stroke: #fff; }
.menu ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.menu ul a { text-decoration: none; font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: var(--texte); }
.menu ul a:hover { color: var(--principale); }
.menu-bouton { display: none; background: none; color: var(--principale); font-size: 1.6rem; padding: 0 .3em; }

/* ---------- fond du site : photo fixe derrière toutes les sections ---------- */
html { background: var(--fond); }
body { background: transparent; }
.fond-site {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: center / cover no-repeat;
}
/* voile léger pour garder le texte lisible sur n'importe quelle photo */
.fond-site::after { content: ""; position: absolute; inset: 0; background: rgba(250, 246, 240, .18); }
/* en attendant la photo : dégradé nude et doré */
.fond-attente {
  background:
    radial-gradient(ellipse at 18% 12%, rgba(255,255,255,.9), transparent 50%),
    radial-gradient(ellipse at 85% 85%, rgba(200,169,106,.2), transparent 55%),
    linear-gradient(160deg, #f6efe5 0%, #ece1d1 55%, #dfd0bb 100%);
}

/* ---------- papier à lettre cartonné, gaufré à sec ---------- */
/* Le relief (papier-gaufre.svg) n'a pas de couleur propre : il se pose sur le ton du carton. */
.carton, .section {
  position: relative; border-radius: 3px;
  background:
    url("../img/ornement-coin.svg") 16px 16px / var(--coin, 96px) no-repeat,
    url("../img/ornement-coin-bd.svg") right 16px bottom 16px / var(--coin, 96px) no-repeat,
    var(--grain) 0 0 / 180px,
    url("../img/papier-gaufre.svg") 0 0 / 360px,
    linear-gradient(155deg, rgba(255,255,255,.45), rgba(255,255,255,0) 45%, rgba(120,90,50,.06)),
    var(--carton);
  /* tranche du carton : quelques liserés superposés + ombre portée */
  box-shadow: 0 1px 0 #e7dbc8, 0 2px 0 #ddceb7, 0 3px 0 #d4c3a9, 0 22px 44px rgba(70, 50, 30, .17);
}
/* double filet doré à l'intérieur de la carte */
.carton::before, .section::before {
  content: ""; position: absolute; inset: 14px; pointer-events: none;
  border: 1px solid rgba(184, 149, 90, .55);
  box-shadow: inset 0 0 0 3px var(--carton), inset 0 0 0 4px rgba(184, 149, 90, .3);
}

/* ---------- accueil : bienvenue au premier écran ---------- */
.accueil { min-height: calc(100svh - 77px); display: grid; place-items: center; align-content: center; gap: 18px; padding: 48px 20px 64px; text-align: center; }
.accueil-bienvenue { max-width: 680px; padding: 58px 60px 50px; }
.accueil-logo { width: 76px; height: 76px; margin: 0 auto 12px; }
.accueil-logo .mono-halo { stroke: var(--carton); }
.accueil-bienvenue .sur-titre { letter-spacing: .2em; line-height: 1.9; }
.noms { font-family: "Great Vibes", "Cormorant Garamond", cursive; font-weight: 400; font-size: clamp(3.1rem, 11vw, 5.4rem); margin: .12em 0 .05em; color: #5e4f3f; }
.esperluette { color: var(--accent); font-size: .8em; }
.repere-fond { margin: 0; font-size: .85rem; }
.accueil-suite { text-align: center; }
.photo-maries { margin: 14px auto 44px; width: min(280px, 68vw); }
.photo-maries img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 200px 200px 6px 6px;
  border: 8px solid #fbf6ec; outline: 1px solid rgba(184, 149, 90, .6); outline-offset: 5px;
  box-shadow: 0 16px 40px rgba(80, 60, 40, .16);
}
.date-grande { font-family: "Cormorant Garamond", serif; font-size: 1.7rem; font-style: italic; margin: 0; }
.intro { font-size: 1.08rem; max-width: 620px; margin-left: auto; margin-right: auto; }
.theme { color: var(--doux); font-size: .95rem; }
.compte-a-rebours { display: flex; justify-content: center; gap: 14px; margin: .8em 0 2em; }
.compte-a-rebours div { text-align: center; min-width: 76px; padding: 12px 6px 10px; border: 1px solid rgba(184, 149, 90, .4); border-radius: 3px; box-shadow: 0 1px 0 #e1d3bd, 0 6px 14px rgba(70, 50, 30, .08); }
.compte-a-rebours b { display: block; font-family: "Cormorant Garamond", serif; font-size: 2.3rem; color: var(--principale); font-weight: 600; line-height: 1; }
.compte-a-rebours span { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--doux); }
.appel-reponse { margin: 34px 0 0; }

/* apparition progressive de l'accueil après l'ouverture de la lettre */
.avec-enveloppe .revele { opacity: 0; transform: translateY(24px); filter: blur(6px); }
.avec-enveloppe.revelation .revele { opacity: 1; transform: none; filter: none; transition: opacity 1.5s ease, transform 1.5s ease, filter 1.5s ease; }
.avec-enveloppe.revelation body { overflow: auto; }
.avec-enveloppe.revelation .accueil-suite .revele:nth-child(1) { transition-delay: .6s; }
.avec-enveloppe.revelation .accueil-suite .revele:nth-child(2) { transition-delay: 1s; }
.avec-enveloppe.revelation .accueil-suite .revele:nth-child(3) { transition-delay: 1.3s; }
/* l'invitation émerge de la lumière : léger recul de l'accueil vers sa taille réelle */
.avec-enveloppe .accueil { transform: scale(1.06); }
.avec-enveloppe.revelation .accueil { transform: none; transition: transform 2.4s cubic-bezier(.2, .7, .2, 1); }

/* ---------- ouverture : enveloppe beige gaufrée et dorée (papier du site), scellée d'un cachet ivoire ----------
   Couches réelles (intérieur beige, pénombre, source de lumière, 4 rabats à deux faces, ombres portées,
   cachet) ; elle s'ouvre quand on touche le cachet, tous les mouvements suivent une timeline GSAP (site.js). */
.enveloppe-scene { display: none; }
.avec-enveloppe body, html.avec-enveloppe:not(.revelation) { overflow: hidden; }
.avec-enveloppe .enveloppe-scene {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  overflow: hidden; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(ellipse at 50% 50%, #f3ebde 0%, #e4d6c1 60%, #cfbfa6 100%);
}
.scene-fin { opacity: 0; transition: opacity .9s ease; pointer-events: none; }
.scene-transparente { background: none !important; }
.scene-transparente .env-camera, .scene-transparente .env-consigne { display: none; }

.env-consigne {
  position: absolute; left: 0; right: 0; bottom: max(11svh, 70px); margin: 0; z-index: 25; text-align: center; pointer-events: none;
  font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 1.05rem; letter-spacing: .06em;
  color: #5e4f3f; font-weight: 600; text-shadow: 0 0 6px rgba(255, 252, 245, .95), 0 0 14px rgba(255, 252, 245, .8);
}
.env-passer {
  position: absolute; bottom: max(3.5svh, 18px); left: 50%; transform: translateX(-50%); z-index: 40;
  background: rgba(255, 250, 242, .65); color: var(--principale); font-size: .64rem; letter-spacing: .2em; text-transform: uppercase;
  padding: .7em 1.3em; border: 1px solid rgba(125, 107, 87, .35); border-radius: 30px;
}
.env-passer:hover, .env-passer:focus-visible { transform: translateX(-50%); box-shadow: none; color: #5e4f3f; border-color: rgba(125, 107, 87, .7); }

/* voile clair de la fin abrégée (« Passer », Échap) */
.env-eclat {
  position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fffdf6 0%, #fdf0d6 45%, #f4dcb0 100%);
}

/* caméra : l'enveloppe se pose dans la pénombre avant le clic */
.env-camera { position: relative; z-index: 2; will-change: transform; }
/* ordinateur : grande enveloppe verticale au centre de l'écran */
.enveloppe4 {
  position: relative; height: min(92vh, 1100px); aspect-ratio: .64; perspective: 1300px;
  --cote: 300px; --vague: 0;
}
/* téléphone / tablette en portrait : l'enveloppe occupe tout l'écran */
@media (max-aspect-ratio: 1/1) {
  .enveloppe4 { width: 100vw; height: 100vh; aspect-ratio: auto; perspective: 900px; --cote: 220px; }
  @supports (height: 1svh) { .enveloppe4 { height: 100svh; } }
}
.enveloppe4 > * { position: absolute; }

.env-sol { inset: 2% 1% -2%; z-index: 0; background: rgba(0, 0, 0, .8); border-radius: 6px; filter: blur(24px); }
/* intérieur de l'enveloppe : papier beige */
.env-dos {
  inset: 0; z-index: 1;
  background: url("../img/interieur-beige.jpg") center / var(--cote);
  box-shadow: inset 0 0 50px rgba(50, 36, 22, .45), inset 0 0 0 1px rgba(70, 52, 32, .4);
}
/* pénombre de l'enveloppe fermée, dissipée par la lumière */
.env-penombre { inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(120, 95, 65, .3) 0%, rgba(90, 70, 45, .55) 100%); }
/* lumière née au cœur de l'enveloppe (sous les rabats : elle ne passe d'abord que par les interstices) */
.env-source {
  left: 50%; top: 50%; width: 60vmin; aspect-ratio: 1; z-index: 3; margin: -30vmin 0 0 -30vmin; opacity: 0; border-radius: 50%;
  pointer-events: none; mix-blend-mode: screen; will-change: transform, opacity;
  background: radial-gradient(circle, #ffffff 0%, #fff7e2 16%, rgba(255, 226, 168, .9) 34%, rgba(255, 196, 120, .45) 54%, rgba(255, 170, 90, 0) 72%);
}
/* fente de lumière qui jaillit entre les rabats latéraux quand ils s'entrouvrent (sous eux, sur le rabat bas) */
.env-fente {
  left: 30%; width: 40%; top: 28%; height: 44%; z-index: 6; opacity: 0; pointer-events: none; mix-blend-mode: screen; will-change: transform, opacity;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, #ffffff 0%, #fff4d6 16%, rgba(255, 214, 150, .8) 36%, rgba(255, 176, 96, .25) 58%, rgba(255, 160, 80, 0) 72%);
}
/* rabats : boîte = toute l'enveloppe, forme découpée (clip-path), charnière sur le bord extérieur */
.rabat { inset: 0; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; will-change: transform; pointer-events: none; }
.rabat-bas { z-index: 5; transform-origin: 50% 100%; }
.rabat-gauche { z-index: 7; transform-origin: 0 50%; }
.rabat-droit { z-index: 7; transform-origin: 100% 50%; }
.rabat-haut { z-index: 9; transform-origin: 50% 0; }
.rabat-ombre { inset: 0; pointer-events: none; filter: blur(7px); opacity: .4; will-change: transform, opacity; }
.rabat-ombre > div { position: absolute; inset: 0; background: #3d2f20; }
.rabat-ombre-bas { z-index: 4; opacity: 0; }
.rabat-ombre-gauche { z-index: 6; transform: translate(6px, 2px); }
.rabat-ombre-droit { z-index: 6; transform: translate(-6px, 2px); }
.rabat-ombre-haut { z-index: 8; transform: translate(0, 8px); }

.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face > * { position: absolute; inset: 0; }
/* faces extérieures : papier marron mat ; pivoines gaufrées sur les côtés, brins feuillus en bas */
.face-avant .papier { background-color: #f2e8d8; }
.rabat-haut .face-avant .papier {
  background-image: linear-gradient(180deg, rgba(255, 252, 244, .25) 0%, rgba(90, 65, 40, 0) 40%, rgba(90, 65, 40, .16) 100%), url("../img/volute-haut.webp"), url("../img/papier-brun.jpg");
  background-size: auto, 46% auto, var(--cote); background-position: 0 0, 50% 26%, 0 0; background-repeat: no-repeat, no-repeat, repeat;
}
.rabat-gauche .face-avant .papier {
  background-image: linear-gradient(90deg, rgba(90, 65, 40, .18) 0%, rgba(90, 65, 40, 0) 35%, rgba(255, 252, 244, .15) 100%), url("../img/rabat-gauche.jpg"), url("../img/papier-brun.jpg");
  background-size: auto, auto 100%, var(--cote); background-position: 0 0, left center, 0 0; background-repeat: no-repeat, no-repeat, repeat;
  filter: brightness(.97);
}
.rabat-droit .face-avant .papier {
  background-image: linear-gradient(270deg, rgba(90, 65, 40, .2) 0%, rgba(90, 65, 40, 0) 35%, rgba(255, 252, 244, .12) 100%), url("../img/rabat-droit.jpg"), url("../img/papier-brun.jpg");
  background-size: auto, auto 100%, var(--cote); background-position: 0 0, right center, 0 0; background-repeat: no-repeat, no-repeat, repeat;
  filter: brightness(.94);
}
.rabat-bas .face-avant .papier {
  background-image: linear-gradient(0deg, rgba(90, 65, 40, .16) 0%, rgba(90, 65, 40, 0) 40%, rgba(255, 252, 244, .18) 100%), url("../img/volute-bas.webp"), url("../img/rabat-bas.jpg"), url("../img/papier-brun.jpg");
  background-size: auto, 46% auto, 100% auto, var(--cote); background-position: 0 0, 50% 76%, center bottom, 0 0; background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  filter: brightness(.97);
}
.ombrage { background: #090705; opacity: 0; }
.face-arriere .ombrage { opacity: .6; }   /* doublure dans l'ombre tant que la lumière ne l'atteint pas */
/* dorure du gaufrage, révélée par une vague de lumière partie du cachet (--vague : rayon en % animé par GSAP) */
.vague {
  opacity: 0; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle farthest-corner at 50% 50%, rgba(0, 0, 0, .6) calc(var(--vague) * 1% - 30%), #000 calc(var(--vague) * 1% - 8%), transparent calc(var(--vague) * 1%));
  mask-image: radial-gradient(circle farthest-corner at 50% 50%, rgba(0, 0, 0, .6) calc(var(--vague) * 1% - 30%), #000 calc(var(--vague) * 1% - 8%), transparent calc(var(--vague) * 1%));
}
.rabat-haut .dorure { background: url("../img/volute-haut-or.webp") 50% 26% / 46% auto no-repeat; }
.rabat-gauche .dorure { background: url("../img/dorure-gauche.webp") left center / auto 100% no-repeat; }
.rabat-droit .dorure { background: url("../img/dorure-droit.webp") right center / auto 100% no-repeat; }
.rabat-bas .dorure { background: url("../img/volute-bas-or.webp") 50% 76% / 46% auto no-repeat, url("../img/dorure-bas.webp") center bottom / 100% auto no-repeat; }
.bord-or-halo { stroke: rgba(255, 196, 110, .35); stroke-width: 9; }
.bord-or { stroke: #ffe6b0; stroke-width: 1.8; }
/* faces intérieures : doublure beige, retournées de 180° (formes en miroir calculées en PHP) */
.rabat-haut .face-arriere, .rabat-bas .face-arriere { transform: rotateX(180deg); }
.rabat-gauche .face-arriere, .rabat-droit .face-arriere { transform: rotateY(180deg); }
.face-arriere .papier {
  background:
    linear-gradient(var(--vers-charniere), rgba(0, 0, 0, 0) 20%, rgba(60, 30, 10, .4) 100%),
    url("../img/interieur-beige.jpg") center / var(--cote);
}
/* lumière intérieure reçue par la doublure, plus forte près de la charnière (au plus près de la source) */
.eclairage { opacity: 0; mix-blend-mode: screen; background: linear-gradient(var(--vers-charniere), rgba(255, 238, 200, 0) 15%, rgba(255, 226, 170, .55) 70%, rgba(255, 246, 220, .95) 100%); }
.rabat-haut { --vers-charniere: to bottom; }
.rabat-bas { --vers-charniere: to top; }
.rabat-gauche { --vers-charniere: to right; }
.rabat-droit { --vers-charniere: to left; }
/* tranches du papier : liseré clair, et liseré de lumière qui s'allume à l'ouverture */
.bord { width: 100%; height: 100%; overflow: visible; }
.bord polyline { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.bord-arete { stroke: rgba(184, 149, 90, .6); stroke-width: 1.1; }
.lueur { opacity: 0; }
.bord-halo { stroke: rgba(255, 210, 140, .3); stroke-width: 10; }
.bord-lumiere { stroke: #fff3d6; stroke-width: 1.6; }

/* cachet de cire ivoire, posé au point de rencontre des quatre rabats */
.cachet, .cachet:hover {
  position: absolute; left: 50%; top: 50%; width: min(30%, 34vh); aspect-ratio: 1; padding: 0; margin: 0; z-index: 12;
  background: none; border: 0; border-radius: 50%; box-shadow: none; cursor: pointer; transform: translate(-50%, -50%);
}
@media (max-aspect-ratio: 1/1) { .cachet, .cachet:hover { width: min(42vw, 24vh); } }
.cachet:focus { outline: none; }
.cachet:focus-visible .cachet-svg { outline: 1px solid #f1dcc0; outline-offset: 6px; border-radius: 50%; }
.cachet-svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* auréole dorée du cachet (elle pulse doucement tant qu'on n'a pas ouvert) */
.cachet-halo {
  left: 50%; top: 50%; width: min(64%, 70vh); aspect-ratio: 1; z-index: 11; opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%); border-radius: 50%; will-change: opacity, transform;
  background: radial-gradient(circle, rgba(255, 232, 170, .95) 0%, rgba(255, 206, 120, .55) 22%, rgba(240, 170, 90, .18) 44%, rgba(200, 120, 60, 0) 66%);
}
@media (max-aspect-ratio: 1/1) { .cachet-halo { width: min(96vw, 56vh); } }
.cachet-lettres text, .cachet-contour text { font-family: "Great Vibes", cursive; font-size: 44px; }
.cl-ombre { fill: #8a7350; opacity: .45; }
.cl-reflet { fill: #ffffff; opacity: .95; }
.cl-base { fill: #d8c092; }
/* lumière qui glisse le long des contours des initiales (traits courts, dashoffset animé) */
.cc-trait { fill: none; stroke: #fff4c8; stroke-width: 1; stroke-linecap: round; stroke-dasharray: 9 55; opacity: 0; }
.faisceau { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .avec-enveloppe.revelation .revele { transition-duration: .5s; transition-delay: 0s !important; }
}

/* ---------- sections ---------- */
/* ---------- sections : cartes de papier cartonné posées sur la photo de fond ---------- */
.section { max-width: 1060px; margin: 70px auto; padding: 86px 66px; }
.section-claire { --carton: #f1e6d4; }
.section-claire > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.centre { text-align: center; }
.texte-large { font-size: 1.12rem; max-width: 700px !important; }

.evenements { display: grid; grid-template-columns: 1fr; gap: 28px; }
.evenement {
  background: #fff; border-radius: var(--rayon); padding: 28px; box-shadow: var(--ombre);
  border-top: 3px solid var(--accent);
}
.sous-titre { color: var(--doux); font-style: italic; margin: 0 0 .8em; min-height: 1.6em; }
.quand { font-weight: 700; color: var(--principale); }
.lieu { margin-bottom: .6em; }
.carte { border-radius: 10px; overflow: hidden; aspect-ratio: 16/10; background: var(--fond); }
.carte iframe { border: 0; width: 100%; height: 100%; }
.lien-carte { font-size: .9rem; }
dl { display: grid; grid-template-columns: auto 1fr; gap: .4em 1em; margin: 1.2em 0 0; font-size: .95rem; }
dt { color: var(--doux); }
dd { margin: 0; }
.parkings ul { padding-left: 1.1em; font-size: .93rem; }
.deroule { list-style: none; padding: 0; margin: 1em 0; border-left: 1px solid var(--accent); }
.deroule li { padding: .3em 0 .3em 1.2em; position: relative; }
.deroule li::before { content: ""; position: absolute; left: -5px; top: .85em; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.deroule .heure { font-weight: 700; color: var(--principale); margin-right: .4em; }

/* cadres cliquables du programme */
.consigne { color: var(--doux); font-style: italic; margin-top: -1.2em; }
.cadres-programme { display: grid; gap: 18px; max-width: 760px; margin: 0 auto 28px; }
.cadre-evt {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; width: 100%;
  text-align: left; background: #fff; color: var(--texte); text-transform: none; letter-spacing: 0;
  border-radius: var(--rayon); border: 1px solid #eadfce; border-left: 4px solid var(--accent);
  padding: 22px 26px; box-shadow: var(--ombre); font: inherit;
}
.cadre-evt:hover, .cadre-evt[aria-expanded="true"] { border-color: var(--accent); }
.cadre-titre { font-family: "Cormorant Garamond", serif; font-size: 1.75rem; color: var(--principale); line-height: 1.2; }
.cadre-date { grid-column: 1; font-style: italic; color: var(--doux); font-size: .98rem; }
.cadre-fleche { grid-column: 2; grid-row: 1 / span 2; width: 14px; height: 14px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); transition: transform .2s; margin: 0 6px 6px 0; }
.cadre-evt[aria-expanded="true"] .cadre-fleche { transform: rotate(-135deg); margin: 6px 6px 0 0; }
.detail-evt { position: relative; scroll-margin-top: 80px; }
.detail-evt[hidden] { display: none; }
/* accordéon : chaque détail s'ouvre juste sous son cadre et pousse le suivant vers le bas */
.accordeon { max-width: 1000px; margin: 0 auto; display: grid; gap: 18px; }
.accordeon .cadre-evt { position: relative; z-index: 1; scroll-margin-top: 80px; }
.accordeon .cadre-evt[aria-expanded="true"] { border-radius: var(--rayon) var(--rayon) 0 0; box-shadow: none; }
.accordeon .detail-evt { border: 1px solid #eadfce; border-left: 4px solid var(--accent); border-top: 0; border-radius: 0 0 var(--rayon) var(--rayon); margin-top: -1px; }
.fermer-detail { grid-column: 1 / -1; justify-self: center; background: transparent; color: var(--principale); border: 1px solid var(--principale); padding: .7em 2em; }
dl.essentiel { margin-top: .4em; }
dl.essentiel dd { font-weight: 400; }
.transports ul, .hotels-proches ul { padding-left: 1.1em; font-size: .95rem; }
.transports li, .hotels-proches li { margin-bottom: .55em; }
.hotels-proches { margin-top: 1.2em; }

/* blocs larges : informations à gauche, carte / détails à droite */
.evenement-large { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; padding: 36px; }
.evenement-large h3 { font-size: 2rem; }
.evenement-carte .lieu { margin-top: 0; }
.deroule-journee { border-left: 2px solid var(--accent); margin: .4em 0 0 .5em; }
.deroule-journee li { display: grid; grid-template-columns: 5.2em 1fr; gap: 0 .8em; padding: .55em 0 .55em 1.4em; }
.deroule-journee li::before { left: -6px; top: 1.05em; width: 10px; height: 10px; box-shadow: 0 0 0 4px #fff; }
.deroule-journee .heure { font-family: "Cormorant Garamond", serif; font-size: 1.6rem; line-height: 1.1; margin: 0; white-space: nowrap; }
.deroule-journee .etape strong { font-weight: 700; }
.deroule-journee .etape em { color: var(--doux); font-size: .95rem; }

/* ---------- formulaires ---------- */
.formulaire { max-width: 760px !important; background: #fff; padding: 36px; border-radius: var(--rayon); box-shadow: var(--ombre); }
.formulaire-court { margin-top: 1em; }
fieldset { border: 0; border-top: 1px solid #efe7dc; margin: 0 0 1.2em; padding: 1.2em 0 0; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { font-family: "Cormorant Garamond", serif; font-size: 1.45rem; color: var(--principale); padding: 0; margin-bottom: .4em; }
.ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.choix { display: flex; align-items: center; margin-bottom: .6em; cursor: pointer; }
.enfant { display: grid; grid-template-columns: 2fr 1fr; gap: 0 18px; padding: 12px 14px 0; margin-bottom: 12px; background: var(--fond); border-radius: 10px; }
.enfant-titre { grid-column: 1 / -1; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--doux); }
.piege { position: absolute; left: -9999px; }
.mentions { font-size: .85rem; color: var(--doux); }
.confirmation { max-width: 760px; margin: 0 auto 24px; padding: 16px 20px; background: #e9f3e6; color: #2f5a27; border-radius: 10px; text-align: center; }
#si-present[hidden] { display: none; }

/* ---------- cartes hôtels / contacts ---------- */
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.petite-carte { background: #fff; border-radius: var(--rayon); padding: 24px; box-shadow: var(--ombre); }
.petite-carte p { margin: .3em 0; }
.tarif { color: var(--principale); font-weight: 700; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin: 0 auto 40px; }
details { border-bottom: 1px solid #efe7dc; padding: 14px 0; }
summary { cursor: pointer; font-weight: 400; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; }
summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin: .6em 0 0; color: #5b534b; }

/* ---------- pied ---------- */
.pied { text-align: center; padding: 40px 20px; color: var(--doux); font-size: .9rem; border-top: 1px solid #efe7dc; }

/* ---------- espace mariés ---------- */
.admin { background: var(--fond); padding: 24px; }
.admin-entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; max-width: 1300px; margin: 0 auto 20px; }
.admin-entete h1 { font-size: 2rem; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; max-width: 1300px; margin: 0 auto 24px; }
.tuile { background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--ombre); font-size: .85rem; color: var(--doux); }
.tuile .nombre { display: block; font-family: "Cormorant Garamond", serif; font-size: 2.3rem; color: var(--principale); line-height: 1.1; }
.admin-bloc { background: #fff; border-radius: var(--rayon); padding: 24px; box-shadow: var(--ombre); max-width: 1300px; margin: 0 auto 24px; }
.admin-bloc h2 { text-align: left; font-size: 1.7rem; margin-bottom: .6em; }
.admin-bloc h2::after { margin-left: 0; }
.admin-export { margin: 0 0 1em; }
.recherche-tableau { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 .8em; }
.recherche-tableau label { display: flex; align-items: center; gap: .6em; margin: 0; }
.recherche-tableau input { width: min(320px, 70vw); }
.recherche-tableau small { color: var(--doux); }
th[data-tri-colonne] { cursor: pointer; user-select: none; white-space: nowrap; }
th[data-tri-colonne]:hover { color: var(--principale); }
th[data-tri-colonne]::after { content: " ↕"; opacity: .35; }
th[aria-sort="ascending"]::after { content: " ▲"; opacity: 1; }
th[aria-sort="descending"]::after { content: " ▼"; opacity: 1; }
.tableau-defilant { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid #efe7dc; text-align: left; vertical-align: top; }
th { font-weight: 700; color: var(--doux); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
tr.absent td { color: #a9a097; }
.questions { list-style: none; padding: 0; }
.questions li { padding: 12px 0; border-bottom: 1px solid #efe7dc; }
.questions li.traitee { opacity: .5; }
.questions p { margin: .3em 0; }
blockquote { margin: 0 0 16px; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--fond); border-radius: 0 10px 10px 0; font-style: italic; }
blockquote footer { font-style: normal; color: var(--doux); font-size: .9rem; margin-top: .3em; }
.zone-danger { border: 1px solid #e8c3bd; }
.zone-danger label { max-width: 320px; }
.zone-danger button { background: #a3362a; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .evenements { grid-template-columns: 1fr; }
  .evenement-large { grid-template-columns: 1fr; gap: 20px; padding: 26px; }
  .cadre-titre { font-size: 1.5rem; }
  .cadre-evt { padding: 18px 20px; }
  .menu-bouton { display: block; }
  .menu ul { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--blanc); border-bottom: 1px solid #efe7dc; }
  .menu ul.ouvert { display: flex; }
  .menu ul a { display: block; padding: 14px 20px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .section { padding: 56px 16px; }
  .formulaire { padding: 22px 16px; }
  .ligne, .enfant { grid-template-columns: 1fr; }
  .compte-a-rebours { gap: 8px; }
  .compte-a-rebours div { min-width: 62px; }
  .compte-a-rebours b { font-size: 1.8rem; }
  .accueil-bienvenue { padding: 48px 26px 40px; }
  .section { margin: 46px 10px; padding: 66px 22px; }
  .carton, .section { --coin: 62px; }
  .carton::before, .section::before { inset: 9px; }
  .accueil-bienvenue .sur-titre { font-size: .72rem; letter-spacing: .14em; }
}

a[href^="tel:"] { white-space: nowrap; }

/* ---------- détails XVIIIe : filets et ornements dorés ---------- */
h2::after { width: 240px; height: 30px; background: url("../img/ornement-titre.svg") center / contain no-repeat; margin: .3em auto 0; }
.menu { border-bottom: 1px solid rgba(184, 149, 90, .45); box-shadow: 0 1px 0 #e7dbc8, 0 6px 18px rgba(70, 50, 30, .08); }
.cadre-evt { border: 1px solid rgba(184, 149, 90, .4); border-left: 3px solid var(--accent); border-radius: 3px; box-shadow: 0 1px 0 #e1d3bd, 0 10px 24px rgba(70, 50, 30, .1); }
.accordeon .cadre-evt[aria-expanded="true"] { border-radius: 3px 3px 0 0; }
.accordeon .detail-evt { border-color: rgba(184, 149, 90, .4); border-left: 3px solid var(--accent); border-radius: 0 0 3px 3px; }
.petite-carte, .formulaire { border: 1px solid rgba(184, 149, 90, .35); border-radius: 3px; box-shadow: 0 1px 0 #e1d3bd, 0 10px 24px rgba(70, 50, 30, .1); }
input, textarea { background: #fffbf4; border-color: #e2d4bd; }
summary::after { color: var(--accent); }
details { border-bottom-color: rgba(184, 149, 90, .3); }
.pied { border-top: 1px solid rgba(184, 149, 90, .45); margin-top: 70px; }
.page-code { background: radial-gradient(ellipse at 50% 40%, #f8f1e6 0%, #ecdfcb 50%, #d6c3a6 100%); }
.carte-code { border-top: 0; border-radius: 3px; padding: 60px 40px; }
html, body { overflow-x: clip; }
/* éléments posés sur la carte : voile de papier qui laisse voir le gaufrage de la feuille */
.cadre-evt, .accordeon .detail-evt, .petite-carte, .compte-a-rebours div, .formulaire { background: rgba(255, 251, 244, .5); }
/* menu et pied de page : bandeaux de papier indépendants */
.menu, .pied {
  background:
    var(--grain) 0 0 / 180px,
    url("../img/papier-gaufre.svg") 0 0 / 360px,
    linear-gradient(155deg, rgba(255,255,255,.5), rgba(255,255,255,0) 50%),
    var(--carton);
}
.en-ligne { display: inline; }
/* ---------- espace mariés : envoi des invitations ---------- */
.envois { list-style: none; padding: 0; margin: 0; }
.envois li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0; border-bottom: 1px solid #efe7dc; }
.envoi-nom { flex: 1 1 180px; }
.envoi-etat { color: #2f5a27; font-size: .9rem; min-width: 70px; }
.envoi-boutons { display: flex; gap: 8px; }
.envoi-boutons .bouton { padding: .55em 1.1em; margin: 0; }
.envois li.envoyee .envoi-nom { opacity: .55; }
.apercu-message { font-style: normal; white-space: normal; }
/* accueil : nom de l'invité reconnu */
.invite-nom { font-family: "Great Vibes", cursive; font-size: 2rem; color: var(--accent); margin: 0 0 .2em; line-height: 1.2; }

/* ---------- choix de la langue ---------- */
.langues { display: flex; align-items: center; gap: 2px; font-size: .78rem; letter-spacing: .08em; }
.langues a { color: var(--doux); text-decoration: none; padding: .35em .55em; border-radius: 3px; line-height: 1; }
.langues a + a { border-inline-start: 1px solid rgba(184, 149, 90, .45); border-radius: 0; }
.langues a:hover { color: var(--principale); }
.langues a[aria-current] { color: var(--principale); font-weight: 700; }
.langues a[lang="he"] { font-family: "Frank Ruhl Libre", "Assistant", Georgia, serif; letter-spacing: 0; font-size: .95rem; }
/* page d'accès : en haut de l'écran, au-dessus de la carte */
.langues-acces { position: absolute; top: 14px; inset-inline-end: 16px; background: rgba(255, 251, 244, .75); border-radius: 3px; padding: 2px 4px; }
.page-code { position: relative; }
/* menu : logo, liens, langues, bouton du menu mobile */
.menu ul { order: 1; margin-inline-start: auto; }
.langues-menu { order: 2; margin-inline-start: 22px; }
.menu-bouton { order: 3; }
@media (max-width: 900px) {
  .langues-menu { margin-inline-start: auto; margin-inline-end: 6px; }
}

/* ---------- hébreu : polices et lecture de droite à gauche ---------- */
html[lang="he"] body { font-family: "Assistant", "Lato", system-ui, sans-serif; }
html[lang="he"] h1, html[lang="he"] h2, html[lang="he"] h3, html[lang="he"] legend, html[lang="he"] .cadre-titre,
html[lang="he"] .date-grande, html[lang="he"] .date-code, html[lang="he"] .compte-a-rebours b, html[lang="he"] .deroule-journee .heure,
html[lang="he"] .env-consigne, html[lang="he"] .invite-nom { font-family: "Frank Ruhl Libre", Georgia, serif; }
html[lang="he"] .noms { font-family: "Frank Ruhl Libre", Georgia, serif; font-weight: 400; font-size: clamp(2.5rem, 9vw, 4.3rem); }
html[lang="he"] .invite-nom { font-size: 1.7rem; }
html[lang="he"] .date-grande, html[lang="he"] .date-code, html[lang="he"] .env-consigne, html[lang="he"] .consigne,
html[lang="he"] .cadre-date, html[lang="he"] .deroule-journee .etape em, html[lang="he"] blockquote { font-style: normal; }
html[lang="he"] .sur-titre, html[lang="he"] h4, html[lang="he"] .menu ul a, html[lang="he"] button, html[lang="he"] .bouton { letter-spacing: 0; }
html[lang="he"] .menu ul a { font-size: .95rem; }
/* champs téléphone / e-mail : saisis de gauche à droite même en hébreu */
[dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"] { direction: ltr; text-align: right; }
[dir="rtl"] .form-code { text-align: right; }
[dir="rtl"] .cadre-evt { text-align: right; border-left-width: 1px; border-right: 3px solid var(--accent); }
[dir="rtl"] .accordeon .detail-evt { border-left-width: 1px; border-right: 3px solid var(--accent); }
[dir="rtl"] .cadre-fleche { margin: 0 0 6px 6px; }
[dir="rtl"] .cadre-evt[aria-expanded="true"] .cadre-fleche { margin: 6px 0 0 6px; }
[dir="rtl"] .parkings ul, [dir="rtl"] .transports ul, [dir="rtl"] .hotels-proches ul { padding-left: 0; padding-right: 1.1em; }
[dir="rtl"] .deroule { border-left: 0; border-right: 1px solid var(--accent); }
[dir="rtl"] .deroule li { padding: .3em 1.2em .3em 0; }
[dir="rtl"] .deroule li::before { left: auto; right: -5px; }
[dir="rtl"] .deroule .heure { margin-right: 0; margin-left: .4em; }
[dir="rtl"] .deroule-journee { border-right-width: 2px; margin: .4em .5em 0 0; }
[dir="rtl"] .deroule-journee li { padding: .55em 1.4em .55em 0; }
[dir="rtl"] .deroule-journee li::before { right: -6px; }
[dir="rtl"] input[type=radio], [dir="rtl"] input[type=checkbox] { margin: 0 0 0 .5em; }
[dir="rtl"] blockquote { border-left: 0; border-right: 3px solid var(--accent); border-radius: 10px 0 0 10px; }
/* espace mariés : langue de chaque invité et textes du message par langue */
.envoi-langue { display: flex; align-items: center; gap: .5em; margin: 0; font-size: .85rem; color: var(--doux); }
.envoi-langue select { width: auto; padding: .35em .5em; font: inherit; color: var(--texte); background: #fffbf4; border: 1px solid #e2d4bd; border-radius: 3px; }
.texte-langue { border-bottom: 1px solid #efe7dc; padding: .4em 0; }
.texte-langue summary { cursor: pointer; font-weight: 700; color: var(--principale); padding: .4em 0; }
.texte-langue textarea[dir="rtl"] { font-family: "Assistant", "Lato", sans-serif; }
