/* ==========================================================
   Karim & Fatima — faire-part, esprit Régence
   ========================================================== */
:root {
  --ivory: #fbf8f2;
  --paper: #f5efe4;
  --powder: #c8d5e2;
  --powder-soft: #e3eaf1;
  --slate: #5b6f88;
  --slate-deep: #3e4c61;
  --ink: #474b55;
  --ink-soft: #7a7c84;
  --gold: #b0915a;
  --gold-deep: #8a6d3b;
  --blush: #e9d3cc;

  --script: "Pinyon Script", cursive;
  --serif: "Cormorant Garamond", Georgia, serif;
  --caps: "Cormorant SC", "Cormorant Garamond", serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --col: 480px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(80% 60% at 50% 30%, #dbe4ee 0%, transparent 70%),
    var(--powder);
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 1.5px solid var(--slate); outline-offset: 4px; }

.script { font-family: var(--script); font-weight: 400; }
.caps {
  font-family: var(--caps);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .24em;
  text-transform: lowercase;
  color: var(--slate);
  margin: 0;
}
.gold {
  background: linear-gradient(100deg, #8a6d3b 0%, #b8995f 22%, #e6d3a6 36%, #a8884e 50%, #7e6334 64%, #c9ad74 80%, #8a6d3b 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 10s ease-in-out infinite;
}
.blue {
  background: linear-gradient(100deg, #34506f 0%, #56769b 22%, #a9c0da 36%, #4f6d92 50%, #2f4865 64%, #7593b6 80%, #34506f 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 10s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity 1.5s var(--ease), transform 1.5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================
   L'enveloppe
   ========================================================== */
.envelope {
  position: fixed; inset: 0; z-index: 50;
  width: min(100%, var(--col)); margin: 0 auto;
  overflow: hidden; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 80px rgba(40, 60, 90, .25);
  transition: opacity 1.6s var(--ease) .9s, transform 2.4s var(--ease) .7s, filter 2s var(--ease) .8s;
  outline: none;
}
.env-paper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.env-sheen { /* lumière qui glisse sur le gaufrage */
  position: absolute; inset: -20%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .28) 48%, transparent 60%);
  animation: sheen 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen { 0%, 30% { transform: translateX(-60%); } 75%, 100% { transform: translateX(60%); } }

.seal {
  --s: min(44vw, 210px);
  position: absolute; left: 50%; top: 51.5%;
  width: var(--s); height: var(--s);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 10px rgba(50, 60, 80, .35)) drop-shadow(0 2px 2px rgba(50, 60, 80, .25));
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.03); } }
.seal-half { position: absolute; inset: 0; transition: transform 1.3s cubic-bezier(.5, 0, .2, 1), opacity 1.1s var(--ease) .2s; }
.seal-half img { width: 100%; height: 100%; object-fit: contain; user-select: none; }
.seal-l { clip-path: polygon(0 0, 52% 0, 47% 35%, 53% 58%, 46% 100%, 0 100%); }
.seal-r { clip-path: polygon(52% 0, 100% 0, 100% 100%, 46% 100%, 53% 58%, 47% 35%); }
.seal-mono {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--script);
  font-size: calc(var(--s, 160px) * .25);
  color: #ece3d1;
  text-shadow: -1px -1px 0 rgba(255, 255, 255, .85), 1px 1.5px 1.5px rgba(110, 90, 60, .45);
  padding-top: 4%;
}
.seal-mono i { font-family: var(--serif); font-style: italic; font-size: .42em; margin: 0 .12em; transform: translateY(-.1em); }
.env-hint {
  position: absolute; left: 0; right: 0; bottom: max(7svh, env(safe-area-inset-bottom));
  margin: 0; text-align: center;
  font-family: var(--caps); font-size: 14px; letter-spacing: .3em; text-transform: lowercase;
  color: #fff; text-shadow: 0 1px 6px rgba(60, 80, 110, .45);
  animation: hint 3.4s ease-in-out infinite;
  transition: opacity .6s;
}
@keyframes hint { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.envelope.open { cursor: default; }
.envelope.open .seal { animation: none; }
.envelope.open .seal-l { transform: translate(-38%, 14%) rotate(-24deg); opacity: 0; }
.envelope.open .seal-r { transform: translate(38%, 18%) rotate(22deg); opacity: 0; }
.envelope.open .env-hint { opacity: 0; animation: none; }
.envelope.open { opacity: 0; transform: scale(1.12); filter: blur(3px) brightness(1.15); }

#petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ==========================================================
   La feuille
   ========================================================== */
.paper {
  position: relative;
  width: min(100%, var(--col)); margin: 0 auto;
  background-color: var(--ivory);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .35 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: 0 0 60px rgba(40, 60, 90, .18);
  overflow: hidden;
  text-align: center;
}
section { position: relative; padding: 72px 28px; }
.head { margin-bottom: 36px; }
.head h2, .countdown h2 { margin: 6px 0 0; font-size: clamp(44px, 12vw, 58px); line-height: 1.15; padding: 0 .1em; }

/* ---------- Accueil ---------- */
.hero { padding: 0; min-height: 100svh; display: flex; container-type: inline-size; }
.hero-frame { position: absolute; inset: 0; display: flex; flex-direction: column; }
.hero-frame img { width: 100%; flex: none; }
.ff-mid { flex: 1; margin: -1px 0; background: url("images/frame-mid.webp") center top / 100% auto repeat-y; }
.hero-inner {
  position: relative; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40cqw 12cqw 58cqw;
}
.hero-inner > .caps { max-width: 15em; line-height: 1.8; }
.hero-art {
  width: 92%; margin: 18px 0 4px;
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.045) translateY(-4px); } }
.hero-art.reveal { transition-duration: 2.2s; }
.names { margin: 0; font-weight: 400; line-height: .95; }
.names .script { display: block; font-size: clamp(60px, 17vw, 82px); padding: 0 .1em; }
.names .amp { display: block; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 28px; color: var(--gold-deep); margin: .05em 0 .1em; }
.lede { margin: 18px 0 20px; font-style: italic; font-size: 18px; line-height: 1.5; color: var(--ink-soft); }
.date-block { width: 100%; }
.rule { display: block; height: 1px; width: 70%; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.date { margin: 12px 0 0; display: flex; align-items: center; justify-content: center; gap: 18px; font-family: var(--caps); font-weight: 500; font-size: 15px; letter-spacing: .22em; text-transform: lowercase; color: var(--slate); }
.date b { font-family: var(--serif); font-weight: 300; font-size: 50px; letter-spacing: 0; line-height: 1; color: var(--slate-deep); font-variant-numeric: lining-nums; }
.year { margin: 0 0 12px; font-style: italic; font-size: 17px; color: var(--ink-soft); }
.city { margin-top: 16px; }

/* ---------- Compte à rebours ---------- */
.countdown { padding-top: 0; padding-bottom: 40px; min-height: 420px; }
.drape { position: absolute; top: -6px; width: 36%; pointer-events: none; transform-origin: 50% 0; }
.drape-l { left: -4%; animation: swayL 9s ease-in-out infinite; }
.drape-r { right: -4%; transform: scaleX(-1); animation: swayR 9s ease-in-out infinite; }
@keyframes swayL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(1.2deg); } }
@keyframes swayR { 0%, 100% { transform: scaleX(-1) rotate(0); } 50% { transform: scaleX(-1) rotate(1.2deg); } }
.countdown-inner { position: relative; z-index: 1; padding-top: 70px; }
.countdown h2 { margin-bottom: 26px; }
.clock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 360px; margin: 0 auto; }
.clock div { display: flex; flex-direction: column; align-items: center; padding: 14px 0 10px; background: rgba(251, 248, 242, .82); }
.clock div + div { border-left: 1px solid rgba(176, 145, 90, .45); }
.num { font-weight: 400; font-size: 42px; line-height: 1; color: var(--slate-deep); font-variant-numeric: lining-nums tabular-nums; transition: opacity .2s; }
.num.tick { opacity: .25; }
.clock small { margin-top: 8px; font-family: var(--caps); font-size: 13px; letter-spacing: .16em; color: var(--ink-soft); }
.note { margin: 24px 0 0; font-style: italic; color: var(--ink-soft); }

.divider-art { width: 62%; margin: 8px auto -10px; }

/* ---------- Programme ---------- */
.moment { display: flex; flex-direction: column; align-items: center; }
.moment-art { width: 82%; margin-bottom: 18px; }
.moment-art-after { width: 100%; margin: 22px 0 0; }
.moment-portrait { width: 70%; margin: 24px 0 0; }
.moment-time { margin: 4px 0 0; font-weight: 300; font-size: 54px; line-height: 1.1; color: var(--slate-deep); font-variant-numeric: lining-nums; }
.moment-place { margin: 6px 0 0; font-weight: 500; font-size: 24px; line-height: 1.3; }
.moment-addr { margin: 4px 0 0; font-style: italic; color: var(--ink-soft); }
.actions { display: grid; gap: 10px; width: 100%; max-width: 320px; margin-top: 22px; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 46px 0; color: var(--gold); }
.ornament span { height: 1px; width: 70px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament span:last-child { transform: scaleX(-1); }
.ornament i { font-style: normal; font-size: 22px; }

.btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 12px 22px;
  font-family: var(--caps); font-weight: 500; font-size: 15px; letter-spacing: .2em; text-transform: lowercase;
  color: var(--slate-deep); text-decoration: none;
  background: transparent;
  border: 1px solid var(--slate);
  border-radius: 0;
  transition: background .5s var(--ease), color .5s var(--ease);
}
.btn:hover { background: var(--powder-soft); }
.btn:active { transform: translateY(1px); }
.btn-main { width: 100%; min-height: 56px; color: var(--ivory); background: var(--slate); border-color: var(--slate); box-shadow: inset 0 0 0 3px var(--slate), inset 0 0 0 4px rgba(251, 248, 242, .55); }
.btn-main:hover { background: var(--slate-deep); }
.btn-main[disabled] { opacity: .7; cursor: progress; }
.btn-quiet { border-color: transparent; color: var(--ink-soft); }

.garland { width: 88%; margin: 0 auto; }

/* ---------- Récapitulatif ---------- */
.recap { padding-top: 32px; padding-bottom: 24px; }
.recap h2 { margin: 0 0 28px; font-size: clamp(46px, 12.5vw, 60px); line-height: 1.15; padding: 0 .1em; }
.timeline { position: relative; list-style: none; margin: 0 auto; padding: 0; max-width: 380px; }
.timeline::before { /* fil central */
  content: ""; position: absolute; left: 50%; top: 12px; bottom: 12px; width: 1px; margin-left: -.5px;
  background: linear-gradient(transparent, rgba(91, 111, 136, .45) 8%, rgba(91, 111, 136, .45) 92%, transparent);
}
.tl-step { position: relative; display: grid; grid-template-columns: 1fr 44px 1fr; align-items: center; min-height: 128px; }
.tl-text { grid-column: 1; text-align: right; padding-right: 4px; }
.tl-icon { grid-column: 3; justify-self: start; margin-left: 4px; width: 42px; height: 42px;
  fill: none; stroke: var(--slate-deep); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tl-right .tl-text { grid-column: 3; text-align: left; padding: 0 0 0 4px; }
.tl-right .tl-icon { grid-column: 1; grid-row: 1; justify-self: end; margin: 0 4px 0 0; }
.tl-dot { grid-column: 2; grid-row: 1; justify-self: center; width: 13px; height: 13px; position: relative; }
.tl-dot::before { /* petit cœur */
  content: ""; position: absolute; inset: 0;
  background: var(--slate);
  clip-path: path("M6.5 12.2C2.6 9.2 0 6.9 0 4.1 0 1.8 1.8 0 4 0c1.1 0 2 .5 2.5 1.3C7 .5 7.9 0 9 0c2.2 0 4 1.8 4 4.1 0 2.8-2.6 5.1-6.5 8.1z");
}
.tl-time {
  display: inline-block; margin: 0 0 6px; padding-bottom: 3px;
  font-weight: 400; font-size: 28px; line-height: 1; color: var(--slate-deep); font-variant-numeric: lining-nums;
  border-bottom: 1px solid var(--gold);
}
.tl-title { margin: 0; font-family: var(--caps); font-weight: 500; font-size: 16px; letter-spacing: .14em; text-transform: lowercase; color: var(--ink); line-height: 1.3; }
.tl-place { margin: 3px 0 0; font-size: 15.5px; font-style: italic; line-height: 1.35; color: var(--ink-soft); }

/* ---------- Infos ---------- */
.info { margin: 0 auto 56px; max-width: 380px; }
.info:last-child { margin-bottom: 0; }
.info h3 { margin: 14px 0 6px; font-size: 18px; color: var(--slate-deep); }
.info p { margin: 0; }
.info p + p { margin-top: 12px; }
.info p em { font-style: italic; color: var(--slate-deep); }
.duo { display: flex; justify-content: center; align-items: flex-end; gap: 4%; }
.duo img { width: 46%; }
.info-art { width: 84%; margin: 0 auto; }
.info-art-sm { width: 52%; }

/* ---------- RSVP ---------- */
.rsvp { padding-top: 0; }
.chandelier { width: 46%; margin: 0 auto 20px; transform-origin: 50% 0; animation: swing 8s ease-in-out infinite; position: relative; z-index: 1; }
@keyframes swing { 0%, 100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }
.rsvp-card {
  position: relative; padding: 44px 24px 36px;
  background: var(--ivory);
  border: 1px solid rgba(176, 145, 90, .6);
  outline: 1px solid rgba(176, 145, 90, .35); outline-offset: -7px;
  box-shadow: 0 20px 50px -26px rgba(60, 80, 110, .35);
}
.rsvp .head h2 { font-size: clamp(38px, 10.5vw, 50px); }
.deadline { margin: 10px 0 0; font-style: italic; color: var(--ink-soft); }
.deadline strong {
  display: inline-block; margin-top: 8px; padding: 6px 18px;
  font-family: var(--caps); font-style: normal; font-weight: 500; font-size: 19px; letter-spacing: .14em;
  color: var(--slate-deep); font-variant-numeric: lining-nums;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
}
form { display: grid; gap: 24px; text-align: left; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.label { font-family: var(--caps); font-weight: 500; font-size: 15px; letter-spacing: .14em; text-transform: lowercase; color: var(--slate); padding: 0; }
.label em { font-family: var(--serif); letter-spacing: 0; color: var(--ink-soft); }
input[type="text"], textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid rgba(91, 111, 136, .45); border-radius: 0;
  padding: 6px 2px; outline: none; transition: border-color .4s;
}
textarea { border: 1px solid rgba(91, 111, 136, .35); padding: 10px 12px; resize: vertical; }
input[type="text"]:focus, textarea:focus { border-color: var(--slate); }
::placeholder { color: #a9abb2; font-style: italic; }
.err { display: none; font-size: 16px; font-style: italic; color: #9a4a3c; }
.field.invalid .err { display: block; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; opacity: 0; }
.choice > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 92px; padding: 10px 6px; text-align: center;
  border: 1px solid rgba(91, 111, 136, .4);
  transition: all .5s var(--ease);
}
.choice b { font-weight: 400; font-size: 32px; line-height: 1.15; color: var(--slate-deep); }
.choice small { font-size: 15px; font-style: italic; color: var(--ink-soft); }
.choice input:checked + span { background: var(--powder-soft); border-color: var(--slate); box-shadow: inset 0 0 0 3px var(--ivory), inset 0 0 0 4px rgba(91, 111, 136, .5); }
.choice input:focus-visible + span { outline: 1.5px solid var(--slate); outline-offset: 3px; }
.if-yes { display: grid; gap: 24px; }
.if-yes[hidden] { display: none; }
.stepper { display: inline-grid; grid-template-columns: 48px 60px 48px; justify-self: start; border: 1px solid rgba(91, 111, 136, .4); }
.stepper button { appearance: none; height: 46px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 24px; color: var(--slate); }
.stepper output { text-align: center; line-height: 46px; font-size: 22px; font-variant-numeric: lining-nums; border-left: 1px solid rgba(91, 111, 136, .3); border-right: 1px solid rgba(91, 111, 136, .3); }
.status { margin: -8px 0 0; text-align: center; font-style: italic; color: #9a4a3c; }

/* ---------- Pied de page ---------- */
.footer { padding: 40px 28px max(56px, env(safe-area-inset-bottom)); }
.foot-seal { --s: 132px; position: relative; width: var(--s); height: var(--s); margin: 0 auto; filter: drop-shadow(0 6px 8px rgba(60, 70, 90, .25)); }
.foot-seal img { width: 100%; height: 100%; }
.foot-seal .seal-mono { color: #e4d9c3; text-shadow: -1px -1px 0 rgba(255, 255, 255, .9), 1px 1.5px 1.5px rgba(100, 80, 50, .55); }
.foot-names { margin: 14px 0 0; font-size: 38px; padding: 0 .1em; }
.foot-date { font-size: 14px; }

/* ==========================================================
   Fenêtres
   ========================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: 20px;
  background: rgba(251, 248, 242, .88);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fade .8s var(--ease);
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.thanks-card { max-width: 400px; text-align: center; display: grid; justify-items: center; gap: 12px; }
.thanks-art { width: 66%; animation: rise 1.4s var(--ease) both; }
.thanks h2 { margin: 0; font-size: 84px; line-height: 1.1; animation: rise 1.4s var(--ease) .3s both; padding: 0 .1em; }
.thanks-msg { margin: 0 0 8px; font-size: 20px; font-style: italic; animation: rise 1.4s var(--ease) .5s both; }
.thanks .btn { width: 100%; animation: rise 1.4s var(--ease) .7s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.sheet { place-items: end center; background: rgba(62, 76, 97, .3); }
.sheet-card {
  width: min(100%, 440px); display: grid; gap: 10px;
  padding: 24px 22px max(22px, env(safe-area-inset-bottom));
  background: var(--ivory); text-align: center;
  animation: up .5s var(--ease);
}
.sheet-card .caps { margin-bottom: 6px; }
@keyframes up { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .3s !important; }
  .reveal { transform: none; }
}

[hidden] { display: none !important; }

/* champ piège anti-robots, invisible pour les invités */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
