/* ═════════════════════════════════════════════════════════════════════
   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; }
}


/* ── 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; }
