:root {
  --cream:   #FAF7F0;
  --cream-d: #F2EBD9;
  --gold:    #F0A500;
  --gold-d:  #C8860A;
  --gold-l:  #FFD166;
  --green:   #8B9B6E;
  --green-d: #5C6E3A;
  --text:    #3D2B00;
  --text-l:  #6B5224;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  font-family: 'Lato', sans-serif;
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ═══════════════════════════════════
   ENVELOPE SCENE
═══════════════════════════════════ */
#envelope-scene {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 70%, rgba(240,165,0,.10) 0%, transparent 55%),
              radial-gradient(ellipse at 75% 25%, rgba(139,155,110,.10) 0%, transparent 55%),
              var(--cream);
}

#skip-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold-d);
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}
#skip-btn:hover { background: var(--gold); color: #fff; }

/* ── Envelope 3D stage ── */
#env-stage {
  perspective: 1400px;
  perspective-origin: 50% 38%;
  position: relative;
  width: min(420px, 92vw);
  overflow: visible;
  filter: drop-shadow(0 32px 64px rgba(0,0,0,.20)) drop-shadow(0 8px 20px rgba(0,0,0,.10));
}

@media (max-width: 480px) {
  #env-stage { width: min(380px, 94vw); }
  #open-text { font-size: clamp(14px, 4vw, 18px); margin-top: 18px; }
}

/* Body wrapper — clips card inside envelope bounds */
#env-svg-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 2px 2px 5px 5px;
}

.env-body-svg {
  position: relative;
  width: 100%;
  display: block;
  z-index: 3;
}

/* Flap — folds backward when opening */
#env-flap-wrap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 67.8%;
  transform-origin: top center;
  transform-style: preserve-3d;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}

.env-flap-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Wax seal */
#wax-seal {
  position: absolute;
  top: 57%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(58px, 14vw);
  height: min(58px, 14vw);
  z-index: 8;
  pointer-events: none;
}

#wax-seal svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 5px rgba(80,50,10,.5));
}

/* Card peek */
#env-card {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 32%;
  bottom: 7%;
  background: #FDFAF5;
  border-radius: 2px;
  z-index: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

#env-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Full-screen card */
#invite-reveal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#invite-reveal img {
  max-width: min(520px, 94vw);
  max-height: 92vh;
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0,0,0,.15);
}

/* Opening text */
#open-text {
  margin-top: 28px;
  font-family: 'Dancing Script', cursive;
  font-size: clamp(16px, 4vw, 20px);
  color: var(--gold-d);
  opacity: 0;
  text-align: center;
}

/* Continue prompt */
#continue-prompt {
  position: fixed;
  bottom: 32px;
  left: 0; right: 0;
  text-align: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
}

#continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 30px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(240,165,0,.45);
  transition: background 0.2s, transform 0.2s;
}
#continue-btn:hover { background: var(--gold-d); transform: translateY(-2px); }

/* ═══════════════════════════════════
   MAIN PAGE
═══════════════════════════════════ */
#main-page {
  opacity: 0;
  transition: opacity 0.9s ease;
}
#main-page.visible { opacity: 1; }

/* ── Mute button ── */
#mute-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(250,247,240,.9);
  backdrop-filter: blur(8px);
  color: var(--gold-d);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: all 0.2s;
}
#mute-btn:hover { background: var(--gold); color: #fff; }

/* ── Language switcher ── */
#lang-switcher {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1001;
  display: flex;
  gap: 4px;
  background: rgba(250,247,240,.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--cream-d);
  border-radius: 24px;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.lang-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: none;
  background: transparent;
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-l);
  cursor: pointer;
  transition: all 0.2s;
}
.lang-btn.active {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(240,165,0,.4);
}

/* ═══════════════════════════════════
   HERO / INVITATION CARD
═══════════════════════════════════ */
.invitation-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px;
}

.invite-card-svg-wrap {
  position: relative;
  z-index: 1;
  width: min(520px, 95vw);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stacked paper layers */
.invite-card-svg-wrap::before,
.invite-card-svg-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  z-index: -1;
}
.invite-card-svg-wrap::before {
  transform: translate(-6px, 8px);
  background: #E8DEBB;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
}
.invite-card-svg-wrap::after {
  transform: translate(5px, 6px);
  background: #EFE4C8;
  box-shadow: 0 6px 22px rgba(0,0,0,.09);
}

.invite-svg-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow:
    0 2px 0 rgba(255,255,255,.8) inset,
    0 4px 6px rgba(0,0,0,.04),
    0 20px 60px rgba(0,0,0,.15),
    0 0 0 1px rgba(240,165,0,.15);
  position: relative;
  z-index: 1;
}

/* Countdown */
.countdown-section {
  padding: 0 20px 48px; text-align: center;
  position: relative; z-index: 1; overflow: visible;
}
.countdown-label {
  font-family: 'Lato', sans-serif; font-size: 10px;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--green); margin-bottom: 16px;
}
.countdown-grid {
  display: flex; justify-content: center;
  gap: 10px; flex-wrap: wrap;
}
.countdown-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.countdown-box {
  min-width: 64px; padding: 10px 8px;
  background: var(--cream);
  border: 1.5px solid var(--gold); border-radius: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 400;
  color: var(--gold-d); line-height: 1;
  box-shadow: 0 2px 12px rgba(240,165,0,.12);
}
.countdown-unit {
  font-family: 'Lato', sans-serif; font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-l);
}

/* RSVP */
.rsvp-section {
  position: relative; z-index: 1;
  padding: 48px 20px; text-align: center;
  background: linear-gradient(to bottom, transparent, rgba(139,155,110,.08), transparent);
  overflow: visible;
}
.section-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(32px, 8vw, 44px); font-weight: 700;
  color: var(--gold-d); margin-bottom: 6px;
}
.section-subtitle {
  font-family: 'Lato', sans-serif; font-size: 12px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--green); margin-bottom: 28px;
}
.rsvp-note-main {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(15px, 3.5vw, 18px);
  font-style: italic; color: var(--text-l);
  margin-bottom: 28px; line-height: 1.6;
  max-width: 340px; margin-left: auto; margin-right: auto;
}
.contact-cards {
  display: flex; flex-direction: column;
  gap: 16px; max-width: 340px; margin: 0 auto;
}
.contact-card {
  background: var(--cream);
  border: 1px solid var(--cream-d); border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.contact-name {
  font-family: 'Dancing Script', cursive;
  font-size: 24px; font-weight: 600;
  color: var(--text); margin-bottom: 4px;
}
.contact-phone {
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  color: var(--text-l);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  cursor: pointer;
}
.contact-phone:active { opacity: 0.6; }
.contact-btns { display: flex; gap: 10px; justify-content: center; }
.app-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 24px;
  text-decoration: none;
  font-family: 'Lato', sans-serif; font-size: 13px;
  font-weight: 700; letter-spacing: 0.04em;
  transition: all 0.2s; border: none; cursor: pointer;
}
.app-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-whatsapp { background: #25D366; color: #fff; box-shadow: 0 4px 14px rgba(37,211,102,.35); }
.btn-whatsapp:hover { background: #1da851; transform: translateY(-1px); }
.btn-viber { background: #7360F2; color: #fff; box-shadow: 0 4px 14px rgba(115,96,242,.35); }
.btn-viber:hover { background: #5a46d6; transform: translateY(-1px); }

/* Dress code */
.dresscode-section {
  position: relative; z-index: 1;
  padding: 48px 20px; text-align: center;
  overflow: visible;
}
.dresscode-card {
  max-width: 340px;
  margin: 0 auto;
  background: var(--cream);
  border: 1px solid var(--cream-d);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.dresscode-icon {
  font-size: 36px;
  margin-bottom: 12px;
}
.dresscode-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(15px, 3.5vw, 17px);
  color: var(--text-l);
  line-height: 1.6;
}
.dresscode-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(240,165,0,.3), transparent);
  margin: 20px 0;
}
.dresscode-pool-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}
.dresscode-pool-icons {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1.4;
  letter-spacing: 2px;
}
.dresscode-pool-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(14px, 3.2vw, 16px);
  color: var(--text-l);
  font-style: italic;
  line-height: 1.6;
}
.dresscode-pool-text em {
  font-style: normal;
  color: var(--gold-d);
  font-weight: 600;
}

/* Map */
.map-section {
  position: relative; z-index: 1;
  padding: 48px 20px 64px; text-align: center;
  overflow: visible;
}
.map-wrapper {
  position: relative; width: 100%; max-width: 600px;
  margin: 0 auto 20px; border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  border: 2px solid rgba(240,165,0,.2);
}
.map-wrapper iframe { display: block; width: 100%; height: 320px; border: 0; }
.directions-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 28px;
  background: var(--gold); color: #fff; text-decoration: none;
  font-family: 'Lato', sans-serif; font-size: 13px;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(240,165,0,.4); transition: all 0.2s;
}
.directions-btn:hover {
  background: var(--gold-d); transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(240,165,0,.5);
}

/* Footer */
footer {
  position: relative; z-index: 1;
  text-align: center; padding: 20px;
  font-family: 'Dancing Script', cursive;
  font-size: 20px; color: var(--gold);
  border-top: 1px solid rgba(240,165,0,.15);
}

/* ── 1. Scroll progress bar ── */
#scroll-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(to right, var(--gold-l), var(--gold), var(--gold-d));
  z-index: 9999;
  transition: width 0.08s linear;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
  display: none;
}
#scroll-bar.active { display: block; }

/* ── 2. Confetti canvas ── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1001;
}

/* ── 3. Copy toast ── */
#copy-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 10px 22px;
  border-radius: 24px;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
#copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 4. Floating petals ── */
#petal-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: opacity 1s ease;
}
#petal-canvas.visible { opacity: 1; }

/* ── 6. Add to calendar button ── */
.cal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 28px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold-d);
  font-family: 'Lato', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.cal-btn:hover {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 4px 18px rgba(240,165,0,.35);
  transform: translateY(-1px);
}
.cal-btn svg { flex-shrink: 0; }
.cal-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* Page corner florals */
.page-corner-flower {
  position: fixed; pointer-events: none; z-index: 0; opacity: 0.22;
  width: 180px; height: 180px;
}
.page-corner-flower.top-left  { top: 0; left: 0; }
.page-corner-flower.top-right { top: 0; right: 0; transform: scaleX(-1); }
.page-corner-flower.bot-left  { bottom: 0; left: 0; transform: scaleY(-1); }
.page-corner-flower.bot-right { bottom: 0; right: 0; transform: scale(-1); }
@media (max-width: 480px) {
  .page-corner-flower { width: 110px; height: 110px; opacity: 0.16; }
}

/* Section flower divider */
.flower-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 32px;
  opacity: 0.6;
}
.flower-divider-line {
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(240,165,0,.4));
}
.flower-divider-line.right {
  background: linear-gradient(to left, transparent, rgba(240,165,0,.4));
}

/* Lang hidden */
[data-lang] { display: none; }
[data-lang].lang-active { display: block; }
.inline-lang[data-lang] { display: none; }
.inline-lang[data-lang].lang-active { display: inline; }


/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
