/* Melissa & Aryan — Save the Date · v10 (cinematic)
   Everything is framed from a few measurements made by app.js:
   --sx/--sy/--sw/--sh  the envelope photograph on screen
   --col-w / --side      the letter column (full width on phones)
   --poster-h, --names-size, --title-pb, --photo-y, --shade-start  the photo framing */

:root {
  --paper: #f8f1e7;
  --ink: #4a2d1f;
  --ink-soft: #6d452f;
  --muted: #7c6453;
  --copper: #b87333;
  --copper-deep: #9a5f3b;
  --olive: #766f4c;
  --table: #d8bfa1;
  --serif: 'Cormorant Garamond', 'Cormorant', Garamond, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --W: 100vw;
  --H: 100vh;
  --col-w: 100vw;
  --side: 0px;
  --letter-mt: 0px;
  --paper-r: 7px;
  --poster-h: 64vh;
  --names-size: 3.4rem;
  --title-pb: 22px;
  --photo-y: 70%;
  --shade-start: 74%;
  --liner: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='80'%20height='80'%20viewBox='0%200%2080%2080'%3E%3Cg%20fill='none'%20stroke='%23b08a52'%20stroke-width='.75'%20stroke-linecap='round'%20stroke-linejoin='round'%20opacity='.62'%3E%3Cg%20id='s'%3E%3Cpath%20d='M6%2034C14%2028%2022%2023%2034%2012'/%3E%3Cpath%20d='M12%2030c-1.4-4.6.5-8.8%204.6-11%20.3%204.6-1.6%208.8-4.6%2011z'/%3E%3Cpath%20d='M12%2030c4.2-.6%208%201.2%209.8%204.4-4.1.7-7.8-.8-9.8-4.4z'/%3E%3Cpath%20d='M20.5%2024c-1.3-4.6.6-8.7%204.6-10.8.3%204.6-1.6%208.7-4.6%2010.8z'/%3E%3Cpath%20d='M20.5%2024c4.1-.6%207.8%201.1%209.6%204.3-4%20.7-7.6-.8-9.6-4.3z'/%3E%3Cpath%20d='M28.6%2017.6c-.5-3.8%201.3-7%204.6-8.4%200%203.8-1.8%207-4.6%208.4z'/%3E%3C/g%3E%3Cuse%20href='%23s'%20transform='translate(40%2040)'/%3E%3C/g%3E%3C/svg%3E");
  --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 20'%3E%3Cpath d='M6 13.5C20 12.4 36 10.6 58 7.2' fill='none' stroke='%237b6a45' stroke-width='.9' stroke-linecap='round'/%3E%3Cg fill='%23737957'%3E%3Cpath d='M0 0C4-2.6 9.5-2.6 13 0 9.5 2.6 4 2.6 0 0Z' transform='translate(16 12.4) rotate(-38)'/%3E%3Cpath d='M0 0C4-2.6 9.5-2.6 13 0 9.5 2.6 4 2.6 0 0Z' transform='translate(19 12.1) rotate(22)'/%3E%3Cpath d='M0 0C4-2.4 9-2.4 12 0 9 2.4 4 2.4 0 0Z' transform='translate(29 10.9) rotate(-40)'/%3E%3Cpath d='M0 0C4-2.4 9-2.4 12 0 9 2.4 4 2.4 0 0Z' transform='translate(32 10.6) rotate(20)'/%3E%3Cpath d='M0 0C3.4-2.2 8-2.2 11 0 8 2.2 3.4 2.2 0 0Z' transform='translate(42 9.3) rotate(-36)'/%3E%3Cpath d='M0 0C3.4-2.2 8-2.2 11 0 8 2.2 3.4 2.2 0 0Z' transform='translate(45 9) rotate(16)'/%3E%3Cpath d='M0 0C3-2 7-2 10 0 7 2 3 2 0 0Z' transform='translate(53 7.9) rotate(-8)'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--table);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { -webkit-user-drag: none; user-select: none; }

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #d6bd9f;
  isolation: isolate;
}

/* ───────────── The table ───────────── */
.table, .cam { position: absolute; inset: 0; }
.table { z-index: 0; }
.cam { transform-origin: 0 0; }
.cam--under { z-index: 1; background: #d6bd9f; }
.cam--card { z-index: 2; visibility: hidden; }
.stage.is-opening .cam--card { visibility: visible; }
.cam--over { z-index: 3; pointer-events: none; }

.table__surface, .cam__table {
  position: absolute;
  left: calc(var(--sx) - var(--sw) * 2);
  top: calc(var(--sy) - var(--sh) * 1.2);
  width: calc(var(--sw) * 5);
  height: calc(var(--sh) * 3.4);
  background: #d6c0a6 url('./assets/table.jpg') 0 0 / 100% 100% no-repeat;
}
.table__surface::after, .cam__table::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('./assets/grain.webp') 0 0 / 160px 160px;
  opacity: .06;
}

/* Dappled light: olive-branch shadows drifting in a slow breeze */
.leaf {
  position: absolute;
  background: url('./assets/leaf-shadow-a.webp') center / contain no-repeat;
  pointer-events: none;
  transform-origin: 30% 80%;
  animation: sway var(--dur, 11s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
}
.leaf--a {
  left: calc(var(--sx) + var(--sw) * .52);
  top: calc(var(--sy) - var(--sh) * .2);
  width: calc(var(--sw) * 1.35);
  height: calc(var(--sw) * 1.35);
  opacity: .34;
  --r0: 4deg; --r1: 7deg; --dx: 10px; --dy: -6px; --dur: 9.5s;
}
.leaf--b {
  left: calc(var(--sx) - var(--sw) * .95);
  top: calc(var(--sy) + var(--sh) * .52);
  width: calc(var(--sw) * 1.25);
  height: calc(var(--sw) * 1.25);
  background-image: url('./assets/leaf-shadow-b.webp');
  opacity: .26;
  --r0: 176deg; --r1: 172deg; --dx: -8px; --dy: 7px; --dur: 12.5s; --delay: -4s;
}
.leaf--c {
  left: calc(var(--sx) + var(--sw) * .45);
  top: calc(var(--sy) - var(--sh) * .1);
  width: calc(var(--sw) * .95);
  height: calc(var(--sw) * .95);
  opacity: .1;
  --r0: 2deg; --r1: 5deg; --dx: 7px; --dy: -4px; --dur: 8.5s; --delay: -2s;
}
@keyframes sway {
  from { transform: rotate(var(--r0)) translate3d(0, 0, 0); }
  to { transform: rotate(var(--r1)) translate3d(var(--dx), var(--dy), 0); }
}

/* ───────────── The envelope photograph and its rig ───────────── */
.scene {
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(.33, 0, .2, 1);
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  width: var(--sw);
  height: var(--sh);
  perspective: var(--persp, 1400px);
  perspective-origin: 50% 56.4%;
}
.scene__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 4.5%, #000 95.5%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 4.5%, #000 95.5%, transparent 100%);
  mask-composite: intersect;
}
.scene__patch {
  position: absolute;
  display: block;
  opacity: 0;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 4%, #000 96%, transparent 100%);
  mask-composite: intersect;
}
.scene__patch--top { left: 12.394%; top: 6.484%; width: 74.930%; height: 27.344%; }
.scene__patch--bottom { left: 29.577%; top: 85.234%; width: 40.845%; height: 10.781%; }

.rig {
  position: absolute;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
}
.stage.is-ready .scene { opacity: 1; }
.stage.is-opening .scene, .stage.is-open .scene { opacity: 1; transition: none; }
.stage.is-opening .rig { visibility: visible; }
.rig img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rig--flap, .rig--lining { transform-origin: 50% 35.664%; }
/* The outside of the flap disappears the moment it turns away from the camera; the lining underneath takes over. */
.rig--flap { -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.rig__shade {
  position: absolute;
  inset: 0;
  background: #2a1206;
  opacity: 0;
}
.rig--inside {
  /* the lined inside of the envelope, in shadow; stops are placed on the opening (35.7% → 61% of the photograph) */
  background:
    linear-gradient(180deg, rgba(34, 11, 2, .9) 35.6%, rgba(58, 22, 6, .66) 39.5%, rgba(64, 26, 8, .6) 47%, rgba(30, 10, 2, .88) 61%),
    var(--liner) 0 0 / 11% auto,
    #dcb990;
}
.rig--lining {
  background:
    linear-gradient(0deg, rgba(255, 232, 204, .1), rgba(70, 28, 8, .22)),
    linear-gradient(90deg, #a2592f, #b36a40 50%, #a2592f);
}
.rig--lining::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: var(--liner-clip);
  background:
    linear-gradient(0deg, rgba(120, 70, 30, .1), rgba(255, 250, 240, .22)),
    var(--liner) 0 0 / 11% auto,
    #efe0c9;
}
.rig--lining .rig__shade { z-index: 1; }
.rig--edges { overflow: visible; }

/* Seal: a soft breathing warmth and an occasional glint invite the tap */
.seal, .seal-glow, .seal-ring {
  position: absolute;
  left: 37.183%;
  top: 51.133%;
  width: 25.915%;
  height: 14.375%;
  pointer-events: none;
}
.seal { transform-origin: 50% 50%; }
.seal img { width: 100%; height: 100%; display: block; }
.seal__glint {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  overflow: hidden;
}
.seal__glint::before {
  content: '';
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 38%;
  background: linear-gradient(90deg, rgba(255, 231, 196, 0), rgba(255, 236, 205, .34) 50%, rgba(255, 231, 196, 0));
  mix-blend-mode: screen;
  transform: translateX(-140%) rotate(18deg);
  animation: glint 6.5s 1.6s cubic-bezier(.45, .05, .25, 1) infinite;
}
@keyframes glint {
  0%, 70% { transform: translateX(-140%) rotate(18deg); }
  92%, 100% { transform: translateX(330%) rotate(18deg); }
}
.seal-glow {
  left: 26.6%;
  top: 45.2%;
  width: 47%;
  height: 26.1%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 206, 140, .42), rgba(255, 186, 110, .14) 55%, rgba(255, 186, 110, 0));
  mix-blend-mode: screen;
  animation: breathe 3.4s ease-in-out infinite;
  transition: opacity .4s var(--ease);
}
@keyframes breathe {
  0%, 100% { opacity: .38; transform: scale(.94); }
  50% { opacity: .74; transform: scale(1.05); }
}
.seal-ring {
  left: 36.4%;
  top: 50.7%;
  width: 27.5%;
  height: 15.25%;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 238, 206, .95), 0 0 0 6px rgba(184, 115, 51, .35);
  opacity: 0;
  transition: opacity .25s;
}
.stage:has(.open-button:focus-visible) .seal-ring { opacity: 1; }
.stage:has(.open-button:hover) .seal-glow { animation-duration: 2.2s; }

.cam__dim {
  position: absolute;
  inset: -50%;
  background: #24130a;
  opacity: 0;
  pointer-events: none;
}

.open-button {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  touch-action: none;
}
.stage.is-opening .open-button { cursor: default; }
.stage.is-open .open-button { display: none; }

/* ───────────── The invitation card / page ───────────── */
.card-shadow {
  position: absolute;
  left: var(--side);
  top: var(--letter-mt);
  width: var(--col-w);
  height: calc(var(--H) - var(--letter-mt));
  transform-origin: calc(var(--side) * -1) calc(var(--letter-mt) * -1);
  border-radius: var(--paper-r);
  box-shadow: 0 46px 80px -26px rgba(38, 18, 6, .62), 0 14px 28px -12px rgba(38, 18, 6, .4);
  opacity: 0;
  pointer-events: none;
}
.page {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--W);
  height: var(--H);
  transform-origin: 0 0;
}
.page__scroll {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(184, 115, 51, .4) transparent;
  outline: none;
}
.page__scroll::-webkit-scrollbar { width: 6px; }
.page__scroll::-webkit-scrollbar-thumb { background: rgba(184, 115, 51, .4); border-radius: 999px; }
.page__scroll::-webkit-scrollbar-track { background: transparent; }
.stage:not(.is-open) .page__scroll {
  clip-path: inset(var(--letter-mt) var(--side-r, var(--side)) 0 var(--side) round var(--paper-r));
}
.stage.is-open .page { width: 100%; height: 100%; }
.card-edge {
  position: absolute;
  top: var(--letter-mt);
  bottom: 0;
  left: var(--side);
  right: var(--side-r, var(--side));
  border-radius: var(--paper-r);
  box-shadow: inset 0 0 0 1.5px rgba(214, 172, 98, .9), inset 0 0 0 5px rgba(255, 246, 228, .18);
  pointer-events: none;
}
.stage.is-open .card-edge,
.stage.is-open .card-shadow { display: none; }
.stage.is-open .cam--card { visibility: visible; }
.stage.is-open .cam--under,
.stage.is-open .cam--over { display: none; }
.stage.is-open.is-bleed .table { visibility: hidden; }
.stage.is-open.is-bleed .table .leaf { animation-play-state: paused; }

.letter {
  position: relative;
  width: min(100%, var(--col-w));
  min-height: 100%;
  margin: 0 auto;
  background: var(--paper);
}
.stage.is-column .letter {
  border-radius: var(--paper-r);
  overflow: hidden;
  margin-top: var(--letter-mt);
  margin-bottom: clamp(40px, 9vh, 96px);
  box-shadow: 0 0 0 1px rgba(120, 80, 50, .07), 0 40px 90px -40px rgba(60, 34, 16, .6), 0 14px 34px -22px rgba(60, 34, 16, .42);
}

/* The photograph: framed so faces, the ring and the wheel always stay clear of the title */
.poster {
  position: relative;
  height: var(--poster-h);
  overflow: hidden;
  background: #2b1d13;
  isolation: isolate;
}
.poster__media {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.poster__photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% var(--photo-y);
  transform-origin: 50% 62%;
}
.stage.is-open .poster__photo { animation: drift 38s ease-in-out infinite alternate; }
@keyframes drift {
  from { transform: scale(1.005); }
  to { transform: scale(1.065) translate3d(-.7%, -.5%, 0); }
}
.poster__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20, 11, 4, .2) 0%, rgba(20, 11, 4, 0) 15%, rgba(20, 11, 4, 0) calc(var(--shade-start) - 14%), rgba(22, 12, 5, .42) var(--shade-start), rgba(18, 9, 3, .8) 100%),
    radial-gradient(120% 90% at 50% 40%, rgba(20, 10, 4, 0) 55%, rgba(20, 10, 4, .3) 100%);
}
.poster__shade::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('./assets/grain.webp') 0 0 / 160px 160px;
  opacity: .07;
}
.poster::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(214, 172, 98, 0), rgba(226, 188, 112, .9) 20%, rgba(244, 214, 150, 1) 50%, rgba(226, 188, 112, .9) 80%, rgba(214, 172, 98, 0));
  z-index: 2;
}
.poster__title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--title-pb);
  padding: 0 5%;
  text-align: center;
  z-index: 1;
  will-change: transform, opacity;
}
.poster__save {
  margin: 0 0 calc(var(--names-size) * .2);
  font: 500 clamp(.6rem, .54rem + .22vw, .74rem) / 1 var(--sans);
  letter-spacing: .34em;
  text-indent: .34em;
  text-transform: uppercase;
  color: #f8ebd2;
  text-shadow: 0 1px 10px rgba(20, 10, 3, .55);
}
.stage.is-compact-title .poster__save { margin-bottom: 8px; }
.stage.is-compact-title .poster__save::after { display: none; }
.poster__save::after {
  content: '';
  display: block;
  width: 56px;
  height: 1px;
  margin: 11px auto 0;
  background: linear-gradient(90deg, rgba(226, 188, 112, 0), #ecc982, rgba(226, 188, 112, 0));
}
.names {
  margin: 0;
  font: 500 var(--names-size) / .84 var(--serif);
  letter-spacing: -.015em;
  color: #e6bd63;
  filter: drop-shadow(0 2px 2px rgba(30, 15, 5, .45)) drop-shadow(0 10px 26px rgba(16, 8, 2, .5));
}
/* Gold foil on each line (more robust in Safari than clipping the whole heading) */
.names__line {
  display: block;
  white-space: nowrap;
  background-image:
    linear-gradient(100deg, rgba(255, 249, 230, 0) 0 38%, rgba(255, 249, 230, .95) 46%, rgba(255, 249, 230, 0) 54% 100%),
    linear-gradient(180deg, #fcecbb 0%, #efcc7c 30%, #cc9849 58%, #eed08a 80%, #bf8d40 100%);
  background-size: 260% 100%, 100% 100%;
  background-position: 160% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.names__line + .names__line { margin-top: .03em; }
.names__amp { font-style: italic; font-weight: 400; font-size: 1.04em; }
.stage.is-open .names__line { animation: sheen 2.2s .6s cubic-bezier(.45, 0, .2, 1) both; }
.stage.is-open .names__line + .names__line { animation-delay: .82s; }
@keyframes sheen {
  from { background-position: 160% 0, 0 0; }
  to { background-position: -70% 0, 0 0; }
}

/* ───────────── Paper ───────────── */
.paper {
  position: relative;
  background: linear-gradient(180deg, #fcf7ef 0%, #f7efe3 38%, #f1e6d6 100%);
  isolation: isolate;
}
.paper::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('./assets/grain.webp') 0 0 / 160px 160px;
  opacity: .05;
}
.paper::after {
  content: '';
  position: absolute;
  z-index: -1;
  right: -30%;
  top: -60px;
  width: 70%;
  aspect-ratio: 1;
  background: url('./assets/leaf-shadow-a.webp') center / contain no-repeat;
  opacity: .065;
  transform: rotate(12deg);
  pointer-events: none;
}

.opening {
  padding: clamp(22px, 3.6vh, 38px) 26px clamp(26px, 4vh, 44px);
  text-align: center;
}
.stage.is-column .opening { padding-top: clamp(70px, 10vh, 110px); padding-bottom: clamp(40px, 6vh, 64px); }
.opening__married {
  margin: 0;
  font: italic 500 clamp(1.8rem, 1.35rem + 2vw, 2.45rem) / 1.1 var(--serif);
  color: #6e3f25;
}
.opening__date {
  margin: .55em 0 0;
  font: 500 clamp(.98rem, .9rem + .45vw, 1.18rem) / 1 var(--serif);
  letter-spacing: .2em;
  text-indent: .2em;
  text-transform: uppercase;
  color: #573421;
}
.sprig-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: clamp(12px, 2.2vh, 20px) auto;
}
.sprig-rule::before, .sprig-rule::after {
  content: '';
  width: clamp(44px, 14vw, 70px);
  height: 1px;
  background: linear-gradient(90deg, rgba(122, 84, 52, 0), rgba(122, 84, 52, .5));
}
.sprig-rule::after { transform: scaleX(-1); }
.sprig-rule svg { display: block; width: 52px; height: auto; }
.opening__lead {
  max-width: 22em;
  margin: 0 auto;
  font: italic 400 clamp(1.1rem, 1.02rem + .4vw, 1.32rem) / 1.48 var(--serif);
  color: #7b5440;
  text-wrap: balance;
}
.scroll-label {
  margin: clamp(14px, 2.4vh, 22px) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  font: 500 .6rem / 1 var(--sans);
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
  color: #9c6a45;
}
.stage:not(.is-open) .scroll-label__arrow { animation-play-state: paused; }
.scroll-label__arrow {
  width: 9px;
  height: 9px;
  border-right: 1.3px solid currentColor;
  border-bottom: 1.3px solid currentColor;
  transform: rotate(45deg);
  animation: nudge 2.4s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(-2px) rotate(45deg); opacity: .55; }
  50% { transform: translateY(3px) rotate(45deg); opacity: 1; }
}

.chapter {
  position: relative;
  max-width: 35rem;
  margin: 0 auto;
  padding: clamp(46px, 8vw, 80px) clamp(22px, 6vw, 44px) 0;
  text-align: center;
}
.chapter::before {
  content: '';
  display: block;
  width: 50px;
  height: 16px;
  margin: 0 auto clamp(34px, 6vw, 52px);
  background: var(--ornament) center / contain no-repeat;
  opacity: .8;
}
.chapter__kicker {
  margin: 0 0 .3em;
  font: italic 500 clamp(1.18rem, 1.08rem + .4vw, 1.38rem) / 1.2 var(--serif);
  color: var(--copper-deep);
}
.chapter h2, .closing h2 {
  margin: 0;
  font: 500 clamp(2.45rem, 1.75rem + 3vw, 3.65rem) / .98 var(--serif);
  letter-spacing: -.01em;
  color: var(--ink);
  text-wrap: balance;
}
.chapter > p:not(.chapter__kicker),
.reply-card > p:not(.chapter__kicker):not(.soft-line) {
  max-width: 30em;
  margin: 1.15em auto 0;
  font: 400 clamp(.94rem, .9rem + .15vw, 1.01rem) / 1.78 var(--sans);
  color: var(--muted);
}
.venue__link {
  display: inline-flex;
  gap: .45em;
  margin-top: 1.5em;
  padding-bottom: 5px;
  font: 500 .84rem / 1 var(--sans);
  color: #96603d;
  text-decoration: none;
  border-bottom: 1px solid rgba(150, 96, 61, .35);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.venue__link:hover { color: #7a4a2c; border-color: rgba(122, 74, 44, .7); }
.venue__link:focus-visible { outline: 2px solid var(--copper); outline-offset: 4px; border-radius: 2px; }

/* The reply card — a separate piece of stationery inside the letter */
.reply-card {
  position: relative;
  max-width: 32rem;
  margin: 0 auto;
  padding: clamp(32px, 6.5vw, 50px) clamp(20px, 5.5vw, 44px) clamp(28px, 5vw, 42px);
  background: linear-gradient(180deg, #fefaf4, #f9f1e6);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(160, 104, 64, .16), 0 26px 50px -32px rgba(70, 40, 20, .5), 0 6px 14px -10px rgba(70, 40, 20, .25);
  container-type: inline-size;
}
.reply-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(176, 124, 72, .26);
  border-radius: 3px;
  pointer-events: none;
}
.soft-line {
  margin: .85em 0 0;
  font: italic 400 1.24rem / 1.3 var(--serif);
  color: var(--ink-soft);
}
.rsvp { margin-top: 26px; text-align: center; }
.choice-row { display: grid; gap: 10px; }
@container (min-width: 430px) {
  .choice-row { grid-template-columns: 1fr 1fr; }
}
.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7em;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 999px;
  font: 500 .7rem / 1.2 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), transform .2s var(--ease);
}
.choice--yes { background: var(--olive); color: #fffaf0; border: 1px solid var(--olive); }
.choice--no { background: transparent; color: var(--ink); border: 1px solid rgba(91, 64, 43, .3); }
.choice:hover { transform: translateY(-1px); }
.choice:active { transform: translateY(0); }
.choice:focus-visible, .counter button:focus-visible, .send:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.choice[aria-pressed='true']::before {
  content: '';
  width: 11px;
  height: 6px;
  margin-top: -3px;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
}
.choice--yes[aria-pressed='true'] { box-shadow: 0 10px 22px -14px rgba(80, 76, 40, .9); }
.choice--no[aria-pressed='true'] { background: #5b3a28; border-color: #5b3a28; color: #fff6ea; box-shadow: 0 10px 22px -14px rgba(70, 40, 20, .9); }
.rsvp[data-response='no'] .choice--yes { background: transparent; color: var(--olive); border-color: rgba(118, 111, 76, .45); }

.guest-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition: grid-template-rows .5s var(--ease), opacity .35s var(--ease), margin-top .5s var(--ease);
}
.guest-panel.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 22px; }
.guest-panel__inner { overflow: hidden; min-height: 0; }
.field-label {
  display: block;
  font: 500 .66rem / 1.3 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8a7160;
}
.field-label small { font-size: .9em; letter-spacing: .1em; text-transform: none; }
.counter {
  width: 188px;
  margin: 10px auto 2px;
  display: grid;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
}
.counter button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(91, 64, 43, .25);
  background: rgba(255, 255, 255, .55);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .15s;
}
.counter button:hover { background: #fff; border-color: rgba(91, 64, 43, .4); }
.counter button:active { transform: scale(.95); }
.counter strong { font: 500 2.1rem / 1 var(--serif); color: var(--ink); }
.counter strong.is-bump { animation: bump .35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.18); } }
.message-label { display: block; margin-top: 24px; }
.message-label textarea {
  display: block;
  width: 100%;
  min-height: 112px;
  margin-top: 10px;
  padding: 14px 16px;
  resize: vertical;
  border: 1px solid rgba(91, 64, 43, .2);
  border-radius: 14px;
  background: rgba(255, 255, 255, .62);
  color: var(--ink);
  font: 400 .96rem / 1.55 var(--sans);
  outline: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background-color .25s;
}
.message-label textarea::placeholder { color: #a8907d; }
.message-label textarea:focus { border-color: rgba(118, 111, 76, .7); background: #fff; box-shadow: 0 0 0 3px rgba(118, 111, 76, .14); }
.send {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  padding: 16px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(100deg, #c88c58, #b87333 55%, #a8632b);
  color: #fff8ef;
  font: 500 .72rem / 1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 24px -14px rgba(150, 80, 30, .75);
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), opacity .3s var(--ease);
}
.send span { display: inline-block; margin-left: .35em; transition: transform .3s var(--ease); }
.send:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 16px 28px -14px rgba(150, 80, 30, .8); }
.send:not(:disabled):hover span { transform: translateX(3px); }
.send:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.saved {
  min-height: 1.4em;
  margin: 14px 0 0;
  font: italic 500 1.08rem / 1.4 var(--serif);
  color: #5d6842;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.saved.is-shown { opacity: 1; transform: none; }

/* Personal link: who the reply is for, notes, and the thank-you state */
.reply-card > p.reply-for:not(.chapter__kicker):not(.soft-line) {
  margin-top: 1.5em;
  font: italic 500 1.12rem / 1.3 var(--serif);
  color: var(--copper-deep);
}
.reply-card > p.reply-note:not(.chapter__kicker):not(.soft-line) {
  margin-top: 1.4em;
  font: italic 400 1.32rem / 1.4 var(--serif);
  color: var(--ink-soft);
}
.saved.is-error { color: #9a4a2f; }
.counter button:disabled { opacity: .35; cursor: default; transform: none; }

.reply-card.is-note > :not(.chapter__kicker):not(#reply-title):not(.reply-note) { display: none; }
.reply-card.is-done > :not(.reply-done) { display: none; }
.reply-done[hidden], .reply-done__mark[hidden], .reply-done__fine[hidden] { display: none; }
.reply-done {
  display: grid;
  justify-items: center;
  padding: clamp(6px, 2vw, 14px) 0 4px;
  text-align: center;
}
.reply-done__mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 22px;
  border-radius: 50%;
  color: var(--olive);
  background: radial-gradient(circle at 50% 35%, #fffdf8, #f6ecdc);
  box-shadow: 0 0 0 1px rgba(176, 124, 72, .4), 0 0 0 7px rgba(176, 124, 72, .1), 0 14px 26px -16px rgba(80, 60, 30, .7);
}
.reply-done__mark path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.reply-done__title {
  max-width: 11em;
  margin: 0;
  font: 500 clamp(2.2rem, 1.6rem + 2.8vw, 3.2rem) / 1.02 var(--serif);
  letter-spacing: -.01em;
  color: var(--ink);
  text-wrap: balance;
}
.reply-done__sub {
  margin: 1.1em 0 0;
  font: 500 .72rem / 1.7 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8a7160;
}
.reply-done .sprig-rule { margin: 1.5em 0 0; opacity: .9; }
.reply-done__fine { margin: 1.3em 0 0; font: italic 400 1.24rem / 1.3 var(--serif); color: var(--ink-soft); }
.reply-card.is-done .reply-done > * { animation: doneIn .9s var(--ease) both; }
.reply-card.is-done .reply-done > :nth-child(2) { animation-delay: .12s; }
.reply-card.is-done .reply-done > :nth-child(3) { animation-delay: .24s; }
.reply-card.is-done .reply-done > :nth-child(4) { animation-delay: .34s; }
.reply-card.is-done .reply-done > :nth-child(5) { animation-delay: .44s; }
.reply-card.is-done .reply-done__mark path { animation: tick .7s .25s var(--ease) forwards; }
@keyframes doneIn { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes tick { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .reply-card.is-done .reply-done > * { animation: none; }
  .reply-card.is-done .reply-done__mark path { animation: none; stroke-dashoffset: 0; }
}

.chapter > p.stay__main { font-size: .93rem; }
.chapter > p.stay__fine {
  margin-top: 1.1em;
  font-size: .76rem;
  line-height: 1.7;
  color: rgba(100, 78, 62, .78);
}

.closing {
  max-width: 35rem;
  margin: 0 auto;
  padding: clamp(72px, 12vw, 120px) 26px calc(clamp(80px, 12vw, 124px) + env(safe-area-inset-bottom));
  text-align: center;
}
.closing__monogram {
  font: 500 2.05rem / 1 var(--serif);
  letter-spacing: .14em;
  text-indent: .14em;
  color: #a06a3f;
}
.closing__monogram span { opacity: .45; margin: 0 .06em; }
.closing h2 { margin-top: 20px; font-size: clamp(2.2rem, 1.7rem + 2.4vw, 3.2rem); }
.closing__tagline {
  margin: 22px 0 0;
  font: 500 .64rem / 1 var(--sans);
  letter-spacing: .28em;
  text-indent: .28em;
  text-transform: uppercase;
  color: #8c7461;
}

/* Sections come into focus once, like a lens pulling focus */
.stage.reveal-ready [data-reveal] {
  opacity: .001;
  filter: blur(5px);
  transition: opacity 1.1s var(--ease), filter 1.1s var(--ease);
}
.stage.reveal-ready [data-reveal].is-in { opacity: 1; filter: blur(0); }

/* Reduced motion: keep every frame still, keep the content */
@media (prefers-reduced-motion: reduce) {
  .leaf, .seal-glow, .seal__glint::before, .scroll-label__arrow { animation: none !important; }
  .stage.is-open .poster__photo, .stage.is-open .names__line { animation: none !important; }
  .names__line { background-position: -70% 0, 0 0; }
  .stage.reveal-ready [data-reveal] { opacity: 1; filter: none; transition: none; }
}
