/* ============================================================
   Abdulrahman & Salma — family edition
   Soft, dreamy, candlelit: muted lavender, dusty rose and champagne,
   fireflies and soft-focus bokeh drifting behind the text.
   Full-page sections with frosted cards; text stays dark and large.
   Made for every age: dark text on a light background, large type,
   big labelled buttons, gentle motion (no flashing or strobing).
   ============================================================ */
:root {
  --bg: #faf6ee;
  --card: #ffffff;
  --ink: #2a2622;          /* body text — ~14:1 on the background */
  --ink-soft: #5a5148;     /* secondary text — still > 7:1 */
  --gold: #a7781a;         /* gold dark enough to read as text */
  --gold-light: #e9cf8e;
  --gold-pale: #f6ecd2;
  --plum: #6b4560;         /* soft plum — ~8:1 on cream */
  --rose-deep: #94505f;    /* dusty rose — ~5.8:1 on cream */
  --line: #e6dcc8;

  --f-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --f-sans: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: #d8bcc0;
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 19px;               /* larger base size for easy reading */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-variant-numeric: lining-nums;   /* full-height numbers in the serif — easier to read */
}
body:not(.revealed) { overflow: hidden; height: 100vh; height: 100dvh; }

/* =====================================================================
   Dreamy twilight — soft lavender → dusty blush → champagne,
   a candle-warm glow that breathes, and a slow drifting haze
   ===================================================================== */
.dream { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #b9a3b8 0%, #cfb0b8 32%, #e2c2bf 60%, #efd9c8 100%); }
.dream__glow {
  position: absolute; left: 50%; top: 55%; width: 120vmax; height: 120vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 228, 180, .55) 0%, rgba(255, 215, 170, .25) 25%, rgba(255, 210, 170, 0) 55%);
  animation: candle 7s ease-in-out infinite;
}
.dream__haze {
  position: absolute; inset: -20%;
  background:
    radial-gradient(ellipse 40% 30% at 20% 30%, rgba(255, 255, 255, .28), transparent 70%),
    radial-gradient(ellipse 35% 28% at 80% 65%, rgba(240, 200, 215, .35), transparent 70%),
    radial-gradient(ellipse 30% 25% at 60% 15%, rgba(210, 190, 230, .3), transparent 70%);
  animation: haze 30s ease-in-out infinite alternate;
}
@keyframes candle { 0%, 100% { opacity: .75; } 35% { opacity: 1; } 55% { opacity: .85; } 75% { opacity: .97; } }
@keyframes haze { from { transform: translate(-3%, -2%) scale(1); } to { transform: translate(3%, 2%) scale(1.06); } }

/* fireflies, bokeh and sparkles: above the background, below the cards */
#nature { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

/* =====================================================================
   Intro: the envelope
   ===================================================================== */
.intro {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 26px;
  padding: 24px 16px;
  text-align: center;
  background: transparent;
  transition: opacity 1.1s ease, visibility 0s linear 1.1s;
}
.intro.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.intro__title { margin: 0; font-family: var(--f-serif); font-size: clamp(2.6rem, 10.5vw, 3.4rem); font-weight: 700; font-style: italic; color: #3a2633; text-shadow: 0 1px 12px rgba(255, 240, 230, .6); }
.intro__note { margin: 0; padding: 8px 18px; border-radius: 999px; background: rgba(255, 250, 242, .92); font-size: 1.05rem; color: var(--ink); }
.intro.is-opening .open-btn, .intro.is-opening .intro__note, .intro.is-opening .intro__title { opacity: 0; transition: opacity .4s; }

.envelope {
  position: relative;
  width: min(86vw, 400px);
  aspect-ratio: 3 / 2;
  padding: 0; border: 0; background: none;
  cursor: pointer;
  perspective: 1200px;
  animation: envFloat 4s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.envelope:focus-visible { outline: 3px solid var(--gold); outline-offset: 12px; border-radius: 10px; }
.envelope.is-open { animation: none; }
@keyframes envFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.env__back {
  position: absolute; inset: 0; z-index: 1;
  border-radius: 10px;
  background: linear-gradient(160deg, #f3e6cc, #e8d6b2);
  box-shadow: 0 24px 50px rgba(90, 70, 30, .22), 0 0 0 1px rgba(167, 120, 26, .35);
}
.env__card {
  position: absolute; left: 6%; right: 6%; top: 6%; height: 88%; z-index: 2;
  display: flex; justify-content: center;
  padding-top: 6%;
  border-radius: 6px;
  background: #fffdf8;
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(90, 70, 30, .15);
  transition: transform 1.2s cubic-bezier(.2, .8, .2, 1) .7s;
}
.envelope.is-open .env__card { transform: translateY(-58%); }
.env__card-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--ink); }
.env__card small { font-size: .72rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.env__card b { font-family: var(--f-serif); font-weight: 700; font-size: clamp(1.55rem, 7vw, 2rem); line-height: 1.1; }
.env__card b i { font-style: italic; color: var(--gold); font-weight: 500; }

.env__pocket { position: absolute; inset: 0; z-index: 3; pointer-events: none; filter: drop-shadow(0 -1px 0 rgba(167, 120, 26, .55)); }
.env__pocket::before {
  content: ""; position: absolute; inset: 0; border-radius: 10px;
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(170deg, #f6ead3, #ead9b7);
}
.env__flap {
  position: absolute; left: 0; right: 0; top: 0; height: 60%; z-index: 4;
  transform-origin: top center;
  filter: drop-shadow(0 1.5px 0 rgba(167, 120, 26, .6)) drop-shadow(0 6px 8px rgba(90, 70, 30, .18));
  transition: transform .9s cubic-bezier(.4, 0, .2, 1) .25s, z-index 0s linear .7s;
}
.env__flap::before {
  content: ""; position: absolute; inset: 0; border-radius: 10px 10px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, #f8eedb, #ecdcbc);
}
.envelope.is-open .env__flap { transform: rotateX(180deg); z-index: 1; }

.env__seal {
  position: absolute; left: 50%; top: 60%; z-index: 5;
  width: 22%; aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d4a7b0, var(--rose-deep) 58%, #6a3443);
  box-shadow: 0 4px 12px rgba(106, 52, 67, .4), inset 0 0 0 3px rgba(246, 227, 190, .6);
  color: #fbefd8;
  font-family: var(--f-serif); font-weight: 700; font-size: clamp(1.15rem, 5.2vw, 1.5rem);
  transform: translate(-50%, -50%);
  transition: transform .55s ease, opacity .55s ease;
}
.env__seal i { font-style: italic; font-weight: 500; margin: 0 .05em; }
.envelope.is-open .env__seal { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }

/* a real, obvious button under the envelope */
.open-btn {
  min-height: 60px;
  padding: 14px 34px;
  border: 0; border-radius: 999px;
  background: var(--plum); color: #fff;
  font: 600 1.2rem/1.2 var(--f-sans);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(42, 38, 34, .2);
  animation: softPulse 3s ease-in-out infinite;
}
.open-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
@keyframes softPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

/* =====================================================================
   Music button — top-right corner, with a text label
   ===================================================================== */
.music {
  position: fixed; z-index: 15;
  right: max(12px, env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 50px;
  padding: 8px 18px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: #fff; color: var(--ink);
  font: 600 1.05rem/1 var(--f-sans);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(42, 38, 34, .18);
}
.music:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.music__icon { font-size: 1.3rem; line-height: 1; }
.music[aria-pressed="true"] .music__icon { animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* =====================================================================
   The invitation — full-page sections (hero, countdown, details, note)
   ===================================================================== */
:root {
  --glass: rgba(255, 251, 247, .78);
  --glass-line: rgba(184, 147, 90, .32);
  --shadow-soft: 0 22px 50px -22px rgba(90, 50, 75, .35);
  --radius: 24px;
}

.invite { position: relative; z-index: 2; }
.invite { opacity: 0; transition: opacity 1.2s ease; }
.revealed .invite { opacity: 1; }

/* ---------- hero: fills the first screen ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 90px 20px 48px;
  text-align: center;
}
.hero__content { max-width: 820px; display: grid; justify-items: center; }
.revealed .hero__content > * { animation: rise 1.4s ease both; }
.revealed .hero__content > *:nth-child(2) { animation-delay: .25s; }
.revealed .hero__content > *:nth-child(3) { animation-delay: .5s; }
.revealed .hero__content > *:nth-child(4) { animation-delay: .7s; }
.revealed .hero__content > *:nth-child(5) { animation-delay: .85s; }
.revealed .hero__content > *:nth-child(6) { animation-delay: 1.1s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.kicker {
  margin: 0 0 14px;
  font-size: clamp(.85rem, 2.6vw, 1rem); font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: #5e3d55;
}
.names { margin: 0; font-family: var(--f-serif); font-weight: 700; line-height: 1; color: #2e1f2a; }
.names__name { display: block; font-size: clamp(3.4rem, 15vw, 7.5rem); text-shadow: 0 2px 24px rgba(255, 240, 230, .55); }
.names .names__amp { display: block; font-style: italic; font-weight: 500; font-size: clamp(2.4rem, 9vw, 4.4rem); color: var(--rose-deep); margin: 4px 0 8px; }
.lead { margin: 22px auto 0; max-width: 22em; font-size: clamp(1.15rem, 3.6vw, 1.45rem); color: #3e2d38; text-wrap: balance; }

.divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px auto 0; color: #9c7a45; }
.divider span { width: clamp(56px, 14vw, 100px); height: 1px; background: linear-gradient(90deg, transparent, rgba(156, 122, 69, .9), transparent); }
.divider i { font-style: normal; font-size: 1.1rem; }
.divider--small span { width: 48px; }

.hero__date {
  margin: 18px 0 0;
  font-family: var(--f-serif); font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 2.4rem); letter-spacing: .04em;
  color: #2e1f2a;
}
.hero__date:empty { display: none; }

.hero__scroll {
  margin-top: 38px;
  width: 30px; height: 48px;
  border: 2px solid #6b4560; border-radius: 16px;
  display: grid; justify-items: center; padding-top: 8px;
  opacity: .85;
}
.hero__scroll span { width: 5px; height: 10px; border-radius: 4px; background: #6b4560; animation: scrollDot 1.8s ease-in-out infinite; }
@keyframes scrollDot { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 9vw, 6.5rem) 20px; }
.section__inner { max-width: 1000px; margin: 0 auto; text-align: center; }
.section__title {
  margin: 0 0 clamp(1.8rem, 5vw, 3rem);
  font-family: var(--f-serif); font-weight: 700; font-style: italic;
  font-size: clamp(2.2rem, 6.5vw, 3.2rem); line-height: 1.1;
  color: #2e1f2a;
}

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1.1s ease, transform 1.1s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- countdown ---------- */
.countdown { display: flex; align-items: flex-start; justify-content: center; gap: clamp(.4rem, 2vw, 1.2rem); max-width: 640px; margin: 0 auto; }
.countdown__unit {
  flex: 1 1 0; min-width: 0; max-width: 130px;
  display: grid; justify-items: center; gap: .3rem;
  padding: clamp(1rem, 3vw, 1.5rem) .3rem;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.countdown__num {
  font-family: var(--f-serif); font-weight: 700;
  font-size: clamp(2.3rem, 9vw, 3.6rem); line-height: 1;
  color: var(--rose-deep);
  font-variant-numeric: lining-nums tabular-nums;
}
.countdown__num.tick { animation: tick .6s ease; }
@keyframes tick { from { transform: translateY(-8px); opacity: .25; } to { transform: none; opacity: 1; } }
.countdown__label { font-size: clamp(.72rem, 2.4vw, .9rem); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.countdown__sep {
  align-self: center; padding-bottom: 1.2rem;
  font-family: var(--f-serif); font-size: clamp(1.6rem, 5vw, 2.6rem); color: #9c7a45;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .2; } }
.countdown__note { margin: 1.6rem 0 0; font-family: var(--f-serif); font-style: italic; font-weight: 600; font-size: 1.6rem; color: var(--rose-deep); }

/* ---------- detail cards ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: 1.5rem; max-width: 480px; margin: 0 auto; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); max-width: 940px; } }
.card {
  position: relative;
  display: grid; justify-items: center; align-content: start; gap: .7rem;
  padding: clamp(2rem, 4.5vw, 2.8rem) 1.6rem;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  text-align: center;
}
.card::before {
  content: ""; position: absolute; inset: 9px;
  border-radius: calc(var(--radius) - 9px);
  border: 1px dashed rgba(184, 147, 90, .35);
  pointer-events: none;
}
.card__icon {
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--rose-deep);
  background: linear-gradient(145deg, #f6dde2, #e6dcf0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}
.card__icon svg { width: 30px; height: 30px; }
.card__title { margin: .2rem 0 0; font-family: var(--f-serif); font-weight: 700; font-style: italic; font-size: 2.1rem; line-height: 1.1; color: var(--plum); }
.card__text { margin: 0; font-size: 1.15rem; line-height: 1.55; color: var(--ink-soft); }
.card__text strong { font-family: var(--f-serif); font-weight: 700; font-size: clamp(1.7rem, 6vw, 2rem); color: var(--ink); line-height: 1.25; }
.card__time { font-weight: 600; font-size: 1.35rem; color: var(--ink); }
.card__actions { position: relative; display: flex; flex-direction: column; gap: .7rem; width: 100%; margin-top: .9rem; }

/* ---------- buttons (large and labelled) ---------- */
.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 12px 22px;
  border-radius: 999px;
  font: 600 1.08rem/1.25 var(--f-sans);
  text-decoration: none; text-align: center;
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease, color .3s ease;
}
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn--primary { color: #fff; border: 0; background: linear-gradient(120deg, #8a5a7c, var(--plum)); box-shadow: 0 12px 24px -12px rgba(107, 69, 96, .8); }
.btn--ghost { color: var(--ink); border: 1.5px solid rgba(156, 122, 69, .6); background: rgba(255, 255, 255, .6); }
.btn--ghost:hover { background: #fff; border-color: #9c7a45; }
.btn--celebrate { width: 100%; max-width: 360px; margin: 1.8rem auto 0; color: var(--rose-deep); border: 1.5px solid var(--rose-deep); background: rgba(255, 255, 255, .6); }
.btn--celebrate:hover { background: var(--rose-deep); color: #fff; }
@media (hover: hover) { .btn:hover { transform: translateY(-2px); } }

/* ---------- message ---------- */
.message {
  position: relative;
  max-width: 700px; margin: 0 auto;
  padding: clamp(2.6rem, 6vw, 3.6rem) clamp(1.4rem, 5vw, 3rem) 2.6rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 251, 247, .9), rgba(246, 221, 226, .7));
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-soft);
}
.message__quote {
  position: absolute; top: -.32em; left: 50%; transform: translateX(-50%);
  font-family: var(--f-serif); font-size: 6rem; line-height: 1; color: #b8935a;
}
.message__text { margin: 0; font-family: var(--f-serif); font-style: italic; font-weight: 600; font-size: clamp(1.45rem, 4.6vw, 1.85rem); line-height: 1.5; color: var(--ink); }
.message__sign { margin: 1.6rem 0 0; font-size: 1.05rem; letter-spacing: .08em; color: var(--ink-soft); }
.message__sign span { display: block; margin-top: .3rem; font-family: var(--f-serif); font-weight: 700; font-style: italic; font-size: 2.2rem; letter-spacing: 0; color: var(--rose-deep); }

/* ---------- footer ---------- */
.footer { padding: 1rem 20px calc(3rem + env(safe-area-inset-bottom)); text-align: center; }
.footer__names { margin: 10px 0 0; font-family: var(--f-serif); font-weight: 700; font-style: italic; font-size: 2.2rem; color: var(--rose-deep); }
.footer__date { margin: .2rem 0 0; font-family: var(--f-serif); font-weight: 600; font-size: 1.15rem; letter-spacing: .25em; color: var(--ink-soft); }
.footer__date:empty { display: none; }
.again {
  margin-top: 1.2rem; min-height: 48px; padding: 10px 18px;
  border: 0; background: none; cursor: pointer;
  font: 500 1rem/1 var(--f-sans); color: var(--ink);
  text-decoration: underline; text-underline-offset: 4px;
}
.again:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.credit { margin: .8rem auto 0; max-width: 34em; font-size: .9rem; color: #4d3a46; }

@media (max-width: 400px) {
  .countdown { gap: .35rem; }
  .countdown__sep { display: none; }
  .countdown__label { letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .invite, .reveal, .revealed .hero__content > * { opacity: 1 !important; transform: none !important; }
}
