
/* ==================== css/fonts.css ==================== */
/* ==================== SELF-HOSTED FONTS ==================== */

/* Great Vibes */
@font-face {
    font-family: 'Great Vibes';
    src: url('../fonts/great-vibes.ttf?v=9d76b8c6') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Playfair Display */
@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/playfair-display-regular.ttf?v=1609a54f') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/playfair-display-600.ttf?v=8ab6a1db') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/playfair-display-700.ttf?v=adefc53e') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Lato */
@font-face {
    font-family: 'Lato';
    src: url('../fonts/lato-300.ttf?v=28c43991') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('../fonts/lato-regular.ttf?v=f43f1c77') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('../fonts/lato-700.ttf?v=02e8f4be') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Battambang (Khmer) */
@font-face {
    font-family: 'Battambang';
    src: url('../fonts/battambang-100.ttf?v=8c1578f0') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Battambang';
    src: url('../fonts/battambang-300.ttf?v=604fe95d') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Battambang';
    src: url('../fonts/battambang-regular.ttf?v=6614d24e') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Battambang';
    src: url('../fonts/battambang-700.ttf?v=19c366fd') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Battambang';
    src: url('../fonts/battambang-900.ttf?v=73ccfd07') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Khmer OS Muol */
@font-face {
    font-family: 'Khmer OS Muol';
    src: url('../fonts/KhmerOS_muolpali.ttf?v=5ed07a0b') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


/* Khmer OS Muol Pali*/
@font-face {
    font-family: 'Khmer OS Muol Pali';
    src: url('../fonts/KhmerOS_muolpali.ttf?v=5ed07a0b') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


@font-face {
    font-family: 'Khmer OS MuolMoul';
    src: url('../fonts/KhmerOS_muol.ttf?v=546ee4ae') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


/* ==================== css/base.css ==================== */
/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Lato', sans-serif;
    color: #3a3a3a;
    background: #0a0a0a;
    height: 100%;
}

/* ==================== SLIDESHOW CONTAINER ==================== */
.slideshow {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.slideshow::-webkit-scrollbar { display: none; }

.slide {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

/* Slide content animation on scroll */
.slide .cover-content,
.slide .details-content,
.slide .story-content,
.slide .gallery-content,
.slide .rsvp-content,
.slide .thankyou-content {
    opacity: 0;
    transform: scale(0.92) translateY(30px);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide.active .cover-content,
.slide.active .details-content,
.slide.active .story-content,
.slide.active .gallery-content,
.slide.active .rsvp-content,
.slide.active .thankyou-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ==================== COMMON STYLES ==================== */
.section-title {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(28px, 6vw, 50px);
    color: #d4af37;
    margin-bottom: 12px;
}

.section-subtitle {
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    font-size: clamp(9px, 1.5vw, 13px);
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: clamp(15px, 3vh, 35px);
}

/* ==================== SHARED CARD TYPOGRAPHY ==================== */
.card-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(22px, 4vw, 32px);
    color: #d4af37;
    margin-bottom: 15px;
}

.card-date {
    font-family: 'Playfair Display', serif;
    font-size: clamp(16px, 2.5vw, 22px);
    color: #3a3a3a;
    margin-bottom: 8px;
}

.card-time {
    font-family: 'Playfair Display', serif;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 10px;
}

.card-venue {
    font-family: 'Playfair Display', serif;
    font-size: clamp(14px, 2vw, 20px);
    color: #3a3a3a;
    margin-bottom: 5px;
}

.card-address {
    font-family: 'Lato', sans-serif;
    font-size: clamp(11px, 1.5vw, 14px);
    color: #888;
    line-height: 1.5;
}

.card-parent-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(14px, 2vw, 18px);
    color: #555;
    line-height: 1.8;
    font-style: italic;
}

.card-icon {
    font-size: clamp(30px, 4vw, 50px);
    margin-bottom: 10px;
}

.year {
    font-family: 'Playfair Display', serif;
    font-size: clamp(14px, 2vw, 18px);
    color: #d4af37;
    font-weight: 700;
}

.event {
    font-family: 'Playfair Display', serif;
    font-size: clamp(14px, 2vw, 18px);
    color: #3a3a3a;
    margin-bottom: 5px;
}

.description {
    font-family: 'Lato', sans-serif;
    font-size: clamp(12px, 1.5vw, 14px);
    color: #888;
    line-height: 1.6;
}

/* Khmer font overrides for shared classes */
body.km-active .card-title,
body.km-active .card-date,
body.km-active .card-time,
body.km-active .card-venue,
body.km-active .card-address,
body.km-active .card-parent-name,
body.km-active .year,
body.km-active .event,
body.km-active .description {
    font-family: 'Battambang', sans-serif;
}

body.km-active .section-title {
    font-family: 'Battambang', sans-serif;
}

body.km-active .section-subtitle {
    font-family: 'Battambang', sans-serif;
}

/* ==================== LANGUAGE LINKS ==================== */
.lang-links {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.lang-link {
    color: rgba(212, 175, 55, 0.7);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 5px 8px;
    transition: all 0.3s ease;
}

.lang-link:hover { color: #d4af37; }
.lang-link.active { color: #d4af37; border-bottom: 2px solid #d4af37; }
.lang-separator { color: rgba(212, 175, 55, 0.4); font-size: 12px; }
body.km-active { font-family: 'Battambang', sans-serif !important; }



/* ==================== css/modal.css ==================== */
/* ==================== INVITATION MODAL ==================== */
.modal-envelope {
    width: min(245px, 62vw);
    aspect-ratio: 1;
    height: auto;
    margin: 0 auto 8px;
    background: url('../images/couple_logo_gold.webp') center / auto 100% no-repeat;
    filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.48));
}

.modal-envelope svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.4));
    display: none;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(100, 40, 50, 0.92) 0%, rgba(30, 10, 15, 0.97) 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay.hidden { display: none; }

.modal-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay.closing .modal-content {
    transform: scale(0.96) translateY(-12px);
    opacity: 0;
}

.modal-content {
    position: relative;
    max-width: 410px;
    width: 90%;
    padding: 70px 50px;
    background: linear-gradient(180deg, #2a1520 0%, #3a1828 30%, #2a1520 70%, #1a0a10 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 80px rgba(232, 196, 196, 0.15), 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.8s ease;
    opacity: 0;
}

.modal-content::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(212, 175, 55, 0.48);
    border-radius: 14px;
    pointer-events: none;
}

.modal-overlay.visible .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.modal-title { font-family: 'Great Vibes', cursive; font-size: 40px; color: rgba(255, 255, 255, 0.6); margin-bottom: 5px; white-space: nowrap; }
body.from-og .modal-title { font-size: clamp(28px, 7vw, 34px) !important; }
.modal-dear { font-family: 'Playfair Display', serif; font-size: 18px; color: rgba(255, 255, 255, 0.7); margin-bottom: 8px; }
.guest-name { font-family: 'Great Vibes', cursive; color: #d4af37; font-size: 28px; }
.modal-message { font-family: 'Playfair Display', serif; font-size: 18px; color: rgba(255, 255, 255, 0.6); line-height: 1.9; margin-bottom: 20px; font-style: italic; }
.modal-couple { font-family: 'Great Vibes', cursive; font-size: 42px; color: #d4af37; margin-bottom: 8px; line-height: 1; }
.modal-heart { display: inline-block; margin: 0 .12em; color: rgba(255, 255, 255, 0.58); font-family: Georgia, serif; font-size: .62em; font-weight: 400; vertical-align: .1em; }
.modal-connector { display: inline-block; width: 42px; height: 32px; margin: 0; background: url('../images/couple_1_small.png') center / 100% auto no-repeat; vertical-align: text-top; opacity: .6; filter: brightness(0) invert(1); }
.modal-connector svg { display: none; }
.modal-date { font-family: 'Lato', sans-serif; font-size: 17px; letter-spacing: 4px; text-transform: uppercase; color: #d4af37; margin-bottom: 35px; text-shadow: 0 0 20px rgba(212, 175, 55, 0.3); font-weight: 700; }

.modal-close-btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-width: 155px;
    padding: 11px 18px;
    background: linear-gradient(120deg, #9c7119 0%, #e7c451 28%, #fff0a8 50%, #d4af37 72%, #8f6515 100%);
    background-size: 220% 100%;
    border: 1px solid rgba(255, 240, 168, 0.8);
    border-radius: 50px;
    color: #28131d;
    font-family: 'Playfair Display', serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 22px rgba(212, 175, 55, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-position 0.6s ease;
}

.modal-close-btn::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.6) 50%, transparent 65%);
    transform: translateX(-130%);
    transition: transform 0.65s ease;
}

.modal-close-btn:hover {
    background-position: 100% center;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42), 0 0 30px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.modal-close-btn:hover::after { transform: translateX(130%); }
.modal-close-btn:active { transform: translateY(0) scale(0.98); }

.modal-close-btn:focus-visible {
    outline: 2px solid #fff0a8;
    outline-offset: 4px;
}

/* Khmer font overrides */
body.km-active .modal-title {
    font-family: 'Khmer OS Muol Pali', sans-serif;
}
body.km-active .modal-dear {
    font-family: 'Battambang', sans-serif;
}
body.km-active .guest-name {
    font-family: 'Khmer OS MuolMoul', sans-serif;
}
/* Default guest (no hash) uses Battambang like .modal-message */
body.km-active .guest-name[data-default="true"] {
    font-family: 'Battambang', sans-serif;
}
body.km-active .modal-message {
    font-family: 'Battambang', sans-serif;
}
body.km-active .modal-couple {
    font-family: 'Khmer OS Muol Pali', sans-serif;
}
body.km-active .modal-heart {
    font-size: .82em;
    vertical-align: .05em;
}
body.km-active .modal-connector {
    margin: 0;
}
body.km-active .modal-date {
    font-family: 'Battambang', sans-serif;
    letter-spacing: 1px;
    text-transform: none;
    font-size: 16px;
    color: #d4af37 !important;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    font-weight: 700;
}
body.km-active .modal-close-btn {
    font-family: 'Battambang', sans-serif;
    letter-spacing: 0;
    text-transform: none;
    padding: 11px 18px;
    font-size: 12px;
}

/* ==================== PARTY INVITATION GLASS MODAL ==================== */
.party-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    background: rgba(66, 31, 43, 0.28);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    pointer-events: none;
    overflow: hidden;
}

.party-notification.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.party-notification.hidden {
    opacity: 0;
    visibility: hidden;
}

.party-notification-frame {
    width: min(480px, 100%);
    max-height: calc(100dvh - 36px);
    position: relative;
    transform: translateY(24px) scale(0.94);
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.party-notification-content {
    width: 100%;
    max-height: inherit;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 26px 34px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 224, 214, 0.48);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(255, 239, 235, 0.88), rgba(241, 192, 199, 0.76));
    -webkit-backdrop-filter: blur(18px) saturate(118%);
    backdrop-filter: blur(18px) saturate(118%);
    box-shadow:
        0 24px 60px rgba(84, 40, 54, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.party-corner-floral {
    position: absolute;
    z-index: 3;
    width: 134px;
    height: auto;
    pointer-events: none;
    opacity: 0.84;
    filter: drop-shadow(0 8px 12px rgba(91, 49, 57, 0.14));
}

.party-corner-floral--top {
    top: -24px;
    left: -24px;
    animation: party-corner-float-top 4.2s ease-in-out infinite;
}

.party-corner-floral--bottom {
    right: -24px;
    bottom: -24px;
    animation: party-corner-float-bottom 4.6s ease-in-out infinite;
}

.party-notification.show .party-notification-frame {
    transform: translateY(0) scale(1);
}

@keyframes party-corner-float-top {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(-1deg); }
}

@keyframes party-corner-float-bottom {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(1deg); }
}

.party-couple-art {
    width: clamp(74px, 20vw, 102px);
    height: auto;
    max-height: 104px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(91, 49, 57, 0.16));
}

.party-notification-text {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.party-invite-title {
    font-family: 'Great Vibes', cursive !important;
    font-size: clamp(30px, 7vw, 38px) !important;
    line-height: 1.18;
    color: #b88b2b !important;
    margin: 0 !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.52);
}

.party-title-divider {
    width: 82px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.party-invite-body {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    color: #684552;
    margin: 0;
    max-width: 380px;
    line-height: 1.62;
}

.party-guest-name {
    display: inline-block;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.45;
}

.party-body-details {
    display: grid;
    gap: 3px;
    margin-top: 10px;
    color: #684552;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}
.party-body-detail { display: block; }

.party-location-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 142px;
    min-height: 38px;
    padding: 9px 18px;
    border: 1px solid rgba(184, 139, 43, 0.62);
    border-radius: 999px;
    color: #764654;
    background: rgba(255, 248, 244, 0.68);
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.45px;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.party-location-link:hover,
.party-location-link:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 252, 249, 0.92);
    box-shadow: 0 7px 18px rgba(99, 55, 66, 0.14);
    outline: none;
}

.party-notification-close {
    position: static;
    z-index: 3;
    width: 34px;
    height: 34px;
    margin-top: 2px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.48);
    background: rgba(255, 247, 243, 0.55);
    color: #8b5967;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.party-notification-close:hover,
.party-notification-close:focus-visible {
    transform: scale(1.06);
    background: rgba(255, 252, 249, 0.88);
    outline: none;
}

body.km-active .party-invite-title {
    font-family: 'Battambang', sans-serif !important;
    font-size: clamp(25px, 6vw, 32px) !important;
}
body.km-active .party-invite-body,
body.km-active .party-body-details,
body.km-active .party-location-link {
    font-family: 'Battambang', sans-serif;
}

@media (max-width: 480px) {
    .party-notification { padding-inline: 12px; }
    .party-notification-frame { max-height: calc(100dvh - 24px); }
    .party-notification-content {
        padding: 20px 20px 22px;
        border-radius: 22px;
        gap: 5px;
    }
    .party-corner-floral { width: 96px; opacity: 0.78; }
    .party-corner-floral--top { top: -8px; left: -8px; }
    .party-corner-floral--bottom { right: -8px; bottom: -8px; }
    .party-couple-art { width: 72px; max-height: 76px; }
    .party-notification-text { gap: 7px; }
    .party-invite-title { font-size: clamp(27px, 8vw, 33px) !important; }
    .party-invite-body { font-size: 13px; line-height: 1.5; }
    .party-guest-name { font-size: 15px; }
    .party-body-details { margin-top: 7px; }
    .party-location-link { min-height: 34px; padding: 7px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .party-notification,
    .party-notification-frame { transition: none; }
    .party-corner-floral { animation: none; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .modal-title {
        font-size: 32px !important;
    }
    body.from-og .modal-title {
        font-size: clamp(24px, 7vw, 30px) !important;
    }
    .modal-content {
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }
    .modal-close-btn { min-width: 145px; padding: 10px 16px; font-size: 11px; letter-spacing: .75px; }
    body.km-active .modal-close-btn { padding: 10px 16px; font-size: 11px; letter-spacing: 0; }
    .modal-envelope { width: min(165px, 48vw); }
}



/* ==================== css/navigation.css ==================== */
/* ==================== NAVIGATION DOTS ==================== */
.nav-dots {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #d4af37;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-dots .dot.active {
    background: #d4af37;
    transform: scale(1.3);
}

.nav-dots .dot:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* ==================== ARROW NAVIGATION ==================== */
.arrow-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: #d4af37;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.arrow-nav:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
}

.arrow-up { top: 20px; }
.arrow-down { bottom: 20px; }
.arrow-nav.hidden { opacity: 0; pointer-events: none; }


/* ==================== css/cover.css ==================== */
/* ==================== SLIDE 1: COVER ==================== */
.slide-cover {
    background: linear-gradient(rgba(255, 248, 238, 0.12), rgba(255, 248, 238, 0.08));
    background-size: cover;
    background-position: var(--cover-position-desktop, 55% 50%);
    background-repeat: no-repeat;
    position: relative;
}

.slide-cover::before { display: none; }

.cover-content {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: min(410px, calc(100% - 48px));
    padding: clamp(30px, 4.5vw, 46px) clamp(26px, 4.5vw, 48px) clamp(26px, 3.5vw, 38px);
    border: 1px solid rgba(255, 224, 214, 0.34);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(150, 70, 92, 0.3), rgba(232, 160, 174, 0.18));
    box-shadow: 0 24px 60px rgba(25, 7, 13, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(3px) saturate(1.05);
    backdrop-filter: blur(3px) saturate(1.05);
    text-align: center;
    flex-shrink: 0;
}

.cover-content::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 224, 214, 0.34);
    border-radius: 14px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.28), inset 0 0 14px rgba(255, 255, 255, 0.14);
    pointer-events: none;
    z-index: 3;
}

.cover-content .pre-text {
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    font-size: clamp(12px, 2vw, 22px);
    letter-spacing: 8px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 2px 9px rgba(20, 4, 10, 0.75);
    white-space: nowrap;
}

.cover-content h1 {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(44px, 10vw, 80px);
    color: #c9796f;
    background: linear-gradient(120deg, #8f443f 0%, #d98b7d 28%, #ffe0d6 50%, #c56f64 72%, #873d39 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    overflow: visible;
    line-height: 1.35;
    margin: 8px 0 14px;
    padding: .28em .08em .12em;
    filter: drop-shadow(1px 2px 6px rgba(42, 12, 20, 0.58));
}

.cover-content h1 span { color: #c9796f; }

.cover-content .ampersand {
    display: block;
    width: 55px;
    height: 42px;
    margin: 6px auto;
    font-size: 0;
    background: url('../images/couple_1_small.png') center / contain no-repeat;
    opacity: .6;
    filter: brightness(0) invert(1);
}

body.km-active .cover-content .ampersand {
    font-family: 'Battambang', sans-serif;
    font-size: clamp(18px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    margin: 10px auto 18px;
    width: auto;
    height: auto;
    background: none;
    filter: none;
    font-size: clamp(18px, 3vw, 30px);
}
html.km-preload .cover-content .ampersand {
    width: auto;
    height: auto;
    background: none;
    filter: none;
    font-size: clamp(18px, 3vw, 30px);
    font-family: 'Battambang', sans-serif;
    color: #fff;
}

.cover-content .wedding-date {
    font-family: 'Playfair Display', serif;
    font-size: clamp(16px, 2.5vw, 28px);
    font-weight: 700;
    color: #fff0df;
    -webkit-text-fill-color: #fff0df;
    letter-spacing: clamp(3px, 0.8vw, 10px);
    margin-top: clamp(8px, 1.5vh, 16px);
    padding-top: 0;
    border-top: 0;
    text-shadow: none;
    filter: drop-shadow(0 2px 5px rgba(101, 45, 62, 0.5));
    animation: none;
}

.cover-content .wedding-date::before {
    content: '';
    display: block;
    width: clamp(105px, 16vw, 135px);
    height: clamp(30px, 4.5vw, 40px);
    margin: 0 auto 6px;
    background: url('../images/devide_flower.webp') center / contain no-repeat;
    opacity: .9;
    filter: drop-shadow(0 3px 6px rgba(81, 34, 47, 0.16));
}

@keyframes dateShine {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

body.km-active .cover-content .wedding-date {
    font-family: 'Battambang', sans-serif;
    max-width: 430px;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(13px, 1.6vw, 18px);
    font-weight: 600;
    line-height: 1.7;
    letter-spacing: .2px;
}

body.km-active .cover-content .pre-text {
    font-family: 'Khmer OS Muol Pali', 'Battambang', sans-serif;
    letter-spacing: 1px;
    line-height: 1.3;
    margin-bottom: 10px;
}

body.km-active .cover-content h1 {
    font-family: 'Khmer OS Muol Pali', sans-serif;
    line-height: 1.5;
    padding-top: .32em;
}

/* Decorative floral corners */
.floral-corner {
    position: absolute;
    width: 200px;
    height: 200px;
    opacity: 0.15;
}

.floral-corner svg { width: 100%; height: 100%; }
.floral-top-left { top: 20px; left: 20px; }
.floral-top-right { top: 20px; right: 20px; transform: scaleX(-1); }
.floral-bottom-left { bottom: 20px; left: 20px; transform: scaleY(-1); }
.floral-bottom-right { bottom: 20px; right: 20px; transform: scale(-1, -1); }

/* ==================== COUPLE LOGO ==================== */
.couple-logo {
    display: block;
    margin: -30px auto 16px;
    position: relative;
    width: clamp(175px, 20vw, 230px);
    aspect-ratio: 1;
    height: auto;
    background: none;
    filter: drop-shadow(0 8px 18px rgba(69, 30, 38, 0.3));
}

/* Keep the full card inside shorter desktop browser viewports. */
@media (min-width: 769px) and (max-height: 850px) {
    .cover-content {
        width: min(370px, calc(100% - 48px));
        padding-top: 28px;
        padding-bottom: 24px;
    }

    .couple-logo {
        width: 180px;
        margin: -22px auto 10px;
    }

    .cover-content .pre-text {
        margin-bottom: 10px;
        font-size: clamp(14px, 2.7dvh, 18px);
        letter-spacing: clamp(3px, .4vw, 5px);
    }
    .cover-content h1 { font-size: 60px; margin: 3px 0 7px; }
    .cover-content .ampersand { width: 44px; height: 32px; margin: 2px auto; }
    .cover-content .wedding-date { margin-top: 3px; }
    .cover-content .wedding-date::before { height: 26px; margin-bottom: 3px; }

    body.km-active .cover-content h1 {
        font-size: 48px;
        line-height: 1.35;
        padding-top: .22em;
    }

    .cover-content .wedding-date {
        white-space: nowrap;
        font-size: clamp(15px, 2.2vw, 19px);
        letter-spacing: clamp(1.5px, .35vw, 4px);
    }

    body.km-active .couple-logo { width: 165px; }
    body.km-active .cover-content .pre-text {
        margin-bottom: 5px;
        letter-spacing: 1px;
        font-size: 15px;
    }
    body.km-active .cover-content h1 { margin-top: 0; margin-bottom: 2px; }
    body.km-active .cover-content .ampersand {
        margin: 1px auto 4px;
        font-size: 21px;
        line-height: 1.25;
    }
    body.km-active .cover-content .wedding-date {
        white-space: normal;
        font-size: clamp(12px, 1.7vw, 15px);
        line-height: 1.45;
        margin-top: 1px;
        padding: 0 8px 4px;
    }
}

.couple-logo::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: clamp(170px, 28vw, 280px);
    height: clamp(210px, 34vw, 340px);
    display: none;
}

.couple-logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/couple_logo_rosegold.webp') center / contain no-repeat;
    filter: drop-shadow(0 2px 10px rgba(151, 68, 78, 0.3));
    z-index: 2;
    pointer-events: none;
}


@media (max-width: 768px) {
    .slide-cover { background-position: var(--cover-position-mobile, 58% 50%); }
    .cover-content {
        width: min(470px, calc(100% - 32px));
        padding: 24px 18px 22px;
        border-radius: 22px;
        -webkit-backdrop-filter: blur(2px) saturate(1.04);
        backdrop-filter: blur(2px) saturate(1.04);
    }
}

@media (max-width: 480px) and (max-height: 650px) {
    .cover-content { padding: 16px 16px 14px; border-radius: 18px; }
    .couple-logo { margin: -12px auto 10px !important; }
    .floral-corner { width: 90px; height: 90px; }
    body.km-active .cover-content h1 { font-size: 33px; line-height: 1.3; }
}



/* ==================== css/story.css ==================== */
/* ==================== SLIDE 2: OUR STORY ==================== */
.slide-story {
    background: linear-gradient(135deg, #e8c4c4 0%, #f5e1e1 50%, #e8c4c4 100%);
    padding: clamp(10px, 2vh, 30px) clamp(10px, 2vw, 20px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.story-content {
    max-width: 1000px;
    width: 95%;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 0;
    border: 1px solid rgba(255, 224, 214, 0.34);
    border-radius: 28px;
    background: transparent;
    box-shadow: 0 24px 60px rgba(25, 7, 13, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    -webkit-backdrop-filter: blur(3px) saturate(1.05);
    backdrop-filter: blur(3px) saturate(1.05);
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.story-content::before,
.story-content::after {
    content: '';
    position: absolute;
    z-index: 5;
    pointer-events: none;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 8px 14px rgba(76, 31, 44, 0.22));
}

.story-content::before {
    top: 0;
    left: 0;
    width: clamp(95px, 9vw, 145px);
    aspect-ratio: 1;
    background-image: url('../images/left-top-corner.webp');
    transform: translate(-28%, -28%);
}

.story-content::after {
    right: 0;
    bottom: 0;
    width: clamp(90px, 8.5vw, 140px);
    aspect-ratio: 2 / 3;
    background-image: url('../images/right-bottom-corner.webp');
    transform: translate(18%, 18%);
}

.timeline {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 0;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    background: transparent;
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: none;

    /* Hidden state - before slide becomes active */
    opacity: 0;
    transform: scale(0.9) translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Active state - when .slide-story has .active class */
.slide-story.active .timeline {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.timeline-item {
    text-align: center;
    padding: clamp(10px, 1.5vh, 30px) clamp(8px, 2vw, 20px);
    background: transparent;
    position: relative;

    /* Hidden state for items */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Staggered reveal when slide becomes active */
.slide-story.active .timeline .timeline-item.item-1 { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
.slide-story.active .timeline .timeline-item.item-2 { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.slide-story.active .timeline .timeline-item.item-3 { opacity: 1; transform: translateY(0); transition-delay: 0.45s; }
.slide-story.active .timeline .timeline-item.item-4 { opacity: 1; transform: translateY(0); transition-delay: 0.6s; }
.slide-story.active .timeline .timeline-item.item-5 { opacity: 1; transform: translateY(0); transition-delay: 0.75s; }
.slide-story.active .timeline .timeline-item.item-6 { opacity: 1; transform: translateY(0); transition-delay: 0.9s; }
.slide-story.active .timeline .timeline-item.item-7 { opacity: 1; transform: translateY(0); transition-delay: 1.05s; }

.ceremony-block { grid-column: 1 / -1; }
.details-block { grid-column: 1 / -1; }
.venue-block { grid-column: 1 / -1; }

/* Couple block - groom and bride names (below details) */
.couple-block {
    padding-bottom: 0;
    padding-top: 0;
    font-family: 'Battambang', sans-serif;
}
.couple-block .card-title {
    font-family: 'Khmer OS Muol', 'Battambang', serif;
    font-size: clamp(18px, 3vw, 26px);
    margin-bottom: 10px;
}
.couple-block .card-parent-name {
    font-family: 'Khmer OS Muol', 'Battambang', serif;
    font-size: clamp(14px, 2vw, 18px);
}

/* Card content styles - story-specific overrides (base.css has shared defaults) */
.slide-story .card-title {
    font-family: 'Great Vibes', cursive;
}

.slide-story .card-parent-name,
.slide-story .card-date,
.slide-story .card-venue,
.slide-story .card-address,
.slide-story .card-text {
    color: #5f3945;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.32);
}

.slide-story .card-title,
.slide-story .card-invite,
.slide-story .card-time {
    color: #c69b2d;
    text-shadow: 0 1px 0 rgba(255, 248, 220, 0.38);
}

.timeline-item { z-index: 2; }
.timeline::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 224, 214, 0.34);
    border-radius: 14px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.28), inset 0 0 14px rgba(255, 255, 255, 0.14);
    pointer-events: none;
    z-index: 3;
}

.slide-story .story-map-link {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: clamp(16px, 3vh, 32px);
    display: inline-flex;
    padding: 9px 18px;
    border: 1px solid rgba(212,175,55,.7);
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    color: #9a741b;
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .25px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 5px 16px rgba(130,80,70,.16);
    transform: translateX(-50%);
}
.story-map-link:hover { transform: translateX(-50%) translateY(-2px); background: #fff; }

body.km-active .slide-story .story-map-link {
    font-family: 'Battambang', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0;
    padding-top: 8px;
    padding-bottom: 8px;
}
.slide-story .card-parent-name {
    font-weight: 700;
}

.ceremony-block {
    padding-bottom: 0;
    padding-top: clamp(15px, 2.5vh, 35px);
    font-family: 'Battambang', sans-serif;
}
.ceremony-block .card-title {
    font-family: 'Khmer OS Muol', 'Battambang', serif;
    font-size: clamp(20px, 4vw, 36px);
}
.ceremony-block .card-date,
.ceremony-block .card-time,
.ceremony-block .card-venue,
.ceremony-block .card-address {
    font-family: 'Battambang', sans-serif;
}
.ceremony-block .card-parent-name {
    font-family: 'Khmer OS Muol', 'Battambang', serif;
}

.parents-block {
    padding-bottom: 0;
    padding-top: 0;
    font-family: 'Battambang', sans-serif;
}
.parents-block .card-title {
    font-family: 'Khmer OS Muol', 'Battambang', serif;
    font-size: clamp(18px, 3vw, 26px);
    margin-bottom: 10px;
}
.parents-block .card-parent-name {
    font-family: 'Khmer OS Muol', 'Battambang', serif;
}
.parents-block .card-date,
.parents-block .card-time,
.parents-block .card-venue,
.parents-block .card-address {
    font-family: 'Battambang', sans-serif;
}

/* 4th milestone - details block (date + text only) */
.details-block {
    padding: 0 clamp(12px, 3vw, 30px);
}
.details-block .card-date {
    font-family: 'Battambang', sans-serif;
    font-size: clamp(14px, 2.5vw, 22px);
    margin-bottom: clamp(4px, 0.5vh, 10px);
}
.card-invite {
    font-family: 'Great Vibes', cursive;
    font-size: clamp(24px, 4vw, 38px);
    color: #d4af37;
    margin-bottom: clamp(6px, 1vh, 12px);
}
body.km-active .card-invite {
    font-family: 'Khmer OS Moul', 'Battambang', sans-serif;
    font-size: clamp(19px, 3vw, 30px);
}
.details-block .card-text {
    font-family: 'Battambang', sans-serif;
    font-size: clamp(11px, 1.5vw, 20px);
}

/* 7th - date/time + venue, full width, bottom padding */
.venue-block {
    padding: clamp(8px, 1.5vh, 20px) clamp(12px, 3vw, 30px) clamp(15px, 2.5vh, 40px);
}
.venue-block .card-time {
    font-family: 'Battambang', sans-serif;
    font-size: clamp(11px, 1.5vw, 16px);
    margin-bottom: clamp(4px, 0.5vh, 10px);
}
.venue-block .card-venue {
    font-family: 'Battambang', sans-serif;
    font-size: clamp(11px, 1.5vw, 16px);
    margin-bottom: clamp(3px, 0.4vh, 6px);
}
.venue-block .card-address {
    font-family: 'Battambang', sans-serif;
    font-size: clamp(9px, 1.2vw, 14px);
    margin-bottom: 0;
}

/* Google Maps inline link next to venue */
.map-link {
    display: inline;
    padding: 0;
    margin-left: 6px;
    background: none;
    color: #d4af37;
    text-decoration: none;
    border-radius: 0;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    box-shadow: none;
}
.map-link:hover {
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

/* Khmer mode - override base.css km-active rules for story slide */
body.km-active .ceremony-block .card-title,
body.km-active .couple-block .card-title,
body.km-active .parents-block .card-title,
body.km-active .ceremony-block .card-parent-name,
body.km-active .couple-block .card-parent-name,
body.km-active .parents-block .card-parent-name {
    font-family: 'Khmer OS Muol', 'Battambang', serif !important;
}



/* ==================== css/details.css ==================== */
/* ==================== SLIDE 3: EVENT DETAILS ==================== */
.slide-details {
    background: linear-gradient(135deg, #e8c4c4 0%, #f5e1e1 50%, #e8c4c4 100%);
    padding: clamp(10px, 2vh, 30px) clamp(15px, 3vw, 40px);
    overflow: hidden;
}

.details-content { max-width: 95vw; max-width: 1000px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.details-content .section-title { font-family: 'Great Vibes', cursive; font-size: clamp(38px, 6vw, 58px); color: #d4af37; position: relative; display: inline-block; }
.details-content .section-title::after {
    display: block;
    font-size: 14px;
    color: #d4af37;
    margin-top: 5px;
    letter-spacing: 15px;
    text-align: center;
}
.details-content .section-subtitle { color: rgba(0,0,0,0.4); }

body.km-active .details-content .section-title {
    font-family: 'Khmer OS Muol Pali', 'Battambang', sans-serif;
    font-size: clamp(22px, 3.6vw, 35px);
    line-height: 1.35;
    max-width: calc(100vw - 32px);
    padding: 0 8px;
    overflow-wrap: anywhere;
}

.details-grid {
    display: flex;
    justify-content: center;
    gap: clamp(12px, 2.5vw, 40px);
    flex-wrap: wrap;
    margin-top: clamp(8px, 1.5vh, 20px);
}

.detail-card-shell {
    position: relative;
    flex: 1;
    min-width: 280px;
    max-width: 500px;
    width: 100%;
    display: flex;
}

.detail-card {
    flex: 1;
    min-width: 280px;
    max-width: 500px;
    width: 100%;
    padding: clamp(15px, 2.5vh, 35px) clamp(12px, 2vw, 25px);
    border: 1px solid rgba(255, 224, 214, 0.34);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.07);
    transition: all 0.4s ease;
    box-shadow: 0 12px 30px rgba(83, 38, 49, 0.14), inset 0 1px 0 rgba(255,255,255,0.2);
    -webkit-backdrop-filter: blur(3px) saturate(1.05);
    backdrop-filter: blur(3px) saturate(1.05);
    position: relative;
    overflow: hidden;
}

.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.detail-card-shell .detail-card {
    min-width: 0;
    max-width: none;
    height: 100%;
}

.detail-corner {
    position: absolute;
    z-index: 5;
    display: block;
    width: clamp(110px, 12vw, 170px);
    aspect-ratio: 1;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    filter: drop-shadow(0 6px 10px rgba(83, 38, 49, 0.16));
}

.detail-corner-top-left {
    top: -20px;
    left: -46px;
    background-image: url('../images/coern-1.webp');
}

.detail-corner-bottom-right {
    right: -46px;
    bottom: -18px;
    background-image: url('../images/coern-3.webp');
}

.detail-card::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 224, 214, 0.34);
    border-radius: 14px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.22), inset 0 0 14px rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 3;
}

.detail-card:hover {
    border-color: rgba(255, 224, 214, 0.58);
    background: rgba(255, 255, 255, 0.11);
    transform: translateY(-8px);
    box-shadow: 0 16px 36px rgba(83, 38, 49, 0.17), inset 0 1px 0 rgba(255,255,255,0.24);
}

.detail-card:hover::before {
    opacity: 1;
}

.detail-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(22px, 4vw, 28px);
    color: #c69b2d;
    text-shadow: 0 1px 0 rgba(255, 248, 220, 0.38);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
}

.detail-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

body.km-active .detail-card h3 {
    font-family: 'Battambang', sans-serif;
}

.detail-card-date {
    margin: -6px auto 14px;
    color: #6b3f49;
    font-size: clamp(12px, 1.7vw, 14px);
    line-height: 1.6;
    text-align: center;
}

body.km-active .detail-card-date {
    font-family: 'Battambang', sans-serif;
}

/* Agenda list */
.agenda-list {
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid rgba(255, 224, 214, 0.3);
    text-align: left;
}

.agenda-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 5px 0;
    border-radius: 10px;
    background: rgba(255, 250, 246, 0.1);
    transition: all 0.3s ease;
}

.agenda-item:hover {
    background: rgba(255, 250, 246, 0.18);
}

.agenda-item:last-child {
    margin-bottom: 0;
}

.agenda-time {
    font-family: 'Playfair Display', serif;
    font-size: clamp(12px, 1.8vw, 14px);
    font-weight: 700;
    color: #c69b2d;
    white-space: nowrap;
    padding: 4px 12px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 20px;
    flex-shrink: 0;
}

.agenda-event {
    font-size: clamp(12px, 1.8vw, 14px);
    color: #5f3945;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.32);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body.km-active .agenda-time {
    font-family: 'Battambang', sans-serif;
}

body.km-active .agenda-event {
    font-family: 'Battambang', sans-serif;
}

/* Countdown — Option B: minimal strip (no boxes) */
.countdown-wrap {
    margin-top: clamp(24px, 4vh, 48px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(4px, 1.2vw, 14px);
}

.countdown-sep {
    width: 1px;
    height: clamp(34px, 5vh, 54px);
    background: linear-gradient(to bottom, rgba(212, 175, 55, 0), rgba(212, 175, 55, 0.55), rgba(212, 175, 55, 0));
}

.countdown-item {
    text-align: center;
    min-width: clamp(44px, 8vw, 72px);
}

.countdown-item .number {
    font-family: 'Playfair Display', serif;
    font-size: clamp(30px, 5.5vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #d4af37;
    text-shadow: 0 1px 2px rgba(160, 120, 30, 0.18);
}

.countdown-item .label {
    font-family: 'Lato', sans-serif;
    font-size: clamp(8px, 1.2vw, 11px);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.45);
    margin-top: clamp(6px, 1vh, 10px);
}

body.km-active .countdown-item .label {
    font-family: 'Battambang', sans-serif;
    letter-spacing: 0;
}

.countdown-msg {
    margin-top: clamp(6px, 1.2vh, 12px);
    font-family: 'Playfair Display', serif;
    font-size: clamp(18px, 3vw, 28px);
    color: #d4af37;
    text-align: center;
}

.countdown-msg:empty {
    display: none;
}

body.km-active .countdown-msg {
    font-family: 'Battambang', sans-serif;
}



/* ==================== css/gallery.css ==================== */
/* ==================== SLIDE 4: GALLERY ==================== */
.slide-gallery { background: #f1d2d5; padding: 0; position: relative; }

.gallery-content {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    position: relative;
}

.gallery-header {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 20;
    text-align: center;
    padding: 64px 70px 18px;
    background: linear-gradient(to top, rgba(55, 24, 32, 0.58) 0%, rgba(55, 24, 32, 0.18) 58%, transparent 100%);
    pointer-events: none;
}

.gallery-header .section-title {
    color: #ffe0d6;
    font-family: 'Great Vibes', cursive;
    font-size: clamp(38px, 6vw, 58px);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 0;
    text-shadow: 0 3px 14px rgba(31, 12, 18, 0.65);
}

.gallery-header .section-subtitle {
    color: #fff0df;
    font-family: 'Playfair Display', serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 5px;
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(31, 12, 18, 0.7);
}

body.km-active .gallery-header .section-title {
    font-family: 'Khmer OS Muol Pali', 'Battambang', sans-serif;
    font-size: clamp(22px, 3.6vw, 35px);
    font-weight: 400;
    line-height: 1.55;
}

body.km-active .gallery-header .section-subtitle {
    font-family: 'Battambang', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: none;
    line-height: 1.25;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: calc(100vw / 3);
    height: 100vh;
    height: 100dvh;
    gap: 0;
    padding: 0;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.gallery-item {
    border-radius: 0;
    overflow: hidden;
    position: relative;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 200px;
    scroll-snap-align: start;
    /* Animation initial state */
    opacity: 0;
    transform: scale(0.8) translateY(30px);
}

.gallery-item.animate-in {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        145deg,
        rgba(255, 224, 214, 0.1),
        rgba(188, 105, 112, 0.08)
    );
}

.gallery-item:hover { filter: brightness(1.1); }
.gallery-item:first-child { grid-row: span 2; }

.gallery-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-viewer {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 70px;
    background: rgba(38, 18, 24, 0.9);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.gallery-viewer.visible { opacity: 1; visibility: visible; }

.gallery-viewer-frame {
    position: relative;
    max-width: min(1100px, 100%);
    max-height: 90dvh;
    margin: 0;
}

.gallery-viewer-image {
    display: block;
    max-width: 100%;
    max-height: 86dvh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

.gallery-viewer-count {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(49, 19, 29, 0.65);
    color: #fff0df;
    font-size: 13px;
}

.gallery-viewer-close,
.gallery-viewer-nav {
    position: absolute;
    z-index: 2;
    border: 1px solid rgba(255, 224, 214, 0.42);
    background: rgba(255, 250, 246, 0.14);
    color: #fff0df;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.gallery-viewer-close {
    top: 18px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 27px;
    line-height: 32px;
}

.gallery-viewer-nav {
    top: 50%;
    width: 42px;
    height: 54px;
    border-radius: 22px;
    transform: translateY(-50%);
    font-size: 25px;
}

.gallery-viewer-prev { left: 16px; }
.gallery-viewer-next { right: 16px; }

@media (max-width: 600px) {
    .gallery-header { padding: 58px 56px 16px 20px; }
    .gallery-viewer { padding: 58px 12px 70px; }
    .gallery-viewer-nav { top: auto; bottom: 12px; transform: none; }
    .gallery-viewer-prev { left: calc(50% - 58px); }
    .gallery-viewer-next { right: calc(50% - 58px); }
    .gallery-viewer-image { max-height: calc(100dvh - 140px); }
}



/* ==================== css/rsvp.css ==================== */
/* ==================== SLIDE 5: RSVP ==================== */
.slide-rsvp {
    background: linear-gradient(135deg, #e8c4c4 0%, #f5e1e1 50%, #e8c4c4 100%);
    padding: clamp(10px, 2vh, 40px) clamp(15px, 3vw, 40px);
}

.rsvp-content {
    max-width: 600px;
    text-align: center;
}

.rsvp-couple-decoration {
    display: block;
    width: auto;
    height: clamp(90px, 14vh, 150px);
    max-width: min(52vw, 240px);
    object-fit: contain;
    margin: 0 auto clamp(4px, 0.8vh, 10px);
    filter: drop-shadow(0 5px 10px rgba(101, 45, 62, 0.16));
}

.rsvp-content .section-title { font-family: 'Great Vibes', cursive; font-size: clamp(38px, 6vw, 58px); color: #d4af37; }
body.km-active .rsvp-content > .section-title {
    font-family: 'Khmer OS Muol Pali', 'Battambang', sans-serif;
    font-size: clamp(22px, 3.6vw, 35px) !important;
    font-weight: 400;
    line-height: 1.55;
}
.rsvp-content .section-subtitle { color: #888; }

.rsvp-message {
    font-family: 'Playfair Display', serif;
    font-size: clamp(14px, 2vw, 20px);
    color: #3a3a3a;
    margin-bottom: clamp(20px, 3vh, 40px);
    line-height: 1.6;
}

.rsvp-form { display: flex; flex-direction: column; gap: clamp(10px, 1.5vh, 20px); }
.form-group { text-align: left; }

.form-group label {
    display: block;
    font-size: clamp(9px, 1.2vw, 13px);
    letter-spacing: clamp(1px, 0.2vw, 3px);
    text-transform: uppercase;
    color: #d4af37;
    margin-bottom: clamp(4px, 0.5vh, 8px);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: clamp(8px, 1.2vh, 15px) clamp(12px, 2vw, 20px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: clamp(5px, 0.8vw, 10px);
    background: rgba(255, 255, 255, 0.7);
    color: #3a3a3a;
    font-family: 'Lato', sans-serif;
    font-size: clamp(12px, 1.5vw, 16px);
    transition: border-color 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #999; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: #d4af37; }

.form-group select option { background: #fffaf0; color: #3a3a3a; }
.form-group textarea { resize: vertical; min-height: clamp(50px, 6vh, 100px); }

.submit-btn {
    padding: clamp(10px, 1.5vh, 18px) clamp(25px, 4vw, 50px);
    background: linear-gradient(135deg, #d4af37, #c5a028);
    border: none;
    border-radius: 50px;
    color: #1a1a2e;
    font-family: 'Playfair Display', serif;
    font-size: clamp(13px, 1.8vw, 18px);
    font-weight: 700;
    letter-spacing: clamp(2px, 0.3vw, 4px);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: clamp(5px, 0.8vh, 10px);
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
}

/* RSVP Contact Section */
.rsvp-contact-section {
    margin-top: clamp(12px, 2vh, 24px);
    padding-top: 0;
    border-top: 0;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: clamp(14px, 3vw, 30px);
}

.rsvp-contact-section .rsvp-section-title {
    flex: 0 0 100%;
}

.rsvp-section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(18px, 3vw, 28px);
    color: #d4af37;
    margin-bottom: clamp(10px, 1.5vh, 20px);
}

.rsvp-contact-info {
    font-family: 'Lato', sans-serif;
    font-size: clamp(13px, 1.8vw, 18px);
    color: #3a3a3a;
    margin: clamp(5px, 0.8vh, 10px) 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.rsvp-contact-info::before {
    content: '📞';
    font-size: 18px;
}

.rsvp-phone-link {
    color: #56323d;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(198, 155, 45, 0.5);
}

/* RSVP Gift Section */
.rsvp-gift-section {
    margin-top: clamp(25px, 4vh, 50px);
    padding: clamp(15px, 2.5vh, 30px);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 15px;
    text-align: center;
}

.rsvp-gift-message {
    font-family: 'Playfair Display', serif;
    font-size: clamp(13px, 1.8vw, 17px);
    color: #5f3945;
    line-height: 1.8;
    font-style: normal;
    margin: clamp(22px, 3vh, 38px) auto 0;
    max-width: 560px;
}

.rsvp-bottom-divider {
    display: block;
    width: clamp(160px, 34vw, 280px);
    height: clamp(20px, 4vh, 34px);
    object-fit: contain;
    margin: clamp(10px, 1.5vh, 18px) auto 0;
    filter: drop-shadow(0 3px 7px rgba(101, 45, 62, 0.14));
}

/* RSVP Bank Section */
.rsvp-bank-section {
    margin-top: clamp(25px, 4vh, 50px);
    text-align: center;
}

.bank-cards {
    display: flex;
    justify-content: center;
    gap: clamp(15px, 3vw, 30px);
    flex-wrap: wrap;
    margin-top: clamp(10px, 1.5vh, 20px);
}

.bank-card {
    position: relative;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    flex: 0 1 auto;
    width: clamp(190px, 15vw, 200px);
    min-width: 190px;
    max-width: 200px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: none;
}

.bank-card::before { display: none; }

.bank-card-details {
    width: 100%;
    padding: 12px 14px 10px;
    background: linear-gradient(145deg, rgba(255, 246, 242, 0.3), rgba(224, 151, 166, 0.14));
    border: 1px solid rgba(255, 224, 214, 0.34);
    border-radius: 15px;
    -webkit-backdrop-filter: blur(5px) saturate(1.08);
    backdrop-filter: blur(5px) saturate(1.08);
    box-shadow: 0 9px 24px rgba(101, 45, 62, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.bank-card > * {
    position: relative;
    z-index: 1;
}

.bank-card:hover { transform: none; box-shadow: none; }

.bank-card-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(14px, 1.7vw, 18px);
    color: #c69b2d;
    margin-bottom: 8px;
    font-weight: 700;
}

.bank-card-account {
    font-family: 'Lato', sans-serif;
    font-size: clamp(11px, 1.2vw, 13px);
    color: #6b424d;
    margin-bottom: 4px;
}

.bank-card-number {
    font-family: 'Lato', sans-serif;
    font-size: clamp(13px, 1.5vw, 16px);
    color: #56323d;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding: 2px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
}

.bank-card-number:hover,
.bank-card-number:focus-visible {
    background: rgba(255, 250, 246, 0.28);
    outline: 1px solid rgba(198, 155, 45, 0.35);
}

.bank-card-qr-panel {
    width: clamp(190px, 15vw, 200px);
    height: clamp(190px, 15vw, 200px);
    display: grid;
    place-items: center;
    margin: 10px auto;
    flex: 0 0 auto;
}

.bank-card-qr {
    width: 100%;
    height: 100%;
    max-width: 200px;
    max-height: 200px;
    box-sizing: border-box;
    object-fit: contain;
    border-radius: 4px;
    border: 0;
    padding: 5px;
    background: #fff;
    box-shadow: none;
}

/* Transfer Button */
.bank-transfer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    flex: 0 0 auto;
    width: clamp(190px, 15vw, 200px);
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(198, 155, 45, 0.72);
    border-radius: 25px;
    text-decoration: none;
    color: #9f7417;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.bank-transfer-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 248, 235, 0.26);
    box-shadow: 0 5px 16px rgba(101, 45, 62, 0.12);
}

.bank-btn-text {
    color: inherit;
}

/* Khmer font overrides */
body.km-active .rsvp-message {
    font-family: 'Battambang', sans-serif;
}
body.km-active .form-group label {
    font-family: 'Battambang', sans-serif;
}
body.km-active .form-group input,
body.km-active .form-group select,
body.km-active .form-group textarea {
    font-family: 'Battambang', sans-serif;
}
body.km-active .submit-btn {
    font-family: 'Battambang', sans-serif;
}
body.km-active .rsvp-section-title,
body.km-active .rsvp-contact-info,
body.km-active .rsvp-gift-message,
body.km-active .bank-card-name,
body.km-active .bank-card-account,
body.km-active .bank-card-number,
body.km-active .bank-transfer-btn,
body.km-active .bank-btn-text {
    font-family: 'Battambang', sans-serif;
}

.bank-card-qr-missing {
    display: none;
    width: 100%;
    height: 100%;
    place-items: center;
    padding: 12px;
    border: 1px dashed rgba(198, 155, 45, 0.42);
    border-radius: 10px;
    background: rgba(255, 250, 246, 0.45);
    color: #6b424d;
    font-size: 12px;
}

.bank-card-qr-panel.is-missing .bank-card-qr { display: none; }
.bank-card-qr-panel.is-missing .bank-card-qr-missing { display: grid; }

@media (max-width: 600px) {
    .rsvp-couple-decoration {
        height: clamp(64px, 10vh, 86px);
        max-width: 42vw;
        margin-bottom: 2px;
    }
}

/* Keep the full RSVP composition visible on common laptop/desktop heights. */
@media (min-width: 769px) and (max-height: 1000px) {
    .slide-rsvp {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .rsvp-couple-decoration {
        height: clamp(82px, 10vh, 108px);
        margin-bottom: 2px;
    }

    .rsvp-content .section-title {
        margin-bottom: 5px;
    }

    .rsvp-contact-section {
        margin-top: 8px;
    }

    .rsvp-contact-info {
        margin: 4px 0;
    }

    .rsvp-bank-section {
        margin-top: 18px;
    }

    .rsvp-section-title {
        margin-bottom: 8px;
    }

    .bank-cards {
        margin-top: 8px;
    }

    .bank-card {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .rsvp-gift-message {
        margin-top: 16px;
        line-height: 1.55;
    }

    .rsvp-bottom-divider {
        height: 26px;
        margin-top: 7px;
    }
}



/* ==================== css/thankyou.css ==================== */
/* ==================== SLIDE 7: THANK YOU ==================== */
.slide-thankyou {
    background: linear-gradient(135deg, #f8f4e8 0%, #fff 50%, #f8f4e8 100%);
    text-align: center;
}

.thankyou-content {
    position: relative;
    box-sizing: border-box;
    width: min(700px, calc(100% - 48px));
    max-width: 700px;
    padding: clamp(28px, 5vh, 54px) clamp(28px, 4vw, 48px);
    overflow-wrap: anywhere;
    border: 1px solid rgba(255, 224, 214, 0.48);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255, 246, 242, 0.34), rgba(224, 151, 166, 0.16));
    box-shadow: 0 24px 60px rgba(101, 45, 62, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: blur(5px) saturate(1.06);
    backdrop-filter: blur(5px) saturate(1.06);
}
.thankyou-content::before {
    content: '';
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(255, 224, 214, 0.34);
    border-radius: 19px;
    pointer-events: none;
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.12);
}
.thankyou-content > * { position: relative; z-index: 1; }
.thankyou-content .heart {
    width: clamp(86px, 12vw, 145px);
    height: clamp(86px, 12vw, 145px);
    margin: 0 auto clamp(8px, 1.5vh, 20px);
    background: url('../images/couple_logo_rosegold.webp') center / contain no-repeat;
    filter: drop-shadow(0 5px 12px rgba(101, 45, 62, 0.18));
    font-size: 0;
}
.thankyou-content h2 { font-family: 'Great Vibes', cursive; font-size: clamp(38px, 6vw, 58px); color: #d4af37; margin-bottom: clamp(8px, 1.5vh, 20px); }
.thankyou-content p { max-width: 100%; font-family: 'Playfair Display', serif; font-size: clamp(14px, 2vw, 22px); color: #555; line-height: 1.7; margin-bottom: clamp(5px, 0.8vh, 15px); overflow-wrap: anywhere; word-break: break-word; }
.thankyou-content .couple-names { font-family: 'Great Vibes', cursive; font-size: clamp(24px, 4vw, 40px); color: #bd777d; background: linear-gradient(135deg, #d89a93, #a85f6d 48%, #e3ae9d); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-top: clamp(15px, 2.5vh, 40px); }
.thankyou-content .hashtag { display: inline-block; max-width: 100%; margin-top: clamp(12px, 2vh, 30px); padding: clamp(6px, 1vh, 12px) clamp(15px, 3vw, 30px); border: 2px solid #d4af37; border-radius: 50px; font-size: clamp(11px, 1.5vw, 16px); letter-spacing: clamp(1px, 0.2vw, 3px); color: #d4af37; overflow-wrap: anywhere; }

/* Khmer font overrides */
body.km-active .thankyou-content h2 {
    font-family: 'Khmer OS Muol Pali', 'Battambang', sans-serif;
    font-weight: 400;
    line-height: 1.55;
    font-size: clamp(22px, 3.6vw, 35px) !important;
}
body.km-active .thankyou-content p {
    font-family: 'Battambang', sans-serif;
}
body.km-active .thankyou-content .couple-names {
    font-family: 'Battambang', sans-serif;
}
body.km-active .thankyou-content .hashtag {
    font-family: 'Battambang', sans-serif;
}



/* ==================== css/music.css ==================== */
/* ==================== MUSIC TOGGLE BUTTON ==================== */
.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.6);
    background: rgba(0, 0, 0, 0.5);
    color: #d4af37;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.music-toggle:hover { background: rgba(212, 175, 55, 0.2); border-color: #d4af37; }
.music-toggle.playing { animation: musicPulse 1.5s infinite; }

@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}


/* ==================== css/particles.css ==================== */
/* ==================== PARTICLES ==================== */
.particles-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.falling-particle {
    position: absolute;
    top: -50px;
    animation: fallDown linear forwards, sway ease-in-out infinite;
    opacity: 0;
}

.flower-particle {
    display: block;
    object-fit: contain;
}

@keyframes fallDown {
    0% { top: -50px; opacity: 0; }
    5% { opacity: 0.8; }
    90% { opacity: 0.6; }
    100% { top: 110vh; opacity: 0; }
}

@keyframes sway {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    50% { transform: translateX(25px) rotate(180deg); }
}

/* Keep Slide 3's schedule readable while retaining the floating decoration. */
body[data-active-slide="2"] .falling-particle {
    filter: opacity(0.48);
}

/* Keep faces and gallery details clear on Slide 4. */
body[data-active-slide="3"] .falling-particle {
    filter: opacity(0.42);
}

/* Slide 1 uses clear side lanes so decoration does not cover names or dates. */
body[data-active-slide="0"] .falling-particle { filter: opacity(0.55); }



/* ==================== css/responsive.css ==================== */
/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    /* Force all slides to be exactly viewport height with no overflow */
    .slide {
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
    }

    .slide-story,
    .slide-details,
    .slide-thankyou {
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
    }

    .slide-story {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .story-content {
        max-width: 95%;
        width: 95%;
        margin: 0 auto;
        min-height: 0 !important;
        max-height: 95vh !important;
        overflow: hidden !important;
    }

    .slide-story .story-content {
        padding: 0;
        overflow: visible !important;
    }

    .slide-details .details-content,
    .slide-thankyou .thankyou-content {
        padding: 24px 22px;
        width: calc(100% - 32px) !important;
        max-width: 620px !important;
        overflow: hidden !important;
        max-height: 95vh !important;
    }

    .slide-rsvp {
        overflow-y: auto !important;
        align-items: flex-start;
        padding-top: clamp(48px, 7vh, 70px);
    }

    .slide-rsvp .rsvp-content {
        padding: 10px 0 10px;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        max-height: 95vh !important;
    }

    .cover-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
    }
    .cover-content h1 {
        flex: 0 0 auto;
        font-size: 46px;
        line-height: 1.18;
        margin: 2px 0 4px;
        padding: .16em .06em .08em;
    }
    .cover-content .ampersand {
        flex: 0 0 auto;
        width: 46px;
        height: 32px;
        margin: 0 auto 2px;
        font-size: 0;
    }
    body.km-active .cover-content .ampersand {
        width: auto;
        height: auto;
        margin: 2px auto 5px;
        font-size: 20px;
    }
    .cover-content .pre-text { flex: 0 0 auto; font-size: 13px; letter-spacing: 4px; margin-bottom: 7px; }
    /* Khmer pre-text on phone/small-tablet: keep it visible, small, and below the h1 size. */
    body.km-active .cover-content .pre-text {
        font-size: clamp(13px, 3.6vw, 16px);
        letter-spacing: 1px;
        line-height: 1.35;
        white-space: normal;
        margin-bottom: 8px;
    }
    .cover-content .wedding-date {
        flex: 0 0 auto;
        width: 100%;
        box-sizing: border-box;
        font-size: 17px;
        letter-spacing: 4px;
        margin: 2px 0 0;
    }
    .cover-content .wedding-date::before {
        width: clamp(92px, 28vw, 118px);
        height: 25px;
        margin-bottom: 4px;
    }
    body.km-active .cover-content .wedding-date {
        font-size: 13px;
        line-height: 1.6;
        letter-spacing: 0;
    }

    .couple-logo {
        width: clamp(155px, 44vw, 190px) !important;
        height: auto !important;
        margin: -25px auto 18px !important;
    }
    .couple-logo::before {
        width: clamp(140px, 42vw, 180px) !important;
        height: clamp(175px, 52vw, 225px) !important;
    }
    .couple-logo .groom-letter {
        font-size: clamp(90px, 26vw, 140px) !important;
    }
    .couple-logo .bride-letter {
        font-size: clamp(70px, 20vw, 110px) !important;
    }
    .couple-logo .logo-ampersand {
        font-size: clamp(22px, 5vw, 36px) !important;
    }

    .section-title { font-size: 42px; margin-bottom: 10px; }
    .section-subtitle { font-size: 11px; letter-spacing: 4px; margin-bottom: 15px; }

    .timeline {
        margin: 10px auto 0;
        border-radius: 15px;
        grid-template-columns: 1fr 1fr !important;
        -webkit-overflow-scrolling: touch;
        display: grid !important;
        grid-template-rows: auto auto !important;
        max-width: calc(100vw - 30px) !important;
    }

    /* Story slide timeline - NO scrolling, must fit in viewport */
    .slide-story .timeline {
        overflow: hidden !important;
        transform: scale(0.88);
        transform-origin: center center;
        max-height: 80vh !important;
    }

    /* Details slide timeline - allow horizontal scroll */
    .slide-details .timeline {
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
    }
    .slide-details .timeline::-webkit-scrollbar { height: 4px; }
    .slide-details .timeline::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }

    .timeline-item { padding: 12px 8px; }
    .ceremony-block .card-title { font-size: 20px; }
    .card-title { font-size: 18px; margin-bottom: 6px; }
    .card-date { font-size: 13px; margin-bottom: 4px; }
    .card-time { font-size: 15px; margin-bottom: 4px; }
    .card-venue { font-size: 12px; margin-bottom: 3px; }
    .card-address { font-size: 10px; }
    .card-icon { font-size: 24px; margin-bottom: 4px; }
    .year { font-size: 13px; }
    .event { font-size: 12px; margin-bottom: 2px; }
    .description { font-size: 10px; line-height: 1.4; }
    .parents-block .card-title { font-size: 14px; }
    .card-parent-name { font-size: 11px; }

    /* 4th milestone - details block (date + text) */
    .details-block {
        padding: 15px 12px;
    }
    .details-block .card-date { font-size: 15px; margin-bottom: 5px; }
    .details-block .card-text { font-size: 12px; }

    /* Couple block mobile */
    .couple-block {
        padding: 12px 8px;
    }
    .couple-block .card-title { font-size: 14px; }
    .couple-block .card-parent-name { font-size: 12px; }

    /* 7th - venue block (time + venue + address, bottom padding) */
    .venue-block {
        padding: 15px 12px 25px;
    }
    .venue-block .card-time { font-size: 12px; margin-bottom: 5px; }
    .venue-block .card-venue { font-size: 12px; margin-bottom: 4px; }
    .venue-block .card-address { font-size: 11px; }

    .details-grid {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 12px !important;
        margin-top: 25px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-padding-left: 15px !important;
        padding: 38px 36px 42px 36px !important;
        -webkit-overflow-scrolling: touch;
        max-height: 60vh !important;
        justify-content: flex-start !important;
    }
    .details-grid::-webkit-scrollbar { height: 4px; }
    .details-grid::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }
    .detail-card-shell {
        min-width: calc(100vw - 70px) !important;
        max-width: none !important;
        flex: none !important;
        scroll-snap-align: start;
        height: clamp(320px, 56dvh, 430px);
    }
    .detail-card {
        min-width: 0 !important;
        width: 100% !important;
        padding: 25px 18px !important;
        display: flex !important;
        flex-direction: column !important;
        max-height: none !important;
        overflow: hidden !important;
    }
    .detail-card h3,
    .detail-card .detail-card-date {
        flex: 0 0 auto;
    }
    .detail-card .agenda-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 6px;
        margin-right: -6px;
    }
    .detail-card .agenda-list::-webkit-scrollbar { width: 4px; }
    .detail-card .agenda-list::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.35); border-radius: 2px; }
    .detail-card::-webkit-scrollbar { width: 3px; }
    .detail-card::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }
    .detail-card h3 { font-size: 24px; }
    .detail-corner { width: clamp(92px, 27vw, 124px); }
    .detail-corner-top-left { top: -16px; left: -34px; }
    .detail-corner-bottom-right { right: -34px; bottom: -15px; }
    .agenda-time { font-size: 13px; min-width: 75px; }
    .agenda-event { font-size: 12px; }

    .countdown { gap: 10px; }
    .countdown-wrap { margin-top: 40px; }
    .countdown-item .number { font-size: 36px; }
    .countdown-sep { height: 44px; }
    .countdown-item .label { font-size: 10px; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); grid-auto-columns: 50vw; }
    .gallery-item:first-child { grid-column: span 2; grid-row: span 1; }
    .gallery-header .section-title { font-size: 38px; }

    .rsvp-message { font-size: 16px; margin-bottom: 25px; }
    .rsvp-form { gap: 15px; }
    .form-group label { font-size: 11px; }
    .form-group input,
    .form-group select,
    .form-group textarea { padding: 12px 14px; font-size: 14px; }
    .submit-btn { padding: 14px 35px; font-size: 15px; }

    /* RSVP Contact/Gift/Bank sections */
    .rsvp-contact-section { margin-top: 12px; padding-top: 0; }
    .rsvp-section-title { font-size: 20px; margin-bottom: 12px; }
    .rsvp-contact-section { column-gap: 12px; }
    .rsvp-contact-info { font-size: 12px; flex-direction: row; gap: 3px; margin: 2px 0; white-space: nowrap; }
    .rsvp-contact-info::before { content: none; }
    .rsvp-gift-section { margin-top: 25px; padding: 20px 15px; }
    .rsvp-gift-message { font-size: 14px; line-height: 1.6; }
    .rsvp-bank-section { margin-top: 25px; }

    /* Disclaimer text darker on mobile */
    .rsvp-gift-note { color: #2a2a2a !important; font-style: normal !important; }

    /* Bank cards - horizontal swipe like Slide 3 details-grid */
    .bank-cards {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 40px !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory !important;
        scroll-padding-left: 20px !important;
        padding: 10px 20px 15px 20px !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        margin-top: 15px;
    }
    .bank-cards::-webkit-scrollbar { height: 4px; }
    .bank-cards::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 2px; }
    .bank-card {
        min-width: 180px !important;
        max-width: 180px !important;
        width: 180px !important;
        flex: none !important;
        scroll-snap-align: center;
        padding: 0 !important;
    }
    .bank-card-name { font-size: 16px; }
    .bank-card-account { font-size: 12px; }
    .bank-card-number { font-size: 14px; }
    .bank-card-qr-panel,
    .bank-card-qr { width: 180px; height: 180px; }
    .bank-transfer-btn { width: 180px; padding: 10px 18px; font-size: 12px; }
    .bank-logo { width: 20px; height: 20px; }

    .thankyou-content .heart { width: 100px; height: 100px; margin-bottom: 8px; }
    .details-content .section-title,
    .rsvp-content .section-title,
    .thankyou-content h2 { font-size: 38px; }
    .thankyou-content p { font-size: 14px; line-height: 1.65; }
    .thankyou-content .couple-names { font-size: 32px; }
    .thankyou-content .hashtag { max-width: calc(100vw - 54px); font-size: 12px; padding: 9px 16px; letter-spacing: .5px; }
    body.km-active .thankyou-content h2 { font-size: clamp(22px, 3.6vw, 35px) !important; line-height: 1.4; }

    .nav-dots { right: 8px; gap: 10px; }
    .nav-dots .dot { width: 10px; height: 10px; }
    .arrow-nav { width: 38px; height: 38px; font-size: 16px; }
    .arrow-up { top: 10px; }
    .arrow-down { bottom: 10px; }
    .lang-links { top: 10px; right: 15px; font-size: 11px; }
    .music-toggle { bottom: 15px; right: 15px; width: 40px; height: 40px; font-size: 17px; }
    .floral-corner { width: 120px; height: 120px; }

    .modal-title { font-size: 38px !important; }
    .modal-couple { font-size: 32px !important; }
    .guest-name { font-size: 26px !important; }
    .modal-content { padding: 50px 30px !important; }
}

/* iPhone/Safari: fit Slide 3 without nested scrolling and keep Slide 4 rows visible. */
@media (max-width: 480px) {
    .slide-details .details-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 18px) !important;
        padding: 34px 0 8px !important;
        overflow: hidden !important;
    }

    .slide-details .details-content .section-title {
        font-size: 30px !important;
        line-height: 1.25;
        margin-bottom: 0;
    }

    body.km-active .slide-details .details-content .section-title {
        font-size: 23px !important;
        line-height: 1.4;
    }

    .slide-details .details-grid {
        margin-top: 2px !important;
        padding: 18px 26px 14px !important;
        max-height: none !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
    }

    .slide-details .detail-card-shell {
        min-width: calc(100vw - 52px) !important;
    }

    .slide-details .detail-card {
        max-height: none !important;
        padding: 12px 14px !important;
        overflow: hidden !important;
    }

    .slide-details .detail-card h3 {
        font-size: 19px;
        margin-bottom: 8px;
        padding-bottom: 7px;
    }

    .slide-details .detail-card-date {
        margin: -2px auto 6px;
        font-size: 11px;
        line-height: 1.4;
    }

    .slide-details .agenda-item {
        gap: 9px;
        padding: 7px 9px;
        margin: 4px 0;
    }

    .slide-details .agenda-time {
        min-width: 62px;
        padding: 4px 9px;
        font-size: 12px;
    }

    .slide-details .agenda-event {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 12px;
        line-height: 1.5;
    }

    .slide-details .countdown-wrap {
        margin-top: 14px;
    }

    .slide-details .countdown {
        gap: clamp(3px, 1.4vw, 8px);
    }

    .slide-details .countdown-sep {
        height: 26px;
    }

    .slide-details .countdown-item {
        min-width: 0;
        flex: 1 1 0;
    }

    .slide-details .countdown-item .number { font-size: clamp(22px, 6.5vw, 30px); }
    .slide-details .countdown-item .label { font-size: 8px; letter-spacing: 1px; margin-top: 3px; }
    .slide-details .countdown-msg { font-size: clamp(15px, 4.5vw, 20px); margin-top: 5px; }

    .slide-gallery .gallery-grid {
        grid-template-rows: repeat(3, minmax(0, 1fr));
        min-height: 0;
        height: 100dvh;
    }

    .slide-gallery .gallery-item { min-height: 0; }
    .slide-gallery .gallery-header { padding: 46px 52px 10px 16px; }
    .slide-gallery .gallery-header .section-title { font-size: 30px; }
    body.km-active .slide-gallery .gallery-header .section-title { font-size: 22px !important; }
}

/* Slide 1 phone card: mirror the opening invitation modal's proportions. */
@media (max-width: 480px) {
    .slide-cover .cover-content {
        width: 90% !important;
        max-width: 410px !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 24px) !important;
        padding: clamp(22px, 5dvh, 40px) 25px clamp(20px, 4dvh, 34px) !important;
        border-radius: 20px;
        justify-content: center;
    }

    .slide-cover .couple-logo,
    body.km-active .slide-cover .couple-logo {
        width: min(165px, 48vw) !important;
        margin: 0 auto 7px !important;
    }

    body:not(.km-active) .slide-cover .cover-content .pre-text {
        font-family: 'Great Vibes', cursive;
        font-size: clamp(26px, 8.5vw, 32px);
        font-weight: 400;
        line-height: 1.12;
        letter-spacing: 0;
        text-transform: none;
        margin-bottom: 7px;
    }

    /* Khmer pre-text on phones: keep it visible but small (smaller than the h1) and let it wrap. */
    body.km-active .slide-cover .cover-content .pre-text {
        font-size: clamp(14px, 4.2vw, 17px);
        line-height: 1.4;
        letter-spacing: 0;
        white-space: normal;
        margin-bottom: 8px;
    }

    .slide-cover .cover-content h1,
    body.km-active .slide-cover .cover-content h1 {
        font-size: 28px;
        line-height: 1.3;
        margin: 1px 0 3px;
        padding: .15em .05em .08em;
    }

    .slide-cover .cover-content .ampersand {
        width: 42px;
        height: 28px;
        margin: 0 auto 2px;
    }

    body.km-active .slide-cover .cover-content .ampersand {
        width: auto;
        height: auto;
        font-size: 18px;
        line-height: 1.3;
        margin: 0 auto 2px;
    }

    .slide-cover .cover-content .wedding-date {
        font-family: 'Lato', sans-serif;
        font-size: 13px;
        line-height: 1.4;
        letter-spacing: 1.5px;
        margin-top: 2px;
        padding-bottom: 0;
    }

    body.km-active .slide-cover .cover-content .wedding-date {
        font-family: 'Battambang', sans-serif;
        font-size: 12px;
        line-height: 1.45;
        letter-spacing: 0;
    }

    .slide-cover .cover-content .wedding-date::before {
        width: 86px;
        height: 22px;
        margin-bottom: 3px;
    }
}

@media (max-width: 480px) {
    .cover-content h1 { font-size: 38px; line-height: 1.16; margin: 1px 0 3px; }
    .cover-content .pre-text { font-size: 12px; }
    .cover-content .wedding-date { font-size: 16px; }

    .couple-logo {
        width: clamp(120px, 36vw, 150px) !important;
        height: auto !important;
        margin: -12px auto 7px !important;
    }
    .couple-logo::before {
        width: clamp(120px, 36vw, 150px) !important;
        height: clamp(150px, 46vw, 190px) !important;
    }
    .couple-logo .groom-letter {
        font-size: clamp(75px, 35vw, 120px) !important;
    }
    .couple-logo .bride-letter {
        font-size: clamp(60px, 25vw, 95px) !important;
    }
    .couple-logo .logo-ampersand {
        font-size: clamp(18px, 4vw, 28px) !important;
    }

    .section-title { font-size: 38px; }
    .section-subtitle { font-size: 11px; }

    .detail-card { padding: 30px 20px; }
    .detail-card h3 { font-size: 22px; }
    .countdown-item .number { font-size: 30px; }
    .countdown-wrap { margin-top: 26px; }

    .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); grid-auto-columns: 50vw; }
    .gallery-item:first-child { grid-column: span 2; }
    .gallery-header .section-title { font-size: 36px; }

    .details-content .section-title,
    .rsvp-content .section-title,
    .thankyou-content h2 { font-size: 36px; }
    .thankyou-content .couple-names { font-size: 30px; }
    .thankyou-content { padding-left: 20px; padding-right: 28px; }

    .modal-title { font-size: 32px !important; }
    .modal-couple { font-size: 28px !important; }
    .guest-name { font-size: 22px !important; }
    .modal-content { padding: 40px 25px !important; }

    /* RSVP compact on small screens */
    .slide-rsvp {
        padding: clamp(42px, 6vh, 56px) 12px 10px;
    }
    .rsvp-content .section-title {
        font-size: 28px !important;
        margin-bottom: 5px !important;
    }
    .rsvp-content .section-subtitle {
        font-size: 9px !important;
        margin-bottom: 8px !important;
    }
    .rsvp-message {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }
    .rsvp-form {
        gap: 8px !important;
    }
    .form-group label {
        font-size: 8px !important;
        margin-bottom: 2px !important;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    .form-group textarea {
        min-height: 40px !important;
    }
    .submit-btn {
        padding: 10px 25px !important;
        font-size: 13px !important;
        margin-top: 5px !important;
    }
    .rsvp-contact-section {
        margin-top: 15px !important;
        padding-top: 10px !important;
    }
    .rsvp-section-title {
        font-size: 16px !important;
        margin-bottom: 6px !important;
    }
    .rsvp-contact-info {
        font-size: 12px !important;
    }
    .rsvp-gift-section {
        margin-top: 15px !important;
        padding: 10px 12px !important;
    }
    .rsvp-gift-message {
        font-size: 11px !important;
    }
    .rsvp-bank-section {
        margin-top: 15px !important;
    }
    .rsvp-gift-note {
        color: #2a2a2a !important;
        font-style: normal !important;
    }
    .bank-cards {
        gap: 40px !important;
        padding: 10px 20px 15px 20px !important;
    }
    .bank-card {
        min-width: 170px !important;
        max-width: 170px !important;
        width: 170px !important;
    }
    .bank-card-account {
        font-size: 11px !important;
    }
    .bank-card-number {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }
    .bank-card-qr-panel,
    .bank-card-qr {
        width: 170px !important;
        height: 170px !important;
    }
    .bank-transfer-btn {
        width: 170px !important;
        padding: 8px 16px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 768px) {
    .story-content::before {
        width: clamp(68px, 22vw, 94px);
        transform: translate(-8%, -18%);
    }

    .story-content::after {
        width: clamp(64px, 20vw, 90px);
        transform: translate(8%, 20%);
    }
}

/* Keep the primary cards visually aligned on standard-height mobile screens. */
@media (max-width: 768px) and (min-height: 651px) {
    .cover-content,
    .story-content {
        width: min(470px, calc(100vw - 32px)) !important;
        max-width: min(470px, calc(100vw - 32px)) !important;
        height: clamp(470px, 61dvh, 525px);
        min-height: 0;
        max-height: min(95dvh, 560px) !important;
    }

    .slide-story .story-content {
        padding: 0;
        border-radius: 22px;
    }

    .slide-story .timeline,
    .slide-story.active .timeline {
        width: 100% !important;
        max-width: 100% !important;
        height: 100%;
        max-height: none !important;
        margin: 0;
        transform: scale(1) translateY(0);
    }
}

/* iPad / medium-tablet portrait: avoid a tall, phone-width opening card. */
@media (min-width: 600px) and (max-width: 1024px) and (min-height: 800px) and (orientation: portrait) {
    .modal-content {
        width: min(520px, calc(100vw - 72px));
        max-width: 520px;
        padding: 44px 42px 38px !important;
    }

    .modal-content::before { inset: 9px; }
    .modal-envelope {
        width: min(205px, 31vw);
        margin-bottom: 5px;
    }
    .modal-title {
        margin-bottom: 3px;
        white-space: nowrap;
        font-size: clamp(32px, 5.2vw, 38px) !important;
    }
    .modal-dear { margin-bottom: 5px; }
    .modal-message { line-height: 1.65; margin-bottom: 12px; }
    .modal-couple { margin-bottom: 5px; }
    .modal-date { margin-bottom: 20px; }

    body.km-active .modal-title {
        font-size: clamp(29px, 4.8vw, 36px) !important;
        line-height: 1.32;
    }
}

/* Height-aware desktop/laptop layout. Keep every public slide usable at
   100% browser zoom on short 13-inch screens without scaling the whole page. */
@media (min-width: 769px) and (max-height: 900px) {
    .modal-overlay {
        padding: max(8px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
        box-sizing: border-box;
    }
    .modal-content {
        width: min(90%, 410px);
        max-height: calc(100dvh - 16px);
        box-sizing: border-box;
        padding: clamp(18px, 3dvh, 28px) 38px;
    }
    .modal-envelope { width: clamp(145px, 24dvh, 195px); margin-bottom: 2px; }
    .modal-title { font-size: clamp(30px, 5dvh, 38px); margin-bottom: 2px; }
    .modal-dear { font-size: clamp(15px, 2.4dvh, 18px); margin-bottom: 4px; }
    .guest-name { font-size: clamp(22px, 3.8dvh, 28px); }
    .modal-message { font-size: clamp(14px, 2.3dvh, 17px); line-height: 1.55; margin-bottom: 8px; }
    .modal-couple { font-size: clamp(31px, 5.2dvh, 39px); margin-bottom: 4px; }
    .modal-date { font-size: clamp(13px, 2.2dvh, 16px); margin-bottom: 12px; }
    body.km-active .modal-date { font-size: clamp(12px, 2dvh, 15px); line-height: 1.4; }
    .modal-close-btn { padding-top: 9px; padding-bottom: 9px; }

    .slide-story,
    .slide-details,
    .slide-rsvp {
        padding-top: clamp(8px, 1.4dvh, 14px);
        padding-bottom: clamp(8px, 1.4dvh, 14px);
    }

    .cover-content {
        max-height: calc(100dvh - 34px);
        padding: clamp(18px, 3dvh, 28px) 24px;
    }
    .couple-logo { width: clamp(140px, 19dvh, 175px); margin-bottom: 5px; }
    .cover-content .pre-text { margin-bottom: 5px; }
    .cover-content h1 { font-size: clamp(42px, 7dvh, 58px); margin: 1px 0 4px; }
    body.km-active .cover-content h1 { font-size: clamp(34px, 5.5dvh, 46px); }
    .cover-content .ampersand { margin-top: 0; margin-bottom: 0; }
    .cover-content .wedding-date { margin-top: 1px; }
    .cover-content .wedding-date::before { height: 22px; margin-bottom: 2px; }

    .story-content {
        width: min(92%, 980px);
        max-height: calc(100dvh - 28px);
    }
    .timeline-item { padding-top: clamp(5px, .8dvh, 8px); padding-bottom: clamp(5px, .8dvh, 8px); }
    .slide-story .card-title { font-size: clamp(22px, 4dvh, 34px); }
    body.km-active .slide-story .card-title { font-size: clamp(20px, 3.4dvh, 30px); }
    .slide-story .card-date,
    .slide-story .card-time,
    .slide-story .card-venue { line-height: 1.35; }
    .story-map-link { padding-top: 7px; padding-bottom: 7px; }
    .story-content::before { width: clamp(78px, 8vw, 112px); }
    .story-content::after { width: clamp(72px, 7.5vw, 106px); }

    .details-content { max-height: calc(100dvh - 24px); }
    .details-content .section-title { font-size: clamp(34px, 6dvh, 48px); }
    body.km-active .details-content .section-title { font-size: clamp(22px, 4dvh, 31px) !important; }
    .details-grid { margin-top: 5px; gap: clamp(10px, 1.5vw, 22px); }
    .detail-card { padding-top: clamp(10px, 1.5dvh, 17px); padding-bottom: clamp(10px, 1.5dvh, 17px); }
    .detail-card h3 { font-size: clamp(20px, 3.2dvh, 27px); margin-bottom: 7px; }
    .agenda-list { margin-top: 5px; padding-top: 5px; }
    .agenda-item { padding-top: 6px; padding-bottom: 6px; }
    .countdown-wrap { margin-top: clamp(6px, 1.6dvh, 14px); }
    .countdown { gap: clamp(8px, 2vw, 18px); }
    .countdown-item .number { font-size: clamp(22px, 4dvh, 34px); }
    .countdown-sep { height: clamp(24px, 4dvh, 40px); }
    .countdown-item .label { font-size: clamp(7px, 1.2dvh, 9px); margin-top: 2px; }
    .countdown-msg { font-size: clamp(14px, 2.6dvh, 22px); margin-top: 2px; }
    .detail-corner { width: clamp(82px, 9vw, 112px); }

    .rsvp-content { max-height: calc(100dvh - 24px); }
    .rsvp-couple-decoration { height: clamp(62px, 9dvh, 82px); margin-bottom: 0; }
    .rsvp-content .section-title { font-size: clamp(34px, 5.5dvh, 46px); margin-bottom: 2px; }
    body.km-active .rsvp-content > .section-title { font-size: clamp(22px, 3.7dvh, 30px) !important; }
    .rsvp-contact-section { margin-top: 4px; }
    .rsvp-section-title { font-size: clamp(17px, 2.7dvh, 22px); margin-bottom: 4px; }
    .rsvp-contact-info { margin: 2px 0; font-size: clamp(12px, 2dvh, 15px); }
    .rsvp-bank-section { margin-top: 10px; }
    .bank-cards { margin-top: 4px; gap: 12px; }
    .bank-card { padding: 0; min-height: 0; }
    .bank-card {
        width: 170px;
        min-width: 170px;
        max-width: 170px;
    }
    .bank-card-details { padding: 8px 12px 7px; }
    .bank-card-name { font-size: 15px; }
    .bank-card-account { font-size: 11px; margin-bottom: 3px; }
    .bank-card-number { font-size: 13px; margin-bottom: 6px; }
    .bank-card-qr-panel { width: 170px; height: 170px; margin: 7px auto; }
    .bank-transfer-btn { width: 170px; padding: 7px 16px; font-size: 11px; }
    .rsvp-gift-message { margin-top: 9px; font-size: clamp(11px, 1.8dvh, 14px); line-height: 1.45; }
    .rsvp-bottom-divider { height: 20px; margin-top: 4px; }

    .thankyou-content { max-height: calc(100dvh - 24px); padding-top: 12px; padding-bottom: 12px; }
    .thankyou-content .heart { width: clamp(64px, 11dvh, 88px); height: clamp(64px, 11dvh, 88px); margin-bottom: 4px; }
    .thankyou-content h2 { font-size: clamp(34px, 6dvh, 48px); margin-bottom: 5px; }
    body.km-active .thankyou-content h2 { font-size: clamp(22px, 4dvh, 31px) !important; }
    .thankyou-content p { font-size: clamp(12px, 2.15dvh, 17px); line-height: 1.5; margin-bottom: 4px; }
    .thankyou-content .couple-names { font-size: clamp(22px, 4.2dvh, 32px); margin-top: 9px; }
    .thankyou-content .hashtag { margin-top: 8px; padding-top: 6px; padding-bottom: 6px; }
}

@media (min-width: 769px) and (max-height: 750px) {
    .modal-content { max-height: calc(100dvh - 12px); padding: 17px 24px 19px; }
    .modal-content::before { inset: 7px; }
    .modal-envelope { width: clamp(158px, 28dvh, 176px); margin-bottom: 2px; }
    .modal-title { font-size: 34px; line-height: 1.08; margin-bottom: 2px; }
    .modal-dear { font-size: 16px; margin-bottom: 3px; }
    .guest-name { font-size: 25px; }
    .modal-message { font-size: 15px; line-height: 1.5; margin-bottom: 7px; }
    .modal-couple { font-size: 34px; line-height: 1.05; margin-bottom: 3px; }
    .modal-date { font-size: 13px; line-height: 1.35; margin-bottom: 9px; }
    body.km-active .modal-title { font-size: 31px !important; line-height: 1.3; }
    body.km-active .modal-dear { font-size: 15px; }
    body.km-active .guest-name { font-size: 23px !important; }
    body.km-active .modal-message { font-size: 14px; line-height: 1.5; }
    body.km-active .modal-couple { font-size: 31px !important; }
    body.km-active .modal-date { font-size: 12px; line-height: 1.4; }
    .modal-close-btn,
    body.km-active .modal-close-btn { padding: 8px 16px; min-width: 145px; }

    .cover-content { max-height: calc(100dvh - 22px); padding-top: 14px; padding-bottom: 14px; }
    .couple-logo { width: 132px; margin: 3px auto 4px; }
    body.km-active .couple-logo { width: 128px; margin: 3px auto 3px; }
    body:not(.km-active) .cover-content .pre-text {
        font-size: clamp(13px, 2.25dvh, 15px);
        letter-spacing: clamp(2px, .3vw, 4px);
    }
    body:not(.km-active) .cover-content .wedding-date {
        font-size: clamp(13px, 2.2dvh, 15px);
        letter-spacing: clamp(1.5px, .25vw, 3px);
    }
    .cover-content h1 { font-size: 40px; }
    body.km-active .cover-content h1 { font-size: 35px; }
    body.km-active .cover-content .pre-text {
        font-size: clamp(27px, 4.25dvh, 30px);
        line-height: 1.35;
        letter-spacing: .01em;
        margin-bottom: 3px;
    }
    body.km-active .cover-content .ampersand { font-size: 20px; margin: 0 auto 2px; }
    body.km-active .cover-content .wedding-date {
        font-size: 12px;
        line-height: 1.35;
        padding-bottom: 10px;
    }
    .cover-content .wedding-date { padding-bottom: 9px; }

    .story-content { max-height: calc(100dvh - 18px); }
    .timeline-item { padding-top: 3px; padding-bottom: 3px; }
    .slide-story .card-title { font-size: 22px; }
    .slide-story .card-date,
    .slide-story .card-time,
    .slide-story .card-venue,
    .slide-story .invite-text { font-size: 12px; }

    .detail-card { padding-top: 8px; padding-bottom: 8px; }
    .agenda-item { padding-top: 4px; padding-bottom: 4px; }
    .countdown-wrap { margin-top: 5px; }
    .countdown { gap: 8px; }

    .rsvp-couple-decoration { height: 54px; }
    .rsvp-content .section-title { font-size: 32px; }
    .bank-card-qr-panel { width: 170px; height: 170px; }
    .bank-card {
        width: 170px;
        min-width: 170px;
        max-width: 170px;
        padding-top: 0;
        padding-bottom: 0;
    }
    .rsvp-gift-message { font-size: 11px; margin-top: 6px; }
    .rsvp-bottom-divider { height: 16px; margin-top: 2px; }

    .thankyou-content {
        width: min(620px, calc(100% - 40px));
        padding: 20px 34px;
    }
    .thankyou-content .heart { width: 88px; height: 88px; margin-bottom: 5px; }
    .thankyou-content h2 { font-size: 40px; }
    body.km-active .thankyou-content h2 { font-size: 29px !important; }
    .thankyou-content p { font-size: 14px; line-height: 1.5; }
    .thankyou-content .couple-names { font-size: 29px; }
}

/* Content-sized phone cards: avoid the large empty area Safari creates when
   percentage heights are resolved against the full slide. */
@media (max-width: 480px) {
    .slide-story .story-content,
    .slide-story .timeline,
    .slide-story.active .timeline {
        height: auto !important;
        min-height: 0 !important;
    }

    .slide-story .story-content {
        width: 90% !important;
        max-width: 410px !important;
        height: clamp(500px, 72dvh, 620px) !important;
        max-height: calc(100dvh - 112px) !important;
        border-radius: 20px !important;
    }

    .slide-story .timeline,
    .slide-story.active .timeline {
        height: 100% !important;
        border-radius: 14px !important;
        align-content: center;
        box-sizing: border-box;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .slide-story .timeline,
    .slide-story.active .timeline {
        max-height: none !important;
        overflow: visible !important;
        margin: 0 auto !important;
    }

    .slide-story .timeline-item { padding: 4px 7px !important; }
    .slide-story .ceremony-block { padding-top: 14px !important; }
    .slide-story .details-block { padding-left: 12px !important; padding-right: 12px !important; }
    .slide-story .couple-block { padding-top: 3px !important; padding-bottom: 3px !important; }
    .slide-story .venue-block { padding: 5px 12px 18px !important; }
    .slide-story .card-invite { margin-bottom: 3px; }
    .slide-story .card-text { font-size: 11px !important; line-height: 1.55; }
    .slide-story .card-time,
    .slide-story .card-venue { line-height: 1.45; }

    .slide-details .detail-card-shell {
        height: clamp(300px, 60dvh, 420px) !important;
        align-self: stretch !important;
        display: flex !important;
        align-items: stretch !important;
        border-radius: 22px !important;
    }

    .slide-details .detail-card-shell .detail-card {
        height: 100% !important;
        min-height: 0 !important;
        position: relative;
        z-index: 1;
    }

    /* Float the top-left flower out over the card's corner (up + left) so it
       reads as a decorative corner accent and does not sit on the title/date
       text. The flower image is 2:3 portrait; background-position:left top keeps
       the art anchored to the box's top-left so it stays at the corner. Offsets
       stay within the grid's safe clip zone (>=18px padding-top, >=26px
       padding-left) so they add no extra scroll space. */
    .slide-details .detail-corner-top-left {
        top: -12px !important;
        left: -6px !important;
        width: clamp(96px, 27vw, 116px) !important;
        background-position: left top !important;
        z-index: 30 !important;
    }

    .slide-details .detail-corner-bottom-right {
        right: -10px !important;
        bottom: 3px !important;
    }
}

/* ==================== FIT GUARD (desktop + tablet) ====================
   The invitation modal title and the cover pre-text use white-space:nowrap
   inside fixed ~410px cards. The earlier rules let them grow to 29-42px,
   which overflows the card and gets clipped (phones stay small so mobile
   looked fine). Cap them at measured one-line sizes so nothing is cut off.
   These high-specificity rules come last, so they win over the tablet/
   mobile/height-aware blocks above, which are left untouched.
   - Khmer title "សូមគោរពអញ្ជើញ" fits at 26px = 300px < 310px box
     (clips at 29-42px), so cap it on all non-phone widths (>=481px).
   - English title "You Are Invited" fits at every existing size, so it is
     left unchanged.
   - English pre-text "WE ARE GETTING MARRIED" fits at 15px + 5px tracking =
     257px < 274px box (the tightest desktop box, at 851-900h where cover
     width shrinks to 370px). Clips at the 22px + 8px base (450px) on tall
     desktops and at 15px + 4px (275px) on the 274px box. */
@media (min-width: 481px) {
    body.km-active .modal-title {
        font-size: 26px !important;
        line-height: 1.3;
    }
}
@media (min-width: 769px) {
    body:not(.km-active) .cover-content .pre-text {
        font-size: 15px !important;
        letter-spacing: 5px !important;
    }
}
