/* ═════════════════════════════════════════════════════════════════════
   Bushra & Muhammad — a full-page sealed envelope that opens into
   a purple garden of flowers. Ivory stationery · violet · greenery.
   ═════════════════════════════════════════════════════════════════════ */

:root {
  --ivory: #f7f3ea;
  --ivory-card: #fbf8f1;
  --ivory-text: #f6efe0;
  --lilac-wash: #efe9f6;
  --ink: #3a3341;
  --ink-soft: #5d5566;
  --violet: #5d2f9e;
  --violet-deep: #43217a;
  --violet-heading: #472a78;
  --lavender: #b9a3d8;
  --green: #5f7a54;
  --sage: #7d9276;
  --gold: #b39250;
  --gold-soft: #cdb98a;
  --gold-bright: #e6cf9a;

  --font-serif: "Cormorant Garamond", "Amiri", serif;
  --font-script: "Great Vibes", "Aref Ruqaa", cursive;
  --font-arabic: "Amiri", serif;
  --font-arabic-display: "Aref Ruqaa", serif;

  --flap-point: 52%;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

html {
  scroll-behavior: smooth;
}

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

html[lang="ar"] body {
  font-family: var(--font-arabic);
}

body[data-state="letter"] {
  overflow: hidden;
  height: 100dvh;
}

[hidden] {
  display: none !important;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: rgba(93, 47, 158, 0.22);
}

/* ═══════════════════ THE ENVELOPE · full-page ═══════════════════ */

.envelope {
  position: fixed;
  inset: 0;
  z-index: 70;
  perspective: 1300px;
}

body[data-state="open"] .envelope {
  display: none;
}

.env-part {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
}

.env-top {
  z-index: 2;
  transform-origin: top center;
  filter: drop-shadow(0 9px 15px rgba(74, 52, 24, 0.3));
}

.env-bottom {
  z-index: 1;
  transform-origin: bottom center;
}

.env-clip {
  position: absolute;
  inset: 0;
}

.env-top .env-clip {
  clip-path: polygon(0 0, 100% 0, 100% 10%, 50% 52%, 0 10%);
}

.env-bottom .env-clip {
  clip-path: polygon(0 0, 50% 49%, 100% 0, 100% 100%, 0 100%);
}

/* fold tones */

.env-clip::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.env-top .env-clip::after {
  background: linear-gradient(180deg, rgba(255, 255, 250, 0.28) 0%, rgba(255, 255, 250, 0) 34%, rgba(94, 76, 44, 0.07) 50%);
}

.env-bottom .env-clip::after {
  background: linear-gradient(0deg, rgba(255, 255, 250, 0.18) 0%, rgba(255, 255, 250, 0) 40%);
}

.env-face {
  position: absolute;
  inset: 0;
}

.letter-face {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 42%, #fbf7ec 0%, #f5efdd 55%, #ece3ca 100%);
}

.letter-face::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 260px;
  opacity: 0.07;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.lf-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 140% 110% at 50% 48%, transparent 62%, rgba(94, 76, 44, 0.15) 100%);
  pointer-events: none;
}

.lf-trims {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.trim-m {
  display: none;
}

.lf-upper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: max(calc(env(safe-area-inset-top) + 11vh), 12.5vh);
}

.lf-eyebrow {
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
}

html[lang="ar"] .lf-eyebrow {
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
}

.lf-corner {
  position: absolute;
  width: clamp(46px, 6.5vw, 80px);
  color: var(--gold);
  opacity: 0.85;
}

.lf-corner.bl {
  bottom: clamp(22px, 3.6vw, 40px);
  left: clamp(22px, 3.6vw, 40px);
  transform: scaleY(-1);
}

.lf-corner.br {
  bottom: clamp(22px, 3.6vw, 40px);
  right: clamp(22px, 3.6vw, 40px);
  transform: scale(-1);
}

.lf-lower {
  position: absolute;
  top: 63%;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1vh 1.5rem 3vh;
  gap: clamp(0.5rem, 1.3vh, 0.95rem);
}

.lf-families {
  font-style: italic;
  font-size: clamp(1.05rem, 2.9vw, 1.35rem);
  color: var(--ink-soft);
}

html[lang="ar"] .lf-families {
  font-style: normal;
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
}

.lf-names {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 9.5vw, 5rem);
  line-height: 1.14;
  color: var(--violet-heading);
}

html[lang="ar"] .lf-names {
  font-family: var(--font-arabic-display);
  font-weight: 700;
  font-size: clamp(2.3rem, 8.2vw, 4.4rem);
}

.lf-rule {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--gold);
}

.lf-rule span {
  display: block;
  width: clamp(52px, 11vw, 110px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 35%, var(--gold) 65%, transparent);
}

.rule-sprig {
  width: 17px;
  height: auto;
}

.lf-date {
  font-weight: 700;
  font-size: clamp(1.25rem, 3.6vw, 1.65rem);
  letter-spacing: 0.1em;
  color: var(--violet-deep);
}

html[lang="ar"] .lf-date {
  letter-spacing: 0;
}

/* the guest's own name on the envelope (?to=…) — a quiet personal line */
.lf-guest {
  margin-top: 0.55rem;
  font-family: var(--font-arabic-display), serif;
  font-size: clamp(0.98rem, 2.8vw, 1.15rem);
  color: var(--violet-heading);
  opacity: 0.92;
}

#calBtn {
  margin-top: 0.8rem;
}

.lf-seal-space {
  flex: 1 1 auto;
  min-height: 3vh;
}

.lf-hint {
  font-style: italic;
  font-size: clamp(1rem, 2.7vw, 1.2rem);
  color: rgba(93, 85, 102, 0.9);
  padding-bottom: 2.5vh;
  animation: hint-breathe 3.4s ease-in-out infinite;
}

html[lang="ar"] .lf-hint {
  font-style: normal;
}

@keyframes hint-breathe {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* wax seal — sits exactly on the V point of the flap */

.seal {
  position: absolute;
  left: 50%;
  top: var(--flap-point);
  width: clamp(112px, 16vw, 168px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 6;
  border-radius: 50%;
  transition: transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.seal:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 8px;
}

.seal::before {
  content: "";
  position: absolute;
  inset: -13%;
  border-radius: 50%;
  border: 1px solid rgba(169, 138, 68, 0.55);
  animation: seal-pulse 2.8s ease-out infinite;
  pointer-events: none;
}

@keyframes seal-pulse {
  0% {
    transform: scale(0.84);
    opacity: 0;
  }
  35% {
    opacity: 0.9;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

.seal-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 18px rgba(42, 22, 60, 0.42));
}

.letter-lang {
  position: absolute;
  top: max(env(safe-area-inset-top), 1rem);
  left: 50%;
  translate: -50% 0;
  z-index: 8;
  background: rgba(94, 76, 44, 0.07);
  border-color: rgba(169, 138, 68, 0.45);
}

.letter-lang button {
  color: var(--ink-soft);
}

.letter-lang button.active {
  background: var(--violet);
  color: var(--on-dark, var(--ivory-text));
}

/* the dove that escapes the seal */

.flying-bird {
  position: fixed;
  left: 50%;
  top: var(--flap-point);
  width: clamp(96px, 15vw, 140px);
  translate: -50% -50%;
  z-index: 72;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 6px 14px rgba(50, 30, 80, 0.22));
}

.bird-glow {
  position: absolute;
  inset: -32%;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 243, 205, 0.95) 0%, rgba(233, 220, 250, 0.55) 42%, transparent 72%);
  filter: blur(2px);
}

/* ═══════════════════ LIGHT BETWEEN THE WORLDS ═══════════════════ */

.burst {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 252, 240, 0.98) 0%, rgba(247, 236, 210, 0.92) 30%, rgba(233, 216, 244, 0.6) 58%, rgba(233, 216, 244, 0.14) 82%),
    rgba(250, 244, 232, 0.6);
}

/* ═══════════════════ THE GARDEN SITE ═══════════════════ */

.garden {
  position: relative;
  z-index: 1;
}

#petalCanvas {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}

/* nav */

.garden-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(max(env(safe-area-inset-top), 0.7rem)) 1.1rem 0.6rem;
  transition: opacity 0.6s ease;
}

body[data-state="letter"] .garden-nav {
  opacity: 0;
  pointer-events: none;
}

.replay-btn {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark, var(--ivory-text));
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(246, 239, 224, 0.35);
  background: rgba(40, 24, 66, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s ease;
}

html[lang="ar"] .replay-btn {
  letter-spacing: 0;
}

.replay-btn:hover {
  background: rgba(40, 24, 66, 0.58);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.language-switcher {
  display: flex;
  gap: 0.25rem;
  padding: 0.26rem;
  border-radius: 999px;
  border: 1px solid rgba(246, 239, 224, 0.35);
  background: rgba(40, 24, 66, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.language-switcher button {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  color: var(--on-dark, var(--ivory-text));
  opacity: 0.75;
  transition: background 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.language-switcher button.active {
  background: rgba(246, 239, 224, 0.92);
  color: var(--violet-deep);
  opacity: 1;
}

.music-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(246, 239, 224, 0.35);
  background: rgba(40, 24, 66, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
}

.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 15px;
}

.music-bars i {
  width: 2.5px;
  border-radius: 2px;
  background: var(--on-dark, var(--ivory-text));
  height: 30%;
  transition: height 0.3s ease;
}

.music-toggle[aria-pressed="true"] .music-bars i {
  animation: eq 1s ease-in-out infinite alternate;
}

.music-toggle[aria-pressed="true"] .music-bars i:nth-child(1) {
  animation-delay: -0.2s;
}

.music-toggle[aria-pressed="true"] .music-bars i:nth-child(2) {
  animation-delay: -0.6s;
}

.music-toggle[aria-pressed="true"] .music-bars i:nth-child(3) {
  animation-delay: -0.9s;
}

.music-toggle[aria-pressed="true"] .music-bars i:nth-child(4) {
  animation-delay: -0.4s;
}

@keyframes eq {
  from {
    height: 22%;
  }
  to {
    height: 100%;
  }
}

/* hero — the lavender field */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 4.5rem 1.4rem 4rem;
}

.hero-photo {
  position: absolute;
  inset: -5%;
  background-image: url("./assets/hero-lavender.jpg");
  background-size: cover;
  background-position: 50% 55%;
  animation: kenburns 48s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes kenburns {
  from {
    transform: scale(1.02) translateY(0.5%);
  }
  to {
    transform: scale(1.1) translateY(-1.2%);
  }
}

.hero-grade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 55% at 50% 44%, rgba(255, 214, 160, 0.13), transparent 72%),
    radial-gradient(ellipse 70% 62% at 50% 56%, rgba(28, 14, 46, 0.3), transparent 74%),
    linear-gradient(180deg, rgba(30, 16, 48, 0.6) 0%, rgba(30, 16, 48, 0.24) 26%, rgba(30, 16, 48, 0.12) 46%, rgba(28, 14, 46, 0.34) 70%, rgba(24, 12, 40, 0.74) 100%);
}

.hero-copy {
  position: relative;
  max-width: 740px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.85rem, 1.9vh, 1.25rem);
  color: var(--ivory-text);
}

.eyebrow {
  font-size: clamp(0.7rem, 1.8vw, 0.82rem);
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 1px 3px rgba(20, 8, 40, 0.55), 0 2px 12px rgba(20, 8, 40, 0.5);
}

html[lang="ar"] .eyebrow {
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
}

.hero-names {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(3.3rem, 10.5vw, 6.6rem);
  line-height: 1.14;
  color: #fdfaf0;
  text-shadow: 0 2px 5px rgba(20, 8, 40, 0.4), 0 5px 38px rgba(20, 8, 40, 0.65);
}

html[lang="ar"] .hero-names {
  font-family: var(--font-arabic-display);
  font-size: clamp(2.7rem, 9vw, 5.4rem);
}

.hero-title {
  font-style: italic;
  font-size: clamp(1.2rem, 3.4vw, 1.6rem);
  color: #fbf7ec;
  max-width: 38ch;
  line-height: 1.65;
  text-shadow: 0 1px 3px rgba(20, 8, 40, 0.5), 0 3px 18px rgba(20, 8, 40, 0.6);
}

html[lang="ar"] .hero-title {
  font-style: normal;
  font-weight: 700;
}

.gold-rule {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--gold-bright);
}

.gold-rule span {
  display: block;
  width: clamp(48px, 11vw, 96px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 207, 154, 0.9) 35%, rgba(230, 207, 154, 0.9) 65%, transparent);
}

.gold-rule .rule-sprig {
  width: 15px;
}

.hero-date {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fefaf0;
  text-shadow: 0 1px 3px rgba(20, 8, 40, 0.55), 0 3px 16px rgba(20, 8, 40, 0.6);
}

html[lang="ar"] .hero-date {
  letter-spacing: 0;
}

.hero-venue {
  font-size: clamp(1.15rem, 3.3vw, 1.45rem);
  font-weight: 700;
  color: #fcf8ee;
  text-shadow: 0 1px 3px rgba(20, 8, 40, 0.55), 0 3px 14px rgba(20, 8, 40, 0.6);
}

.countdown {
  display: flex;
  gap: clamp(0.5rem, 1.8vw, 0.9rem);
  margin-top: 0.3rem;
}

.cd-cell {
  min-width: clamp(64px, 15vw, 86px);
  padding: 0.75rem 0.4rem 0.6rem;
  border-radius: 8px;
  background: rgba(34, 18, 58, 0.52);
  border: 1px solid rgba(246, 239, 224, 0.36);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cd-cell strong {
  font-size: clamp(1.7rem, 5.2vw, 2.4rem);
  font-weight: 700;
  color: #fdfaf0;
  font-variant-numeric: tabular-nums;
}

.cd-cell span {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(246, 239, 224, 0.88);
}

html[lang="ar"] .cd-cell span {
  letter-spacing: 0;
  font-size: 0.95rem;
}

.hero-cta {
  margin-top: 0.7rem;
  text-decoration: none;
}

.scroll-cue {
  position: absolute;
  bottom: max(env(safe-area-inset-bottom), 1.3rem);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(246, 239, 224, 0.85);
}

.scroll-cue svg {
  width: 24px;
  animation: cue-bob 2.2s ease-in-out infinite;
}

@keyframes cue-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* sections */

.section {
  position: relative;
  padding: clamp(4rem, 10vh, 7rem) 1.5rem;
  background: var(--ivory);
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 260px;
  opacity: 0.05;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.section-lilac {
  background: linear-gradient(180deg, var(--ivory) 0%, var(--lilac-wash) 18%, var(--lilac-wash) 82%, var(--ivory) 100%);
}

.section-tag {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
}

html[lang="ar"] .section-tag {
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  font-size: 0.92rem;
}

.section-tag.light {
  color: var(--gold-bright);
}

.section h2,
.closing h2 {
  font-size: clamp(2.1rem, 5.4vw, 3.1rem);
  font-weight: 600;
  color: var(--violet-heading);
  margin: 0.7rem 0 1rem;
  line-height: 1.3;
}

.body-copy {
  font-size: clamp(1.12rem, 3vw, 1.3rem);
  line-height: 1.85;
  color: var(--ink-soft);
  max-width: 56ch;
}

.body-copy.center {
  margin-inline: auto;
}

.body-copy.light {
  color: #f8f2e4;
  text-shadow: 0 1px 3px rgba(20, 8, 40, 0.5), 0 2px 14px rgba(20, 8, 40, 0.55);
}

.section-head {
  position: relative;
  text-align: center;
  max-width: 700px;
  margin: 0 auto clamp(2rem, 5vh, 3.2rem);
}

/* details cards */

.details-grid {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 1.4rem;
}

.detail-card {
  position: relative;
  background: var(--ivory-card);
  border: 1px solid rgba(169, 138, 68, 0.38);
  border-radius: 6px;
  padding: 2.6rem 1.8rem 2.4rem;
  text-align: center;
  box-shadow: 0 22px 48px rgba(67, 33, 122, 0.1);
  overflow: hidden;
}

.card-sprig {
  position: absolute;
  width: 44px;
  height: auto;
  opacity: 0.55;
  pointer-events: none;
}

.card-sprig.a {
  top: -6px;
  left: 2px;
  transform: rotate(148deg);
}

.card-sprig.b {
  bottom: -6px;
  right: 2px;
  transform: rotate(-32deg);
}

.detail-icon {
  width: 32px;
  margin: 0 auto 1rem;
  color: var(--violet);
}

.detail-card h3 {
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.8rem;
}

html[lang="ar"] .detail-card h3 {
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  font-size: 1.05rem;
}

.detail-strong {
  font-size: clamp(1.5rem, 4.2vw, 1.95rem);
  font-weight: 700;
  color: var(--violet-deep);
  line-height: 1.5;
}

.detail-sub {
  font-size: clamp(1.1rem, 3vw, 1.25rem);
  line-height: 1.75;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

.ghost-btn {
  display: inline-block;
  margin-top: 1.1rem;
  padding: 0.55rem 1.4rem;
  border: 1px solid var(--violet);
  border-radius: 4px;
  color: var(--violet);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease;
}

html[lang="ar"] .ghost-btn {
  letter-spacing: 0.04em;
  text-indent: 0.04em;
  font-size: 0.95rem;
}

.ghost-btn:hover {
  background: var(--violet);
  color: var(--on-dark, var(--ivory-text));
}

/* rsvp */

.rsvp-card {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  background: var(--ivory-card);
  border: 1px solid rgba(139, 108, 190, 0.4);
  border-radius: 6px;
  box-shadow:
    0 30px 64px rgba(67, 33, 122, 0.14),
    inset 0 0 0 6px var(--ivory-card),
    inset 0 0 0 7px rgba(169, 138, 68, 0.32);
  padding: clamp(2.4rem, 6vw, 3.6rem);
  text-align: center;
}

.rsvp-crest-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 0.8rem;
}

.rsvp-crest {
  width: 72px;
  color: var(--violet);
  opacity: 0.9;
}

.crest-sprig {
  width: 26px;
  height: auto;
  opacity: 0.8;
}

.crest-sprig.flip {
  transform: scaleX(-1);
}

.rsvp-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: start;
  max-width: 460px;
  margin-inline: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field > span {
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

html[lang="ar"] .field > span {
  letter-spacing: 0.04em;
  font-size: 0.92rem;
}

.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 1.06rem;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.75);
  border: 1px solid rgba(122, 108, 140, 0.4);
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.field textarea {
  resize: vertical;
  min-height: 76px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(93, 47, 158, 0.14);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.rsvp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-transform: uppercase;
  color: #fbf7ff;
  background: linear-gradient(150deg, #6b39b4, #47217e);
  box-shadow: 0 14px 30px rgba(67, 33, 122, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

html[lang="ar"] .btn {
  letter-spacing: 0.02em;
  text-indent: 0.02em;
  font-size: 1.1rem;
  font-weight: 700;
}

.btn svg {
  width: 18px;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 18px 36px rgba(67, 33, 122, 0.42);
}

.btn.wa {
  background: linear-gradient(150deg, #2b9d63, #16693f);
  box-shadow: 0 14px 30px rgba(22, 105, 63, 0.32);
}

.rsvp-note,
.rsvp-status {
  text-align: center;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.rsvp-status.ok {
  color: #2e6b45;
}

.rsvp-status.err {
  color: #9c3156;
}

/* closing — colorful flower field */

.closing {
  position: relative;
  min-height: 88svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 5rem 1.5rem 6rem;
}

.closing-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 116%;
  top: -8%;
  object-fit: cover;
}

.closing-grade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 100% at 50% 40%, transparent 42%, rgba(28, 12, 44, 0.56) 100%),
    linear-gradient(180deg, rgba(28, 12, 44, 0.5), rgba(28, 12, 44, 0.3) 40%, rgba(24, 10, 40, 0.72) 100%);
}

.closing-copy {
  position: relative;
  max-width: 640px;
  color: var(--ivory-text);
}

.closing h2 {
  color: #fdfaf0;
  text-shadow: 0 2px 24px rgba(20, 8, 40, 0.6);
}

.closing-names {
  margin-top: 1.5rem;
  font-family: var(--font-script);
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  color: var(--gold-bright);
  text-shadow: 0 3px 26px rgba(20, 8, 40, 0.6);
}

html[lang="ar"] .closing-names {
  font-family: var(--font-arabic-display);
}

.foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.2rem 1rem calc(max(env(safe-area-inset-bottom), 0.9rem));
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: rgba(246, 239, 224, 0.7);
  text-align: center;
}

html[lang="ar"] .foot {
  letter-spacing: 0.02em;
}

/* reveals */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */

@media (max-width: 760px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .countdown {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* narrow / portrait screens: shallower, wider envelope folds */

@media (max-width: 640px) {
  :root {
    --flap-point: 44%;
  }

  .env-top .env-clip {
    clip-path: polygon(0 0, 100% 0, 100% 12%, 50% 44%, 0 12%);
  }

  .env-bottom .env-clip {
    clip-path: polygon(0 0, 50% 41%, 100% 0, 100% 100%, 0 100%);
  }

  .trim-d {
    display: none;
  }

  .trim-m {
    display: block;
  }

  .lf-upper {
    padding-top: max(calc(env(safe-area-inset-top) + 7.5vh), 8.5vh);
  }

  .lf-lower {
    top: 55%;
  }
}

/* ═══════════════════ REDUCED MOTION ═══════════════════ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.2s !important;
  }

  html {
    scroll-behavior: auto;
  }

  .hero-photo {
    animation: none;
  }

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

/* ═══════════════ premium template skins ═══════════════ */
/* Lavender (base) & Rose keep the photo look. Royal & White restyle for real variety. */

/* ── Royal Gold — deep emerald + gold, ornate ── */
.tpl-royal .hero-names { color: var(--gold-bright); }
.tpl-royal .hero-title,
.tpl-royal .eyebrow.hero-item { color: var(--gold-soft); }
.tpl-royal .section-tag { color: var(--gold); }
.tpl-royal h2::after { content: ""; display: block; width: 64px; height: 2px; margin: 12px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.tpl-royal .btn { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: #14352a; }
.tpl-royal .cd-cell { border-color: rgba(200, 162, 74, 0.45); }
.tpl-royal .cd-cell strong { color: var(--gold-bright); }
.tpl-royal .closing { background: linear-gradient(160deg, #173a30, #0a1f19); }
.tpl-royal .closing-grade { background: linear-gradient(180deg, rgba(10, 31, 25, 0.2), rgba(10, 31, 25, 0.5)); }

/* ── White Elegance — light, minimal; hero text goes DARK for legibility ── */
.tpl-white .hero-grade { background: linear-gradient(180deg, rgba(46, 42, 36, 0.05), rgba(46, 42, 36, 0.02) 45%, rgba(46, 42, 36, 0.12)); }
.tpl-white .hero-names { color: var(--violet-deep); text-shadow: none; }
.tpl-white .hero-title,
.tpl-white .hero-date,
.tpl-white .hero-venue,
.tpl-white .eyebrow.hero-item { color: var(--ink); text-shadow: none; }
.tpl-white .cd-cell { border-color: rgba(92, 83, 80, 0.28); background: rgba(255, 255, 255, 0.55); }
.tpl-white .cd-cell strong { color: var(--violet-deep); }
.tpl-white .cd-cell span { color: var(--ink-soft); }
.tpl-white .btn { background: var(--violet-deep); color: #fff; }
.tpl-white h2::after { content: ""; display: block; width: 56px; height: 1px; margin: 12px auto 0; background: var(--gold); }
.tpl-white .closing { background: linear-gradient(180deg, #f7f2e9, #efe7d8); }
.tpl-white .closing-grade { background: linear-gradient(180deg, rgba(46, 42, 36, 0.04), rgba(46, 42, 36, 0.1)); }
.tpl-white .closing-copy,
.tpl-white .closing h2,
.tpl-white .closing .section-tag.light { color: var(--ink); text-shadow: none; }
.tpl-white .closing-names { color: var(--violet-deep); text-shadow: none; }

/* ── Midnight Stars — deep navy night sky, silver-gold accents ── */
.tpl-midnight .hero-names { color: #eef1ff; }
.tpl-midnight .hero-title,
.tpl-midnight .eyebrow.hero-item { color: #c8d0ee; }
.tpl-midnight .section-tag { color: var(--gold); }
.tpl-midnight h2::after { content: ""; display: block; width: 64px; height: 1px; margin: 12px auto 0; background: linear-gradient(90deg, transparent, #c8d0ee, transparent); }
.tpl-midnight .btn { background: linear-gradient(135deg, #39466f, #273258); color: #eef1ff; }
.tpl-midnight .cd-cell { border-color: rgba(200, 208, 238, 0.4); }
.tpl-midnight .cd-cell strong { color: #eef1ff; }
.tpl-midnight .closing { background: linear-gradient(180deg, #1c2445, #12182f); }
.tpl-midnight .closing-grade { background: linear-gradient(180deg, rgba(18, 24, 47, 0.2), rgba(18, 24, 47, 0.55)); }

/* ── Olive Garden — quiet greens on cream, dark legible text ── */
.tpl-olive .hero-grade { background: linear-gradient(180deg, rgba(51, 57, 31, 0.05), rgba(51, 57, 31, 0.02) 45%, rgba(51, 57, 31, 0.12)); }
.tpl-olive .hero-names { color: var(--violet-deep); text-shadow: none; }
.tpl-olive .hero-title,
.tpl-olive .hero-date,
.tpl-olive .hero-venue,
.tpl-olive .eyebrow.hero-item { color: var(--ink); text-shadow: none; }
.tpl-olive .cd-cell { border-color: rgba(90, 107, 61, 0.3); background: rgba(255, 255, 255, 0.55); }
.tpl-olive .cd-cell strong { color: var(--violet-deep); }
.tpl-olive .cd-cell span { color: var(--ink-soft); }
.tpl-olive .btn { background: var(--violet-deep); color: #fff; }
.tpl-olive h2::after { content: ""; display: block; width: 56px; height: 1px; margin: 12px auto 0; background: var(--gold); }
.tpl-olive .closing { background: linear-gradient(180deg, #eef0e2, #e0e4cd); }
.tpl-olive .closing-grade { background: linear-gradient(180deg, rgba(51, 57, 31, 0.04), rgba(51, 57, 31, 0.1)); }
.tpl-olive .closing-copy,
.tpl-olive .closing h2,
.tpl-olive .closing .section-tag.light { color: var(--ink); text-shadow: none; }
.tpl-olive .closing-names { color: var(--violet-deep); text-shadow: none; }

/* ── light-template legibility: .body-copy.light / .foot / .scroll-cue carry
   their own cream color, so the parent recolors above never reach them ── */
.tpl-white .closing .body-copy.light,
.tpl-olive .closing .body-copy.light { color: var(--ink-soft); text-shadow: none; }
.tpl-white .foot,
.tpl-olive .foot { color: var(--ink-soft); }
.tpl-white .scroll-cue,
.tpl-olive .scroll-cue { color: var(--ink-soft); }

/* ── theme-driven seal wax + doves: the gate follows the palette instead of
   opening lavender on every template. SVG gradient stops accept CSS vars, and
   CSS fill beats presentation attributes — no markup changes needed. ── */
#waxCore stop:nth-child(1) { stop-color: var(--wax-1, #9a5fd0); }
#waxCore stop:nth-child(2) { stop-color: var(--wax-2, #6a35a6); }
#waxCore stop:nth-child(3) { stop-color: var(--wax-3, #4a2080); }
#waxCore stop:nth-child(4) { stop-color: var(--wax-4, #37155e); }
.seal-svg circle[fill="#240b3c"] { fill: var(--wax-under, #240b3c); }
.seal-svg circle[stroke="#2a1049"] { stroke: var(--wax-under, #2a1049); }
.seal-glitter circle[fill="#efe0ff"],
.seal-glitter circle[fill="#e9d5ff"],
.seal-glitter circle[fill="#f4e8ff"] { fill: var(--seal-glitter, #efe0ff); }
#doveBodyGrad stop:nth-child(2) { stop-color: var(--dove-mid, #ddd4e8); }
#doveWingGrad stop:nth-child(2) { stop-color: var(--dove-wing, #c9bedb); }
.flying-bird .wing-far { fill: var(--dove-shade, #bdb0d2); }
.flying-bird .tail { fill: var(--dove-tail, #cfc4e0); }
.flying-bird .beak { stroke: var(--dove-beak, #b9a8d0); }

/* ── Rose Poppy — burgundy warmth (the one skin that had no block at all) ── */
.tpl-rose .btn { background: linear-gradient(150deg, #b23048, #7e1f34); box-shadow: 0 14px 30px rgba(126, 31, 52, 0.35); }
.tpl-rose .cd-cell { background: rgba(62, 16, 26, 0.5); border-color: rgba(224, 167, 179, 0.42); }
.tpl-rose h2::after { content: ""; display: block; width: 56px; height: 1px; margin: 12px auto 0; background: var(--gold); }

/* ── per-tenant monogram (config-gated; the REAL artwork file, e.g. the B&M crest).
   mix-blend multiply melts a white-background PNG into the paper. ── */
.lf-monogram { display: none; width: 96px; height: auto; margin: 0 auto 6px; mix-blend-mode: multiply; }
@media (max-width: 640px) {
  .lf-monogram { width: 70px; margin: 52px auto 2px; }
}

/* ── real-photo flying bird: image frames of the tenant's exact bird ── */
.bird--photo svg { display: none; }
.flying-bird .bird-frame { width: 100%; height: 100%; object-fit: contain; display: block; }
#flyingBird2 .bird-frame { transform: scaleX(-1); }
@keyframes birdRock { 0%, 100% { rotate: -5deg; } 50% { rotate: 6deg; } }
.bird-frame--rock { animation: birdRock 0.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .bird-frame--rock { animation: none; } }

/* ── real-photo seal mode: the tenant's own seal image replaces the drawn art ── */
.seal--photo .seal-svg > g:not(.seal-photo-layer),
.seal--photo .seal-svg > ellipse { display: none; }
.seal--photo .seal-svg { filter: drop-shadow(0 12px 20px rgba(30, 10, 50, 0.35)); }

/* ── glitter twinkle on the wax seal ── */
@keyframes sealTwinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.95; }
}
.seal-glitter circle { animation: sealTwinkle 2.6s ease-in-out infinite; }
.seal-glitter circle:nth-of-type(2n) { animation-delay: 0.7s; }
.seal-glitter circle:nth-of-type(3n) { animation-delay: 1.3s; }
.seal-glitter circle:nth-of-type(5n) { animation-delay: 1.9s; }
@media (prefers-reduced-motion: reduce) {
  .seal-glitter circle { animation: none; }
}

/* ── pluggable opening flows: shared screen base (gate / curtain / gift) ── */
.flow-screen {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ivory);
}
body.flow-active .envelope { display: none !important; }
body.flow-active .flying-bird { display: none; }
.flow-trigger { cursor: pointer; border: 0; background: none; padding: 0; }
.flow-trigger:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* ═══════ opening flow: gate ═══════ */
/* ═════════════════════════════════════════════════════════════════════
   Flow: بوابة الحديقة — the garden gate. Two wrought-iron leaves under a
   gilded arch, a glowing garden waiting behind the bars. The rosette
   handle is the trigger. All colors ride the palette CSS vars.
   ═════════════════════════════════════════════════════════════════════ */

/* rides the shared .flow-screen base (fixed, inset 0, z 70, flex column,
   centered, overflow hidden, ivory) — restated here so the flow stands alone */
.flow-screen--gate {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* stationery vignette + grain, same paper feel as the envelope */
.flow-screen--gate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: radial-gradient(ellipse 140% 110% at 50% 46%, transparent 60%, rgba(94, 76, 44, 0.14) 100%);
}

.flow-screen--gate::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 260px;
  opacity: 0.06;
  mix-blend-mode: multiply;
}

/* the world — everything the camera pushes through */
.flow-screen--gate .gate-world {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 2.2vh, 1.5rem);
  padding: calc(env(safe-area-inset-top) + 2.5vh) 1.25rem calc(env(safe-area-inset-bottom) + 2.5vh);
}

.flow-screen--gate .gate-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.flow-screen--gate .gate-sky {
  position: absolute;
  inset: 0 0 42%;
  background: linear-gradient(180deg, var(--lilac-wash), transparent 85%);
  opacity: 0.8;
}

.flow-screen--gate .gate-ground {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 130%;
  height: 24%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 42% at 50% 38%, rgba(94, 76, 44, 0.14), transparent 70%);
}

/* ── the gate scene ── */

.flow-screen--gate .gate-scene {
  position: relative;
  z-index: 2;
  width: min(88vw, 430px);
  aspect-ratio: 390 / 520;
  flex: 0 0 auto;
}

/* the glowing garden behind the bars */
.flow-screen--gate .gate-glowfield {
  position: absolute;
  inset: 13% 15.4% 2.7%;
  z-index: 1;
  pointer-events: none;
}

.flow-screen--gate .gate-glow-core {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 86%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--gold-bright) 0%, transparent 62%);
  opacity: 0.55;
  filter: blur(10px);
  animation: gate-glow-breathe 5.5s ease-in-out infinite;
}

@keyframes gate-glow-breathe {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.65;
  }
}

.flow-screen--gate .gate-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(22px);
}

.flow-screen--gate .gate-blob--green {
  left: -6%;
  bottom: -4%;
  width: 55%;
  aspect-ratio: 1.4;
  background: var(--green);
  opacity: 0.3;
}

.flow-screen--gate .gate-blob--sage {
  right: -6%;
  bottom: -2%;
  width: 48%;
  aspect-ratio: 1.3;
  background: var(--sage);
  opacity: 0.3;
}

.flow-screen--gate .gate-blob--lav {
  left: 22%;
  top: 16%;
  width: 56%;
  aspect-ratio: 1.2;
  background: var(--lavender);
  opacity: 0.4;
}

/* the two iron leaves — physical layout, immune to RTL flex reversal */
.flow-screen--gate .gate-doors {
  position: absolute;
  inset: 12.7% 15.4% 2.7%;
  z-index: 3;
  display: flex;
  direction: ltr;
  perspective: 1200px;
}

.flow-screen--gate .gate-door {
  position: relative;
  width: 50%;
  height: 100%;
  will-change: transform;
}

.flow-screen--gate .gate-door--l {
  transform-origin: left center;
}

.flow-screen--gate .gate-door--r {
  transform-origin: right center;
}

.flow-screen--gate .gate-door svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 20px rgba(25, 18, 40, 0.32));
}

.flow-screen--gate .gate-door--r svg {
  transform: scaleX(-1);
}

/* gilded arch + climbing flowers, in front of the leaves */
.flow-screen--gate .gate-arch {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* the warm light that blooms through the bars on open */
.flow-screen--gate .gate-bloom {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 5;
  width: 120%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(0.4);
  background: radial-gradient(circle, rgba(255, 255, 250, 0.95) 0%, var(--gold-bright) 30%, var(--lavender) 56%, transparent 74%);
  mix-blend-mode: screen;
  opacity: 0;
  filter: blur(2px);
  pointer-events: none;
}

/* ── the rosette handle (the trigger) ── */

.flow-screen--gate .flow-trigger {
  position: absolute;
  left: 50%;
  top: 60.8%;
  z-index: 6;
  width: clamp(62px, 16vw, 82px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s ease;
  filter: drop-shadow(0 8px 16px rgba(25, 18, 40, 0.4));
}

.flow-screen--gate .flow-trigger:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.flow-screen--gate .flow-trigger:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}

.flow-screen--gate .flow-trigger::before {
  content: "";
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  border: 1px solid rgba(169, 138, 68, 0.55);
  animation: gate-pulse 2.8s ease-out infinite;
  pointer-events: none;
}

@keyframes gate-pulse {
  0% {
    transform: scale(0.84);
    opacity: 0;
  }
  35% {
    opacity: 0.9;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

.flow-screen--gate .flow-trigger svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* drifting petals (animated by GSAP on open) */
.flow-screen--gate .gate-petals {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.flow-screen--gate .gate-petal {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 11px;
  height: 15px;
  border-radius: 62% 38% 58% 42% / 55% 45% 60% 40%;
  background: linear-gradient(150deg, var(--lavender), var(--gold-bright));
  opacity: 0;
  will-change: transform, opacity;
}

.flow-screen--gate .gate-petal:nth-child(3n) {
  background: linear-gradient(150deg, var(--gold-bright), var(--gold-soft));
}

.flow-screen--gate .gate-petal:nth-child(4n) {
  width: 9px;
  height: 12px;
}

/* ── the invitation text, below the arch ── */

.flow-screen--gate .gate-text {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(0.35rem, 1vh, 0.7rem);
  max-width: min(92vw, 560px);
}

.flow-screen--gate .lf-names {
  font-size: clamp(2.2rem, 8.4vw, 3.9rem);
  line-height: 1.12;
}

html[lang="ar"] .flow-screen--gate .lf-names {
  font-size: clamp(2rem, 7.4vw, 3.5rem);
}

.flow-screen--gate .lf-hint {
  padding-bottom: 0;
}

.flow-screen--gate [hidden] {
  display: none !important;
}

/* ── responsive ── */

@media (max-height: 700px) {
  .flow-screen--gate .gate-scene {
    width: min(72vw, 330px);
  }

  .flow-screen--gate .lf-names,
  html[lang="ar"] .flow-screen--gate .lf-names {
    font-size: clamp(1.9rem, 6.6vw, 2.7rem);
  }
}

@media (min-width: 760px) {
  .flow-screen--gate .gate-scene {
    width: min(50vh, 470px);
  }

  .flow-screen--gate .gate-world {
    gap: clamp(1rem, 3vh, 2rem);
  }
}

/* ── reduced motion: a calm, still gate ── */

@media (prefers-reduced-motion: reduce) {
  .flow-screen--gate .flow-trigger {
    transition: none;
  }

  .flow-screen--gate .flow-trigger::before {
    animation: none;
    opacity: 0.45;
    transform: scale(1.05);
  }

  .flow-screen--gate .gate-glow-core {
    animation: none;
  }

  .flow-screen--gate .lf-hint {
    animation: none;
    opacity: 0.85;
  }

  .flow-screen--gate .gate-petal {
    display: none;
  }
}

/* ═══════ opening flow: curtain ═══════ */
/* ═════════════════════════════════════════════════════════════════════
   FLOW · curtain — الستارة الملكية
   A grand theater: velvet panels in the palette's wax tones, gold valance
   and tassel-rope pull, a spotlight pool where the invitation stands.
   Every color is a CSS var → correct on all six palettes.
   ═════════════════════════════════════════════════════════════════════ */

.flow-screen--curtain {
  position: fixed;
  inset: 0;
  z-index: 70; /* nav is 90 — stay below 80 */
  overflow: hidden;
  perspective: 1200px;
  background: var(--wax-4, #37155e);
  -webkit-tap-highlight-color: transparent;
}

.flow-screen--curtain *,
.flow-screen--curtain *::before,
.flow-screen--curtain *::after {
  box-sizing: border-box;
}

/* film grain over the whole stage (uses the shared --grain token) */
.flow-screen--curtain::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 7;
  background-image: var(--grain, none);
  background-size: 260px;
  opacity: 0.07;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ── the house ── */

.flow-screen--curtain .ct-house {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* back wall + floor (the 0.2% step at 76% is the stage-floor edge) */
.flow-screen--curtain .ct-back {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(6, 3, 12, 0.72) 0%,
      rgba(6, 3, 12, 0.35) 45%,
      rgba(6, 3, 12, 0.6) 75.8%,
      rgba(16, 10, 26, 0.55) 76%,
      rgba(4, 2, 8, 0.88) 100%),
    linear-gradient(180deg, var(--wax-3, #4a2080) 0%, var(--wax-4, #37155e) 58%, var(--wax-4, #37155e) 100%);
}

/* the second, sheer curtain — a gauzy scrim over the back wall */
.flow-screen--curtain .ct-sheer {
  position: absolute;
  inset: -3% -2%;
  background:
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, 0.09) 0 2px,
      rgba(255, 255, 255, 0.015) 2px 34px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.1));
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  will-change: transform;
}

/* spotlight cone */
.flow-screen--curtain .ct-beam {
  position: absolute;
  top: -4%;
  bottom: 21%;
  left: 50%;
  width: min(84vw, 680px);
  transform: translateX(-50%);
  clip-path: polygon(42% 0, 58% 0, 96% 100%, 4% 100%);
  background: linear-gradient(180deg, rgba(255, 247, 222, 0.42), rgba(255, 247, 222, 0.18) 55%, rgba(255, 247, 222, 0.04));
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: ctBeamBreath 5.5s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes ctBeamBreath {
  from { opacity: 0.42; }
  to { opacity: 0.58; }
}

/* light pool on the boards */
.flow-screen--curtain .ct-pool {
  position: absolute;
  bottom: 11%;
  left: 50%;
  width: min(78vw, 600px);
  height: 14vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(255, 247, 222, 0.5), rgba(255, 247, 222, 0.12) 58%, transparent 78%);
  filter: blur(3px);
  mix-blend-mode: screen;
  opacity: 0.75;
  pointer-events: none;
}

/* dust motes drifting in the beam */
.flow-screen--curtain .ct-motes {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  pointer-events: none;
}

.flow-screen--curtain .ct-motes i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-bright, #e6cf9a);
  box-shadow: 0 0 6px var(--gold-bright, #e6cf9a);
  opacity: 0;
  animation: ctMote 7s linear infinite;
}

@keyframes ctMote {
  0% { transform: translate3d(0, 2vh, 0); opacity: 0; }
  14% { opacity: 0.75; }
  60% { opacity: 0.3; }
  100% { transform: translate3d(1.6vh, -9vh, 0); opacity: 0; }
}

.flow-screen--curtain .ct-motes i:nth-child(1) { left: 38%; top: 34%; animation-delay: 0s; }
.flow-screen--curtain .ct-motes i:nth-child(2) { left: 46%; top: 52%; width: 2px; height: 2px; animation-delay: 1.2s; animation-duration: 7.6s; }
.flow-screen--curtain .ct-motes i:nth-child(3) { left: 55%; top: 40%; animation-delay: 2.1s; animation-duration: 6.2s; }
.flow-screen--curtain .ct-motes i:nth-child(4) { left: 61%; top: 60%; width: 4px; height: 4px; filter: blur(1px); animation-delay: 0.6s; animation-duration: 8.2s; }
.flow-screen--curtain .ct-motes i:nth-child(5) { left: 42%; top: 66%; animation-delay: 3s; }
.flow-screen--curtain .ct-motes i:nth-child(6) { left: 50%; top: 30%; width: 2px; height: 2px; animation-delay: 4.2s; animation-duration: 6.8s; }
.flow-screen--curtain .ct-motes i:nth-child(7) { left: 58%; top: 72%; animation-delay: 1.8s; animation-duration: 7.2s; }
.flow-screen--curtain .ct-motes i:nth-child(8) { left: 35%; top: 56%; animation-delay: 5s; }
.flow-screen--curtain .ct-motes i:nth-child(9) { left: 65%; top: 46%; width: 2px; height: 2px; animation-delay: 2.6s; animation-duration: 6.4s; }
.flow-screen--curtain .ct-motes i:nth-child(10) { left: 47%; top: 76%; width: 4px; height: 4px; filter: blur(1px); animation-delay: 3.6s; animation-duration: 8.6s; }
.flow-screen--curtain .ct-motes i:nth-child(11) { left: 52%; top: 58%; animation-delay: 0.9s; }
.flow-screen--curtain .ct-motes i:nth-child(12) { left: 40%; top: 44%; animation-delay: 4.6s; animation-duration: 7.4s; }

/* ── the invitation in the spotlight ── */

.flow-screen--curtain .ct-copy {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.5vh, 1rem);
  text-align: center;
  padding: max(15vh, calc(env(safe-area-inset-top) + 13vh)) 1.25rem 9vh;
  pointer-events: none;
  will-change: transform, opacity;
}

.flow-screen--curtain .lf-eyebrow {
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: var(--gold-bright, #e6cf9a);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

html[lang="ar"] .flow-screen--curtain .lf-eyebrow {
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
}

.flow-screen--curtain .lf-families {
  font-style: italic;
  font-size: clamp(1.05rem, 2.9vw, 1.35rem);
  color: var(--on-dark, #f6efe0);
  opacity: 0.85;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

html[lang="ar"] .flow-screen--curtain .lf-families {
  font-style: normal;
  font-weight: 700;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
}

.flow-screen--curtain .lf-names {
  font-family: var(--font-script, "Great Vibes", "Aref Ruqaa", cursive);
  font-weight: 400;
  font-size: clamp(2.6rem, 9.5vw, 5rem);
  line-height: 1.14;
  color: var(--on-dark, #f6efe0);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 6px 40px rgba(0, 0, 0, 0.6);
}

html[lang="ar"] .flow-screen--curtain .lf-names {
  font-family: var(--font-arabic-display, "Aref Ruqaa", serif);
  font-weight: 700;
  font-size: clamp(2.3rem, 8.2vw, 4.4rem);
}

.flow-screen--curtain .ct-rule {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.flow-screen--curtain .ct-rule span {
  display: block;
  width: clamp(48px, 11vw, 100px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-bright, #e6cf9a) 35%, var(--gold-bright, #e6cf9a) 65%, transparent);
}

.flow-screen--curtain .ct-rule b {
  display: block;
  width: 7px;
  height: 7px;
  background: var(--gold-bright, #e6cf9a);
  transform: rotate(45deg);
}

.flow-screen--curtain .lf-date {
  font-weight: 700;
  font-size: clamp(1.25rem, 3.6vw, 1.65rem);
  letter-spacing: 0.1em;
  color: var(--gold-bright, #e6cf9a);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

html[lang="ar"] .flow-screen--curtain .lf-date {
  letter-spacing: 0;
}

.flow-screen--curtain .lf-guest {
  margin-top: 0.4rem;
  font-family: var(--font-arabic-display, "Aref Ruqaa", serif);
  font-size: clamp(0.98rem, 2.8vw, 1.15rem);
  color: var(--on-dark, #f6efe0);
  opacity: 0.92;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.flow-screen--curtain .lf-hint {
  margin-top: 1.1vh;
  font-style: italic;
  font-size: clamp(1rem, 2.7vw, 1.2rem);
  color: var(--on-dark, #f6efe0);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  animation: ctHintBreathe 3.4s ease-in-out infinite;
}

html[lang="ar"] .flow-screen--curtain .lf-hint {
  font-style: normal;
}

@keyframes ctHintBreathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── the velvet curtains ── */

.flow-screen--curtain .ct-curtain {
  position: absolute;
  top: -1%;
  bottom: -1%;
  width: 28vw;
  min-width: 104px;
  z-index: 3;
  will-change: transform;
}

.flow-screen--curtain .ct-left {
  left: -1%;
  filter: drop-shadow(16px 0 26px rgba(6, 3, 12, 0.55));
}

.flow-screen--curtain .ct-right {
  right: -1%;
  filter: drop-shadow(-16px 0 26px rgba(6, 3, 12, 0.55));
}

.flow-screen--curtain .ct-drape {
  position: absolute;
  inset: 0;
  will-change: transform;
}

/* back drape: tighter, darker folds */
.flow-screen--curtain .ct-drape-back {
  background-color: var(--wax-3, #4a2080);
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 68%, rgba(0, 0, 0, 0.45)),
    repeating-linear-gradient(90deg,
      rgba(0, 0, 0, 0.42) 0 8px,
      rgba(0, 0, 0, 0.1) 8px 20px,
      rgba(255, 255, 255, 0.06) 26px 34px,
      rgba(0, 0, 0, 0.1) 40px 54px);
}

/* front drape: broader folds with a velvet sheen + gold hem */
.flow-screen--curtain .ct-drape-front {
  background-color: var(--wax-2, #6a35a6);
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.38)),
    repeating-linear-gradient(90deg,
      rgba(0, 0, 0, 0.34) 0 10px,
      rgba(0, 0, 0, 0.08) 10px 26px,
      rgba(255, 255, 255, 0.1) 34px 46px,
      rgba(0, 0, 0, 0.08) 54px 76px);
}

.flow-screen--curtain .ct-drape-front::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  background: linear-gradient(90deg, var(--gold-soft, #cdb98a), var(--gold, #b39250));
  box-shadow: 0 -3px 0 rgba(255, 255, 255, 0.14);
  opacity: 0.55;
}

/* gold piping on the inner (leading) edge */
.flow-screen--curtain .ct-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--gold-bright, #e6cf9a), var(--gold, #b39250) 40%, var(--gold-soft, #cdb98a) 70%, var(--gold, #b39250));
  opacity: 0.85;
}

.flow-screen--curtain .ct-left .ct-edge { right: 0; }
.flow-screen--curtain .ct-right .ct-edge { left: 0; }

/* ── valance ── */

.flow-screen--curtain .ct-valance {
  position: absolute;
  top: 0;
  left: -1%;
  width: 102%;
  height: clamp(70px, 13vh, 130px);
  z-index: 6;
  filter: drop-shadow(0 10px 18px rgba(6, 3, 12, 0.4));
  pointer-events: none;
  will-change: transform;
}

/* ── light flood (the moment the garden takes over) ── */

.flow-screen--curtain .ct-flood {
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 46%, rgba(255, 252, 240, 0.98) 0%, rgba(247, 236, 210, 0.9) 34%, rgba(255, 250, 238, 0.5) 62%, rgba(255, 250, 238, 0.12) 85%);
  pointer-events: none;
}

/* ── the trigger: gold tassel rope ── */

.flow-screen--curtain .flow-trigger {
  position: absolute;
  top: 0;
  inset-inline-end: clamp(8px, 7vw, 90px);
  width: clamp(54px, 15vw, 84px);
  height: clamp(230px, 44vh, 360px);
  z-index: 5; /* under the valance (6): the rope's top tucks behind it */
  transition: transform 0.3s ease;
  will-change: transform;
}

.flow-screen--curtain .flow-trigger:hover { transform: translateY(6px); }
.flow-screen--curtain .flow-trigger:active { transform: translateY(12px); }

.flow-screen--curtain .flow-trigger:focus-visible {
  outline: 2px solid var(--gold, #b39250);
  outline-offset: 6px;
  border-radius: 14px;
}

.flow-screen--curtain .ct-rope {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: 50% 0;
  animation: ctSway 5.6s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(6, 3, 12, 0.5));
}

@keyframes ctSway {
  0%, 100% { transform: rotate(1.8deg); }
  50% { transform: rotate(-1.8deg); }
}

/* soft glow behind the tassel head — the "press me" affordance */
.flow-screen--curtain .flow-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-bright, #e6cf9a) 0%, transparent 68%);
  opacity: 0.22;
  animation: ctGlowPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ctGlowPulse {
  0%, 100% { opacity: 0.14; transform: translate(-50%, -50%) scale(0.9); }
  50% { opacity: 0.32; transform: translate(-50%, -50%) scale(1.08); }
}

/* ── desktop: grander proportions ── */

@media (min-width: 720px) {
  .flow-screen--curtain .ct-curtain { width: 30vw; }
  .flow-screen--curtain .ct-copy { padding-top: 17vh; }
  .flow-screen--curtain .flow-trigger { inset-inline-end: 9vw; }
}

/* ── reduced motion: a still, quiet theater ── */

@media (prefers-reduced-motion: reduce) {
  .flow-screen--curtain .ct-rope,
  .flow-screen--curtain .flow-trigger::after,
  .flow-screen--curtain .ct-motes i,
  .flow-screen--curtain .ct-beam,
  .flow-screen--curtain .lf-hint {
    animation: none;
  }
  .flow-screen--curtain .ct-motes i { opacity: 0.4; }
  .flow-screen--curtain .flow-trigger,
  .flow-screen--curtain .flow-trigger:hover,
  .flow-screen--curtain .flow-trigger:active { transition: none; transform: none; }
}

/* ═══════ opening flow: gift ═══════ */
/* ═════════════════════════════════════════════════════════════════════
   FLOW · gift — صندوق الهدية
   An ivory gift box under a spotlight in a deep velvet room; the gold
   ribbon bow is the trigger. Every color rides the theme vars, so the
   room re-tints itself per palette (wax = the theme's deep tones).
   ═════════════════════════════════════════════════════════════════════ */

.flow-screen--gift {
  --gift-lid-h: clamp(44px, 7vh, 58px);
  --gift-body-h: clamp(148px, 24vh, 205px);
  --gift-ribbon-w: clamp(24px, 11%, 34px);

  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  background: radial-gradient(130% 100% at 50% 22%, var(--wax-1, #9a5fd0) 0%, var(--wax-3, #4a2080) 52%, var(--wax-under, #240b3c) 100%);
}

/* paper grain over the whole room */
.flow-screen--gift::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 260px;
  opacity: 0.1;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* the soft spotlight the box stands in */
.flow-screen--gift::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 46% at 50% 60%, rgba(255, 255, 250, 0.11), rgba(255, 255, 250, 0) 70%);
  pointer-events: none;
}

/* ── drifting dust motes ── */

.flow-screen--gift .gift-motes span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--seal-glitter, #efe0ff);
  filter: blur(1px);
  opacity: 0;
  animation: gift-mote 11s linear infinite;
}

.flow-screen--gift .gift-motes span:nth-child(1) { left: 12%; top: 72%; animation-duration: 12s; }
.flow-screen--gift .gift-motes span:nth-child(2) { left: 26%; top: 38%; width: 3px; height: 3px; animation-duration: 15s; animation-delay: -4s; }
.flow-screen--gift .gift-motes span:nth-child(3) { left: 44%; top: 82%; animation-duration: 10s; animation-delay: -7s; }
.flow-screen--gift .gift-motes span:nth-child(4) { left: 62%; top: 30%; width: 4px; height: 4px; animation-duration: 14s; animation-delay: -2s; }
.flow-screen--gift .gift-motes span:nth-child(5) { left: 78%; top: 64%; animation-duration: 13s; animation-delay: -9s; }
.flow-screen--gift .gift-motes span:nth-child(6) { left: 88%; top: 44%; width: 3px; height: 3px; animation-duration: 16s; animation-delay: -5s; }
.flow-screen--gift .gift-motes span:nth-child(7) { left: 8%; top: 26%; width: 4px; height: 4px; animation-duration: 15s; animation-delay: -11s; }

@keyframes gift-mote {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  15% { opacity: 0.45; }
  85% { opacity: 0.28; }
  100% { transform: translate3d(14px, -16vh, 0); opacity: 0; }
}

/* ── stage: text · box · hint ── */

.flow-screen--gift .gift-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 5vh) 1.25rem calc(env(safe-area-inset-bottom) + 4vh);
  will-change: transform;
}

.flow-screen--gift .gift-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(0.4rem, 1.2vh, 0.85rem);
  padding: 0 0.5rem;
}

/* the letter-face copy, re-inked for the dark room */
.flow-screen--gift .lf-eyebrow { color: var(--gold-bright, #e6cf9a); }
.flow-screen--gift .lf-families { color: var(--on-dark, #f6efe0); opacity: 0.82; }
.flow-screen--gift .lf-names {
  color: var(--on-dark, #f6efe0);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.38);
}
.flow-screen--gift .lf-date { color: var(--gold-soft, #cdb98a); }
.flow-screen--gift .lf-guest { color: var(--on-dark, #f6efe0); opacity: 0.9; }
.flow-screen--gift .lf-hint {
  color: var(--on-dark, #f6efe0);
  opacity: 0.75;
  padding-bottom: 0;
  margin-top: 1.5vh;
}

/* ── the gift box ── */

.flow-screen--gift .gift-box {
  position: relative;
  width: min(74vw, 300px);
  margin: clamp(2.4rem, 6.5vh, 3.8rem) auto clamp(0.8rem, 2.5vh, 1.6rem);
}

.flow-screen--gift .gift-shadow {
  position: absolute;
  left: 50%;
  bottom: -22px;
  width: 132%;
  height: 32px;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 70%);
  filter: blur(4px);
  z-index: 0;
  pointer-events: none;
}

.flow-screen--gift .gift-body {
  position: relative;
  z-index: 1;
  margin-top: calc(var(--gift-lid-h) - 12px);
  height: var(--gift-body-h);
  border-radius: 0 0 12px 12px;
  background:
    linear-gradient(90deg, rgba(60, 44, 20, 0.14), rgba(60, 44, 20, 0) 14% 86%, rgba(60, 44, 20, 0.16)),
    linear-gradient(180deg, rgba(255, 255, 250, 0.42), rgba(255, 255, 250, 0) 34%, rgba(60, 44, 20, 0.08) 100%),
    var(--ivory-card, #fbf8f1);
  box-shadow:
    0 26px 48px rgba(0, 0, 0, 0.42),
    0 6px 16px rgba(0, 0, 0, 0.28);
  will-change: transform;
}

.flow-screen--gift .gift-body::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--grain);
  background-size: 260px;
  opacity: 0.06;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* ribbons on the body: gold cross with satin shading */
.flow-screen--gift .gift-ribbon-v,
.flow-screen--gift .gift-ribbon-h-l,
.flow-screen--gift .gift-ribbon-h-r,
.flow-screen--gift .gift-lid-ribbon {
  position: absolute;
  background:
    linear-gradient(90deg, rgba(60, 40, 0, 0.2), rgba(255, 255, 255, 0.34) 24%, rgba(255, 255, 255, 0.05) 56%, rgba(60, 40, 0, 0.18)),
    var(--gold, #b39250);
  will-change: transform, opacity;
}

.flow-screen--gift .gift-ribbon-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--gift-ribbon-w);
  transform: translateX(-50%);
  z-index: 3;
}

.flow-screen--gift .gift-ribbon-h-l,
.flow-screen--gift .gift-ribbon-h-r {
  top: 50%;
  height: var(--gift-ribbon-w);
  transform: translateY(-50%);
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 46%, rgba(60, 40, 0, 0.22)),
    var(--gold, #b39250);
}

.flow-screen--gift .gift-ribbon-h-l { left: 0; right: 50%; }
.flow-screen--gift .gift-ribbon-h-r { left: 50%; right: 0; }

/* the light waiting inside the box */
.flow-screen--gift .gift-glow,
.flow-screen--gift .gift-glow-core {
  position: absolute;
  left: 50%;
  top: calc(var(--gift-lid-h) - 12px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.35);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 4;
  will-change: transform, opacity;
}

.flow-screen--gift .gift-glow {
  width: 125%;
  background: radial-gradient(closest-side, rgba(255, 255, 250, 0.95), var(--gold-bright, #e6cf9a) 32%, transparent 72%);
  filter: blur(3px);
}

.flow-screen--gift .gift-glow-core {
  width: 52%;
  background: radial-gradient(closest-side, #fff, var(--seal-glitter, #efe0ff) 45%, transparent 74%);
}

/* petals + sparks that rise out of the open box */
.flow-screen--gift .gift-burst {
  position: absolute;
  left: 50%;
  top: calc(var(--gift-lid-h) - 12px);
  width: 0;
  height: 0;
  z-index: 7;
  pointer-events: none;
}

.flow-screen--gift .gift-spark {
  position: absolute;
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 62% 38% 55% 45% / 48% 62% 38% 52%;
  background: var(--lavender, #b9a3d8);
  opacity: 0;
  will-change: transform, opacity;
}

.flow-screen--gift .gift-spark:nth-child(2n) { transform: rotate(40deg); }
.flow-screen--gift .gift-spark:nth-child(3n) { background: var(--gold-bright, #e6cf9a); width: 7px; height: 7px; border-radius: 50%; }
.flow-screen--gift .gift-spark:nth-child(4n) { background: var(--seal-glitter, #efe0ff); }
.flow-screen--gift .gift-spark:nth-child(5n) { background: #fff; width: 6px; height: 6px; border-radius: 50%; }

/* the lid — slightly wider, brighter paper, casts onto the body */
.flow-screen--gift .gift-lid {
  position: absolute;
  top: 0;
  left: 50%;
  width: 112%;
  height: var(--gift-lid-h);
  transform: translateX(-50%);
  border-radius: 9px;
  background:
    linear-gradient(90deg, rgba(60, 44, 20, 0.12), rgba(60, 44, 20, 0) 14% 86%, rgba(60, 44, 20, 0.14)),
    linear-gradient(180deg, rgba(255, 255, 250, 0.6), rgba(255, 255, 250, 0) 60%, rgba(60, 44, 20, 0.1) 100%),
    var(--ivory-card, #fbf8f1);
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.32);
  z-index: 5;
  will-change: transform, opacity;
}

.flow-screen--gift .gift-lid::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--grain);
  background-size: 260px;
  opacity: 0.05;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.flow-screen--gift .gift-lid-ribbon {
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--gift-ribbon-w);
  transform: translateX(-50%);
  border-radius: 2px 2px 0 0;
}

/* ── the bow · the trigger ── */

.flow-screen--gift .flow-trigger {
  position: absolute;
  left: 50%;
  top: 0;
  width: clamp(122px, 48%, 158px);
  transform: translate(-50%, -62%);
  z-index: 6;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}

.flow-screen--gift .flow-trigger::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--gold-soft, #cdb98a);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  animation: gift-bow-pulse 2.8s ease-out infinite;
  pointer-events: none;
}

@keyframes gift-bow-pulse {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  35% { opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(1.28); opacity: 0; }
}

.flow-screen--gift .gift-bow {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 9px 14px rgba(0, 0, 0, 0.35));
  transform-origin: 50% 58%;
  transition: transform 0.25s ease;
}

.flow-screen--gift .flow-trigger:hover .gift-bow { transform: scale(1.05); }

.flow-screen--gift .flow-trigger:focus-visible {
  outline: 2px solid var(--gold-bright, #e6cf9a);
  outline-offset: 8px;
}

/* loop draw-back plumbing: pathLength=1 makes the dash math trivial */
.flow-screen--gift .bow-loop {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

/* ── the flash the camera dives into ── */

.flow-screen--gift .gift-flash {
  position: absolute;
  inset: 0;
  z-index: 9;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(140% 140% at 50% 58%, #fff 0%, var(--gold-bright, #e6cf9a) 42%, var(--ivory, #f7f3ea) 100%);
}

/* ── wider stages ── */

@media (min-width: 720px) {
  .flow-screen--gift {
    --gift-lid-h: clamp(50px, 8vh, 64px);
    --gift-body-h: clamp(180px, 26vh, 235px);
  }
  .flow-screen--gift .gift-box { width: clamp(300px, 30vw, 350px); }
}

/* short landscape phones: keep the whole composition on screen */
@media (max-height: 620px) {
  .flow-screen--gift {
    --gift-lid-h: clamp(34px, 6vh, 46px);
    --gift-body-h: clamp(96px, 22vh, 140px);
  }
  .flow-screen--gift .gift-box {
    width: min(52vw, 230px);
    margin: clamp(1.4rem, 4.5vh, 2.2rem) auto 0.7rem;
  }
  .flow-screen--gift .lf-hint { margin-top: 0.6vh; }
}

/* ── reduced motion: a still, dignified gate ── */

@media (prefers-reduced-motion: reduce) {
  .flow-screen--gift .gift-motes span,
  .flow-screen--gift .flow-trigger::before,
  .flow-screen--gift .lf-hint {
    animation: none;
  }
  .flow-screen--gift .gift-motes span { opacity: 0.3; }
  .flow-screen--gift .flow-trigger::before { opacity: 0.5; transform: translate(-50%, -50%) scale(1.05); }
  .flow-screen--gift .gift-bow { transition: none; }
  .flow-screen--gift .flow-trigger:hover .gift-bow { transform: none; }
}


/* ── the inside of the envelope: deep silk in the seal's color ── */
.env-inner {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(130% 95% at 50% 42%, var(--wax-2, #6a35a6) 0%, var(--wax-3, #4a2080) 52%, var(--wax-4, #37155e) 100%);
}
.env-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 55% at 50% 30%, rgba(255, 255, 255, 0.14), transparent 60%);
}

/* ── their song: visible YouTube mini-player chip ── */
#ytMusic {
  position: fixed;
  inset-block-end: 12px;
  inset-inline-start: 12px;
  z-index: 64;
  width: 200px;
  background: rgba(30, 14, 52, 0.85);
  border: 1px solid rgba(246, 239, 224, 0.28);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(20, 8, 40, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
#ytMusic .yt-frame-holder { aspect-ratio: 16 / 9; }
#ytMusic iframe { width: 100%; height: 100%; display: block; }
#ytMusic .yt-label { font-size: 11.5px; color: #f3ecff; padding: 7px 10px 8px; text-align: center; letter-spacing: 0.02em; }
@media (max-width: 640px) { #ytMusic { width: 168px; } }

/* ── text pop pass: bolder presence, deeper shadows, gold weight ── */
html[lang="ar"] .lf-names { font-size: clamp(2.6rem, 9.6vw, 5rem); }
.lf-names { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55), 0 14px 34px rgba(74, 32, 128, 0.24); }
html[lang="ar"] .lf-families { font-size: clamp(1.18rem, 3.3vw, 1.5rem); color: var(--ink); }
.lf-date { font-size: clamp(1.35rem, 4vw, 1.85rem); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.lf-eyebrow { font-weight: 700; }
.lf-guest { font-size: clamp(1.05rem, 3vw, 1.25rem); }
.hero-names { text-shadow: 0 2px 5px rgba(20, 8, 40, 0.45), 0 16px 44px rgba(20, 8, 40, 0.5); }
.tpl-white .hero-names, .tpl-olive .hero-names { text-shadow: none; }

#ytMusic.yt-preparing { opacity: 0; pointer-events: none; }
