/* Ink reply · washed paper (core/rsvp/027) — INV-05 v2.2 · Luxe W2a.1 (A1800; owner 2026-10-23: the reply card "is very
   plain as well, make it premium looking by adding some texture and a branch"). rs005 on ev010's paper: the sage
   watercolour wash under the grain, torn top and bottom edges with the shadow following the tear, a fine gold hairline
   inside, and a pressed eucalyptus sprig on the top-left corner (st004's, mirrored) across from the sage sprig. The
   form, the wet-ink live layer, Send and WhatsApp were rs005's. Release A1844 (owner 2026-10-24, "keep the look, add
   saving"): the form is now rs015's saving card (the reply core, a count per event, "Change your reply", the honest
   status line, "Send"); it shows and saves with reduced motion too (D-098); only no-JS gets the plain WhatsApp button,
   so the older lines below that say "nothing is stored" / "reduced motion" are rs004's history. Below: rs005's header.
/* Ink reply (core/rsvp/004) — sage_light_rest w1 (INV-05, D-031, D-032 ruling C, A1319). A cotton reply card: the
   guest writes their name, circles "Joyfully accepts" or "Regretfully declines", picks how many are coming and may add
   a note. "Send reply" opens WhatsApp with the reply written out, as rs003; nothing is stored. Without JavaScript or
   with reduced motion the card shows the plain WhatsApp button instead. A still watercolour sage sprig is tucked
   behind the card's lower corner (ruling A: it never moves).
   CSS version: when the guest stops typing, their name appears on the signature line in Pinyon (a fade, never a
   wipe), and a drawn ink ellipse goes round the chosen answer (stroke-dashoffset, 420 ms).
   live.js (WebGL, replace): the name soaks into the paper as wet ink and dries lighter; the answer circle is a
   photographed pen loop drawn the way the pen went; pressing the card paper dents it.
   v2 "laid down" (core/rsvp/005, inv05_v2 w2, A1338): a lift shadow behind the card (.rs027__lift) fades out as
   the card settles; the wrap is isolated so the shadow sits under the card and the sprig. */
.rs027 { --rs027-eh: 30px; position: relative; padding: var(--k-section-pad) var(--k-gutter); background: var(--k-light-ground); color: var(--k-ink); text-align: center; touch-action: pan-y; }
.rs027__inner { max-width: var(--k-measure); margin: 0 auto; }
.rs027__by { margin-top: 18px; font: 400 1.0625rem/1.55 var(--k-font-body); color: var(--k-ink-soft); }
.rs027__by b { font-weight: 500; color: var(--k-ink); }

/* the card, with the sprig tucked behind its lower right corner */
.rs027__wrap { position: relative; isolation: isolate; max-width: 560px; margin: 84px auto 0; } /* W2a.1: room above for the sprig (≥ 24 px from the date) */
/* v2 (D-034): the card's lift shadow, behind the card's box (the card is the wrap's only in-flow child and has no
   margin, so inset 0 is the card's box). At rest it is gone; section.js fades it from 1 to 0 as the card settles. */
.rs027__lift { position: absolute; inset: var(--rs027-eh) 0; z-index: -1; box-shadow: 0 18px 36px rgb(74 63 53 / .22); opacity: 0; pointer-events: none; }
.rs027__sage {
  position: absolute; z-index: 0; right: 0; bottom: 0; width: clamp(132px, 38%, 212px); height: auto; pointer-events: none;
  transform: translate(8%, 58%) rotate(78deg); transform-origin: 50% 50%;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.rs027__card { position: relative; z-index: 1; padding: calc(46px + 22px + 18px) clamp(22px, 6.4vw, 56px) calc(38px + 22px); text-align: left; }
/* W2a.1: the card's paper is ev010's, a layer of its own under the stage and the form: the sage watercolour wash
   multiplied under the grain, torn top and bottom by mask (attached when near, AG-T053), the shadow following the tear
   (the filter sits on the unmasked parent only) */
.rs027__paper { position: absolute; inset: 0; z-index: 0; pointer-events: none; filter: drop-shadow(0 6px 10px rgb(74 63 53 / .16)) drop-shadow(0 -5px 12px rgb(74 63 53 / .10)); }
.rs027__sheet { position: absolute; inset: 0; background: var(--k-grain), var(--k-card); }
.rs027.is-near .rs027__sheet, .js.motion-reduce .rs027 .rs027__sheet, html:not(.js) .rs027 .rs027__sheet {
  background: var(--k-grain), url("assets/wash.webp") center / 100% 100% no-repeat, var(--k-card);
  background-blend-mode: normal, multiply, normal;
  -webkit-mask: url("assets/edge-top.webp") left top / auto var(--rs027-eh) repeat-x, linear-gradient(#000, #000) center / 100% calc(100% - 2 * var(--rs027-eh) + 2px) no-repeat, url("assets/edge-bot.webp") left bottom / auto var(--rs027-eh) repeat-x;
  -webkit-mask-composite: source-over;
  mask: url("assets/edge-top.webp") left top / auto var(--rs027-eh) repeat-x, linear-gradient(#000, #000) center / 100% calc(100% - 2 * var(--rs027-eh) + 2px) no-repeat, url("assets/edge-bot.webp") left bottom / auto var(--rs027-eh) repeat-x;
  mask-composite: add;
}
/* a pressed eucalyptus sprig on the card's top-left corner (st004's, mirrored), its shadow under it */
.rs027__euc { position: absolute; z-index: 2; top: -54px; left: -9px; width: clamp(130px, 34%, 180px); aspect-ratio: 600 / 327; pointer-events: none; }
.rs027__euc img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.rs027__euc-img { transform: scaleX(-1) rotate(16deg); }
.rs027__euc-shadow { transform: translate(4px, 7px) scaleX(-1) rotate(16deg); opacity: .75; }
/* a fine gold hairline inside the torn edges (W2a.1; the thread's foil #B4975F) */
.rs027__card::before { content: ""; position: absolute; z-index: 1; inset: calc(var(--rs027-eh) + 4px) 14px; border: 1px solid rgb(180 151 95 / .55); pointer-events: none; }
/* the stage stops above the Send button: the ink lives higher up, and a phone canvas under 250k px² draws at the
   full device dpr, so the signature stays as crisp as the DOM text beside it */
.rs027__stage { position: absolute; z-index: 0; inset: 0 0 130px 0; pointer-events: none; }
.rs027__card.is-sent .rs027__stage { bottom: 0; }

/* the form sits above the live stage: the ink is drawn on the paper, under the fields */
.rs027-form { position: relative; z-index: 1; display: grid; gap: 22px; }
.rs027-form[hidden], .rs027-field[hidden], .rs027__plain[hidden] { display: none; }
.rs027-field { display: block; }
.rs027-field__l { display: block; margin-bottom: 6px; padding: 0; font: 400 .6875rem/1.3 var(--k-font-display); letter-spacing: .22em; text-transform: uppercase; color: var(--c-secondary-dark); }
.rs027-field__l i { font-style: normal; letter-spacing: .04em; text-transform: none; color: var(--k-ink-soft); }
.rs027-input { display: block; width: 100%; padding: 6px 2px; border: 0; border-bottom: 1px solid rgb(var(--c-primary-rgb) / .45); border-radius: 0; background: transparent; font: 500 1.1875rem/1.4 var(--k-font-body); color: var(--k-ink); }
.rs027-input:focus { outline: none; border-bottom-color: var(--c-primary); box-shadow: 0 1px 0 var(--c-primary); }
.rs027-input--note { min-height: 84px; resize: vertical; }

/* the signature line: the name in Pinyon on a sage hairline (a mirror of the field, hidden from screen readers) */
.rs027-sig { margin: -2px 0 6px; }
.rs027-sig__name {
  --rs027-sfs: clamp(2.125rem, 9.4vw, 2.625rem);
  position: relative; height: calc(var(--rs027-sfs) * 1.22); border-bottom: 1px solid var(--k-line);
}
.rs027-sig__ink {
  position: absolute; left: .18em; bottom: -.5em; white-space: nowrap;
  font: 400 calc(var(--rs027-sfs) * var(--rs027-k, 1))/1.3 var(--k-font-script); color: var(--c-primary);
  opacity: 0; transition: opacity .6s ease-out;
}
.rs027-sig__ink.is-in { opacity: 1; }
.rs027-sig__ink.is-late { transition-delay: .15s; }
.rs027-sig__ink.is-out { opacity: 0; transition-duration: .15s; transition-delay: 0s; }
.rs027-sig__l { display: block; margin-top: 7px; font: 500 .625rem/1 var(--k-font-body); letter-spacing: .24em; text-transform: uppercase; color: var(--k-ink-soft); }

/* the answer: two phrases to circle; the chosen one gets an ink ellipse drawn the way a pen goes (from upper right) */
.rs027-choice { display: grid; justify-items: start; gap: 4px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rs027-choice > .rs027-field__l { margin-bottom: 4px; }
.rs027-opt { position: relative; display: inline-flex; align-items: center; min-height: 50px; padding: 8px 22px; margin-left: -8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rs027-opt input { position: absolute; left: 50%; top: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; }
.rs027-opt__t { font: 400 1.3125rem/1.3 var(--k-font-display); color: var(--k-ink); }
.rs027-opt input:focus-visible ~ .rs027-opt__t { outline: 2px solid var(--c-primary); outline-offset: 5px; }
.rs027-ring { position: absolute; left: -3px; top: -1px; width: calc(100% + 6px); height: calc(100% + 2px); overflow: visible; pointer-events: none; transition: opacity .15s linear; }
.rs027-ring__p {
  fill: none; stroke: rgb(var(--c-primary-rgb) / .85); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1 1; stroke-dashoffset: 1; transition: stroke-dashoffset .42s cubic-bezier(.45, 0, .3, 1);
  /* W2a.1: an unchosen ring's zero-length dash still drew a round-cap dot above each answer (eye r1): hidden, and
     only after the ring has drawn back */
  opacity: 0; transition: stroke-dashoffset .42s cubic-bezier(.45, 0, .3, 1), opacity 0s linear .42s;
}
.rs027-opt input:checked ~ .rs027-ring .rs027-ring__p { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset .42s cubic-bezier(.45, 0, .3, 1), opacity 0s; }

.rs027-send { justify-self: center; margin-top: 4px; }
.rs027-small { text-align: center; font: 400 .875rem/1.45 var(--k-font-body); color: var(--k-ink-soft); }
.rs027__plain { position: relative; z-index: 1; text-align: center; }
.rs027-thanks { position: relative; z-index: 1; margin-top: 20px; text-align: center; font: 400 1.1875rem/1.5 var(--k-font-display); color: var(--c-primary); }

/* sent: the card keeps the signature and the circled answer; the rest steps aside for the thank-you line */
.rs027-form.is-sent > .rs027-field, .rs027-form.is-sent > .rs027-send, .rs027-form.is-sent > .rs027-small,
.rs027-form.is-sent .rs027-choice > .rs027-field__l, .rs027-form.is-sent .rs027-opt:not(.is-chosen) { display: none; }
.rs027-form.is-sent { gap: 14px; }

@media (min-width: 768px) {
  .rs027__card { padding: calc(58px + 22px + 14px) 60px calc(46px + 22px); }
  .rs027__wrap { margin-top: 56px; }
  .rs027__euc { top: -66px; left: -60px; width: 198px; } /* up and out: the sprig stays ≥ 24 px from "Your name" */
  .rs027__sage { transform: translate(42%, 40%) rotate(78deg); }
}

/* live (Tier 3): the canvas draws the ink from its first frame; the CSS mirror and circles step aside at once.
   A circle that was already chosen when the layer mounted stays CSS (is-css) until the guest changes the answer. */
.rs027.is-live .rs027-sig__ink { visibility: hidden; }
.rs027.is-live .rs027-ring { opacity: 0; }
.rs027.is-live .rs027-opt.is-css .rs027-ring { opacity: 1; }

/* Replies W2 (A1505, D-068, plan §D7): a count per event, sticky details, the late line, the couple's extra questions.
   Labels and selects reuse .rs027-field__l and .rs027-input, so the only new colour is the error's. The accepts block and the
   questions stack on the form's own 22 px rhythm; the mine panel sits above the live paper like the form does. */
.rs027-yes, .rs027-extra { display: grid; gap: 22px; }
.rs027-yes[hidden], .rs027-extra:empty { display: none; }
.rs027-evs{margin:0}
.rs027-ev{display:grid;grid-template-columns:1fr auto;grid-template-rows:auto auto;column-gap:.75rem;align-items:center;padding:.6rem 0;border-bottom:0}
.rs027-ev__n{grid-column:1;grid-row:1}
.rs027-ev__d{grid-column:1;grid-row:2;font-size:.82em;color:var(--k-ink-soft)}
.rs027-ev__c{grid-column:2;grid-row:1 / span 2;min-width:7rem;min-height:44px;font-size:1rem;padding-right:22px}
.rs027-day{margin:1.1rem 0 0;font:400 .6875rem/1.3 var(--k-font-display);letter-spacing:.22em;text-transform:uppercase;color:var(--c-secondary-dark)}
.rs027-help{margin:-.75rem 0 0;font-size:.85em;color:var(--k-ink-soft)}
.rs027-late{margin:.25rem 0 .75rem;font:400 1.0625rem/1.5 var(--k-font-display);color:var(--c-primary);text-align:center}
.rs027-err{margin:.25rem 0 .75rem;color:#8B2E2E}
.rs027-trap{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.rs027-mine{position:relative;z-index:1;margin:0;padding:0;border:0;border-radius:0}
.rs027-mine__t{margin:0 0 .9rem;font:400 1.1875rem/1.5 var(--k-font-display);color:var(--c-primary)}
.rs027-change{margin-right:.75rem}
.rs027__card select, .rs027__card button { min-height: 44px; }

/* eye review rounds 1-2 (A1505): the signature's tail clears the "Signed" label; the error line is centred like the late line */
.rs027-sig__l { margin-top: 16px; }
.rs027-mine:not([hidden]) ~ .rs027-form { margin-top: 28px; }
.rs027-err { text-align: center; }
