/* ── Palette ── */
:root {
  --bg: #1a0e2e;
  --card: #231340;
  --card-border: #3a2460;
  --purple-soft: #c4a0e8;
  --purple-bright: #d4b0ff;
  --purple-accent: #a855f7;
  --purple-deep: #7c3aed;
  --lavender: #e8d5ff;
  --text: #e8ddf4;
  --text-dim: #a898c0;
  --gold: #fbbf24;

  /* Cat colors */
  --cat-white: #faf5ef;
  --cat-grey: #a8a0b0;
  --cat-orange: #f0a050;
  --cat-dark: #484050;
  --cat-pink: #ffb0c0;
}

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

body {
  font-family: "DM Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(124, 58, 237, 0.05) 0%, transparent 40%);
}

/* ── Card ── */
.card {
  position: relative;
  max-width: 520px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 48px 40px 40px;
  text-align: center;
  overflow: hidden;
  box-shadow:
    0 4px 60px rgba(124, 58, 237, 0.12),
    0 0 0 1px rgba(168, 85, 247, 0.05) inset;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(168, 85, 247, 0.06) 0%,
    transparent 60%
  );
  pointer-events: none;
}

/* ── Sparkles ── */
.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--purple-bright);
  border-radius: 50%;
  animation: sparkle 3s ease-in-out infinite;
}

.sparkle::after {
  content: "";
  position: absolute;
  inset: -2px;
  background: inherit;
  border-radius: 50%;
  filter: blur(3px);
  opacity: 0.6;
}

.s1 { top: 12%; left: 15%; animation-delay: 0s; }
.s2 { top: 8%; right: 20%; animation-delay: 0.8s; }
.s3 { top: 35%; left: 8%; animation-delay: 1.6s; }
.s4 { top: 50%; right: 10%; animation-delay: 0.4s; }
.s5 { bottom: 20%; left: 12%; animation-delay: 2s; }
.s6 { bottom: 15%; right: 15%; animation-delay: 1.2s; }

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ── Cats Container ── */
.cats {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

/* ── Individual Cat ── */
.cat {
  position: relative;
  width: 80px;
  height: 110px;
  animation: catBounce 2s ease-in-out infinite;
}

@keyframes catBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.cat-body {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ── Ears ── */
.cat-ear {
  position: absolute;
  width: 16px;
  height: 18px;
  background: var(--cat-white);
  top: 2px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  z-index: 2;
}

.cat-ear::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 11px;
  background: var(--cat-pink);
  top: 5px;
  left: 3px;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.cat-ear-l { left: 12px; }
.cat-ear-r { right: 12px; }

/* ── Head ── */
.cat-head {
  position: absolute;
  width: 52px;
  height: 44px;
  background: var(--cat-white);
  border-radius: 50% 50% 45% 45%;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  overflow: hidden;
}

/* ── Patches ── */
.cat-patch {
  position: absolute;
  border-radius: 50%;
}

.patch-1 {
  width: 22px;
  height: 20px;
  background: var(--cat-grey);
  top: -2px;
  right: 0;
}

.patch-2 {
  width: 28px;
  height: 22px;
  background: var(--cat-orange);
  top: -2px;
  right: -4px;
  border-radius: 40% 60% 50% 50%;
}

.patch-3 {
  width: 30px;
  height: 18px;
  background: var(--cat-grey);
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
}

/* ── Eyes ── */
.cat-eye {
  position: absolute;
  top: 18px;
  z-index: 4;
}

.cat-eye-l { left: 12px; }
.cat-eye-r { right: 12px; }

.cat-eye.open {
  width: 8px;
  height: 8px;
  background: var(--cat-dark);
  border-radius: 50%;
}

.cat-eye.open::after {
  content: "";
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  top: 1px;
  left: 1px;
}

.cat-eye.closed {
  width: 8px;
  height: 2px;
  background: var(--cat-dark);
  border-radius: 2px;
  top: 22px;
}

.cat-eye.squint {
  width: 7px;
  height: 4px;
  border-bottom: 2px solid var(--cat-dark);
  border-radius: 0 0 50% 50%;
  top: 20px;
}

/* ── Mouth ── */
.cat-mouth {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
}

.cat-mouth.happy {
  width: 10px;
  height: 5px;
  border-bottom: 2px solid var(--cat-dark);
  border-left: 2px solid var(--cat-dark);
  border-right: 2px solid var(--cat-dark);
  border-radius: 0 0 50% 50%;
}

.cat-mouth.smirk {
  width: 6px;
  height: 4px;
  border-bottom: 2px solid var(--cat-dark);
  border-radius: 0 0 40% 60%;
}

/* ── Whiskers ── */
.cat-whisker-l,
.cat-whisker-r {
  position: absolute;
  bottom: 12px;
  width: 14px;
  height: 1px;
  background: var(--cat-dark);
  opacity: 0.4;
  z-index: 4;
}

.cat-whisker-l {
  left: -2px;
  transform: rotate(-8deg);
}

.cat-whisker-r {
  right: -2px;
  transform: rotate(8deg);
}

.cat-whisker-l::after,
.cat-whisker-r::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 1px;
  background: inherit;
  top: -4px;
}

.cat-whisker-l::after { left: 0; transform: rotate(12deg); }
.cat-whisker-r::after { right: 0; transform: rotate(-12deg); }

/* ── Torso ── */
.cat-torso {
  position: absolute;
  width: 38px;
  height: 30px;
  background: var(--cat-white);
  border-radius: 40% 40% 50% 50%;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

/* ── Arms ── */
.cat-arm {
  position: absolute;
  width: 12px;
  height: 22px;
  background: var(--cat-white);
  border-radius: 6px 6px 5px 5px;
  top: 2px;
  z-index: 3;
}

.cat-arm-l { left: -4px; transform: rotate(8deg); }
.cat-arm-r { right: -4px; transform: rotate(-8deg); }

.cat-arm.up {
  transform: rotate(-25deg);
  transform-origin: bottom center;
}

.cat-arm-r.up {
  transform: rotate(25deg);
}

.cat-arm.pray {
  top: 4px;
}

.cat-arm-l.pray { left: 4px; transform: rotate(15deg); }
.cat-arm-r.pray { right: 4px; transform: rotate(-15deg); }

/* ── Legs ── */
.cat-legs {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 1;
}

.cat-leg {
  width: 14px;
  height: 18px;
  background: var(--cat-white);
  border-radius: 5px 5px 6px 6px;
}

/* ── Tail ── */
.cat-tail {
  position: absolute;
  width: 10px;
  height: 24px;
  background: var(--cat-white);
  border-radius: 5px;
  z-index: 0;
  animation: tailWag 1.5s ease-in-out infinite;
}

.tail-1 {
  top: 55px;
  right: 4px;
  transform-origin: bottom center;
  background: var(--cat-grey);
}

.tail-2 {
  top: 55px;
  left: 4px;
  transform-origin: bottom center;
  background: var(--cat-orange);
}

.tail-3 {
  top: 55px;
  right: 6px;
  transform-origin: bottom center;
  background: var(--cat-grey);
}

.tail-4 {
  top: 55px;
  left: 6px;
  transform-origin: bottom center;
}

@keyframes tailWag {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(15deg); }
}

/* ── Cat-specific Colors ── */
.cat-2 .cat-ear::after { background: var(--cat-pink); }

/* ── Balloon ── */
.cat-balloon {
  position: absolute;
  top: -30px;
  left: 6px;
  z-index: 5;
  animation: balloonFloat 3s ease-in-out infinite;
}

.balloon {
  width: 22px;
  height: 28px;
  background: var(--purple-accent);
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  position: relative;
}

.balloon::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--purple-accent);
}

.balloon::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  top: 6px;
  left: 5px;
  transform: rotate(-20deg);
}

.balloon-string {
  width: 1px;
  height: 22px;
  background: var(--text-dim);
  margin: 0 auto;
  position: relative;
}

@keyframes balloonFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

/* ── Party Hat ── */
.cat-party-hat {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%) rotate(8deg);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 28px solid var(--purple-accent);
  z-index: 10;
  border-radius: 2px;
}

.cat-party-hat::after {
  content: "";
  position: absolute;
  top: 24px;
  left: -14px;
  width: 28px;
  height: 6px;
  background: var(--gold);
  border-radius: 3px;
}

.cat-party-hat::before {
  content: "";
  position: absolute;
  top: -6px;
  left: -3px;
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

/* ── Cupcake ── */
.cat-cupcake {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}

.cupcake-top {
  width: 22px;
  height: 14px;
  background: var(--purple-bright);
  border-radius: 50% 50% 30% 30%;
  position: relative;
}

.cupcake-bottom {
  width: 18px;
  height: 10px;
  background: var(--gold);
  border-radius: 2px 2px 4px 4px;
  margin: 0 auto;
  position: relative;
}

.cupcake-bottom::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  right: 2px;
  height: 1px;
  background: rgba(0, 0, 0, 0.15);
}

.cupcake-candle {
  width: 2px;
  height: 8px;
  background: var(--cat-white);
  margin: 0 auto;
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
}

.cupcake-flame {
  width: 5px;
  height: 7px;
  background: var(--gold);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
  animation: flame 0.5s ease-in-out infinite alternate;
}

@keyframes flame {
  0% { transform: translateX(-50%) scale(1) rotate(-5deg); opacity: 1; }
  100% { transform: translateX(-50%) scale(1.15) rotate(5deg); opacity: 0.85; }
}

/* ── Gift ── */
.cat-gift {
  position: absolute;
  top: -14px;
  right: -16px;
  z-index: 5;
}

.gift-box {
  width: 20px;
  height: 16px;
  background: var(--purple-accent);
  border-radius: 2px;
  position: relative;
}

.gift-ribbon {
  position: absolute;
  width: 4px;
  height: 16px;
  background: var(--gold);
  left: 8px;
  top: 0;
}

.gift-ribbon::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 4px;
  background: var(--gold);
  top: 6px;
  left: -8px;
}

.gift-bow {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
}

/* ── Typography ── */
.invite-label {
  font-family: "DM Sans", sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--purple-soft);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

h1 {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 2.4rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--purple-bright);
  margin: 0 0 12px;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.tagline {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-bottom: 28px;
  font-style: italic;
  position: relative;
  z-index: 1;
}

/* ── Meta ── */
.meta {
  margin: 0 0 32px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.meta-block {
  margin-top: 12px;
}

.meta-block strong {
  color: var(--purple-soft);
  font-weight: 600;
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.meta-block a {
  color: var(--lavender);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 170, 255, 0.3);
  transition: border-color 0.2s;
}

.meta-block a:hover {
  border-color: var(--purple-bright);
}

.meta-block small {
  display: block;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 2px;
}

.meta-block small a {
  font-size: inherit;
}

.accent {
  color: var(--purple-bright);
  font-weight: 600;
}

/* ── RSVP Wrapper ── */
.rsvp-wrapper {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
  display: grid;
  grid-template-rows: 1fr;
}

/* ── Toggle Button (visible by default) ── */
#rsvp-toggle {
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rsvp-wrapper.open #rsvp-toggle,
.rsvp-wrapper.done #rsvp-toggle {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: scale(0.9);
}

/* ── Form (hidden by default, slides in) ── */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(12px);
  transition:
    max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s 0.1s ease,
    transform 0.4s 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.rsvp-wrapper.open .rsvp-form {
  max-height: 400px;
  opacity: 1;
  transform: translateY(0);
}

.rsvp-wrapper.done .rsvp-form {
  max-height: 0;
  opacity: 0;
  transform: translateY(-12px);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--purple-soft);
}

.form-group input {
  font-family: "DM Sans", sans-serif;
  font-size: 1rem;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.form-group input:focus {
  outline: none;
  border-color: var(--purple-accent);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}

/* ── Success (hidden by default, fades in) ── */
.rsvp-success {
  text-align: center;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: scale(0.9);
  transition:
    max-height 0.5s 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s 0.35s ease,
    transform 0.4s 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.rsvp-wrapper.done .rsvp-success {
  max-height: 200px;
  opacity: 1;
  transform: scale(1);
}

.success-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
  animation: successPop 0.5s 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes successPop {
  0% { transform: scale(0) rotate(-20deg); }
  100% { transform: scale(1) rotate(0); }
}

.success-heading {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  text-transform: uppercase;
  color: var(--purple-bright);
  margin-bottom: 4px;
}

.success-sub {
  color: var(--text-dim);
  font-style: italic;
}

/* ── Buttons ── */
.button-row-secondary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.button,
button.button {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  font-family: "DM Sans", sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: all 0.25s ease;
  cursor: pointer;
}

button.button.primary,
.button.primary {
  background: var(--purple-deep);
  color: white;
  border: 1px solid var(--purple-accent);
  box-shadow: 0 2px 20px rgba(124, 58, 237, 0.3);
  font-size: 1.2rem;
  padding: 16px 48px;
  width: 100%;
}

button.button.primary:hover,
.button.primary:hover {
  background: var(--purple-accent);
  box-shadow: 0 4px 30px rgba(168, 85, 247, 0.4);
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
  color: var(--purple-soft);
  border: 1px solid var(--card-border);
  font-size: 0.95rem;
  padding: 10px 20px;
}

.button.secondary:hover {
  border-color: var(--purple-accent);
  color: var(--purple-bright);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .card {
    padding: 36px 24px 32px;
    border-radius: 18px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .cats {
    gap: 4px;
  }

  .cat {
    width: 65px;
    height: 95px;
    transform: scale(0.85);
  }

  a.button.primary {
    padding: 14px 36px;
    font-size: 1.1rem;
  }
}
