:root {
  --ivory: #fcf7ef;
  --sand: #f5ead9;
  --line: #e0cdb3;
  --gold: #b08a52;
  --brown: #86532f;
  --cocoa: #5e3a24;
  --cocoa-deep: #46291a;
  --soft: #86684f;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--cocoa-deep);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Colonne centrale : plein écran sur téléphone, colonne élégante sur ordinateur.
   Le fond passe doucement de l'ivoire au sable tout au long de la page. */
#site {
  position: relative; max-width: 520px; margin: 0 auto; overflow: clip;
  background: linear-gradient(180deg, #fcf7ef 0%, #f8eddd 14%, #fcf7ef 30%, #f7ecdb 47%, #fcf7ef 63%, #f6e9d5 81%, #fcf7ef 100%);
}
.backdrop { display: none; }
@media (min-width: 760px) {
  .backdrop { display: block; position: fixed; inset: -40px; z-index: -1; background: url(/img/footer.webp) center / cover; filter: blur(18px) saturate(.9); }
  .backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(252, 244, 232, .4); }
  #site { box-shadow: 0 0 90px rgba(60, 35, 18, .3); }
}

/* ================= Entrée (invitation fermée puis ouverte) ================= */
.blk-hero { position: relative; display: flex; min-height: 100svh; overflow: hidden; color: var(--cocoa); }
@media (min-width: 760px) { .blk-hero { min-height: min(100svh, 940px); } }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; animation: settle 9s ease-out both; }
@keyframes settle { from { transform: scale(1.07); } }
.hero-veil { position: absolute; inset: 0; background: radial-gradient(ellipse 85% 42% at 58% 32%, rgba(255, 243, 226, .6), transparent 72%); }
.hero-haze { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease .5s; background: linear-gradient(180deg, transparent 49%, rgba(255, 243, 226, .82) 58%, rgba(255, 243, 226, .82) 66%, transparent 76%); }
.is-open .hero-haze { opacity: 1; }
.hero-inner {
  position: relative; z-index: 2; width: 100%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(46px, 9vh, 86px) 24px 150px;
}
.stack { display: grid; justify-items: center; }
.stack > * { grid-area: 1 / 1; }
.kicker { margin: 0 0 6px; max-width: 280px; font: 400 .72rem/1.7 var(--sans); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; transition: opacity 1.1s ease, visibility 1.1s; }
.names { margin: 0; font-weight: 400; }
.nm { display: block; font-family: var(--script); font-size: clamp(4rem, 18.5vw, 5.9rem); line-height: 1.05; color: var(--cocoa); }
.amp { display: block; margin: 2px 0; font-size: 1.9rem; line-height: 1; }
.hero-bottom { margin-top: 34px; }
.cdate { margin: 0 0 18px; font-style: italic; font-size: 1.6rem; font-weight: 500; text-shadow: 0 0 16px rgba(255, 243, 226, 1), 0 0 6px rgba(255, 243, 226, .95); }
.hline { margin: 14px 0 8px; font-style: italic; font-size: 1.3rem; }
.hplace { margin: 0; display: inline-flex; align-items: center; gap: 6px; font: 500 .78rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; }
.hdate { display: inline-block; margin: 18px 0 0; padding: 12px 24px; background: rgba(110, 66, 38, .94); color: #fff; font: 400 .8rem/1 var(--sans); letter-spacing: .26em; text-indent: .26em; text-transform: uppercase; box-shadow: 0 8px 22px rgba(70, 40, 20, .25); }
.when-closed, .when-open { display: grid; justify-items: center; transition: opacity 1.1s ease, visibility 1.1s; }
.is-closed .k-open, .is-closed .when-open { opacity: 0; visibility: hidden; }
.is-open .k-closed, .is-open .when-closed { opacity: 0; visibility: hidden; pointer-events: none; }
.is-open .k-open, .is-open .when-open { transition-delay: .7s; }
.is-closed .nm, .is-closed .amp { animation: rise 1.5s .1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.burger { position: absolute; top: 14px; right: 14px; z-index: 5; width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--cocoa); cursor: pointer; transition: opacity 1s ease .8s, visibility 1s .8s; }
.is-closed .burger, .is-closed .scroll-cue { opacity: 0; visibility: hidden; }
.scroll-cue { position: absolute; left: 50%; bottom: 138px; z-index: 4; margin-left: -15px; color: var(--cocoa); transition: opacity 1s ease 1.4s; animation: nudge 2.4s ease-in-out 2.4s infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }
.rule { width: 42px; height: 1px; margin: 14px auto; background: currentColor; opacity: .55; }

/* ================= Boutons ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 30px;
  border: 1px solid currentColor; border-radius: 999px; background: transparent; color: var(--cocoa);
  font: 400 .74rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background .35s, color .35s, border-color .35s, transform .35s;
}
.btn:hover { background: var(--brown); color: #fff; border-color: var(--brown); }
.btn-solid { background: var(--brown); color: #fff; border-color: var(--brown); box-shadow: 0 10px 24px rgba(90, 52, 28, .28); }
.btn-solid:hover { background: var(--cocoa-deep); border-color: var(--cocoa-deep); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.wide { width: 100%; }
.btn-cta { width: 100%; max-width: 380px; justify-content: space-between; gap: 14px; padding: 0 22px; border-radius: 12px; }

/* ================= Sections ================= */
.blk { padding: 66px 22px; }
.wrap { max-width: 480px; margin: 0 auto; text-align: center; }
.blk h2 { margin: 0; font-weight: 400; font-style: italic; font-size: clamp(2rem, 8vw, 2.5rem); line-height: 1.12; color: var(--cocoa); }
.blk h2 + .rule { margin: 16px auto 26px; }
.lead { margin: -6px auto 26px; max-width: 34ch; font-style: italic; color: var(--soft); }
.prose { margin: 0; white-space: pre-line; }

/* Compte à rebours : le bandeau naît de la plage et s'efface dans la page */
.blk-countdown {
  position: relative; z-index: 3; margin-top: -120px; padding: 200px 16px 160px; color: #fff;
  background: linear-gradient(rgba(96, 54, 30, .55), rgba(96, 54, 30, .62)), url(/img/palm-shadow.webp) center / cover;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .3) 36px, rgba(0, 0, 0, .72) 80px, #000 114px, #000 calc(100% - 130px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .3) 36px, rgba(0, 0, 0, .72) 80px, #000 114px, #000 calc(100% - 130px), transparent 100%);
}
.cd-title { margin: 0 0 22px; font-family: var(--script); font-size: clamp(2rem, 8vw, 2.6rem); line-height: 1.2; color: #fff1dc; }
.cd { display: flex; justify-content: center; }
.cd-item { display: grid; padding: 0 clamp(12px, 4vw, 30px); border-left: 1px solid rgba(255, 255, 255, .38); }
.cd-item:first-child { border-left: 0; }
.cd-num { font-weight: 500; font-size: clamp(2.4rem, 10.5vw, 3.4rem); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.cd-lab { margin-top: 8px; font: 400 .62rem/1 var(--sans); letter-spacing: .24em; text-indent: .24em; text-transform: uppercase; opacity: .85; }
.cd-done { margin: 0; font-style: italic; font-size: 1.8rem; }
.blk-countdown + .blk { padding-top: 6px; }

/* Lieux */
.events { display: grid; text-align: left; }
.event { display: grid; grid-template-columns: 38% 1fr; gap: 18px; align-items: center; }
.event + .event { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.ev-photo { aspect-ratio: 1; padding: 5px; border-radius: 18px; background: #fffdf8; box-shadow: 0 12px 26px rgba(80, 50, 28, .17); }
.ev-img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.ev-ph { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 13px; color: var(--gold); background: linear-gradient(135deg, #f5e7d2, #e8d3b6); }
.ev-label { margin: 0; font-family: var(--script); font-size: 1.55rem; line-height: 1.1; color: var(--gold); }
.ev-title { margin: 2px 0 6px; font-weight: 600; font-size: 1.55rem; line-height: 1.1; }
.ev-time { margin: 0 0 6px; font: 500 .78rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brown); }
.ev-addr { margin: 0 0 10px; font-size: 1rem; line-height: 1.3; color: var(--soft); }
.ev-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; color: var(--gold); }
.ev-links a { font: 400 .7rem/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--cocoa); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.ev-links a:hover { color: var(--gold); }

/* Dress code : le lin se fond dans le texte */
.blk-dress { padding: 14px 22px 56px; }
.dress {
  position: relative; overflow: hidden; border-radius: 22px; min-height: 260px; padding: 84px 20px 36px 38%;
  background: linear-gradient(90deg, rgba(252, 247, 239, 0) 0%, rgba(252, 247, 239, .55) 30%, rgba(252, 247, 239, .96) 52%), url(/img/linen.webp) center / cover;
  box-shadow: 0 14px 34px rgba(80, 50, 28, .15), inset 0 0 0 1px rgba(255, 255, 255, .6);
}
.dress-flower { position: absolute; right: 18px; top: 14px; width: 92px; opacity: .85; pointer-events: none; }
.dress-body { text-align: center; }
.blk h2.dress-title { margin: 0; font: 400 1rem/1.2 var(--sans); font-style: normal; letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; color: var(--cocoa); }
.blk h2.dress-title + .rule { margin: 14px auto 16px; }
.dress-body .prose { font-style: italic; font-size: 1.2rem; line-height: 1.4; }

/* Réponse : l'hibiscus entier couronne la section */
.blk-rsvp { padding: 40px 22px 70px; background: radial-gradient(ellipse 85% 36% at 50% 42%, rgba(246, 205, 160, .36), transparent 74%); }
.rsvp-flower { display: block; width: 158px; height: auto; margin: 0 auto 10px; filter: drop-shadow(0 12px 14px rgba(90, 50, 30, .24)); }

/* Programme */
.timeline { list-style: none; margin: 0; padding: 0; text-align: left; }
.timeline li { position: relative; display: grid; grid-template-columns: 3.4rem 14px 30px 1fr; gap: 0 10px; align-items: center; padding: 9px 0; }
.timeline li::before { content: ""; position: absolute; left: calc(3.4rem + 16.5px); top: 0; bottom: 0; width: 1px; background: var(--line); }
.timeline li:first-child::before { top: 50%; }
.timeline li:last-child::before { bottom: 50%; }
.tl-time { text-align: right; font: 500 .82rem/1 var(--sans); letter-spacing: .08em; color: var(--brown); }
.tl-dot { position: relative; z-index: 1; width: 9px; height: 9px; border-radius: 50%; background: var(--brown); justify-self: center; }
.tl-ico { color: var(--soft); display: grid; place-items: center; }
.tl-text strong { display: block; font-weight: 600; font-size: 1.1rem; line-height: 1.2; }
.tl-text small { display: block; font-style: italic; font-size: .98rem; line-height: 1.25; color: var(--soft); }

/* Infos pratiques */
.linklist { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; text-align: left; }
.linkcard { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .62); text-decoration: none; transition: border-color .3s, box-shadow .3s, transform .3s; }
a.linkcard:hover { border-color: var(--gold); box-shadow: 0 10px 22px rgba(80, 50, 28, .12); transform: translateY(-1px); }
.lk-ico { color: var(--cocoa); display: grid; place-items: center; }
.lk-text strong { display: block; font-weight: 600; font-size: 1.12rem; line-height: 1.2; }
.lk-text small { display: block; margin-top: 2px; font-style: italic; font-size: 1rem; line-height: 1.25; color: var(--soft); }
.lk-go { color: var(--cocoa); }
.lk-soon { font-style: italic; font-size: .98rem; color: var(--soft); }
.linkcard.soon { border-style: dashed; background: transparent; }
.linkcard.soon .lk-ico, .linkcard.soon strong { opacity: .6; }

/* Enveloppes */
.blk-gifts { position: relative; overflow: hidden; background: radial-gradient(ellipse 90% 22% at 50% 16%, rgba(246, 205, 160, .32), transparent 72%); }
.blk-gifts .wrap { position: relative; }
.gifts-leaf {
  position: absolute; left: 0; top: 6px; width: 190px; opacity: .26; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 48%, transparent 82%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 48%, transparent 82%);
}
.gift-text { margin-bottom: 32px; font-size: 1.02rem; line-height: 1.5; }
.envelopes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.env-wrap { display: grid; justify-items: center; gap: 4px; }
.envelope { width: 100%; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .4s ease; }
.envelope img { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 14px rgba(70, 45, 25, .22)); }
.envelope:not(:disabled):hover, .envelope:not(:disabled):focus-visible { transform: translateY(-5px) rotate(-1.2deg); }
.envelope:disabled { cursor: default; opacity: .65; filter: saturate(.7); }
.env-name { margin-top: 6px; font-family: var(--script); font-size: 1.6rem; line-height: 1.1; white-space: nowrap; color: var(--cocoa); }
.env-link { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; border: 0; border-bottom: 1px solid var(--gold); background: none; font: 400 .7rem/1.3 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--cocoa); cursor: pointer; }
.env-soon { font-style: italic; font-size: .98rem; color: var(--soft); }

/* Pied de page */
.footer { position: relative; margin-top: 10px; text-align: center; color: var(--soft); }
.footer-text { position: relative; z-index: 1; padding: 50px 22px 0; }
.footer-names { margin: 0; font-family: var(--script); font-size: 2.35rem; line-height: 1.1; color: var(--cocoa); }
.footer-line { margin: 6px 0 0; font-style: italic; font-size: 1.25rem; }
.footer-photo { display: block; width: 100%; height: auto; margin-top: -4px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 36%); mask-image: linear-gradient(180deg, transparent, #000 36%); }
.load-error { padding: 40px 24px; text-align: center; font-style: italic; }

/* Bouton flottant */
.fab {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; transform: translateX(-50%);
  min-height: 48px; padding: 0 30px; border: 0; border-radius: 999px;
  background: var(--brown); color: #fff; font: 400 .74rem/1 var(--sans); letter-spacing: .28em; text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(70, 40, 20, .38); cursor: pointer;
  animation: fab-in .5s ease both;
}
@keyframes fab-in { from { opacity: 0; transform: translate(-50%, 14px); } }

/* ================= Menu ================= */
.drawer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(252, 247, 239, .97); backdrop-filter: blur(8px); animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer-close { position: absolute; top: 12px; right: 16px; width: 48px; height: 48px; border: 0; background: none; font-size: 2rem; line-height: 1; cursor: pointer; color: var(--cocoa); }
.drawer-list { margin: 0; padding: 0; list-style: none; text-align: center; }
.drawer-list a { display: block; padding: 11px 24px; font-style: italic; font-size: 1.9rem; text-decoration: none; color: var(--cocoa); }
.drawer-list a:hover { color: var(--gold); }

/* ================= Fenêtres ================= */
.modal {
  width: min(94vw, 440px); max-height: min(92svh, 800px); padding: 0; border: 0; border-radius: 22px; overflow: auto;
  background: var(--ivory); color: var(--cocoa-deep);
  box-shadow: 0 30px 90px rgba(40, 25, 14, .38);
}
.modal[open] { animation: sheet .38s cubic-bezier(.2, .7, .2, 1); }
@keyframes sheet { from { opacity: 0; transform: translateY(26px); } }
.modal::backdrop { background: rgba(38, 26, 18, .5); backdrop-filter: blur(4px); }
.modal-inner { padding: 40px 26px 28px; }
.modal-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--soft); }
.modal-close:hover { background: var(--sand); }
.center { text-align: center; }
.m-title { margin: 0; font-family: var(--script); font-weight: 400; font-size: 2.3rem; line-height: 1.15; color: var(--gold); }
.m-lead { margin: 6px auto 20px; font-style: italic; font-size: 1.1rem; line-height: 1.4; color: var(--soft); }
.m-big { margin: 12px 0 26px; font-style: italic; font-size: 1.55rem; line-height: 1.35; }
.qr { width: 210px; height: 210px; margin: 0 auto 22px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.qr svg { display: block; width: 100%; height: 100%; }
@media (max-width: 560px) {
  .modal { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 94svh; }
}

/* Formulaire de réponse */
.form { text-align: left; }
.lbl { display: block; margin: 0 0 6px; font: 400 .68rem/1.3 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--soft); }
.input { display: block; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: 400 1rem/1.4 var(--sans); }
textarea.input { min-height: 0; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--soft) 50%), linear-gradient(135deg, var(--soft) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.gap { margin: 18px 0 4px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 6px 10px; text-align: center; font: 400 .92rem/1.2 var(--sans); transition: background .25s, color .25s; }
.seg label + label span { border-left: 1px solid var(--line); }
.seg input:checked + span { background: var(--brown); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: -4px; }
.seg.sm { min-width: 128px; }
.seg.sm span { min-height: 40px; padding: 4px 14px; }
.more { margin: 14px 0 6px; padding-top: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0; }
.q { font: 400 .92rem/1.3 var(--sans); }
.sub { margin: -4px 0 12px; }
.form .lbl:not(:first-child) { margin-top: 18px; }
.form-error { margin: 14px 0 0; font: 400 .92rem/1.4 var(--sans); color: #9b2c2c; }
.form .btn { margin-top: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 340px) {
  .row { flex-direction: column; align-items: stretch; gap: 8px; }
  .seg.sm { min-width: 0; }
  .event { grid-template-columns: 1fr; }
  .ev-photo { aspect-ratio: 16 / 9; }
  .dress { padding-left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-img, .is-closed .nm, .is-closed .amp, .scroll-cue { animation: none; }
  .kicker, .when-closed, .when-open, .burger, .scroll-cue, .modal[open], .fab, .drawer { transition: none; animation: none; }
}
