:root {
  --cream: #f6f2e9;
  --cream-2: #efe9db;
  --emerald: #0e4d3a;
  --emerald-deep: #0a3b2c;
  --emerald-soft: #16624a;
  --sage: #7fa78c;
  --sky: #a9d6e5;
  --sky-deep: #4d97b6;
  --gold: #c19a4b;
  --gold-soft: #d9bd80;
  --ink: #1f2b26;
  --muted: #5c6b63;
  --line: rgba(14, 77, 58, 0.16);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --arabic: "Amiri", "Times New Roman", serif;
  --arabic-ui: "Cairo", system-ui, sans-serif;

  --shadow: 0 24px 60px -30px rgba(10, 59, 44, 0.4);
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Arabic mode */
html[dir="rtl"] body { font-family: var(--arabic-ui); }
html[dir="rtl"] .names,
html[dir="rtl"] .section-title,
html[dir="rtl"] .footer__names { font-family: var(--arabic); font-weight: 400; }

::selection { background: var(--gold-soft); color: var(--emerald-deep); }

/* ============ TOPBAR ============ */
.topbar {
  /* --lb-h : hauteur du bandeau « lovebar » (lovebar.css), 0 s'il est absent */
  position: fixed; inset-block-start: var(--lb-h, 0px); inset-inline: 0;
  z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 48px);
  background: linear-gradient(to bottom, rgba(246, 242, 233, 0.86), rgba(246, 242, 233, 0));
  backdrop-filter: blur(6px);
}
.monogram {
  font-family: var(--serif); font-size: 1.5rem; letter-spacing: 0.04em;
  color: var(--emerald); text-decoration: none; display: inline-flex; gap: 4px; align-items: center;
  white-space: nowrap; flex: 0 0 auto;
}
.monogram .amp { color: var(--gold); font-style: italic; }
.langswitch { display: inline-flex; gap: 4px; background: rgba(255,255,255,0.5); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.langswitch button {
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.06em;
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: all 0.25s ease;
}
.langswitch button.is-active { background: var(--emerald); color: var(--cream); }
.langswitch button[data-lang="ar"] { font-family: var(--arabic-ui); font-size: 1rem; }

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 2.4vh, 26px);
  padding: calc(110px + var(--lb-h, 0px)) clamp(18px, 5vw, 40px) 88px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(169, 214, 229, 0.5), transparent 60%),
    radial-gradient(900px 500px at 50% 120%, rgba(127, 167, 140, 0.35), transparent 60%),
    var(--cream);
  text-align: center; overflow: hidden;
}
.hero__zellige {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%230e4d3a' stroke-opacity='0.08' stroke-width='1'%3E%3Cpath d='M60 8l14 30 32 4-22 24 6 32-30-16-30 16 6-32-22-24 32-4z'/%3E%3Ccircle cx='60' cy='60' r='30'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 150px 150px;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, black, transparent 72%);
  mask-image: radial-gradient(circle at 50% 45%, black, transparent 72%);
}

.arch { position: relative; width: min(720px, 96vw); padding: clamp(20px, 5vw, 40px); }
.arch__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.arch__line {
  stroke: var(--gold); stroke-width: 1.4; fill: none;
  stroke-dasharray: 2600; stroke-dashoffset: 2600;
  animation: draw 2.6s ease forwards 0.2s;
}
.arch__line--inner { stroke: var(--sage); stroke-width: 0.9; opacity: 0.7; animation-delay: 0.5s; animation-duration: 3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero__content {
  position: relative; z-index: 2;
  padding-block: clamp(52px, 11vw, 88px) 34px;
  padding-inline: clamp(48px, 11vw, 104px);
}
.hero__invite {
  position: relative; z-index: 2;
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.15rem, 3.6vw, 1.7rem);
  color: var(--sky-deep); letter-spacing: 0.01em; line-height: 1.45;
  max-width: 20ch; margin-inline: auto; text-wrap: balance;
}
.hero__invite::before {
  content: ""; display: block; width: 46px; height: 1px; margin: 0 auto 18px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
html[dir="rtl"] .hero__invite { font-family: var(--arabic); font-style: normal; font-weight: 400; letter-spacing: 0; }

.hero__bismillah {
  position: relative; z-index: 2;
  font-family: var(--arabic);
  font-size: clamp(1.35rem, 3.6vw, 1.7rem);
  color: var(--gold); line-height: 1;
  margin-block-end: clamp(2px, 1vw, 6px);
}

.names { display: flex; flex-direction: column; align-items: center; gap: 6px; line-height: 1.02; }
.names__line {
  display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.6vw, 12px);
  font-family: var(--serif); font-weight: 500; color: var(--emerald);
  line-height: 1;
}
.names__first {
  font-size: clamp(2rem, 7vw, 4.2rem); letter-spacing: 0.01em;
}
.names__last {
  font-size: clamp(1.1rem, 3.4vw, 1.9rem); text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--emerald-soft);
}
html[dir="rtl"] .names__last { letter-spacing: 0.04em; }
.names__amp {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--gold); margin-block: 4px;
}
html[dir="rtl"] .names__line { font-family: var(--arabic); font-weight: 400; }
html[dir="rtl"] .card__value,
html[dir="rtl"] .hero__date,
html[dir="rtl"] .countdown__done,
html[dir="rtl"] #doneMsg { font-family: var(--arabic); }

.hero__rule { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold); margin-block: 22px 18px; font-size: 0.9rem; }
.hero__rule span { display: block; width: clamp(40px, 12vw, 80px); height: 1px; background: linear-gradient(to right, transparent, var(--gold)); }
.hero__rule span:last-child { background: linear-gradient(to left, transparent, var(--gold)); }

.hero__subtitle { color: var(--muted); font-size: clamp(0.95rem, 2.5vw, 1.05rem); max-width: 25ch; margin-inline: auto; }
.hero__date {
  margin-block-start: 20px; font-family: var(--serif); font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  color: var(--emerald-soft); letter-spacing: 0.06em; font-style: italic;
}

/* Countdown */
.countdown { position: relative; z-index: 2; text-align: center; }
.countdown__title { font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); margin-block-end: 16px; }
html[dir="rtl"] .countdown__title { letter-spacing: 0.05em; font-size: 0.9rem; }
.countdown__grid { display: flex; gap: clamp(10px, 3vw, 26px); justify-content: center; }
.cd {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: clamp(58px, 16vw, 84px);
  padding: 16px 6px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line);
}
.cd__num { font-family: var(--serif); font-size: clamp(1.7rem, 6vw, 2.6rem); font-weight: 600; color: var(--emerald); font-variant-numeric: tabular-nums; }
.cd__lbl { font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
html[dir="rtl"] .cd__lbl { letter-spacing: 0; font-size: 0.78rem; }
.countdown__done { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--emerald); }

.scrollhint {
  position: absolute; inset-block-end: 22px; inset-inline-start: 50%; transform: translateX(-50%);
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
}
html[dir="rtl"] .scrollhint { transform: translateX(50%); }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0);} 50% { transform: translateX(-50%) translateY(6px);} }

/* ============ VERSES ============ */
.verses {
  background:
    radial-gradient(700px 400px at 80% 0%, rgba(77,151,182,0.18), transparent 60%),
    linear-gradient(160deg, var(--emerald) 0%, var(--emerald-deep) 100%);
  color: var(--cream); text-align: center;
  padding: clamp(80px, 12vw, 140px) clamp(18px, 5vw, 40px);
  display: flex; flex-direction: column; align-items: center; gap: clamp(40px, 7vw, 72px);
}
.kicker { font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--gold-soft); }
html[dir="rtl"] .kicker { letter-spacing: 0.06em; font-size: 0.92rem; }
/* ---- Slider des versets ---- */
.verse-slider { position: relative; width: min(860px, 100%); display: flex; align-items: center; }
.verse-track {
  display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; -ms-overflow-style: none; scrollbar-width: none;
}
.verse-track::-webkit-scrollbar { display: none; }
.verse.slide { flex: 0 0 100%; width: 100%; scroll-snap-align: center; }
.verse-nav {
  position: absolute; z-index: 3; inset-block-start: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border-radius: 50%; cursor: pointer; color: var(--cream);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(217, 189, 128, 0.5);
  transition: background 0.25s ease;
}
.verse-nav:hover { background: rgba(217, 189, 128, 0.24); }
.verse-nav--prev { inset-inline-start: -6px; }
.verse-nav--next { inset-inline-end: -6px; }
html[dir="rtl"] .verse-nav--prev svg,
html[dir="rtl"] .verse-nav--next svg { transform: scaleX(-1); }
.verse-dots {
  position: absolute; inset-block-end: -16px; inset-inline-start: 50%;
  transform: translateX(-50%); display: flex; gap: 10px;
}
html[dir="rtl"] .verse-dots { transform: translateX(50%); }
.verse-dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%; cursor: pointer;
  background: rgba(246, 242, 233, 0.3); border: 0; transition: all 0.3s ease;
}
.verse-dot.is-active { background: var(--gold-soft); transform: scale(1.25); }
@media (max-width: 620px) {
  .verse-nav { width: 38px; height: 38px; }
  .verse-nav--prev { inset-inline-start: 0; }
  .verse-nav--next { inset-inline-end: 0; }
}
.verse__frame { position: relative; padding: clamp(24px, 5vw, 40px) clamp(48px, 8vw, 72px); }
.verse__ar {
  font-family: var(--arabic); font-weight: 400; line-height: 2.1;
  font-size: clamp(1.6rem, 5.4vw, 2.5rem); color: #fff;
  text-shadow: 0 2px 30px rgba(0,0,0,0.25);
}
.verse__underline { display: block; width: 0; height: 1px; margin: 22px auto; background: linear-gradient(to right, transparent, var(--gold), transparent); transition: width 1.4s ease; }
.verse.in .verse__underline { width: min(320px, 70%); }
.verse__tr { font-family: var(--serif); font-style: italic; font-size: clamp(1rem, 3vw, 1.3rem); color: rgba(246,242,233,0.9); max-width: 52ch; margin-inline: auto; }
html[dir="rtl"] .verse__tr { display: none; }
.verse__ref { margin-block-start: 18px; font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-soft); }
html[dir="rtl"] .verse__ref { letter-spacing: 0; font-size: 0.9rem; font-family: var(--arabic); }

/* ============ DETAILS ============ */
.details {
  padding: clamp(80px, 12vw, 130px) clamp(18px, 5vw, 40px);
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.section-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 6vw, 3rem); color: var(--emerald); margin-block: 6px 10px; }
.details__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 28px); width: min(880px, 100%); margin-block-start: 24px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(26px, 4vw, 40px) 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.card__icon { color: var(--sky-deep); background: rgba(169,214,229,0.22); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-block-end: 6px; }
.card__label { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
html[dir="rtl"] .card__label { letter-spacing: 0; font-size: 0.9rem; }
.card__value { font-family: var(--serif); font-size: clamp(1.25rem, 3.5vw, 1.6rem); color: var(--emerald); }
.card__sub { color: var(--muted); font-size: 0.95rem; }
.link-btn {
  margin-block-start: 14px; display: inline-block; cursor: pointer;
  font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.08em;
  color: var(--emerald); background: transparent; border: 1px solid var(--emerald);
  padding: 10px 20px; border-radius: 999px; text-decoration: none; transition: all 0.25s ease;
}
.link-btn:hover { background: var(--emerald); color: var(--cream); }

/* ============ RSVP ============ */
.rsvp {
  padding: clamp(80px, 12vw, 130px) clamp(18px, 5vw, 40px);
  background:
    radial-gradient(600px 380px at 10% 10%, rgba(127,167,140,0.22), transparent 60%),
    var(--cream-2);
  display: flex; justify-content: center;
}
.rsvp__inner {
  width: min(620px, 100%); background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: clamp(30px, 6vw, 54px); text-align: center;
}
.rsvp__subtitle { color: var(--muted); margin-block-end: 26px; }
.alert { background: rgba(193,154,75,0.12); border: 1px solid var(--gold-soft); color: #7a5c1c; border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; margin-block-end: 20px; }

#rsvpForm { text-align: start; display: flex; flex-direction: column; gap: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span, .choice legend { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
html[dir="rtl"] .field > span, html[dir="rtl"] .choice legend { letter-spacing: 0; font-size: 0.95rem; }
.field input, .field textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: var(--cream);
  transition: border-color 0.2s ease, box-shadow 0.2s ease; width: 100%; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(127,167,140,0.22); }

.choice { border: 0; }
.choice__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-block-start: 10px; }
.pill {
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--cream);
  font-size: 0.98rem; transition: all 0.2s ease; user-select: none;
}
.pill input { accent-color: var(--emerald); margin: 0; }
.pill:has(input:checked) { border-color: var(--emerald); background: rgba(14,77,58,0.06); color: var(--emerald); font-weight: 500; box-shadow: 0 0 0 2px rgba(14,77,58,0.12); }

.form-error { color: #b04a3a; font-size: 0.9rem; }
.submit {
  margin-block-start: 6px; font-family: var(--sans); font-size: 0.92rem; letter-spacing: 0.1em;
  color: var(--cream); background: var(--emerald); border: 0; border-radius: 999px;
  padding: 16px; cursor: pointer; transition: background 0.25s ease, transform 0.1s ease;
}
.submit:hover { background: var(--emerald-soft); }
.submit:active { transform: translateY(1px); }
.submit:disabled { opacity: 0.6; cursor: default; }

.rsvp__done { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-block: 10px; }
.rsvp__seal { color: var(--emerald); background: rgba(14,77,58,0.08); width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; animation: pop 0.5s cubic-bezier(0.2,0.9,0.3,1.4); }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#doneMsg { font-family: var(--serif); font-size: 1.4rem; color: var(--emerald); max-width: 30ch; }
.rsvp__locknote { font-size: 0.82rem; color: var(--muted); }

/* ============ FOOTER ============ */
.footer {
  background: linear-gradient(160deg, var(--emerald-deep), #072318);
  color: var(--cream); text-align: center; padding: clamp(60px, 9vw, 90px) 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.footer__names { font-family: var(--serif); font-size: clamp(1.6rem, 5vw, 2.2rem); letter-spacing: 0.04em; }
.footer__names span { color: var(--gold); font-style: italic; }
.footer__thanks { color: rgba(246,242,233,0.75); font-size: 0.98rem; }
.footer__date { font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--sage); margin-block-start: 8px; }
html[dir="rtl"] .footer__date { letter-spacing: 0.05em; }

.footer__credit {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  margin-block-start: 28px; padding-block-start: 20px;
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(246, 242, 233, 0.4);
}
.footer__credit::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 40px; height: 1px;
  background: linear-gradient(to right, transparent, rgba(217, 189, 128, 0.5), transparent);
}
.footer__heart { color: var(--gold-soft); flex: none; }
html[dir="rtl"] .footer__credit { letter-spacing: 0.02em; text-transform: none; font-family: var(--arabic-ui); font-size: 0.76rem; }

/* ============ Feuilles ============ */
.leaves { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.leaf { position: absolute; inset-block-start: -8%; width: 14px; height: 14px; opacity: 0; will-change: transform; }
.leaf svg { width: 100%; height: 100%; }
@keyframes fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.8; }
  100% { transform: translateY(110vh) rotate(320deg); opacity: 0; }
}

/* ============ Reveal ============ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============ Responsive ============ */
@media (max-width: 560px) {
  .details__grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .cd { padding: 12px 4px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .arch__line { stroke-dashoffset: 0; }
  .leaves { display: none; }
}
