/* ===========================================================================
   Jenny & Markus — "Moonlit Mediterranean"
   Deep emerald night · candlelight gold · frosted glass over real video.
   =========================================================================== */

:root {
  /* Palette */
  --midnight:    #0E1A17;
  --emerald:     #14302A;
  --emerald-2:   #0B201B;
  --gold:        #C9A24B;
  --gold-soft:   #E8D39A;
  --gold-deep:   #A07C2E;
  --ivory:       #F6F1E7;
  --ivory-dim:   #cfc7b6;
  --blush:       #E3B7B0;

  /* Glass */
  --glass-bg:     rgba(20, 48, 42, 0.32);
  --glass-bg-2:   rgba(12, 26, 22, 0.55);
  --glass-border: rgba(201, 162, 75, 0.28);
  --glass-blur:   18px;

  /* Type */
  --f-display: "Fraunces", "Times New Roman", serif;
  --f-script:  "Tangerine", "Brush Script MT", cursive;
  --f-ui:      "Jost", "Century Gothic", system-ui, sans-serif;

  /* Rhythm */
  --maxw: 1140px;
  --r-lg: 26px;
  --r-md: 16px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-ui);
  color: var(--ivory);
  background: var(--midnight);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; border-radius: 4px; }

/* Lock scroll while the envelope is on screen */
body.is-sealed { overflow: hidden; height: 100vh; }

/* --- Atmospheric backdrop -------------------------------------------------- */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(70% 55% at 50% -10%, rgba(201,162,75,0.16), transparent 60%),
    radial-gradient(80% 60% at 100% 110%, rgba(20,48,42,0.9), transparent 60%),
    radial-gradient(60% 60% at 0% 100%, rgba(227,183,176,0.10), transparent 55%),
    linear-gradient(160deg, var(--emerald-2), var(--midnight) 55%, #08120f);
}

/* Shared canvas for ambient particles */
#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* --- Typography helpers ---------------------------------------------------- */
.eyebrow {
  font-family: var(--f-ui);
  text-transform: uppercase;
  letter-spacing: 0.42em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold-soft);
  margin: 0 0 1.2rem;
  padding-left: 0.42em; /* compensate tracking */
}
.script {
  font-family: var(--f-script);
  font-weight: 700;
  line-height: 0.9;
  color: var(--ivory);
}
.section-title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.3rem);
  letter-spacing: 0.01em;
  margin: 0 0 1rem;
}

/* Hairline botanical divider (cedar sprig sits in the middle) */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.6rem auto;
  color: var(--gold);
}
.divider::before, .divider::after {
  content: "";
  height: 1px;
  width: min(120px, 22vw);
  background: linear-gradient(90deg, transparent, var(--gold));
}
.divider::after { background: linear-gradient(90deg, var(--gold), transparent); }
.divider .sprig { width: 30px; height: 30px; opacity: 0.9; }

/* ===========================================================================
   1. ENVELOPE — the signature opening
   =========================================================================== */
.envelope-scene {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(20,48,42,0.6), transparent 70%),
    linear-gradient(160deg, #0b201b, #08120f);
  perspective: 1400px;
  transition: opacity 1s var(--ease);
}
.envelope-scene.is-open { pointer-events: none; }
.envelope-scene.is-gone { opacity: 0; visibility: hidden; }

/* Cover welcome message — tells guests whose wedding this is and that it's an
   RSVP. Sits at the top of the cover, above the envelope. */
.env-welcome {
  position: absolute;
  top: clamp(3.4rem, 9vh, 5rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(540px, 88vw);
  text-align: center;
  z-index: 2;
}
.env-welcome-eyebrow {
  font-family: var(--f-ui);
  text-transform: uppercase;
  letter-spacing: 0.36em;
  font-size: 0.64rem;
  color: var(--gold-soft);
  margin: 0 0 0.6rem;
  padding-left: 0.36em;
}
.env-welcome-text {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(1.1rem, 3vw, 1.45rem);
  line-height: 1.7;
  color: var(--ivory);
  opacity: 0.95;
  margin: 0;
}
/* Arabic: use the readable UI face (El Messiri), not the calligraphic display
   font — calligraphy is hard to read in a running paragraph. */
html[lang="ar"] .env-welcome-text {
  font-family: var(--f-ui);
  font-style: normal;
  font-weight: 500;
  line-height: 2;
  opacity: 1;
}

.envelope {
  position: relative;
  /* Cap by viewport height too, so the tall letter that rises out of the
     envelope always has headroom above it (prevents off-screen overflow on
     short / landscape screens). */
  width: min(440px, 88vw, 48vh);
  aspect-ratio: 3 / 2;
  transform-style: preserve-3d;
  cursor: pointer;
  filter: drop-shadow(0 40px 50px rgba(0,0,0,0.55));
}

/* The letter that rises out of the envelope */
.letter {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 8%;
  height: 132%;
  background: linear-gradient(180deg, #fbf7ee, #efe7d4);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(160,124,46,0.25), 0 10px 30px rgba(0,0,0,0.3);
  transform: translateY(0) scale(0.98);
  transform-origin: bottom center;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #2c2419;
  padding: 1.6rem;
  opacity: 0;
}
.letter .letter-eyebrow {
  font-family: var(--f-ui);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.6rem;
  color: var(--gold-deep);
  margin-bottom: 0.7rem;
}
.letter .letter-names {
  font-family: var(--f-script);
  font-size: clamp(3rem, 9vw, 4.6rem);
  line-height: 0.85;
  color: #1f3b32;
}
.letter .letter-date {
  font-family: var(--f-display);
  letter-spacing: 0.2em;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--gold-deep);
}

/* Envelope body + flaps (built from layered divs) */
.env-back, .env-front, .env-flap {
  position: absolute;
  inset: 0;
}
.env-back {
  background: linear-gradient(145deg, #1c4036, #122a24);
  border-radius: 10px;
}
.env-front {
  z-index: 3;
  border-radius: 10px;
  background: linear-gradient(145deg, #1f463b, #15322b);
  clip-path: polygon(0 0, 50% 46%, 100% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(201,162,75,0.22);
}
.env-flap {
  z-index: 4;
  transform-origin: top center;
  transform: rotateX(0deg);
  background: linear-gradient(145deg, #245044, #18382f);
  clip-path: polygon(0 0, 100% 0, 50% 64%);
  box-shadow: inset 0 1px 0 rgba(201,162,75,0.25);
  backface-visibility: hidden;
}
.env-flap.is-open { z-index: 1; }

/* Wax seal with cedar sprig monogram */
.wax-seal {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  z-index: 6;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #d9b15d, var(--gold) 45%, var(--gold-deep) 100%);
  box-shadow: 0 6px 16px rgba(0,0,0,0.45), inset 0 0 0 2px rgba(255,255,255,0.18),
              inset 0 -6px 10px rgba(0,0,0,0.25);
  color: #3a2c12;
  text-align: center;
}
.wax-seal .seal-mono {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.wax-seal svg { width: 22px; height: 22px; margin: 0 auto 1px; opacity: 0.85; }

.env-prompt {
  position: absolute;
  bottom: -4.4rem;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--f-ui);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.72rem;
  color: var(--gold-soft);
}
.env-prompt span { display: inline-block; animation: breathe 2.6s var(--ease) infinite; }
@keyframes breathe { 0%,100%{ opacity:0.55; transform:translateY(0);} 50%{ opacity:1; transform:translateY(-3px);} }

/* Floating music toggle */
.music-toggle {
  position: fixed;
  bottom: 1.4rem;
  left: 1.4rem;
  z-index: 80;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold-soft);
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  box-shadow: 0 10px 26px -12px rgba(0,0,0,0.7);
  transition: transform 0.2s var(--ease), color 0.2s, border-color 0.2s;
}
.music-toggle:hover { transform: translateY(-2px); border-color: var(--gold); }
.music-toggle svg { width: 22px; height: 22px; }
/* Show the "on" icon by default; swap to "off" when muted. */
.music-toggle .ic-off { display: none; }
.music-toggle.is-muted { color: var(--ivory-dim); }
.music-toggle.is-muted .ic-on { display: none; }
.music-toggle.is-muted .ic-off { display: block; }
/* Gentle pulse before the first interaction, hinting it's interactive. */
.music-toggle:not(.is-muted)::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(201,162,75,0.4);
  animation: ring 2.8s var(--ease) infinite;
}
@keyframes ring { 0%{ transform: scale(0.9); opacity: 0.8; } 100%{ transform: scale(1.3); opacity: 0; } }

/* ===========================================================================
   2. HERO
   =========================================================================== */
.site { opacity: 0; transition: opacity 0.8s ease; }
.site.is-revealed { opacity: 1; }

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  padding: 6rem 1.2rem 4rem;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: saturate(1.05) brightness(0.85);
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(80% 70% at 50% 40%, rgba(8,18,15,0.35), rgba(8,18,15,0.78) 100%),
    linear-gradient(180deg, rgba(11,32,27,0.55), rgba(8,18,15,0.2) 40%, rgba(8,18,15,0.9));
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-names {
  font-family: var(--f-script);
  font-size: clamp(4.2rem, 16vw, 9.5rem);
  line-height: 0.78;
  margin: 0.4rem 0 0.2rem;
  text-shadow: 0 14px 50px rgba(0,0,0,0.55);
  background: linear-gradient(180deg, #fffaf0 0%, var(--gold-soft) 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* The connector uses Fraunces (a real "&" glyph) with an Arabic fallback.
   The hero names use -webkit-background-clip:text (transparent fill) for the gold
   gradient; a child span inherits that transparent fill and would be invisible,
   so we give the "&" its own solid gold fill to force it to paint. */
.hero-amp {
  font-family: "Fraunces", "Aref Ruqaa", serif;
  font-style: italic;
  font-size: 0.62em;
  vertical-align: 0.1em;
  margin: 0 0.14em;
  color: var(--gold-soft);
  -webkit-text-fill-color: var(--gold-soft); /* override parent's transparent fill */
}
.hero-tag {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  color: var(--ivory);
  opacity: 0.92;
  margin: 0.4rem 0 1.6rem;
}
.hero-date {
  font-family: var(--f-ui);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--gold-soft);
  padding-left: 0.4em;
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
.scroll-cue .line { width: 1px; height: 42px; background: linear-gradient(var(--gold), transparent); animation: drip 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0%{ transform: scaleY(0); opacity:0;} 40%{ transform: scaleY(1); opacity:1;} 100%{ transform: scaleY(1) translateY(10px); opacity:0;} }

/* ===========================================================================
   3. COUNTDOWN
   =========================================================================== */
.countdown {
  display: flex;
  gap: clamp(0.5rem, 2.4vw, 1.4rem);
  justify-content: center;
  margin-top: 2.4rem;
  flex-wrap: wrap;
}
.count-cell {
  min-width: clamp(66px, 18vw, 104px);
  padding: 1.1rem 0.6rem 0.9rem;
  border-radius: var(--r-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  box-shadow: var(--shadow);
}
.count-num {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 6vw, 2.8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ivory);
}
.count-label {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.countdown.is-done {
  font-family: var(--f-display);
  font-style: italic;
}

/* ===========================================================================
   4. CONTENT SECTIONS
   =========================================================================== */
.section {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(4rem, 11vw, 8rem) 1.4rem;
  text-align: center;
}
.section .lead {
  max-width: 620px;
  margin: 0 auto;
  font-family: var(--f-display);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  line-height: 1.8;
  color: var(--ivory-dim);
  font-style: italic;
}

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

/* Detail cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
  margin-top: 2.6rem;
  justify-content: center;
}
/* Keep cards from stretching too wide (e.g. when there's only one). */
.cards .glass-card { justify-self: center; width: 100%; max-width: 460px; }
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  box-shadow: var(--shadow);
  padding: 2.6rem 1.8rem;
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(232,211,154,0.10), transparent 40%);
  pointer-events: none;
}
.glass-card .card-icon { width: 44px; height: 44px; margin: 0 auto 1.2rem; color: var(--gold); }
.glass-card .card-title { font-family: var(--f-display); font-size: 1.5rem; margin: 0 0 0.2rem; }
.glass-card .card-time { font-family: var(--f-script); font-size: 2rem; color: var(--gold-soft); line-height: 1; margin: 0.3rem 0 0.8rem; }
.glass-card .card-venue { font-weight: 500; letter-spacing: 0.04em; }
.glass-card .card-addr { color: var(--ivory-dim); font-size: 0.92rem; margin-top: 0.2rem; }
.glass-card .card-map {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.3rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--gold-soft);
  font-family: var(--f-ui);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.glass-card .card-map:hover { background: rgba(201,162,75,0.1); border-color: var(--gold); transform: translateY(-1px); }
.glass-card .card-map svg { width: 15px; height: 15px; }

/* ===========================================================================
   5. RSVP
   =========================================================================== */
.rsvp-wrap {
  max-width: 600px;
  margin: 2.6rem auto 0;
  text-align: left;
}
.rsvp-form {
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  box-shadow: var(--shadow);
  padding: clamp(1.8rem, 5vw, 2.8rem);
}
.field { margin-bottom: 1.3rem; }
.field label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 0.55rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(8,18,15,0.5);
  border: 1px solid rgba(201,162,75,0.22);
  border-radius: 12px;
  color: var(--ivory);
  font-family: var(--f-ui);
  font-size: 1rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input::placeholder, .field textarea::placeholder { color: rgba(207,199,182,0.45); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,75,0.18);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Attendance toggle */
.attend-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.attend-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.attend-toggle label {
  display: block;
  text-align: center;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(201,162,75,0.25);
  background: rgba(8,18,15,0.4);
  letter-spacing: 0.12em;
  text-transform: none;
  font-size: 0.9rem;
  color: var(--ivory-dim);
  margin: 0;
  transition: all 0.25s var(--ease);
}
.attend-toggle input:checked + label {
  color: var(--midnight);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border-color: var(--gold-soft);
  box-shadow: 0 8px 22px -8px rgba(201,162,75,0.6);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 1.4rem;
  border: none;
  border-radius: 14px;
  font-family: var(--f-ui);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--midnight);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  box-shadow: 0 14px 30px -12px rgba(201,162,75,0.7);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 20px 38px -12px rgba(201,162,75,0.8); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid var(--glass-border);
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(201,162,75,0.08); box-shadow: none; }

/* Form feedback */
.form-note { margin-top: 1rem; font-size: 0.85rem; min-height: 1.2em; text-align: center; }
.form-note.error { color: var(--blush); }
.form-note.success { color: var(--gold-soft); }

/* Success state */
.rsvp-success {
  text-align: center;
  padding: 2.4rem 1rem;
}
.rsvp-success .tick {
  width: 64px; height: 64px; margin: 0 auto 1.2rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--midnight);
}
.rsvp-success h3 { font-family: var(--f-display); font-size: 1.7rem; margin: 0 0 0.5rem; }
.rsvp-success p { color: var(--ivory-dim); }
.hidden { display: none !important; }

/* ===========================================================================
   6. FOOTER
   =========================================================================== */
.footer {
  text-align: center;
  padding: 4rem 1.4rem 3rem;
  border-top: 1px solid rgba(201,162,75,0.16);
  margin-top: 2rem;
}
.footer .foot-script { font-family: var(--f-script); font-size: 3.4rem; line-height: 0.9; color: var(--gold-soft); }
.footer .foot-amp { font-family: "Fraunces", "Aref Ruqaa", serif; font-style: italic; font-size: 0.7em; }
.footer .foot-date { letter-spacing: 0.34em; text-transform: uppercase; font-size: 0.72rem; color: var(--ivory-dim); margin-top: 0.6rem; }
.footer .foot-hash { margin-top: 1.2rem; font-size: 0.78rem; letter-spacing: 0.12em; color: var(--gold); }
.footer .foot-admin { margin-top: 2rem; font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(207,199,182,0.4); }
.footer .foot-admin a:hover { color: var(--gold-soft); }

/* ===========================================================================
   Responsive & motion
   =========================================================================== */
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .env-prompt { bottom: -3.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===========================================================================
   7. LANGUAGE SWITCH (EN / AR) + RTL
   =========================================================================== */
/* Sits above the envelope scene (z 90) so guests can switch before opening. */
.lang-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-family: var(--f-ui);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  box-shadow: 0 10px 26px -12px rgba(0,0,0,0.7);
  transition: transform 0.2s var(--ease), border-color 0.2s, color 0.2s;
}
.lang-toggle:hover { transform: translateY(-2px); border-color: var(--gold); }
.lang-toggle svg { width: 16px; height: 16px; opacity: 0.85; }
/* Mirror the fixed corner in RTL so it doesn't crowd the same side as content. */
html[dir="rtl"] .lang-toggle { right: auto; left: 1.2rem; }

/* ---- Arabic typography: swap the three font roles in one place ---------- */
html[lang="ar"] {
  --f-display: "Aref Ruqaa", "Amiri", serif;
  --f-script:  "Aref Ruqaa", "Amiri", serif;
  --f-ui:      "El Messiri", system-ui, sans-serif;
}
/* Arabic script is cursive — letter-spacing breaks the joins, so remove it. */
html[lang="ar"] * { letter-spacing: normal !important; }
/* Aref Ruqaa carries tall diacritics; give the big display type more headroom. */
html[lang="ar"] .hero-names { line-height: 1.18; }
html[lang="ar"] .letter-names { line-height: 1.18; }
html[lang="ar"] .foot-script { line-height: 1.35; }
html[lang="ar"] .section-title { line-height: 1.35; }
html[lang="ar"] .glass-card .card-time { line-height: 1.35; }
html[lang="ar"] .hero-tag { font-style: normal; }

/* ---- RTL layout nudges -------------------------------------------------- */
html[dir="rtl"] .rsvp-wrap { text-align: right; }
html[dir="rtl"] .rsvp-success { text-align: center; }
/* Inputs that hold Latin data (phone, numbers) read better LTR even in RTL. */
html[dir="rtl"] #g-phone,
html[dir="rtl"] #g-count { direction: ltr; text-align: right; }
/* The venue is a Latin proper name kept in English — render it left-to-right
   even inside the RTL Arabic card so the words and dash read correctly. */
html[dir="rtl"] .glass-card .card-venue { direction: ltr; }
