/* RSVP layer: "Will you join us?" card with wax seal, sun and flying letter. */

.rsvp {
  --paper: #f6eddd;
  --paper-deep: #eadcc2;
  --ink: #2a2118;
  --ink-soft: rgba(42, 33, 24, .64);
  --gold: #b8893f;
  --gold-soft: #dec18a;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(5, 5, 7, .58);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  opacity: 0;
  transition: opacity .45s ease;
  -webkit-font-smoothing: antialiased;
}
.rsvp[hidden] { display: none; }
.rsvp.is-visible { opacity: 1; }
.rsvp *, .rsvp *::before, .rsvp *::after { box-sizing: border-box; }

@media (min-height: 640px) { .rsvp { place-items: center; } }

.rsvp-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 40px 28px 30px;
  border-radius: 3px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 252, 244, .9), transparent 60%),
    radial-gradient(90% 70% at 50% 110%, rgba(214, 190, 150, .35), transparent 70%),
    var(--paper);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(184, 137, 63, .25) inset,
    0 0 0 7px var(--paper) inset,
    0 0 0 8px rgba(184, 137, 63, .35) inset;
  text-align: center;
  transform: translateY(36px);
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}
.rsvp.is-visible .rsvp-card { transform: none; }

.rsvp-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.rsvp-close:hover, .rsvp-close:focus-visible { color: var(--ink); }

.rsvp-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
}
.rsvp-title {
  margin: 0 0 6px;
  font-size: 36px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
}
.rsvp-lead {
  margin: 0 auto 24px;
  max-width: 30ch;
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.rsvp-rule {
  width: 56px;
  height: 1px;
  margin: 0 auto 22px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.rsvp-step { animation: rsvp-in .5s ease both; }
.rsvp-step[hidden] { display: none; }
@keyframes rsvp-in { from { opacity: 0; transform: translateY(8px); } }

.rsvp-choices { display: grid; gap: 10px; }
.rsvp-choice {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(184, 137, 63, .45);
  border-radius: 2px;
  background: rgba(255, 252, 244, .55);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: background .25s, border-color .25s, transform .25s;
}
.rsvp-choice:hover, .rsvp-choice:focus-visible {
  background: rgba(255, 252, 244, .95);
  border-color: var(--gold);
  outline: none;
  transform: translateY(-1px);
}
.rsvp-choice strong { font-size: 20px; font-weight: 500; }
.rsvp-choice span { font-size: 15px; font-style: italic; color: var(--ink-soft); }
.rsvp-choice--yes { border-color: var(--gold); background: rgba(222, 193, 138, .22); }

.rsvp-form { display: grid; gap: 14px; text-align: left; }
.rsvp-field { display: grid; gap: 5px; }
.rsvp-field[hidden] { display: none; }
.rsvp-field label {
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rsvp-field input, .rsvp-field select, .rsvp-field textarea {
  width: 100%;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid rgba(42, 33, 24, .3);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 19px;
}
.rsvp-field textarea { min-height: 84px; resize: vertical; line-height: 1.35; }
.rsvp-field input:focus, .rsvp-field select:focus, .rsvp-field textarea:focus {
  outline: none;
  border-bottom-color: var(--gold);
}
.rsvp-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.rsvp-actions { display: grid; gap: 10px; margin-top: 8px; text-align: center; }
.rsvp-submit, .rsvp-secondary {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 15px;
  letter-spacing: .24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.rsvp-submit:hover, .rsvp-submit:focus-visible { background: #4a3a28; outline: none; }
.rsvp-submit[disabled] { opacity: .6; cursor: progress; }
.rsvp-secondary { background: transparent; color: var(--ink); }
.rsvp-secondary:hover, .rsvp-secondary:focus-visible { background: rgba(42, 33, 24, .06); outline: none; }
.rsvp-back {
  justify-self: center;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font: inherit;
  font-size: 16px;
  font-style: italic;
  cursor: pointer;
}
.rsvp-back:hover, .rsvp-back:focus-visible { color: var(--ink); outline: none; }
.rsvp-error { margin: 0; color: #8a2f1d; font-size: 16px; text-align: center; }
.rsvp-error:empty { display: none; }

/* Success visuals */
.rsvp-visual { position: relative; height: 132px; margin: 0 auto 18px; display: grid; place-items: center; }

.rsvp-seal {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 49% 51% 47% 53% / 52% 47% 53% 48%;
  background: radial-gradient(circle at 34% 28%, #f0d9a4 0, #c99b4c 38%, #97702f 72%, #6f5020 100%);
  box-shadow:
    0 6px 14px rgba(60, 40, 10, .35),
    inset 0 -6px 12px rgba(70, 45, 10, .45),
    inset 0 5px 10px rgba(255, 240, 200, .45);
  animation: rsvp-stamp .9s cubic-bezier(.3, 1.4, .5, 1) both;
}
.rsvp-seal::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 238, 196, .55);
  box-shadow: inset 0 0 0 1px rgba(90, 60, 20, .35);
}
.rsvp-seal span {
  font-size: 30px;
  font-weight: 500;
  letter-spacing: .06em;
  color: rgba(84, 56, 18, .9);
  text-shadow: 0 1px 0 rgba(255, 238, 196, .6), 0 -1px 0 rgba(60, 40, 10, .4);
}
@keyframes rsvp-stamp {
  0% { opacity: 0; transform: scale(2.3) rotate(-24deg); }
  55% { opacity: 1; transform: scale(.9) rotate(-5deg); }
  75% { transform: scale(1.04) rotate(-7deg); }
  100% { opacity: 1; transform: scale(1) rotate(-6deg); }
}
.rsvp-card.is-stamped { animation: rsvp-thud .35s ease .5s; }
@keyframes rsvp-thud { 40% { transform: translateY(3px) scale(.995); } }

.rsvp-sun {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4d6 0, #f1cf86 45%, #dca957 100%);
  box-shadow: 0 0 40px 14px rgba(241, 207, 134, .55), 0 0 90px 30px rgba(241, 207, 134, .25);
  animation: rsvp-rise 1.4s cubic-bezier(.2, .8, .2, 1) both, rsvp-glow 3.2s ease-in-out 1.4s infinite;
}
@keyframes rsvp-rise { from { opacity: 0; transform: translateY(40px) scale(.7); } }
@keyframes rsvp-glow { 50% { box-shadow: 0 0 52px 20px rgba(241, 207, 134, .7), 0 0 110px 40px rgba(241, 207, 134, .3); } }

.rsvp-letter {
  width: 96px;
  height: 64px;
  position: relative;
  background: linear-gradient(160deg, #fffaf0, #eadcc2);
  border: 1px solid rgba(184, 137, 63, .5);
  box-shadow: 0 8px 18px rgba(60, 40, 10, .2);
  animation: rsvp-fly 2.2s cubic-bezier(.5, 0, .3, 1) both;
}
.rsvp-letter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, transparent 49%, rgba(184, 137, 63, .45) 50%, transparent 51%),
              linear-gradient(to bottom left, transparent 49%, rgba(184, 137, 63, .45) 50%, transparent 51%);
  background-size: 50% 100%;
  background-position: left, right;
  background-repeat: no-repeat;
}
@keyframes rsvp-fly {
  0% { opacity: 0; transform: scale(.6); }
  20% { opacity: 1; transform: scale(1); }
  45% { transform: translate(0, -6px) rotate(-3deg); }
  100% { opacity: 0; transform: translate(150px, -170px) rotate(22deg) scale(.25); }
}
.rsvp-visual .rsvp-wish {
  position: absolute;
  font-size: 22px;
  font-style: italic;
  color: var(--gold);
  opacity: 0;
  animation: rsvp-wish-in .8s ease 1.8s both;
}
@keyframes rsvp-wish-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.rsvp-done-title { margin: 0 0 10px; font-size: 30px; font-weight: 400; font-style: italic; line-height: 1.1; }
.rsvp-done-text { margin: 0 auto 22px; max-width: 30ch; font-size: 18px; line-height: 1.45; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  .rsvp, .rsvp-card, .rsvp-step, .rsvp-seal, .rsvp-sun, .rsvp-letter, .rsvp-card.is-stamped, .rsvp-visual .rsvp-wish {
    animation: none !important;
    transition: none !important;
  }
  .rsvp-visual .rsvp-wish { opacity: 1; }
  .rsvp-letter { opacity: 1; }
}
