/* ===================================================================
   BABY SHOWER INVITATION — MAIN STYLESHEET
   Sections: Base / Typography / Header / Hero / Event / Countdown /
             Gallery / Prediction / Reveal / RSVP / Share / Footer
   =================================================================== */

/* ---------- Base / Design tokens ---------- */
:root {
  /* Palette — cream, blush, sage, gold. Overridden per-event via JS. */
  --primary-color: #c98a9c;      /* blush/rose */
  --secondary-color: #a9c1a1;    /* sage green */
  --accent-color: #cba135;       /* gold */
  --cream: #f6efe7;
  --ivory: #fbf7f1;
  --champagne: #f0e2c8;
  --baby-blue: #b9d3e4;
  --text-dark: #3a332f;
  --text-muted: #7a7067;

  --font-display: 'Cormorant Garamond', 'Marcellus', serif;
  --font-accent: 'Marcellus', serif;
  --font-body: 'Poppins', sans-serif;

  --radius-lg: 1.5rem;
  --radius-md: 1rem;
  --radius-sm: 0.5rem;

  --shadow-soft: 0 10px 40px rgba(58, 51, 47, 0.08);
  --shadow-card: 0 6px 24px rgba(58, 51, 47, 0.10);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--safe-top);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--cream);
  overflow-x: hidden;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

img { max-width: 100%; display: block; }

.hidden { display: none !important; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

a { color: inherit; text-decoration: none; }

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--text-dark);
}

.eyebrow {
  font-family: var(--font-body);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  color: var(--primary-color);
  margin: 0 0 0.5rem;
  font-weight: 500;
}

.section-title {
  font-size: clamp(2rem, 6vw, 3rem);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  text-align: center;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #fff;
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(201, 138, 156, 0.35); }

.btn-outline {
  background: #fff;
  color: var(--text-dark);
  border: 1.5px solid var(--champagne);
  box-shadow: var(--shadow-card);
}
.btn-outline:hover { border-color: var(--accent-color); }

.btn:disabled { opacity: 0.6; pointer-events: none; }

/* ---------- Layout / sections ---------- */
.section {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5rem) 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.invitation.hidden { display: none; }

/* ---------- Opening Screen ---------- */
.opening-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, var(--champagne), var(--cream) 70%);
  padding: calc(var(--safe-top) + 1rem) 1.25rem calc(var(--safe-bottom) + 1rem);
  overflow: hidden;
}

.opening-decor { position: absolute; inset: 0; pointer-events: none; }
.petal {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.55;
}
.petal-1 { top: 8%; left: 10%; }
.petal-2 { top: 15%; right: 12%; }
.petal-3 { bottom: 14%; left: 14%; }
.petal-4 { bottom: 10%; right: 10%; }

.opening-card {
  position: relative;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(203, 161, 53, 0.3);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 8vw, 3rem) clamp(1.5rem, 6vw, 2.5rem);
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.opening-illustration {
  width: clamp(120px, 34vw, 168px);
  margin: 0.25rem auto 0.5rem;
}
.opening-illustration svg { width: 100%; height: auto; display: block; }

.opening-sanskrit {
  font-family: var(--font-accent);
  color: var(--accent-color);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}
.opening-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  letter-spacing: 0.05em;
}
.opening-names {
  font-size: clamp(2.2rem, 9vw, 3rem);
  color: var(--primary-color);
  margin-bottom: 1rem;
}
.opening-line {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0.15rem 0;
}
.opening-line-emph {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-dark);
  font-style: italic;
}
.open-btn { margin-top: 1.75rem; width: 100%; max-width: 260px; }

/* ---------- Music button ---------- */
.music-btn {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 1.25rem);
  right: 1.25rem;
  z-index: 150;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--primary-color);
}
.music-btn.playing .music-icon { animation: pulse 1.4s ease-in-out infinite; }

/* ---------- Hero ---------- */
.hero-section {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  max-width: 100%;
}
.hero-content { position: relative; z-index: 2; }
.hero-names {
  font-size: clamp(2.6rem, 11vw, 4.5rem);
  color: var(--primary-color);
  margin: 0.5rem 0 1rem;
}
.hero-line { font-size: 1rem; color: var(--text-muted); margin: 0.2rem 0; }
.hero-line-emph { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--text-dark); }
.hero-divider { color: var(--accent-color); font-size: 1.5rem; margin-top: 1.5rem; }
.decor-float { position: absolute; font-size: clamp(1.5rem, 6vw, 2.5rem); color: var(--secondary-color); opacity: 0.4; pointer-events: none; }
.decor-1 { top: 10%; left: 8%; }
.decor-2 { bottom: 12%; right: 8%; }
.decor-tl { top: 6%; left: 6%; }
.decor-tr { top: 6%; right: 6%; }
.decor-bl { bottom: 6%; left: 6%; }
.decor-br { bottom: 6%; right: 6%; }
.scroll-hint {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 1.5rem);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Hero ambient balloons (permanent decorative fill) ---------- */
.hero-balloons {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.hero-balloon {
  position: absolute;
  animation: hero-balloon-bob 6s ease-in-out infinite;
  filter: drop-shadow(0 10px 16px rgba(58, 51, 47, 0.14));
}
.hero-balloon-body {
  width: var(--hb-size, 48px);
  height: calc(var(--hb-size, 48px) * 1.25);
  border-radius: 50% 50% 50% 50% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.7), var(--balloon-color) 62%);
  box-shadow:
    inset -7px -9px 12px rgba(0, 0, 0, 0.10),
    inset 4px 6px 10px rgba(255, 255, 255, 0.35);
}
.hero-balloon-knot {
  width: 0;
  height: 0;
  margin: -1px auto 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--balloon-color);
}
.hero-balloon-string {
  width: 1.5px;
  height: calc(var(--hb-size, 48px) * 0.9);
  margin: 0 auto;
  background: rgba(90, 70, 52, 0.28);
}

.hb-1  { top: 4%;  left: 3%;  --hb-size: 40px; animation-duration: 5.5s; }
.hb-2  { top: 6%;  left: 85%; --hb-size: 34px; animation-duration: 6.5s; animation-delay: 0.8s; }
.hb-3  { top: 18%; left: 10%; --hb-size: 54px; animation-duration: 7s;   animation-delay: 1.6s; }
.hb-4  { top: 16%; left: 78%; --hb-size: 46px; animation-duration: 6s;   animation-delay: 0.4s; }
.hb-5  { top: 42%; left: 0%;  --hb-size: 30px; animation-duration: 5.2s; animation-delay: 2.1s; opacity: 0.85; }
.hb-6  { top: 45%; left: 89%; --hb-size: 30px; animation-duration: 6.8s; animation-delay: 1.1s; opacity: 0.85; }
.hb-7  { top: 68%; left: 4%;  --hb-size: 58px; animation-duration: 7.4s; animation-delay: 0.6s; }
.hb-8  { top: 71%; left: 80%; --hb-size: 48px; animation-duration: 6.2s; animation-delay: 1.9s; }
.hb-9  { top: 85%; left: 21%; --hb-size: 36px; animation-duration: 5.8s; animation-delay: 1.3s; }
.hb-10 { top: 87%; left: 66%; --hb-size: 40px; animation-duration: 6.6s; animation-delay: 0.2s; }

.hero-sparkle {
  position: absolute;
  color: var(--accent-color);
  opacity: 0.55;
  font-size: 0.85rem;
  animation: pulse 3.2s ease-in-out infinite;
}
.hs-1 { top: 11%; left: 46%; animation-delay: 0.5s; }
.hs-2 { top: 28%; left: 64%; animation-delay: 1.5s; font-size: 0.65rem; }
.hs-3 { top: 58%; left: 28%; animation-delay: 0.8s; font-size: 0.65rem; }
.hs-4 { top: 76%; left: 52%; animation-delay: 2s; }
.hs-5 { top: 34%; left: 8%;  color: var(--secondary-color); font-size: 1rem; animation-delay: 1.1s; }
.hs-6 { top: 62%; left: 90%; color: var(--primary-color); font-size: 0.9rem; animation-delay: 0.3s; }

/* ---------- Event details ---------- */
.event-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
.event-card {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.event-card-icon { font-size: 1.6rem; }
.event-card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.event-card-value { font-weight: 500; font-size: 0.95rem; }
.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.75rem;
}

/* ---------- Countdown ---------- */
.countdown-section { background: var(--ivory); max-width: 100%; }
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 1.25rem);
  flex-wrap: wrap;
  max-width: 480px;
  margin: 0 auto;
}
.countdown-unit {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  min-width: 70px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.countdown-num {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}
.countdown-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.countdown-started {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-top: 1rem;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.08); }

.gallery-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1.5rem 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 14, 0.92);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: var(--radius-sm); }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  color: #fff;
  font-size: 1.8rem;
  background: rgba(255,255,255,0.15);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-close { top: calc(var(--safe-top) + 1rem); right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---------- Prediction ---------- */
.prediction-buttons {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.prediction-btn {
  flex: 1 1 140px;
  max-width: 180px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 1rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 500;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.prediction-btn:active { transform: scale(0.95); }
.prediction-btn.selected.boy { border-color: var(--baby-blue); background: #eef6fb; }
.prediction-btn.selected.girl { border-color: var(--primary-color); background: #fbeef2; }
.prediction-emoji { font-size: 2.2rem; }
.prediction-feedback { margin-top: 1rem; color: var(--primary-color); font-weight: 500; }

.prediction-results { max-width: 420px; margin: 2rem auto 0; }
.prediction-bar-row {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}
.prediction-bar {
  background: var(--champagne);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}
.prediction-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.boy-fill { background: var(--baby-blue); }
.girl-fill { background: var(--primary-color); }

/* ---------- Reveal ---------- */
.reveal-section { background: var(--ivory); max-width: 100%; }
.reveal-secret {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-muted);
}
.reveal-emoji { font-size: 4rem; margin-bottom: 0.5rem; }
.reveal-text {
  font-size: clamp(2rem, 8vw, 3rem);
  color: var(--primary-color);
}

/* ---------- RSVP ---------- */
.rsvp-form {
  text-align: left;
  max-width: 480px;
  margin: 1.5rem auto 0;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--champagne);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--ivory);
  min-height: 48px;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-color);
}

.attendance-toggle { display: flex; flex-direction: column; gap: 0.6rem; }
.attend-btn {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--champagne);
  background: var(--ivory);
  font-size: 0.9rem;
  min-height: 48px;
  text-align: left;
}
.attend-btn.selected {
  border-color: var(--accent-color);
  background: var(--champagne);
  font-weight: 500;
}

.form-error { color: #b3413c; font-size: 0.85rem; margin: 0.5rem 0; }
.rsvp-submit-btn { width: 100%; margin-top: 0.5rem; }

.rsvp-success {
  max-width: 480px;
  margin: 1.5rem auto 0;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.rsvp-success p { margin: 0 0 1rem; font-weight: 500; }

/* ---------- Share ---------- */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.share-feedback { margin-top: 1rem; color: var(--secondary-color); font-weight: 500; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 3rem 1.5rem calc(3rem + var(--safe-bottom));
  background: var(--text-dark);
  color: var(--ivory);
}
.footer-names { font-family: var(--font-display); font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--champagne); }
.footer-line { opacity: 0.8; font-size: 0.9rem; margin: 0 0 1rem; }
.footer-credit {
  display: inline-block;
  opacity: 0.8;
  font-size: 0.8rem;
  color: var(--champagne);
  text-decoration: none;
}
.footer-credit:hover { opacity: 1; text-decoration: underline; }

/* ---------- Balloon celebration (played once, on opening the invitation) ---------- */
.balloon-wrap {
  position: fixed;
  left: 0;
  bottom: -160px;
  z-index: 500;
  width: 46px;
  pointer-events: none;
  animation-name: balloon-rise;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}
.balloon-body {
  width: 46px;
  height: 58px;
  border-radius: 50% 50% 50% 50% / 56% 56% 44% 44%;
  box-shadow: inset -7px -9px 12px rgba(0, 0, 0, 0.10), inset 4px 6px 10px rgba(255, 255, 255, 0.35);
}
.balloon-knot {
  width: 0;
  height: 0;
  margin: -1px auto 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--balloon-color, var(--primary-color));
}
.balloon-string {
  width: 1.5px;
  height: 42px;
  margin: 0 auto;
  background: rgba(90, 70, 52, 0.35);
}

.pop-particle {
  position: fixed;
  top: 0;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  z-index: 501;
  pointer-events: none;
  animation: pop-burst 0.6s ease-out forwards;
}
