/* ===== Sage & Blush Theme Variables (matches qr.bizolduk.com) ===== */
:root {
  --sage: #8ba888;
  --sage-light: #c8dcc4;
  --sage-dark: #52704f;
  --blush: #e8a4b8;
  --blush-light: #f6d3de;
  --blush-pale: #fdeff0;
  --cream: #f7f5ef;
  --white: #ffffff;
  --text-dark: #2d3b2d;
  --text-muted: #6b7d6b;
  --gold: #c2a878;
  --gold-light: #ddc99a;
  --font-script: 'Great Vibes', cursive;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
}

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

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  background: linear-gradient(160deg, #f0f5f0 0%, var(--cream) 40%, var(--blush-pale) 100%);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== Share (QR) Section ===== */
.share-section {
  margin-top: 3rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.share-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.share-text {
  font-size: clamp(0.9rem, 2.4vw, 1.05rem);
  color: var(--text-muted);
  font-style: italic;
  margin: 0.5rem 0 1.5rem;
}

.btn-share {
  display: inline-block;
  background: var(--blush);
  color: var(--white);
  border: 1px solid var(--blush);
  text-decoration: none;
}

.btn-share:hover {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  box-shadow: 0 4px 15px rgba(122, 158, 126, 0.35);
}

/* ===== Envelope Opening Overlay ===== */
.envelope-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: radial-gradient(circle at center, var(--cream) 0%, var(--blush-pale) 65%, #f3e2c9 100%);
  cursor: pointer;
  opacity: 1;
}

.envelope-overlay.js-ready {
  display: flex;
}

.envelope-overlay.opening {
  animation: envelopeFadeOut 0.9s ease forwards 0.7s;
  pointer-events: none;
}

.envelope-overlay.hidden {
  display: none;
}

@keyframes envelopeFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.envelope {
  position: relative;
  width: min(260px, 68vw);
  aspect-ratio: 3 / 2;
  perspective: 600px;
}

.envelope-body {
  position: absolute;
  inset: 0;
  background: var(--white);
  border: 1px solid var(--gold-light);
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(120, 80, 40, 0.18);
}

.envelope-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 48%, rgba(193, 104, 60, 0.12) 50%, transparent 52%),
    linear-gradient(-135deg, transparent 48%, rgba(193, 104, 60, 0.12) 50%, transparent 52%);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58%;
  background: linear-gradient(135deg, var(--blush-light), var(--blush));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.6, -0.28, 0.4, 1.3);
  z-index: 2;
  border-radius: 4px 4px 0 0;
}

.envelope-overlay.opening .envelope-flap {
  transform: rotateX(180deg);
}

.envelope-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-script);
  font-size: 1.4rem;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  z-index: 3;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.envelope-overlay.opening .envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}

.envelope-hint {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  animation: pulseHint 2s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

.envelope-overlay.opening .envelope-hint {
  opacity: 0;
}

@keyframes pulseHint {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

html.envelope-lock,
html.envelope-lock body {
  overflow: hidden;
  height: 100%;
}

/* ===== Music Toggle ===== */
.music-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--sage-light);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  color: var(--sage-dark);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(122, 158, 126, 0.18);
  transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.music-toggle:hover {
  background: var(--sage);
  color: var(--white);
}

/* Off/muted state: note icon gets a clear diagonal "mute" slash */
.music-icon {
  position: relative;
  display: inline-block;
  line-height: 1;
}

.music-toggle:not(.playing) .music-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -4px;
  right: -4px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform: translateY(-50%) rotate(-45deg);
}

/* On/playing state: solid filled button + pulsing note, unmistakably "active" */
.music-toggle.playing {
  background: var(--blush);
  border-color: var(--blush);
  color: var(--white);
  box-shadow: 0 3px 14px rgba(193, 104, 60, 0.4);
}

.music-toggle.playing:hover {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
}

.music-toggle.playing .music-icon {
  animation: notePulse 1.4s ease-in-out infinite;
}

@keyframes notePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* ===== Monogram ===== */
.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 1px solid var(--gold-light);
  color: var(--gold);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.monogram-amp {
  font-family: var(--font-script);
  font-size: 1rem;
  color: var(--blush);
}

/* ===== Map Embed ===== */
.map-embed {
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--sage-light);
  box-shadow: 0 4px 15px rgba(122, 158, 126, 0.12);
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: 200px;
  border: 0;
}

/* ===== RSVP Section ===== */
.rsvp-section {
  margin-top: 3rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.rsvp-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.rsvp-text {
  font-size: clamp(0.9rem, 2.4vw, 1.05rem);
  color: var(--text-muted);
  font-style: italic;
  margin: 0.5rem auto 1.5rem;
  max-width: 480px;
}

.rsvp-form {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.rsvp-row {
  display: flex;
  gap: 0.75rem;
}

.rsvp-input {
  width: 100%;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--white);
  border: 1px solid var(--sage-light);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  resize: vertical;
}

.rsvp-input:focus {
  outline: none;
  border-color: var(--blush);
  box-shadow: 0 0 0 3px rgba(193, 104, 60, 0.12);
}

.rsvp-input-count {
  max-width: 130px;
  flex-shrink: 0;
}

.rsvp-choice {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.rsvp-radio {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.btn-rsvp {
  align-self: center;
  background: var(--blush);
  color: var(--white);
  border-color: var(--blush);
}

.btn-rsvp:hover {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
}

.btn-rsvp:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.rsvp-status {
  font-size: 0.85rem;
  font-style: italic;
  min-height: 1.2em;
  color: var(--sage-dark);
}

.rsvp-status.error {
  color: var(--blush);
}

/* ===== Background Leaves ===== */
.bg-leaves {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.leaf {
  position: absolute;
  width: 180px;
  height: 180px;
  opacity: 0.12;
  background: radial-gradient(ellipse at center, var(--sage) 0%, transparent 70%);
  border-radius: 0 80% 0 80%;
}

.leaf-tl { top: -40px; left: -40px; transform: rotate(45deg); }
.leaf-tr { top: -40px; right: -40px; transform: rotate(135deg); }
.leaf-bl { bottom: -40px; left: -40px; transform: rotate(-45deg); }
.leaf-br { bottom: -40px; right: -40px; transform: rotate(-135deg); }

/* ===== Floating Petals ===== */
.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  border-radius: 50% 0 50% 50%;
  opacity: 0;
  animation: fall linear infinite;
}

@keyframes fall {
  0% {
    transform: translateY(-10vh) rotate(0deg) translateX(0);
    opacity: 0;
  }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% {
    transform: translateY(110vh) rotate(720deg) translateX(40px);
    opacity: 0;
  }
}

/* ===== Main Layout ===== */
main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ===== Invitation Card ===== */
.invitation-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-floral {
  position: relative;
  background: var(--white);
  border-radius: 4px;
  box-shadow:
    0 4px 30px rgba(122, 158, 126, 0.15),
    0 1px 8px rgba(232, 160, 180, 0.1);
  border: 2px solid var(--sage-light);
  overflow: hidden;
}

.card-floral::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed var(--sage-light);
  border-radius: 2px;
  pointer-events: none;
}

.card-inner {
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  position: relative;
}

.top-wreath,
.bottom-wreath {
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

.top-wreath { margin-bottom: 1rem; }
.bottom-wreath { margin-top: 1.5rem; }

.top-wreath svg,
.bottom-wreath svg {
  width: min(220px, 70vw);
  height: auto;
}

/* Staggered reveal of card contents */
.top-wreath,
.monogram,
.couple-names,
.invite-message,
.families,
.events,
.bottom-wreath {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.8s ease forwards;
}

.top-wreath { animation-delay: 0.15s; }
.monogram { animation-delay: 0.32s; }
.couple-names { animation-delay: 0.5s; }
.invite-message { animation-delay: 0.7s; }
.families { animation-delay: 0.9s; }
.events { animation-delay: 1.1s; }
.bottom-wreath { animation-delay: 1.3s; }

/* Couple Names */
.couple-names {
  font-family: var(--font-script);
  font-size: clamp(3rem, 10vw, 5rem);
  color: var(--sage-dark);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ampersand {
  font-family: var(--font-script);
  font-size: 0.5em;
  color: var(--blush);
  font-weight: 400;
}

.invite-message {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  color: var(--blush);
  letter-spacing: 0.04em;
  margin-bottom: 2rem;
  font-weight: 500;
}

/* Families */
.families {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--sage-light);
}

.family {
  font-family: var(--font-serif);
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.6;
  font-weight: 500;
}

.flower-divider {
  width: 6px;
  height: 6px;
  background: var(--blush-light);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Events */
.events {
  display: flex;
  justify-content: center;
}

.event {
  width: 100%;
  max-width: 320px;
}

.event-title {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  color: var(--sage-dark);
  letter-spacing: 0.25em;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* Date Block */
.date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

.date-month,
.date-year {
  font-family: var(--font-serif);
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  color: var(--sage);
  letter-spacing: 0.15em;
  padding: 0.4rem 0;
  position: relative;
  width: 100%;
  font-weight: 500;
}

.date-month::after,
.date-year::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  max-width: 110px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blush-light), transparent);
}

.date-month::after { bottom: 0; }
.date-year::before { top: 0; }

.date-day {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  color: var(--blush);
  font-weight: 400;
  line-height: 1;
  padding: 0.25rem 0;
}

.event-time {
  font-family: var(--font-serif);
  font-size: clamp(0.7rem, 1.8vw, 0.8rem);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  font-weight: 500;
}

.event-venue {
  font-family: var(--font-serif);
  font-size: clamp(0.7rem, 1.8vw, 0.82rem);
  color: var(--sage-dark);
  letter-spacing: 0.05em;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.venue-sub {
  font-weight: 400;
  color: var(--sage);
}

.event-address {
  font-family: var(--font-serif);
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-style: italic;
}

.map-link {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 0.75rem;
  color: var(--sage);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border: 1px solid var(--sage-light);
  border-radius: 20px;
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.map-link:hover {
  background: var(--sage);
  color: var(--white);
  border-color: var(--sage);
}

/* ===== Section Titles ===== */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: var(--sage-dark);
  letter-spacing: 0.12em;
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
}

/* ===== Countdown ===== */
.countdown-section {
  margin-top: 4rem;
  padding: 2.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  border: 1px solid var(--sage-light);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.countdown-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  flex-wrap: wrap;
}

.countdown-item {
  text-align: center;
  min-width: 70px;
  padding: 1rem;
  background: var(--blush-pale);
  border-radius: 12px;
  border: 1px solid var(--blush-light);
}

.countdown-value {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--blush);
  line-height: 1;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.countdown-label {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--sage);
  font-style: italic;
  letter-spacing: 0.08em;
}

/* ===== Calendar Section ===== */
.calendar-section {
  margin-top: 3rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.calendar-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.calendar-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.calendar-hint {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
}

.btn {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  padding: 0.9rem 2rem;
  border: 1px solid var(--sage);
  background: var(--white);
  color: var(--sage-dark);
  border-radius: 30px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
  font-weight: 500;
}

.btn:hover {
  background: var(--sage);
  color: var(--white);
  box-shadow: 0 4px 15px rgba(122, 158, 126, 0.3);
}

.btn:active {
  transform: scale(0.98);
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 3rem 1rem;
  position: relative;
  z-index: 1;
}

.footer-names {
  font-family: var(--font-script);
  font-size: 2.2rem;
  color: var(--sage-dark);
  margin-bottom: 0.25rem;
}

.footer-date {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--blush);
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.footer-note {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--sage);
  font-style: italic;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .card-inner {
    padding: 2.5rem 1.25rem 2rem;
  }

  .families {
    flex-direction: column;
    gap: 0.5rem;
  }

  .rsvp-row {
    flex-direction: column;
  }

  .rsvp-input-count {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  .countdown {
    gap: 0.75rem;
  }

  .countdown-item {
    min-width: 60px;
    padding: 0.75rem;
  }
}
