:root {
  --bg: #fdf4eb;
  --bg-intro: #f9f0e0;
  --gold: #cfab66;
  --gold-deep: #806b43;
  --gold-mid: #7d6332;
  --gold-link: rgb(166, 133, 71);
  --ink: #5c4a2e;
  --serif: 'Cinzel', Georgia, serif;
  --num: 'Ovo', Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hidden { display: none !important; }
.text-center { text-align: center; }

/* ---------- Envelope intro ---------- */
#weiOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-intro);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: opacity 1.4s ease;
}
#weiOverlay.fade-out { opacity: 0; pointer-events: none; }

.envelope {
  width: 320px;
  height: 220px;
  position: relative;
  background: linear-gradient(180deg, #f3e3c8, #e7d2ae);
  border-radius: 8px 8px 20px 20px;
  box-shadow: 0 20px 50px rgba(128, 107, 67, 0.35);
  animation: envFloat 3.5s ease-in-out infinite;
}
.envelope::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  border-bottom: 110px solid #f3e3c8;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
  border-radius: 8px 8px 0 0;
}
.envelope::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  border-top: 110px solid #e7d2ae;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
}
.env-seal {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #d8ba72, var(--gold-deep));
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(128, 107, 67, 0.5);
  border: 2px solid #f7ecd7;
}
@keyframes envFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

#weiTapWrap {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  animation: weiTapIn 1.2s 0.8s both;
}
@keyframes weiTapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
#weiTapLabel {
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(140, 100, 60, 0.75);
  animation: weiPulse 2.4s 1.6s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes weiPulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.wei-chevron {
  width: 10px; height: 10px;
  border-right: 1.5px solid rgba(140,100,60,.6);
  border-top: 1.5px solid rgba(140,100,60,.6);
  transform: rotate(135deg);
  animation: weiChevron 2.4s 1.9s ease-in-out infinite;
}
@keyframes weiChevron { 0%,100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(4px); opacity: 1; } }

/* ---------- Shared ---------- */
main { position: relative; }
section { padding: 70px 20px; text-align: center; position: relative; overflow: hidden; }

/* ambient sparkles */
.sparkles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(216,186,114,.9), transparent 60%),
    radial-gradient(1px 1px at 33% 68%, rgba(216,186,114,.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 55% 12%, rgba(216,186,114,.8), transparent 60%),
    radial-gradient(1px 1px at 70% 45%, rgba(216,186,114,.6), transparent 60%),
    radial-gradient(2px 2px at 85% 78%, rgba(216,186,114,.8), transparent 60%),
    radial-gradient(1px 1px at 92% 30%, rgba(216,186,114,.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 25% 88%, rgba(216,186,114,.7), transparent 60%),
    radial-gradient(1px 1px at 47% 40%, rgba(255,240,196,.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 60%, rgba(216,186,114,.6), transparent 60%),
    radial-gradient(1px 1px at 8% 55%, rgba(255,240,196,.8), transparent 60%);
  animation: sparkle 4s ease-in-out infinite;
  opacity: .6;
}
@keyframes sparkle { 0%,100% { opacity: .35; } 50% { opacity: .75; } }

main > * { position: relative; z-index: 2; }

/* light transition between sections */
section.deco-light::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 55%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #f3e3c8, rgba(216,186,114,.9), #d8ba72, rgba(216,186,114,.9), #f3e3c8, transparent);
  animation: lightPulse 3.5s ease-in-out infinite;
}
@keyframes lightPulse { 0%,100% { opacity: .25; } 50% { opacity: .9; } }

.section-title {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: 52px;
  color: var(--gold-deep);
  margin-bottom: 40px;
  letter-spacing: 0.02em;
  background: linear-gradient(105deg, #B48C3D 0%, #cda95a 46%, #d8ba72 52%, #cda95a 58%, #B48C3D 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 5s ease-in-out infinite;
  text-shadow: none;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.hero-video-wrap { position: relative; margin-bottom: 30px; }
.candle-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(249,237,224,1) 0%, rgba(255,247,5,0) 72%);
  opacity: .7;
  border-radius: 50%;
}
.hero-frame {
  position: relative;
  width: 300px;
  height: 380px;
  border-radius: 50% 50% 8px 8px;
  background: linear-gradient(180deg, #f3e3c8, #e7d2ae);
  box-shadow: 0 24px 60px rgba(128,107,67,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.monogram { font-size: 64px; color: var(--gold-deep); letter-spacing: .04em; }
.monogram small { font-size: 34px; }
.hero-carve { font-size: 20px; color: var(--gold-mid); letter-spacing: .18em; text-transform: uppercase; }

/* rings */
.rings { display: flex; align-items: center; gap: 5px; margin: 26px 0 6px; }
.ring { filter: drop-shadow(0 2px 4px rgba(128,107,67,.4)); animation: ringSpin 12s linear infinite; }
.ring-b { animation-direction: reverse; animation-duration: 14s; }
@keyframes ringSpin { to { transform: rotate(360deg); } }
.links {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), #d8ba72, var(--gold), transparent);
  position: relative;
}
.links::before, .links::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 10px; height: 10px;
  background: #d8ba72;
  border-radius: 50%;
  box-shadow: 0 0 8px #d8ba72;
  animation: linkGlow 2.4s ease-in-out infinite;
}
.links::before { left: 0; }
.links::after { right: 0; animation-delay: 1.2s; }
@keyframes linkGlow { 0%,100% { box-shadow: 0 0 4px #d8ba72; } 50% { box-shadow: 0 0 12px #fff0c4; } }

.hero-title {
  font-family: 'Great Vibes', cursive;
  font-size: 74px;
  font-weight: 400;
  color: var(--gold-deep);
  margin: 4px 0 10px;
  text-shadow: 0 2px 10px rgba(128,107,67,.25), 0 0 24px rgba(216,186,114,.4);
  background: linear-gradient(105deg, #B48C3D 0%, #cda95a 46%, #d8ba72 52%, #cda95a 58%, #B48C3D 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 5s ease-in-out infinite, glowFloat 4s ease-in-out infinite;
}
.hero-title em { font-style: normal; font-size: .6em; vertical-align: middle; }
@keyframes glowFloat { 0%,100% { filter: drop-shadow(0 2px 8px rgba(216,186,114,.25)); } 50% { filter: drop-shadow(0 4px 20px rgba(216,186,114,.6)); } }

.scroll-hint {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--gold-deep);
  font-size: 22px;
  letter-spacing: .04em;
}
.scroll-hint svg { animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* ---------- Date ---------- */
.date-cards {
  display: flex;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
}
.date-cards > div {
  background: #f7ecd7;
  border: 1px solid #e7d2ae;
  border-radius: 12px;
  padding: 26px 30px;
  min-width: 120px;
  box-shadow: 0 10px 30px rgba(128,107,67,.12);
}
.date-cards .num {
  display: block;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-mid);
  margin-bottom: 12px;
}
.date-cards .lab {
  font-family: var(--num);
  font-size: 30px;
  color: var(--gold-deep);
}

/* ---------- Invitation ---------- */
.invite { max-width: 760px; margin: 0 auto; }
.join { font-size: 17px; line-height: 1.8; color: var(--ink); margin-bottom: 40px; }
.invite-card {
  border: 1px solid #e7d2ae;
  border-radius: 14px;
  padding: 60px 30px;
  background: #fbf3e5;
  box-shadow: 0 16px 50px rgba(128,107,67,.15);
}
.smallcaps { font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-mid); margin-bottom: 14px; }
.mini { font-size: 14px; color: var(--gold-mid); margin: 12px 0; letter-spacing: .04em; font-style: italic; }
.big { font-size: 42px; font-weight: 400; color: var(--gold-deep); margin: 8px 0; letter-spacing: .06em; }
.names {
  font-family: 'Great Vibes', cursive;
  font-size: 36px;
  font-weight: 400;
  color: var(--gold-deep);
  margin: 4px 0;
  background: linear-gradient(105deg, #B48C3D 0%, #cda95a 46%, #d8ba72 52%, #cda95a 58%, #B48C3D 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 5s ease-in-out infinite;
}

/* ---------- Quran ---------- */
.quran { padding: 40px 20px; }
.verse { font-size: 24px; color: var(--gold-deep); font-style: italic; margin-bottom: 8px; }
.ref { font-size: 15px; color: var(--gold-mid); letter-spacing: .06em; }

/* ---------- Timeline ---------- */
.timeline { max-width: 620px; margin: 0 auto; }
.tl { position: relative; padding: 10px 0; }
.tl::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(#e7d2ae, var(--gold), #e7d2ae);
  transform: translateX(-50%);
}
.tl-item {
  position: relative;
  width: 50%;
  padding: 20px 30px;
  text-align: left;
}
.tl-item.left { left: 0; text-align: right; }
.tl-item.right { left: 50%; text-align: left; }
.tl-item::before {
  content: '';
  position: absolute;
  top: 30px;
  width: 12px; height: 12px;
  background: var(--gold);
  border: 3px solid #f7ecd7;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--gold);
}
.tl-item.left::before { right: -7px; }
.tl-item.right::before { left: -7px; }
.tl-time { font-size: 34px; color: var(--gold-deep); font-family: var(--num); }
.tl-name { font-size: 19px; color: var(--ink); margin-top: 6px; }

/* ---------- Countdown ---------- */
.countdown { padding: 70px 20px; }
#wcbContainer {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 26px;
  flex-wrap: wrap;
}
.wcb-number {
  font-family: var(--num);
  font-size: 52px;
  line-height: 1.1;
  background: linear-gradient(105deg, #B48C3D 0%, #cda95a 46%, #d8ba72 52%, #cda95a 58%, #B48C3D 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 4.5s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 50% { background-position: 0% 0; } 100% { background-position: 100% 0; } }
.wcb-label { font-family: var(--num); font-size: 19px; color: var(--gold-mid); margin-top: 10px; letter-spacing: .08em; }

/* ---------- Venue ---------- */
.map-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.map-wrap iframe { box-shadow: 0 16px 50px rgba(128,107,67,.2); }
.venue-name { font-size: 20px; color: var(--gold-deep); letter-spacing: .06em; }

/* ---------- Dress code ---------- */
.dresscode { max-width: 640px; margin: 0 auto; }
.dc-title { font-size: 22px; color: var(--gold-mid); font-weight: 700; margin-bottom: 18px; }
.dc-text { font-size: 17px; line-height: 1.7; color: var(--ink); }
.swatches { display: flex; justify-content: center; gap: 16px; margin: 30px 0; }
.sw { width: 54px; height: 54px; border-radius: 50%; border: 3px solid #f7ecd7; box-shadow: 0 6px 18px rgba(128,107,67,.2); }
.s1 { background: #e8d8c8; }
.s2 { background: #c9b7a4; }
.s3 { background: #d9c9b6; }
.s4 { background: #e5d5c2; }
.s5 { background: #f0e4d4; }
.dc-note { font-size: 15px; color: var(--gold-mid); margin: 8px 0; }
.dc-note strong { color: var(--gold-deep); }

/* ---------- Gift ---------- */
.gift-link {
  color: var(--gold-link);
  font-size: 30px;
  text-decoration: none;
  border-bottom: 1px solid var(--gold-link);
  padding-bottom: 2px;
}

/* ---------- RSVP CTA ---------- */
.rsvp-cta { max-width: 640px; margin: 0 auto; }
.rsvp-cta .dc-text { margin-bottom: 34px; }
.btn-rsvp {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .06em;
  padding: 16px 40px;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(207,171,102,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-rsvp:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(207,171,102,.55); }

/* ---------- Footer ---------- */
footer { padding: 70px 20px 60px; text-align: center; }
.foot-big { font-size: 34px; color: var(--gold-deep); margin-bottom: 14px; font-weight: 300; }
.foot-sub { font-size: 15px; color: var(--gold-mid); }
.foot-sub a { color: var(--gold-mid); }

/* ---------- Popup ---------- */
.popup {
  position: fixed;
  inset: 0;
  z-index: 90000;
  background: rgba(60,45,20,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.popup.open { display: flex; }
.popup-box {
  background: var(--bg);
  border-radius: 16px;
  padding: 40px 34px;
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.popup-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none; border: none;
  font-size: 30px;
  color: var(--gold-mid);
  cursor: pointer;
  line-height: 1;
}
.field { display: block; text-align: left; margin: 18px 0; }
.field legend, .field > span, .field { font-size: 14px; color: var(--gold-mid); }
.field input[type="text"] {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid #e7d2ae;
  border-radius: 8px;
  background: #fbf3e5;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
}
.field input[type="text"]:focus { outline: none; border-color: var(--gold); }
.radio { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 16px; color: var(--ink); cursor: pointer; }
.radio input { accent-color: var(--gold); width: 16px; height: 16px; }
.popup-box .btn-rsvp { width: 100%; margin-top: 10px; }

/* ---------- Audio button ---------- */
#audioBtn {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 60px; height: 60px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 95000;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease;
}
#audioBtn.show { opacity: 1; visibility: visible; }
#audioBtn svg { width: 30px; height: 30px; fill: #fff; }
#audioBtn #iconPause { display: none; }
#audioBtn.playing #iconPause { display: block; }
#audioBtn.playing #iconPlay { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .section-title { font-size: 40px; }
  .hero-title { font-size: 58px; }
  .big { font-size: 32px; }
  .names { font-size: 30px; }
  .date-cards { gap: 14px; }
  .date-cards > div { min-width: 96px; padding: 20px 16px; }
  .wcb-number { font-size: 40px; }
  #wcbContainer { gap: 18px; }
  .tl::before { left: 20px; }
  .tl-item { width: 100%; left: 0 !important; text-align: left !important; padding-left: 50px; }
  .tl-item::before { left: 14px !important; right: auto !important; }
}