:root {
  color-scheme: light;
  --paper: #ecd0a5;
  --ink: #513323;
  --burgundy: #6f1826;
  --green: #28432a;
  --gold: #9c7339;
  --line: #b993586b;
  --scene-height: 100svh;
  --art-space: 310px;
  --parchment: url('assets/parchment.webp');
  --ease-paper: cubic-bezier(.22,.7,.2,1);
}
* { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
html.snap-opening { scroll-snap-type: y mandatory; }
body { position: relative; isolation: isolate; margin: 0; color: var(--ink); font: 1.125rem/1.65 Georgia, 'Times New Roman', serif; overflow-wrap: break-word; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--parchment) center / cover no-repeat; pointer-events: none; }
button { font: inherit; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; }
button:focus-visible { outline: 3px solid var(--green); outline-offset: 5px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.music-control { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); z-index: 30; min-height: 46px; padding: 10px 14px; border: 1px solid #a87a4152; border-radius: 99px; background: #f5e4cbbf; color: var(--burgundy); display: inline-flex; align-items: center; gap: 8px; font: 600 .8125rem/1.35 ui-sans-serif, system-ui, sans-serif; box-shadow: 0 3px 16px #5838160c; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer; }
.music-control:disabled { color: #6c5743; cursor: default; }
.music-control svg { width: 19px; height: 19px; flex: none; }
.music-control .sound-waves { display: none; }
.music-control.is-playing .sound-waves { display: block; }
.music-control.is-playing .sound-off { display: none; }

.opening { position: relative; }
.story-stops { display: none; }
.opening-stage { width: 100%; min-height: 100vh; min-height: 100svh; padding: calc(90px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) 130px max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 22px; }
.opening-heading { width: 100%; }
.eyebrow { margin: 0 0 17px; color: var(--green); font: 600 .6875rem/1.65 ui-sans-serif, system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
h1 { margin: 0; color: var(--burgundy); font-size: clamp(3rem, 11vw, 4.75rem); line-height: 1.02; font-weight: 400; letter-spacing: -.04em; }
h1 .second-name { display: block; margin-top: 5px; }
h1 em { display: inline-block; font-size: .55em; margin-right: .12em; font-weight: 400; color: var(--gold); vertical-align: .06em; }
.opening-date { margin: 20px 0 0; font-size: .9375rem; letter-spacing: .02em; }
.opening-date span { margin: 0 5px; color: var(--gold); }
.opening-art { width: 100%; display: grid; place-items: center; min-height: 0; }
.tabletop { position: relative; width: min(100%, 800px); aspect-ratio: 1.65; perspective: 1200px; }
.envelope-position { position: absolute; width: 94%; aspect-ratio: 1426 / 836; left: 3%; top: 50%; transform: translateY(-50%); z-index: 3; opacity: 1; filter: drop-shadow(0 12px 12px #532b282e); }
.envelope-turn { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(0deg); }
.envelope-face { position: absolute; inset: 0; border-radius: 4px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.envelope-face svg { width: 100%; height: 100%; }
.envelope-back { transform: rotateY(180deg); }
.card-cover { position: absolute; width: 84%; aspect-ratio: 1276 / 845; left: 8%; top: 50%; display: flex; transform: translateY(-27%) scale(.84); opacity: 0; z-index: 2; perspective: 1100px; filter: drop-shadow(0 13px 13px #532b282a); }
.cover-door { width: 50%; flex: none; backface-visibility: hidden; }
.cover-door svg { width: 100%; height: 100%; }
.cover-door-left { transform-origin: left center; }
.cover-door-right { transform-origin: right center; }
.gatefold { position: absolute; width: 98%; left: 50%; top: 50%; display: flex; align-items: center; transform: translate(-50%, -50%) scale(.9); perspective: 1200px; opacity: 0; z-index: 1; filter: drop-shadow(0 11px 12px #532b2826); }
.fold-panel { flex: 0 0 23.5294%; min-width: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fold-panel img { width: 100%; height: auto; }
.fold-left { transform-origin: right center; transform: rotateY(-88deg); }
.fold-center { flex-basis: 52.9412%; }
.fold-right { transform-origin: left center; transform: rotateY(88deg); }
.tabletop[data-scene='cover'] .envelope-turn, .tabletop[data-scene='spread'] .envelope-turn { transform: rotateY(-180deg); }
.tabletop[data-scene='cover'] .envelope-position, .tabletop[data-scene='spread'] .envelope-position { opacity: 0; transform: translate(-6%, -17%) scale(.86); }
.tabletop[data-scene='cover'] .card-cover { opacity: 1; transform: translateY(-50%) scale(1); z-index: 4; }
.tabletop[data-scene='spread'] .card-cover { opacity: 0; transform: translateY(-50%) scale(.63); z-index: 4; }
.tabletop[data-scene='spread'] .cover-door-left { transform: rotateY(-100deg); }
.tabletop[data-scene='spread'] .cover-door-right { transform: rotateY(100deg); }
.tabletop[data-scene='spread'] .gatefold { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.tabletop[data-scene='spread'] .fold-left, .tabletop[data-scene='spread'] .fold-right { transform: rotateY(0deg); }
.motion-ready .envelope-position { transition: transform 1200ms var(--ease-paper), opacity 650ms ease 430ms; }
.motion-ready .envelope-turn { transition: transform 850ms var(--ease-paper); }
.motion-ready .card-cover { transition: transform 1200ms var(--ease-paper), opacity 850ms ease; }
.motion-ready .tabletop[data-scene='cover'] .card-cover { transition-delay: 220ms; }
.motion-ready .cover-door { transition: transform 1100ms var(--ease-paper); }
.motion-ready .gatefold { transition: transform 1200ms var(--ease-paper), opacity 600ms ease; }
.motion-ready .fold-left, .motion-ready .fold-right { transition: transform 1200ms var(--ease-paper) 140ms; }
.opening-caption { margin: 0; white-space: pre-line; color: #67452f; font-size: 1.125rem; font-style: italic; line-height: 1.55; }
.has-story .opening { height: calc(3 * var(--scene-height)); }
.has-story .opening-stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(0,1fr) auto; gap: 20px; }
.has-script .opening-stage { padding-bottom: var(--cue-space,130px); }
.has-story .opening-art { align-self: stretch; }
.has-story .tabletop { width: min(100%, calc(var(--art-space) * 1.65), 800px); }

/* Fit the unfolded 17:6 card to the space between the title and caption. */
.has-story .gatefold {
  --spread-gutter: max(5px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --spread-height: var(--art-space);
  --spread-width: calc(100vw - 16px - 2 * var(--spread-gutter));
  width: min(var(--spread-width), calc(var(--spread-height) * 17 / 6), 1600px);
}
@supports (height: 1cqh) {
  .has-story .opening-art { container-type: size; }
  .has-story .gatefold {
    --spread-height: 100cqh;
    --spread-width: calc(100cqw + 2 * max(0px, 18px - var(--spread-gutter)));
  }
}

.has-story .story-stops { display: block; }
.story-stop { position: absolute; width: 1px; height: 1px; top: calc(var(--stop) * var(--scene-height)); left: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.has-story #wedding { scroll-snap-align: start; scroll-snap-stop: always; }

.invitation { width: min(100% - 40px, 660px); margin: 0 auto; text-align: center; }
.invitation-section { position: relative; padding: 76px clamp(4px, 3vw, 40px) 0; }
.ornament { color: var(--gold); font-size: 2rem; line-height: 1; margin-bottom: 28px; }
.section-end { margin: 56px auto 0; display: flex; align-items: center; justify-content: center; gap: 20px; font-size: 1.5rem; }
.section-end::before, .section-end::after { content: ''; height: 1px; width: 48px; background: var(--line); }
.couple-portrait { position: relative; width: min(86%, 320px); aspect-ratio: 486 / 648; margin: 32px auto 38px; overflow: hidden; border: 1px solid #ab813b; box-shadow: 0 14px 28px #57361129; }
.couple-portrait img { position: absolute; width: 316.05%; max-width: none; left: -42.8%; top: -29.48%; }
.invitation-intro { margin: 0 0 16px; }
.hosts { font-size: clamp(1.3rem, 4.8vw, 1.6rem); line-height: 1.5; color: var(--green); margin: 0 0 24px; }
.invitation-copy { margin: 16px 0; }
.couple-names { margin: 30px 0; color: var(--burgundy); font-size: clamp(2rem, 7.5vw, 2.9rem); font-weight: 400; line-height: 1.2; letter-spacing: -.02em; }
.couple-names span { display: block; }
.couple-names em { display: block; color: var(--gold); font-size: 1.5rem; margin: 18px 0; }
.bride-family { color: var(--green); font-size: 1.25rem; line-height: 1.6; margin: 0; }
.late { font-style: italic; }
.wedding-details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 38px; padding: 28px 0; }
.wedding-details p { margin: 4px 0; }
.wedding-day { color: var(--green); font-weight: 700; font-size: 1.25rem; }
.venue-name { color: var(--burgundy); font-size: 1.65rem; line-height: 1.4; }
.wedding-details .venue-name { margin-top: 22px; }
.section-title { color: var(--burgundy); margin: 0 0 42px; font-size: clamp(2.1rem, 7.5vw, 2.8rem); line-height: 1.2; font-weight: 400; letter-spacing: -.025em; }
.celebration-day + .celebration-day { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--line); }
.celebration-day h3, .family h3, .venue h3 { color: var(--green); margin: 0 0 22px; font: 600 .875rem/1.65 ui-sans-serif, system-ui, sans-serif; letter-spacing: .04em; }
dl { margin: 0; }
dl > div + div { margin-top: 26px; }
dt { color: var(--burgundy); font-size: 1.8rem; line-height: 1.4; }
dd { margin: 5px 0 0; font-size: 1.125rem; }
.location-note { font-size: 1rem; margin: 38px 0 0; }
.family { margin: 36px 0; }
.family p { color: var(--burgundy); font-size: 1.3rem; line-height: 1.7; margin: 0; }
.venue { border-top: 1px solid var(--line); margin-top: 40px; padding-top: 36px; }
.venue-name { margin: 4px 0 18px; }
address { font-style: normal; font-size: 1.125rem; line-height: 1.8; }
.closing { padding: 96px 8px 150px; }
.closing p { font-size: clamp(1.8rem, 6vw, 2.5rem); line-height: 1.45; font-style: italic; color: var(--burgundy); margin: 0 0 24px; }
.closing-signature { display: block; color: var(--green); font-size: 1.25rem; }
.closing-hosts { display: block; margin-top: 14px; color: var(--green); font: 600 .6875rem/1.6 ui-sans-serif, system-ui, sans-serif; letter-spacing: .13em; text-transform: uppercase; }
.closing-flourish { display: block; color: var(--gold); font-size: 2.25rem; margin-top: 26px; }

.scroll-cue { position: static; isolation: isolate; z-index: 20; width: 100%; padding: 18px 16px calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--burgundy); pointer-events: none; text-align: center; font: 600 .8125rem/1.5 ui-sans-serif, system-ui, sans-serif; }
.has-script .scroll-cue { position: fixed; bottom: 0; left: 0; }
.has-script .scroll-cue::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--parchment) center / cover no-repeat; mask-image: linear-gradient(to bottom, transparent calc(100% - 145px), #000 calc(100% - 85px)); -webkit-mask-image: linear-gradient(to bottom, transparent calc(100% - 145px), #000 calc(100% - 85px)); }
.scroll-telugu { font-size: .8125rem; font-weight: 400; color: #62472c; }
.scroll-cue svg { width: 24px; height: 28px; margin-top: 4px; animation: scroll-pulse 2.4s ease-in-out infinite; }
@keyframes scroll-pulse { 0%,100% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(4px); opacity: .4; } }
@media (min-width: 760px) { .opening-stage { padding-top: 76px; } .invitation-section { padding-top: 90px; } }
@media (max-height: 700px) { .opening-stage { padding-top: calc(76px + env(safe-area-inset-top, 0px)); gap: 14px; } h1 { font-size: clamp(2rem, 7.8vw, 3rem); line-height: 1.15; } h1 .second-name { display: inline; margin: 0; } h1 em { font-size: .72em; margin: 0; vertical-align: 0; } .opening-heading .eyebrow { margin-bottom: 8px; } .opening-date { margin-top: 10px; font-size: .875rem; } .opening-caption { font-size: 1rem; } .has-story .opening-stage { gap: 14px; } }
@media (max-height: 499px) { .opening-stage { min-height: 100svh; padding-bottom: 110px; } .tabletop { width: min(65%, 420px); } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } html { scroll-snap-type: none !important; } }
