@font-face {
  font-family: "Wedding Serif";
  src: url("assets/fonts/wedding-serif.woff2?v=20261101-bride") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Wedding Script";
  src: url("assets/fonts/italianno.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  --paper: #f6f1e8;
  --wine: #762d34;
  --ink: #352a25;
  --muted: #796963;
  --line: #b58b86;
  --u: min(1vw, 4.8px);
  /* Sizes follow the existing 480px invitation canvas, not the outer viewport. */
  --cover-title-size: calc(var(--u) * 11.8);
  --couple-name-size: calc(var(--u) * 7.458333);
  --story-title-size: calc(var(--u) * 7.016667);
  font-family: "Wedding Serif", "Songti SC", "STSong", serif;
  color: var(--ink);
  background: #e9e2d8;
  font-synthesis: none;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
body.modal-open { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
a { color: var(--wine); text-decoration: none; }
button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--wine); outline-offset: 5px;
}
img { display: block; max-width: 100%; }
p, h1, h2, h3, figure { margin: 0; }
h1, h2, h3 { font-weight: 550; }
svg { fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 10; background: var(--paper); padding: 12px; }
.skip-link:focus { top: 12px; }
.invitation {
  width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--paper) url("assets/paper.webp") repeat;
  background-size: 420px;
  overflow: clip;
  box-shadow: 0 0 70px #5b423215;
}
.cover { padding: calc(var(--u) * 7) calc(var(--u) * 7.5) calc(var(--u) * 7); text-align: center; }
.invitation-line { display: flex; align-items: center; gap: 13px; color: var(--wine); font-size: calc(var(--u) * 4.1); letter-spacing: .24em; white-space: nowrap; }
.invitation-line::before, .invitation-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.invitation-line span { padding-left: .24em; }
h1 { color: var(--wine); font-size: var(--cover-title-size); line-height: 1.5754; letter-spacing: -.055em; margin-top: calc(var(--u) * 2.4); white-space: nowrap; }
.script { font-family: "Wedding Script", "Apple Chancery", cursive; color: var(--wine); font-weight: 400; line-height: 1; }
.cover-script { font-size: calc(var(--u) * 7.8); text-align: right; margin-top: calc(var(--u) * -1); margin-right: calc(var(--u) * -1); }
.ribbon { display: block; width: 100%; height: calc(var(--u) * 11); color: var(--wine); stroke-width: 1.05; }
.ribbon-detail { opacity: .7; stroke-width: .75; }
.cover-ribbon { height: calc(var(--u) * 9); margin-top: calc(var(--u) * -2.2); margin-bottom: calc(var(--u) * 1.3); }
.photo-frame { display: block; width: 100%; padding: 3px; background: transparent; border: 1px solid var(--wine); border-radius: 13px; overflow: hidden; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; transition: transform .7s ease; }
.photo-frame:hover img { transform: scale(1.015); }
.cover-photo { width: 88%; margin-inline: auto; aspect-ratio: .735; }
.cover-photo img { object-position: 50% 66%; transform: scale(1.14); }
.cover-photo:hover img { transform: scale(1.155); }
.couple-names { display: flex; justify-content: center; align-items: center; gap: .38em; color: var(--wine); font-size: var(--couple-name-size); font-weight: 550; white-space: nowrap; line-height: 1.5; margin-top: calc(var(--u) * 3.8); }
.ampersand { flex: 0 0 .9em; text-align: center; font: italic 400 1.08em/1 Georgia, serif; }
.cover-date { display: flex; justify-content: center; align-items: center; gap: calc(var(--u) * 2.2); font-size: calc(var(--u) * 4.25); margin-top: calc(var(--u) * 1.7); white-space: nowrap; }
.cover-date time { font-family: Georgia, "Times New Roman", serif; letter-spacing: .13em; font-size: calc(var(--u) * 4.7); }
.cover-place { display: flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; margin: calc(var(--u) * 2.2) auto 0; padding: 4px 8px; border: 0; background: none; color: var(--wine); font-size: calc(var(--u) * 4.15); letter-spacing: .06em; }
.cover-place svg { width: 1em; height: 1em; flex: none; }
button.text-link { border: 0; background: none; cursor: pointer; }
.scroll-cue { display: flex; align-items: center; flex-direction: column; gap: 8px; min-height: 44px; margin-top: calc(var(--u) * 4); color: var(--ink); font-size: calc(var(--u) * 3.4); letter-spacing: .12em; }
.scroll-cue svg { width: 22px; height: 22px; color: var(--wine); animation: invite-down 2.8s ease-in-out infinite; }
@keyframes invite-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.section-pad { padding: calc(var(--u) * 10) calc(var(--u) * 7.5); text-align: center; }
.story { padding-top: calc(var(--u) * 6); }
.story-title { font-size: var(--story-title-size); color: var(--wine); line-height: 1.4; font-weight: 500; margin-top: calc(var(--u) * 2.5); letter-spacing: -.02em; }
.story-script { font-size: calc(var(--u) * 9.2); margin: calc(var(--u) * 2) 0 calc(var(--u) * 6); }
.garden-photo { aspect-ratio: 2 / 3; }
.garden-photo img { object-position: center; }
.chapter-label { color: var(--muted); font-size: max(11px, calc(var(--u) * 2.8)); line-height: 1.9; margin-top: calc(var(--u) * 5); }
.garden-pair { display: grid; grid-template-columns: 1.25fr 1fr; gap: calc(var(--u) * 3.2); align-items: start; margin: calc(var(--u) * 8) 0 calc(var(--u) * 5); }
.garden-pair .photo-frame, .portrait-pair .photo-frame { border: 0; border-radius: 0; padding: 0; }
.garden-pair .photo-frame img, .portrait-pair .photo-frame img { border-radius: 0; }
.window-moment { margin-top: calc(var(--u) * 17); }
.window-photo { aspect-ratio: 552 / 789; }
.window-moment figcaption { font: calc(var(--u) * 8)/1.2 "Wedding Script", cursive; color: var(--wine); text-align: right; margin-top: 12px; }
.story-letter { width: 87%; margin: calc(var(--u) * 9) auto 0; text-align: left; font-size: max(14px, calc(var(--u) * 3.55)); line-height: 2.05; letter-spacing: .035em; }
.chapter-number { display: block; color: var(--muted); font: 10px/1.6 Georgia, serif; letter-spacing: .2em; margin-bottom: 17px; }
.story-letter p + p { margin-top: 20px; }
.story-emphasis { color: var(--wine); }
.portrait-chapter { margin-top: calc(var(--u) * 17); }
.portrait-script { font-size: calc(var(--u) * 16); text-align: left; margin-bottom: calc(var(--u) * 5); }
.portrait-pair { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--u) * 4.2); }
.portrait-moment:nth-child(2) { padding-top: calc(var(--u) * 12); }
.portrait-photo { aspect-ratio: 433 / 648; }
.portrait-moment figcaption { text-align: left; color: var(--wine); font-size: max(15px, calc(var(--u) * 4)); margin-top: 13px; }
.portrait-moment figcaption span { display: block; font: 9px/1.7 Georgia, serif; letter-spacing: .17em; color: var(--muted); margin-bottom: 4px; }
.story-letter h3 { color: var(--wine); font-size: max(19px, calc(var(--u) * 4.8)); line-height: 1.7; margin-bottom: 16px; }
.gallery-heading { margin-top: calc(var(--u) * 16); }
.promise { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: calc(var(--u) * 13) 0 calc(var(--u) * 2); color: var(--wine); }
.promise > svg { width: 23px; height: 23px; stroke-width: 1; }
.promise > p { font-size: calc(var(--u) * 7); line-height: 1.6; letter-spacing: .12em; padding-left: .12em; }
.promise > .script { font-size: calc(var(--u) * 8); }
.poem { font-size: calc(var(--u) * 5); line-height: 1.9; margin-top: calc(var(--u) * 6); letter-spacing: .06em; }
.photo-hint { font-size: max(12px, calc(var(--u) * 3.1)); color: var(--muted); letter-spacing: .09em; margin-top: calc(var(--u) * 3.791667); }
.moment { margin-top: calc(var(--u) * 12); }
.landscape-photo { aspect-ratio: 3 / 2; border-radius: 3px; }
.landscape-photo img { border-radius: 0; }
.moment figcaption { font-size: calc(var(--u) * 4.2); margin-top: calc(var(--u) * 4); letter-spacing: .05em; }
.celebration { padding-top: calc(var(--u) * 8); }
.orchid { width: 100%; height: auto; margin: 0 auto calc(var(--u) * 4.5); }
.section-title { font-size: calc(var(--u) * 12); color: var(--wine); letter-spacing: .04em; line-height: 1.4; }
.small-names { font-size: calc(var(--u) * 7.6); margin-top: calc(var(--u) * 3); }
.small-names .ampersand { font-size: calc(var(--u) * 12); }
.invitation-letter { font-size: calc(var(--u) * 4.5); line-height: 2.05; letter-spacing: .06em; margin: calc(var(--u) * 8) 0 calc(var(--u) * 6); }
.invitation-letter p + p { margin-top: calc(var(--u) * 3.5); }
.invitation-letter .letter-signoff { color: var(--muted); font-size: .88em; margin-top: 24px; }
.small-ribbon { height: calc(var(--u) * 7); }
.wedding-date { margin-top: calc(var(--u) * 6); }
.wedding-date time { color: var(--wine); font-size: calc(var(--u) * 8.1); white-space: nowrap; letter-spacing: -.025em; }
.wedding-date p { font-size: calc(var(--u) * 4.8); margin-top: calc(var(--u) * 2.5); }
.wedding-date > p:not(.ceremony-time) { font-size: max(14px, calc(var(--u) * 3.7)); }
.wedding-date .ceremony-time { display: flex; justify-content: center; align-items: center; gap: 12px; color: var(--wine); margin-top: 22px; }
.ceremony-time > span { font-size: 13px; letter-spacing: .12em; }
.ceremony-time > strong { font: 400 calc(var(--u) * 9)/1.2 Georgia, serif; letter-spacing: .05em; }
.calendar { width: 90%; margin: calc(var(--u) * 6) auto 0; table-layout: fixed; border-collapse: collapse; font-size: calc(var(--u) * 3.5); font-family: Georgia, "Wedding Serif", serif; }
.calendar th { font: 400 calc(var(--u) * 3.3) "Wedding Serif", serif; color: var(--wine); border-bottom: 1px solid #b58b8659; padding-bottom: 10px; }
.calendar td { height: calc(var(--u) * 9); text-align: center; }
.wedding-day { position: relative; color: var(--wine); }
.wedding-day span { position: relative; z-index: 1; font-weight: 700; }
.wedding-day svg { position: absolute; width: calc(var(--u) * 9); height: calc(var(--u) * 9); left: 50%; top: 50%; transform: translate(-50%, -49%); stroke-width: .9; }
.text-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; font-size: max(13px, calc(var(--u) * 3.4)); color: var(--wine); text-underline-offset: 5px; }
.text-link:hover { text-decoration: underline; }
.calendar-link { margin-top: 13px; border-bottom: 1px solid #b58b8670; min-height: 36px; }
.venue { margin-top: calc(var(--u) * 13); }
.location-icon { width: 25px; height: 28px; color: var(--wine); margin: 0 auto 12px; }
.venue h3 { color: var(--wine); font-size: calc(var(--u) * 7.8); white-space: nowrap; letter-spacing: -.02em; }
.venue-hall { color: var(--wine); font-size: max(16px, calc(var(--u) * 4.6)); letter-spacing: .14em; margin-top: 12px; }
address { font-style: normal; font-size: max(14px, calc(var(--u) * 3.8)); line-height: 1.9; margin: calc(var(--u) * 4) 0 calc(var(--u) * 6); }
.outline-button, .solid-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 29px; border: 1px solid var(--wine); border-radius: 28px; font-size: 17px; letter-spacing: .1em; line-height: 1.5; transition: background .2s, color .2s; }
.outline-button { color: var(--wine); background: transparent; }
.solid-button, .outline-button:hover { background: var(--wine); color: var(--paper); }
.venue .outline-button { width: min(100%, calc(var(--u) * 39.283333)); min-height: 44px; padding: 6px 16px; font-size: max(16px, calc(var(--u) * 3.958333)); }
.venue + .small-ribbon { margin-top: calc(var(--u) * 11); }
.closing-line { margin-top: calc(var(--u) * 4.5); font-size: calc(var(--u) * 4.7); letter-spacing: .1em; }
.farewell-photo { margin-top: calc(var(--u) * 9); }
.farewell { margin-top: calc(var(--u) * 8); font-size: calc(var(--u) * 7.2); color: var(--wine); }
.farewell-script { margin-top: 12px; font-size: calc(var(--u) * 8); }
.back-to-top { margin-top: calc(var(--u) * 6); }
footer { color: var(--muted); text-align: center; font-size: 11px; letter-spacing: .04em; padding: 0 52px max(28px, env(safe-area-inset-bottom)); }
footer > p span { padding: 0 3px; }
dialog { border: 0; padding: 0; }
dialog::backdrop { background: #211a16bd; backdrop-filter: blur(5px); }
.photo-viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; background: #171513; color: var(--paper); margin: 0; overflow: hidden; }
.photo-viewer[open] { display: flex; flex-direction: column; }
.viewer-top, .viewer-bottom { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; }
.viewer-top { padding-top: max(12px, env(safe-area-inset-top)); }
.viewer-top p { font: 15px/1.4 Georgia, serif; letter-spacing: .1em; }
.viewer-bottom { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.viewer-bottom p { font-size: 15px; text-align: center; }
.viewer-stage { min-height: 0; flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px; position: relative; }
.viewer-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.viewer-stage #photo-error { position: absolute; inset: 45% 20px auto; text-align: center; font-size: 14px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; background: transparent; border: 1px solid #ffffff38; color: inherit; border-radius: 50%; }
.icon-button svg { width: 22px; height: 22px; }
.photo-viewer button:focus-visible { outline-color: var(--paper); }
.location-dialog { width: min(88vw, 400px); max-height: 88dvh; padding: 42px 24px 16px; text-align: center; background: var(--paper) url("assets/paper.webp"); background-size: 420px; color: var(--ink); border-radius: 18px; box-shadow: 0 24px 80px #0004; overflow: auto; }
.location-close { position: absolute; right: 8px; top: 8px; border: none; color: var(--wine); }
.location-dialog h2 { font-size: 28px; color: var(--wine); }
.location-dialog h3 { font-size: 21px; margin-top: 20px; color: var(--wine); }
.location-dialog address { font-size: 14px; margin: 15px 0 24px; }
.location-dialog .solid-button, .location-dialog .outline-button { width: 100%; font-size: 15px; }
.location-dialog .outline-button { margin-top: 12px; }
.map-note { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 18px; }
.copy-status { color: var(--wine); min-height: 26px; font-size: 13px; line-height: 1.8; margin-top: 5px; }
#manual-copy { margin-top: 16px; font-size: 12px; }
#address-text { width: 100%; color: var(--ink); background: #fff8; border: 1px solid var(--line); font-size: 14px; margin-top: 8px; padding: 10px; resize: none; }
.motion-ready .reveal { transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.65,.3,1); }
.motion-ready .reveal:not(.in-view) { opacity: 0; transform: translateY(28px); }

/* The opening borrows the burgundy and champagne lettering of the printed poster. */
[hidden] { display: none !important; }
.opening { --gold: #ead2a6; width: min(100%, 480px); max-width: 480px; height: 100dvh; max-height: 100dvh; margin: auto; background: transparent; color: var(--gold); overflow: auto; }
.opening[open] { display: flex; }
.opening::backdrop { background: #29191fd9; backdrop-filter: blur(7px); transition: opacity .8s ease; }
.opening-panel { position: absolute; top: 0; bottom: 0; width: 50.2%; background-color: #682230; background-image: radial-gradient(ellipse at center, #ffffff1a, #25010a80), url("assets/paper.webp"); background-blend-mode: soft-light, multiply; background-size: auto, 420px; transition: transform 1s cubic-bezier(.65,0,.25,1); }
.opening-left { left: 0; border-right: 1px solid #eccd9d12; }
.opening-right { right: 0; }
.opening-border { position: absolute; inset: 18px; pointer-events: none; border: 1px solid #e6c99550; outline: 1px solid #e6c99516; outline-offset: 5px; transition: opacity .4s; }
.opening-border::before, .opening-border::after { content: ""; position: absolute; left: 50%; width: 6px; height: 6px; background: var(--gold); transform: translateX(-50%) rotate(45deg); opacity: .6; }
.opening-border::before { top: -3px; }.opening-border::after { bottom: -3px; }
.opening-content { position: relative; width: 100%; min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: clamp(38px, 7svh, 68px) calc(var(--u) * 7.5) 30px; text-align: center; transition: opacity .35s, transform .6s; }
.opening-eyebrow { font: 10px/1.5 Georgia, serif; letter-spacing: .38em; padding-left: .38em; opacity: .8; }
.opening-script { color: var(--gold); font-size: calc(var(--u) * 30); line-height: .9; margin-top: clamp(24px, 4svh, 40px); padding: 0 8px; text-shadow: 0 1px 15px #efd8ac1c; }
.opening h2 { color: var(--gold); font-size: calc(var(--u) * 4.8); font-weight: 400; letter-spacing: .13em; margin-top: 18px; white-space: nowrap; }
.opening-ribbon { width: 82%; color: var(--gold); opacity: .68; height: calc(var(--u) * 10); margin: 12px 0 13px; }
.opening-names { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: calc(var(--u) * 5.8); letter-spacing: .08em; }
.opening-names .script { color: var(--gold); font-size: 36px; line-height: 1.2; }
.opening-date { font: 14px/1.5 Georgia, serif; letter-spacing: .19em; margin-top: 9px; }
.opening-seal { width: 65px; height: 65px; display: grid; place-items: center; border: 1px solid #dab98099; outline: 1px solid #dab98044; outline-offset: 4px; border-radius: 50%; margin: clamp(24px, 4.2svh, 42px) 0 25px; background: radial-gradient(circle at 30% 25%, #bd687447, #5d162e66); box-shadow: 0 3px 15px #28020d20, inset 0 0 0 5px #c9976924; }
.opening-seal span { font-size: 28px; line-height: 1; transform: translateY(-1px); }
.opening-description { font-size: max(12px, calc(var(--u) * 3.35)); line-height: 1.8; letter-spacing: .04em; opacity: .85; }
.open-invitation { margin-top: 24px; min-height: 48px; min-width: 184px; display: inline-flex; align-items: center; justify-content: center; gap: 22px; border: 1px solid #ead2a67d; background: #ead2a60c; color: var(--gold); font-size: 16px; letter-spacing: .22em; padding: 10px 24px; }
.open-invitation svg { width: 17px; height: 17px; transition: transform .3s; }
.open-invitation:hover { background: #ead2a618; }.open-invitation:hover svg { transform: translateX(4px); }
.opening button:focus-visible { outline-color: var(--gold); }
.opening-music-note { display: flex; gap: 6px; align-items: center; font-size: 10px; letter-spacing: .06em; margin-top: 12px; opacity: .68; }
.opening-music-note svg { width: 11px; height: 11px; }
.open-silent { background: none; border: 0; color: var(--gold); opacity: .72; min-height: 44px; font-size: 12px; letter-spacing: .08em; padding: 10px 24px; margin-top: 2px; }
.open-silent:hover { opacity: 1; }
.opening-place { margin-top: auto; padding-top: 18px; font-size: 10px; letter-spacing: .22em; opacity: .65; }
.opening.is-opening { pointer-events: none; overflow: hidden; }
.opening.is-opening .opening-content { opacity: 0; transform: scale(.97); }
.opening.is-opening .opening-left { transform: translateX(-101%); }
.opening.is-opening .opening-right { transform: translateX(101%); }
.opening.is-opening .opening-border, .opening.is-opening::backdrop { opacity: 0; }
.opening:not(.is-opening) .opening-script { animation: letter-arrive 1.2s ease both; }
.opening:not(.is-opening) .opening-seal { animation: seal-arrive 1s .2s ease both; }
@keyframes letter-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes seal-arrive { from { opacity: 0; transform: scale(.9) rotate(-12deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

.experience-controls { position: fixed; right: max(12px, calc((100vw - 480px) / 2 + 12px)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 5; display: flex; flex-direction: column; gap: 9px; }
.experience-button { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #a8807780; color: var(--wine); background: #f6f1e8ef; box-shadow: 0 3px 15px #48212510; }
.experience-button svg { width: 19px; height: 19px; }
.experience-button:hover { background: #fffaf2; }
.equalizer { display: none; height: 20px; align-items: center; gap: 3px; }
.equalizer i { display: block; width: 2px; height: 14px; background: currentColor; animation: sound-wave .85s ease-in-out infinite alternate; }
.equalizer i:nth-child(2) { animation-delay: -.3s; height: 20px; }.equalizer i:nth-child(3) { animation-delay: -.5s; height: 11px; }
.music-toggle[aria-pressed="true"] > svg { display: none; }
.music-toggle[aria-pressed="true"] .equalizer { display: flex; }
.music-toggle[aria-busy="true"] { opacity: .6; }
@keyframes sound-wave { from { transform: scaleY(.4); } to { transform: scaleY(1); } }
.experience-status { position: fixed; z-index: 6; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; width: max-content; max-width: min(74vw, 355px); transform: translate(-50%, 8px); padding: 12px 18px; border-radius: 4px; font-size: 13px; line-height: 1.7; background: #682230; color: var(--paper); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.experience-status.is-visible { opacity: 1; transform: translate(-50%, 0); }
.music-credit { margin-top: 16px; font-size: 10px; line-height: 1.8; }
.music-credit summary { cursor: pointer; display: inline-block; min-height: 30px; padding: 8px; }
.music-credit summary::marker { content: ""; }.music-credit summary::-webkit-details-marker { display: none; }
.music-credit p { margin: 6px auto; max-width: 310px; }.music-credit a { text-decoration: underline; text-underline-offset: 3px; }

.motion-ready.invitation-open .cover > :not(.cover-ribbon) { animation: cover-arrive 1s cubic-bezier(.2,.65,.3,1) both; animation-delay: calc(var(--order, 0) * 90ms); }
.cover > :nth-child(2) { --order: 1; }.cover > :nth-child(3) { --order: 2; }.cover > :nth-child(5) { --order: 3; }.cover > :nth-child(6) { --order: 4; }.cover > :nth-child(7) { --order: 5; }.cover > :nth-child(8) { --order: 6; }.cover > :nth-child(9) { --order: 7; }
@keyframes cover-arrive { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.motion-ready.invitation-open .cover-ribbon, .motion-ready .ribbon.in-view { stroke-dasharray: 1000; animation: ribbon-draw 2.2s ease both; }
@keyframes ribbon-draw { from { opacity: 0; stroke-dashoffset: 1000; } to { opacity: 1; stroke-dashoffset: 0; } }
.motion-ready.invitation-open .cover-photo img { animation: cover-drift 16s ease-in-out infinite alternate; }
.motion-ready .photo-frame.in-view:not(.cover-photo) img { animation: photo-drift 14s ease-in-out infinite alternate; }
.motion-ready .photo-frame:not(.on-screen) img { animation-play-state: paused !important; }
@keyframes cover-drift { from { transform: scale(1.14); } to { transform: scale(1.18); } }
@keyframes photo-drift { from { transform: scale(1); } to { transform: scale(1.035); } }
.page-away *, .page-away *::before, .page-away *::after { animation-play-state: paused !important; }
.motion-disabled *, .motion-disabled *::before, .motion-disabled *::after { animation: none !important; transition: none !important; }
.motion-disabled { scroll-behavior: auto; }
.motion-disabled .reveal:not(.in-view) { opacity: 1; transform: none; }
@media (max-height: 700px) {
  .opening-content { padding-top: 32px; padding-bottom: 24px; }
  .opening-script { font-size: calc(var(--u) * 25); margin-top: 20px; }
  .opening h2 { margin-top: 10px; }
  .opening-ribbon { margin: 8px 0; height: 26px; }
  .opening-seal { width: 48px; height: 48px; margin: 20px 0 16px; }
  .opening-seal span { font-size: 24px; }
  .open-invitation { margin-top: 14px; min-height: 44px; }
  .opening-place { padding-top: 8px; }
}
@media (min-width: 700px) {
  .invitation { margin: 32px auto; }
  .cover { padding-top: 38px; }
  .opening { height: min(880px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .motion-ready .reveal:not(.in-view) { opacity: 1; transform: none; }
}


/* Reserve photo layout while lower sections wait for a nearby viewport. */
.photo-frame picture { display: block; width: 100%; height: 100%; }
.photo-frame .deferred-photo, .deferred-photo { display: none; }
.js .deferred-photo { display: block; }
.rsvp-return { font: 11px/1.8 -apple-system, BlinkMacSystemFont, sans-serif; color: #74665f; }

/* Native horizontal scrolling keeps the reader on the invitation. */
.story-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-top: calc(var(--u) * 8); }
.story-gallery::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; margin: 0; }
.gallery-controls { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 12px; color: var(--wine); }
.gallery-controls > span { font: 13px/1.4 Georgia, serif; letter-spacing: .12em; }
.gallery-arrow { display: grid; place-items: center; width: 44px; height: 44px; background: none; color: var(--wine); border: 1px solid #b58b8670; border-radius: 50%; }
.gallery-arrow svg { width: 17px; height: 17px; }
.gallery-arrow:disabled { opacity: .3; cursor: default; }
.story-gallery:focus-visible { outline: 2px solid var(--wine); outline-offset: 5px; }

/* Lightweight photo and sound loading, without holding up reading. */
.photo-frame { position: relative; background: #eee6da; }
.photo-frame.is-loading::after { content: ""; position: absolute; top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px; border: 1px solid #b58b8640; border-top-color: var(--wine); border-radius: 50%; animation: loading-turn 1.5s linear infinite; pointer-events: none; }
.photo-frame.load-failed::after { content: "照片暂未加载，轻触重试"; position: absolute; inset: 45% 12px auto; font-size: 13px; color: var(--wine); text-align: center; }
.photo-frame.load-failed img { opacity: 0; }
.opening-loading { display: flex; align-items: center; gap: 8px; min-height: 18px; margin: -12px 0 12px; color: var(--gold); font: 11px/1.6 -apple-system, BlinkMacSystemFont, sans-serif; opacity: .8; }
.opening-loading[hidden], .viewer-loading[hidden] { display: none; }
.loading-dots { display: inline-flex; align-items: center; gap: 4px; }
.loading-dots i { display: block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: loading-breathe 1.4s ease-in-out infinite; }
.loading-dots i:nth-child(2) { animation-delay: .18s; }.loading-dots i:nth-child(3) { animation-delay: .36s; }
.viewer-picture { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; }
.viewer-loading { position: absolute; left: 16px; right: 16px; top: 48%; display: flex; gap: 10px; justify-content: center; align-items: center; padding: 12px; font-size: 13px; background: #171513d9; pointer-events: none; }
#photo-error .text-link { color: var(--paper); min-height: 44px; }
.music-toggle[aria-busy="true"] { position: relative; opacity: 1; }
.music-toggle[aria-busy="true"]::after { content: ""; position: absolute; inset: 4px; border: 1px solid transparent; border-top-color: var(--wine); border-radius: 50%; animation: loading-turn 1.5s linear infinite; }
@keyframes loading-turn { to { transform: rotate(360deg); } }
@keyframes loading-breathe { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loading-dots i { opacity: .65; } }
