/* =========================================================
   Invitation de mariage — Fatima & Zineddine
   Thème : palais de la Casbah, bleu royal & or
   ========================================================= */

:root {
  --night: #070f26;
  --navy: #0a1633;
  --royal: #13306e;
  --zellige: #1f4fa8;
  --sky: #2a5bb8;
  --gold: #d4af5f;
  --gold-deep: #b48a3a;
  --gold-light: #f1d998;
  --ivory: #f7f1e3;
  --ivory-2: #efe5cf;
  --ink: #1b2440;
  --wall: #f4efe4;

  --f-script: "Great Vibes", "Snell Roundhand", cursive;
  --f-title: "Cinzel", "Trajan Pro", serif;
  --f-body: "Cormorant Garamond", Georgia, serif;
  --f-ar: "Amiri", "Traditional Arabic", serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-door: cubic-bezier(.65, .05, .25, 1);

  --zellige-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23d4af5f' stroke-width='1'%3E%3Crect x='24' y='24' width='40' height='40'/%3E%3Crect x='24' y='24' width='40' height='40' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='7'/%3E%3Cpath d='M0 0L24 24M88 0L64 24M0 88L24 64M88 88L64 64M44 0v15.7M44 88V72.3M0 44h15.7M88 44H72.3'/%3E%3C/g%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* aucun défilement horizontal, ni « rebond » latéral sur mobile */
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  scroll-behavior: smooth;
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-body);
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.25rem);
  line-height: 1.6;
  color: var(--ivory);
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  -webkit-font-smoothing: antialiased;
}
/* fond fixe : dégradé bleu nuit + motif zellige discret */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
body::before {
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(42, 91, 184, .35), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--navy) 40%, #0e2354 100%);
}
body::after {
  inset: -100px 0;
  background: var(--zellige-pattern) center / 88px 88px;
  opacity: .07;
  transform: translate3d(0, var(--bgy, 0px), 0);
  will-change: transform;
}

body.is-locked { overflow: hidden; height: 100%; touch-action: none; }
html:has(body.is-locked) { overflow: hidden; overscroll-behavior: none; }
main { overflow-x: clip; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--gold); color: var(--navy); }

/* =========================================================
   OUVERTURE — Porte du palais en 3D
   ========================================================= */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 50% 55%, rgba(255, 190, 110, .18), transparent 70%),
    linear-gradient(180deg, #070f26, #0f2150);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}
.intro__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.intro.is-3d .intro__canvas { opacity: 1; }

.intro__ui {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  opacity: 0;
  transition: opacity .9s ease;
}
.intro.is-ready .intro__ui { opacity: 1; }
.intro.is-opening .intro__ui { opacity: 0; transition-duration: .4s; }

.intro__top,
.intro__bottom {
  text-align: center;
  padding: max(26px, env(safe-area-inset-top)) 20px 60px;
  background: linear-gradient(180deg, rgba(5, 10, 28, .82), rgba(5, 10, 28, 0));
}
.intro__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 70px 20px max(28px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(5, 10, 28, .9), rgba(5, 10, 28, 0));
}
.intro__kicker {
  margin: 0;
  font-family: var(--f-title);
  font-size: clamp(.68rem, .62rem + .3vw, .85rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(247, 241, 227, .85);
}
.intro__names {
  margin: 2px 0 0;
  font-family: var(--f-script);
  font-size: clamp(2.3rem, 1.8rem + 2.6vw, 3.6rem);
  line-height: 1.15;
  color: var(--gold-light);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}
.intro__names span { font-size: .7em; color: var(--ivory); }

/* Bouton principal : très visible */
.intro__cta {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 30px 10px 12px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--f-title);
  font-size: clamp(.9rem, .85rem + .3vw, 1.05rem);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--navy);
  background: linear-gradient(135deg, #fbe7ad, var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 12px 34px -8px rgba(212, 175, 95, .75), inset 0 1px 0 rgba(255, 255, 255, .6);
  animation: ctaPulse 2.2s ease-in-out infinite;
  transition: transform .3s var(--ease-out);
}
.intro__cta:hover { transform: translateY(-2px) scale(1.03); }
.intro__cta:focus-visible { outline: 3px solid var(--ivory); outline-offset: 5px; }
.intro__cta::after {
  /* reflet qui balaie le bouton */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%);
  background-size: 250% 100%;
  animation: ctaShine 3.2s ease-in-out infinite;
  pointer-events: none;
}
.intro__cta-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
}
.intro__cta-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.intro__help {
  margin: 0;
  font-style: italic;
  font-size: 1rem;
  color: rgba(247, 241, 227, .8);
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 12px 34px -8px rgba(212, 175, 95, .75), 0 0 0 0 rgba(241, 217, 152, .55), inset 0 1px 0 rgba(255, 255, 255, .6); }
  50% { box-shadow: 0 12px 34px -8px rgba(212, 175, 95, .75), 0 0 0 14px rgba(241, 217, 152, 0), inset 0 1px 0 rgba(255, 255, 255, .6); }
}
@keyframes ctaShine { 0%, 40% { background-position: 120% 0; } 100% { background-position: -130% 0; } }

/* Main qui tapote la porte */
.tap-hint {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  opacity: 0;
  transition: opacity .6s ease;
}
.intro.is-3d.is-ready .tap-hint { opacity: 1; }
.tap-hint__ring {
  position: absolute;
  left: -34px;
  top: -34px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(241, 217, 152, .95);
  box-shadow: 0 0 18px rgba(241, 217, 152, .6);
  animation: ring 1.8s ease-out infinite;
}
.tap-hint__ring--2 { animation-delay: .9s; }
.tap-hint svg { max-width: none; }
.tap-hint__hand {
  position: absolute;
  left: -14px;
  top: -6px;
  width: 54px;
  height: 54px;
  fill: #fff8e6;
  stroke: var(--navy);
  stroke-width: 2.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5));
  animation: tap 1.8s ease-in-out infinite;
  transform-origin: 30% 20%;
}
@keyframes ring {
  0% { transform: scale(.35); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes tap {
  0%, 100% { transform: translate(10px, 14px) scale(1); }
  45% { transform: translate(0, 0) scale(.92); }
  55% { transform: translate(0, 0) scale(.92); }
}

.intro__loader {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 46px;
  height: 46px;
  transition: opacity .5s;
}
.intro__loader span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 95, .2);
  border-top-color: var(--gold-light);
  animation: spinSlow 1s linear infinite;
}
.intro.is-ready .intro__loader { opacity: 0; }

.intro__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #fff6dc, #f3cf86 60%, #d9a24a);
  opacity: 0;
  pointer-events: none;
  transition: opacity .9s ease;
}
.intro.is-flash .intro__flash { opacity: 1; }
.intro.is-leaving { opacity: 0; transition: opacity 1.1s ease; pointer-events: none; }
.intro.is-done { display: none; }

@keyframes spinSlow { to { rotate: 360deg; } }

/* =========================================================
   UI fixe : progression, particules, musique
   ========================================================= */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 50;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-light), var(--gold));
  box-shadow: 0 0 10px rgba(241, 217, 152, .6);
}

.sparkles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* =========================================================
   HÉRO — La Casbah la nuit
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse 80% 60% at 70% 15%, rgba(66, 112, 205, .45), transparent 70%),
    linear-gradient(180deg, #050b1f 0%, #0b1d4a 45%, #1a3f8f 80%, #2a5bb8 100%);
}

.hero__sky { position: absolute; inset: 0; z-index: -2; }
.stars { position: absolute; inset: 0 0 30% 0; }
.star {
  position: absolute;
  width: var(--s, 2px);
  height: var(--s, 2px);
  border-radius: 50%;
  background: #fff;
  opacity: .2;
  animation: twinkle var(--t, 3s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }

.moon {
  position: absolute;
  top: 9%;
  right: 12%;
  width: clamp(56px, 9vw, 96px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset -14px 6px 0 0 #f6e7b8;
  filter: drop-shadow(0 0 18px rgba(246, 231, 184, .55));
  rotate: -20deg;
}

.lanterns { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.lantern {
  position: absolute;
  top: 0;
  width: clamp(34px, 5vw, 56px);
}
.lantern svg {
  width: 100%;
  height: auto;
  transform-origin: 50% 0;
  animation: sway 6s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(255, 196, 92, .75)) drop-shadow(0 0 40px rgba(255, 170, 60, .35));
}
.lantern--1 { left: 7%; }
.lantern--1 svg { height: clamp(150px, 24vh, 240px); width: auto; }
.lantern--2 { right: 8%; }
.lantern--2 svg { height: clamp(110px, 17vh, 180px); width: auto; animation-delay: -2s; animation-duration: 7s; }
.lantern--3 { left: 24%; }
.lantern--3 svg { height: clamp(80px, 11vh, 120px); width: auto; animation-delay: -4s; animation-duration: 5.5s; opacity: .85; }
@keyframes sway { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }

.hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 7vh 20px 30vh;
  will-change: transform, opacity;
}

.hero__bismillah {
  margin: 0 0 1.2rem;
  font-family: var(--f-ar);
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.9rem);
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(241, 217, 152, .35);
}
.hero__kicker {
  margin: 0;
  font-family: var(--f-title);
  font-size: clamp(.72rem, .66rem + .3vw, .9rem);
  letter-spacing: .4em;
  text-transform: uppercase;
  color: rgba(247, 241, 227, .8);
}
.hero__names {
  margin: .2em 0 .35em;
  font-family: var(--f-script);
  font-weight: 400;
  line-height: .95;
  font-size: clamp(3.4rem, 1.8rem + 7vw, 7rem);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero__name {
  background: linear-gradient(100deg, var(--gold-deep) 0%, var(--gold-light) 25%, #fff6d8 40%, var(--gold) 60%, var(--gold-light) 80%, var(--gold-deep) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 .12em;
  animation: shimmer 7s linear infinite;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .35));
}
.hero__amp {
  font-size: .45em;
  color: var(--ivory);
  margin: -.05em 0;
  opacity: .85;
}
@keyframes shimmer { to { background-position: -250% 0; } }

.hero__date {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 2.5vw, 22px);
  font-family: var(--f-title);
  font-size: clamp(.7rem, .62rem + .35vw, .9rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(247, 241, 227, .85);
}
.hero__date strong {
  font-weight: 600;
  font-size: 1.35em;
  letter-spacing: .18em;
  color: var(--gold-light);
  padding: .45em 1em;
  border-block: 1px solid rgba(212, 175, 95, .6);
}

/* Entrée du héro après l'ouverture */
.js .hero__bismillah,
.js .hero__kicker,
.js .hero__name,
.js .hero__amp,
.js .hero__date {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(8px);
  transition: opacity 1.4s var(--ease-out), transform 1.4s var(--ease-out), filter 1.4s var(--ease-out);
}
.hero.is-in .hero__bismillah { transition-delay: .1s; }
.hero.is-in .hero__kicker { transition-delay: .35s; }
.hero.is-in .hero__name:nth-child(1) { transition-delay: .55s; }
.hero.is-in .hero__amp { transition-delay: .8s; }
.hero.is-in .hero__name:nth-child(3) { transition-delay: 1s; }
.hero.is-in .hero__date { transition-delay: 1.3s; }
.hero.is-in .hero__bismillah,
.hero.is-in .hero__kicker,
.hero.is-in .hero__name,
.hero.is-in .hero__amp,
.hero.is-in .hero__date { opacity: 1; transform: none; filter: none; }

/* Silhouette de la Casbah */
.skyline {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: clamp(190px, 38vh, 400px);
  z-index: 1;
  pointer-events: none;
}
.skyline__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}
.skyline::after {
  /* fondu vers la page */
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 22%;
  background: linear-gradient(180deg, transparent, var(--night));
}
.win-lit { animation: flicker 5s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .75; } 50% { opacity: .95; } }

.scroll-hint {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: var(--f-title);
  font-size: .65rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--gold-light);
  opacity: 0;
  transition: opacity 1s 2s;
}
.hero.is-in .scroll-hint { opacity: .9; }
.scroll-hint i {
  width: 1px;
  height: 42px;
  background: linear-gradient(var(--gold-light), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-hint i::after {
  content: "";
  position: absolute;
  left: 0; top: -40%;
  width: 100%; height: 40%;
  background: #fff;
  animation: drip 2s ease-in-out infinite;
}
@keyframes drip { to { top: 110%; } }

/* =========================================================
   SECTIONS
   ========================================================= */
.section {
  position: relative;
  padding: clamp(80px, 14vh, 150px) clamp(18px, 5vw, 40px);
  text-align: center;
}
.section__title {
  margin: 0;
  font-family: var(--f-title);
  font-weight: 400;
  font-size: clamp(1.25rem, 1rem + 1.4vw, 2.1rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.ornament {
  width: clamp(170px, 30vw, 240px);
  height: auto;
  margin: 18px auto 34px;
  overflow: visible;
}
.ornament .orn-line { fill: none; stroke: var(--gold); stroke-width: 1.2; }
.ornament .orn-star { fill: var(--gold); }
.ornament .orn-dot { fill: var(--gold-light); }
.ornament--draw .orn-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1.8s var(--ease-out) .2s;
}
.ornament--draw .orn-star,
.ornament--draw .orn-dot {
  transform-box: fill-box;
  transform-origin: center;
  scale: 0;
  transition: scale 1s var(--ease-out) .6s;
}
.ornament--draw.is-visible .orn-line { stroke-dashoffset: 0; }
.ornament--draw.is-visible .orn-star,
.ornament--draw.is-visible .orn-dot { scale: 1; }

/* Apparitions au défilement */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(6px);
  transition:
    opacity 1.1s var(--ease-out) var(--d, 0s),
    transform 1.1s var(--ease-out) var(--d, 0s),
    filter 1.1s var(--ease-out) var(--d, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; filter: none; }

/* ---------- Invitation (carte en arche) ---------- */
.invitation { padding-top: clamp(40px, 8vh, 90px); }

.arch-card {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  padding: 10px;
  border-radius: 340px 340px 18px 18px;
  background: linear-gradient(160deg, var(--gold-light), var(--gold-deep) 40%, var(--gold) 60%, var(--gold-deep));
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7);
}
.arch-card__inner {
  position: relative;
  border-radius: 330px 330px 12px 12px;
  padding: clamp(90px, 16vw, 130px) clamp(22px, 7vw, 70px) clamp(44px, 7vw, 64px);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 0%, #fffdf6 0%, transparent 60%),
    var(--ivory);
  overflow: hidden;
}
.arch-card__inner::before {
  /* liseré intérieur */
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 320px 320px 8px 8px;
  border: 1px solid rgba(180, 138, 58, .55);
  pointer-events: none;
}
.arch-card__inner::after {
  /* motif zellige discret */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--zellige-pattern) center / 70px 70px;
  opacity: .12;
  pointer-events: none;
}
.arch-card .ornament { margin: 0 auto 26px; }
.arch-card .ornament .orn-line { stroke: var(--gold-deep); }
.arch-card .ornament .orn-star, .arch-card .ornament .orn-dot { fill: var(--gold-deep); }

.verse { margin: 0 0 26px; position: relative; z-index: 1; }
.verse__ar {
  margin: 0 0 14px;
  font-family: var(--f-ar);
  font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem);
  line-height: 2;
  color: var(--royal);
}
.verse__fr {
  margin: 0 0 8px;
  font-style: italic;
  font-size: clamp(1rem, .95rem + .25vw, 1.15rem);
  color: #3a4260;
}
.verse cite {
  font-style: normal;
  font-family: var(--f-title);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.invitation__lead,
.invitation__text {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem);
}
.invitation__couple {
  position: relative;
  z-index: 1;
  margin: 8px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--f-script);
  font-size: clamp(2.4rem, 1.8rem + 3vw, 3.6rem);
  line-height: 1.25;
  color: var(--royal);
}
.invitation__couple em { font-style: normal; color: var(--gold-deep); font-size: .7em; line-height: 1; }

.invitation__when {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(12px, 3vw, 26px);
}
.invitation__when > div:not(.sep) { display: flex; flex-direction: column; gap: 2px; flex: 1; max-width: 190px; }
.invitation__when .label {
  font-family: var(--f-title);
  font-size: .62rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.invitation__when strong { font-weight: 600; font-size: clamp(1rem, .95rem + .3vw, 1.15rem); line-height: 1.3; color: var(--royal); }
.invitation__when .sep { width: 1px; background: linear-gradient(transparent, var(--gold), transparent); }

/* ---------- Compte à rebours ---------- */
.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 2.5vw, 26px);
  max-width: 720px;
  margin: 0 auto 44px;
}
.tile {
  position: relative;
  padding: clamp(26px, 5vw, 44px) 6px clamp(14px, 2.5vw, 22px);
  border-radius: 50% 50% 10px 10px / 56px 56px 10px 10px;
  border: 1px solid rgba(212, 175, 95, .65);
  background:
    linear-gradient(180deg, rgba(31, 79, 168, .35), rgba(7, 15, 38, .6)),
    var(--zellige-pattern) center / 40px 40px;
  box-shadow: inset 0 0 0 5px rgba(7, 15, 38, .5), inset 0 0 0 6px rgba(212, 175, 95, .25), 0 20px 40px -20px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.tile__num {
  display: block;
  font-family: var(--f-title);
  font-size: clamp(1.7rem, 1.1rem + 3.2vw, 3.4rem);
  line-height: 1;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(241, 217, 152, .3);
}
.tile__num.tick { animation: tick .6s var(--ease-out); }
@keyframes tick {
  0% { transform: translateY(-40%); opacity: 0; filter: blur(4px); }
  100% { transform: none; opacity: 1; filter: none; }
}
.tile__label {
  display: block;
  margin-top: 10px;
  font-family: var(--f-title);
  font-size: clamp(.52rem, .45rem + .3vw, .72rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(247, 241, 227, .75);
}
.countdown__done {
  font-family: var(--f-script);
  font-size: clamp(2.2rem, 1.6rem + 3vw, 3.4rem);
  color: var(--gold-light);
  margin: 0 0 36px;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 50%, var(--gold-deep));
  color: var(--navy);
  font-family: var(--f-title);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(212, 175, 95, .6);
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), background .35s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(212, 175, 95, .75); }
.btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }
.btn--ghost {
  background: rgba(7, 15, 38, .45);
  color: var(--gold-light);
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(212, 175, 95, .14); }

/* ---------- Programme / frise ---------- */
.timeline {
  position: relative;
  list-style: none;
  max-width: 860px;
  margin: 10px auto 0;
  padding: 0;
}
.timeline__line {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  translate: -50% 0;
  background: rgba(212, 175, 95, .18);
  border-radius: 2px;
}
.timeline__line span {
  position: absolute;
  inset: 0;
  transform-origin: top;
  transform: scaleY(0);
  background: linear-gradient(var(--gold-light), var(--gold));
  box-shadow: 0 0 12px rgba(241, 217, 152, .6);
}

.event {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 84px 1fr;
  align-items: center;
  margin-bottom: clamp(40px, 8vh, 80px);
}
.event:last-child { margin-bottom: 0; }

.event__icon {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  z-index: 1;
}
.event__icon::before {
  /* étoile à huit branches */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--navy);
  border: 0;
  clip-path: polygon(50% 0%, 64.6% 14.6%, 85.4% 14.6%, 85.4% 35.4%, 100% 50%, 85.4% 64.6%, 85.4% 85.4%, 64.6% 85.4%, 50% 100%, 35.4% 85.4%, 14.6% 85.4%, 14.6% 64.6%, 0% 50%, 14.6% 35.4%, 14.6% 14.6%, 35.4% 14.6%);
  box-shadow: inset 0 0 0 40px rgba(212, 175, 95, .15);
  transition: background .6s ease, scale .6s var(--ease-out);
}
.event__icon::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--navy);
  clip-path: inherit;
  clip-path: polygon(50% 0%, 64.6% 14.6%, 85.4% 14.6%, 85.4% 35.4%, 100% 50%, 85.4% 64.6%, 85.4% 85.4%, 64.6% 85.4%, 50% 100%, 35.4% 85.4%, 14.6% 85.4%, 14.6% 64.6%, 0% 50%, 14.6% 35.4%, 14.6% 14.6%, 35.4% 14.6%);
  transition: background .6s ease;
}
.event__icon svg {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .6s ease;
}
.event.is-active .event__icon::before { background: var(--gold); scale: 1.08; }
.event.is-active .event__icon::after { background: linear-gradient(135deg, #1d4594, var(--navy)); }
.event.is-active .event__icon svg { stroke: var(--gold-light); }

.event__card {
  grid-row: 1;
  text-align: right;
  padding: 22px 26px;
  border-radius: 16px;
  background: rgba(10, 22, 51, .55);
  border: 1px solid rgba(212, 175, 95, .25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: .3;
  transform: translateX(-30px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out), border-color .9s;
}
.event:nth-child(odd) .event__card {
  grid-column: 3;
  text-align: left;
  transform: translateX(30px);
}
.event:nth-child(even) .event__card { grid-column: 1; }
.event.is-active .event__card { opacity: 1; transform: none; border-color: rgba(212, 175, 95, .55); }

.event__time {
  font-family: var(--f-title);
  font-size: .85rem;
  letter-spacing: .2em;
  color: var(--gold);
}
.event__card h3 {
  margin: 4px 0 6px;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem);
  line-height: 1.1;
  color: var(--gold-light);
}
.event__card p { margin: 0; color: rgba(247, 241, 227, .82); }

/* ---------- Lieu ---------- */
.venue__wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: stretch;
  max-width: 1040px;
  margin: 0 auto;
  text-align: left;
}
.venue__info {
  padding: clamp(28px, 4vw, 44px);
  border-radius: 200px 200px 16px 16px;
  border: 1px solid rgba(212, 175, 95, .5);
  background:
    linear-gradient(180deg, rgba(19, 48, 110, .7), rgba(7, 15, 38, .88)),
    var(--zellige-pattern) center / 56px 56px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(60px, 8vw, 90px);
}
.venue__info h3 {
  margin: 0 0 14px;
  font-family: var(--f-title);
  font-weight: 400;
  font-size: .85rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(247, 241, 227, .8);
}
.venue__info h3 span {
  display: block;
  margin-top: 6px;
  font-family: var(--f-script);
  font-size: clamp(2.4rem, 2rem + 2vw, 3.2rem);
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold-light);
  line-height: 1.1;
}
.venue__info address { font-style: normal; font-size: 1.12rem; line-height: 1.5; }
.venue__time { margin: 10px 0 26px; color: var(--gold); font-style: italic; }
.venue__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.venue__map {
  position: relative;
  min-height: 380px;
  border-radius: 18px;
  overflow: hidden;
  padding: 6px;
  background: linear-gradient(160deg, var(--gold-light), var(--gold-deep) 50%, var(--gold));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7);
}


/* ---------- Final ---------- */
.finale { padding-bottom: clamp(100px, 18vh, 180px); }
.finale__arch {
  max-width: 540px;
  margin: 0 auto;
  padding: clamp(80px, 14vw, 120px) 24px 56px;
  border-radius: 270px 270px 0 0;
  border: 1px solid rgba(212, 175, 95, .55);
  border-bottom: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(241, 217, 152, .12), transparent 70%);
  position: relative;
}
.finale__arch::before {
  content: "";
  position: absolute;
  inset: 10px 10px 0;
  border-radius: 260px 260px 0 0;
  border: 1px solid rgba(212, 175, 95, .25);
  border-bottom: 0;
}
.finale__dua {
  margin: 0 0 22px;
  font-family: var(--f-ar);
  font-size: clamp(1.15rem, 1rem + .8vw, 1.55rem);
  line-height: 1.9;
  color: var(--gold-light);
}
.finale__text {
  margin: 0;
  font-style: italic;
  font-size: clamp(1.25rem, 1.1rem + .6vw, 1.6rem);
  color: rgba(247, 241, 227, .9);
}
.finale__names {
  margin: 18px 0 4px;
  font-family: var(--f-script);
  font-size: clamp(2.8rem, 2rem + 4vw, 4.6rem);
  line-height: 1.1;
  color: var(--gold-light);
}
.finale__names em { font-style: normal; font-size: .6em; color: var(--ivory); }
.finale__date {
  margin: 0;
  font-family: var(--f-title);
  letter-spacing: .35em;
  color: var(--gold);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 760px) {
  .lantern--3 { display: none; }
  .lantern--1 { left: 4%; }
  .lantern--2 { right: 5%; }

  .hero__date { flex-direction: column; gap: 10px; }

  .invitation__when { flex-direction: column; align-items: center; gap: 14px; }
  .invitation__when > div:not(.sep) { max-width: none; }
  .invitation__when .sep { width: 60px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

  .timeline__line { left: 36px; }
  .event { grid-template-columns: 72px 1fr; gap: 14px; }
  .event__icon { grid-column: 1; width: 64px; height: 64px; }
  .event__icon svg { width: 30px; height: 30px; }
  .event:nth-child(odd) .event__card,
  .event:nth-child(even) .event__card {
    grid-column: 2;
    text-align: left;
    transform: translateY(24px);
  }
  .event.is-active .event__card { transform: none; }
  .event__card { padding: 18px 18px; }

  .venue__wrap { grid-template-columns: 1fr; }
  .venue__map { min-height: 300px; }
}

@media (max-width: 420px) {
  .countdown__grid { gap: 8px; }
  .tile { padding-top: 22px; border-radius: 50% 50% 8px 8px / 36px 36px 8px 8px; }
  .tile__label { letter-spacing: .12em; }
  .arch-card { border-radius: 200px 200px 16px 16px; }
  .arch-card__inner { border-radius: 192px 192px 10px 10px; }
  .arch-card__inner::before { border-radius: 182px 182px 6px 6px; }
}

/* Mouvement réduit */
/* =========================================================
   V3 — Navigation rapide, carte, calendrier, animations
   ========================================================= */
main { padding-bottom: 90px; }

.quicknav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 95, .45);
  background: rgba(7, 15, 38, .78);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .7);
  translate: -50% 140%;
  opacity: 0;
  transition: translate .6s var(--ease-out), opacity .6s;
}
.quicknav.is-shown { translate: -50% 0; opacity: 1; }
.quicknav a,
.quicknav .music-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 70px;
  min-height: 52px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(247, 241, 227, .72);
  font-family: var(--f-title);
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color .3s, background .3s;
  -webkit-tap-highlight-color: transparent;
}
.quicknav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.quicknav a.is-active { color: var(--navy); background: linear-gradient(135deg, var(--gold-light), var(--gold)); }
.quicknav a:focus-visible, .quicknav .music-btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.quicknav .music-btn { border-left: 1px solid rgba(212, 175, 95, .25); border-radius: 0 999px 999px 0; }
.quicknav .music-btn[hidden] { display: none; }
.music-btn__bars { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.music-btn__bars i { width: 3px; height: 30%; border-radius: 2px; background: currentColor; transition: height .3s; }
.music-btn.is-playing { color: var(--gold-light); }
.music-btn.is-playing .music-btn__bars i { animation: eq 1s ease-in-out infinite; }
.music-btn.is-playing .music-btn__bars i:nth-child(2) { animation-delay: -.3s; }
.music-btn.is-playing .music-btn__bars i:nth-child(3) { animation-delay: -.6s; }
.music-btn.is-playing .music-btn__bars i:nth-child(4) { animation-delay: -.15s; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 80px);
  z-index: 70;
  translate: -50% 20px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s, translate .35s var(--ease-out);
}
.toast.is-shown { opacity: 1; translate: -50% 0; }

/* Calendrier */
.cal__label {
  margin: 0 0 14px;
  font-family: var(--f-title);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(247, 241, 227, .75);
}
.cal__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn--copy { cursor: pointer; }

/* Carte illustrée */
.venue__map {
  display: block;
  text-decoration: none;
  isolation: isolate;
}
.map { display: block; width: 100%; height: 100%; min-height: 368px; border-radius: 13px; }
.map__label { font-family: var(--f-title); font-size: 11px; letter-spacing: .18em; fill: rgba(247, 241, 227, .55); }
.map__label--road { font-size: 9.5px; fill: #0c1b42; font-weight: 600; letter-spacing: .1em; }
.map__compass text { font-family: var(--f-title); font-size: 10px; fill: var(--gold-light); }
.map__tag text { font-family: var(--f-body); font-size: 13px; font-weight: 600; fill: #13306e; }
.map__pulse { fill: rgba(241, 217, 152, .5); transform-box: fill-box; transform-origin: center; animation: mapPulse 2s ease-out infinite; }
@keyframes mapPulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }
.map__streets path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease-out); }
.map__road { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2s var(--ease-out) .3s; }
.map__road-center, .map__label--road { opacity: 0; transition: opacity .8s 1.6s; }
.map__drop { transform: translateY(-80px); opacity: 0; }
.map__tag { opacity: 0; transition: opacity .6s 2.6s; }
.venue__map.is-visible .map__streets path, .venue__map.is-visible .map__road { stroke-dashoffset: 0; }
.venue__map.is-visible .map__road-center, .venue__map.is-visible .map__label--road, .venue__map.is-visible .map__tag { opacity: 1; }
.venue__map.is-visible .map__drop { animation: pinDrop .9s 2s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes pinDrop { from { transform: translateY(-80px); opacity: 0; } to { transform: none; opacity: 1; } }
.no-js .map__streets path, .no-js .map__road { stroke-dashoffset: 0; }
.venue__map-cta {
  position: absolute;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  white-space: nowrap;
  font-family: var(--f-title);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--ivory);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.venue__map-cta svg { width: 15px; height: 15px; fill: var(--navy); }
.venue__map:hover .venue__map-cta { background: var(--gold-light); }

/* Titres : lettre par lettre */
.js .section__title[data-reveal] { opacity: 1; transform: none; filter: none; }
.section__title .w { display: inline-block; white-space: nowrap; }
.section__title .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(.7em) rotateX(-80deg);
  transform-origin: 50% 100%;
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: calc(var(--i) * 35ms);
}
.section__title.is-visible .ch { opacity: 1; transform: none; }

/* Carte d'invitation : se redresse en 3D au défilement */
.arch-card[data-scroll] {
  transform-origin: 50% 100%;
  transform: perspective(1400px) rotateX(calc((1 - var(--p, 1)) * 32deg)) translateY(calc((1 - var(--p, 1)) * 80px)) scale(calc(.86 + var(--p, 1) * .14));
  opacity: calc(.15 + var(--p, 1) * .85);
  will-change: transform, opacity;
}
.finale__arch[data-scroll] { transform: scale(calc(.9 + var(--p, 1) * .1)); }

/* Compte à rebours : les tuiles basculent */
.js .tile[data-reveal] {
  transform: perspective(700px) rotateX(-85deg) translateY(20px);
  transform-origin: 50% 0;
  filter: none;
  transition: opacity .8s var(--ease-out) var(--d, 0s), transform 1.1s cubic-bezier(.2, 1.4, .4, 1) var(--d, 0s);
}
.js .tile[data-reveal].is-visible { transform: none; }

/* Frise : comète lumineuse + étoiles qui tournent */
#timelineHead {
  position: absolute;
  left: 50%;
  top: 0;
  width: 14px;
  height: 14px;
  translate: -50% -50%;
  border-radius: 50%;
  background: #fff6d8;
  box-shadow: 0 0 10px 3px rgba(241, 217, 152, .9), 0 0 30px 8px rgba(212, 175, 95, .5);
  opacity: 0;
  transition: opacity .4s;
}
.timeline.is-running #timelineHead { opacity: 1; }
.event__icon::before { transition: background .6s ease, scale .6s var(--ease-out), rotate 1s var(--ease-out); }
.event.is-active .event__icon::before { rotate: 90deg; }
.event.is-active .event__icon svg { animation: iconPop .6s var(--ease-out); }
@keyframes iconPop { 40% { transform: scale(1.25); } }

/* Pétales dorés à la fin */
.finale { overflow: hidden; }
.petals { position: absolute; inset: 0; pointer-events: none; }
.petal {
  position: absolute;
  top: -30px;
  width: 12px;
  height: 16px;
  border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, #fbe7ad, var(--gold) 60%, var(--gold-deep));
  opacity: 0;
}
.finale.is-in .petal { animation: fall var(--t) linear var(--delay) infinite; }
@keyframes fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); }
  10% { opacity: .9; }
  100% { opacity: 0; transform: translate3d(var(--x), 110vh, 0) rotate(var(--r)); }
}
.credit {
  max-width: 520px;
  margin: 40px auto 0;
  font-size: .8rem;
  line-height: 1.5;
  color: rgba(247, 241, 227, .45);
}

@media (max-width: 420px) {
  .quicknav a, .quicknav .music-btn { min-width: 62px; padding: 6px 8px; letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  .arch-card[data-scroll], .finale__arch[data-scroll] { transform: none !important; opacity: 1 !important; }
  .petals { display: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .3s !important;
    transition-delay: 0s !important;
  }
}
