@charset "UTF-8";

:root {
  --ink: #782738;
  --body-ink: #595b59;
  --muted: #818480;
  --paper: #f5f4f0;
  --desk: #e7e6e1;
  /* Calligraphy names remain vector artwork; all live text shares this family. */
  --text-font: 'Lora', serif;
  --letter-copy-size: 17px;
  --detail-size: 13px;
  --caption-size: 10px;
  --ease: cubic-bezier(.22,.7,.19,1);
  --light-x: 38%;
  --light-y: 15%;
}
* { box-sizing: border-box; }
html { min-width: 0; background: var(--desk); scrollbar-gutter: stable; }
body { margin: 0; min-height: 100svh; color: var(--body-ink); font: 400 13px/1.75 var(--text-font); -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a { touch-action: manipulation; }
button { border: 0; }
button:disabled { cursor: default; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--ink); outline-offset: 7px; }
button[hidden], section[hidden], div[hidden], p[hidden], span[hidden] { display: none !important; }
.filter-defs { position: absolute; width: 0; height: 0; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ambient-light { position: fixed; z-index: -3; inset: 0; background: radial-gradient(ellipse at var(--light-x) var(--light-y), #fafaf7 0%, #efeee9 39%, #dfded8 100%); }
.desk-grain { position: fixed; z-index: -1; inset: 0; opacity: .1; filter: url(#paper-grain); pointer-events: none; mix-blend-mode: multiply; }
.window-shadow { position: fixed; z-index: -2; top: -23vh; left: -8vw; width: 62vw; height: 160vh; transform: rotate(-31deg); background: linear-gradient(90deg, transparent 3%, #504f3815 4%, #504f3815 6%, transparent 8%, transparent 42%, #504f3814 43%, #504f3814 46%, transparent 48%, transparent 79%, #504f3810 80%, #504f3810 84%, transparent 86%); filter: blur(13px); pointer-events: none; }
.paper { background: var(--paper); isolation: isolate; }
.paper::after { content: ''; position: absolute; z-index: -1; inset: 0; opacity: .105; filter: url(#paper-grain); mix-blend-mode: multiply; pointer-events: none; }
.masthead { position: relative; z-index: 4; height: 110px; max-width: 1600px; margin: auto; padding: 36px 5.3vw 24px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 21px; text-decoration: none; }
.brand img { width: 43px; height: 39px; opacity: .9; }
.brand span { font-size: 9px; letter-spacing: .24em; color: #817569; }
.event-switch { display: flex; align-items: center; gap: 23px; margin-left: auto; }
.event-switch button { position: relative; background: none; padding: 8px 0; font-size: 11px; color: #8b7f72; transition: color .2s; }
.event-switch button span { font: 400 15px var(--text-font); margin-left: 7px; }
.event-switch button::after { content: ''; position: absolute; left: 0; right: 0; height: 1px; bottom: 0; background: var(--ink); transform: scaleX(0); transition: transform .3s var(--ease); transform-origin: left; }
.event-switch button[aria-pressed="true"] { color: var(--ink); }
.event-switch button[aria-pressed="true"]::after { transform: scaleX(1); }
.switch-divider { height: 14px; width: 1px; background: #9c8e7c44; }
.close-card { display: flex; align-items: center; gap: 9px; background: none; margin-left: 20px; padding: 9px 0 9px 18px; border-left: 1px solid #9c8e7c44; font-size: 10px; }
.close-card svg { width: 20px; height: 20px; }
main { position: relative; }
.opening-stage { min-height: calc(100svh - 185px); display: flex; flex-direction: column; align-items: center; padding: 10px 24px 25px; justify-content: center; }
.stage-heading { display: flex; flex-direction: column; align-items: center; gap: 9px; margin: -10px 0 35px; color: #8a7767; transition: opacity .4s; }
.stage-heading p { margin: 0; font-size: 9px; letter-spacing: .29em; }
.tiny-diamond { font-family: var(--text-font); font-size: 22px; line-height: 1; color: #aa8b72; }
.envelope-scene { position: relative; width: min(660px, 70vw); aspect-ratio: 1.54; perspective: 1800px; margin: 15px 0 34px; }
.under-sheet { position: absolute; inset: 9px 7px -3px 9px; background: #eae4d8; transform: rotate(-4deg); border: 1px solid #d7d0c2; box-shadow: 2px 7px 12px #59452c14; transition: opacity .6s, transform .9s var(--ease); }
.envelope { position: relative; width: 100%; height: 100%; display: block; border-radius: 1px; padding: 0; background: transparent; transform: rotate(-2deg) rotateY(0deg); transform-style: preserve-3d; transition: transform 1.15s var(--ease), filter .5s; box-shadow: none; }
.envelope:hover { transform: rotate(-.8deg) translateY(-5px); }
.envelope-face { position: absolute; inset: 0; display: block; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1px solid #ded6c8; box-shadow: 1px 2px 2px #6f53340d, 5px 15px 24px -14px #48382048, 20px 32px 70px -27px #503c3054; }
.envelope-front { background: radial-gradient(ellipse at 27% 20%, #faf7ed, #eee8dc 100%); }
.front-border { position: absolute; inset: 12px; border: 1px solid #c6bbab15; }
.emboss-monogram { position: absolute; left: 50%; top: 43%; width: 30%; aspect-ratio: 550 / 503; transform: translate(-50%, -50%); display: block; filter: drop-shadow(var(--emboss-x, 1.1px) var(--emboss-y, 1.6px) 1px #6b5a3c72) drop-shadow(-1px -1.5px .7px #fffefa); }
.emboss-monogram span { display: block; width: 100%; height: 100%; background: linear-gradient(140deg, #f4f0e5, #e8e1d4 75%, #f6f0e4); mask: url('assets/monogram.svg') center / contain no-repeat; -webkit-mask: url('assets/monogram.svg') center / contain no-repeat; }
.envelope-recipient { position: absolute; left: 9%; bottom: 10.5%; display: flex; flex-direction: column; text-align: left; width: 42%; }
.recipient-label { font-size: 10px; color: #877b6b; margin-bottom: 2px; }
.envelope-recipient .guest-name { font-family: var(--text-font); font-style: italic; font-size: 27px; color: #6c5a4a; line-height: 1.5; overflow-wrap: anywhere; }
.recipient-rule { display: block; width: 100%; border-bottom: 1px solid #af9d8259; margin-top: 4px; }
.envelope-date { position: absolute; right: 9%; bottom: 11.5%; display: flex; flex-direction: column; gap: 4px; text-align: right; }
.envelope-date .event-date { font: 400 24px var(--text-font); color: #8c7964; letter-spacing: -.03em; }
.envelope-date > span:last-child { font-size: 8px; letter-spacing: .24em; color: #9a8974; }
.envelope-back { transform: rotateY(180deg); background: #e9e1d2; }
.envelope-lining { position: absolute; inset: 1px; background: linear-gradient(135deg, #c8baa7, #e7dece 40%, #d0c3af); }
.envelope-pocket { position: absolute; z-index: 2; inset: 0; background: linear-gradient(147deg, #f1eadc 49.8%, #c7bba7 50%, #f4eee1 50.3%); clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%); filter: drop-shadow(0 -2px 2px #79654533); }
.envelope-pocket::after { content: ''; position: absolute; inset: 0; background: linear-gradient(32deg, #f2ecdf 49.8%, #cfc2ac 50%, #f4eddf 50.3%); clip-path: polygon(0 100%, 50% 50%, 100% 100%); }
.envelope-flap { position: absolute; z-index: 4; inset: -1px -1px auto; height: 53%; background: linear-gradient(160deg, #f8f2e7, #eee5d6); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transform: rotateX(0); transition: transform .95s var(--ease); backface-visibility: visible; filter: drop-shadow(0 2px 2px #6a513a44); }
.sliding-letter { position: absolute; z-index: 1; inset: 7% 6% 5%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 25px; background-color: #f8f3e9; box-shadow: 0 1px 6px #49392722; transition: transform 1.2s var(--ease); }
.sliding-letter img { width: 23%; }
.sliding-letter > span { font-size: 8px; letter-spacing: .15em; }
.open-invitation { background: transparent; padding: 4px 16px; display: flex; align-items: center; gap: 13px; color: var(--ink); font-size: 11px; letter-spacing: .035em; transition: opacity .35s, transform .35s; }
.open-orbit { width: 36px; height: 36px; border: 1px solid #78273855; border-radius: 50%; display: grid; place-items: center; transition: background .3s, transform .4s; }
.open-orbit svg { width: 15px; height: 15px; }
.open-invitation:hover .open-orbit { background: #7827380b; transform: rotate(45deg); }
.opening-footnote { margin: 12px 0 0; font-family: var(--text-font); font-style: italic; font-size: 17px; color: #978879; }
body[data-state="turning"] .envelope, body[data-state="unsealing"] .envelope, body[data-state="unfolding"] .envelope { transform: rotate(0) rotateY(180deg); cursor: default; }
body[data-state="turning"] .under-sheet, body[data-state="unsealing"] .under-sheet, body[data-state="unfolding"] .under-sheet { opacity: 0; transform: rotate(0); }
body:not([data-state="closed"]) .stage-heading, body:not([data-state="closed"]) .open-invitation, body:not([data-state="closed"]) .opening-footnote { opacity: 0; pointer-events: none; }
body[data-state="unsealing"] .envelope-flap, body[data-state="unfolding"] .envelope-flap { transform: rotateX(178deg); }
body[data-state="unfolding"] .sliding-letter { transform: translateY(-73%); }
body[data-state="unfolding"] .envelope-scene { animation: envelope-exit .8s .95s var(--ease) both; }
@keyframes envelope-exit { to { opacity: 0; transform: translateY(70px) scale(.94); } }

.invitation { max-width: 1100px; margin: 0 auto; padding: 3px 48px 32px; outline: none; }
.invitation.is-revealing { animation: invitation-reveal 1.1s var(--ease) both; }
@keyframes invitation-reveal { from { opacity: 0; transform: translateY(-24px) scale(.93); } to { opacity: 1; transform: none; } }
.book-label { display: flex; align-items: center; justify-content: center; gap: 17px; margin: 2px 0 27px; font-size: 8px; letter-spacing: .23em; color: #7b827b; }
.book-label .line { width: 37px; height: 1px; background: #989f987a; }
.book { display: grid; grid-template-columns: 1fr 1fr; min-height: var(--book-height, 0); position: relative; filter: drop-shadow(0 1px 1px #2a2f2b2e) drop-shadow(4px 10px 12px #2a2f2b26) drop-shadow(14px 32px 34px #2a2f2b2e); perspective: 2000px; }
.book::before, .book::after { content: none; }
.book-page { container-type: inline-size; min-width: 0; position: relative; min-height: 590px; display: flex; flex-direction: column; padding: 27px 35px 20px; background-color: #fafbf9; }
.left-page { background-image: linear-gradient(90deg, #ffffff14 89%, #6169610c 98%, #4f584f22); border: 1px solid #adb5ad55; border-right: 0; }
.right-page { background-image: linear-gradient(90deg, #ffffff30, #ffffff55 1%, transparent 4%), linear-gradient(90deg, #505b5014, transparent 6%); border: 1px solid #adb5ad55; border-left: 1px solid #8c978c3b; }
.page-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 7px; letter-spacing: .22em; color: #7b827b; }
.page-number { font: italic 15px var(--text-font); letter-spacing: 0; }
.page-content { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 0 18px; }
.calligraphy { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; margin: 22px 0 20px; }
.love-note, .invitation-note { width: 100%; font: italic var(--letter-copy-size)/1.7 var(--text-font); text-align: justify; text-align-last: start; text-justify: inter-word; text-wrap: pretty; margin: 0; color: #5d645e; }
.invitation-note { margin: 18px 0; }
.signature { margin-top: auto; padding-top: 18px; opacity: .68; }
.signature img { width: 54px; height: 50px; }
.page-footer { display: block; text-align: center; font-size: 6px; letter-spacing: .17em; color: #7b827b; margin-top: auto; }
.event-content { padding-top: 23px; }
.invited-guest { margin: 0 0 12px; font: italic 18px var(--text-font); color: #5d645e; }
.invited-guest .guest-name { color: #5d645e; }
.gathering-copy { font-size: 11px; line-height: 1.9; margin: 0; }
.date-composition { display: flex; align-items: center; color: var(--ink); height: 121px; margin: 8px 0 0; font-family: var(--text-font); font-weight: 400; }
.date-day { font-size: 103px; line-height: 1; letter-spacing: -.065em; }
.date-stroke { height: 75px; width: 1px; background: #78273865; transform: rotate(23deg); margin: 10px 22px 0 24px; }
.date-month { display: flex; flex-direction: column; align-items: center; font-size: 51px; line-height: .85; padding-top: 12px; }
.date-month span { font-size: 24px; line-height: 1.5; letter-spacing: .045em; margin-top: 5px; }
.event-weekday { margin: 2px 0 13px; font-size: 7px; letter-spacing: .24em; color: #7b827b; }
.time-label { margin: 0 0 12px; font-size: 9px; color: #7b827b; }
.time-label strong { font: 400 25px var(--text-font); color: var(--ink); margin-left: 7px; }
.venue h2 { font: 500 26px/1.2 var(--text-font); color: var(--ink); margin: 0 0 5px; }
.venue p { margin: 0; font-size: 10px; line-height: 1.9; }
.venue .event-room { font-size: 8px; color: #7b827b; margin-top: 2px; }
.families { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; margin: 25px 0 20px; }
.families > div > span { font-size: 6px; letter-spacing: .15em; color: #7b827b; }
.families p { font-size: 9px; line-height: 1.9; margin: 4px 0 0; color: #5d645e; }
.event-actions { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: auto; padding-top: 4px; color: #7b827b; }
.text-action { display: inline-flex; align-items: center; gap: 5px; padding: 5px 0; border-bottom: 1px solid #7c857c44; background: transparent; text-decoration: none; font-size: 9px; color: #5d645e; transition: color .2s, border-color .2s; }
.text-action:hover { color: var(--ink); border-color: var(--ink); }
.text-action svg { width: 14px; height: 14px; }
/* The rail stays outside the paper, including on narrow screens. */
.book-navigation { position: fixed; z-index: 5; right: max(16px, calc((100vw - 1160px) / 2)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 7px; width: 88px; padding: 7px; border: 1px solid #b4bcb45c; border-radius: 28px; background: #fafbf9ed; box-shadow: 0 5px 20px #353a3512; backdrop-filter: blur(12px); }
.book-navigation button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: none; padding: 9px 1px; min-height: 52px; border-radius: 21px; font-size: 8px; color: #6c736d; transition: background .2s, color .2s; }
.book-navigation button > span:first-child { font: italic 14px var(--text-font); }
.book-navigation button[aria-pressed="true"] { color: var(--ink); background: #7827380b; }
.section-kicker { color: #7b827b; font-size: 8px; letter-spacing: .16em; }
.ceremony-intro, .thanks-intro { justify-content: center; padding-top: 34px; }
.ceremony-intro h2, .thanks-intro h2 { font: 400 43px/1.1 var(--text-font); color: var(--ink); margin: 25px 0 22px; letter-spacing: -.03em; }
.ceremony-intro h2 em, .thanks-intro h2 em { font-weight: 400; }
.ceremony-intro > p { font-size: 9px; margin: 0; }
.ceremony-intro .couple-serif { font: 400 27px/1.35 var(--text-font); color: var(--ink); margin: 20px 0; }
.couple-serif span { font-style: italic; font-size: 23px; }
.ceremony-intro .lunar-date { font: 400 17px/1.5 var(--text-font); }
.lunar-date span { font: 400 8px var(--text-font); color: #7b827b; }
.ceremony-details { align-items: stretch; text-align: left; justify-content: center; padding-top: 30px; }
.ceremony-item { display: grid; grid-template-columns: 75px 1fr; gap: 11px; padding: 17px 0; border-bottom: 1px solid #a3ada343; }
.ceremony-time { font: 400 30px/1.25 var(--text-font); color: var(--ink); }
.ceremony-item h3 { font: 500 23px/1.25 var(--text-font); color: var(--ink); margin: 0 0 4px; }
.ceremony-item p { font-size: 8px; line-height: 1.9; margin: 0; color: #7b827b; }
.second-date { margin-top: 20px; }
.thanks-monogram { width: 138px; height: 130px; margin: 20px 0 31px; opacity: .78; }
.thanks-content { text-align: left; align-items: flex-start; justify-content: center; padding: 30px 8px 24px; }
.thank-you-title { font: 400 58px/1.05 var(--text-font); color: var(--ink); margin: 25px 0 !important; letter-spacing: -.025em; }
.handwritten-signoff { font: italic 26px var(--text-font); align-self: flex-end; color: var(--ink); margin: 4px 0 0; }
.desk-footer { position: relative; z-index: 1; min-height: 75px; max-width: 1600px; margin: 0 auto; padding: 18px 5.3vw 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #988876; }
.desk-footer > span:first-child { font-size: 7px; letter-spacing: .18em; }
.footer-message { font: italic 17px var(--text-font); position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.footer-mark { font: 400 21px var(--text-font); letter-spacing: .11em; opacity: .6; }
.footer-mark i { font-size: 16px; }
.noscript-message { padding: 20px; max-width: 700px; margin: auto; background: var(--paper); }
@media (min-width: 1500px) { .envelope-scene { width: 730px; } .opening-stage { padding-top: 25px; } .stage-heading { margin-bottom: 40px; } }
@media (min-width: 1000px) and (max-height: 850px) { .masthead { height: 90px; padding-top: 23px; } .opening-stage { min-height: calc(100svh - 150px); } .stage-heading { margin-bottom: 15px; } .envelope-scene { width: min(590px, 65vw); margin-bottom: 24px; } .desk-footer { min-height: 60px; padding-top: 12px; padding-bottom: 16px; } .invitation { max-width: 970px; } .book-page { min-height: 555px; padding-top: 20px; } .calligraphy { margin-top: 12px; } .book-label { margin-bottom: 17px; } }
@media (max-width: 900px) {
  .masthead { padding-inline: 5vw; gap: 20px; }
  .brand span { display: none; }
  .close-card { margin-left: 0; }
  .envelope-scene { width: min(640px, 80vw); }
  .invitation { padding-inline: 35px; }
  .book-page { padding-inline: 25px; min-height: 570px; }
  :root { --letter-copy-size: 16px; }
  .calligraphy { margin-top: 30px; }
  .families { gap: 8px; }
  .families p { font-size: 8px; }
  .venue h2 { font-size: 23px; }
  .ceremony-intro h2, .thanks-intro h2 { font-size: 36px; }
  .ceremony-item { grid-template-columns: 65px 1fr; }
  .ceremony-time { font-size: 26px; }
  .ceremony-item h3 { font-size: 20px; }
  .thank-you-title { font-size: 48px; }
}
@media (max-width: 600px) {
  .masthead { height: 91px; padding: 23px 23px 18px; gap: 16px; }
  .brand img { width: 34px; height: 32px; }
  .event-switch { gap: 13px; }
  .event-switch button { font-size: 10px; }
  .event-switch button span { font-size: 13px; margin-left: 4px; }
  .close-card { padding-left: 12px; }
  .close-card > span { display: none; }
  .close-card svg { width: 19px; }
  .opening-stage { min-height: calc(100svh - 166px); padding: 10px 18px 32px; }
  .stage-heading { margin: -25px 0 34px; gap: 12px; }
  .stage-heading p { font-size: 7px; letter-spacing: .25em; }
  .envelope-scene { width: 91%; aspect-ratio: 1.32; margin: 22px 0 40px; }
  .under-sheet { inset: 6px 5px -2px; transform: rotate(-5deg); }
  .envelope { transform: rotate(-3deg); }
  .envelope-front { box-shadow: 2px 3px 3px #4937200c, 9px 20px 36px -15px #5d472d42, 13px 35px 60px -30px #6b503344; }
  .front-border { inset: 8px; }
  .emboss-monogram { width: 36%; top: 40%; filter: drop-shadow(.7px 1px .65px #6b5a3c7c) drop-shadow(-.8px -1px .5px #fffefa); }
  .envelope-recipient { left: 8.5%; bottom: 11%; width: 46%; }
  .recipient-label { font-size: 7px; }
  .envelope-recipient .guest-name { font-size: 23px; }
  .envelope-date { right: 8%; bottom: 12%; }
  .envelope-date .event-date { font-size: 18px; }
  .envelope-date > span:last-child { font-size: 6px; }
  .open-invitation { font-size: 10px; gap: 12px; }
  .open-orbit { width: 33px; height: 33px; }
  .opening-footnote { font-size: 16px; margin-top: 14px; }
  .sliding-letter > span { font-size: 5px; }
  .sliding-letter { gap: 18px; }
  .invitation { padding: 0 22px 25px; }
  .book-label { margin: 6px 0 23px; font-size: 6px; letter-spacing: .21em; gap: 12px; }
  .book-label .line { width: 25px; }
  .book { display: block; filter: drop-shadow(0 1px 1px #2a2f2b2e) drop-shadow(3px 7px 9px #2a2f2b26) drop-shadow(9px 22px 24px #2a2f2b2b); }
  .book-page { min-height: auto; padding: 24px 27px; }
  .left-page { border: 1px solid #adb5ad55; border-bottom: 0; background-image: linear-gradient(0deg, #6169610b, transparent 8%); }
  .right-page { border: 1px solid #adb5ad55; border-top: 1px dashed #909b9037; background-image: linear-gradient(180deg, #505b5007, transparent 7%); padding-top: 25px; }
  .page-header { font-size: 6px; }
  .page-content { padding: 22px 0 10px; }
  .calligraphy { width: 100%; margin: 6px 0 15px; }
  .invitation-note { margin: 15px 0 9px; }
  .signature { display: none; }
  .page-footer { font-size: 5px; margin-top: 20px; }
  .left-page .page-footer { display: none; }
  .event-content { padding-top: 18px; }
  .invited-guest { font-size: 19px; }
  .gathering-copy { font-size: 10px; }
  .date-composition { height: 134px; margin-top: 6px; }
  .date-day { font-size: 112px; }
  .date-month { font-size: 56px; }
  .date-month span { font-size: 26px; }
  .event-weekday { font-size: 8px; }
  .time-label { font-size: 10px; margin-top: 4px; }
  .time-label strong { font-size: 28px; }
  .venue h2 { font-size: 28px; margin-top: 3px; }
  .venue p { font-size: 10px; }
  .venue .event-room { font-size: 9px; }
  .families { gap: 10px; margin: 27px 0 21px; }
  .families > div > span { font-size: 7px; }
  .families p { font-size: 8px; }
  .text-action { font-size: 10px; min-height: 38px; }
  .event-actions { gap: 18px; }
  .ceremony-intro, .thanks-intro { padding-block: 25px 20px; }
  .ceremony-intro h2, .thanks-intro h2 { font-size: 43px; }
  .ceremony-intro .couple-serif { font-size: 31px; }
  .ceremony-intro .lunar-date { font-size: 18px; }
  .lunar-date span { font-size: 8px; }
  .ceremony-details { padding-block: 20px 7px; }
  .ceremony-item { grid-template-columns: 75px 1fr; padding-block: 19px; }
  .ceremony-time { font-size: 31px; }
  .ceremony-item h3 { font-size: 24px; }
  .ceremony-item p { font-size: 9px; }
  .section-kicker { font-size: 7px; }
  .thanks-monogram { width: 120px; height: 112px; margin: 15px 0 25px; }
  .thanks-content { padding: 20px 3px 10px; }
  .thank-you-title { font-size: 55px; }
  .desk-footer { padding: 15px 23px 25px; min-height: 75px; }
  .desk-footer > span:first-child { font-size: 6px; max-width: 130px; line-height: 2; }
  .footer-message { position: static; transform: none; font-size: 14px; white-space: normal; max-width: 140px; text-align: right; }
  .footer-mark { display: none; }
  .window-shadow { width: 110vw; left: -40vw; }
}
@media (max-width: 360px) { .masthead { padding-inline: 18px; gap: 10px; } .event-switch { gap: 9px; } .event-switch button { font-size: 9px; } .invitation { padding-inline: 16px; } .book-page { padding-inline: 23px; } .families p { font-size: 7px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .envelope:hover { transform: rotate(-2deg); }
}

/* Three continuous sheets; no wheel interception or hidden content panels. */
body[data-state="open"], body[data-state="entering"] { --reading-header: 110px; }
body[data-state="open"] .masthead, body[data-state="entering"] .masthead { position: sticky; top: 0; background: linear-gradient(#e9e8e3 0, #e9e8e3f2 62%, #e9e8e300 100%); }
body[data-state="open"] .window-shadow { opacity: .4; }
.invitation { max-width: 1160px; padding-inline: 42px 120px; }
.invitation-sheet { min-height: calc(100svh - var(--reading-header, 110px)); padding-block: 12px 55px; scroll-margin-top: calc(var(--reading-header, 110px) + 12px); display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; }
.invitation-sheet + .invitation-sheet { padding-top: 30px; }
@media (min-width: 1000px) and (max-height: 850px) {
  body[data-state="open"], body[data-state="entering"] { --reading-header: 90px; }
}
@media (max-width: 600px) {
  body[data-state="open"], body[data-state="entering"] { --reading-header: 91px; }
  .invitation { padding-inline: 12px; padding-bottom: 84px; }
  .invitation-sheet { min-height: 0; padding-block: 4px 38px; }
  .invitation-sheet + .invitation-sheet { padding-top: 14px; }
  .book-navigation { top: auto; right: auto; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); flex-direction: row; width: auto; padding: 4px; gap: 2px; border-radius: 26px; }
  .book-navigation button { min-height: 46px; min-width: 78px; padding: 5px 8px; font-size: 8px; gap: 1px; }
  .book-navigation button > span:first-child { font-size: 14px; }
  .book { min-width: 0; }
  .book-page { padding-inline: 23px; }
  .date-day { font-size: clamp(80px, 25vw, 112px); }
  .date-month { font-size: clamp(40px, 12vw, 56px); }
  .date-month span { font-size: 23px; }
  .date-stroke { height: 65px; margin-inline: 12px 13px; }
  .ceremony-intro h2, .thanks-intro h2 { font-size: clamp(29px, 9vw, 43px); }
  .ceremony-intro .couple-serif { font-size: 27px; }
  .ceremony-intro .lunar-date { font-size: 15px; }
  .ceremony-item { grid-template-columns: 60px 1fr; gap: 7px; }
  .ceremony-time { font-size: 25px; }
  .ceremony-item h3 { font-size: 21px; }
  .thank-you-title { font-size: clamp(37px, 12vw, 55px); }
}
@media (max-width: 360px) {
  .book-navigation button { min-width: 70px; }
  .book-page { padding-inline: 18px; }
}

/* Desktop: the three sheets sit side by side; wheel and trackpad gestures turn them sideways. */
@media (min-width: 900px) {
  body[data-state="open"] .desk-footer, body[data-state="entering"] .desk-footer { display: none; }
  .invitation { display: flex; max-width: none; height: calc(100svh - var(--reading-header, 110px)); padding: 0; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
  .invitation::-webkit-scrollbar { display: none; }
  .invitation-sheet, .invitation-sheet + .invitation-sheet { flex: 0 0 100%; min-width: 0; height: 100%; min-height: 0; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; padding: 14px max(56px, calc((100% - 1000px) / 2)) 86px; align-content: safe center; scrollbar-width: thin; }
  .book-navigation { top: auto; bottom: 22px; right: auto; left: 50%; transform: translateX(-50%); flex-direction: row; width: auto; gap: 4px; padding: 5px; border-radius: 30px; }
  .book-navigation button { flex-direction: row; gap: 8px; min-height: 40px; padding: 6px 18px; font-size: 9px; }
  .book-navigation button > span:first-child { font-size: 13px; }
  .invitation-sheet > * { zoom: var(--fit, 1); }
  /* Nothing scrolls under the header here, so it needs no band of its own. */
  body[data-state="open"] .masthead, body[data-state="entering"] .masthead { background: transparent; backdrop-filter: none; }
  .invitation.is-entering { position: relative; }
}
@media (min-width: 900px) and (max-height: 760px) {
  .book-page { min-height: 520px; }
  .invitation-sheet, .invitation-sheet + .invitation-sheet { padding-bottom: 80px; }
  .book-navigation { bottom: 14px; }
}

/* Content follows the printed PDFs word for word. */
.invited-guest { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 400 13px/1.5 var(--text-font); color: #5d645e; }
/* No guest name: an empty dotted line, as on the printed card. */
.guest-name:empty { display: inline-block; width: min(190px, 80%); height: 1.3em; border-bottom: 1px dotted #9aa19a; }
.invited-guest .guest-name:not(:empty) { font: italic 19px/1.3 var(--text-font); }
.couple-line { margin: 12px 0 0; font: 400 19px/1.3 var(--text-font); letter-spacing: .06em; color: var(--ink); }
.event-content .date-composition { margin-top: 4px; }
.event-content .time-label { margin-top: 6px; }
.venue .event-room { font-size: 9px; color: #5d645e; margin: 0 0 4px; }
.event-families.is-bride > div:first-child { order: 2; }
.rite { justify-content: center; gap: 0; }
.rite-title { margin: 0 0 26px; font: 500 17px/1.3 var(--text-font); letter-spacing: .14em; color: var(--ink); }
.rite-names { margin: 0 0 24px; font: 400 27px/1.4 var(--text-font); letter-spacing: .07em; color: var(--ink); }
.rite-note { margin: 0 0 6px; font-size: 8px; letter-spacing: .12em; color: #5d645e; }
.rite-time { margin: 0 0 6px; font: 400 30px/1.2 var(--text-font); letter-spacing: .03em; color: var(--ink); }
.time-bar { display: inline-block; width: 1px; height: .7em; margin: 0 .45em; vertical-align: -.02em; overflow: hidden; color: transparent; background: #78273870; }
.rite-lunar { margin: 0 0 26px; font-size: 8px; letter-spacing: .12em; color: #5d645e; }
.rite .families { margin: 6px 0 0; }
.thanks-intro { justify-content: center; }
.thanks-intro .thanks-monogram { width: 58%; height: auto; margin: 0; opacity: .85; }
.thanks-content { justify-content: center; text-align: justify; padding: 30px 0 24px; }
.thanks-content > p { width: 100%; font: italic var(--letter-copy-size)/1.7 var(--text-font); text-align: justify; text-align-last: start; text-justify: inter-word; text-wrap: pretty; color: #5d645e; margin: 0 0 22px; }
.thanks-content > p:last-child { margin-bottom: 0; }
.desk-footer > span:first-child .event-date { letter-spacing: inherit; }
@media (max-width: 900px) {
  .rite-names { font-size: 23px; }
  .rite-time { font-size: 26px; }
}
@media (max-width: 600px) {
  .couple-line { font-size: clamp(13px, 4.1vw, 18px); white-space: nowrap; letter-spacing: .04em; }
  .rite { padding-block: 22px 14px; }
  .rite-title { font-size: 16px; margin-bottom: 20px; }
  .rite-names { font-size: clamp(20px, 6.4vw, 26px); margin-bottom: 18px; }
  .rite-time { font-size: clamp(22px, 7.4vw, 28px); }
  .rite-lunar { margin-bottom: 20px; }
  .thanks-intro .thanks-monogram { width: 46%; margin: 10px 0; }
}

/* Typography reviewed across invitation, ceremony and thanks. */
.gathering-copy { font-size: var(--detail-size); line-height: 1.75; }
.time-label { font-size: var(--detail-size); }
.venue p, .venue .event-room { font-size: var(--detail-size); line-height: 1.65; text-wrap: pretty; }
.venue h2 { font-size: 25px; line-height: 1.35; text-wrap: balance; }
.venue .event-address { margin-top: 6px; }
.couple-line { display: flex; flex-wrap: wrap; justify-content: center; column-gap: .35em; width: 100%; font-size: 19px; line-height: 1.5; letter-spacing: .025em; white-space: normal; }
.couple-line > span { white-space: nowrap; }
.families { column-gap: 16px; align-items: start; }
.families > div { min-width: 0; }
.families > div > span { display: block; font-size: var(--caption-size); line-height: 1.5; letter-spacing: .1em; }
.families p { font-size: 12px; line-height: 1.8; margin-top: 7px; }
.rite-title { font-size: 18px; letter-spacing: .1em; }
.rite-note, .rite-lunar { font-size: 11px; line-height: 1.7; letter-spacing: .045em; text-wrap: balance; }
.rite-note { max-width: 34ch; }
.rite-time { white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0; }
.page-footer { font-size: 9px; letter-spacing: .1em; }
.book-label { font-size: 10px; letter-spacing: .16em; }
.text-action { font-size: 12px; }
.book-navigation button { font-size: 11px; }
@media (max-width: 900px) {
  :root { --detail-size: 12px; }
}
@media (max-width: 600px) {
  .couple-line { font-size: 17px; }
  .date-day { font-size: clamp(80px, 24vw, 98px); }
  .date-month { font-size: clamp(40px, 12vw, 48px); }
  .venue h2 { font-size: 24px; }
  .families p { font-size: 12px; }
  .rite-title { font-size: 18px; }
  .rite-time { font-size: clamp(22px, 6.5vw, 28px); }
  .thanks-content { padding-inline: 0; }
  .book-label { font-size: 9px; letter-spacing: .1em; gap: 10px; }
  .book-navigation button { font-size: 10px; }
}
@container (max-width: 300px) {
  .families { grid-template-columns: 1fr; row-gap: 16px; }
}
@media (min-width: 900px) and (max-height: 850px) {
  /* Reduce decorative space before the shared fit scales readable text down. */
  .book-page { padding-block: 18px 14px; }
  .page-content { padding-block: 14px 12px; }
  .calligraphy { max-height: 180px; margin-block: 12px 16px; }
  .signature { padding-top: 10px; }
  .signature img { width: 42px; height: 40px; }
  .event-content .date-composition { height: 108px; }
  .families { margin-block: 18px 12px; }
  .book-label { margin-bottom: 16px; }
}

@media (max-width: 600px) {
  .event-switch button { font-size: 10px; }
  .desk-footer > span:first-child { font-size: 10px; letter-spacing: .1em; }
}

/* Only the moving leaf is WebGL; settled pages remain accessible live HTML. */
.page-turn-canvas { position: fixed; z-index: 4; pointer-events: none; }
.is-page-turning .invitation { overflow: hidden; }
/* Keep the original book silhouette and its exact shadow throughout the turn. */
.is-turn-source > .book::before { content: ''; position: absolute; inset: 0; background: #fafbf9; }
.is-turn-source > .book > .book-page { visibility: hidden; }
.is-page-turning .book-navigation { pointer-events: none; }
@media (min-width: 900px) { .invitation { touch-action: pan-y; } }
