:root {
  --bg: #fff6f9;
  --ink: #2c2540;
  --muted: #7d7596;
  --pink: #ff4d8d;
  --coral: #ff7a59;
  --yellow: #ffce3a;
  --teal: #25c4c0;
  --purple: #7b5cff;
  --green: #2ec46b;
  --card: #ffffff;
  --line: #efe6f0;
  --grad: linear-gradient(135deg, var(--pink), var(--coral) 55%, var(--yellow));
  --shadow: 0 22px 50px -22px rgba(123, 92, 255, 0.45);
  --radius: 26px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Soft floating colour blobs in the background */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -2;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
}
body::before {
  width: 46vw; height: 46vw;
  top: -12vw; right: -10vw;
  background: radial-gradient(circle at 30% 30%, var(--pink), transparent 70%);
  animation: floatA 18s ease-in-out infinite;
}
body::after {
  width: 42vw; height: 42vw;
  bottom: -14vw; left: -10vw;
  background: radial-gradient(circle at 60% 40%, var(--teal), transparent 70%);
  animation: floatB 22s ease-in-out infinite;
}
@keyframes floatA { 50% { transform: translate(-4vw, 5vw) scale(1.1); } }
@keyframes floatB { 50% { transform: translate(5vw, -4vw) scale(1.08); } }

h1, h2, legend, .cd-num, .stat .num {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 600;
  line-height: 1.05;
}
a { color: var(--pink); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Confetti ---------- */
.confetti { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.confetti span {
  position: absolute;
  top: -8vh;
  width: 11px; height: 16px;
  border-radius: 3px;
  opacity: 0.85;
  animation: confettiFall linear infinite;
}
.confetti span:nth-child(3n)   { background: var(--pink); }
.confetti span:nth-child(3n+1) { background: var(--teal); border-radius: 50%; }
.confetti span:nth-child(3n+2) { background: var(--yellow); }
.confetti span:nth-child(4n)   { background: var(--purple); }
.confetti span:nth-child(5n)   { background: var(--coral); }
.confetti span:nth-child(1)  { left: 5%;  animation-duration: 9s;  animation-delay: 0s; }
.confetti span:nth-child(2)  { left: 12%; animation-duration: 12s; animation-delay: 2s; }
.confetti span:nth-child(3)  { left: 19%; animation-duration: 10s; animation-delay: 4s; }
.confetti span:nth-child(4)  { left: 27%; animation-duration: 13s; animation-delay: 1s; }
.confetti span:nth-child(5)  { left: 34%; animation-duration: 8s;  animation-delay: 3s; }
.confetti span:nth-child(6)  { left: 41%; animation-duration: 11s; animation-delay: 5s; }
.confetti span:nth-child(7)  { left: 48%; animation-duration: 14s; animation-delay: 0.5s; }
.confetti span:nth-child(8)  { left: 55%; animation-duration: 9.5s;animation-delay: 2.5s; }
.confetti span:nth-child(9)  { left: 62%; animation-duration: 12.5s;animation-delay: 4.5s; }
.confetti span:nth-child(10) { left: 69%; animation-duration: 10.5s;animation-delay: 1.5s; }
.confetti span:nth-child(11) { left: 76%; animation-duration: 13.5s;animation-delay: 3.5s; }
.confetti span:nth-child(12) { left: 83%; animation-duration: 8.5s; animation-delay: 5.5s; }
.confetti span:nth-child(13) { left: 90%; animation-duration: 11.5s;animation-delay: 0.8s; }
.confetti span:nth-child(14) { left: 96%; animation-duration: 12s;  animation-delay: 2.8s; }
.confetti span:nth-child(15) { left: 9%;  animation-duration: 10s;  animation-delay: 6s; }
.confetti span:nth-child(16) { left: 30%; animation-duration: 13s;  animation-delay: 6.5s; }
.confetti span:nth-child(17) { left: 58%; animation-duration: 9s;   animation-delay: 7s; }
.confetti span:nth-child(18) { left: 80%; animation-duration: 12s;  animation-delay: 7.5s; }
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0); }
  100% { transform: translateY(112vh) rotate(540deg); }
}

/* ---------- Hero / landing ---------- */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  align-items: center;
  padding: 1.4rem;
  gap: 1.4rem;
}
.hero-photo {
  background-image: url('/img/hero.jpg');
  background-size: cover;
  background-position: center 30%;
  min-height: 78vh;
  border-radius: 32px;
  box-shadow: var(--shadow);
  border: 6px solid #fff;
  transform: rotate(-1.5deg);
}
.hero-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.6rem, 3.5vw, 3rem);
  transform: rotate(1deg);
  animation: popIn 0.5s ease both;
}
@keyframes popIn { from { opacity: 0; transform: rotate(1deg) translateY(16px) scale(0.97); } }

.eyebrow {
  font-family: 'Pacifico', cursive;
  font-size: 1.25rem;
  color: var(--purple);
  margin: 0 0 0.3rem;
  transform: rotate(-2deg);
}
.hero-card h1 { font-size: clamp(2.8rem, 7vw, 4.8rem); margin: 0 0 0.5rem; }
.big-40 {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700;
}
.lead { font-size: 1.18rem; color: var(--muted); margin: 0 0 1.6rem; max-width: 34ch; font-weight: 600; }

/* ---------- Party details ---------- */
.details { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.details li {
  display: flex; gap: 0.9rem; align-items: center;
  padding: 0.7rem 0.9rem; margin-bottom: 0.5rem;
  background: #fbf4ff; border-radius: 16px;
}
.details .label {
  min-width: 52px; font-family: 'Fredoka', sans-serif; font-weight: 600;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--purple);
}
.details .value { font-weight: 700; }
.blurb {
  color: var(--ink); margin: 0 0 1.8rem; background: #effcfb;
  border-radius: 16px; padding: 0.9rem 1.1rem; font-weight: 600;
}

/* ---------- Entry / email form ---------- */
.entry h2 { font-size: 1.9rem; margin: 0 0 0.2rem; }
.hint { color: var(--muted); font-size: 0.95rem; margin: 0.3rem 0 0.9rem; font-weight: 600; }
.email-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.email-form input {
  flex: 1; min-width: 220px; padding: 0.95rem 1.1rem; font-size: 1rem;
  border: 2.5px solid var(--line); border-radius: 16px; background: #fff;
  font-family: inherit; font-weight: 600;
}
.email-form input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255,77,141,0.18); }
.form-error { color: #d83a6a; font-weight: 800; background: #ffe9f0; padding: 0.6rem 0.9rem; border-radius: 12px; }

/* ---------- Buttons ---------- */
.btn, .email-form button {
  display: inline-block; padding: 0.9rem 1.6rem; border-radius: 999px;
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 1.02rem;
  text-decoration: none; cursor: pointer; border: none; color: #fff;
  background: var(--grad); background-size: 160% 160%;
  box-shadow: 0 10px 22px -8px rgba(255,77,141,0.6);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-position 0.4s ease;
}
.btn:hover, .email-form button:hover {
  transform: translateY(-2px) rotate(-1deg) scale(1.04);
  box-shadow: 0 16px 30px -8px rgba(255,77,141,0.7);
  background-position: 100% 0;
}
.btn:active, .email-form button:active { transform: translateY(0) scale(0.99); }
.btn.primary { font-size: 1.12rem; padding: 1rem 2.2rem; }
.btn.ghost {
  background: #fff; color: var(--pink); border: 2.5px solid var(--pink);
  box-shadow: none;
}
.btn.ghost:hover { background: #fff0f5; box-shadow: 0 8px 18px -10px rgba(255,77,141,0.6); }

/* ---------- Generic pages ---------- */
.page { flex: 1; width: 100%; max-width: 780px; margin: 0 auto; padding: 2rem 1.2rem 3rem; }
.page.narrow { max-width: 560px; }
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(1.5rem, 4vw, 2.8rem);
  animation: popIn 0.5s ease both; transform: none;
  border-top: 7px solid transparent;
  border-image: var(--grad) 1;
}
.card h1 { font-size: clamp(2.1rem, 5vw, 3rem); margin: 0 0 0.6rem; }

/* ---------- Countdown ---------- */
.countdown { display: flex; gap: 0.7rem; margin: 0 0 1.6rem; flex-wrap: wrap; }
.cd-unit {
  flex: 1; min-width: 64px; border-radius: 20px; padding: 0.8rem 0.4rem;
  text-align: center; color: #fff; box-shadow: 0 8px 18px -8px rgba(0,0,0,0.25);
  transform: rotate(-2deg);
}
.cd-unit:nth-child(1) { background: var(--pink); }
.cd-unit:nth-child(2) { background: var(--teal); transform: rotate(2deg); }
.cd-unit:nth-child(3) { background: var(--purple); transform: rotate(-1.5deg); }
.cd-unit:nth-child(4) { background: var(--coral); transform: rotate(1.5deg); }
.cd-num { display: block; font-size: 2.2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cd-lbl { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; opacity: 0.95; margin-top: 0.3rem; }
.cd-done { width: 100%; margin: 0; text-align: center; font-family: 'Fredoka', sans-serif; font-size: 1.7rem; color: var(--pink); }
.deadline-note { margin: 0 0 1.2rem; }
.summary { background: #fbf4ff; border-radius: 18px; padding: 1rem 1.2rem; }

/* ---------- RSVP form ---------- */
.rsvp-card .eyebrow { margin-bottom: 0.3rem; }
.banner { padding: 1rem 1.2rem; border-radius: 16px; margin: 0 0 1.4rem; font-weight: 700; }
.banner.success { background: #e3fbec; color: #1f8f52; }
.banner.error { background: #ffe9f0; color: #d83a6a; }

fieldset.attend { border: none; padding: 0; margin: 1.6rem 0; }
fieldset.attend legend { font-size: 1.7rem; padding: 0; margin-bottom: 0.6rem; }
.radio-card { display: block; margin-bottom: 0.7rem; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card-body {
  display: block; padding: 1rem 1.2rem; border: 2.5px solid var(--line);
  border-radius: 18px; background: #fff; transition: all 0.16s;
}
.radio-card-body strong { display: block; font-family: 'Fredoka', sans-serif; font-size: 1.1rem; }
.radio-card-body small { color: var(--muted); font-weight: 600; }
.radio-card input:checked + .radio-card-body {
  border-color: var(--pink); background: #fff0f6;
  box-shadow: 0 0 0 4px rgba(255,77,141,0.16); transform: translateY(-1px);
}
.radio-card input:focus-visible + .radio-card-body { outline: 3px solid var(--purple); outline-offset: 2px; }

.block { margin: 1.9rem 0; }
.block h2 { font-size: 1.55rem; margin: 0 0 0.2rem; }
.optional { font-size: 0.8rem; color: var(--muted); font-family: 'Nunito', sans-serif; font-weight: 700; }

textarea, .block input[type="text"] {
  width: 100%; padding: 0.85rem 1rem; font-size: 1rem; font-family: inherit; font-weight: 600;
  border: 2.5px solid var(--line); border-radius: 16px; background: #fff; resize: vertical;
}
textarea:focus, .block input[type="text"]:focus {
  outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255,77,141,0.16);
}

/* attendee rows */
.attendee-row {
  display: flex; gap: 0.6rem; align-items: flex-start; padding: 1rem;
  border: 2.5px solid var(--line); border-radius: 18px; margin-bottom: 0.7rem; background: #fffafd;
}
.attendee-fields { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.attendee-fields label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; font-weight: 800; color: var(--muted); }
.attendee-fields > label:first-child,
.attendee-fields .allergies-field { grid-column: 1 / -1; }
.attendee-fields select {
  padding: 0.7rem 0.8rem; font-size: 0.98rem; font-family: inherit; font-weight: 600;
  border: 2.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink);
}
.attendee-fields select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255,77,141,0.16); }
.remove-attendee {
  border: none; background: #fff0f5; color: var(--pink); font-size: 1rem;
  cursor: pointer; padding: 0.4rem 0.55rem; border-radius: 12px; font-weight: 800;
}
.remove-attendee:hover { background: var(--pink); color: #fff; }

.actions { margin-top: 1.9rem; }

/* ---------- Admin ---------- */
.admin .card { max-width: none; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 1.4rem 0; }
.stat { border-radius: 18px; padding: 1rem; text-align: center; color: #fff; }
.stat:nth-child(4n+1) { background: var(--pink); }
.stat:nth-child(4n+2) { background: var(--teal); }
.stat:nth-child(4n+3) { background: var(--purple); }
.stat:nth-child(4n)   { background: var(--coral); }
.stat .num { display: block; font-size: 2rem; }
.stat .lbl { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; opacity: 0.95; }
.allergy-list { padding-left: 1.1rem; }
.diet-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.diet-pill {
  background: #fbf4ff; border: 2px solid var(--line); border-radius: 999px;
  padding: 0.35rem 0.9rem; font-weight: 700; font-size: 0.92rem;
}
.diet-num {
  display: inline-block; min-width: 1.4rem; text-align: center; font-weight: 800;
  color: #fff; background: var(--purple); border-radius: 999px; padding: 0 0.35rem; margin-right: 0.25rem;
}
.import-box { background: #effcfb; border: 2.5px dashed var(--teal); border-radius: 18px; padding: 1.1rem 1.2rem; }
.import-form { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-top: 0.4rem; }
.import-form input[type="file"] { flex: 1; min-width: 220px; font-family: inherit; font-weight: 600; }
.rsvp-entry { border: 2px solid var(--line); border-radius: 18px; padding: 1rem 1.1rem; margin-bottom: 0.8rem; }
.rsvp-entry.yes { border-left: 6px solid var(--green); }
.rsvp-entry.no { border-left: 6px solid var(--muted); }
.rsvp-entry-head { display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; }
.rsvp-entry-head strong { font-family: 'Fredoka', sans-serif; }
.pill { margin-left: auto; background: var(--green); color: #fff; border-radius: 999px; padding: 0.12rem 0.7rem; font-size: 0.78rem; font-weight: 800; }
.edit-link {
  font-size: 0.8rem; font-weight: 800; text-decoration: none; color: var(--pink);
  border: 2px solid var(--pink); border-radius: 999px; padding: 0.15rem 0.7rem; white-space: nowrap;
}
.edit-link:hover { background: var(--pink); color: #fff; }
.rsvp-entry-head .edit-link { margin-left: auto; }
.rsvp-entry.yes .rsvp-entry-head .edit-link { margin-left: 0; }
.admin-invitee { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.admin-invitee label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.82rem; font-weight: 800; color: var(--muted); }
.people { margin: 0.5rem 0 0.4rem; padding-left: 1.1rem; }
.tag { background: var(--yellow); color: #5a4500; border-radius: 8px; padding: 0.05rem 0.45rem; font-size: 0.72rem; font-weight: 800; }
.tag.diet { background: var(--teal); color: #fff; }
.qa { margin: 0.3rem 0; font-size: 0.95rem; }
.qa span { font-weight: 800; color: var(--pink); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.noreply { width: 100%; border-collapse: collapse; }
.noreply td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 1.8rem 1rem; color: var(--muted); font-size: 0.9rem; font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { min-height: 36vh; transform: rotate(-1deg); }
  .hero-card { transform: rotate(0); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-invitee { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .attendee-fields { grid-template-columns: 1fr; }
  .email-form button { width: 100%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .confetti span, .hero-card, .card { animation: none; }
  .hero-photo, .hero-card, .cd-unit { transform: none; }
}
