/* One look only: the invite's own paper. Layout: one full-screen 9:16 stage; scrolling plays the invitation's pages in turn.
   Shared by the landing page and the five invitations; the RSVP form's styles are at the end. */
:root {
  --paper: #F8F4E8;        /* paper of the final PDF */
  --moss: #3F4B18;
  --copper: #B56D26;
  --ink-soft: #6B7148;
  --rule: rgba(63, 75, 24, 0.18);
  --panel: #FFFDF6;
  --glow: 255, 196, 92;
  --debug: rgba(56, 100, 200, 0.85);
  --display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --caps: "Cinzel", Georgia, serif;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  color-scheme: light;
}
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html, body { background: var(--paper); color: var(--moss); }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
body { font-family: var(--serif); -webkit-font-smoothing: antialiased; }

.theatre { z-index: 1; height: 100svh; display: grid; place-items: center; overflow: hidden; position: relative; }
.stage { position: relative; width: min(100vw, calc(100svh * 9 / 16)); aspect-ratio: 9 / 16; container-type: inline-size; }
.page { position: absolute; inset: 0; visibility: hidden; }
.page > canvas, .page > .flat { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.piece { position: absolute; }
.piece > .art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.piece.lantern { isolation: isolate; }
.piece.lantern > .halo { position: absolute; left: -70%; right: -70%; top: 22%; bottom: -8%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--glow), 0.42), rgba(var(--glow), 0)); }
.glow { position: absolute; border-radius: 50%; opacity: 0; pointer-events: none; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--glow), 0.55), rgba(var(--glow), 0) 65%); }
.bulb { position: absolute; width: 7cqw; height: 7cqw; margin: -3.5cqw 0 0 -3.5cqw; border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 240, 190, 0.95) 0 10%, rgba(var(--glow), 0.5) 28%, rgba(var(--glow), 0) 68%); }
.glint { position: absolute; width: 5cqw; height: 5cqw; margin: -2.5cqw 0 0 -2.5cqw; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, #fff 0 8%, rgba(255, 245, 210, 0.6) 18%, transparent 45%),
    linear-gradient(transparent 47%, rgba(255, 250, 230, 0.9) 50%, transparent 53%),
    linear-gradient(90deg, transparent 47%, rgba(255, 250, 230, 0.9) 50%, transparent 53%); }
.debug .piece { outline: 1.5px dashed var(--debug); outline-offset: 2px; }

.line { position: absolute; margin: 0; white-space: nowrap; line-height: normal; font-weight: 400; transform: translateX(-50%); }
.line.left { transform: none; }
.line .in { display: inline-block; }
.line sup { font-size: 0.694em; vertical-align: top; line-height: 1; position: relative; top: 0.03em; }

/* scroll sign: a small Gond leaf with a dotted midrib over a soft chevron, drifting down and back */
.cue { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 5; color: var(--copper);
  pointer-events: none; transform: translateX(-50%); transition: opacity 0.6s ease; }
.cue { display: grid; justify-items: center; gap: 4px; }
.cue svg { display: block; width: 22px; height: 37px; animation: cue 2.4s ease-in-out infinite; }
.cue span { font-family: "Jost", "Helvetica Neue", Arial, sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.28em; padding-left: 0.28em; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(7px); opacity: 1; } }
.glint.big { width: 11cqw; height: 11cqw; margin: -5.5cqw 0 0 -5.5cqw; }
.status { position: fixed; inset: auto 16px 50% 16px; text-align: center; font-size: 16px; color: var(--copper); }

.end { padding-block: 56px 96px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; justify-items: center; gap: 14px; text-align: center; }
.end p { margin: 0; font-style: italic; font-size: 18px; color: var(--ink-soft); }
.end .end-by { font-style: normal; font-family: var(--caps); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); }
.end .btn { margin-top: 6px; min-width: 160px; font-family: var(--caps); letter-spacing: 0.16em; }
.link { font: inherit; font-size: 15px; color: var(--ink-soft); background: none; border: 0; padding: 10px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* RSVP button that stays at the top once the guest starts scrolling */
.rsvp-pill { position: fixed; z-index: 6; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px));
  font-family: var(--caps); font-size: 13px; letter-spacing: 0.16em; color: var(--paper); background: var(--moss); border: 0; border-radius: 999px;
  padding: 11px 18px; cursor: pointer; box-shadow: 0 6px 18px rgba(63, 75, 24, 0.18); opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }
.rsvp-pill.show { opacity: 1; pointer-events: auto; }
.btn { font: inherit; font-size: 16px; color: var(--paper); background: var(--moss); border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer; }
.btn:focus-visible, .link:focus-visible, .rsvp-pill:focus-visible, .tune-toggle:focus-visible, .tune input:focus-visible, .tune button:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

/* tuning drawer */
.tune-toggle { position: fixed; z-index: 20; left: calc(14px + env(safe-area-inset-left, 0px)); top: calc(14px + env(safe-area-inset-top, 0px));
  font: inherit; font-size: 14px; color: var(--moss); background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; padding: 8px 14px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(63, 75, 24, 0.12); }
.tune { position: fixed; z-index: 21; left: calc(14px + env(safe-area-inset-left, 0px)); top: calc(60px + env(safe-area-inset-top, 0px));
  width: min(310px, calc(100vw - 28px)); background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; padding: 16px 18px 18px;
  box-shadow: 0 12px 40px rgba(63, 75, 24, 0.16); display: grid; gap: 12px; font-size: 15px; }
.tune h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 15px; color: var(--copper); }
.tune label { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.tune input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--moss); }
.tune output { font-variant-numeric: tabular-nums; color: var(--ink-soft); font-size: 13px; }
.tune .check { grid-template-columns: auto 1fr; }
.tune .check input { accent-color: var(--moss); width: 18px; height: 18px; margin: 0; }
.tune .row { display: flex; gap: 10px; flex-wrap: wrap; }
.tune .row button { font: inherit; font-size: 14px; background: none; border: 1px solid var(--rule); color: var(--moss); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.tune .note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); font-style: italic; }

/* ---------- landing page: the cover's art with its own words (sizes in page widths, like the invitation's text) ---------- */
.landing { position: absolute; z-index: 2; left: 17%; right: 17%; top: 29.8%; text-align: center; color: var(--moss); }
.js:not(.opened) .landing > * { opacity: 0; }
.opened .landing > * { animation: landing-in 2s cubic-bezier(0.22, 1, 0.36, 1) 0.9s both; }
.opened .landing > :nth-child(2) { animation-delay: 1.2s; } .opened .landing > :nth-child(3) { animation-delay: 1.5s; }
.opened .landing > :nth-child(4) { animation-delay: 1.8s; } .opened .landing > :nth-child(5) { animation-delay: 2.1s; } .opened .landing > :nth-child(6) { animation-delay: 2.4s; }
@keyframes landing-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .opened .landing > * { animation-duration: 0.01s; } }
.landing p, .landing h1 { margin: 0; }
.l-kicker { font-style: italic; font-size: 4.2cqw; color: var(--ink-soft); }
.l-names { font-family: var(--display); font-weight: 400; font-size: 8.8cqw; line-height: 1.08; margin-top: 2.4cqw !important; }
.l-and { display: block; font-family: var(--caps); font-size: 3.2cqw; color: var(--copper); line-height: 1.5; }
.l-date { font-family: var(--caps); font-size: 2.6cqw; letter-spacing: 0.16em; text-transform: uppercase; color: var(--copper); margin-top: 2.2cqw !important; }
.l-lede { font-style: italic; font-size: 3.8cqw; line-height: 1.28; margin-top: 3.8cqw !important; }
.l-note { font-size: 3.3cqw; line-height: 1.32; color: var(--ink-soft); margin-top: 3.2cqw !important; }
.l-help { font-style: italic; font-size: 3.2cqw; line-height: 1.32; color: var(--copper); margin-top: 2.8cqw !important; }

/* ---------- RSVP form ---------- */
html.rsvp-open, html.rsvp-open body { overflow: hidden; }
.rsvp { position: fixed; inset: 0; z-index: 30; background: var(--paper); overflow-y: auto; overscroll-behavior: contain; color: var(--moss); }
.rsvp-bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; background: var(--paper);
  padding: calc(6px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 6px max(8px, env(safe-area-inset-left, 0px)); }
.rsvp-back, .rsvp-close { font: inherit; font-size: 16px; color: var(--moss); background: none; border: 0; min-height: 44px; padding: 0 10px; cursor: pointer; }
.rsvp-close { margin-left: auto; }
.rsvp-back:focus-visible, .rsvp-close:focus-visible, .r-edit:focus-visible, .c-ctrl button:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; border-radius: 8px; }
.rsvp-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--rule); }
.rsvp-progress i { display: block; height: 100%; width: 0; background: var(--copper); transition: width 0.4s ease; }
.rsvp-body { max-width: 460px; margin: 0 auto; padding: 28px 20px calc(48px + env(safe-area-inset-bottom, 0px)); }
.step { display: grid; gap: 18px; }
.step p { margin: 0; }
.step .kicker { font-family: var(--caps); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--copper); }
.step h2 { margin: -8px 0 0; font-weight: 400; font-size: clamp(25px, 6.6vw, 29px); line-height: 1.22; outline: none; }
.step h3 { margin: 8px 0 -6px; font-family: var(--caps); font-weight: 400; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); }
.step .help { font-size: 18px; line-height: 1.45; color: var(--ink-soft); }
.step .by { font-family: var(--caps); font-size: 14px; letter-spacing: 0.1em; color: var(--copper); }
.field { display: grid; gap: 6px; }
.field label { font-size: 18px; }
.field .hint { font-size: 15px; line-height: 1.4; color: var(--ink-soft); margin-top: -2px; }
.rsvp input[type=text], .rsvp input[type=tel], .rsvp textarea, .rsvp select { font: inherit; font-size: 18px; color: var(--moss); background: var(--panel);
  border: 1px solid rgba(63, 75, 24, 0.3); border-radius: 12px; padding: 12px 14px; width: 100%; box-sizing: border-box; }
.rsvp textarea { resize: vertical; min-height: 104px; line-height: 1.4; }
.rsvp select { width: auto; flex: none; min-width: 104px; padding-right: 10px; }
.rsvp input:focus-visible, .rsvp textarea:focus-visible, .rsvp select:focus-visible { outline: 2px solid var(--copper); outline-offset: 1px; border-color: var(--moss); }
.kid { display: flex; gap: 8px; }
.you { font-size: 18px; padding: 2px 2px 0; }
.you small { color: var(--ink-soft); font-size: 15px; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 14px; align-items: center; padding: 14px 16px; min-height: 30px; border: 1px solid rgba(63, 75, 24, 0.25); border-radius: 14px;
  background: var(--panel); font-size: 18px; line-height: 1.3; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.choice:has(input:checked) { border-color: var(--moss); background: #EFEBD8; }
.choice small { display: block; font-family: var(--caps); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--copper); margin-bottom: 2px; }
.choice input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--moss); border-radius: 50%; background: var(--panel); }
.choice input[type=checkbox] { border-radius: 6px; }
.choice input:checked { background: var(--moss); box-shadow: inset 0 0 0 4px var(--panel); }
.choice input[type=checkbox]:checked { box-shadow: none; background: var(--moss) center / 14px no-repeat
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%23F8F4E8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.choice input:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.counter { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid rgba(63, 75, 24, 0.25); border-radius: 14px; background: var(--panel); }
.c-label { display: block; font-size: 19px; }
.counter small { display: block; font-size: 15px; color: var(--ink-soft); }
.c-ctrl { display: flex; align-items: center; gap: 6px; }
.c-ctrl button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--moss); background: none; color: var(--moss); font-size: 22px; line-height: 1; cursor: pointer; }
.c-ctrl button:disabled { opacity: 0.3; cursor: default; }
.c-ctrl output { min-width: 2ch; text-align: center; font-size: 22px; font-variant-numeric: tabular-nums; }
.review { margin: 0; border-top: 1px solid var(--rule); }
.r-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.r-row dt { font-family: var(--caps); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--copper); }
.r-row dd { grid-column: 1; margin: 0; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-line; }
.r-edit { grid-column: 2; grid-row: 1 / span 2; align-self: center; font: inherit; font-size: 15px; color: var(--moss); background: none; border: 0; padding: 10px 4px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.test { font-size: 15px; font-style: italic; color: var(--copper); border: 1px dashed var(--copper); border-radius: 10px; padding: 10px 12px; }
.error { color: #A3401F; font-size: 16px; min-height: 0; }
.error:empty { display: none; }
.btn.go { width: 100%; min-height: 52px; font-size: 17px; margin-top: 4px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.rsvp-body.centered { text-align: center; padding-top: 12vh; }
.centered .step { justify-items: center; }
.centered h2 { font-family: var(--display); font-style: normal; font-size: clamp(28px, 8vw, 36px); margin: 0; }
.centered .step > p { font-size: 19px; line-height: 1.5; max-width: 30ch; }
.centered .step > .by { font-size: 14px; max-width: none; }
.centered .sign { font-style: italic; color: var(--ink-soft); }
.centered .sign b { display: block; font-style: normal; font-weight: 400; font-family: var(--display); font-size: 22px; color: var(--moss); margin-top: 4px; }
.ornament { width: 120px; height: 20px; color: var(--copper); }

/* =====================================================================================================
   The occasion: an opening wreath on handmade-paper doors, a backdrop of the page's own art on wide screens,
   paper grain, the list of pages, and the ending. One easing family throughout: slow in, soft landing.
   ===================================================================================================== */
:root { --gold: #E3B65C; --gold-hi: #FFF0C8; --ease: cubic-bezier(0.22, 1, 0.36, 1); }

/* paper grain over everything, so the screen reads as card stock rather than a flat colour */
.grain { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .15 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }


/* ---------- wide screens: the invitation becomes a card, with its page's art glowing around it ---------- */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: none; }
.ambient i { position: absolute; inset: -12%; background: center / cover no-repeat; opacity: 0;
  transition: opacity 1.6s var(--ease); }
.ambient i.on { opacity: 0.95; }
.ambient::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 75% at 50% 50%, rgba(248, 244, 232, 0), rgba(248, 244, 232, 0.25) 65%, rgba(248, 244, 232, 0.6)); }
@media (min-aspect-ratio: 4/5) {
  .ambient { display: block; }
  .stage { width: calc((100svh - 56px) * 9 / 16); background: var(--paper); border-radius: 4px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 0 0 1px rgba(181, 109, 38, 0.14), 0 40px 90px -30px rgba(63, 50, 20, 0.45), 0 18px 40px -24px rgba(63, 50, 20, 0.3); }
  .page { border-radius: 4px; overflow: hidden; }
}
.end { position: relative; z-index: 1; }

/* ---------- the opening ---------- */
.gate { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; overflow: hidden; }
.gate-on .gate { display: grid; }
html.gate-on, html.gate-on body { overflow: hidden; }
.door { position: absolute; top: 0; bottom: 0; width: 50.2%; will-change: transform;
  background: var(--paper) url("assets/paper.webp") 0 0 / 512px 512px repeat; }  /* handmade paper */
.door.l { left: 0; box-shadow: inset -1px 0 0 rgba(181, 109, 38, 0.4), 10px 0 30px -10px rgba(63, 50, 20, 0.25); }
.door.r { right: 0; box-shadow: inset 1px 0 0 rgba(181, 109, 38, 0.4), -10px 0 30px -10px rgba(63, 50, 20, 0.25); background-position: 256px 0; }
.door-frame { position: absolute; top: 18px; bottom: 18px; border: 1px solid rgba(181, 109, 38, 0.5); }
.door-frame::after { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(181, 109, 38, 0.28); }
.door.l .door-frame { left: 18px; right: -1px; border-right: 0; } .door.l .door-frame::after { right: -1px; border-right: 0; }
.door.r .door-frame { right: 18px; left: -1px; border-left: 0; } .door.r .door-frame::after { left: -1px; border-left: 0; }
.gate-inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: clamp(10px, 2.2vh, 18px); text-align: center; padding: 0 24px; }
.gate-inner p { margin: 0; }
.g-kicker { font-family: var(--caps); font-size: 12px; letter-spacing: 0.34em; padding-left: 0.34em; text-transform: uppercase; color: var(--copper); }
.g-names { font-family: var(--display); font-size: clamp(30px, 8.5vw, 56px); line-height: 1.1; color: var(--moss); animation-delay: 0.8s; }
.g-names span { font-family: var(--caps); font-size: 0.5em; vertical-align: 0.3em; padding: 0 0.15em; }
.gate-inner > * { animation: gate-in 1.8s var(--ease) both; }
.gate-inner > :nth-child(2) { animation-delay: 0.25s; } .gate-inner > :nth-child(3) { animation-delay: 0.5s; }
.g-names { animation: gate-in 1.8s var(--ease) 0.25s both; }
@keyframes gate-in { from { opacity: 0; transform: translateY(14px); } }

.seal { position: relative; width: clamp(210px, 58vw, 340px); aspect-ratio: 1; margin: clamp(4px, 1.5vh, 12px) 0; padding: 0; border: 0;
  background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.seal img { display: block; width: 100%; height: 100%; }
.gate:not(.ready) .seal { animation: gate-in 1.6s var(--ease) 0.4s both, breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.97); opacity: 0.9; } }
.seal:focus-visible { outline: 2px solid var(--copper); outline-offset: 8px; border-radius: 50%; }

html:not(.opened) .cue, html:not(.opened) .rsvp-pill, html:not(.opened) .chapters { opacity: 0 !important; pointer-events: none !important; }

/* ---------- petals ---------- */
.petals { position: fixed; inset: 0; z-index: 45; pointer-events: none; overflow: hidden; perspective: 600px; }
.petals img { position: absolute; height: auto; margin: -10px 0 0 -10px; }

/* ---------- the list of pages ---------- */
.chapters { position: fixed; z-index: 6; transition: opacity 0.8s var(--ease); }
.chapters ol { list-style: none; margin: 0; padding: 0; }
.chapters button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; padding: 0; }
.chapters button:focus-visible { outline: 2px solid var(--copper); outline-offset: 4px; border-radius: 4px; }
/* phones: a hairline of progress along the top */
.chapters { top: 0; left: 0; right: 0; height: 0; }
.chapters ol { display: none; }
.ch-bar { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 2px; background: rgba(181, 109, 38, 0.12); }
.ch-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--copper), var(--gold)); transform-origin: 0 50%; transform: scaleX(0); }
/* wide screens: the celebrations as a list beside the card, each one a place to jump to */
@media (min-aspect-ratio: 4/5) and (min-width: 900px) {
  .chapters { top: 50%; left: max(32px, calc(25vw - (100svh - 56px) * 9 / 64 - 150px)); right: auto; height: auto; transform: translateY(-50%);
    padding: 22px 28px 22px 26px; border-radius: 6px; background: rgba(250, 247, 238, 0.88);
    box-shadow: 0 0 0 1px rgba(181, 109, 38, 0.14), 0 20px 50px -24px rgba(63, 50, 20, 0.35); }
  .ch-bar { display: none; }
  .chapters ol { display: grid; gap: 4px; border-left: 1px solid rgba(181, 109, 38, 0.28); }
  .chapters li { position: relative; }
  .chapters li::before { content: ""; position: absolute; left: -4px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
    background: var(--paper); border: 1px solid rgba(181, 109, 38, 0.5); transition: background 0.5s var(--ease), transform 0.5s var(--ease); }
  .chapters li.on::before { background: var(--copper); border-color: var(--copper); transform: scale(1.3); }
  .chapters button { display: grid; padding: 9px 0 9px 22px; opacity: 0.5; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
  .chapters button:hover { opacity: 0.85; }
  .chapters li.on button { opacity: 1; transform: translateX(4px); }
  .chapters small { font-family: var(--caps); font-size: 11px; letter-spacing: 0.2em; color: var(--copper); min-height: 0; }
  .chapters small:empty { display: none; }
  .chapters span { font-size: 18px; color: var(--moss); }
}

/* ---------- the ending ---------- */
.end { padding-block: 72px 112px; gap: 18px; min-height: 70svh; align-content: center; box-sizing: border-box;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(227, 182, 92, 0.16), rgba(227, 182, 92, 0) 70%), var(--paper); }
html.at-end .chapters { opacity: 0; pointer-events: none; }
.end .ornament { width: 140px; height: 24px; }
.end-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 7vw, 40px); line-height: 1.15; color: var(--moss); max-width: 14ch; }
.end .end-count { font-style: normal; font-family: var(--caps); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--copper);
  display: grid; justify-items: center; gap: 2px; }
.end .end-count b { font-family: var(--display); font-weight: 400; font-size: 56px; letter-spacing: 0; line-height: 1; color: var(--moss); }
.btn-rsvp { position: relative; margin-top: 10px; min-width: 132px; min-height: 42px; font-family: var(--caps); font-size: 13px;
  letter-spacing: 0.24em; padding: 10px 26px 10px calc(26px + 0.24em); box-shadow: 0 10px 22px -12px rgba(63, 75, 24, 0.5);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.btn-rsvp:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(63, 75, 24, 0.6); }
.rsvp-pill { box-shadow: 0 10px 24px -8px rgba(63, 75, 24, 0.5); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transform: translateY(-6px); }
.rsvp-pill.show { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .gate:not(.ready) .seal { animation: none !important; }
}

/* ---------- turning pages: the invitation holds still on screen and turns page by page ---------- */
html.paged, html.paged body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.paged .theatre { touch-action: none; cursor: pointer; }
.paged .end { position: fixed; inset: 0; z-index: 8; overflow: hidden; min-height: 0; padding: 0; visibility: hidden; touch-action: none;
  display: grid; place-items: center; background: rgba(248, 244, 232, 0.6); }
/* the closing card: the cover's own flowers framing the last words */
.end-card { position: relative; width: min(100vw, calc(100svh * 9 / 16)); aspect-ratio: 9 / 16; container-type: inline-size; box-sizing: border-box;
  display: grid; justify-items: center; align-content: center; gap: 0; padding: 0; text-align: center;
  background: var(--paper) url("assets/cover/base.webp") center / cover no-repeat; }
.end-card > * { max-width: 62cqw; margin-block: 1.5cqw; }
.end-card .end-title { font-size: 8.4cqw; }
.end-card .end-count b { font-size: 15cqw; }
.end-card .end-count, .end-card .end-by { font-size: 2.9cqw; }
@media (min-aspect-ratio: 4/5) {
  .end-card { width: calc((100svh - 56px) * 9 / 16); border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(181, 109, 38, 0.14), 0 40px 90px -30px rgba(63, 50, 20, 0.45), 0 18px 40px -24px rgba(63, 50, 20, 0.3); }
}
.paged .cue { pointer-events: auto; cursor: pointer; }
.page { contain: layout style; }
.end-card { padding-top: 10cqw; }
.end-card .ornament { display: none; }
.end-card .end-count { margin-top: 4cqw; }
.end-card .end-by { margin-top: 4cqw; }
.end-card .btn-rsvp { margin-top: 5cqw; }
@media (max-aspect-ratio: 4/5) {
  .end-card { padding-top: 18cqw; }
  .end-card .end-title { font-size: 7.4cqw; }
}
