/* ═══════════════════════════════════════════════════════
   Younis & Malak — Wedding Invitation
   Palette: shades of white, ivory, champagne, soft gold
   ═══════════════════════════════════════════════════════ */

:root {
  --ivory:        #faf7f0;
  --alabaster:    #f4efe4;
  --champagne:    #e9ddc9;
  --champagne-d:  #d8c8ab;
  --gold:         #b69768;
  --gold-soft:    #c2a878;
  --ink:          #5d5040;
  --ink-soft:     #8a7b66;
  --blush:        #e2cab7;

  --font-script:  'Great Vibes', cursive;
  --font-serif:   'Cormorant Garamond', serif;
  --font-caps:    'Marcellus', serif;

  /* ── motion system ──────────────────────────────────────
     One shared vocabulary so every gesture feels related.    */
  --ease-entrance: cubic-bezier(0.22, 1, 0.36, 1);   /* things arriving: fades, reveals, settles */
  --ease-emphasis: cubic-bezier(0.62, 0, 0.30, 1);   /* big theatrical moves: flap, dolly, curtains */
  --ease-exit:     cubic-bezier(0.4, 0, 0.9, 0.5);   /* things leaving: seal breaking away */
  --ease-soft:     cubic-bezier(0.33, 0.68, 0.4, 1); /* small UI feedback: buttons, toggles */
  --dur-quick: 0.28s;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-serif);
  background: var(--ivory);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.locked { overflow: hidden; height: 100dvh; }

/* grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 0 0.32 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ═══════════════ ENVELOPE SCENE (full screen) ═══════════════ */

#envelope-scene {
  position: fixed; inset: 0;
  z-index: 50;
  background: transparent; /* the flaps are opaque; invitation shows through as they open */
  perspective: 1700px;
  perspective-origin: 50% 50%;
  overflow: hidden;
  transition: opacity 0.7s var(--ease-entrance), visibility 0.7s;
  animation: sceneIn 1.2s var(--ease-entrance) both;
}

@keyframes sceneIn { from { opacity: 0; } to { opacity: 1; } }

/* once the flaps have opened, the scene fades away entirely */
#envelope-scene.gone {
  animation: none; /* sceneIn's fill-mode would pin opacity and kill the fade */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── the full-screen envelope: four triangular flaps meeting at the
      centre, where the wax seal holds them shut ─────────────────── */
.env-flaps {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
}

.env-flap {
  position: absolute; inset: 0;
  /* tone-on-tone damask, aligned identically across all four flaps so the
     closed envelope reads as one continuous sheet creased along the diagonals */
  background: url('assets/envelope-damask-web.jpg') center / cover no-repeat;
  backface-visibility: hidden;
  transition: transform 1.15s var(--ease-emphasis);
  will-change: transform;
}

/* gentle depth toward the centre (where the seal sits) + edge highlight */
.env-flap::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(125% 125% at 50% 50%, rgba(120, 99, 70, 0.18) 0%, transparent 44%),
    radial-gradient(60% 60% at 50% 50%, rgba(255, 255, 255, 0.22) 0%, transparent 62%);
}

/* the diagonal flap creases, drawn corner-to-corner and lightly embossed */
.env-seams {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55));
  transition: opacity 0.35s var(--ease-entrance);
}

.env-seams line {
  stroke: rgba(120, 99, 70, 0.30);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

#envelope-scene.opening .env-seams { opacity: 0; }

/* each flap is one of the four triangles formed by the screen diagonals,
   hinged at its outer edge so the apex (centre) lifts away first */
.flap-top    { clip-path: polygon(0 0, 100% 0, 50% 50%);     transform-origin: 50% 0%;   }
.flap-bottom { clip-path: polygon(0 100%, 100% 100%, 50% 50%); transform-origin: 50% 100%; }
.flap-left   { clip-path: polygon(0 0, 0 100%, 50% 50%);      transform-origin: 0% 50%;   }
.flap-right  { clip-path: polygon(100% 0, 100% 100%, 50% 50%); transform-origin: 100% 50%; }

#envelope-scene.opened .flap-top    { transform: rotateX(-179deg); }
#envelope-scene.opened .flap-bottom { transform: rotateX(179deg);  }
#envelope-scene.opened .flap-left   { transform: rotateY(179deg);  }
#envelope-scene.opened .flap-right  { transform: rotateY(-179deg); }

/* wax seal */
.seal {
  position: absolute;
  left: 50%; top: 50%;
  width: clamp(122px, 27vw, 162px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: none; border: none; cursor: pointer;
  z-index: 6;
  -webkit-tap-highlight-color: transparent;
  transition: transform 1.2s var(--ease-entrance), opacity 1.1s var(--ease-entrance);
}

.seal:hover { transform: translate(-50%, -50%) scale(1.05); }

/* on open: the seal gently expands outward and fades away */
.seal.cracked {
  transform: translate(-50%, -50%) scale(1.7);
  opacity: 0;
  pointer-events: none;
}

.seal.cracked .seal-pulse { animation: none; opacity: 0; }

.seal-svg { width: 100%; height: 100%; display: block; }

.seal-mono {
  font-family: var(--font-script);
  font-size: 33px;
  fill: #8d6a4d;
}

.seal-amp { font-size: 15px; fill: #a07f60; }

.seal-pulse {
  position: absolute; inset: 8%;
  border-radius: 50%;
  border: 1.5px solid rgba(176, 143, 115, 0.55);
  animation: pulse 2.6s ease-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%   { transform: scale(0.92); opacity: 0.9; }
  70%  { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}

.open-hint {
  position: absolute;
  left: 0; right: 0;
  top: calc(50% + clamp(72px, 12vh, 104px));
  text-align: center;
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: hintFade 3s ease-in-out infinite;
  transition: opacity 0.4s;
}

@keyframes hintFade { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

#envelope-scene.opening .open-hint { animation: none; opacity: 0; }


/* ═══════════════ INVITATION ═══════════════ */

.invite {
  position: relative;
  min-height: 100dvh;
  background:
    radial-gradient(140% 50% at 50% 0%, #fdfaf2 0%, var(--ivory) 60%),
    var(--ivory);
  opacity: 0;
  transition: opacity 1.1s var(--ease-entrance);
}

.invite.shown { opacity: 1; }

/* petals */
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }

.petals span {
  position: absolute;
  top: -4vh;
  width: 10px; height: 13px;
  background: linear-gradient(160deg, #f7eede, #e9d9bf);
  border-radius: 80% 10% 80% 10%;
  opacity: 0;
  animation: petalFall linear infinite;
}

.petals span:nth-child(1)  { left: 6%;  animation-duration: 17s; animation-delay: 0s;  }
.petals span:nth-child(2)  { left: 16%; animation-duration: 21s; animation-delay: 4s; width: 8px; height: 11px; }
.petals span:nth-child(3)  { left: 27%; animation-duration: 19s; animation-delay: 9s;  }
.petals span:nth-child(4)  { left: 38%; animation-duration: 23s; animation-delay: 2s; width: 7px; height: 10px; }
.petals span:nth-child(5)  { left: 49%; animation-duration: 18s; animation-delay: 12s; }
.petals span:nth-child(6)  { left: 58%; animation-duration: 22s; animation-delay: 6s;  }
.petals span:nth-child(7)  { left: 68%; animation-duration: 20s; animation-delay: 14s; width: 8px; height: 11px; }
.petals span:nth-child(8)  { left: 78%; animation-duration: 24s; animation-delay: 1s;  }
.petals span:nth-child(9)  { left: 87%; animation-duration: 18s; animation-delay: 8s; width: 7px; height: 10px; }
.petals span:nth-child(10) { left: 94%; animation-duration: 21s; animation-delay: 11s; }

@keyframes petalFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  6%   { opacity: 0.85; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(108vh) rotate(300deg); opacity: 0; }
}

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease-entrance), transform 1s var(--ease-entrance);
}

.reveal.in { opacity: 1; transform: none; }

/* ── hero ── */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  align-items: center;
  padding: 0 44px 118px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  transform-origin: 50% 30%;
  animation: kenburns 36s ease-in-out infinite alternate;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.07); }
}

/* blend the image bottom into the page ivory */
.hero-veil {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(250, 247, 240, 0) 86%, var(--ivory) 100%),
    radial-gradient(60% 28% at 50% 30%, rgba(248, 233, 198, 0.32) 0%, rgba(248, 233, 198, 0) 75%);
  animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 1; }
}

/* sparkles over the chandelier crystals */
.sparkles { position: absolute; inset: 0; pointer-events: none; }

.sparkles i {
  position: absolute;
  left: var(--x); top: var(--y);
  width: calc(14px * var(--s));
  height: calc(14px * var(--s));
  background: radial-gradient(circle, #fff 0%, #f3dca6 40%, rgba(243, 220, 166, 0) 72%);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: 0;
  animation: twinkle 6.5s ease-in-out infinite;
  animation-delay: var(--d);
  filter: drop-shadow(0 0 4px rgba(243, 220, 166, 0.9));
}

@keyframes twinkle {
  0%, 18%, 100% { opacity: 0; transform: scale(0.2) rotate(0deg); }
  6%            { opacity: 1; transform: scale(1) rotate(40deg); }
  12%           { opacity: 0; transform: scale(0.3) rotate(80deg); }
}

.flames ellipse {
  fill: #e8c98a;
  filter: drop-shadow(0 0 6px rgba(232, 195, 130, 0.9));
  animation: flicker 2.2s ease-in-out infinite;
}

.flames ellipse:nth-child(2n) { animation-delay: 0.7s; }
.flames ellipse:nth-child(3n) { animation-delay: 1.3s; }

@keyframes flicker {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  45%      { opacity: 0.75; transform: scaleY(0.88); }
  70%      { opacity: 0.95; transform: scaleY(1.06); }
}

.hero-content {
  position: relative;
  z-index: 4;
  /* clear the chandelier inside the arch (~38% down the bg image); image is
     height-driven on phones (dvh), width-driven in the desktop column */
  margin-top: max(40dvh, calc(min(100vw, 560px) * 0.72));
  text-shadow:
    0 0 14px rgba(255, 252, 244, 0.9),
    0 0 36px rgba(255, 252, 244, 0.6);
}

.eyebrow {
  font-family: var(--font-caps);
  font-size: clamp(10px, 2.6vw, 12px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

.names {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(54px, 14vw, 96px);
  line-height: 1.04;
  color: var(--ink);
  display: flex; flex-direction: column; align-items: center;
}

.names .amp {
  font-size: 0.42em;
  color: var(--gold);
  margin: 0.05em 0;
  background: linear-gradient(100deg, var(--gold) 20%, #e6cfa0 50%, var(--gold) 80%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 5s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 0; }
  50%      { background-position: 100% 0; }
}

.invite-line {
  margin-top: 22px;
  font-size: clamp(16px, 4.2vw, 19px);
  font-style: italic;
  line-height: 1.7;
  color: var(--ink-soft);
}

.date-line {
  margin-top: 40px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
}

.date-line .rule {
  width: clamp(28px, 9vw, 64px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--champagne-d));
}

.date-line .rule:last-child { transform: scaleX(-1); }

.date {
  font-family: var(--font-caps);
  font-size: clamp(13px, 3.6vw, 17px);
  letter-spacing: 0.18em;
  color: var(--ink);
  white-space: nowrap;
}

.date sup { font-size: 0.6em; }

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 1.2px solid var(--champagne-d);
  border-radius: 14px;
  z-index: 3;
}

.scroll-cue span {
  position: absolute; left: 50%; top: 8px;
  width: 3px; height: 8px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--gold-soft);
  animation: cueDrop 2.2s ease-in-out infinite;
}

@keyframes cueDrop {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ── sections ── */
.section {
  position: relative; z-index: 2;
  max-width: 620px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}

.section-label {
  font-family: var(--font-caps);
  font-size: clamp(11px, 2.8vw, 13px);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 36px;
}

/* countdown */
.countdown-section { padding-top: 30px; }

.countdown {
  display: flex; align-items: baseline; justify-content: center;
  gap: clamp(10px, 3.5vw, 26px);
}

.cd-unit { display: flex; flex-direction: column; gap: 8px; min-width: clamp(52px, 14vw, 78px); }

.cd-num {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(38px, 11vw, 64px);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cd-label {
  font-family: var(--font-caps);
  font-size: clamp(9px, 2.2vw, 11px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cd-sep { color: var(--champagne-d); font-size: clamp(22px, 6vw, 34px); align-self: flex-start; padding-top: 0.3em; }

.flourish { display: flex; justify-content: center; padding: 8px 0; }
.flourish svg { width: 180px; }

/* timeline */
.timeline {
  display: flex; align-items: stretch; justify-content: center;
  gap: clamp(18px, 6vw, 48px);
}

.tl-item { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; max-width: 220px; }

.tl-icon { width: 46px; height: 46px; }

.tl-time {
  font-family: var(--font-serif);
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 500;
  color: var(--ink);
}

.tl-time span { font-size: 0.5em; letter-spacing: 0.1em; color: var(--gold); }

.tl-name {
  font-family: var(--font-caps);
  font-size: clamp(11px, 3vw, 13px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tl-divider {
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--champagne-d), transparent);
}

/* venue */
.venue-card {
  border: 1px solid var(--champagne-d);
  outline: 1px solid var(--champagne);
  outline-offset: 5px;
  border-radius: 4px;
  padding: clamp(34px, 8vw, 52px) clamp(22px, 6vw, 48px);
  background: linear-gradient(180deg, #fffdf8, #f8f2e5);
  box-shadow: 0 24px 50px -28px rgba(140, 118, 84, 0.4);
}

.candles { width: 110px; margin-bottom: 14px; }

.venue-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(28px, 7.5vw, 38px);
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 12px;
}

.venue-address {
  font-size: clamp(16px, 4.2vw, 18px);
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

/* buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

.btn {
  font-family: var(--font-caps);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform var(--dur-quick) var(--ease-soft), box-shadow var(--dur-quick) var(--ease-soft), background var(--dur-quick) var(--ease-soft);
}

.btn:active { transform: scale(0.97); }

.btn-solid {
  background: linear-gradient(135deg, #c9ab7d, #b69768);
  color: #fffdf8;
  border: none;
  box-shadow: 0 12px 26px -12px rgba(160, 130, 88, 0.7);
}

.btn-solid:hover { box-shadow: 0 16px 32px -12px rgba(160, 130, 88, 0.85); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--champagne-d);
}

.btn-outline:hover { background: rgba(216, 200, 171, 0.18); }

/* calendar */
.calendar-note {
  font-style: italic;
  font-size: clamp(16px, 4.2vw, 18px);
  color: var(--ink-soft);
  margin: -16px 0 26px;
}

/* rsvp */
.rsvp-card {
  border: 1px solid var(--champagne-d);
  outline: 1px solid var(--champagne);
  outline-offset: 5px;
  border-radius: 4px;
  padding: clamp(34px, 8vw, 52px) clamp(22px, 6vw, 48px);
  background: linear-gradient(180deg, #fffdf8, #f8f2e5);
  box-shadow: 0 24px 50px -28px rgba(140, 118, 84, 0.4);
}

.rsvp-greeting {
  font-family: var(--font-script);
  font-size: clamp(28px, 7vw, 36px);
  color: var(--ink);
  margin-bottom: 10px;
}

.rsvp-seats {
  font-size: clamp(16px, 4.2vw, 19px);
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.rsvp-seats strong { color: var(--gold); font-weight: 600; }

.rsvp-deadline {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

.rsvp-choice { margin-top: 6px; }

.rsvp-form-hint {
  font-family: var(--font-caps);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

.rsvp-input {
  display: block;
  width: 100%;
  margin-bottom: 12px;
  padding: 13px 16px;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--ink);
  background: #fffefb;
  border: 1px solid var(--champagne-d);
  border-radius: 3px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.rsvp-input:focus { border-color: var(--gold-soft); box-shadow: 0 0 0 3px rgba(194, 168, 120, 0.15); }

.rsvp-plusone { border-style: dashed; }

.rsvp-label {
  display: block;
  text-align: left;
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 18px 0 0;
}

.rsvp-label span { text-transform: none; letter-spacing: 0.04em; }

.rsvp-label textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
  background: #fffefb;
  border: 1px solid var(--champagne-d);
  border-radius: 3px;
  outline: none;
  resize: vertical;
}

.rsvp-label textarea:focus { border-color: var(--gold-soft); box-shadow: 0 0 0 3px rgba(194, 168, 120, 0.15); }

#rsvpForm .btn-row { margin-top: 26px; }

.rsvp-error {
  margin-top: 16px;
  font-style: italic;
  color: #a05c4a;
}

.rsvp-done-mark { width: 56px; margin-bottom: 14px; }

.rsvp-done-title {
  font-family: var(--font-script);
  font-size: clamp(26px, 6.5vw, 32px);
  color: var(--ink);
  margin-bottom: 10px;
}

.rsvp-done-text {
  font-size: 17px;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

/* footer */
.footer {
  text-align: center;
  padding: 70px 24px 90px;
  position: relative; z-index: 2;
}

.footer-mono {
  width: clamp(110px, 30vw, 150px);
  height: auto;
  mix-blend-mode: multiply;
  margin-bottom: 6px;
}

.footer-line {
  font-family: var(--font-script);
  font-size: clamp(26px, 7vw, 34px);
  color: var(--ink);
  margin-bottom: 12px;
}

.footer-names {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ═══════════════ CURTAIN REVEAL ═══════════════ */

.curtain-overlay {
  position: fixed; inset: 0;
  z-index: 45;
  pointer-events: none;
}

.curtain {
  position: absolute; top: 0; bottom: 0;
  width: 51%;
  background-image: url('assets/curtains-web.jpg');
  background-size: 200% 100%;
  transition: transform 2.4s var(--ease-emphasis);
  box-shadow: 0 0 40px rgba(140, 118, 84, 0.25);
}

.curtain-l { left: 0;  background-position: left center; }
.curtain-r { right: 0; background-position: right center; }

.curtain-overlay.open .curtain-l { transform: translateX(-104%); }
.curtain-overlay.open .curtain-r { transform: translateX(104%); }
.curtain-overlay.done { display: none; }

/* ═══════════════ DOVES ═══════════════ */

.doves {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

/* tracks (top / direction / speed / depth) are generated per-dove in JS */
.dove-track {
  position: absolute;
  left: 0;
  width: 100%;
  opacity: 0;
  will-change: transform;
}

/* gentle arced crossings rather than dead-straight lines */
@keyframes doveLTR {
  0%   { transform: translate(-18vw, 3vh);  opacity: 0; }
  8%   { opacity: 1; }
  30%  { transform: translate(24vw, -3vh); }
  55%  { transform: translate(55vw, -6vh); }
  80%  { transform: translate(84vw, -2vh); }
  92%  { opacity: 1; }
  100% { transform: translate(112vw, 2vh);  opacity: 0; }
}

@keyframes doveRTL {
  0%   { transform: translate(112vw, -2vh); opacity: 0; }
  8%   { opacity: 1; }
  30%  { transform: translate(70vw, 4vh); }
  55%  { transform: translate(40vw, 6vh); }
  80%  { transform: translate(10vw, 2vh); }
  92%  { opacity: 1; }
  100% { transform: translate(-18vw, -2vh); opacity: 0; }
}

/* slight rocking as they glide; varied per dove so they don't sync up */
.dove-bob { animation: doveBob 3.4s ease-in-out infinite; }

@keyframes doveBob {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50%      { transform: translateY(10px) rotate(-3deg); }
}

.dove {
  width: clamp(38px, 9.5vw, 56px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 3px 4px rgba(140, 118, 84, 0.22));
}

.dove-body, .dove-tail {
  fill: url(#doveBodyGrad);
  stroke: #d8c7a8; stroke-width: 0.6;
  stroke-linejoin: round;
}

.dove-beak { fill: #d7b06f; }
.dove-eye  { fill: #6f5e48; }

.dove-feather {
  fill: url(#doveWingGrad);
  stroke: #d3c19f; stroke-width: 0.55;
  stroke-linejoin: round;
}

/* feather vanes drawn on the wing for detail */
.dove-vane {
  fill: none;
  stroke: #cdbb97; stroke-width: 0.5;
  stroke-linecap: round;
  opacity: 0.85;
}

/* the near wing flaps from the shoulder joint, then glides — more lifelike */
.dove-wing {
  transform-origin: 40px 25px;
  animation: doveFlap 2.4s ease-in-out infinite;
  will-change: transform;
}
@keyframes doveFlap {
  0%   { transform: rotate(-32deg); }
  10%  { transform: rotate(8deg); }
  20%  { transform: rotate(-32deg); }
  30%  { transform: rotate(8deg); }
  40%  { transform: rotate(-28deg); }
  52%  { transform: rotate(-14deg); }
  72%  { transform: rotate(-12deg); }
  88%  { transform: rotate(-16deg); }
  100% { transform: rotate(-32deg); }
}

/* stop all dove work while the hero is off-screen (set by JS) */
.doves.paused .dove-track,
.doves.paused .dove-bob,
.doves.paused .dove-wing { animation-play-state: paused; }

/* ═══════════════ VERSE ═══════════════ */

.verse { padding-top: 72px; padding-bottom: 28px; }

.verse-ornament { width: min(220px, 60vw); display: block; margin: 0 auto; }
.verse-ornament.flip { transform: scaleY(-1); margin-top: 24px; }

.verse-arabic {
  font-family: 'Amiri', serif;
  font-size: clamp(21px, 5.6vw, 27px);
  line-height: 2.1;
  color: var(--ink);
  max-width: 30ch;
  margin: 26px auto 16px;
}

.verse-translation {
  font-style: italic;
  font-size: clamp(15px, 4vw, 17px);
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 auto 16px;
}

.verse-ref {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ═══════════════ LANGUAGE TOGGLE + ARABIC ═══════════════ */

.lang-toggle {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 16px;
  z-index: 60;
  font-family: 'Amiri', var(--font-caps), serif;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--champagne-d);
  border-radius: 999px;
  padding: 9px 18px 11px;
  cursor: pointer;
  box-shadow: 0 8px 22px -10px rgba(140, 118, 84, 0.5);
  transition: background var(--dur-quick) var(--ease-soft), transform var(--dur-quick) var(--ease-soft);
}

.lang-toggle:hover { background: #fffdf8; }
.lang-toggle:active { transform: scale(0.96); }

html[dir="rtl"] .lang-toggle {
  font-family: var(--font-caps);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 11px 18px;
}

/* Arabic mode: swap the font stack via the custom properties */
body.ar {
  --font-script: 'Aref Ruqaa', serif;
  --font-serif:  'Amiri', serif;
  --font-caps:   'Amiri', serif;
}

body.ar .eyebrow, body.ar .section-label, body.ar .date,
body.ar .cd-label, body.ar .tl-name, body.ar .open-hint,
body.ar .rsvp-deadline, body.ar .rsvp-form-hint, body.ar .rsvp-label,
body.ar .footer-names, body.ar .verse-ref, body.ar .btn, body.ar .mini-btn {
  letter-spacing: 0 !important;
  text-transform: none;
}

body.ar .eyebrow { font-size: clamp(15px, 4vw, 18px); }
body.ar .section-label { font-size: clamp(16px, 4.4vw, 19px); font-weight: 700; }
body.ar .date { font-size: clamp(16px, 4.4vw, 20px); }
body.ar .cd-label { font-size: clamp(12px, 3vw, 14px); }
body.ar .tl-name { font-size: clamp(15px, 4vw, 17px); }
body.ar .btn { font-size: 15px; }

body.ar .names {
  font-size: clamp(40px, 11vw, 76px);
  line-height: 1.55;
}

body.ar .names .amp { font-size: 0.5em; }

body.ar .footer-line { font-size: clamp(24px, 6.4vw, 32px); line-height: 1.8; }
body.ar .rsvp-greeting { font-size: clamp(24px, 6.4vw, 32px); line-height: 1.8; }
body.ar .verse-translation { display: none; }
body.ar .invite-line { line-height: 2; }

/* ── desktop: present the invite as a centered phone-style column ── */
@media (min-width: 720px) {
  .invite {
    max-width: 560px;
    margin: 0 auto;
    box-shadow:
      0 0 0 1px rgba(216, 200, 171, 0.5),
      0 30px 90px -30px rgba(140, 118, 84, 0.45);
  }

  body { background: linear-gradient(180deg, #f3eee1, #ece4d2); }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.3s !important; }
  .reveal { opacity: 1; transform: none; }
}
