:root {
  --paper: #faf6ed;
  --maroon: #882a24;
  --ink: #453c35;
  --green: #315747;
  --gold: #ba8a4d;
  --line: #d9c8aa;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #e8eae4; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 15px/1.5 var(--serif); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button, a { touch-action: manipulation; }
button:disabled { cursor: default; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; -webkit-user-drag: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; }

.invitation-shell {
  --frame-crop: clamp(32px, 7svh, 64px);
  position: relative;
  width: min(100%, 640px);
  height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  background: url('../assets/frame-top.jpg') center calc(-1 * var(--frame-crop)) / 100% calc(100% + var(--frame-crop)) no-repeat var(--paper);
}

.palace-crown {
  position: absolute;
  inset: 0 0 auto;
  height: 58px;
  z-index: -1;
  background: url('../assets/frame-top.jpg') center top / 100% auto no-repeat;
  pointer-events: none;
}

.palace-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38px;
  z-index: -1;
  pointer-events: none;
  background-size: 100% auto;
  background-repeat: repeat-y;
}

.palace-edge-left { left: 0; background-image: url('../assets/frame-side.jpg'); }
.palace-edge-right { right: 0; background-image: url('../assets/frame-side-r.jpg'); }
.palace-crown, .palace-edge { display: none; }
.landing, #invite { position: relative; height: 100%; }
.landing { background: url('../assets/bg1.png') center -78cqw / 100% auto no-repeat var(--paper); }
#invite { overflow-y: auto; overflow-x: hidden; scroll-behavior: auto; overscroll-behavior-y: contain; scrollbar-width: none; }
#invite::-webkit-scrollbar { display: none; }
.petal-shower { position: absolute; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; }
.falling-petal { position: absolute; top: -20px; left: var(--petal-left); width: var(--petal-size); height: calc(var(--petal-size) * 1.5); animation: petal-fall var(--petal-duration) linear var(--petal-delay) infinite; }
.falling-petal::before { content: ''; display: block; width: 100%; height: 100%; border-radius: 75% 15% 65% 35%; background: linear-gradient(135deg, #fff7deaa, var(--petal-color) 60%); animation: petal-turn 4s ease-in-out var(--petal-delay) infinite; }
@keyframes petal-fall { from { transform: translate3d(0, 0, 0); opacity: 0; } 8%, 88% { opacity: .55; } to { transform: translate3d(var(--petal-drift), calc(100svh + 40px), 0); opacity: 0; } }
@keyframes petal-turn { 0%, 100% { transform: rotate(15deg) rotateY(0); } 50% { transform: rotate(150deg) rotateY(65deg); } }
.petal-shower.is-paused .falling-petal, .petal-shower.is-paused .falling-petal::before { animation-play-state: paused; }
.scratch-spark { position: absolute; width: 3px; height: 5px; border-radius: 1px; background: linear-gradient(135deg, #fff1b6, #ca9c40); animation: scratch-dust 850ms ease-out both; }
.scratch-glint { position: absolute; width: 12px; height: 12px; margin: -6px; background: #ffe6a1; clip-path: polygon(50% 0, 60% 38%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 38%); animation: scratch-glint 320ms ease-out both; }
@keyframes scratch-glint { from { opacity: .9; transform: scale(.4) rotate(0); } 35% { opacity: 1; transform: scale(1) rotate(20deg); } to { opacity: 0; transform: scale(.2) rotate(45deg); } }
@keyframes scratch-dust { from { opacity: .95; transform: translate3d(0, 0, 0) rotate(0); } 20% { opacity: .9; transform: translate3d(var(--spark-lift-x), -7px, 0) rotate(30deg); } to { opacity: 0; transform: translate3d(var(--spark-x), var(--spark-y), 0) rotate(var(--spark-turn)); } }
.floral { position: absolute; z-index: -1; pointer-events: none; object-fit: contain; }
.floral-opening-left { top: 45px; left: 24px; width: 185px; transform: scaleX(-1); }
.floral-opening-right { bottom: 15px; right: 23px; width: 135px; }
.floral-opening-left, .floral-opening-right { display: none; }
.floral-bottom-left { bottom: 0; left: 24px; width: 130px; transform: scaleX(-1); }
.floral-bottom-right { bottom: 0; right: 24px; width: 140px; }
.floral-top-right { top: 82px; right: 22px; width: 155px; }

.opening-content {
  position: relative;
  height: 100%;
  text-align: center;
}

.eyebrow { margin: 0; font: 500 11px/1.4 var(--sans); color: var(--green); letter-spacing: 0; text-transform: uppercase; }
.opening-heading { position: absolute; top: calc(37svh - 12px); left: 8%; right: 8%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.opening-heading .invocation, .opening-heading h1 { margin: 0; color: var(--maroon); font-size: inherit; font-weight: 400; line-height: 1.4; text-transform: uppercase; white-space: nowrap; }
.opening-heading h1 { font-size: .92em; }
.gate-control { position: absolute; top: 42svh; left: 50%; transform: translateX(-50%); display: flex; align-items: center; flex-direction: column; gap: 8px; padding: 0; border: 0; background: transparent; }
.gate-art { --gate-lift: 6px; position: relative; display: block; height: min(38svh, 370px); aspect-ratio: 650 / 966; perspective: 700px; scale: 1.04; transform-origin: center top; animation: gate-float 4.8s ease-in-out infinite; transition: filter 250ms; }
@keyframes gate-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(-1 * var(--gate-lift))); } }
.gate-control:hover .gate-art, .gate-control:focus-visible .gate-art { filter: drop-shadow(0 8px 8px #882a2426); }
.gate-frame, .gate-leaf { width: 100%; height: 100%; object-fit: contain; }
.gate-leaf { position: absolute; inset: 0; transition: transform 2200ms cubic-bezier(.25,.6,.25,1); backface-visibility: hidden; }
.gate-leaf-left { clip-path: polygon(27% 79%, 27% 46%, 30% 42%, 36% 40%, 37% 38%, 45% 37%, 50% 36%, 50% 79%); transform-origin: 27% 60%; }
.gate-leaf-right { clip-path: polygon(50% 36%, 55% 37%, 63% 38%, 64% 40%, 70% 42%, 73% 46%, 73% 79%, 50% 79%); transform-origin: 73% 60%; }
.gate-reveal { position: absolute; top: 35.8%; left: 26.8%; width: 46.4%; height: 43.4%; display: grid; place-items: center; background: var(--paper); opacity: 0; clip-path: polygon(0 100%,0 25%,7% 15%,20% 11%,22% 5%,40% 3%,50% 0,60% 3%,78% 5%,80% 11%,93% 15%,100% 25%,100% 100%); transition: opacity 180ms; }
.gate-preview { position: absolute; inset: 0; background: url('../assets/bg1.png') center 20% / 100% auto no-repeat var(--paper); }
.gate-preview .gate-preview-mantra { position: absolute; top: 35%; left: 19%; width: 62%; height: auto; }
.gate-preview .gate-preview-mahavir { position: absolute; top: 48%; left: 50%; width: auto; height: 42%; transform: translateX(-50%); }
.gate-caption { display: flex; align-items: center; gap: 9px; margin-top: 10px; color: var(--maroon); font-size: 17px; line-height: 1.4; }
.gate-caption svg { width: 18px; height: 18px; transition: transform 200ms; }
.gate-control:hover .gate-caption svg { transform: translateX(4px); }
.opening-couple { position: absolute; bottom: 3svh; left: 50%; transform: translateX(-50%); width: 140px; height: auto; aspect-ratio: 460 / 338; }
.opening-couple img { width: 100%; height: 100%; object-fit: contain; }
.is-opening .gate-reveal { opacity: 1; }
.is-opening .gate-art { animation-play-state: paused; }
.is-opening .gate-leaf-left { transform: rotateY(-83deg); }
.is-opening .gate-leaf-right { transform: rotateY(83deg); }
.is-opening .gate-caption { opacity: 0; }
.is-opening .gate-control { pointer-events: none; }
.landing.is-entering-gate {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  transform-origin: var(--entry-origin-x) var(--entry-origin-y);
  transform: translate(var(--entry-shift-x), var(--entry-shift-y)) scale(var(--entry-zoom));
  opacity: 0;
  transition: transform 2600ms cubic-bezier(.4, 0, .15, 1), opacity 360ms ease 2100ms;
}
.is-entering-gate .opening-heading, .is-entering-gate .opening-couple, .is-entering-gate .topbar {
  opacity: 0;
  transition: opacity 180ms ease;
}

.topbar { position: absolute; z-index: 5; top: max(64px, env(safe-area-inset-top)); left: 64px; right: 64px; display: flex; align-items: center; justify-content: flex-end; }
.utility-actions { display: flex; align-items: center; gap: 6px; }
.is-wedding .topbar { top: max(12px, env(safe-area-inset-top)); }
.utility-actions .icon-button { background: var(--paper); }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; color: var(--maroon); background: transparent; text-decoration: none; }
.icon-button:hover { background: #eee6d7; }
.icon-button:disabled { opacity: .3; }
.icon-button[data-tooltip]::after { content: attr(data-tooltip); position: absolute; z-index: 20; bottom: calc(100% + 8px); right: 0; padding: 6px 9px; color: white; background: var(--green); font: 11px/1.3 var(--sans); white-space: nowrap; opacity: 0; visibility: hidden; pointer-events: none; }
.icon-button[data-tooltip]:hover::after, .icon-button[data-tooltip]:focus-visible::after { opacity: 1; visibility: visible; }

.slide { --slide-top: 115px; --slide-bottom: 92px; position: relative; min-height: 100%; padding: var(--slide-top) 64px var(--slide-bottom); scroll-snap-align: start; scroll-snap-stop: always; outline: none; }
.slide.is-entering > :not(.floral) { animation: enter 550ms both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.slide-content { min-height: calc(100svh - var(--slide-top) - var(--slide-bottom)); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin: 6px 0 0; color: var(--maroon); font-size: 36px; font-weight: 400; line-height: 1.15; }
.heading-note { margin: 6px 0 0; color: var(--green); font-size: 17px; font-style: italic; }
.slide-blessing { --slide-top: 38svh; }
.blessing-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; min-height: calc(100svh - var(--slide-top) - var(--slide-bottom)); }
.blessing-mantra { width: min(72%, 360px); height: auto; }
.blessing-mahavir { width: auto; max-width: 65%; height: min(40svh, 380px); object-fit: contain; }
.invitation-content { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100svh - var(--slide-top) - var(--slide-bottom)); text-align: center; gap: 10px; }
.wedding-logo { width: auto; height: min(17svh, 145px); object-fit: contain; }
.family-names { width: min(78%, 390px); max-height: 43svh; object-fit: contain; }
.date-block { margin-top: 6px; }
.date-block::before { content: ''; display: block; width: 50px; height: 1px; margin: 0 auto 13px; background: var(--gold); }
.date-block > p { margin: 6px 0; color: var(--maroon); font-size: 21px; }
.date-block i { font-weight: 400; }
.text-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 0; border: 0; background: transparent; color: var(--green); font: 12px/1.4 var(--sans); text-decoration: none; }
.text-action:hover { color: var(--maroon); text-decoration: underline; text-underline-offset: 4px; }
.text-action svg { width: 17px; height: 17px; }
.celebrations-content .section-heading { margin-bottom: 18px; }
.celebrations-content .section-heading h2 { font-size: 30px; font-style: italic; }
.event-art { height: min(61svh, 550px); width: auto; max-width: 100%; object-fit: contain; }
.event-detail { margin: 9px 0 0; font: 11px/1.6 var(--sans); color: var(--green); }
.event-detail span { padding: 0 5px; color: var(--gold); }
.gallery-content .section-heading { margin-bottom: 32px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; gap: 14px; }
.gallery-item { position: relative; min-width: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; overflow: hidden; text-align: left; }
.gallery-item > img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform 350ms; }
.gallery-item:hover > img { transform: scale(1.035); }
.gallery-caption { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding-top: 9px; color: var(--green); font: 11px/1.5 var(--sans); }
.gallery-caption svg { width: 13px; height: 13px; }
.venue-content .section-heading { margin-bottom: 10px; }
.venue-art { height: min(53svh, 480px); width: auto; max-width: 100%; object-fit: contain; }
.venue-content > .text-action { margin-top: 8px; }
.family-content { justify-content: flex-start; padding-bottom: 10px; }
.family-content .section-heading h2 { font-size: 30px; }
.family-couple { width: 150px; margin: 22px auto 0; }
.rsvp-heading { margin: 5px 0 28px; }
.rsvp-heading > p:last-child { margin: 5px 0 0; color: var(--maroon); font-size: 22px; font-style: italic; }
.family-grid { width: min(100%, 620px); display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; padding-top: 25px; border-top: 1px solid var(--line); }
.family-group { min-width: 0; }
.family-group h3 { margin: 0 0 10px; font-size: 23px; font-weight: 400; font-style: italic; color: var(--maroon); }
.family-group p { margin: 0 0 18px; font: 12px/1.9 var(--sans); }
.family-signoff { margin: 28px 0 10px; font-size: 19px; font-style: italic; color: var(--green); }

.scene-navigation { position: absolute; z-index: 5; bottom: 0; left: 45px; right: 45px; min-height: calc(76px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; justify-content: space-between; align-items: center; gap: 25px; background: transparent; pointer-events: none; }
.scene-navigation .icon-button, .scene-navigation .page-dots { pointer-events: auto; }
.nav-arrow { border: 1px solid var(--line); width: 38px; height: 38px; background: #faf6edf2; }
.page-dots { display: none; }
.page-dot { display: grid; place-items: center; width: 22px; height: 30px; border: 0; padding: 0; background: transparent; }
.page-dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #c9b99d; transition: transform 180ms, background 180ms; }
.page-dot[aria-current="page"]::before { background: var(--maroon); transform: scale(1.6); }
.page-counter { color: var(--maroon); font: 11px/1.5 var(--sans); transform: translateY(12px); }
#landing:not([hidden]) ~ .scene-navigation .page-counter { visibility: hidden; }

.lightbox { position: fixed; width: 100vw; max-width: none; height: 100svh; max-height: none; margin: 0; border: 0; padding: 48px 80px; background: #18271feF; color: white; overflow: hidden; }
.lightbox::backdrop { background: #18271f; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { display: flex; flex-direction: column; align-items: center; height: 100%; width: 100%; margin: 0; gap: 12px; }
.lightbox figure img { min-height: 0; max-height: calc(100% - 34px); width: auto; max-width: 100%; object-fit: contain; }
.lightbox figcaption { font: 12px/1.5 var(--sans); }
.lightbox .icon-button { position: absolute; color: white; background: #ffffff12; }
.lightbox .icon-button:hover { background: #ffffff30; }
.lightbox-close { top: max(16px, env(safe-area-inset-top)); right: 20px; }
.lightbox-prev { top: calc(50% - 20px); left: 20px; }
.lightbox-next { top: calc(50% - 20px); right: 20px; }

@media (min-width: 1100px) {
  .floral-opening-left { width: 240px; top: 85px; }
  .floral-opening-right { width: 180px; bottom: 30px; }
}

@media (max-width: 650px) {
  .palace-edge { width: 23px; }
  .palace-crown { height: 38px; }
  .opening-heading { font-size: 12px; }
  .eyebrow { font-size: 10px; }
  .gate-art { height: min(37svh, 330px); }
  .opening-couple { width: 130px; }
  .floral-opening-left { top: 43px; left: 18px; width: 99px; }
  .floral-opening-right { right: 15px; width: 77px; }
  .floral-bottom-left, .floral-bottom-right { width: 76px; }
  .floral-bottom-left { left: 14px; }
  .floral-bottom-right { right: 14px; }
  .floral-top-right { width: 95px; right: 17px; top: 65px; }
  .topbar { top: max(43px, env(safe-area-inset-top)); left: 35px; right: 30px; }
  .utility-actions { gap: 0; }
  .icon-button { width: 36px; height: 36px; }
  .slide { --slide-top: 91px; --slide-bottom: 83px; padding: var(--slide-top) 37px var(--slide-bottom); }
  .slide-blessing { --slide-top: 38svh; }
  .blessing-content { gap: 26px; }
  .blessing-mantra { width: 72%; }
  .blessing-mahavir { max-width: 78%; height: min(40svh, 370px); }
  .section-heading h2 { font-size: 30px; }
  .section-heading { margin-bottom: 22px; }
  .family-names { width: 100%; max-height: 42svh; }
  .wedding-logo { height: min(16svh, 125px); }
  .date-block > p { font-size: 19px; }
  .event-art { height: min(61svh, 500px); }
  .event-detail { max-width: 245px; font-size: 10px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 13px; }
  .gallery-item > img { aspect-ratio: 4 / 5; }
  .gallery-caption { font-size: 10px; padding-top: 7px; }
  .gallery-caption svg { width: 12px; height: 12px; }
  .venue-art { height: min(52svh, 430px); }
  .family-content .section-heading h2 { font-size: 27px; }
  .family-grid { grid-template-columns: 1fr; gap: 16px; }
  .family-couple { width: 130px; }
  .family-signoff { font-size: 17px; }
  .scene-navigation { left: 27px; right: 27px; min-height: calc(72px + env(safe-area-inset-bottom)); gap: 13px; }
  .page-counter { display: block; }
  .page-dots { gap: 3px; }
  .page-dot { width: 20px; }
  .lightbox { padding: 66px 47px 40px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

@media (max-width: 370px) {
  .opening-heading { font-size: 11px; }
  .slide { padding-left: 33px; padding-right: 33px; }
  .gallery-caption { font-size: 9px; }
}

@media (max-height: 740px) {
  .gate-art { height: 34svh; }
  .gate-caption { margin-top: 4px; font-size: 16px; }
  .opening-couple { width: 112px; }
  .invitation-content { gap: 5px; }
  .wedding-logo { height: 13svh; }
  .family-names { max-height: 37svh; }
  .date-block::before { margin-bottom: 8px; }
  .event-art { height: 45svh; }
  .venue-art { height: 44svh; }
  .section-heading h2 { font-size: 28px; }
}

@media (max-height: 480px) {
  .opening-heading { top: calc(37svh - 24px); font-size: 12px; }
  .gate-art { --gate-lift: 2px; height: 41svh; }
  .gate-caption { margin-top: 6px; font-size: 13px; }
  .opening-couple { display: none; }
  .slide { --slide-top: 105px; }
  .slide-blessing { --slide-top: 50px; }
  .blessing-content { gap: 12px; }
  .blessing-mantra { max-height: 16svh; object-fit: contain; }
  .blessing-mahavir { height: 38svh; }
  .event-art { height: 24svh; }
  .celebrations-content .section-heading { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  #invite { scroll-behavior: auto; }
  .petal-shower { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Bottom alignment crops the dome, keeping the leaves and final woman artwork in one scene. */
.blessing-story {
  background: url('../assets/bg1.png') center bottom / 100% 116.3% no-repeat var(--paper);
}
.blessing-story .slide-blessing {
  --slide-top: 35svh;
  min-height: 100svh;
}
.blessing-story .blessing-content {
  min-height: 0;
  justify-content: flex-start;
}
.blessing-story .blessing-mantra { width: min(62%, 310px); scale: .96774; transform-origin: center top; }
.blessing-story .blessing-mahavir { height: min(42svh, 385px); margin-top: 26px; }
.blessing-story .slide-invitation {
  --slide-top: 46px;
  --slide-bottom: 76px;
  height: 100svh;
  min-height: 100svh;
}
.blessing-story .invitation-content {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-content: stretch;
  justify-items: center;
  gap: 6px;
}
.blessing-story .family-names { width: min(100%, 475px); height: 100%; min-height: 0; max-height: 50svh; align-self: center; margin-top: 0; }
.blessing-story .wedding-logo { height: min(24svh, 210px); transform: translateY(-4px); }
.blessing-story .date-block { width: min(92%, 270px); margin-top: 8px; }
.blessing-story .date-block::before { display: none; }
.blessing-story .slide-art { min-height: 100svh; padding: 0; }
.celebration-story { background: url('../assets/bg2.png') center bottom / 100% 105.41% no-repeat var(--paper); }
.slide-background-two { height: 100svh; min-height: 100svh; padding: 35svh 48px 76px; display: flex; justify-content: center; align-items: flex-start; }
.slide-continuation { height: 100svh; min-height: 100svh; padding: 92px 48px 76px; display: flex; align-items: center; justify-content: center; background: none left 30px / 44% auto no-repeat, none right bottom / 22% auto no-repeat, url('../assets/pdf-continuation-background.jpg') center top / 100% auto no-repeat var(--paper); }
.slide-continuation::before, .slide-continuation::after { content: ''; position: absolute; aspect-ratio: 400 / 696; background: url('../assets/tree.png') center / contain no-repeat; pointer-events: none; }
.slide-continuation::before { top: 48px; left: 0; width: min(34%, calc((100svh - 80px) * .48)); transform: scaleX(-1) rotate(-12deg); }
.slide-continuation::after { bottom: 16px; right: 0; width: min(22%, calc((100svh - 80px) * .48)); transform: rotate(-12deg); }
#gallery::before, #rsvp::before { width: min(26%, calc((100svh - 80px) * .48)); }
.slide-continuation > * { position: relative; z-index: 1; }
.continuation-function { --gate-top-padding: 92px; --gate-side-padding: 96px; }
.continuation-function .function-gate { --art-height: min(45svh, 424px, calc(100svh - 288px)); --gate-image-height: min(var(--art-height), calc((100cqw - var(--gate-side-padding)) / .9)); --gate-shift-limit: calc((100svh - var(--gate-top-padding) - var(--gate-image-height) - 108px) / 2 - 12px); max-width: 500px; }
#haldi, #reception, #welcome { background-position: left 30px, right bottom, center -16.57cqw; }
#haldi .function-gate { transform: translateY(min(146px, var(--gate-shift-limit))); }
#reception .function-gate { transform: translateY(min(138px, var(--gate-shift-limit))); }
.slide-continuation.slide-welcome { align-items: flex-end; padding-bottom: 112px; }
.slide-welcome::before { width: min(44%, calc((100svh - 80px) * .48)); }
.slide-welcome .welcome-art { position: relative; }
.welcome-art { display: block; width: min(75%, 360px); aspect-ratio: 280 / 209; }
.welcome-art img { width: 100%; height: 100%; object-fit: contain; }
.pdf-gallery-content, .pdf-venue-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; max-width: 100%; }
.pdf-page-heading { text-align: center; color: var(--maroon); }
.pdf-page-heading h2 { margin: 0; font-size: 28px; font-style: italic; font-weight: 400; }
.pdf-page-heading p { margin: 3px 0 0; font-size: 12px; text-transform: uppercase; }
.pdf-gallery-frame { position: relative; height: min(40svh, 380px, calc(100svh - 320px)); aspect-ratio: 650 / 966; max-width: 100%; }
.pdf-gallery-frame-art { width: 100%; height: 100%; object-fit: contain; }
.pdf-gallery-opening { position: absolute; top: 35.8%; left: 26.8%; width: 46.4%; height: 43.4%; background: var(--paper); clip-path: polygon(0 100%,0 25%,7% 15%,20% 11%,22% 5%,40% 3%,50% 0,60% 3%,78% 5%,80% 11%,93% 15%,100% 25%,100% 100%); }
.pdf-gallery-photo { width: 100%; height: 100%; object-fit: cover; }
.pdf-venue-art { height: min(50svh, 450px, calc(100svh - 280px)); width: auto; max-width: 100%; object-fit: contain; }
.slide-continuation.slide-rsvp { height: auto; align-items: flex-start; padding-top: 142px; }
.pdf-rsvp-content { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 100%; max-width: 490px; color: var(--maroon); text-align: center; }
.weather-link { font-size: 18px; font-style: italic; text-underline-offset: 4px; }
.pdf-rsvp-heading h2 { margin: 0; font-size: 28px; font-weight: 400; text-decoration: underline; text-underline-offset: 5px; }
.pdf-rsvp-heading p { margin: 6px 0; font-size: 18px; font-style: italic; }
.pdf-rsvp-heading strong { font-size: 12px; font-weight: 400; text-transform: uppercase; }
.rsvp-group h3 { margin: 2px 0 3px; font-size: 17px; font-weight: 400; font-style: italic; }
.rsvp-group p { margin: 0; font-size: 11px; line-height: 1.4; text-transform: uppercase; }
.slide-sangeet { padding-top: 92px; align-items: center; }
.function-gate { --art-height: min(49svh, 460px); --art-ratio: .9; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 108px; justify-items: center; width: min(100%, calc(var(--art-height) * var(--art-ratio))); }
.slide-mayra .function-gate { --art-height: min(49svh, 460px, calc(65svh - 184px)); }
.slide-sangeet .function-gate { --art-height: min(45svh, 424px, calc(100svh - 288px)); --art-ratio: .89845; max-width: 500px; transform: translateY(-24px); }
.function-art-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; line-height: 0; }
.function-art { --function-lift: 4px; width: 100%; height: auto; aspect-ratio: var(--art-ratio); object-fit: contain; scale: 1.01; animation: function-gate-float 4.8s ease-in-out infinite; filter: drop-shadow(0 5px 5px #882a2424); }
@keyframes function-gate-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(-1 * var(--function-lift))); } }
.function-gate[aria-busy="true"] .function-art { animation-play-state: paused; }
.function-gate-actions { display: grid; grid-template-rows: 40px 24px 36px; gap: 4px; justify-items: center; align-items: center; width: max(100%, min(280px, calc(100cqw - 28px))); height: 108px; }
.function-name { margin: 0; color: var(--maroon); font-size: 16px; line-height: 24px; text-align: center; white-space: nowrap; }
.function-open { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border: 0; background: transparent; color: var(--maroon); font-size: 16px; }
.function-open:hover { color: var(--green); }
.function-open svg { width: 17px; height: 17px; }
.function-replay { display: inline-flex; justify-content: center; align-items: center; gap: 6px; width: auto; min-width: 100px; height: 36px; padding: 0 12px; border: 1px solid var(--gold); border-radius: 4px; font: 11px var(--sans); background: #faf6edf2; box-shadow: 0 2px 7px #882a2420; transition: transform 180ms, box-shadow 180ms, background 180ms; }
.function-replay svg { width: 16px; height: 16px; }
.function-replay:hover { background: #fffaf0; box-shadow: 0 4px 10px #882a242b; transform: translateY(-2px); }
.function-replay svg { transition: transform 180ms; }
.function-replay:hover svg { transform: rotate(-25deg); }
.is-art .scene-navigation { justify-content: space-between; }
.is-art .page-counter { display: none; }
/* .is-welcome .page-counter { visibility: hidden; } removed to show on page 8 */
.scratch-date { position: relative; width: 100%; aspect-ratio: 659 / 237; overflow: hidden; touch-action: pan-y; cursor: pointer; }
.scratch-date:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
.scratch-date > img { position: absolute; top: -67.51055%; width: 100%; height: auto; clip-path: inset(70% 0 0); }
.scratch-date-art, #scratch-cover {
  position: absolute;
  top: 0;
  left: 14.1%;
  width: 69.8%;
  height: 52%;
}
.scratch-date-art { overflow: hidden; border: 2px solid var(--gold); background: var(--paper); }
.scratch-date-art img { position: absolute; top: 50%; left: -20.2%; width: 143.27%; max-width: none; height: auto; transform: translateY(-51.64%); clip-path: inset(43% 0 36%); }
#scratch-cover {
  z-index: 1;
}
#scratch-cover { touch-action: none; transition: opacity 280ms ease; }
.scratch-date.is-scratching #scratch-cover { filter: drop-shadow(0 1px 2px #ba8a4d66); }
.scratch-date.is-revealed #scratch-cover { opacity: 0; pointer-events: none; }
.scratch-date.is-revealed .scratch-date-art { transform-origin: center; animation: date-reveal 650ms ease-in-out both; }
@keyframes date-reveal { 0% { transform: scale(1); box-shadow: 0 0 0 0 #d7b45c00; } 45% { transform: scale(1.12); box-shadow: 0 0 12px 2px #d7b45c55; } 100% { transform: scale(1); box-shadow: 0 0 0 0 #d7b45c00; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 650px) {
  .blessing-story .slide-invitation { --slide-top: 38px; --slide-bottom: 72px; padding-left: 14px; padding-right: 14px; }
  .slide-background-two { padding-left: 14px; padding-right: 14px; padding-bottom: 72px; }
  .slide-sangeet { padding-top: 80px; }
  .slide-continuation { padding: 82px 28px 72px; }
  .continuation-function { --gate-top-padding: 82px; --gate-side-padding: 28px; padding-left: 14px; padding-right: 14px; }
}
@media (max-height: 740px) {
  #haldi .function-gate { transform: translateY(min(88px, var(--gate-shift-limit))); }
  #reception .function-gate { transform: translateY(min(80px, var(--gate-shift-limit))); }
  .blessing-story .wedding-logo { height: 22svh; }
  .blessing-story .family-names { max-height: 46svh; margin-top: 0; }
  .blessing-story .date-block { width: min(88%, 240px); }
  .pdf-rsvp-content { gap: 4px; }
  .pdf-rsvp-heading h2 { font-size: 25px; }
  .pdf-rsvp-heading p { font-size: 16px; }
  .rsvp-group h3 { font-size: 15px; }
  .rsvp-group p { font-size: 10px; line-height: 1.3; }
}
@media (max-height: 480px) {
  .continuation-function .function-gate { --gate-shift-limit: calc((100svh - var(--gate-top-padding) - var(--gate-image-height) - 108px) / 2 + 14px); }
  .slide-welcome .welcome-art { width: min(75%, 360px, calc((100svh - 220px) * 1.3397)); }
  .blessing-story .slide-blessing { --slide-top: 54px; }
  .function-art { --function-lift: 2px; }
  .blessing-story .slide-invitation { --slide-top: 24px; --slide-bottom: 24px; }
  .blessing-story .wedding-logo { height: 16svh; }
  .blessing-story .date-block { width: 180px; }
  .scene-navigation { justify-content: space-between; }
  .scene-navigation .page-counter { display: none; }
}
