:root {
  /* Party palette — elegant plum & gold */
  --plum: #5b2a86;
  --plum-deep: #3d1a5e;
  --gold: #d4a017;
  --gold-soft: #e6b84d;
  --rose: #a13670;
  --accent: var(--plum);
  --ink: #2b2333;
  --muted: #6b6275;
  --bg: #faf7fb;
  --card: #ffffff;
  --border: #ece4f0;
  --max: 900px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(91,42,134,0.05), transparent 42%),
    radial-gradient(circle at 88% 4%, rgba(212,160,23,0.05), transparent 40%),
    var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Display font for headings */
h1, .brand, .hero-title { font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 3px solid var(--gold);
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  font-weight: 800; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em;
  color: var(--plum);
}
.nav { display: flex; gap: 1rem; align-items: center; }
.nav a, .linklike { color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.nav a:hover { color: var(--plum); }
.nav a.active { color: var(--plum); }
.linklike { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }
.inline { display: inline; margin: 0; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 1rem; flex: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  margin-bottom: 1.25rem;
  padding: 2.6rem 1.25rem 2.8rem;
  text-align: center;
  color: #fff;
  background: linear-gradient(125deg, var(--plum-deep), var(--plum), var(--rose));
  background-size: 200% 200%;
  animation: heroShift 16s ease infinite;
  box-shadow: 0 18px 40px -20px rgba(61, 26, 94, 0.55);
}
@keyframes heroShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.hero-badge {
  display: inline-block; background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 0.3rem 0.9rem; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; margin-bottom: 0.9rem;
  backdrop-filter: blur(4px);
}
.hero-title {
  font-size: clamp(2.2rem, 8vw, 3.6rem);
  font-weight: 800; line-height: 1.05; margin: 0 0 0.6rem;
  text-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.hero-sub { font-size: 1.05rem; margin: 0 auto; max-width: 34rem; opacity: 0.96; }
.hero .btn { margin-top: 1.3rem; }
/* floating balloons */
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  width: 120px; height: 140px; opacity: 0.18; filter: blur(2px);
  background: #fff;
}
.hero::before { left: -30px; top: -40px; }
.hero::after { right: -40px; bottom: -60px; width: 160px; height: 180px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  box-shadow: 0 12px 30px -20px rgba(36, 25, 51, 0.35);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--plum), var(--gold));
}
h1 { font-size: 1.5rem; margin-top: 0.35rem; }

/* ---------- Forms ---------- */
label { display: block; margin: 0.6rem 0 0.25rem; font-weight: 600; font-size: 0.9rem; }
input, textarea, select, button {
  width: 100%; padding: 0.65rem; font-size: 1rem;
  border: 1.5px solid var(--border); border-radius: 10px; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--plum);
  box-shadow: 0 0 0 3px rgba(91, 42, 134, 0.15);
}
textarea { min-height: 120px; }
button.primary, .btn {
  background: var(--plum);
  color: #fff; border: none; font-weight: 700; font-size: 1rem;
  cursor: pointer; text-align: center; text-decoration: none; display: inline-block;
  padding: 0.7rem 1.4rem; border-radius: 999px;
  box-shadow: 0 8px 20px -10px rgba(61, 26, 94, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
button.primary:hover, .btn:hover {
  transform: translateY(-2px); filter: brightness(1.08);
  box-shadow: 0 12px 26px -10px rgba(61, 26, 94, 0.7);
}
button.primary:active, .btn:active { transform: translateY(0); }
.btn-google {
  background: #fff; color: var(--ink); border: 1.5px solid var(--border);
  font-weight: 600; padding: 0.7rem; border-radius: 999px; display: block;
  text-align: center; text-decoration: none; margin-bottom: 1rem;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(36,25,51,0.4); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
.gallery figure {
  margin: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 24px -18px rgba(36, 25, 51, 0.5);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gallery figure:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -18px rgba(91,42,134,0.4); }
.gallery img {
  width: 100%; height: 150px; object-fit: cover; display: block; cursor: pointer;
  transition: transform 0.35s ease;
}
.gallery figure:hover img { transform: scale(1.07); }
.gallery figcaption { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
.gallery figcaption .uploader { color: var(--muted); font-size: 0.8rem; }

/* ---------- Fullscreen photo viewer (lightbox) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 4, 20, 0.96);
  display: flex; flex-direction: column;
  touch-action: pan-y;
}
.lightbox[hidden] { display: none; }
.lightbox-stage {
  flex: 1; position: relative; display: flex;
  align-items: center; justify-content: center; overflow: hidden;
  min-height: 0;
}
.lightbox-stage img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto; object-fit: contain;
  display: block; user-select: none; -webkit-user-drag: none;
  border-radius: 6px;
}
.lightbox-caption {
  color: #fff; text-align: center; padding: 0.75rem 1rem;
  font-size: 0.95rem; line-height: 1.4;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}
.lightbox-caption .loc { color: #e6d3f0; font-style: italic; }
.lightbox-caption .uploader { color: #cbb8dd; font-size: 0.85rem; }
.lightbox-counter { color: #cbb8dd; font-size: 0.8rem; margin-top: 0.25rem; }
.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.14); color: #fff; border: none;
  width: 48px; height: 64px; font-size: 2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; line-height: 1; z-index: 2;
}
.lb-btn:hover { background: rgba(91, 42, 134, 0.65); }
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }
.lb-close {
  position: absolute; top: calc(0.5rem + env(safe-area-inset-top)); right: 0.75rem;
  background: none; border: none; color: #fff; font-size: 2.5rem;
  line-height: 1; cursor: pointer; z-index: 3; padding: 0.25rem 0.5rem;
}
@media (hover: none) and (pointer: coarse) {
  .lb-btn { width: 40px; height: 56px; font-size: 1.6rem; opacity: 0.75; }
}

/* ---------- Memories ---------- */
.memory {
  border-left: 3px solid var(--gold);
  padding: 0.65rem 0 0.65rem 0.9rem;
  margin-bottom: 0.9rem;
}
.memory:last-child { margin-bottom: 0; }
.memory .meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
.memory .meta strong { color: var(--ink); }
.memory .body { white-space: pre-wrap; }

/* ---------- Flash ---------- */
.flash { padding: 0.7rem 0.9rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 600; }
.flash.error { background: #fbeaf0; color: #a13670; }
.flash.ok { background: #eef6ec; color: #4a7c3f; }

/* ---------- Footer ---------- */
.site-footer {
  background: rgba(255, 255, 255, 0.9); border-top: 1px solid var(--border);
  padding: 1rem; text-align: center; display: flex; gap: 0.5rem;
  align-items: center; justify-content: center; flex-wrap: wrap;
  font-size: 0.9rem; color: var(--muted);
}
.sf-logo { height: 34px; width: auto; }
.footer-credit { padding-left: 0.5rem; border-left: 1px solid var(--border); }

/* ---------- Confetti canvas ---------- */
#confetti-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 900;
}

@media (max-width: 480px) {
  .footer-credit { border-left: none; padding-left: 0; flex-basis: 100%; }
  .site-header { justify-content: center; }
  .nav { flex-wrap: wrap; justify-content: center; }
  .hero { padding: 2.2rem 1rem 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero { animation: none; }
  .gallery figure, .gallery img, button.primary, .btn { transition: none; }
}
