/* ==========================================================
   Design tokens
   ========================================================== */
:root {
  --emerald: #043927;
  --emerald-light: #0c5c3f;
  --maroon: #5a0e1d;
  --maroon-light: #7d1a2c;
  --maroon-deep: #3d0812;
  --gold: #d4af37;
  --gold-light: #f0d775;
  --crimson: #7c1f34;
  --marigold: #e8960c;
  --marigold-light: #ffcf5c;
  --royal-blue: #16294f;
  --royal-blue-light: #2c4a80;
  --silver: #c9d0da;
  --ivory: #fbf4e6;
  --ink: #201a14;

  --font-display: 'Playfair Display', serif;
  --font-script: 'Great Vibes', cursive;
  --font-body: 'Poppins', sans-serif;
  --font-arabic: 'Noto Naskh Arabic', serif;

  --ease: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ==========================================================
   Splash / Jali Gate
   ========================================================== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 32%, var(--maroon-light), var(--maroon-deep) 78%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.85s ease;
}

.splash-frame {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(212,175,55,0.5);
  pointer-events: none;
}
.splash-frame::before,
.splash-frame::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid var(--gold);
}
.splash-frame::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.splash-frame::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.splash.opening { opacity: 0; }
.splash.hidden { visibility: hidden; pointer-events: none; }

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.splash-eyebrow {
  color: var(--gold-light);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin: 0 0 12px;
}
.splash-names {
  font-family: var(--font-script);
  color: var(--gold);
  font-size: clamp(3rem, 14vw, 5.5rem);
  margin: 0 0 40px;
  text-shadow: 0 0 30px rgba(212,175,55,0.35);
}
.splash-names .amp { color: var(--ivory); padding: 0 8px; }

.heart-btn {
  position: relative;
  background: transparent;
  border: none;
  padding: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.heart-ring {
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 50%;
  animation: pulseRing 2.4s ease-out infinite;
}
.heart-svg {
  width: 74px;
  height: 68px;
  fill: var(--gold);
  filter: drop-shadow(0 0 18px rgba(212,175,55,0.5));
  transition: transform 0.25s ease;
  position: relative;
  z-index: 2;
}
.heart-btn:hover .heart-svg { transform: scale(1.08); }

.heart-burst {
  position: absolute;
  inset: -50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,215,117,0.65), rgba(212,175,55,0.15) 55%, transparent 75%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}
.heart-btn.is-popped .heart-burst {
  animation: burstOut 0.75s ease-out forwards;
}
.heart-btn.is-popped .heart-svg {
  animation: heartPop 0.75s var(--ease) forwards;
}
@keyframes heartPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.4); }
  55%  { transform: scale(0.9); }
  75%  { transform: scale(1.15); }
  100% { transform: scale(1.05); opacity: 0; }
}
@keyframes burstOut {
  0%   { transform: scale(0.25); opacity: 0.95; }
  100% { transform: scale(2.4); opacity: 0; }
}

.heart-caption {
  display: block;
  margin-top: 4px;
  color: var(--gold-light);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@keyframes pulseRing {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Rose petals */
.petal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -5%;
  width: 14px;
  height: 10px;
  background: radial-gradient(circle at 30% 30%, var(--crimson), #4a0f1c 90%);
  border-radius: 60% 0 60% 0;
  opacity: 0.9;
  animation-name: fallPetal;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform;
}
@keyframes fallPetal {
  0%   { transform: translate3d(0,0,0) rotate(0deg); }
  100% { transform: translate3d(var(--drift), 115vh, 0) rotate(var(--spin)); opacity: 0.15; }
}

/* ==========================================================
   Main invite
   ========================================================== */
.main-invite { max-width: 720px; margin: 0 auto; padding: 0 0 60px; }

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* Bismillah banner */
.bismillah-banner {
  text-align: center;
  padding: 90px 24px 60px;
  background:
    radial-gradient(circle at 50% 0%, rgba(212,175,55,0.12), transparent 60%),
    var(--ivory);
}
.bismillah-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: var(--emerald);
  margin: 0 0 10px;
}
.bismillah-translit {
  font-style: italic;
  color: #6b5f4e;
  font-size: 0.9rem;
  margin: 0;
}
.banner-rule {
  width: 60px; height: 2px;
  background: var(--gold);
  margin: 28px auto;
}
.banner-note {
  color: #4a4136;
  font-size: 0.95rem;
  max-width: 420px;
  margin: 0 auto 10px;
}
.banner-names {
  font-family: var(--font-script);
  font-size: clamp(2.4rem, 9vw, 3.6rem);
  color: var(--crimson);
  margin: 0 0 34px;
}
.blessing-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  color: var(--maroon);
  line-height: 2;
  max-width: 480px;
  margin: 0 auto 12px;
}
.blessing-meaning {
  font-style: italic;
  color: #6b5f4e;
  font-size: 0.82rem;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Events section */
.events-section { padding: 40px 20px 20px; text-align: center; }
.section-eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--gold);
  margin: 0 0 8px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6vw, 2.3rem);
  color: var(--maroon);
  margin: 0 0 30px;
}

.event-card.single-card {
  margin: 0 auto;
  scroll-snap-align: none;
  flex: none;
}

.dua-box {
  max-width: 420px;
  margin: 34px auto 0;
  padding: 30px 26px;
  border: 1px solid rgba(90,14,29,0.25);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf1 0%, var(--ivory) 100%);
  box-shadow: 0 10px 30px rgba(90,14,29,0.08);
  position: relative;
}
.dua-box::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212,175,55,0.5);
  border-radius: 10px;
  pointer-events: none;
}
.dua-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.15rem, 4vw, 1.4rem);
  color: var(--maroon);
  line-height: 2;
  margin: 0 0 14px;
}
.dua-translit {
  font-style: italic;
  color: #6b5f4e;
  font-size: 0.85rem;
  margin: 0;
}
.dua-rule {
  width: 44px; height: 1px;
  background: var(--gold);
  margin: 18px auto;
}
.dua-meaning {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--maroon);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

.event-card {
  scroll-snap-align: center;
  flex: 0 0 88%;
  max-width: 360px;
  perspective: 1400px;
  min-height: 420px;
}
@media (min-width: 480px) { .event-card { flex-basis: 340px; } }

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 420px;
  transition: transform 0.7s var(--ease);
  transform-style: preserve-3d;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}
.event-card.is-flipped .card-flip-inner { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 34px 26px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  color: var(--ivory);
}
.card-back {
  transform: rotateY(180deg);
  padding: 16px;
  justify-content: flex-start;
}

.theme-walimah .card-face { background: linear-gradient(160deg, var(--maroon-light) 0%, var(--maroon-deep) 100%); }

.card-eyebrow { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.75; margin: 0 0 6px; }
.card-title { font-family: var(--font-display); font-size: 1.9rem; margin: 0 0 14px; }
.card-date, .card-venue { font-size: 0.88rem; margin: 0 0 4px; opacity: 0.92; }
.card-desc { font-size: 0.85rem; line-height: 1.5; margin: 14px 0 0; opacity: 0.9; }

.card-flip-btn {
  margin-top: auto;
  align-self: flex-start;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.4);
  color: inherit;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  transition: background 0.25s ease;
}
.card-flip-btn:hover { background: rgba(255,255,255,0.28); }

.card-flip-back { margin-bottom: 10px; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.4); border-radius: 999px; padding: 8px 16px; color: inherit; align-self: flex-start; }

.map-embed-wrap { flex: 1; width: 100%; border-radius: 12px; overflow: hidden; }
.map-embed-wrap iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }

/* Countdown (Nikaah only) */
.countdown { display: flex; gap: 10px; margin-top: 16px; }
.countdown-unit {
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 52px;
  text-align: center;
}
.cd-num { display: block; font-family: var(--font-display); font-size: 1.3rem; }
.cd-label { display: block; font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.countdown-caption { font-size: 0.72rem; opacity: 0.75; margin: 8px 0 0; }

/* Footer */
.invite-footer { text-align: center; padding: 70px 24px 40px; }
.footer-note { font-family: var(--font-display); font-style: italic; color: var(--emerald); line-height: 1.7; margin: 0 0 30px; }

.rsvp-fab {
  background: var(--crimson);
  color: var(--ivory);
  border: none;
  padding: 15px 36px;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(124,31,52,0.35);
  transition: transform 0.2s ease;
}
.rsvp-fab:hover { transform: translateY(-2px); }

/* ==========================================================
   RSVP Modal
   ========================================================== */
.rsvp-modal { position: fixed; inset: 0; z-index: 200; display: none; }
.rsvp-modal.open { display: block; }
.rsvp-backdrop { position: absolute; inset: 0; background: rgba(4,57,39,0.55); backdrop-filter: blur(3px); }
.rsvp-panel {
  position: relative;
  max-width: 400px;
  margin: 8vh auto 0;
  background: var(--ivory);
  border-radius: 18px;
  padding: 34px 26px 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
  animation: rsvpIn 0.35s var(--ease);
}
@keyframes rsvpIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.rsvp-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 1.4rem; color: var(--emerald);
}
.rsvp-title { font-family: var(--font-display); color: var(--emerald); text-align: center; margin: 0 0 20px; }
.rsvp-form { display: flex; flex-direction: column; gap: 14px; }
.rsvp-label { font-size: 0.8rem; color: #4a4136; display: flex; flex-direction: column; gap: 6px; }
.rsvp-label input, .rsvp-label select {
  font-family: inherit;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #d9cdb4;
  font-size: 0.9rem;
  background: #fff;
}
.rsvp-submit {
  margin-top: 6px;
  background: var(--emerald);
  color: var(--ivory);
  border: none;
  padding: 13px;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.rsvp-submit:hover { background: var(--emerald-light); }
.rsvp-status { text-align: center; font-size: 0.82rem; min-height: 1.2em; margin: 4px 0 0; color: var(--emerald); }
