:root {
  /* Fall pumpkin palette, matched to the event decor */
  --cream: #fbf4e7;
  --cream-deep: #f3e6cf;
  --sage: #8a9a6b;
  --sage-dark: #5f7048;
  --sage-pale: #e3e9d7;
  --pumpkin: #d9822b;
  --pumpkin-dark: #b5651d;
  --gold: #c99a3d;
  --maple-red: #b8452c;
  --rust: #9c5128;
  --white: #fffdf8;
  --text: #4a3c2c;
  --muted: #8c7d68;
  --border: #e9dcc3;
  --shadow: rgba(94, 66, 21, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--text);
  font-family: "Nunito", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(217, 130, 43, 0.16), transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(138, 154, 107, 0.22), transparent 45%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
  background-attachment: fixed;
}

/* --- Maple leaf colors (the #maple-leaf symbol fills with currentColor) --- */
.maple-red { color: var(--maple-red); }
.maple-orange { color: var(--pumpkin); }
.maple-gold { color: var(--gold); }
.maple-rust { color: var(--rust); }

/* --- Falling leaves behind the card --- */
.falling-leaves {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.falling-leaves svg {
  position: absolute;
  top: -40px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  opacity: 0.75;
  animation: leaf-fall var(--d) linear infinite;
  animation-delay: var(--delay);
}

@keyframes leaf-fall {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(28px, 27vh) rotate(90deg); }
  50% { transform: translate(-18px, 54vh) rotate(180deg); }
  75% { transform: translate(24px, 81vh) rotate(270deg); }
  100% { transform: translate(-8px, calc(100vh + 80px)) rotate(360deg); }
}

/* --- Corner leaf clusters --- */
.card > :not(.corner) {
  position: relative;
  z-index: 1;
}

.corner {
  position: absolute;
  width: 96px;
  height: 96px;
  pointer-events: none;
  z-index: 0;
}

.corner svg {
  position: absolute;
  opacity: 0.9;
}

.corner-top {
  top: -14px;
  right: -14px;
}

.corner-bottom {
  bottom: -14px;
  left: -14px;
  transform: rotate(180deg);
}

.corner svg:nth-child(1) { width: 66px; height: 66px; top: 0; right: 0; transform: rotate(-25deg); }
.corner svg:nth-child(2) { width: 44px; height: 44px; top: 50px; right: 6px; transform: rotate(35deg); }
.corner svg:nth-child(3) { width: 40px; height: 40px; top: 4px; right: 56px; transform: rotate(-70deg); }

.card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 600px;
  background: var(--white);
  border-radius: 28px;
  padding: 48px 40px 40px;
  box-shadow: 0 24px 60px var(--shadow), 0 2px 0 var(--gold);
  overflow: hidden;
  animation: rise 0.6s ease-out;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--sage), var(--gold), var(--pumpkin));
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Decorative garland --- */
.garland {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 18px;
}

.garland svg {
  width: 26px;
  height: 26px;
  animation: sway 4s ease-in-out infinite;
}

.garland svg:nth-child(2) {
  animation-delay: 0.4s;
}

.garland svg:nth-child(3) {
  width: 36px;
  height: 36px;
  animation-delay: 0.8s;
}

.garland svg:nth-child(4) {
  animation-delay: 1.2s;
}

.garland svg:nth-child(5) {
  animation-delay: 1.6s;
}

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

/* --- Header --- */
header {
  text-align: center;
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0;
  font-family: "Caveat", cursive;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--sage-dark);
}

h1 {
  margin: 4px 0 10px;
  font-family: "Fraunces", "Georgia", serif;
  font-optical-sizing: auto;
  font-size: clamp(2.1rem, 6vw, 2.9rem);
  font-weight: 600;
  line-height: 1.15;
  background: linear-gradient(100deg, var(--pumpkin-dark), var(--gold) 55%, var(--sage-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.honoree {
  margin: 0 0 18px;
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 600;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--border),
    var(--border) 8px,
    transparent 8px,
    transparent 14px
  );
}

.divider svg {
  width: 22px;
  height: 22px;
}

/* --- Details --- */
.details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.detail {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--sage-pale);
  border-radius: 14px;
}

.detail .icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(95, 112, 72, 0.18);
}

.detail .icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--sage-dark);
}

.detail-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--sage-dark);
  font-weight: 700;
}

.value {
  font-size: 1rem;
  line-height: 1.4;
}

.value a {
  color: inherit;
  text-decoration-color: var(--sage-dark);
  text-underline-offset: 2px;
}

/* --- RSVP --- */
.rsvp h2 {
  text-align: center;
  /* Nunito rather than Fraunces: Fraunces' "J" swoops below the baseline */
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  color: var(--pumpkin-dark);
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.rsvp .sub {
  text-align: center;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.optional {
  color: var(--muted);
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--cream);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--pumpkin);
  box-shadow: 0 0 0 3px rgba(217, 130, 43, 0.18);
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

legend {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0 0 6px;
}

.pill-group {
  display: flex;
  gap: 10px;
}

.pill-group .inline {
  flex: 1;
}

.pill-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-group .pill {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
  background: var(--cream);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-group input[type="radio"]:checked + .pill {
  background: var(--sage);
  border-color: var(--sage-dark);
  color: var(--white);
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

button[type="submit"] {
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(100deg, var(--pumpkin), var(--pumpkin-dark));
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: "Nunito", sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(181, 101, 29, 0.32);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(181, 101, 29, 0.4);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status {
  min-height: 1.2em;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.status.success {
  color: var(--sage-dark);
}

.status.error {
  color: var(--pumpkin-dark);
}

footer.note {
  text-align: center;
  margin-top: 28px;
  color: var(--muted);
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
}

@media (max-width: 420px) {
  .card {
    padding: 36px 22px 28px;
    border-radius: 22px;
  }

  .pill-group {
    flex-direction: column;
  }

  /* Shrink about the center, then shift out so the clusters keep hugging the corners */
  .corner {
    scale: 0.75;
  }

  .corner-top {
    top: -26px;
    right: -26px;
  }

  .corner-bottom {
    bottom: -26px;
    left: -26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .falling-leaves {
    display: none;
  }

  .garland svg,
  .card {
    animation: none;
  }
}
