/* ═══════════════════════════════════════════════════════
   Mohammad & Rawan — Wedding Invitation
   Palette: warm cream silk, champagne, bronze, walnut brown
   Inspired by the printed card: draped silk + cherry blossom
   ═══════════════════════════════════════════════════════ */

:root {
  --ivory:        #f5ecd9;   /* warm cream paper */
  --alabaster:    #ede0c5;   /* slightly deeper cream */
  --champagne:    #e3d4b8;   /* silk fabric tone */
  --champagne-d:  #cdb693;   /* deeper silk shadow */
  --gold:         #a78659;   /* bronze accent */
  --gold-soft:    #b89875;   /* softer bronze */
  --ink:          #5b4128;   /* walnut brown (calligraphy ink) */
  --ink-soft:     #8a6b4d;   /* medium brown body text */
  --blush:        #e8c8b0;   /* warm blush highlight */
  --branch:       #4d3520;   /* dark walnut for branch motifs */
  --petal:        #fdf3ee;   /* near-white blossom petal */
  --petal-core:   #e9b89a;   /* soft pink-peach blossom center */

  /* Arabic-primary typography (the page defaults to AR) */
  --font-ar-display: 'Aref Ruqaa', 'Amiri', serif;   /* hero names, big calligraphic moments */
  --font-ar-body:    'Amiri', serif;                  /* body Arabic */

  /* English secondary typography */
  --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; /* opaque flaps cover the screen; invitation shows through as they open */
  perspective: 2300px;
  perspective-origin: 50% 44%;
  overflow: hidden;
  transition: opacity 1s var(--ease-entrance), visibility 1s;
  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;
}

/* soft vignette so the paper reads as a lit physical sheet */
#envelope-scene::before {
  content: '';
  position: absolute; inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(125% 100% at 50% 42%, transparent 54%, rgba(120, 104, 78, 0.07) 82%, rgba(96, 82, 60, 0.16) 100%);
}

/* ── the full-screen envelope: four triangular flaps meeting at the
      centre, where the wax seal holds them shut ─────────────────── */
/* The fold geometry lives on a centred SQUARE sized to the larger screen
   dimension, so the flap creases are always true 45° diagonals and never
   stretch to the corners. On a tall phone the square overflows left/right and
   the screen simply crops in — a close-up of the envelope, exactly like the
   real thing — instead of the lines snapping to whatever corner the viewport
   happens to have. */
.env-flaps {
  position: absolute;
  top: 50%; left: 50%;
  width: 100vmax; height: 100vmax;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  transition: transform 0.95s var(--ease-emphasis);
}

.env-flap {
  position: absolute; inset: 0;
  /* real warm-ivory handmade cotton paper, the same scan aligned identically
     across all four flaps so the closed envelope reads as one continuous sheet */
  background-color: #f3edde;
  background-image: url("assets/envelope-paper-web.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  transition: transform 1.05s cubic-bezier(0.5, 0.04, 0.3, 1);
  will-change: transform;
}

/* The closed envelope is lit as one object: a single soft light from the
   upper-left, a gentle convex bulge where the contents fill the body, and a
   soft vignette pulling the far corners back. Layered over the per-flap fold
   shadows below, this is what makes it read as a real, full envelope. */
.env-flap::after {
  content: '';
  position: absolute; inset: 0;
  background:
    /* directional light: upper-left catches it, lower-right falls to shadow */
    linear-gradient(152deg, rgba(255, 254, 249, 0.36) 0%, rgba(255, 253, 247, 0.09) 21%, transparent 43%, rgba(116, 95, 66, 0.09) 70%, rgba(96, 76, 53, 0.26) 100%),
    /* convex fullness: the stuffed body bulges toward the light */
    radial-gradient(78% 66% at 49% 44%, rgba(255, 253, 247, 0.26) 0%, rgba(255, 252, 246, 0.07) 33%, transparent 56%),
    /* corner vignette so the sheet seats as a lit physical object */
    radial-gradient(140% 130% at 50% 44%, transparent 56%, rgba(72, 56, 40, 0.14) 80%, rgba(56, 42, 30, 0.30) 100%);
}

/* layer order = a real envelope back: side flaps lowest, bottom flap over them,
   the top closure flap on top. Each casts a soft shadow along its overlapping
   edge onto the layer beneath — a crisp contact line plus a wider ambient fall
   so the flaps read as separate sheets of paper with real thickness. */
/* facet tone: the top closure flap is the topmost layer and catches the most
   light; the side flaps sit lowest and read a touch darker — a subtle step in
   brightness at each crease sells the change of plane */
.flap-left   { z-index: 1; filter: drop-shadow(1.5px 0 0.5px rgba(78, 60, 40, 0.34)) drop-shadow(6px 0 12px rgba(92, 72, 50, 0.24)) brightness(0.958); }
.flap-right  { z-index: 1; filter: drop-shadow(-1.5px 0 0.5px rgba(78, 60, 40, 0.34)) drop-shadow(-6px 0 12px rgba(92, 72, 50, 0.24)) brightness(0.958); }
.flap-bottom { z-index: 2; filter: drop-shadow(0 -1.5px 0.5px rgba(74, 56, 38, 0.5)) drop-shadow(0 -7px 14px rgba(92, 72, 50, 0.38)) brightness(0.976); }
/* the top closure flap reads as the raised top layer: a bright lit lip right at
   its edge, then a crisp contact line and a wider soft cast onto the body below,
   plus a touch more light as the topmost sheet */
.flap-top    { z-index: 3; filter: drop-shadow(0 0.6px 0 rgba(255, 254, 249, 0.9)) drop-shadow(0 2.5px 1px rgba(58, 42, 26, 0.74)) drop-shadow(0 8px 9px rgba(80, 60, 42, 0.42)) drop-shadow(0 16px 28px rgba(86, 66, 46, 0.40)) brightness(1.016); }

/* a faint bright bevel on the top edge of each closure flap so the folded
   paper catches the light along its crease */
.flap-top::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.5) 0%, transparent 14%);
  clip-path: polygon(0 0, 100% 0, 100% 15%, 50% 50%, 0 15%);
}

/* the diagonal flap creases: an embossed V-groove — light catches the upper-left
   lip, shadow falls on the lower-right, giving each fold dimensional depth */
.env-seams {
  position: absolute;
  top: 50%; left: 50%;
  width: 100vmax; height: 100vmax;
  transform: translate(-50%, -50%);
  z-index: 4;
  pointer-events: none;
  filter:
    drop-shadow(-0.8px -0.8px 0.3px rgba(255, 253, 246, 0.9))
    drop-shadow(1px 1.3px 1.8px rgba(52, 37, 22, 0.6));
  transition: opacity 0.45s var(--ease-entrance);
}

.env-seams line {
  stroke: rgba(86, 66, 45, 0.36);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

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

/* each flap meets the centre at a fixed 35° crease (creases exit the square's
   side edges at 15%/85%), hinged at its outer edge so the apex lifts away first.
   The top and bottom flaps are five-sided (they keep the outer corners); the
   side flaps are slim triangles. */
.flap-top    { clip-path: polygon(0 0, 100% 0, 100% 15%, 50% 50%, 0 15%);       transform-origin: 50% 0%;   }
.flap-bottom { clip-path: polygon(0 100%, 100% 100%, 100% 85%, 50% 50%, 0 85%); transform-origin: 50% 100%; }
.flap-left   { clip-path: polygon(0 15%, 0 85%, 50% 50%);                       transform-origin: 0% 50%;   }
.flap-right  { clip-path: polygon(100% 15%, 100% 85%, 50% 50%);                 transform-origin: 100% 50%; }

/* the flaps are real sheets of paper, so we see their undersides as they swing
   back */
.env-flap { backface-visibility: visible; }

/* OPEN — each flap peels back and away from the viewer about its outer hinge,
   the top lifting up-and-back first, then the sides folding in, then the
   bottom, so the envelope opens up to reveal the invitation waiting behind. */
#envelope-scene.unfolding .flap-top    { transform: rotateX(104deg);  transition-delay: 0s;    }
#envelope-scene.unfolding .flap-left   { transform: rotateY(-104deg); transition-delay: 0.1s;  }
#envelope-scene.unfolding .flap-right  { transform: rotateY(104deg);  transition-delay: 0.1s;  }
#envelope-scene.unfolding .flap-bottom { transform: rotateX(-104deg); transition-delay: 0.2s;  }

/* as the invitation is uncovered the envelope eases gently toward the viewer
   (a soft dolly-in), so the card feels like it comes forward to meet you */
#envelope-scene.gone .env-flaps { transform: translate(-50%, -50%) scale(1.08); }

/* champagne wax seal at the centre, holding the flaps shut */
.seal {
  position: absolute;
  left: 50%; top: 50%;
  width: clamp(140px, 32vw, 216px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: none; border: none; padding: 0; cursor: pointer;
  z-index: 6;
  -webkit-tap-highlight-color: transparent;
  /* lit from the upper-left, so the wax casts to the lower-right: a tight
     contact shadow seats it on the paper, a softer cast lifts it off */
  filter:
    drop-shadow(1px 2px 2px rgba(86, 60, 48, 0.34))
    drop-shadow(5px 10px 15px rgba(92, 66, 54, 0.26));
  transition: transform 0.45s var(--ease-soft);
}

.seal-img {
  display: block; width: 100%; height: 100%;
  user-select: none; -webkit-user-drag: none;
}

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

/* keyboard focus: a soft gold halo that follows the scalloped silhouette */
.seal:focus-visible {
  outline: none;
  filter:
    drop-shadow(1px 2px 2px rgba(86, 60, 48, 0.34))
    drop-shadow(5px 10px 15px rgba(92, 66, 54, 0.26))
    drop-shadow(0 0 5px rgba(182, 151, 104, 0.85));
}

/* on open: the wax presses, cracks free, then lifts and floats away as it fades */
.seal.cracked {
  animation: sealBreak 1.5s var(--ease-exit) forwards;
  pointer-events: none;
}

@keyframes sealBreak {
  0%   { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
  15%  { transform: translate(-50%, -51.5%) scale(0.95) rotate(-2.5deg); opacity: 1; }
  100% { transform: translate(-50%, -14%) scale(1.18) rotate(11deg); opacity: 0; }
}

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

.seal-pulse {
  position: absolute; inset: 11%;
  border-radius: 50%;
  border: 1.5px solid rgba(182, 151, 104, 0.42);
  animation: pulse 2.6s ease-out infinite;
  pointer-events: none;
}

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

#envelope-scene.opening .seal-pulse { animation: none; opacity: 0; }

.open-hint {
  position: absolute;
  left: 0; right: 0;
  top: calc(50% + clamp(80px, 13.5vh, 120px));
  text-align: center;
  font-family: var(--font-serif), 'Amiri', serif;
  font-style: italic;
  font-size: clamp(15px, 4vw, 19px);
  letter-spacing: 0.04em;
  color: #9a8a76;
  z-index: 6;
  animation: hintFade 3s ease-in-out infinite;
  transition: opacity 0.4s;
}

html[dir="rtl"] .open-hint { font-style: normal; letter-spacing: 0; }

@keyframes hintFade { 0%, 100% { opacity: 0.55; } 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; }

/* 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, .hero-still {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* the still poster is the reliable base layer — always visible, even if the
   film never loads on a weak connection */
.hero-still { background: var(--ivory); }

/* the film stays invisible until it's actually playing (so a stalled/empty
   video never covers the still), fades in, plays once, then fades back out */
.hero-bg { opacity: 0; transition: opacity 1.2s ease; }
.hero-bg.playing { opacity: 1; }
.hero-bg.ended { opacity: 0; }

/* 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;
  /* sit just below the chandelier and fill the open archway; image is
     height-driven on phones (dvh), width-driven in the desktop column */
  margin-top: max(23dvh, calc(min(100vw, 560px) * 0.44));
  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.4em;
  text-transform: uppercase;
  /* darker + a touch bolder, with a tight light halo so it stays legible over
     the bright, busy arch */
  color: #5f4f39;
  font-weight: 600;
  margin-bottom: 26px;
  text-shadow: 0 1px 7px rgba(255, 253, 247, 0.95), 0 0 2px rgba(255, 253, 247, 0.95);
}

.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 .name-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* surname: small letter-spaced caps under each script first name */
.names .surname {
  font-family: var(--font-caps);
  font-size: 0.2em;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  /* offset the right-hand letter-spacing so the word stays optically centred */
  text-indent: 0.34em;
  margin-top: 0.18em;
  text-shadow: 0 1px 7px rgba(255, 253, 247, 0.95), 0 0 2px rgba(255, 253, 247, 0.95);
}

.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; }

/* a full-width row of white peonies & roses anchored to the bottom of the hero,
   its top edge faded so the blooms sit on the scene like a floral separator
   before the next section */
.flower-divider {
  position: absolute; left: 0; bottom: 0; width: 100%;
  height: clamp(115px, 19vh, 178px);
  background: url("assets/flower-divider-web.jpg") center bottom / cover no-repeat;
  z-index: 2;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 42%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 42%);
}

/* slim gold down-arrow inviting the scroll, sitting just above the flowers */
.scroll-cue {
  position: absolute; bottom: clamp(128px, 21vh, 196px); left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 34px;
  z-index: 3;
  filter: drop-shadow(0 1px 1.5px rgba(120, 96, 60, 0.28));
}

.scroll-cue svg {
  display: block;
  width: 100%; height: 100%;
  fill: none;
  stroke: var(--gold-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: cueBounce 2s ease-in-out infinite;
}

@keyframes cueBounce {
  0%, 100% { transform: translateY(0);   opacity: 0.62; }
  50%      { transform: translateY(6px); opacity: 1; }
}

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

/* a soft painted watercolour wash behind alternating sections — a full-width
   band that fades into the plain ivory at top and bottom, kept subtle so the
   text stays clean */
.section.washed::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  background: url("assets/section-wash-web.jpg") center / cover no-repeat;
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 16%, #000 84%, transparent 100%);
}
/* flip alternate washes so they don't read as identical */
.section.washed.flip::before { transform: translateX(-50%) scaleX(-1); }

.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);
}

.venue-pin { width: 40px; margin: 0 auto 16px; display: block; }

.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 ═══════════════ */



/* ═══════════════ 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: 101; /* stays above the envelope scene (z-100) on the landing screen */
  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); }

/* floating music toggle: a soft gold disc with an equalizer that animates while
   the track plays and rests flat when paused. Hidden until the invite opens. */
.music-toggle {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 35% 28%, #c8a96e, #ab8a55);
  box-shadow: 0 5px 16px rgba(120, 96, 60, 0.4), inset 0 1px 1px rgba(255, 248, 234, 0.4);
  -webkit-tap-highlight-color: transparent;
  opacity: 0; visibility: hidden;
  transition: opacity 0.6s var(--ease-entrance), visibility 0.6s, transform 0.18s var(--ease-soft);
}
.music-toggle.shown { opacity: 1; visibility: visible; }
.music-toggle:active { transform: scale(0.93); }

.music-toggle .eq { display: flex; align-items: center; gap: 2.5px; height: 16px; }
.music-toggle .eq i {
  width: 2.5px; height: 5px;
  background: #fff8ec;
  border-radius: 2px;
}
.music-toggle.is-playing .eq i { animation: eqBar 0.95s ease-in-out infinite; }
.music-toggle .eq i:nth-child(1) { animation-delay: 0s; }
.music-toggle .eq i:nth-child(2) { animation-delay: 0.22s; }
.music-toggle .eq i:nth-child(3) { animation-delay: 0.44s; }
.music-toggle .eq i:nth-child(4) { animation-delay: 0.12s; }

@keyframes eqBar { 0%, 100% { height: 5px; } 50% { height: 15px; } }

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.12;
}

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

body.ar .names .surname {
  font-family: var(--font-serif), 'Amiri', serif;
  font-size: 0.26em;
  letter-spacing: 0;
  text-indent: 0;
  margin-top: 0.1em;
}

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; }
}

/* ═══════════════════════════════════════════════════════════════
   MOHAMMED & RAWAN — additions (cherry blossom + Arabic-primary)
   ═══════════════════════════════════════════════════════════════ */

/* Push content below the chandelier so names sit in the open archway. */
.hero-content {
  margin-top: max(32dvh, 260px);
}

/* Top blessing — matches the printed card's calligraphic basmala-style header.
   Bronze tone with subtle warm shadow so it sits like ink on cream paper. */
.blessing {
  font-family: var(--font-ar-display);
  font-size: clamp(15px, 4.2vw, 22px);
  line-height: 1.7;
  color: var(--gold);
  margin-bottom: 22px;
  letter-spacing: 0.02em;
  text-shadow:
    0 1px 6px rgba(255, 250, 240, 0.85),
    0 0 1px rgba(255, 250, 240, 0.7);
  max-width: 28ch;
  margin-left: auto; margin-right: auto;
}

/* English variant of blessing — italic serif, smaller */
body:not(.ar) .blessing {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(13px, 3.4vw, 17px);
  color: var(--gold-soft);
}

/* Families block — lead → two family columns → invite line.
   Mirrors the printed card: تتشرف above, two families side-by-side,
   connector in the middle. Works in both LTR and RTL (flex honours dir). */
.families {
  margin-bottom: 18px;
  text-shadow: 0 1px 6px rgba(255, 250, 240, 0.9);
}

.families-lead {
  font-family: var(--font-serif);
  font-size: clamp(12px, 3vw, 15px);
  color: var(--gold-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.families-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(16px, 6vw, 44px);
}

.family {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 18ch;
}

.family-label {
  font-family: var(--font-serif);
  font-size: clamp(10px, 2.4vw, 12px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.family-name {
  font-family: var(--font-serif);
  font-size: clamp(14px, 3.6vw, 18px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.family-amp {
  align-self: center;
  font-family: var(--font-serif);
  font-size: clamp(14px, 3.6vw, 18px);
  color: var(--gold);
}

/* Arabic-specific tuning for blessing + families */
body.ar .blessing {
  font-size: clamp(16px, 4.6vw, 24px);
  line-height: 1.85;
  max-width: 32ch;
}

body.ar .families-lead {
  font-family: var(--font-ar-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: clamp(13px, 3.4vw, 16px);
}

body.ar .family-label {
  font-family: var(--font-ar-body);
  text-transform: none;
  letter-spacing: 0;
  font-size: clamp(12px, 2.8vw, 14px);
}

body.ar .family-name,
body.ar .family-amp {
  font-family: var(--font-ar-display);
  font-size: clamp(16px, 4.2vw, 22px);
}

/* Veil tuned for the cherry-blossom arch backdrop: open arch sits behind the
   names, so we pour cream over the central reading band to keep calligraphy
   crisp while leaving the architecture + chandelier visible at the top and the
   cascading blossoms visible at the sides. */
.hero-veil {
  background:
    linear-gradient(180deg,
      rgba(245, 236, 217, 0) 0%,
      rgba(245, 236, 217, 0.05) 28%,
      rgba(245, 236, 217, 0.55) 42%,
      rgba(245, 236, 217, 0.82) 56%,
      rgba(245, 236, 217, 0.92) 76%,
      var(--ivory) 100%),
    radial-gradient(70% 30% at 50% 58%, rgba(255, 252, 244, 0.32) 0%, rgba(255, 252, 244, 0) 80%);
}

/* Envelope flap warm-tint — even before the new envelope-paper asset ships,
   nudge the flap colour toward warm champagne so the closed envelope reads
   in the same family as the printed invitation. */
.env-flap {
  background-color: #ecdcc1;  /* warm champagne fallback */
}

/* Open hint — warm bronze instead of cool gold */
.open-hint { color: var(--gold); }
