/* ====== Thèmes ====== */
:root, [data-theme="ivoire"] {
  --bg: #FBF7F0; --bg2: #F3EADB; --card: #FFFFFF; --ink: #2B2320; --muted: #7B6F66;
  --accent: #B08D57; --accent-ink: #FFFFFF; --accent2: #7A5C3E; --line: #E6D9C3;
  --hero-bg: linear-gradient(160deg, #F6EEDF 0%, #EADBC2 100%); --hero-ink: #2B2320;
  --font-names: 'Great Vibes', cursive; --names-size: clamp(3rem, 13vw, 5.2rem); --names-weight: 400;
}
[data-theme="bleu-rouge"] {
  --bg: #F3F6FA; --bg2: #E3EBF5; --card: #FFFFFF; --ink: #0B1E33; --muted: #5A6B80;
  --accent: #D7191F; --accent-ink: #FFFFFF; --accent2: #0B2A4A; --line: #D3DEEB;
  --hero-bg: radial-gradient(circle at 20% 15%, rgba(255,190,90,.35) 0 6%, transparent 7%),
             radial-gradient(circle at 85% 25%, rgba(120,200,255,.35) 0 9%, transparent 10%),
             radial-gradient(circle at 70% 70%, rgba(255,170,80,.25) 0 5%, transparent 6%),
             linear-gradient(165deg, #0E5C99 0%, #0B2A4A 55%, #071728 100%);
  --hero-ink: #FFFFFF;
  --font-names: 'Anton', 'Oswald', Impact, sans-serif; --names-size: clamp(2.8rem, 12vw, 4.6rem); --names-weight: 400;
}
[data-theme="sahel"] {
  --bg: #FAF3EA; --bg2: #F0DFCB; --card: #FFFDF9; --ink: #2A1E17; --muted: #7C6656;
  --accent: #B5562B; --accent-ink: #FFFFFF; --accent2: #2F4858; --line: #E7CFB5;
  --hero-bg: linear-gradient(165deg, #B5562B 0%, #7D3A1E 60%, #4A2312 100%); --hero-ink: #FFF6EC;
  --font-names: 'Great Vibes', cursive; --names-size: clamp(3rem, 13vw, 5.2rem); --names-weight: 400;
}
[data-theme="emeraude"] {
  --bg: #F4F7F3; --bg2: #E1EBE3; --card: #FFFFFF; --ink: #18261F; --muted: #5D6E64;
  --accent: #1F6B4F; --accent-ink: #FFFFFF; --accent2: #C29B4A; --line: #CFDDD3;
  --hero-bg: linear-gradient(165deg, #1F6B4F 0%, #123F2F 100%); --hero-ink: #FFFFFF;
  --font-names: 'Great Vibes', cursive; --names-size: clamp(3rem, 13vw, 5.2rem); --names-weight: 400;
}
[data-theme="nuit"] {
  --bg: #14161F; --bg2: #1C1F2B; --card: #222636; --ink: #F2EDE4; --muted: #A7A2B3;
  --accent: #D4AF6A; --accent-ink: #14161F; --accent2: #E7CF9C; --line: #343A4F;
  --hero-bg: linear-gradient(165deg, #232838 0%, #0F1118 100%); --hero-ink: #F2EDE4;
  --font-names: 'Great Vibes', cursive; --names-size: clamp(3rem, 13vw, 5.2rem); --names-weight: 400;
}

/* ====== Base ====== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 'Montserrat', system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: 999px; padding: .9em 1.6em; cursor: pointer;
  font: 600 .95rem/1 'Montserrat', sans-serif; letter-spacing: .02em; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); transition: transform .15s, opacity .15s, box-shadow .15s;
  box-shadow: 0 6px 18px -8px var(--accent);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); box-shadow: none; }
.btn.dark { background: var(--accent2); color: #fff; box-shadow: none; }
.btn.small { padding: .6em 1em; font-size: .82rem; }
.btn.block { width: 100%; }

input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .8em 1em; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .4em; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #111; color: #fff; padding: .75em 1.2em; border-radius: 12px; font-size: .9rem; z-index: 99;
  transition: .25s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ====== Couverture (enveloppe) ====== */
.cover {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center;
  background: var(--hero-bg); color: var(--hero-ink); padding: 32px 24px; transition: opacity .7s, transform .7s;
}
.cover.open { opacity: 0; transform: scale(1.06); pointer-events: none; }
.cover-inner { max-width: 420px; }
.seal {
  width: 92px; height: 92px; margin: 0 auto 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 400 2.1rem/1 var(--font-names);
  box-shadow: 0 0 0 6px rgba(255,255,255,.15), 0 14px 30px -10px rgba(0,0,0,.5);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(255,255,255,.06), 0 14px 30px -10px rgba(0,0,0,.5); } }
.kicker { text-transform: uppercase; letter-spacing: .28em; font-size: .72rem; font-weight: 600; opacity: .85; margin: 0 0 .8em; }
.names { font-family: var(--font-names); font-size: var(--names-size); font-weight: var(--names-weight); line-height: 1.05; margin: 0 0 .25em; letter-spacing: .01em; }
.names .amp { font-family: 'Playfair Display', serif; font-style: italic; font-size: .6em; opacity: .9; padding: 0 .15em; }
.dear { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.15rem; margin: 18px 0 28px; }
.dear strong { font-style: normal; display: block; font-size: 1.35rem; margin-top: 4px; }

/* ====== Hero ====== */
.hero { background: var(--hero-bg); color: var(--hero-ink); padding: 56px 0 64px; text-align: center; position: relative; overflow: hidden; }
.hero .date-big { font-family: 'Playfair Display', serif; font-size: 1.15rem; letter-spacing: .04em; margin-top: 6px; }
.hero .slogan { font-style: italic; opacity: .9; margin-top: 10px; font-size: .98rem; }
.poster {
  margin: 30px auto 0; max-width: 360px; border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.12);
  transform: rotate(-1.2deg);
}
.ribbon {
  display: inline-block; background: var(--accent); color: var(--accent-ink); font: 400 1.15rem/1 'Anton', 'Montserrat', sans-serif;
  letter-spacing: .06em; padding: .5em 1.4em; margin-top: 14px; clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%);
}

/* ====== Sections ====== */
section.block { padding: 56px 0; }
section.block.alt { background: var(--bg2); }
.section-title { text-align: center; margin-bottom: 28px; }
.section-title .eyebrow { display: block; text-transform: uppercase; letter-spacing: .25em; font-size: .7rem; color: var(--accent); font-weight: 700; margin-bottom: .6em; }
.section-title h2 { font-size: 1.85rem; }
.divider { width: 56px; height: 2px; background: var(--accent); margin: 14px auto 0; border-radius: 2px; }
.lead { text-align: center; font-size: 1.05rem; color: var(--ink); max-width: 520px; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: 0 12px 30px -24px rgba(0,0,0,.35); }
.info-grid { display: grid; gap: 14px; }
.info-row { display: flex; gap: 14px; align-items: flex-start; }
.info-ico { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg2); color: var(--accent); }
.info-ico svg { width: 22px; height: 22px; }
.info-row small { display: block; text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; color: var(--muted); font-weight: 700; }
.info-row div > span { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.actions .btn { flex: 1 1 180px; }

/* Programme */
.timeline { position: relative; margin: 0; padding: 0 0 0 28px; list-style: none; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 22px; }
.timeline li::before { content: ''; position: absolute; left: -26px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }
section.alt .timeline li::before { box-shadow: 0 0 0 4px var(--bg2); }
.timeline .t { font-weight: 700; color: var(--accent); font-size: .85rem; letter-spacing: .05em; }
.timeline h3 { font-size: 1.2rem; margin: 2px 0 2px; }
.timeline p { margin: 0; color: var(--muted); font-size: .93rem; }

/* Compte à rebours */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.countdown div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 4px; text-align: center; }
.countdown b { display: block; font: 600 2rem/1.1 'Playfair Display', serif; color: var(--accent2); }
[data-theme="nuit"] .countdown b { color: var(--accent); }
.countdown span { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.today { text-align: center; font: 600 1.6rem 'Playfair Display', serif; color: var(--accent); }

/* RSVP */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.choice button {
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 16px; padding: 18px 10px;
  font: 600 .95rem 'Montserrat', sans-serif; cursor: pointer; transition: .15s;
}
.choice button .ico { display: block; font-size: 1.6rem; margin-bottom: 6px; }
.choice button.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.stepper { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 6px 0 4px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); font-size: 1.4rem; cursor: pointer; color: var(--ink); }
.stepper output { font: 600 2rem 'Playfair Display', serif; min-width: 2ch; text-align: center; }
.hint { color: var(--muted); font-size: .85rem; text-align: center; margin: 4px 0 0; }
.status-badge { display: inline-flex; align-items: center; gap: 8px; padding: .5em 1em; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.status-badge.yes { background: #E3F4EA; color: #17663A; }
.status-badge.no { background: #FBE7E7; color: #9B1C1C; }
.qr-box { text-align: center; margin-top: 22px; }
.qr-box .qr { display: inline-block; background: #fff; padding: 14px; border-radius: 16px; border: 1px solid var(--line); }
.qr-box .qr svg, .qr-box .qr img { width: 220px; height: 220px; display: block; shape-rendering: crispEdges; }
.qr-code-txt { font-family: ui-monospace, Menlo, monospace; letter-spacing: .15em; color: var(--muted); font-size: .85rem; margin-top: 8px; }
.sep { height: 1px; background: var(--line); margin: 24px 0; }

/* Dress code */
.swatches { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.swatches i { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line), 0 6px 14px -8px rgba(0,0,0,.4); }

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }

.gift-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.gift-item:last-child { border-bottom: 0; }

/* Pied de page + barre fixe */
footer.foot { text-align: center; padding: 40px 20px 120px; color: var(--muted); font-size: .85rem; }
.wa-btn { background: #25D366; color: #fff; box-shadow: 0 6px 18px -8px #25D366; margin-top: 6px; }
footer.foot .names { font-size: 2.4rem; color: var(--ink); }
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent); display: flex; justify-content: center;
}
.sticky-cta .btn { width: min(100%, 420px); }
.music-btn {
  position: fixed; right: 14px; top: 14px; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,.45); color: #fff; backdrop-filter: blur(6px); font-size: 1.1rem;
}

.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 30px; }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .seal { animation: none; } }
