/* Eden & Yohai — direction « Pierre de Jérusalem » */
:root {
  --pierre: #EFE6D6;
  --pierre-2: #E5D8C1;
  --papier: #F8F3EA;
  --olivier: #5F6E45;
  --olivier-clair: #7C8B5E;
  --terre: #8E5733;
  --encre: #3F382B;
  --encre-douce: #6B6150;
  --filet: rgba(63, 56, 43, .22);
  --serif: 'Cormorant Garamond', 'Frank Ruhl Libre', Georgia, serif;
  --hebreu: 'Frank Ruhl Libre', 'Cormorant Garamond', serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rayon: 14px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  color: var(--encre);
  background-color: var(--pierre);
  /* grain de pierre très léger + lumière chaude */
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(255, 248, 232, .9), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed, scroll;
}
[hidden] { display: none !important; }
html[dir="rtl"] body { font-family: var(--hebreu); }

/* ── Structure ───────────────────────────── */
.ecran {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 20px;
  position: relative;
}
.ecran--court { min-height: 70svh; }
.contenu { width: 100%; max-width: 520px; text-align: center; }

.barre {
  position: fixed; top: 0; inset-inline-end: 0;
  padding: max(12px, env(safe-area-inset-top)) 14px 0;
  z-index: 20;
}

/* ── Typographie ─────────────────────────── */
.label {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--olivier);
  margin: 0 0 6px;
}
.titre {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(36px, 10vw, 52px);
  line-height: 1.1;
  margin: 0 0 28px;
}
html[dir="rtl"] .titre { font-family: var(--hebreu); font-style: normal; }

/* ── Hero / arche ────────────────────────── */
.hero { padding-top: 56px; padding-bottom: 40px; overflow: hidden; }
.arche {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  padding: 40px 26px 34px;
  text-align: center;
  background: var(--papier);
  border-radius: 190px 190px 6px 6px;
  border: 1px solid var(--filet);
  box-shadow: 0 30px 60px -40px rgba(63, 56, 43, .55);
}
.arche::before {
  content: "";
  position: absolute; inset: 9px;
  border-radius: 181px 181px 3px 3px;
  border: 1px solid rgba(95, 110, 69, .35);
  pointer-events: none;
}
.arche--petite { width: min(100%, 340px); padding-top: 34px; }

.mono { display: block; width: 66px; height: 77px; margin: 0 auto 14px; color: var(--olivier); }
.mono--petit { width: 48px; height: 56px; }

.surtitre, .salut-attend {
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--olivier); font-weight: 400; margin: 0 0 6px;
}

.salutation { margin: 0 0 22px; }
.salut-nom {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 6.4vw, 28px);
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.salut-nom > span:first-child { display: block; }
.salut-enfants {
  display: block;
  font-size: .68em;
  font-style: italic;
  font-weight: 400;
  color: var(--encre-douce);
  line-height: 1.1;
  margin-top: 1px;
}
.salut-attend { margin-top: 14px; }

.noms {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(52px, 16vw, 72px);
  line-height: .95;
  margin: 6px 0 10px;
}
.noms span { display: block; }
.noms .noms-et { font-size: .45em; color: var(--terre); margin: 4px 0; font-style: normal; }
.noms-hebreu { font-family: var(--hebreu); font-size: 22px; color: var(--terre); margin: 0 0 8px; }
.hero-date { font-size: 15px; letter-spacing: .08em; margin: 0 0 16px; }

.compte {
  display: flex; justify-content: center; gap: 10px;
  margin: 6px 0 24px;
}
.compte div {
  min-width: 70px;
  padding: 8px 4px 6px;
  border-top: 1px solid var(--filet);
  border-bottom: 1px solid var(--filet);
}
.compte b { display: block; font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1; }
.compte span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--encre-douce); }

.branche { display: block; width: 180px; height: 54px; margin: 0 auto 18px; color: var(--olivier-clair); }
.branche--hero {
  position: absolute; bottom: 4vh; inset-inline-end: -40px;
  width: 260px; height: 78px; opacity: .55; transform: rotate(-8deg);
  pointer-events: none;
}

/* ── Boutons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px;
  padding: 12px 28px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible, .choix button:focus-visible, .pas button:focus-visible { outline: 2px solid var(--terre); outline-offset: 3px; }
.btn-plein { background: var(--olivier); color: var(--papier); }
.btn-plein:hover { background: #4E5B38; }
.btn-contour { border-color: var(--olivier); color: var(--olivier); background: transparent; }
.btn-contour:hover { background: rgba(95, 110, 69, .08); }
.btn-lien { background: none; color: var(--terre); text-decoration: underline; text-underline-offset: 4px; min-height: 44px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.boutons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.boutons--col { flex-direction: column; align-items: center; margin-top: 28px; }
.boutons .btn { flex: 1 1 140px; max-width: 220px; }
.boutons--col .btn { flex: none; max-width: none; }

.pastille-btn {
  font-family: var(--hebreu); font-size: 15px;
  background: rgba(248, 243, 234, .85); color: var(--encre);
  border: 1px solid var(--filet); border-radius: 999px;
  padding: 6px 14px; min-height: 38px; cursor: pointer;
}

/* ── Cartes, programme ───────────────────── */
.carte {
  background: var(--papier);
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  padding: 24px 20px;
  margin: 0 0 18px;
}
.date-grande { font-family: var(--serif); font-size: 30px; line-height: 1.2; margin: 0; }
.date-grande--moyenne { font-size: 24px; margin-bottom: 8px; }
.date-hebraique { font-family: var(--hebreu); color: var(--terre); margin: 6px 0 0; }

.programme {
  list-style: none; margin: 8px 0 26px; padding: 0;
  display: flex; justify-content: center; gap: 0;
}
.programme li {
  flex: 1 1 0;
  padding: 10px 6px;
  position: relative;
}
.programme li + li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 22%; bottom: 22%;
  border-inline-start: 1px solid var(--filet);
}
.prog-heure { display: block; font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1.1; }
.prog-nom { display: block; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--encre-douce); }

.lieu-nom { font-family: var(--serif); font-size: 26px; line-height: 1.2; margin: 4px 0; }
.lieu-adresse { margin: 0; color: var(--encre-douce); }
.dress { margin: 8px 0 0; }
.dress .label { display: block; }
.a-venir { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--encre-douce); margin: 10px 0; }

/* ── RSVP ────────────────────────────────── */
.rsvp { text-align: start; }
.rsvp-info { text-align: center; font-family: var(--serif); font-size: 20px; font-style: italic; color: var(--encre-douce); }
.choix { display: grid; gap: 10px; margin-bottom: 20px; }
.choix button {
  font-family: var(--serif); font-size: 21px; line-height: 1.25;
  padding: 14px 18px; min-height: 58px;
  border-radius: var(--rayon);
  border: 1px solid var(--filet);
  background: var(--papier); color: var(--encre);
  cursor: pointer; text-align: center;
  transition: background-color .2s, border-color .2s, color .2s;
}
.choix button[aria-pressed="true"] { background: var(--olivier); border-color: var(--olivier); color: var(--papier); }
.choix button.non[aria-pressed="true"] { background: var(--encre-douce); border-color: var(--encre-douce); }

.compteurs { display: grid; gap: 10px; margin-bottom: 18px; }
.compteur {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--papier); border: 1px solid var(--filet); border-radius: var(--rayon);
  padding: 10px 12px 10px 18px;
}
.compteur-nom { font-size: 17px; }
.pas { display: flex; align-items: center; gap: 6px; }
.pas button {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--olivier); background: transparent; color: var(--olivier);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.pas output { min-width: 34px; text-align: center; font-family: var(--serif); font-size: 26px; font-weight: 500; }

.rsvp label.champ { display: block; font-size: 14px; color: var(--encre-douce); margin-bottom: 6px; }
.rsvp textarea {
  width: 100%; min-height: 96px; resize: vertical;
  font: inherit; font-size: 16px; color: var(--encre);
  background: var(--papier); border: 1px solid var(--filet); border-radius: var(--rayon);
  padding: 12px 14px; margin-bottom: 18px;
}
.rsvp textarea:focus { outline: 2px solid var(--olivier-clair); outline-offset: 1px; }
.rsvp .envoyer { width: 100%; }
.rsvp-etat { text-align: center; min-height: 1.6em; margin: 12px 0 0; font-size: 15px; }
.rsvp-etat.erreur { color: #9B2F22; }

.merci { text-align: center; }
.merci-titre { font-family: var(--serif); font-style: italic; font-size: 28px; margin: 0 0 6px; }
.merci-detail { color: var(--encre-douce); margin: 0 0 14px; }

/* ── Signature & pied ────────────────────── */
.signature .mot { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.45; margin: 0 0 26px; white-space: pre-line; }
.parents { font-family: var(--serif); font-size: 21px; line-height: 1.4; margin: 0 0 6px; white-space: pre-line; }
.familles { font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: var(--encre-douce); }
.pied {
  text-align: center; padding: 26px 20px calc(80px + env(safe-area-inset-bottom));
  font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--encre-douce);
  border-top: 1px solid var(--filet);
}
.pied-date { display: block; font-family: var(--sans); font-style: normal; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }

/* ── Écran lien invalide ─────────────────── */
.ecran-invalide { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.invalide-texte { font-family: var(--serif); font-size: 24px; line-height: 1.35; margin: 8px 0 10px; }

/* ── Popup ───────────────────────────────── */
.popup {
  border: none; padding: 0; background: transparent;
  width: min(100% - 32px, 460px); max-height: 86vh;
}
.popup::backdrop { background: rgba(63, 56, 43, .45); }
.popup-corps {
  position: relative; background: var(--papier); color: var(--encre);
  border-radius: 20px; padding: 30px 22px 24px; text-align: center;
}
.popup-fermer {
  position: absolute; top: 8px; inset-inline-end: 8px;
  width: 44px; height: 44px; border: none; background: none;
  font-size: 30px; line-height: 1; color: var(--encre-douce); cursor: pointer;
}
.titre--popup { font-size: 32px; margin-bottom: 16px; }
.popup-bloc { margin: 0 0 16px; }
.popup-bloc p { margin: 0; white-space: pre-line; }
.popup-rappel {
  background: rgba(142, 87, 51, .1); border: 1px solid rgba(142, 87, 51, .35);
  color: var(--terre); border-radius: var(--rayon); padding: 12px 14px;
  font-weight: 400;
}

/* ── Musique ─────────────────────────────── */
.musique {
  position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); inset-inline-end: 16px; z-index: 20;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--filet);
  background: rgba(248, 243, 234, .92); color: var(--encre);
  font-family: var(--sans); font-size: 14px; cursor: pointer;
  box-shadow: 0 8px 20px -12px rgba(63, 56, 43, .6);
}
.musique[aria-pressed="true"] { background: var(--olivier); color: var(--papier); border-color: var(--olivier); }
.musique[aria-pressed="true"] .musique-icone { animation: note 1.6s ease-in-out infinite; }
@keyframes note { 50% { transform: translateY(-3px); } }

/* ── Apparition au défilement ────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.reveal.vu { opacity: 1; transform: none; }
.hero .arche { animation: monte 1.1s ease both; }
@keyframes monte { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .arche, .musique-icone { animation: none !important; }
}

@media (min-width: 720px) {
  body { font-size: 18px; }
  .arche { width: 420px; padding: 52px 34px 40px; border-radius: 210px 210px 6px 6px; }
  .arche::before { border-radius: 201px 201px 3px 3px; }
  .branche--hero { width: 360px; height: 108px; inset-inline-end: 6vw; }
}
