:root {
  --teal-deep: #0a4f4f;
  --teal: #0e6e6e;
  --teal-light: #16a3a3;
  --gold: #e8c07d;
  --gold-bright: #f5d99b;
  /* jade / mint accent — harmonises with the turquoise + gold palette */
  --pink: #3fb99f;
  --pink-soft: #9ce0d0;
  --cream: #fdf6ec;
  --ink: #1c2b2b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

/* Lock scrolling until the video finishes */
html.locked { overflow: hidden; }
body.locked {
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  touch-action: none;
}

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--cream);
  background: var(--teal-deep);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- Fixed background (captured last frame) ---------- */
#bg-layer {
  position: fixed;
  inset: 0;
  background-color: var(--teal-deep);
  background-size: cover;
  background-position: center;
  z-index: -2;
  transition: opacity 0.5s ease, filter 0.5s ease;
  opacity: 0;
  filter: blur(0px);
}
#bg-layer.show { opacity: 1; filter: blur(8px) saturate(1.1); }

#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(10,79,79,0.25), rgba(10,79,79,0.75) 70%, rgba(6,40,40,0.92) 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
#bg-overlay.show { opacity: 1; }

/* ---------- Stage ---------- */
#stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#invite-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  transition: opacity 0.5s ease;
}
#invite-video.fade-out { opacity: 0; }

/* ---------- CTA ---------- */
#cta-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.7s ease;
  z-index: 3;
}
#cta-wrap.hide { opacity: 0; pointer-events: none; }

#cta-card {
  text-align: center;
  /* invite box back, with very little padding */
  background: linear-gradient(160deg, rgba(10,79,79,0.55), rgba(6,40,40,0.7));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(232,192,125,0.5);
  border-radius: 18px;
  padding: 15px 20px;
  box-shadow: var(--shadow);
  max-width: 360px;
  /* 6.5% right, 27% below center */
  transform: translateX(6.5vw) translateY(27vh) scale(0.6);
  transform-origin: center;
  animation: floatIn 1s ease both;
}

.cta-flourish { color: var(--gold); font-size: 30px; line-height: 1; margin-bottom: 4px; opacity: 0.9; }
.cta-kicker { font-size: 20px; letter-spacing: 1px; color: var(--gold-bright); font-style: italic; margin-bottom: 10px; }

#open-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--teal-deep);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, #c99b4f);
  box-shadow: 0 10px 30px rgba(232,192,125,0.45), inset 0 1px 0 rgba(255,255,255,0.6);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: pulse 2.4s ease-in-out infinite;
}
#open-btn:active { transform: scale(0.96); }
.key-icon { color: var(--teal-deep); display: inline-flex; transform: rotate(-45deg); }
.btn-text { line-height: 1; }
.cta-sub { margin-top: 18px; font-size: 19px; letter-spacing: 3px; text-transform: uppercase; color: var(--cream); }

/* ---------- Reveal (names) ---------- */
#reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#reveal.show { opacity: 1; }

.reveal-top {
  position: absolute;
  top: 5vh;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ganesha-svg {
  display: block;
  width: 50px;
  height: auto;
  margin: 0 auto 4px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4));
}
.ganesh-mantra {
  font-family: 'Tiro Devanagari Hindi', 'Cormorant Garamond', serif;
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--gold-bright);
  margin-bottom: 12px;
  opacity: 0.95;
}
.reveal-kicker { font-size: 20px; font-style: italic; color: var(--gold-bright); letter-spacing: 1px; margin-bottom: 6px; }
.couple {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  line-height: 1.05;
  margin: 8px 0;
  margin-top: 1.2em;
  text-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
.couple .name { display: block; font-size: clamp(56px, 18vw, 110px); color: var(--gold-bright); }
.couple .amp { display: block; font-size: clamp(30px, 9vw, 54px); color: var(--pink-soft); margin: 0; }
.amp-icon { display: block; width: clamp(220px, 72vw, 340px); height: auto; margin: 16px auto; padding: 0 10px; filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4)); }
.reveal-sub { font-size: 22px; letter-spacing: 4px; text-transform: uppercase; color: var(--cream); margin-top: 10px; }

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 0; right: 0;
  text-align: center;
  color: var(--gold-bright);
  font-size: 16px;
  letter-spacing: 2px;
  animation: bob 1.8s ease-in-out infinite;
}
.scroll-cue .chevron { font-size: 26px; line-height: 1; }

/* Scroll-down arrow after the video ends (matches the .scroll-next button) */
.scroll-popup {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 50;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  color: var(--teal-deep);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, #c99b4f);
  box-shadow: 0 8px 22px rgba(232,192,125,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.scroll-popup.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); animation: popBob 1.8s ease-in-out infinite; }

@keyframes popBob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* ---------- Content panels ---------- */
#content { position: relative; z-index: 1; }

.panel {
  position: relative;
  min-height: 96vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 22px;
}
.scroll-next {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  color: var(--teal-deep);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, #c99b4f);
  box-shadow: 0 8px 22px rgba(232,192,125,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popBob 1.8s ease-in-out infinite;
}
.scroll-next:active { transform: translateX(-50%) scale(0.9); }
#scratch-panel .scroll-next { bottom: 60px; }
/* closing page holds two separate boxes stacked */
/* Last page split into 6 vertical parts:
   1 empty · 2 countdown · 1 empty · 1 see-you-there · 1 empty  (rows sum to 6fr) */
.panel.closing {
  display: grid;
  grid-template-rows: 1fr 2fr 1fr 1fr 1fr;
  height: 100svh;
  min-height: 100svh;
  padding: 0 22px;
  align-items: center;
  justify-items: center;
}
.panel.closing .panel-inner { margin: 0; }
.panel.closing .panel-inner:not(.signoff-box) { grid-row: 2; }  /* countdown in parts 1-3 */
.panel.closing .signoff-box { grid-row: 4; }                    /* see you there in parts 4-5 */
/* compact sign-off box — hugs its content instead of full width */
.signoff-box { width: fit-content; max-width: 90%; margin: 0 auto; padding: 10px 26px; }
.closing-title { font-size: clamp(34px, 9vw, 48px) !important; margin-bottom: 2px !important; }
.signoff-box .cta-flourish { font-size: 18px; margin-bottom: 0; }
.signoff-box .panel-note { font-size: 16px; }
.panel-inner {
  width: 100%;
  max-width: 440px;
  text-align: center;
  background: linear-gradient(160deg, rgba(10,79,79,0.62), rgba(6,40,40,0.72));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(232,192,125,0.4);
  border-radius: 26px;
  padding: 40px 28px;
  box-shadow: var(--shadow);
}
.eyebrow { font-size: 15px; letter-spacing: 5px; text-transform: uppercase; color: var(--pink-soft); margin-bottom: 8px; }
.panel-title { font-family: 'Playfair Display', serif; font-weight: 600; font-size: clamp(30px, 8vw, 44px); color: var(--gold-bright); margin-bottom: 10px; }
.panel-title.script { font-family: 'Great Vibes', cursive; font-size: clamp(48px, 14vw, 72px); }
.panel-note { font-size: 20px; color: var(--cream); font-style: italic; opacity: 0.9; }

/* ---------- Scratch card ---------- */
.scratch-holder {
  position: relative;
  width: 300px;
  max-width: 100%;
  height: 180px;
  margin: 26px auto 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0,0,0,0.4);
  border: 2px solid var(--gold);
}
.scratch-prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #103f3f, #0a2e2e);
  color: var(--gold-bright);
  gap: 2px;
}
.prize-day { font-family: 'Playfair Display', serif; font-size: 62px; font-weight: 700; line-height: 1; }
.prize-day sup { font-size: 0.3em; vertical-align: super; margin-left: 2px; }
.prize-month { font-size: 26px; letter-spacing: 4px; text-transform: uppercase; color: var(--pink-soft); }
.prize-year { font-size: 24px; letter-spacing: 6px; color: var(--cream); }
#scratch-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.scratch-hint {
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  text-align: center;
  font-size: 16px;
  color: var(--teal-deep);
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* ---------- Countdown ---------- */
.countdown { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.unit {
  flex: 1;
  background: linear-gradient(160deg, rgba(232,192,125,0.16), rgba(232,192,125,0.05));
  border: 1px solid rgba(232,192,125,0.35);
  border-radius: 16px;
  padding: 16px 4px;
}
.unit .num { display: block; font-family: 'Playfair Display', serif; font-size: clamp(30px, 9vw, 44px); font-weight: 700; color: var(--gold-bright); line-height: 1; }
.unit .lbl { display: block; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--cream); margin-top: 8px; opacity: 0.85; }
.countdown-over { margin-top: 24px; font-size: 26px; color: var(--gold-bright); }

/* ---------- Itinerary ---------- */
.timeline { margin-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.itin-event {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(232,192,125,0.14), rgba(232,192,125,0.04));
  border: 1px solid rgba(232,192,125,0.32);
}
.itin-event:nth-child(even) { flex-direction: row-reverse; }  /* alternate left / right */
.itin-photo { flex: 0 0 44%; }
.itin-photo img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  border: 2px solid var(--gold);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.itin-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.itin-emoji {
  font-size: 24px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(63,185,159,0.14);
  border: 1px solid rgba(156,224,208,0.4);
}
.itin-title { font-family: 'Playfair Display', serif; font-weight: 600; font-size: clamp(24px, 6.5vw, 32px); color: var(--gold-bright); }
.itin-when { font-size: 16px; color: var(--cream); opacity: 0.9; font-style: italic; line-height: 1.4; }
.itin-event { cursor: pointer; transition: transform 0.15s ease; }
.itin-event:active { transform: scale(0.985); }
.itin-more { margin-top: 4px; font-size: 13px; letter-spacing: 0.5px; color: var(--pink-soft); font-style: italic; }

.itin-cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 40px;
  text-decoration: none;
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--teal-deep);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, #c99b4f);
  box-shadow: 0 4px 12px rgba(232,192,125,0.35);
  transition: transform 0.15s ease;
}
.itin-cal-btn img { width: 16px; height: 16px; object-fit: contain; display: block; }
.itin-cal-btn:active { transform: scale(0.95); }

/* ---------- Sticky music toggle ---------- */
.music-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9990;
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(232,192,125,0.75);
  border-radius: 50%;
  cursor: pointer;
  color: var(--gold-bright);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.music-toggle[hidden] { display: none; }
.music-toggle:active { transform: scale(0.9); }
.music-toggle .slash { display: none; }
.music-toggle.muted .wave { display: none; }
.music-toggle.muted .slash { display: block; }

/* ---------- Event detail modal ---------- */
.event-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(120% 100% at 50% 30%, rgba(232,192,125,0.10), rgba(10,79,79,0.4) 55%, rgba(4,22,22,0.72) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.event-modal[hidden] { display: none; }
.em-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  padding: 20px 22px 24px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(10,79,79,0.92), rgba(6,40,40,0.96));
  border: 1px solid rgba(232,192,125,0.5);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  animation: floatInUp 0.5s ease both;
}
@keyframes floatInUp { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.em-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  cursor: pointer; font-size: 22px; line-height: 1; color: var(--teal-deep);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, #c99b4f);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
.em-close:active { transform: scale(0.9); }
.em-photo { width: 62%; max-width: 220px; margin: 6px auto 0; }
.em-photo img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block;
  border-radius: 14px; border: 2px solid var(--gold);
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}
.em-emoji { display: inline-block; font-size: 26px; margin-top: 12px; }
.em-title { font-family: 'Playfair Display', serif; font-weight: 600; font-size: clamp(26px, 7vw, 34px); color: var(--gold-bright); margin-top: 2px; }
.em-when { font-size: 16px; color: var(--cream); font-style: italic; opacity: 0.9; margin-top: 2px; }
.em-dress {
  margin: 14px auto 0; max-width: 300px;
  font-size: 17px; line-height: 1.5; color: var(--cream); font-style: italic;
}
.em-map {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 16px;
  padding: 10px 16px; border-radius: 14px; text-decoration: none; text-align: left;
  background: rgba(232,192,125,0.1); border: 1px solid rgba(232,192,125,0.3);
}
.em-map span > strong { display: block; font-family: 'Playfair Display', serif; font-size: 16px; color: var(--gold-bright); }
.em-map span > em { display: block; font-size: 14px; color: var(--cream); opacity: 0.85; font-style: italic; }
.em-map > span[aria-hidden] { font-size: 22px; }
.em-cal {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  padding: 12px 24px; border-radius: 40px; text-decoration: none;
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif; font-size: 15px; font-weight: 500;
  color: var(--teal-deep);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, #c99b4f);
  box-shadow: 0 8px 20px rgba(232,192,125,0.4);
}
.em-cal img { width: 18px; height: 18px; object-fit: contain; }
.em-cal:active { transform: scale(0.96); }
/* ---------- Wedding teaser video (inline) ---------- */
.wedding-video { margin: 22px auto 6px; width: 100%; }
.wv-frame {
  position: relative;
  height: clamp(260px, 50vh, 440px);
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(160deg, #0e6e6e, #0a3f3f 60%, #06282a);
  border: 3px solid var(--gold);
  box-shadow: 0 16px 44px rgba(0,0,0,0.45),
              0 0 0 1px rgba(255,233,176,0.6) inset,
              0 0 22px rgba(232,192,125,0.4);
  cursor: pointer;
}
.wv-frame video { position: absolute; top: 0; left: 50%; transform: translateX(-50%); height: auto; display: block; z-index: 1; }
.wv-side { position: absolute; top: 0; bottom: 0; z-index: 0; }
.wv-left  { left: 0;  background: linear-gradient(180deg, #cbb1a7, #ccb8b6); }
.wv-right { right: 0; background: linear-gradient(180deg, #ccafa5, #c7aeab); }

/* ---------- Details ---------- */
.detail-card { margin: 24px 0; text-align: left; display: flex; flex-direction: column; gap: 16px; }
.detail-row { display: flex; gap: 14px; align-items: center; }
.d-icon { font-size: 26px; width: 34px; text-align: center; flex-shrink: 0; }
.d-icon img { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; }
.btn-cal-icon { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.detail-link { text-decoration: none; color: inherit; }
.detail-link:active { transform: scale(0.98); }
.detail-row strong { display: block; font-family: 'Playfair Display', serif; font-size: 20px; color: var(--gold-bright); }
.detail-row em { display: block; font-size: 17px; color: var(--cream); opacity: 0.85; font-style: italic; }

#calendar-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 15px 30px;
  border-radius: 60px;
  text-decoration: none;
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: var(--teal-deep);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 60%, #c99b4f);
  box-shadow: 0 10px 26px rgba(232,192,125,0.4);
  transition: transform 0.2s ease;
}
#calendar-btn:active { transform: scale(0.97); }

.closing .panel-inner { border-color: rgba(246,184,208,0.5); }

/* ---------- Animations ---------- */
@keyframes pulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(232,192,125,0.45), inset 0 1px 0 rgba(255,255,255,0.6); }
  50% { box-shadow: 0 10px 44px rgba(245,217,155,0.9), inset 0 1px 0 rgba(255,255,255,0.6); }
}
@keyframes floatIn { from { opacity: 0; transform: translateX(6.5vw) translateY(35vh) scale(0.56); } to { opacity: 1; transform: translateX(6.5vw) translateY(27vh) scale(0.6); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  #open-btn, .scroll-cue { animation: none; }
  html { scroll-behavior: auto; }
}
