:root {
    --gold: #efd67f;
    --gold-bright: #ffe4a0;
    --red: #790b12;
    --ink: #4c080e;
    --serif: 'Trajan Pro', Georgia, 'Times New Roman', serif;
    color-scheme: dark
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 22px
}

body {
    margin: 0;
    background: radial-gradient(ellipse at 50% 25%, #530710, #1e0206 75%);
    color: var(--gold);
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.5;
    text-align: center
}

body.modal-open {
    overflow: hidden
}

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

button {
    font: inherit;
    color: inherit;
    cursor: pointer
}

a {
    color: inherit
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #fff6c2;
    outline-offset: 5px
}

button:disabled {
    cursor: default
}

img {
    display: block;
    max-width: 100%;
    height: auto
}

button img {
    pointer-events: none
}

[hidden] {
    display: none !important
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

.invitation-shell {
    position: relative;
    width: min(100%, 560px);
    min-height: 100svh;
    margin: auto;
    background: #860810 url('assets/invitation-bg.webp') center top/100% auto repeat-y;
    box-shadow: 0 0 110px #0009;
    border-inline: 1px solid #b88546
}

.invitation-shell:after {
    content: '';
    position: absolute;
    inset: 0 1.8%;
    border-inline: 1px solid #d2b06c70;
    pointer-events: none;
    z-index: 3
}

.ornamental {
    position: relative;
    background: url('assets/invitation-bg.webp') center top/100% auto no-repeat
}

.entrance {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(72px, 11svh, 118px) 16px 75px;
    transition: opacity .8s, filter .8s;
    overflow: hidden
}

.entrance-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%
}

.ganesh {
    width: clamp(90px, 25vw, 125px);
    margin-bottom: 30px
}

.invited-title {
    width: 82%;
    max-width: 380px
}

.main-gate {
    position: relative;
    display: block;
    width: clamp(235px, 78vw, 365px);
    max-width: 100%;
    aspect-ratio: 2/3;
    padding: 0;
    border: 0;
    background: transparent;
    perspective: 1000px;
    isolation: isolate;
    margin: 18px auto 8px
}

.main-gate img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%
}

.gate-frame {
    clip-path: url(#gate-frame);
    z-index: 4;
    pointer-events: none
}

.gate-door {
    z-index: 3;
    backface-visibility: hidden;
    transition: transform 1.8s cubic-bezier(.35, 0, .2, 1), filter 1.8s
}

.gate-left {
    clip-path: url(#door-left);
    transform-origin: 30.2% center
}

.gate-right {
    clip-path: url(#door-right);
    transform-origin: 69.8% center
}

.door-light {
    position: absolute;
    left: 30%;
    top: 35%;
    width: 40%;
    height: 44%;
    border-radius: 48% 48% 0 0;
    background: radial-gradient(ellipse, #fff5c6, #e9ad42 70%);
    box-shadow: 0 0 25px #e7bf5860;
    z-index: 1;
    opacity: 0;
    transition: opacity .8s
}

.opening .gate-left {
    transform: rotateY(-108deg);
    filter: brightness(.5)
}

.opening .gate-right {
    transform: rotateY(108deg);
    filter: brightness(.5)
}

.opening .door-light {
    opacity: 1
}

.gate-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 43%, #ffefb025 48%, transparent 53%);
    background-size: 300% 100%;
    animation: shimmer 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 5;
    clip-path: polygon(20% 29%, 80% 29%, 80% 82%, 20% 82%)
}

.open-caption {
    border: 0;
    padding: 14px;
    background: none;
    width: 62%;
    max-width: 290px;
    animation: breathe 3s infinite
}

.entrance-date {
    font-size: 14px;
    letter-spacing: .09em;
    margin: 12px 0 0;
    color: #e2c589
}

.entrance.leaving {
    opacity: 0;
    filter: blur(5px)
}

main {
    animation: appear 1s both
}

.section-inner {
    padding: 0 24px
}

.blessings {
    padding-top: clamp(105px, 25vw, 145px)
}

.mantra {
    width: 86%;
    margin: 0 auto 24px
}

.deity-wrap {
    width: 35%;
    max-width: 150px;
    margin: 0 auto 24px;
    position: relative
}

.deity-wrap:before {
    content: '';
    position: absolute;
    inset: 0 -20%;
    background: radial-gradient(ellipse, #f2d88230, transparent 68%);
    filter: blur(8px)
}

.deity {
    position: relative;
    width: 100%;
    filter: drop-shadow(0 8px 12px #31010080)
}

.art-zoom {
    display: block;
    padding: 0;
    background: none;
    border: 0;
    margin: auto
}

.family-art {
    width: 100%
}

.family-art img {
    width: 100%
}

.date-section {
    margin: 28px auto 34px
}

.micro {
    font-size: 14px;
    letter-spacing: .1em;
    margin: 0 0 15px
}

.scratch-card {
    position: relative;
    width: 86%;
    max-width: 340px;
    height: 148px;
    padding: 7px;
    border: 1px solid #e9c76c;
    box-shadow: 0 8px 25px #39020880;
    margin: auto
}

.date-under {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f3dea0;
    color: #641018;
    gap: 4px
}

.date-under span:first-child {
    font-style: italic;
    font-size: 19px
}

.date-under strong {
    font-size: clamp(21px, 5.4vw, 29px);
    font-weight: 400
}

.date-under span:last-child {
    font-size: 19px;
    letter-spacing: .15em
}

canvas {
    position: absolute;
    inset: 7px;
    width: calc(100% - 14px);
    height: calc(100% - 14px);
    touch-action: none;
    cursor: crosshair;
    transition: opacity .85s
}

.scratch-card.revealed canvas {
    opacity: 0;
    pointer-events: none
}

.scratch-card.revealed {
    animation: gold-pulse 1.2s
}

.text-button {
    border: 0;
    border-bottom: 1px solid #d3b35e80;
    background: none;
    padding: 10px 0 6px;
    margin: 12px 0 0;
    font-size: 14px;
    min-height: 44px
}

.continue-link {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-decoration: none;
    font-size: 16px;
    font-style: italic;
    padding-bottom: 30px
}

.down-chevron {
    font-size: 25px;
    animation: drift 2s infinite
}

.functions {
    padding-top: 24px
}

.flow-title {
    width: 80%;
    margin: 0 auto 18px
}

.section-hint {
    font-size: 15px;
    font-style: italic;
    line-height: 1.6;
    margin: 0 auto 22px;
    color: #f2d29a
}

.event {
    position: relative;
    margin: 0 auto 44px
}

.event-topline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 13px;
    letter-spacing: .12em;
    margin: 30px 0 0
}

.event-topline:before,
.event-topline:after {
    content: '';
    height: 1px;
    width: 40px;
    background: linear-gradient(90deg, transparent, #d4a65d)
}

.event-topline:after {
    transform: rotate(180deg)
}

.event-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 771/1150;
    isolation: isolate
}

.event-frame {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
    pointer-events: none;
    filter: drop-shadow(0 8px 7px #32000550)
}

.event-window {
    position: absolute;
    left: 20.65%;
    right: 20.65%;
    top: 28.3%;
    bottom: 18.6%;
    clip-path: url(#event-window);
    overflow: hidden;
    background: #4b080e;
    perspective: 800px
}

.event-art {
    width: 100%;
    height: 100%;
    object-fit: fill;
    transform: scale(1.07);
    transition: transform 1.6s .2s, filter 1.2s;
    filter: brightness(.6)
}

.event.open .event-art {
    transform: scale(1);
    filter: brightness(1)
}

.event-trigger {
    position: absolute;
    inset: 0;
    padding: 0;
    border: 0;
    background: transparent;
    display: block;
    z-index: 6
}

.event-trigger:focus-visible {
    outline-offset: -8px;
    border-radius: 40% 40% 0 0
}

.cover-panel {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    transition: transform 1.65s cubic-bezier(.3, 0, .15, 1), opacity 1s;
    backface-visibility: hidden
}

.cover-panel:after {
    content: '';
    position: absolute;
    inset: 9px;
    border: 1px solid #e8c27275
}

.event-label {
    position: absolute;
    z-index: 7;
    left: 22%;
    right: 22%;
    top: 43%;
    bottom: 25%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    transition: opacity .3s, transform .4s;
    text-shadow: 0 2px 5px #0005
}

.event-label .number {
    font-size: 13px;
    letter-spacing: .18em
}

.event-label h3 {
    font-size: clamp(22px, 6.3vw, 34px);
    line-height: 1.2;
    font-weight: 400;
    font-style: italic;
    margin: 12px -3px
}

.event-label .tap-label {
    font-size: 12px;
    letter-spacing: .08em;
    border-top: 1px solid #d7b46d80;
    padding-top: 10px;
    margin-top: 3px
}

.event-label .seal {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #cda565;
    border-radius: 50%;
    margin-top: 14px;
    background: #d6ad5030;
    font-size: 17px
}

.event.open .event-label {
    opacity: 0;
    transform: scale(.94)
}

.mehendi .cover-panel {
    background: repeating-linear-gradient(45deg, transparent 0 17px, #d2b25c15 18px 19px, transparent 20px 36px), repeating-linear-gradient(-45deg, transparent 0 17px, #d2b25c15 18px 19px, transparent 20px 36px), linear-gradient(100deg, #183827, #315c3a, #142f20)
}

.mehendi .panel-a {
    right: 50%;
    transform-origin: left
}

.mehendi .panel-b {
    left: 50%;
    transform-origin: right
}

.mehendi.open .panel-a {
    transform: rotateY(-105deg)
}

.mehendi.open .panel-b {
    transform: rotateY(105deg)
}

.sangeet .cover-panel {
    background: repeating-linear-gradient(90deg, #130e25 0%, #35273b 14%, #0b0a19 26%, #48313e 33%, #151022 44%);
    border-bottom: 4px solid #caa35e
}

.sangeet .panel-a {
    right: 49.8%
}

.sangeet .panel-b {
    left: 49.8%
}

.sangeet.open .panel-a {
    transform: translateX(-103%) skewY(-7deg)
}

.sangeet.open .panel-b {
    transform: translateX(103%) skewY(7deg)
}

.haldi .panel-a {
    background: repeating-linear-gradient(0deg, #93611d22 0 1px, transparent 2px 6px), linear-gradient(100deg, #9e5c12, #d49a29 42%, #b77619);
    transform-origin: top;
    box-shadow: inset 0 -7px 0 #e9c264, inset 0 -12px 0 #734415
}

.haldi .panel-b {
    display: none
}

.haldi.open .panel-a {
    transform: translateY(-104%)
}

.wedding .cover-panel {
    background: linear-gradient(90deg, #6e111c, #951e2c 45%, #5a0a15);
    box-shadow: inset 0 0 20px #20010b;
    border: 1px solid #c49558
}

.wedding .cover-panel:after {
    inset: 14px;
    border: 3px double #d6b576
}

.wedding .panel-a {
    right: 50%;
    transform-origin: left
}

.wedding .panel-b {
    left: 50%;
    transform-origin: right
}

.wedding.open .panel-a {
    transform: rotateY(-125deg)
}

.wedding.open .panel-b {
    transform: rotateY(125deg)
}

.event-caption {
    font-size: 15px;
    margin: -6px 0 0
}

.event-tools {
    min-height: 46px;
    display: flex;
    justify-content: center;
    gap: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s
}

.event.open .event-tools {
    opacity: 1;
    visibility: visible
}

.event-tools button {
    border: 0;
    background: none;
    font-size: 14px;
    border-bottom: 1px solid #ad884c;
    padding: 7px 0;
    min-height: 44px
}

.photos {
    padding: 18px 30px 25px;
    scroll-margin-top: 30px
}

.gallery-title {
    width: 80%;
    margin: auto auto 14px
}

.photo-frame {
    position: relative;
    width: 84%;
    aspect-ratio: 771/1150;
    margin: 20px auto 0
}

.photo-frame>img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%
}

.photo-message {
    position: absolute;
    inset: 32% 22% 22%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #53091280
}

.photo-message p {
    font-size: 16px;
    font-style: italic;
    line-height: 1.8
}

.small-ornament {
    font-size: 30px
}

.rsvp {
    padding: 34px 30px 15px;
    scroll-margin-top: 35px
}

.rsvp-art {
    width: 100%
}

.rsvp-art img {
    width: 100%
}

.rsvp-note {
    font-size: 16px;
    font-style: italic;
    line-height: 1.6;
    margin: 20px 10px
}

.closing {
    padding: 12px 28px 170px;
    background: url('assets/invitation-bg.webp') center bottom/100% auto no-repeat
}

.closing-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 20px auto
}

.closing-rule:before,
.closing-rule:after {
    content: '';
    width: 65px;
    height: 1px;
    background: #bd985f
}

.closing>p {
    margin: 6px 0;
    font-style: italic
}

.couple-signature {
    font-size: 30px
}

.footer-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 24px auto 0;
    width: 85%;
    max-width: 320px
}

.footer-actions button,
.footer-actions a {
    font-size: 14px;
    min-height: 44px;
    padding: 12px 20px;
    background: #650d16;
    border: 1px solid #ba934f;
    color: #efd67f;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 4px;
    letter-spacing: .02em
}

.action-status {
    font-size: 14px;
    min-height: 21px
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, 560px);
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #bc9457;
    background: #710d15f5;
    box-shadow: 0 -8px 30px #36040b80;
    backdrop-filter: blur(14px)
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 3px;
    min-height: 58px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: .035em;
    color: #e4bb8d;
    transition: background .3s, color .3s
}

.bottom-nav a.active {
    background: #e7c28524;
    color: #fff0ba
}

.bottom-nav svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
    stroke-linecap: round
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 20
}

.ambient i {
    position: absolute;
    left: var(--x);
    top: -15px;
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    background: #f9d774;
    box-shadow: 0 0 7px #ffc95e80;
    opacity: 0;
    animation: fall var(--t) linear infinite;
    animation-delay: var(--d)
}

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .9s, transform .9s
}

.reveal.visible {
    opacity: 1;
    transform: none
}

.entrance-reveal {
    animation: appear 1s both
}

.entrance-reveal:nth-child(2) {
    animation-delay: .2s
}

.entrance-reveal:nth-child(4) {
    animation-delay: .4s
}

dialog {
    width: min(94vw, 570px);
    max-height: 90svh;
    padding: 0;
    border: 1px solid #c6a362;
    background: #6b0b15;
    color: var(--gold);
    box-shadow: 0 20px 100px #000a;
    overflow: auto
}

dialog::backdrop {
    background: #190107d9;
    backdrop-filter: blur(8px)
}

.dialog-bar {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #610913f5;
    z-index: 2;
    border-bottom: 1px solid #b0884a
}

.dialog-bar h2 {
    font-weight: 400;
    font-size: 19px;
    margin: 0
}

.dialog-bar button {
    border: 0;
    background: none;
    font-size: 30px;
    width: 44px;
    min-height: 44px
}

#detail-body {
    padding: 18px
}

#detail-body img {
    width: 100%;
    height: auto
}

.detail-copy {
    line-height: 1.8;
    font-size: 17px
}

.detail-copy h3 {
    font-size: 24px;
    font-style: italic;
    font-family: sans-serif;
    font-weight: 500;
}

.detail-copy p {
    margin: 14px 0
}

@keyframes fall {
    0% {
        transform: translateY(-10px) translateX(0);
        opacity: 0
    }

    15%,
    80% {
        opacity: .55
    }

    100% {
        transform: translateY(105vh) translateX(30px);
        opacity: 0
    }
}

@keyframes breathe {
    50% {
        opacity: .55
    }
}

@keyframes drift {
    50% {
        transform: translateY(5px)
    }
}

@keyframes shimmer {

    0%,
    55% {
        background-position: 150% 0
    }

    90%,
    100% {
        background-position: -100% 0
    }
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(15px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes gold-pulse {
    50% {
        box-shadow: 0 0 38px #f1cc6680
    }
}

@media(min-width:700px) {
    .invitation-shell {
        margin-top: 24px;
        margin-bottom: 24px;
        border: 1px solid #bc965b
    }

    .entrance {
        min-height: calc(100svh - 48px);
        padding-top: 105px
    }

    .main-gate {
        width: min(365px, 38svh)
    }

    .ganesh {
        width: 110px;
        margin-bottom: 25px
    }
}

@media(max-width:380px) {
    .section-inner {
        padding-inline: 18px
    }

    .entrance {
        padding-inline: 10px
    }

    .ganesh {
        margin-bottom: 25px
    }

    .main-gate {
        width: 84%;
        margin-top: 12px
    }

    .event-label h3 {
        font-size: 22px
    }

    .event-label .tap-label {
        font-size: 12px
    }

    .event-label .seal {
        margin-top: 7px;
        width: 28px;
        height: 28px
    }

    .photos,
    .rsvp {
        padding-inline: 22px
    }

    .scratch-card {
        width: 92%
    }

    .bottom-nav {
        padding-inline: 5px
    }

    .event-topline {
        font-size: 12px
    }
}

@media(max-height:740px) and (max-width:699px) {
    .entrance {
        padding-top: 75px;
        padding-bottom: 45px
    }

    .main-gate {
        width: min(74vw, 265px)
    }

    .ganesh {
        width: 85px;
        margin-bottom: 22px
    }

    .entrance-date {
        margin-top: 4px
    }

    .open-caption {
        width: 58%;
        padding: 10px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    *,
    *:before,
    *:after {
        animation: none !important;
        transition: none !important
    }

    .reveal {
        opacity: 1;
        transform: none
    }

    .ambient {
        display: none
    }
}

/* Keep the complete opening invitation within short phone viewports. */
.entrance {
    padding-top: clamp(68px, 10svh, 105px);
    padding-bottom: 32px
}

.ganesh {
    width: clamp(72px, 11svh, 110px);
    margin-top: 30px;
    margin-bottom: 20px
}

.main-gate {
    width: min(78vw, calc((100svh - 320px)*.6667), 350px);
    margin: 16px auto 6px
}

.open-caption {
    padding: 12px;
    min-height: 44px
}

.entrance-date {
    margin-top: 6px
}

.invitation-shell {
    background-image: url('assets/invitation-texture.webp')
}

/* Full-screen chapters preserve the original card and arch artwork. */
html {
    scroll-padding-top: 0
}

html.invitation-open {
    scroll-snap-type: y proximity
}

.invitation-shell {
    margin-block: 0
}

.page {
    min-height: 100svh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px calc(112px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin: 0;
    isolation: isolate
}

.page>.section-inner {
    width: 100%;
    padding: 0
}

.page .reveal {
    opacity: 1;
    transform: none
}

.page-content,
.page-blessings>.section-inner {
    transition: opacity .85s, transform 1s;
    opacity: .25;
    transform: translateY(16px)
}

.page.in-view .page-content,
.page-blessings.in-view>.section-inner {
    opacity: 1;
    transform: none
}

.page-blessings {
    padding-top: clamp(90px, 20svh, 160px)
}

.page-blessings .mantra {
    width: 92%;
    max-width: 420px;
    margin: 0 auto clamp(25px, 6svh, 55px)
}

.page-blessings .deity-wrap {
    width: min(40%, calc((100svh - 330px)*.79));
    max-width: 180px;
    margin: 0 auto
}

.page-blessings .deity {
    animation: none
}

.page-blessings.in-view .deity {
    animation: sacred-arrival 1.5s both
}

.page-couple .family-art {
    width: min(100%, calc((100svh - 340px)*.825));
    max-width: 390px
}

.page-couple .date-section {
    margin: 18px auto 0
}

.page-couple .scratch-card {
    height: 132px;
    max-width: 320px
}

.page-couple .micro {
    margin-bottom: 10px
}

.page-couple .text-button {
    margin-top: 4px
}

.page-flow .flow-title {
    width: 80%;
    max-width: 350px;
    margin: 0 auto 32px
}

.page-flow .section-hint {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 32px
}

.page-flow .continue-link {
    padding: 0;
    min-height: 44px
}

.page-flow .continue-link>span:first-child {
    border-bottom: 1px solid #b9965960;
    padding-bottom: 5px
}

#events {
    display: contents
}

.event.page {
    gap: 8px
}

.event.page .event-topline {
    margin: 0;
    letter-spacing: .075em;
    font-size: 14px;
    line-height: 1.6
}

.event.page .event-stage {
    width: min(100%, calc((100svh - 245px)*.670435), 440px);
    flex: none;
    transform: translateY(12px) scale(.98);
    transition: transform 1s, opacity 1s;
    opacity: .45;
    container-type: inline-size
}

.event.page.in-view .event-stage {
    opacity: 1;
    transform: none
}

.event.page .event-caption {
    margin: 0;
    font-size: 15px;
    line-height: 1.5
}

.event.page .event-tools {
    min-height: 44px;
    gap: 20px
}

.event.page .event-label h3 {
    font-size: clamp(18px, 7cqw, 32px);
    margin: 8px 0;
    line-height: 1.2;
    font-family: sans-serif;
    font-weight: 500;
}

.event.page .event-label .number {
    font-size: 12px
}

.event.page .event-label .tap-label {
    font-size: 12px;
    letter-spacing: .02em;
    padding-top: 7px
}

.event.page .event-label .seal {
    width: 28px;
    height: 28px;
    margin-top: 9px;
    font-size: 15px
}

.page-gallery {
    gap: 8px
}

.page-gallery .gallery-title {
    width: min(78%, 300px);
    margin: 0
}

.page-gallery>.micro {
    margin: 0;
    font-size: 14px
}

.page-gallery .photo-frame {
    width: min(100%, calc((100svh - 245px)*.670435), 440px);
    margin: 0 auto;
    flex: none;
    isolation: isolate;
    container-type: inline-size
}

.gallery-window {
    position: absolute;
    left: 20.65%;
    right: 20.65%;
    top: 28.3%;
    bottom: 18.6%;
    clip-path: url(#event-window);
    overflow: hidden;
    background: #39080f
}

.gallery-photo-button {
    border: 0;
    padding: 0;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #39080f;
    touch-action: pan-y;
    isolation: isolate
}

.gallery-photo-button:before {
    content: '';
    position: absolute;
    inset: -10px;
    background: var(--photo-bg) center/cover;
    filter: blur(10px) brightness(.5);
    z-index: -1
}

.gallery-photo-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity .28s, transform .5s
}

.gallery-photo-button.changing img {
    opacity: 0;
    transform: scale(1.02)
}

.gallery-cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #8b1730, #570b20 55%, #350a17);
    border: 3px double #caa765;
    transition: clip-path 1.6s cubic-bezier(.3, 0, .2, 1), opacity 1.6s;
    clip-path: inset(0 0 0 0)
}

.gallery-cover>span:first-child {
    font-style: italic;
    font-size: clamp(16px, 7cqw, 26px);
    line-height: 1.35;
    padding: 0 6px;
    font-family: sans-serif;
    font-weight: 500;
}

.gallery-tap {
    font-size: 12px;
    letter-spacing: .025em;
    border-top: 1px solid #caa76580;
    padding-top: 10px
}

.gallery-stage.open .gallery-cover {
    clip-path: inset(0 0 100% 0);
    opacity: .5
}

.photo-frame>.gallery-arch {
    z-index: 3;
    pointer-events: none
}

.gallery-trigger {
    position: absolute;
    inset: 0;
    z-index: 4;
    border: 0;
    padding: 0;
    background: none
}

.gallery-stage.open .gallery-trigger {
    pointer-events: none;
    visibility: hidden
}

.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-height: 44px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.gallery-stage.open ~ .gallery-controls {
    opacity: 1;
    pointer-events: auto;
}

.gallery-controls button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid #bd965d90;
    background: #5c0b1460;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 16px;
    line-height: 1
}

.gallery-controls button:disabled {
    opacity: .35
}

#photo-count {
    min-width: 48px;
    font-size: 14px;
    letter-spacing: .12em
}

.gallery-hint {
    margin: 0;
    font-size: 14px;
    font-style: italic;
    min-height: 21px
}

.page-rsvp .rsvp-art {
    width: min(100%, calc((100svh - 315px)*.974));
    max-width: 440px;
    margin: 0 auto;
    transform: translateY(15px) scale(.95);
    opacity: .35;
    transition: transform 1.6s cubic-bezier(.2, .6, .2, 1), opacity 1.4s
}

.page-rsvp.in-view .rsvp-art {
    transform: none;
    opacity: 1
}

.page-rsvp.in-view .rsvp-art img {
    animation: rsvp-float 6s ease-in-out 1.6s infinite
}

.page-rsvp .rsvp-note {
    font-size: 15px;
    margin: 90px 0 12px
}

.page-closing {
    width: 100%;
    padding: 0;
    background: none
}

.page-closing .closing-rule {
    margin: 4px auto 7px
}

.page-closing>p {
    font-size: 14px;
    margin: 2px 0
}

.page-closing .couple-signature {
    font-size: 25px;
    line-height: 1.3
}

.page-closing .footer-actions {
    margin: 14px auto 0;
    gap: 7px
}

.page-closing .footer-actions button,
.page-closing .footer-actions a {
    padding: 10px;
    font-size: 14px
}

.page-closing .action-status {
    min-height: 20px;
    margin-top: 5px
}

.next-page {
    position: fixed;
    right: max(12px, calc((100vw - 560px)/2 + 12px));
    bottom: calc(91px + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 54px;
    min-height: 62px;
    padding: 7px 3px;
    border: 1px solid #c7a361;
    background: linear-gradient(145deg, #931d29f5, #560711f5);
    color: #f7dfa3;
    border-radius: 28px;
    box-shadow: 0 4px 17px #2c020a70;
    transition: background .25s, transform .25s
}

.next-page:hover {
    background: #921b28;
    transform: translateY(2px)
}

.next-page:disabled {
    cursor: wait
}

.next-page svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .5s
}

.next-count {
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: .02em;
    font-variant-numeric: tabular-nums
}

.next-page.restart svg {
    transform: rotate(180deg)
}

body.modal-open .next-page {
    visibility: hidden
}

.ambient {
    z-index: 21;
    contain: strict
}

.ambient .petal {
    position: absolute;
    top: -25px;
    left: var(--x);
    width: var(--s);
    height: calc(var(--s)*1.2);
    background: none;
    box-shadow: none;
    border-radius: 0;
    opacity: 0;
    will-change: transform;
    animation: petal-fall var(--t) linear var(--d) infinite
}

.petal img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: petal-turn var(--sway) ease-in-out var(--d) infinite alternate
}

@keyframes petal-fall {
    0% {
        transform: translate3d(0, -25px, 0);
        opacity: 0
    }

    12%,
    85% {
        opacity: var(--opacity)
    }

    100% {
        transform: translate3d(var(--drift), calc(100vh + 40px), 0);
        opacity: 0
    }
}

@keyframes petal-turn {
    0% {
        transform: rotate(0deg) rotateY(15deg) translateX(-7px)
    }

    100% {
        transform: rotate(var(--turn)) rotateY(65deg) translateX(7px)
    }
}

@keyframes sacred-arrival {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.97)
    }

    to {
        opacity: 1;
        transform: none
    }
}

@keyframes rsvp-float {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-5px)
    }
}

@media(max-height:700px) {
    .page {
        padding-top: 18px;
        padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px))
    }

    .page-blessings {
        padding-top: 84px
    }

    .page-couple .family-art {
        width: min(100%, calc((100svh - 310px)*.825))
    }

    .page-couple .date-section {
        margin-top: 10px
    }

    .page-couple .scratch-card {
        height: 112px
    }

    .page-couple .micro {
        font-size: 13px;
        margin-bottom: 6px
    }

    .page-couple .date-under strong {
        font-size: 23px
    }

    .page-couple .date-under span {
        font-size: 16px
    }

    .event.page {
        gap: 5px
    }

    .event.page .event-stage {
        width: min(100%, calc((100svh - 218px)*.670435), 440px)
    }

    .event.page .event-label h3 {
        margin: 4px 0
    }

    .event.page .event-label .seal {
        display: none
    }

    .page-gallery .photo-frame {
        width: min(100%, calc((100svh - 218px)*.670435), 440px)
    }

    .page-rsvp .rsvp-art {
        width: min(100%, calc((100svh - 318px)*.974))
    }

    .page-rsvp .rsvp-note {
        margin: 70px 0 10px;
        font-size: 14px
    }

    .page-closing .footer-actions {
        margin-top: 8px
    }

    .page-closing .couple-signature {
        font-size: 22px
    }

    .page-closing .footer-actions button,
    .page-closing .footer-actions a {
        font-size: 13px;
        padding: 8px
    }

    .page-closing .closing-rule {
        margin-block: 3px
    }
}

@media(max-width:380px) {
    .page {
        padding-inline: 18px
    }

    .next-page {
        right: 10px;
        width: 48px;
        min-height: 57px
    }

    .event.page .event-label h3 {
        font-size: clamp(16px, 6cqw, 22px)
    }
    .tap-label, .gallery-tap {
        font-size: 11px !important;
        letter-spacing: 1px;
    }
    .gallery-cover span {
        font-size: 15px !important;
    }
}

/* At enlarged text sizes and short landscape heights, allow content to grow instead of clipping. */
@media(max-height:480px) {
    .page {
        min-height: 100svh;
        padding-top: 28px
    }

    .page-couple .family-art {
        width: 210px
    }

    .page-blessings .deity-wrap {
        width: 150px
    }

    .event.page .event-stage {
        width: 220px
    }

    .page-gallery .photo-frame {
        width: 220px
    }

    .page-rsvp .rsvp-art {
        width: 230px
    }

    .page-blessings {
        padding-top: 85px
    }
}

@media(prefers-reduced-motion:reduce) {
    html.invitation-open {
        scroll-snap-type: none
    }

    .page-content,
    .page-blessings>.section-inner,
    .event.page .event-stage,
    .page-rsvp .rsvp-art {
        opacity: 1;
        transform: none
    }

    .ambient {
        display: none
    }
}

.page-blessings.ornamental {
    background-size: 100% calc(100% - 80px);
    background-position: center top
}

@media(max-height:700px) {
    .page-couple .family-art {
        width: min(100%, calc((100svh - 322px)*.825))
    }

    .event.page .event-stage {
        width: min(100%, calc((100svh - 228px)*.670435), 440px)
    }

    .page-gallery .photo-frame {
        width: min(100%, calc((100svh - 228px)*.670435), 440px)
    }

    .page-rsvp .rsvp-art {
        width: min(100%, calc((100svh - 334px)*.974))
    }

    .page-closing .footer-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr))
    }

    .page-closing .footer-actions button,
    .page-closing .footer-actions a {
        font-size: 14px;
        line-height: 1.2;
        padding: 6px
    }
}

@media(max-height:480px) {
    .page-couple .family-art {
        width: 210px
    }

    .event.page .event-stage {
        width: 220px
    }

    .page-gallery .photo-frame {
        width: 220px
    }

    .page-rsvp .rsvp-art {
        width: 230px
    }
}

html.page-travel {
    scroll-snap-type: none !important;
    scroll-behavior: auto !important
}

/* Reference footer: five compact navigation items and a top-right sound control. */
.bottom-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #7c111a
}

.bottom-nav a {
    font-family: Arial, sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
    padding: 7px 1px;
    min-height: 56px;
    gap: 5px;
    color: #f4e8dc
}

.bottom-nav a.active {
    color: #ffe6a4;
    background: #e3bd7624
}

.bottom-nav svg {
    width: 22px;
    height: 22px
}

.music-toggle {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: max(14px, calc((100vw - 560px)/2 + 14px));
    width: 44px;
    height: 44px;
    border: 1px solid #c89e51;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #781d27ef;
    color: #f0d56e;
    z-index: 36;
    box-shadow: 0 3px 14px #35030a40
}

.music-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round
}

.sound-mute {
    display: none
}

.music-toggle.muted .sound-waves {
    display: none
}

.music-toggle.muted .sound-mute {
    display: block
}

.music-toggle:disabled {
    opacity: .65;
    cursor: default
}

@media(max-width:340px) {
    .bottom-nav a {
        font-size: 11px
    }
}


/* Floating Controls - Pushed up so it doesn't overlap bottom-nav and sits above next-page */
.floating-controls {
    position: fixed;
    bottom: calc(165px + env(safe-area-inset-bottom, 0px));
    right: max(12px, calc((100vw - 560px)/2 + 12px));
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.floating-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #650d16;
    border: 2px solid #ba934f;
    color: #efd67f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, background 0.3s;
    padding: 0;
}

.floating-btn:hover {
    transform: scale(1.1);
    background: #860810;
}

.scroll-btn {
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-8px);
    }

    60% {
        transform: translateY(-4px);
    }
}

/* Flower Rain Particles */
#flower-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 90;
    overflow: hidden;
}

.petal-custom {
    position: absolute;
    top: -30px;
    width: 12px;
    height: 12px;
    background: rgba(255, 230, 240, 0.7);
    border-radius: 15px 0 15px 0;
    animation: petal-fall-custom linear infinite, petal-spin-custom linear infinite;
    opacity: 0.65;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
    transform-origin: center;
}

@keyframes petal-fall-custom {
    0% {
        top: -30px;
        transform: translateX(0);
    }

    100% {
        top: 110vh;
        transform: translateX(60px);
    }
}

@keyframes petal-spin-custom {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile adjustments for Blessings page */
@media (max-width: 600px) {
    .page-blessings {
        padding-top: 70px !important;
    }
    .page-blessings .deity-wrap {
        width: 65% !important;
        max-width: 220px !important;
    }
    .page-couple .family-art {
        width: 80% !important;
    }
    .page-couple .scratch-card {
        height: 105px !important;
        width: 78% !important;
    }
    .footer-actions button, .footer-actions a {
        width: fit-content !important;
        padding-inline: 36px !important;
    }
    .page-rsvp .rsvp-art {
        width: 85% !important;
    }
    .page-rsvp .rsvp-note {
        font-size: 13px !important;
    }
    .event.page .event-stage {
        width: 80% !important;
    }
    .page-gallery .photo-frame {
        width: 80% !important;
    }
}

.floating-controls {
    position: fixed;
    right: 20px;
    bottom: 110px;
    z-index: 40;
}
.floating-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid #c7a361;
    background: linear-gradient(145deg, #931d29f5, #560711f5);
    color: #f7dfa3;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 17px #2c020a70;
    transition: transform 0.3s;
}
.floating-btn:hover {
    transform: scale(1.05);
}

/* Phone screens (up to 430px) - Fit content within first background tile */
@media (max-width: 430px) {
    .entrance {
        align-items: flex-start !important;
        padding-top: 25px !important;
        padding-bottom: 20px !important;
    }
    .ganesh {
        width: 75px !important;
        margin-top: 0 !important;
        margin-bottom: 12px !important;
    }
    .main-gate {
        width: clamp(220px, 68vw, 300px) !important;
        margin-top: 10px !important;
        margin-bottom: 0 !important;
    }
    .open-caption {
        padding: 5px !important;
        margin-top: 0px !important;
    }
    .entrance-date {
        margin-top: 2px !important;
    }
    .page-closing .footer-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .page-closing .footer-actions button,
    .page-closing .footer-actions a {
        flex: 1 1 40%;
        padding: 10px 5px !important;
        font-size: 13px !important;
        text-align: center;
    }
    .floating-controls {
        position: fixed;
        right: 10px;
        bottom: 160px;
        z-index: 40;
    }
    .floating-btn {
        width: 54px;
        height: 54px;
        border-radius: 50%;
        border: 1px solid #c7a361;
        background: linear-gradient(145deg, #931d29f5, #560711f5);
        color: #f7dfa3;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 17px #2c020a70;
    }
}

/* Very small phones (up to 330px) */
@media (max-width: 330px) {
    .entrance {
        align-items: flex-start !important;
        padding-top: 15px !important;
    }
    .ganesh {
        width: 60px !important;
        margin-bottom: 10px !important;
    }
    .main-gate {
        width: clamp(190px, 65vw, 240px) !important;
    }
    .invited-title {
        width: 75% !important;
    }
}