/* The reply: the engagement photo on one side, a paper card with the form on the other. */
#rsvp { padding: 0; background: #F6F1E6; }
.rs3 { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100svh - 56px); }
.rs3-ph { margin: 0; position: relative; overflow: hidden; }
.rs3-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.rs3-card {
  display: grid; place-items: center; padding: clamp(28px, 5vw, 72px) clamp(20px, 4vw, 64px);
  background: radial-gradient(120% 80% at 80% 0%, #FBF7EE, transparent 60%), radial-gradient(90% 70% at 0% 100%, #EFE6D2, transparent 70%), #F6F1E6;
}
/* the card: a double gold rule, a small diamond ornament on top */
.rs3-in { width: min(470px, 100%); position: relative; text-align: center; padding: clamp(30px, 4vw, 48px) clamp(22px, 3.4vw, 44px); border: 1px solid #C8AC6C; outline: 1px solid #C8AC6C; outline-offset: -9px; background: #FCF9F2; }
.rs3-orn { width: 132px; height: 14px; margin: 0 auto 16px; position: relative; background: linear-gradient(#B8913F, #B8913F) 0 50% / 50px 1px no-repeat, linear-gradient(#B8913F, #B8913F) 100% 50% / 50px 1px no-repeat; }
.rs3-orn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border: 1px solid #B8913F; transform: translate(-50%, -50%) rotate(45deg); box-shadow: 0 0 0 3px #FCF9F2, 0 0 0 4px #D9C28E; }
.rs3 h2 { font: 500 clamp(2.3rem, 3.6vw, 3.2rem)/1.05 "Cormorant Garamond", serif; color: var(--ink); margin: 0; }
.rs3-by { font: 500 .78rem/1.4 "Jost", sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #9A7A36; margin: 10px 0 0; }
@media (max-width: 820px) {
  .rs3 { grid-template-columns: 1fr; min-height: 0; }
  .rs3-ph { height: 56svh; }
  .rs3-card { padding: 22px 14px 40px; }
  .rs3-in { padding: 30px 20px; }
}

/* ---------- the form ---------- */
label, legend { font: 500 .9rem/1.2 "Jost", sans-serif; display: grid; gap: 7px; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type=text], textarea { width: 100%; }
.rs3-f { margin-top: 30px; display: grid; gap: 28px; text-align: left; }
.rs3-f label > span, .rs3-count > span, .rs3-ev legend { font: 500 .74rem/1.2 "Jost", sans-serif; letter-spacing: .15em; text-transform: uppercase; color: #7C6A44; }
/* names are written on a line, like a card filled in by hand */
.rs3-name { gap: 4px; }
#rsvp .rs3-name input, #rsvp .rs3-guest input { font: 500 1.4rem/1.3 "Cormorant Garamond", serif; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid #BFA978; border-radius: 0; padding: 6px 0 8px; }
#rsvp .rs3-name input::placeholder, #rsvp .rs3-guest input::placeholder { color: #A99B7E; font-style: italic; font-size: 1.15rem; }
#rsvp .rs3-name input:focus, #rsvp .rs3-guest input:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }

/* how many: − 1 + */
.rs3-count { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rs3-step { display: flex; align-items: center; gap: 6px; }
.rs3-step button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #BFA978; background: transparent; color: var(--ink); font: 400 1.3rem/1 "Jost", sans-serif; cursor: pointer; }
.rs3-step button:hover { background: #F1E8D4; }
.rs3-step button:focus-visible { outline: 2px solid #B8913F; outline-offset: 2px; }
.rs3-step output { font: 500 2rem/1 "Cormorant Garamond", serif; font-variant-numeric: lining-nums; min-width: 2.2ch; text-align: center; color: var(--ink); }

/* a name box for each extra guest (js/rsvp.js) */
.rs3-party { display: grid; gap: 20px; margin-top: -8px; }
.rs3-party:empty { display: none; }
.rs3-guest, .rs3-note { display: grid; gap: 4px; }
.rs3-guest { animation: rs3in .35s ease both; }
@keyframes rs3in { from { opacity: 0; transform: translateY(-6px); } }

/* which celebrations: round checkmarks in each event's colour (--g) */
.rs3-ev ul { list-style: none; margin: 8px 0 0; padding: 0; }
.rs3-ev li + li { border-top: 1px dotted #D3C39E; }
.rs3-ev label { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 14px; padding: 11px 2px; cursor: pointer; font: inherit; }
.rs3-ev input { position: absolute; opacity: 0; }
.rs3-ev i { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--g); position: relative; transition: background .15s; }
.rs3-ev input:checked + i { background: var(--g); }
.rs3-ev input:checked + i::after { content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rs3-ev input:focus-visible + i { outline: 2px solid #B8913F; outline-offset: 3px; }
.rs3-ev b { font: 500 1.3rem/1.1 "Cormorant Garamond", serif; color: var(--ink); }
.rs3-ev label > span { font: 400 .85rem/1 "Jost", sans-serif; color: #7C7262; }
.rs3-ev input:not(:checked) ~ b, .rs3-ev input:not(:checked) ~ span { opacity: .5; }

/* the optional note */
.rs3-note em { font-style: normal; letter-spacing: .08em; text-transform: none; color: #A99B7E; margin-left: 6px; }
#rsvp .rs3-note textarea { font: 500 1.15rem/1.4 "Cormorant Garamond", serif; color: var(--ink); background: #FFFDF7; border: 1px solid #BFA97880; border-radius: 2px; padding: 10px 12px; margin-top: 6px; min-height: 76px; resize: vertical; }
#rsvp .rs3-note textarea::placeholder { color: #A99B7E; font-style: italic; }
#rsvp .rs3-note textarea:focus { outline: none; border-color: var(--ink); }

/* spam trap: people never see it, bots fill it in */
.rs3-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.rs3-go { width: 100%; }
.rs3 .ok { font: 400 .9rem/1.4 "Jost", sans-serif; color: var(--soft); margin: 0; }

/* ---------- sending: the card's contents fade, the paper folds into a plane and flies off (js/paper-plane.js) ---------- */
.rs3-in > * { transition: opacity .35s; }
.rs3-in.rs3-gone > :not(.rs3-done) { opacity: 0; pointer-events: none; }
.rs3-in { transition: background-color .3s, border-color .3s, outline-color .3s; }
.rs3-in.rs3-fold { background-color: transparent; border-color: transparent; outline-color: transparent; }   /* the paper has taken the card's place */
.rs3-sky { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 300; pointer-events: none; overflow: visible; transition: opacity .8s; }
.rs3-sky.fade { opacity: 0 !important; }
.rs3-sky polygon { filter: drop-shadow(0 4px 6px #5a4a2a40); }
.rs3-trail { fill: none; stroke: #B8975A; stroke-width: 2; stroke-dasharray: 3 7; stroke-linecap: round; opacity: .75; }
.rs3-ink text { font: italic 500 19px "Cormorant Garamond", serif; fill: #26402F; }
.rs3-ink path { stroke: #C8AC6C; stroke-width: 1.4; stroke-linecap: round; }
.rs3-seal { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .3s, transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.rs3-sky.sealed .rs3-seal { opacity: 1; transform: none; }
.rs3-seal circle { fill: #8E2A2A; stroke: #6E1E1E; }
.rs3-seal text { font: 600 8px "Cormorant Garamond", serif; fill: #F3D9A6; font-style: normal; }

/* landed: the card comes back as a thank-you note */
.rs3-done { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; padding: 40px 28px; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity .7s, transform .7s; }
.rs3-done.on { opacity: 1; transform: none; }
.rs3-done p { margin: 0 auto; max-width: 32ch; font: 400 1.02rem/1.55 "Jost", sans-serif; color: var(--soft); }
.rs3-again { justify-self: center; background: none; border: 0; border-bottom: 1px solid #C8AC6C; padding: 4px 0; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; }
#rsvp .rs3-in.rs3-landed > :not(.rs3-done) { display: none; }
.rs3-in.rs3-landed .rs3-done { position: static; padding: 36px 8px 28px; }
