:root {
  --ivory: #f5f0e7;
  --ivory-deep: #ebe3d6;
  --ink: #26342f;
  --sky: #b8d5e4;
  --sage: #708277;
  --gold: #b49a6a;
  --white: #fffdf8;
  --page-height: 100vh;
  color-scheme: light;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

@supports (height: 100svh) {
  :root { --page-height: 100svh; }
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
}

body {
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

a { color: inherit; }

.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;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  background: var(--white);
  color: var(--ink);
  transform: translateY(-160%);
  transition: transform .2s ease;
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.pages {
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: none;
}

.pages::-webkit-scrollbar { display: none; }

.gate-open .pages { overflow: hidden; }

.page {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100vh;
  height: var(--page-height);
  min-height: 520px;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  isolation: isolate;
}

.page-photo,
.page-photo picture,
.page-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.page-photo { z-index: -3; background: #c1d7df; }

.page-photo img {
  object-fit: cover;
  transform: scale(1.035);
  transition: transform 1.6s cubic-bezier(.22, 1, .36, 1);
}

.page.is-active .page-photo img { transform: scale(1); }

.photo-wash {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.paper-texture {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .23;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(87, 73, 55, .08) 0 1px, transparent 1.4px),
    radial-gradient(circle at 75% 62%, rgba(87, 73, 55, .055) 0 .8px, transparent 1.2px);
  background-size: 31px 31px, 23px 23px;
  pointer-events: none;
}

.eyebrow {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(9px, 2.5vw, 12px);
  letter-spacing: .28em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow.ink { color: var(--sage); }
.eyebrow.light { color: rgba(255, 253, 248, .82); }

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity .85s cubic-bezier(.22, 1, .36, 1),
    transform .85s cubic-bezier(.22, 1, .36, 1);
}

.js .page.is-active .reveal { opacity: 1; transform: translateY(0); }
.js .page.is-active .reveal-1 { transition-delay: .08s; }
.js .page.is-active .reveal-2 { transition-delay: .17s; }
.js .page.is-active .reveal-3 { transition-delay: .28s; }
.js .page.is-active .reveal-4 { transition-delay: .41s; }
.js .page.is-active .reveal-5 { transition-delay: .54s; }

/* Opening gate */
.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  min-height: 520px;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(28, 50, 54, .08) 0%, rgba(24, 42, 42, .18) 42%, rgba(18, 35, 35, .67) 100%),
    linear-gradient(90deg, rgba(20, 37, 38, .14), transparent 50%, rgba(20, 37, 38, .12)),
    url("./assets/images/church-placeholder.webp") center 72% / cover no-repeat;
  transition: opacity .7s ease, visibility .7s ease;
}

.entry-gate[hidden] { display: none; }

.entry-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("./assets/images/church.jpg") center 72% / cover no-repeat;
  background: image-set(
    url("./assets/images/church.webp") type("image/webp") 1x,
    url("./assets/images/church.jpg") type("image/jpeg") 1x
  ) center 72% / cover no-repeat;
  animation: gate-image-in 1.2s ease both;
}

.entry-gate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(29, 54, 59, .03), rgba(29, 48, 48, .08) 45%, rgba(17, 33, 33, .74));
}

.entry-gate.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }

.gate-frame {
  position: absolute;
  z-index: 2;
  inset: calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 253, 248, .44);
  pointer-events: none;
}

.gate-frame::before,
.gate-frame::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
}

.gate-frame::before { top: -1px; left: -1px; border-top: 3px solid var(--white); border-left: 3px solid var(--white); }
.gate-frame::after { right: -1px; bottom: -1px; border-right: 3px solid var(--white); border-bottom: 3px solid var(--white); }

.gate-content {
  position: relative;
  z-index: 3;
  align-self: end;
  width: min(82vw, 360px);
  margin-bottom: calc(8.5vh + env(safe-area-inset-bottom));
  text-align: center;
  animation: gate-content-in .9s .2s cubic-bezier(.22, 1, .36, 1) both;
}

.gate-mark { display: flex; justify-content: center; margin: 15px 0 7px; }
.gate-mark span { width: 1px; height: 33px; background: rgba(255, 253, 248, .62); }

.gate-date {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(39px, 12vw, 57px);
  font-weight: 400;
  letter-spacing: .09em;
}

.gate-names {
  margin: 7px 0 0;
  font-family: "Songti SC", STSong, SimSun, serif;
  font-size: 15px;
  letter-spacing: .2em;
  text-indent: .2em;
}

.gate-names i {
  margin: 0 6px;
  font-family: Georgia, serif;
  font-size: .85em;
  font-style: italic;
  color: rgba(255, 253, 248, .72);
}

.gate-copy {
  margin: 7px 0 22px;
  font-family: "Songti SC", STSong, SimSun, serif;
  font-size: 14px;
  letter-spacing: .22em;
}

.open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 206px;
  min-height: 48px;
  border: 1px solid rgba(255, 253, 248, .82);
  border-radius: 0;
  color: var(--ink);
  background: rgba(255, 253, 248, .93);
  font-size: 13px;
  letter-spacing: .18em;
  cursor: pointer;
  transition: color .25s ease, background .25s ease, transform .25s ease;
}

.open-button:active { transform: scale(.98); }
.open-button-icon { font-family: Georgia, serif; font-size: 15px; }

.silent-button {
  display: block;
  margin: 13px auto 0;
  padding: 7px 14px;
  border: 0;
  color: rgba(255, 253, 248, .78);
  background: transparent;
  font-size: 11px;
  letter-spacing: .14em;
  cursor: pointer;
}

@keyframes gate-image-in { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }
@keyframes gate-content-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Persistent controls */
.music-control {
  position: fixed;
  z-index: 50;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: 50%;
  color: var(--white);
  background: rgba(37, 54, 50, .27);
  box-shadow: 0 6px 24px rgba(21, 36, 35, .12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 1;
  transition: opacity .4s ease, background .25s ease, color .25s ease;
}

.gate-open .music-control,
.gate-open .page-dots,
.gate-open .next-page { opacity: 0; pointer-events: none; }

.music-disc { display: block; width: 34px; height: 34px; }
.music-disc svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1; }
.music-center { fill: currentColor; stroke: none; }
.music-control.is-playing .music-disc { animation: record-spin 7s linear infinite; }
.music-bars { position: absolute; right: 3px; bottom: 4px; display: none; align-items: end; gap: 1.5px; width: 12px; height: 11px; padding: 2px; border-radius: 50%; background: var(--white); }
.music-control.is-playing .music-bars { display: flex; }
.music-bars i { display: block; width: 1.5px; height: 3px; background: var(--sage); animation: music-bar .8s ease-in-out infinite alternate; }
.music-bars i:nth-child(2) { height: 6px; animation-delay: -.3s; }
.music-bars i:nth-child(3) { height: 4px; animation-delay: -.5s; }

@keyframes record-spin { to { transform: rotate(360deg); } }
@keyframes music-bar { to { height: 7px; } }

.page-dots {
  position: fixed;
  z-index: 40;
  top: 50%;
  right: 8px;
  display: flex;
  flex-direction: column;
  transform: translateY(-50%);
  opacity: 1;
  transition: opacity .4s ease;
}

.page-dots button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.page-dots span {
  width: 4px;
  height: 4px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  background: rgba(38, 52, 47, .2);
  box-shadow: 0 0 0 1px rgba(38, 52, 47, .12);
  transition: height .3s ease, border-radius .3s ease, background .3s ease;
}

.page-dots button.is-current span { width: 3px; height: 20px; border-radius: 4px; background: rgba(255, 255, 255, .9); }

.next-page {
  position: fixed;
  z-index: 40;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  min-height: 48px;
  padding: 4px 12px;
  border: 0;
  color: rgba(255, 255, 255, .9);
  background: transparent;
  filter: drop-shadow(0 1px 3px rgba(28, 43, 42, .46));
  opacity: 1;
  transform: translateX(-50%);
  cursor: pointer;
  transition: opacity .35s ease, visibility .35s ease;
}

.next-page span { font-size: 9px; letter-spacing: .18em; }
.next-page i { display: block; width: 12px; height: 12px; border-top: 1px solid currentColor; border-left: 1px solid currentColor; transform: rotate(45deg); animation: arrow-rise 1.8s ease-in-out infinite; }
.next-page.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

@keyframes arrow-rise { 0%, 100% { transform: translateY(4px) rotate(45deg); opacity: .25; } 50% { transform: translateY(-3px) rotate(45deg); opacity: 1; } }

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: calc(72px + env(safe-area-inset-bottom));
  max-width: calc(100vw - 48px);
  padding: 10px 18px;
  border-radius: 2px;
  color: var(--white);
  background: rgba(38, 52, 47, .9);
  box-shadow: 0 8px 30px rgba(28, 42, 39, .18);
  font-size: 12px;
  letter-spacing: .08em;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Page 1 */
.hero { color: var(--white); background: #a9cddd; }
.hero .page-photo img { object-position: 50% 72%; }
.hero-wash { background: linear-gradient(180deg, rgba(31, 60, 65, .18) 0%, rgba(31, 52, 52, .025) 40%, rgba(26, 43, 42, .52) 100%); }

.hero-moon {
  position: absolute;
  z-index: 0;
  top: 11.5%;
  right: 12%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  box-shadow: -4px 2px 0 0 rgba(255, 251, 234, .8);
  opacity: .7;
}

.corner { position: absolute; z-index: 1; top: calc(22px + env(safe-area-inset-top)); width: 36px; height: 36px; opacity: .7; }
.corner-left { left: 22px; border-top: 1px solid currentColor; border-left: 1px solid currentColor; }
.corner-right { right: 22px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; }

.hero-content {
  position: absolute;
  z-index: 2;
  top: max(12.5vh, 78px);
  left: 50%;
  width: calc(100% - 56px);
  max-width: 480px;
  text-align: center;
  transform: translateX(-50%);
  text-shadow: 0 2px 18px rgba(42, 59, 58, .2);
}

.fine-rule { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 17px 0 19px; }
.fine-rule span { width: 42px; height: 1px; background: rgba(255, 255, 255, .62); }
.fine-rule i { width: 4px; height: 4px; border: 1px solid rgba(255, 255, 255, .8); transform: rotate(45deg); }

.hero-intro {
  margin: 0 0 11px;
  font-family: "Songti SC", STSong, SimSun, serif;
  font-size: clamp(12px, 3.4vw, 15px);
  letter-spacing: .32em;
}

.hero h1 {
  margin: 0;
  font-family: "Songti SC", STSong, SimSun, serif;
  font-size: clamp(36px, 11vw, 56px);
  font-weight: 400;
  letter-spacing: .16em;
  line-height: 1.24;
  text-indent: .16em;
}

.couple-names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 0;
  font-family: "Songti SC", STSong, SimSun, serif;
  font-size: clamp(12px, 3.5vw, 16px);
  letter-spacing: .18em;
  text-indent: .18em;
}

.couple-names i {
  color: rgba(255, 255, 255, .72);
  font-family: Georgia, serif;
  font-size: .8em;
  font-style: italic;
  letter-spacing: 0;
}

.hero-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 18px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: .16em;
}

.hero-date i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.hero-footer {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: calc(58px + env(safe-area-inset-bottom));
  left: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 9px;
  letter-spacing: .18em;
}

/* Page 2 */
.story { padding: calc(8vh + env(safe-area-inset-top)) 30px calc(6vh + env(safe-area-inset-bottom)); background: var(--ivory); }
.story-number { position: absolute; top: 4.5%; right: 25px; color: rgba(112, 130, 119, .16); font-family: Georgia, serif; font-size: clamp(58px, 18vw, 92px); line-height: 1; }
.story-header { position: relative; z-index: 2; }
.story h2 { margin: 13px 0 8px; font-family: "Songti SC", STSong, SimSun, serif; font-size: clamp(29px, 8vw, 42px); font-weight: 400; letter-spacing: .14em; }
.story-lead { margin: 0; color: #53625c; font-family: "Songti SC", STSong, SimSun, serif; font-size: clamp(12px, 3.3vw, 15px); letter-spacing: .13em; }

.story-photo {
  position: absolute;
  top: 25%;
  right: 0;
  width: 81%;
  height: 52%;
  margin: 0;
  overflow: hidden;
  background: #cad9d3;
  box-shadow: 0 18px 52px rgba(40, 54, 48, .12);
}

.story-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 68%, rgba(30, 45, 41, .24)); }
.story-photo picture,
.story-photo img { display: block; width: 100%; height: 100%; }
.story-photo img { object-fit: cover; object-position: 50% 59%; }
.photo-index { position: absolute; z-index: 2; right: 14px; bottom: 12px; color: rgba(255, 255, 255, .9); font-family: Georgia, serif; font-size: 9px; letter-spacing: .15em; }

.story-note {
  position: absolute;
  z-index: 3;
  left: 24px;
  bottom: calc(5.5vh + env(safe-area-inset-bottom));
  width: min(72%, 310px);
  padding: 22px 24px 20px;
  color: var(--white);
  background: rgba(76, 96, 85, .94);
  box-shadow: 0 12px 36px rgba(38, 54, 47, .16);
}

.story-note p { margin: 0; font-family: "Songti SC", STSong, SimSun, serif; font-size: clamp(12px, 3.3vw, 14px); letter-spacing: .12em; line-height: 2; }
.quote-mark { position: absolute; top: -17px; left: 17px; color: var(--gold); font-family: Georgia, serif; font-size: 52px; line-height: 1; }
.vertical-note { position: absolute; right: 8px; bottom: 8%; margin: 0; color: rgba(38, 52, 47, .46); font-family: Georgia, serif; font-size: 8px; letter-spacing: .25em; writing-mode: vertical-rl; }

/* Page 3 */
.date-page { display: flex; flex-direction: column; align-items: center; padding: calc(7vh + env(safe-area-inset-top)) 25px calc(6vh + env(safe-area-inset-bottom)); text-align: center; background: var(--ivory); }
.date-orbit { position: absolute; z-index: -1; border: 1px solid rgba(180, 154, 106, .22); border-radius: 50%; pointer-events: none; }
.orbit-one { top: -13vw; right: -25vw; width: 88vw; height: 88vw; }
.orbit-two { top: -2vw; right: -13vw; width: 52vw; height: 52vw; }
.date-header { width: 100%; }

.date-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(13px, 5vw, 28px);
  margin: clamp(22px, 5vh, 44px) 0 8px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.date-display span { font-size: clamp(63px, 22vw, 108px); font-weight: 400; letter-spacing: -.04em; line-height: .9; }
.date-display i { width: 1px; height: clamp(54px, 15vw, 76px); background: var(--gold); transform: rotate(24deg); }
.date-chinese { margin: 20px 0 7px; font-family: "Songti SC", STSong, SimSun, serif; font-size: clamp(13px, 3.5vw, 16px); letter-spacing: .15em; }
.banquet-time { margin: 0; color: var(--sage); font-size: clamp(12px, 3.3vw, 15px); letter-spacing: .16em; }
.banquet-time strong { color: var(--ink); font-family: Georgia, serif; font-size: 1.15em; font-weight: 400; }
.calendar-line { display: flex; align-items: center; justify-content: center; gap: 13px; width: min(76vw, 360px); margin: clamp(25px, 5vh, 45px) 0; color: var(--gold); }
.calendar-line span { flex: 1; height: 1px; background: rgba(180, 154, 106, .55); }
.calendar-line i { font-family: "Songti SC", STSong, SimSun, serif; font-size: 10px; font-style: normal; letter-spacing: .2em; }

.countdown-wrap { width: 100%; }
.countdown-title { margin: 0 0 15px; color: var(--sage); font-family: "Songti SC", STSong, SimSun, serif; font-size: 11px; letter-spacing: .2em; }
.countdown { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 18px); }
.countdown div { display: flex; flex-direction: column; min-width: 44px; }
.countdown strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(25px, 7vw, 35px); font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown span { margin-top: 4px; color: var(--sage); font-size: 9px; letter-spacing: .15em; }
.countdown > i { width: 2px; height: 2px; border-radius: 50%; background: var(--gold); }
.countdown-arrived { margin: 20px 0 0; color: var(--sage); font-family: "Songti SC", STSong, SimSun, serif; font-size: 16px; letter-spacing: .16em; }
.text-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin-top: auto; padding: 8px 12px; color: var(--ink); font-size: 11px; letter-spacing: .16em; text-underline-offset: 5px; }
.text-link span { color: var(--gold); font-size: 16px; }

/* Page 4 */
.venue { color: var(--white); background: #6a8072; }
.venue .page-photo img { object-position: 50% 60%; }
.venue-wash { background: linear-gradient(180deg, rgba(20, 42, 38, .2) 0%, rgba(20, 42, 38, .025) 38%, rgba(20, 38, 35, .34) 70%, rgba(20, 38, 35, .58) 100%); }
.venue-label { position: absolute; z-index: 2; top: calc(34px + env(safe-area-inset-top)); left: 25px; display: flex; align-items: center; gap: 12px; text-shadow: 0 1px 9px rgba(21, 37, 34, .28); }
.venue-label span { font-family: Georgia, serif; font-size: 35px; line-height: 1; }
.venue-label p { margin: 0; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .65); font-family: Georgia, serif; font-size: 8px; letter-spacing: .23em; line-height: 1.55; }

.venue-card {
  position: absolute;
  z-index: 3;
  right: 20px;
  bottom: calc(48px + env(safe-area-inset-bottom));
  left: 20px;
  padding: clamp(23px, 6vw, 31px) 25px 22px;
  color: var(--ink);
  text-align: center;
  background: rgba(248, 244, 236, .92);
  box-shadow: 0 16px 45px rgba(25, 39, 36, .2);
  backdrop-filter: blur(11px);
  -webkit-backdrop-filter: blur(11px);
}

.venue-card h2 { margin: 14px 0 10px; font-family: "Songti SC", STSong, SimSun, serif; font-size: clamp(22px, 6vw, 31px); font-weight: 400; letter-spacing: .07em; }
.hall-name { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 0 0 12px; color: var(--gold); font-family: "Songti SC", STSong, SimSun, serif; font-size: 13px; letter-spacing: .3em; text-indent: .3em; }
.hall-name span { width: 21px; height: 1px; background: rgba(180, 154, 106, .62); }
.venue-card address { color: #53605b; font-size: 12px; font-style: normal; letter-spacing: .06em; line-height: 1.7; }
.venue-actions { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; margin-top: 20px; }
.venue-actions a,
.venue-actions button { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 8px 12px; border-radius: 0; font-size: 12px; letter-spacing: .12em; text-decoration: none; cursor: pointer; }
.primary-action { gap: 9px; border: 1px solid var(--ink); color: var(--white); background: var(--ink); }
.primary-action span { color: var(--gold); font-size: 16px; }
.copy-action { border: 1px solid rgba(38, 52, 47, .38); color: var(--ink); background: transparent; }

/* Page 5 */
.finale { color: var(--white); background: #a9cddd; }
.finale .page-photo img { object-position: 50% 84%; }
.finale-wash { background: linear-gradient(180deg, rgba(20, 43, 47, .41) 0%, rgba(20, 43, 47, .13) 52%, rgba(20, 39, 39, .55) 100%); }
.finale-frame { position: absolute; z-index: 1; inset: calc(23px + env(safe-area-inset-top)) 22px calc(23px + env(safe-area-inset-bottom)); border: 1px solid rgba(255, 255, 255, .55); }
.finale-frame::before { content: ""; position: absolute; top: 13px; right: 13px; bottom: 13px; left: 13px; border: 1px solid rgba(255, 255, 255, .16); }

.finale-content {
  position: absolute;
  z-index: 2;
  top: calc(10vh + env(safe-area-inset-top));
  left: 50%;
  width: calc(100% - 70px);
  text-align: center;
  text-shadow: 0 2px 18px rgba(23, 41, 41, .25);
  transform: translateX(-50%);
}

.finale-script { margin: clamp(20px, 4vh, 35px) 0 -3px; color: rgba(255, 255, 255, .75); font-family: "Snell Roundhand", "Segoe Script", cursive; font-size: clamp(20px, 5.8vw, 30px); }
.finale h2 { margin: 0; font-family: "Songti SC", STSong, SimSun, serif; font-size: clamp(34px, 10vw, 50px); font-weight: 400; letter-spacing: .16em; line-height: 1.5; text-indent: .16em; }
.finale-rule { width: 1px; height: 40px; margin: 18px auto; background: rgba(255, 255, 255, .65); }
.finale-copy { margin: 0; font-family: "Songti SC", STSong, SimSun, serif; font-size: clamp(12px, 3.3vw, 15px); letter-spacing: .2em; line-height: 2; }
.finale-names { margin: 14px 0 0; font-family: "Songti SC", STSong, SimSun, serif; font-size: 12px; letter-spacing: .18em; }
.finale-names i { margin: 0 5px; color: rgba(255, 255, 255, .72); font-family: Georgia, serif; font-size: .85em; font-style: italic; }
.finale-date { margin: 6px 0 0; font-family: Georgia, serif; font-size: 12px; letter-spacing: .2em; }
.finale-actions { position: absolute; z-index: 3; right: 52px; bottom: calc(45px + env(safe-area-inset-bottom)); left: 52px; display: flex; justify-content: center; align-items: center; gap: 20px; }
.finale-actions a { display: flex; align-items: center; min-height: 44px; padding: 8px 4px; color: var(--white); font-size: 11px; letter-spacing: .15em; text-underline-offset: 5px; }
.finale-actions i { width: 1px; height: 13px; background: rgba(255, 255, 255, .5); }

/* Compact phones and landscape */
@media (max-height: 650px) {
  .hero-content { top: max(11vh, 62px); }
  .hero h1 { font-size: clamp(32px, 10vw, 43px); }
  .fine-rule { margin: 11px 0 13px; }
  .hero-date { margin-top: 12px; }
  .couple-names { margin-top: 7px; }
  .story { padding-top: calc(5vh + env(safe-area-inset-top)); }
  .story h2 { margin-top: 8px; }
  .story-photo { top: 22%; height: 51%; }
  .story-note { bottom: calc(4.5vh + env(safe-area-inset-bottom)); padding-top: 18px; padding-bottom: 16px; }
  .story-note p { line-height: 1.8; }
  .date-page { padding-top: calc(5vh + env(safe-area-inset-top)); }
  .date-display { margin-top: 14px; }
  .date-chinese { margin-top: 13px; }
  .calendar-line { margin: 19px 0; }
  .countdown-title { margin-bottom: 10px; }
  .venue-card { bottom: calc(38px + env(safe-area-inset-bottom)); padding-top: 18px; padding-bottom: 16px; }
  .venue-card h2 { margin: 9px 0 6px; }
  .venue-actions { margin-top: 13px; }
  .venue-actions a,
  .venue-actions button { min-height: 42px; }
  .finale-content { top: calc(7vh + env(safe-area-inset-top)); }
  .finale-script { margin-top: 12px; }
  .finale h2 { font-size: clamp(31px, 9vw, 43px); line-height: 1.35; }
  .finale-rule { height: 28px; margin: 11px auto; }
  .finale-copy { line-height: 1.75; }
  .finale-names { margin-top: 8px; }
  .finale-date { margin-top: 4px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .page { min-height: 360px; }
  .hero-content { top: 13%; left: 30%; width: 48%; }
  .hero h1 { font-size: 34px; }
  .hero .page-photo img,
  .finale .page-photo img { object-position: 50% 76%; }
  .story { padding: 34px 7%; }
  .story-header { width: 42%; }
  .story-photo { top: 0; right: 0; width: 52%; height: 100%; }
  .story-note { left: 7%; bottom: 10%; width: 40%; }
  .date-page { padding-top: 25px; }
  .date-header { width: 54%; }
  .date-display { margin: 10px 0 0; }
  .date-display span { font-size: 57px; }
  .date-chinese { margin-top: 9px; }
  .calendar-line { position: absolute; top: 35%; right: 5%; width: 34%; }
  .countdown-wrap { position: absolute; top: 51%; right: 4%; width: 37%; }
  .text-link { position: absolute; right: 13%; bottom: 10%; }
  .venue-card { top: 50%; right: 4%; bottom: auto; left: auto; width: 48%; transform: translateY(-50%); }
  .venue-label { left: 5%; }
  .finale-content { top: 10%; left: 28%; width: 46%; }
  .finale h2 { font-size: 32px; line-height: 1.25; }
  .finale-script { margin: 6px 0; }
  .finale-rule { height: 18px; margin: 7px auto; }
  .finale-actions { right: 7%; bottom: 8%; left: auto; }
}

@media (min-width: 700px) {
  .story { padding-right: max(30px, calc((100vw - 640px) / 2)); padding-left: max(30px, calc((100vw - 640px) / 2)); }
  .story-photo { right: calc((100vw - 700px) / 2); width: 520px; }
  .story-note { left: calc((100vw - 650px) / 2); width: 310px; }
  .venue-card { right: 50%; left: auto; width: min(540px, calc(100vw - 40px)); transform: translateX(50%); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .page-photo img { transform: none; }
}
