/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
    --maroon:  #800020;
    --gold:    #D4AF37;
    --cream:   #F8F1E5;
    --pink-bg: #F3E5E5;
    --royal-maroon: #6B0F1A;
    --deep-maroon: #4A0C14;
    --stage-maroon: #6B1E2A;
    --stage-wine: #641622;
    --stage-deep: #5A101A;
    --wine-red: #7D1E2E;
    --dusty-rose: #B4515D;
    --champagne: #F4E7D6;
    --antique-gold: #C79A3E;
    /* Envelope video bg — matches the edges of the animation artwork */
    --env-bg:  #e8c99a;
}

/* ─── BODY ───────────────────────────────────────────────── */
body {
    font-family: 'Playfair Display', serif;
    background-color: var(--deep-maroon); /* Dark background prevents white blinking gaps */
    color: var(--maroon);
    overscroll-behavior-y: none;
}

body.locked { overflow: hidden; }

/* ─── AUDIO BUTTON ───────────────────────────────────────── */
#audio-controller {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
}
#music-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(248,241,229,0.88);
    border: 1.5px solid var(--gold);
    color: var(--maroon);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 18px rgba(0,0,0,0.12);
    backdrop-filter: blur(6px);
    transition: background 0.3s, color 0.3s;
}
#music-btn:hover { background: var(--gold); color: var(--cream); }

/* ═══════════════════════════════════════════════════════════
   HERO SECTION — Frame 1 + Frame 2 share 100vw × 100vh
   ═══════════════════════════════════════════════════════════ */
#hero {
    position: relative;
    z-index: 2;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    /* Black fallback — any bleed-through is invisible against mandapam edges */
    background-color: #000;
    margin: 0;
    padding: 0;
}

/* Feather only the lower Mandapam edge into the gallery's stage maroon. */
#layer-mandapam::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 180px;
    background: linear-gradient(180deg,
        rgba(107, 30, 42, 0) 0%,
        rgba(107, 30, 42, 0.40) 55%,
        var(--stage-maroon) 100%);
    pointer-events: none;
    z-index: 6;
}

/* Every child layer absolutely covers the hero */
#hero > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ── FRAME 2 LAYER: Mandapam ──────────────────────────────── */
#layer-mandapam {
    z-index: 1;
    overflow: hidden; /* prevent any scale/blur bleed at edges */
    background-color: #000; /* fallback so no orange shows during transition */
}

/* Base mandapam background — always full viewport */
#mandapam-bg {
    position: absolute !important;
    inset: 0;
    background-image: url('Public/2nd scene mandapam.jpeg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    filter: blur(14px) brightness(1.1) contrast(1.06) saturate(1.05);
    z-index: 1;
    /* No scale transform — scaling can expose edges */
    transition:
        opacity   1.4s 0.0s cubic-bezier(0.25,1,0.5,1),
        filter    1.4s 0.0s cubic-bezier(0.25,1,0.5,1);
}

/* Stagger layers share same image but animate at different speeds */
.reveal-layer {
    position: absolute !important;
    inset: 0;
    background-image: url('Public/2nd scene mandapam.jpeg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 2;
    transition: opacity 1.2s ease, filter 1.2s ease;
}

#reveal-glow {
    filter: brightness(1.4) contrast(1.08) blur(6px);
}
#reveal-flowers {
    filter: brightness(1.15) contrast(1.06) blur(2px);
}
#reveal-pillars {
    filter: brightness(1.1) contrast(1.08) blur(0px);
}

/* When .bloom is added to #layer-mandapam, all layers animate in */
#layer-mandapam.bloom #mandapam-bg {
    opacity: 1;
    filter: blur(0px) brightness(1.1) contrast(1.06) saturate(1.05);
    /* No transform change needed — scale removed */
}
#layer-mandapam.bloom .reveal-layer {
    opacity: 1;
}
/* Stagger each reveal layer's transition-delay through inline style */

/* ── FRAME 2 TYPOGRAPHY ────────────────────────────────────── */
#frame2-text {
    position: absolute !important;
    /* Centered in viewport — not at bottom */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(18px);
    width: 90%;
    max-width: 600px;
    text-align: center;
    z-index: 5;

    /* Subtle halo scrim for legibility over mandapam */
    background: radial-gradient(ellipse at center,
        rgba(248,241,229,0.55) 0%,
        rgba(248,241,229,0.30) 55%,
        transparent 100%
    );
    padding: 2.8rem 3rem;
    opacity: 0;
    transition: opacity 1.4s ease 1.1s, transform 1.4s ease 1.1s;
}
#layer-mandapam.bloom #frame2-text {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
}

/* ── FRAME 3 UMBRELLAS ─────────────────────────────────────── */
.corner-umbrella {
    position: absolute;
    width: min(35vw, 250px); /* Slightly smaller to match reference */
    height: auto;
    z-index: 6;
    opacity: 0;
    
    /* Lighten mode hides the background if it's darker than the page, keeping the true gold color */
    mix-blend-mode: lighten;
    transition: opacity 1.2s ease 0.5s, transform 1.2s ease 0.5s;
    
    /* Crop out the golden lines on the left and bottom of the source image */
    clip-path: inset(0 0 18% 18%);
    
    /* Slight brightness reduction ensures the image background stays hidden beneath the page background */
    filter: brightness(0.85) contrast(1.15);
}
.umbrella-left {
    left: calc(min(35vw, 250px) * -0.18);
    bottom: -15px; /* Lifted slightly above the corner */
    transform: translateY(30px);
}
.umbrella-right {
    right: calc(min(35vw, 250px) * -0.18);
    bottom: -15px; /* Lifted slightly above the corner */
    transform: scaleX(-1) translateY(30px);
}

.frame-3.is-visible .umbrella-left {
    opacity: 1;
    transform: translateY(0);
}
.frame-3.is-visible .umbrella-right {
    opacity: 1;
    transform: scaleX(-1) translateY(0);
}

.murugan {
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    letter-spacing: 3.5px;
    color: var(--maroon);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(248,241,229,0.9);
}

.names {
    font-family: 'Cinzel', serif;
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--maroon);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    text-shadow: 0 1px 12px rgba(248,241,229,0.95), 0 0 30px rgba(248,241,229,0.7);
    margin-bottom: 0.5rem;
}

.ampersand {
    font-family: 'Great Vibes', cursive;
    color: var(--gold);
    font-size: 3rem;
    text-transform: none;
    line-height: 1.1;
    display: inline-block;
}

.invite-tagline {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--maroon);
    font-style: italic;
    line-height: 1.9;
    text-shadow: 0 0 20px rgba(248,241,229,0.95);
}

/* ── FRAME 1 LAYER: Envelope ────────────────────────────────── */
#layer-envelope {
    /* Fixed to viewport — completely independent of any parent container */
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100;
    background-color: #000;
    margin: 0;
    padding: 0;
    border: 0;
    transition: opacity 1.2s ease 0.15s, transform 1.6s ease;
}

#layer-envelope.fade-out {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

#envelope-vid {
    /* Fixed to viewport — bypasses all container constraints */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    object-fit: cover !important;
    object-position: center center !important;
    z-index: 100;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    max-width: none !important;
    display: block;
    background: #000;
}

/* ═══════════════════════════════════════════════════════════
   REGULAR FRAMES (3–6)
   ═══════════════════════════════════════════════════════════ */
.frame {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* scroll-reveal defaults */
.frame .joy-text,
.frame .gallery-wrapper,
.frame .portrait-wrap,
.frame .elephant-wrap,
.frame .event-item,
.frame .couple-video-wrap,
.frame .save-the-date {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1s ease, transform 1s ease;
}

.frame.is-visible .joy-text,
.frame.is-visible .gallery-wrapper,
.frame.is-visible .portrait-wrap,
.frame.is-visible .elephant-wrap,
.frame.is-visible .couple-video-wrap {
    opacity: 1;
    transform: translateY(0);
}

.frame.is-visible .event-item { opacity: 1; transform: translateY(0); }
.frame.is-visible .save-the-date { opacity: 1; transform: translateY(0); transition-delay: 0.8s; }

/* ── Frame 3 ─────────────────────────────────────────────── */
.frame-3 {
    /* Removed solid background-color so the negative margin area is transparent 
       and perfectly reveals the feathered mandapam edge underneath. */
    background-color: transparent;
    background-image:
        radial-gradient(ellipse at 50% 34%, rgba(201, 164, 92, 0.11) 0%, transparent 33%),
        radial-gradient(circle at 18% 72%, rgba(245, 232, 208, 0.045) 0 1px, transparent 2px),
        radial-gradient(circle at 74% 21%, rgba(245, 232, 208, 0.04) 0 1px, transparent 2px),
        linear-gradient(180deg,
        transparent 0%,
        var(--stage-maroon) 180px,
        #6B1624 calc(180px + 15%),
        #5A0F1B 66%,
        var(--deep-maroon) 100%);
    /* Overlap the Mandapam's feathered edge; content stays below the fade. */
    margin-top: -180px;
    padding: calc(5rem + 180px) 2rem 5rem;
    gap: 1.5rem;
    z-index: 1;
}

/* Minimal gold mandala linework, placed only at the outer sides. */
.frame-3::before,
.frame-3::after {
    content: "";
    position: absolute;
    top: 56%;
    width: 156px;
    height: 156px;
    border: 1px solid rgba(201, 164, 92, 0.20);
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 0 28%, rgba(201, 164, 92, 0.15) 28.5% 29.5%, transparent 30% 45%, rgba(201, 164, 92, 0.12) 45.5% 46.5%, transparent 47%),
        repeating-conic-gradient(from 0deg, rgba(201, 164, 92, 0.13) 0 1deg, transparent 1deg 30deg);
    opacity: 0.55;
    pointer-events: none;
    z-index: 1;
}
.frame-3::before { left: -84px; }
.frame-3::after { right: -84px; }

.gold-divider {
    width: 100%;
    height: 50px;
    margin: 0.5rem 0 0.6rem 0;
    display: block;
    position: relative;
    z-index: 15;
    overflow: visible;
}
.gold-divider svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.joy-text {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    font-weight: 600;
    text-align: center;
    color: var(--champagne);
    max-width: 80%;
    line-height: 1.6;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(74, 12, 20, 0.45);
    z-index: 15;
}

.gallery-wrapper {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 15;
}

/* Symmetrical Hanging Brass Lotus Diyas */
.diya-column {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 12;
    display: flex;
    pointer-events: none;
}
.diya-left {
    left: 8%;
    gap: 36px;
}
.diya-right {
    right: 8%;
    gap: 36px;
    flex-direction: row-reverse;
}
.diya-wrap {
    width: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    pointer-events: none;
}
.diya-chain {
    width: 3px;
    flex-grow: 1;
    /* Dotted brass/gold beaded chain styling */
    background-image: radial-gradient(circle, #E5C158 1px, #9E782F 1.5px, transparent 2px);
    background-size: 3px 9px;
    background-repeat: repeat-y;
}
.diya-svg {
    width: 100%;
    height: 48px;
    display: block;
    margin-top: -1px;
    overflow: visible;
}

/* Vertical Height Variations for Symmetrical Framing */
.diya-long {
    height: 440px;
}
.diya-medium {
    height: 320px;
    opacity: 0.9;
}
.diya-short {
    height: 200px;
    opacity: 0.8;
}

/* Warm natural flickering flame animation */
@keyframes diyaFlicker {
    0%, 100% { transform: scale(1) rotate(-0.5deg); opacity: 0.95; }
    20% { transform: scale(1.05) rotate(0.5deg); opacity: 1; }
    40% { transform: scale(0.97) rotate(-1deg); opacity: 0.9; }
    60% { transform: scale(1.07) rotate(1deg); opacity: 1; }
    80% { transform: scale(0.95) rotate(-0.5deg); opacity: 0.85; }
}
.diya-flame {
    animation: diyaFlicker 2.5s infinite ease-in-out;
    transform-origin: 30px 34px;
}

/* Rose petals remain entirely behind the couple gallery and controls. */
.gallery-petals {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}
.gallery-petal {
    position: absolute;
    top: -8%;
    left: var(--x);
    width: var(--size);
    height: var(--petal-height);
    border-radius: 58% 42% 64% 36% / 42% 56% 44% 58%;
    clip-path: polygon(0% 56%, 10% 31%, 34% 8%, 63% 2%, 88% 18%, 100% 44%, 91% 64%, 62% 87%, 28% 100%, 7% 79%);
    opacity: var(--opacity);
    filter: blur(var(--blur, 0px));
    background:
        radial-gradient(ellipse at 27% 35%, rgba(255, 183, 168, 0.76) 0 9%, transparent 25%),
        linear-gradient(138deg, #E56A63 0%, #C33745 43%, #8D1729 77%, #59101C 100%);
    box-shadow: 0 2px 5px rgba(30, 3, 7, 0.42);
    animation: gallery-petal-drift var(--duration) var(--delay) cubic-bezier(.35,.05,.68,.94) infinite;
}
.gallery-petal::after {
    content: "";
    position: absolute;
    inset: 10% 20% 18% 26%;
    border-radius: 52% 48% 44% 56%;
    background: linear-gradient(104deg, rgba(255, 208, 192, 0.38), rgba(255, 208, 192, 0) 58%);
    transform: rotate(-14deg);
    pointer-events: none;
}
.petal-shape-1 {
    border-radius: 34% 66% 44% 56% / 64% 38% 62% 36%;
    clip-path: polygon(0% 45%, 13% 18%, 43% 0%, 75% 9%, 96% 32%, 93% 58%, 72% 82%, 35% 100%, 9% 77%);
}
.petal-shape-2 {
    border-radius: 72% 28% 54% 46% / 44% 66% 34% 56%;
    clip-path: polygon(2% 64%, 10% 33%, 31% 9%, 62% 0%, 92% 19%, 100% 47%, 79% 75%, 43% 98%, 16% 84%);
}
.petal-shape-3 {
    border-radius: 42% 58% 28% 72% / 60% 34% 66% 40%;
    clip-path: polygon(0% 48%, 19% 17%, 49% 3%, 78% 15%, 100% 42%, 86% 70%, 57% 94%, 23% 100%, 5% 72%);
}
@keyframes gallery-petal-drift {
    0% { transform: translate3d(0, -10vh, 0) rotate(0deg); }
    35% { transform: translate3d(var(--drift-mid), 29vh, 0) rotate(120deg); }
    70% { transform: translate3d(var(--drift-return), 66vh, 0) rotate(300deg); }
    100% { transform: translate3d(var(--drift), 116vh, 0) rotate(var(--turn)); }
}

/* Keep the stage-colour background uninterrupted behind the existing frame. */
.gallery-wrapper::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 140%;
    background: transparent;
    z-index: -1;
    pointer-events: none;
}

/* Arrows are positioned relative to .gallery-wrapper, fully visible */
.carousel-arrow {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(244, 231, 214, 0.97);
    border: 1.5px solid var(--antique-gold);
    color: var(--royal-maroon);
    font-size: 1.7rem;
    font-weight: 300;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(128, 0, 32, 0.18);
}

.carousel-arrow:hover {
    background: var(--maroon);
    color: var(--cream);
    border-color: var(--maroon);
}

/* Push arrows outside the frame on each side */
.carousel-arrow.prev { left: -24px; }
.carousel-arrow.next { right: -24px; }

/* The frame container — natural sizing, no clipping */
.frame-container {
    position: relative;
    width: 100%;
    aspect-ratio: 0.72;
    border-radius: 0;
    /* Maroon bg matches frame outer colour — no visible bleed */
    background-color: transparent;
    box-shadow: 0 20px 50px rgba(80, 0, 16, 0.35);
}

/* Thin metallic-gold rectangular border offset around the frame container */
.frame-container::before {
    content: "";
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 1px dashed rgba(198, 154, 75, 0.65); /* Using a fine dashed/solid line blend */
    border-style: solid;
    border-width: 1px;
    box-shadow: 0 0 1px rgba(198, 154, 75, 0.3);
    pointer-events: none;
    z-index: 11;
}

/* ── CAROUSEL: Photo behind frame, clipped to arch shape ── */
.carousel-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 5; /* Sits behind the frame border layer */
    cursor: grab;
    background-color: transparent;
}

.carousel-viewport:active { cursor: grabbing; }

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

/*
   The image is sized to the arch opening and the viewport performs the final
   arch-shaped crop. This leaves no background visible within the opening.
*/
.carousel-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--photo-position, center);
    display: block;
}

/* Fill any space around a differently proportioned photo cleanly. */
.carousel-slide {
    background: transparent;
}

/* Gold decorative frame — ON TOP.
   Cuts out the cream inner area using clip-path, leaving the border 100% solid. */
.gold-frame-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: 10; /* Render on top of the couple images */
    pointer-events: none;
    clip-path: url(#frame-outer-only); /* Cuts the center arch opening out cleanly */
}

/* Dots indicator */
.carousel-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 0.5rem;
}

.carousel-dots .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(128, 0, 32, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dots .dot.active {
    background: var(--maroon);
    transform: scale(1.25);
}

/* ── Frame 4 ─────────────────────────────────────────────── */
.frame-4 {
    min-height: 100vh;
    padding: 4rem 2rem 2rem;
    justify-content: space-between;
    margin-top: -2px; /* Prevent any sub-pixel white gaps between sections */
    position: relative;
    z-index: 2;
    background:
        radial-gradient(circle at 50% 25%, rgba(201,164,92,.10), transparent 22%),
        radial-gradient(circle at 12% 70%, rgba(245,232,208,.035) 0 1px, transparent 2px),
        /* Smooth, diffused gradient transition: starts with the exact deep burgundy from frame-3, blending softly into the pinkish-maroon over a wide area */
        linear-gradient(180deg, var(--deep-maroon) 0%, #6B1624 30%, #5A0F1B 66%, var(--deep-maroon) 100%);
    overflow: hidden;
}
.procession-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.corner-motif {
    position: absolute;
    width: 82px;
    height: 69px;
    opacity: 1;
    background: url('Public/reference images/corner-border-reference-gold.png') center / contain no-repeat;
    filter: drop-shadow(0 0 2px rgba(245,232,208,.14));
    z-index: 1;
}
.corner-tl { top: 0; left: 0; transform: scaleY(-1); }
.corner-tr { top: 0; right: 0; transform: scale(-1); }
.corner-bl { bottom: 0; left: 0; }
.corner-br { bottom: 0; right: 0; transform: scaleX(-1); }
.side-chains { position:absolute; inset:0; z-index:3; pointer-events:none; }
.side-chain {
    position:absolute;
    top:34px;
    width:44px;
    height:min(570px,82vh);
    color:#D8AB47;
    filter:drop-shadow(0 0 3px rgba(245,210,113,.42));
    opacity:.98;
}
.chain-left { left:-16px; top:69px; }
.chain-right { right:-16px; top:69px; transform:scaleX(-1); }
.procession-lamp {
    position: absolute;
    top: 18px;
    width: 104px;
    height: 250px;
    opacity: 0;
    transition: opacity 1s ease .25s;
    isolation: isolate;
    z-index: 2;
}
.procession-lamp::before {
    content: "";
    position: absolute;
    inset: -18px -52px -14px;
    z-index: 0;
    pointer-events: none;
    opacity: .70;
    border-radius: 50%;
    background: radial-gradient(ellipse at 50% 53%, rgba(255,230,145,.48) 0%, rgba(236,188,75,.28) 33%, rgba(210,143,35,.13) 58%, transparent 78%);
    filter: blur(11px);
    box-shadow: 0 0 26px 7px rgba(226,172,57,.15);
    animation: lamp-soft-glow 3.8s ease-in-out infinite;
}
.procession-lamp::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: url('Public/reference images/kuthu-vilakku-gold.png') center / contain no-repeat;
}
@keyframes lamp-soft-glow {
    0%, 100% { opacity: .54; transform: scale(.95); }
    50% { opacity: .82; transform: scale(1.05); }
}
.lamp-one { left: 7%; }.lamp-two { right: 7%; }
.vinayagar-mark { width:118px; color:#D7AA46; opacity:1; z-index:2; margin: 0 auto 0.5rem; display: block; mix-blend-mode: screen; }
.vinayagar-mark img { width: 100%; display: block; mix-blend-mode: screen; filter: grayscale(1) sepia(1) hue-rotate(-5deg) saturate(2.5) brightness(1.1); }
.procession-divider { width:min(550px,88vw); height:auto; position:relative; z-index:2; opacity:0; transition:opacity .8s ease .7s; margin: 0.5rem auto 0; text-align: center; }
.procession-divider::before, .procession-divider::after { display: none; }
.procession-divider span { display: none; }
.frame-4.is-visible .vinayagar-mark, .frame-4.is-visible .procession-divider { opacity:1; }
.elephant-wrap {
    position: relative;
    z-index: 1;
    width: calc(100% + 4rem);
    margin-left: -2rem;
    max-width: 100vw;
    align-self: center;
    opacity: 1;
    mix-blend-mode: screen; /* Applied to the wrapper to composite properly with the frame background */
    overflow: hidden;
    /* Removed will-change: transform to prevent browsers from downscaling this layer into a blurry texture! */
}
.frame-4.is-visible .elephant-wrap {
    opacity: 1;
}
.elephant-sequence-video {
    width: 100%;
    height: auto;
    display: block;
    opacity: 1;
}

/* ── Frame 5 ─────────────────────────────────────────────── */
.frame-5 {
    background-color: var(--cream);
    padding: 5rem 2rem;
}
.events-inner {
    width: 100%;
    max-width: 700px;
    text-align: center;
}
.events-heading {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    color: var(--maroon);
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}
.events-heading::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: var(--gold);
}
.event-item { margin-bottom: 2rem; }
.event-date {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
}
.event-name {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--maroon);
    margin-bottom: 0.4rem;
}
.event-time { font-size: 1rem; margin-bottom: 0.8rem; }
.event-venue { font-style: italic; line-height: 1.7; margin-bottom: 1.2rem; font-size: 0.95rem; }
.directions-btn {
    display: inline-block;
    padding: 9px 22px;
    border: 1.5px solid var(--gold);
    color: var(--maroon);
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    letter-spacing: 1.2px;
    transition: background 0.3s, color 0.3s;
}
.directions-btn:hover { background: var(--gold); color: var(--cream); }
.event-divider {
    width: 80px;
    height: 1px;
    background: var(--gold);
    margin: 2rem auto;
    opacity: 0.5;
}

/* ── Frame 6 ─────────────────────────────────────────────── */
.frame-6 {
    background-color: var(--pink-bg);
    padding: 3rem 2rem;
    gap: 2rem;
}
#petals-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}
.petal {
    position: absolute;
    width: 18px;
    height: 18px;
    background-image: url('Public/flower reference images/WhatsApp Image 2026-08-04 at 9.07.18 PM.jpeg');
    background-size: cover;
    border-radius: 50%;
    opacity: 0;
    animation: petalfall linear infinite;
}
.frame-6.is-visible .petal { opacity: 0.55; }
@keyframes petalfall {
    0%   { transform: translateY(-6vh) rotate(0deg); }
    100% { transform: translateY(108vh) rotate(380deg); }
}
.couple-video-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    height: 58vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.couple-animated-video { height: 100%; border-radius: 8px; }
.save-the-date { position: relative; z-index: 2; text-align: center; }
.save-the-date h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 3.4rem;
    color: var(--maroon);
    margin-bottom: 0.6rem;
}
.save-the-date p {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--gold);
    letter-spacing: 5px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .names { font-size: 1.7rem; }
    .events-heading { font-size: 2rem; }
    .event-name { font-size: 1.4rem; }
    .save-the-date h2 { font-size: 2.6rem; }
    #frame2-text { padding: 1.8rem 1.5rem; }
    
    /* Adjust diya sizes and positioning on tablet viewports */
    .diya-left { left: 2%; gap: 15px; }
    .diya-right { right: 2%; gap: 15px; }
    .diya-wrap { width: 36px; }
    .diya-long { height: 320px; }
    .diya-medium { height: 240px; }
    .diya-short { height: 160px; }
    .diya-svg { height: 36px; }
}

@media (max-width: 560px) {
    /* Hide diyas on small mobile screens to keep layout unobstructed */
    .diya-column { display: none; }
}
