/* ============ Palette (from poster) ============ */
:root {
  --cream: #f4ecd8;
  --cream-soft: #faf5e9;
  --rose: #c9738f;
  --rose-deep: #b85c7e;
  --rose-light: #e7b7c8;
  --sage: #8ba888;
  --sage-deep: #6f8f6d;
  --brown: #6b4f3a;
  --brown-soft: #8a6d54;
  --amber: #edb04a;
  --amber-deep: #d9963a;
  --shadow: rgba(107, 79, 58, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--brown);
  background:
    radial-gradient(circle at 12% 18%, rgba(199,115,143,0.08) 0 12px, transparent 13px) 0 0 / 46px 46px,
    linear-gradient(135deg, #efe6cf 0%, #f4ecd8 45%, #eee3ce 100%);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  padding: clamp(12px, 4vw, 40px) 12px;
}

/* ============ Language toggle ============ */
.lang-switch {
  position: relative;
  z-index: 10; /* above the floaties so it stays clickable */
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  width: fit-content;
  margin: 0 0 12px auto;
  padding: 4px;
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid #fff;
  border-radius: 40px;
  box-shadow: 0 8px 20px -10px var(--shadow);
  backdrop-filter: blur(6px);
}
@media (min-width: 700px) {
  /* line up with the card's right edge on wider screens */
  .lang-switch { margin-right: calc((100% - 640px) / 2); }
}
.lang-switch button {
  font-family: "Fredoka", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
  font-size: .9rem;
  color: var(--brown-soft);
  background: transparent;
  border: none;
  border-radius: 40px;
  padding: 7px 14px;
  min-width: 44px;
  cursor: pointer;
  transition: background .2s, color .2s, transform .15s;
}
.lang-switch button:hover { color: var(--rose-deep); transform: translateY(-1px); }
.lang-switch button[aria-pressed="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  box-shadow: 0 6px 14px -6px rgba(184,92,126,0.6);
}
.lang-switch button:focus-visible { outline: 3px solid var(--rose-light); outline-offset: 2px; }

/* Chinese: Fredoka / Nunito have no CJK glyphs, so fall back to good system fonts */
:lang(zh) body,
:lang(zh) .kicker, :lang(zh) .subtitle, :lang(zh) .banner, :lang(zh) .detail-label,
:lang(zh) .detail-big, :lang(zh) .address, :lang(zh) .venue-badge, :lang(zh) .rsvp-title,
:lang(zh) .field-label, :lang(zh) .choice-pill, :lang(zh) .submit-btn, :lang(zh) .thank-you h3,
:lang(zh) input[type="text"] {
  font-family: "Fredoka", "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
:lang(zh) .kicker { letter-spacing: .2em; }

/* ============ Floating decorations ============ */
.floaties {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6; /* in front of the card so they're always visible, behind confetti */
  overflow: hidden;
}
.floaties .layer { position: absolute; inset: 0; }
.floaties span {
  position: absolute;
  will-change: transform;
  user-select: none;
  filter: drop-shadow(0 3px 5px rgba(107, 79, 58, 0.2));
}

/* Balloons — rise from below to above the viewport */
.balloons span { font-size: 2.4rem; opacity: .8; animation: rise linear infinite; }
.balloons span:nth-child(1) { left: 5%;  animation-duration: 18s; animation-delay: -2s;  }
.balloons span:nth-child(2) { left: 21%; animation-duration: 22s; animation-delay: -9s;  font-size: 2rem;   }
.balloons span:nth-child(3) { left: 40%; animation-duration: 16s; animation-delay: -5s;  font-size: 2.8rem; }
.balloons span:nth-child(4) { left: 61%; animation-duration: 24s; animation-delay: -14s; font-size: 2.1rem; }
.balloons span:nth-child(5) { left: 80%; animation-duration: 19s; animation-delay: -7s;  font-size: 2.6rem; }
.balloons span:nth-child(6) { left: 92%; animation-duration: 21s; animation-delay: -12s; font-size: 2rem;   }

/* Leaves — drift down */
.leaves span { font-size: 1.6rem; opacity: .7; animation: fall linear infinite; }
.leaves span:nth-child(1) { left: 10%; animation-duration: 14s; animation-delay: -3s;  }
.leaves span:nth-child(2) { left: 26%; animation-duration: 18s; animation-delay: -8s;  font-size: 1.3rem; }
.leaves span:nth-child(3) { left: 44%; animation-duration: 12s; animation-delay: -1s;  font-size: 1.9rem; }
.leaves span:nth-child(4) { left: 60%; animation-duration: 16s; animation-delay: -6s;  }
.leaves span:nth-child(5) { left: 78%; animation-duration: 20s; animation-delay: -11s; font-size: 1.4rem; }
.leaves span:nth-child(6) { left: 90%; animation-duration: 15s; animation-delay: -4s;  font-size: 1.8rem; }

/* Party & park friends — bob gently near the edges */
.critters span { font-size: 2rem; opacity: .6; animation: bob ease-in-out infinite; }
.critters span:nth-child(1) { left: 3%;  top: 30%; animation-duration: 3.6s; animation-delay: -.2s;  }
.critters span:nth-child(2) { left: 92%; top: 22%; animation-duration: 4.4s; animation-delay: -1.1s; }
.critters span:nth-child(3) { left: 5%;  top: 62%; animation-duration: 4s;   animation-delay: -.7s;  }
.critters span:nth-child(4) { left: 90%; top: 58%; animation-duration: 3.8s; animation-delay: -1.6s; }
.critters span:nth-child(5) { left: 4%;  top: 84%; animation-duration: 4.6s; animation-delay: -.4s;  }
.critters span:nth-child(6) { left: 93%; top: 80%; animation-duration: 3.4s; animation-delay: -2s;   }

@keyframes rise {
  from { transform: translateY(110vh) rotate(-8deg); }
  to   { transform: translateY(-20vh) rotate(8deg); }
}
@keyframes fall {
  0%   { transform: translateY(-15vh) translateX(0) rotate(0); }
  100% { transform: translateY(115vh) translateX(40px) rotate(320deg); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-14px) rotate(4deg); }
}

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

/* ============ Card ============ */
.card {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  background: var(--cream-soft);
  border-radius: 34px;
  padding: clamp(26px, 6vw, 52px) clamp(18px, 5vw, 44px) clamp(24px, 5vw, 40px);
  box-shadow: 0 24px 60px -18px var(--shadow), 0 0 0 8px rgba(255,255,255,0.5);
  border: 3px solid #fff;
  overflow: hidden;
}

/* ============ Bunting ============ */
.bunting {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin: -6px -6px 8px;
  padding: 0 4px;
}
.bunting span {
  flex: 1;
  height: 22px;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  animation: sway 3.5s ease-in-out infinite;
}
.bunting span:nth-child(5n+1){ background: var(--rose); }
.bunting span:nth-child(5n+2){ background: var(--sage); }
.bunting span:nth-child(5n+3){ background: var(--rose-light); }
.bunting span:nth-child(5n+4){ background: var(--brown-soft); }
.bunting span:nth-child(5n+5){ background: var(--sage-deep); }
.bunting span:nth-child(odd){ animation-delay: .4s; }
@keyframes sway {
  0%,100% { transform: rotate(-3deg); }
  50%     { transform: rotate(3deg); }
}

/* ============ Hero ============ */
.hero { text-align: center; margin-top: 6px; }
.kicker {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: clamp(.72rem, 2.6vw, .95rem);
  color: var(--sage-deep);
}
.name {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: clamp(3.4rem, 15vw, 6rem);
  line-height: .95;
  color: var(--rose);
  text-shadow: 0 3px 0 #fff, 0 6px 14px rgba(184,92,126,0.28);
  margin: 2px 0 6px;
}
.subtitle {
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  font-size: clamp(1rem, 4vw, 1.4rem);
  color: var(--brown);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.subtitle .rule { display: inline-block; width: clamp(20px, 8vw, 44px); height: 3px; border-radius: 3px; background: var(--sage); }

/* ============ Photo ============ */
.photo-frame {
  position: relative;
  width: clamp(200px, 62vw, 320px);
  aspect-ratio: 1;
  margin: clamp(20px, 5vw, 32px) auto 6px;
}
.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 8px solid #fff;
  box-shadow: 0 14px 34px -10px var(--shadow);
}
.photo-frame::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 3px dashed var(--rose-light);
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.photo-emoji {
  position: absolute;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
  animation: bob 4s ease-in-out infinite;
}
.photo-emoji.gift  { top: -6px; left: -6px; }
.photo-emoji.party { top: 4px; right: -8px; animation-delay: .6s; }
.photo-emoji.bear  { bottom: 2px; left: -10px; animation-delay: 1.1s; }
.photo-emoji.deer  { bottom: -6px; right: 0; animation-delay: 1.6s; }
.photo-emoji.castle{ bottom: 22%; right: -18px; animation-delay: 2.1s; }

/* ============ Banner ============ */
.banner {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-deep) 100%);
  font-size: clamp(1.1rem, 4.6vw, 1.6rem);
  padding: 14px 20px;
  border-radius: 40px;
  margin: clamp(22px, 5vw, 32px) auto;
  max-width: 520px;
  box-shadow: 0 10px 24px -8px rgba(184,92,126,0.5);
}

/* ============ Details ============ */
.details {
  background: var(--cream);
  border-radius: 24px;
  padding: clamp(20px, 5vw, 30px);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7);
}
.detail-row { display: flex; align-items: stretch; gap: 12px; }
.detail { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.detail-label {
  font-family: "Fredoka", sans-serif;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .8rem;
  color: var(--sage-deep);
  font-weight: 600;
}
.detail-big {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 5.2vw, 1.8rem);
  color: var(--brown);
  white-space: nowrap;
}
.detail-sub { font-size: 1rem; color: var(--brown-soft); font-weight: 600; }
.detail-note { font-style: italic; color: var(--rose); font-size: .9rem; }
.divider { width: 2px; background: repeating-linear-gradient(var(--rose-light) 0 6px, transparent 6px 12px); }

.dashed {
  height: 0;
  border-top: 2px dashed var(--rose-light);
  margin: clamp(16px, 4vw, 22px) 0;
}
.detail-where { text-align: center; }
.address {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 4.6vw, 1.4rem);
  color: var(--brown);
  text-decoration: none;
  border-bottom: 2px dotted var(--rose);
  transition: color .2s;
}
.address:hover { color: var(--rose); }
.venue-badge {
  display: inline-block;
  margin-top: 12px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  letter-spacing: .04em;
  font-size: clamp(.9rem, 3.4vw, 1.05rem);
  color: #fff;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  padding: 8px 22px;
  border-radius: 40px;
  box-shadow: 0 8px 18px -8px rgba(217,150,58,0.8);
}

.blurb { margin-top: 12px; color: var(--brown-soft); font-size: clamp(.95rem, 3.6vw, 1.05rem); }

/* ============ RSVP ============ */
.rsvp {
  margin-top: clamp(26px, 6vw, 38px);
  text-align: center;
}
.rsvp-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: var(--rose-deep);
  font-size: clamp(1.3rem, 5.4vw, 1.7rem);
  margin-bottom: 18px;
}
.field { display: block; text-align: left; margin: 0 auto 18px; max-width: 420px; border: none; }
.field-label {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 8px;
  font-size: 1rem;
}
input[type="text"] {
  width: 100%;
  font-family: "Nunito", sans-serif;
  font-size: 1.05rem;
  padding: 14px 16px;
  border: 2px solid var(--rose-light);
  border-radius: 16px;
  background: #fff;
  color: var(--brown);
  transition: border-color .2s, box-shadow .2s;
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(199,115,143,0.18);
}

.choices { display: flex; gap: 12px; flex-wrap: wrap; }
.choice { flex: 1; min-width: 150px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-pill {
  display: block;
  text-align: center;
  padding: 14px 12px;
  border-radius: 16px;
  border: 2px solid var(--rose-light);
  background: #fff;
  font-family: "Fredoka", sans-serif;
  font-weight: 500;
  color: var(--brown);
  transition: transform .15s, border-color .2s, background .2s, color .2s;
}
.choice:hover .choice-pill { transform: translateY(-2px); }
.choice input:checked + .choice-pill {
  background: var(--rose);
  border-color: var(--rose-deep);
  color: #fff;
  box-shadow: 0 8px 18px -6px rgba(184,92,126,0.55);
}
.choice input:focus-visible + .choice-pill { box-shadow: 0 0 0 4px rgba(199,115,143,0.3); }

.submit-btn {
  margin-top: 8px;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  border: none;
  border-radius: 40px;
  padding: 15px 42px;
  cursor: pointer;
  box-shadow: 0 10px 22px -8px rgba(111,143,109,0.7);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.submit-btn:hover { transform: translateY(-2px) scale(1.02); }
.submit-btn:active { transform: translateY(0) scale(.99); }
.submit-btn:disabled { opacity: .6; cursor: default; transform: none; }

.form-error { color: var(--rose-deep); font-weight: 700; margin-top: 12px; min-height: 1em; }

.hidden-field { position: absolute; left: -9999px; }

/* ============ Thank you ============ */
.thank-you { padding: 20px 10px; animation: pop .5s ease; }
.thank-you-emoji { font-size: 3.5rem; animation: bob 3s ease-in-out infinite; }
.thank-you h3 {
  font-family: "Fredoka", sans-serif;
  color: var(--rose);
  font-size: 2rem;
  margin: 6px 0;
}
.thank-you p { color: var(--brown-soft); font-size: 1.1rem; }
@keyframes pop {
  0% { transform: scale(.85); opacity: 0; }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

/* ============ Footer ============ */
.foot { text-align: center; margin-top: 26px; font-size: 1.5rem; letter-spacing: 8px; }

/* ============ Scroll reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* ============ Reduced motion ============ */
/* Keep a gentle, slower float for everyone — soften rather than kill. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .balloons span { animation-duration: 40s !important; }
  .leaves span   { animation-duration: 38s !important; }
  .critters span { animation-duration: 7s !important; }
  .photo-frame::before { animation: none; }  /* stop the spinning ring */
  .bunting span { animation: none; }          /* stop the swaying bunting */
  .reveal { transform: none; }                /* fade in only, no upward slide */
}
