@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,600&family=Montserrat:wght@400;500;600&family=Noto+Serif+Bengali:wght@500;700&display=swap');

:root {
    --royal-maroon: #240404;
    --gold-light: #fbe69b;
    --gold-primary: #d4af37;
    --gold-dark: #997415;
    --ivory: #fffdf9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    background-color: var(--royal-maroon);
    color: var(--ivory);
    font-family: 'Cormorant Garamond', serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

/* Hardware-Locked Background (Prevents First-Scroll URL Bar Jump) */
#rajbari-backdrop {
    position: fixed;
    top: -10vh;
    left: -5vw;
    width: 110vw;
    height: 120lvh;
    background-image: 
        radial-gradient(circle at center, rgba(36, 4, 4, 0.38) 0%, rgba(15, 2, 2, 0.76) 100%),
        url('assets/rajbari_bg.png');
    background-size: cover;
    background-position: center top;
    filter: blur(3.5px);
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    will-change: transform;
    z-index: 0;
    pointer-events: none;
}

/* 3 Eternal Flying Butterflies Across the Webpage */
.butterfly-stage {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 120;
    overflow: hidden;
}

.butterfly {
    position: absolute;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 8px rgba(251, 230, 155, 0.45));
    will-change: transform;
}

.b-wings {
    animation: wingFlap 0.28s infinite alternate ease-in-out;
}

@keyframes wingFlap {
    0% { transform: scaleX(1) rotateY(0deg); }
    100% { transform: scaleX(0.35) rotateY(55deg); }
}

.butterfly.b1 { left: -50px; top: 75vh; animation: flightPathOne 16s infinite linear; }
.butterfly.b2 { right: -50px; top: 22vh; animation: flightPathTwo 21s infinite linear 4s; }
.butterfly.b3 { left: -50px; top: 45vh; animation: flightPathThree 18s infinite linear 9s; }

@keyframes flightPathOne {
    0%   { transform: translate3d(0, 0, 0) rotate(35deg); }
    25%  { transform: translate3d(32vw, -18vh, 0) rotate(20deg); }
    50%  { transform: translate3d(62vw, -12vh, 0) rotate(45deg); }
    75%  { transform: translate3d(90vw, -38vh, 0) rotate(25deg); }
    100% { transform: translate3d(125vw, -55vh, 0) rotate(35deg); }
}

@keyframes flightPathTwo {
    0%   { transform: translate3d(0, 0, 0) rotate(-135deg); }
    30%  { transform: translate3d(-35vw, 15vh, 0) rotate(-115deg); }
    65%  { transform: translate3d(-75vw, 8vh, 0) rotate(-145deg); }
    100% { transform: translate3d(-125vw, 35vh, 0) rotate(-130deg); }
}

@keyframes flightPathThree {
    0%   { transform: translate3d(0, 0, 0) rotate(55deg); }
    35%  { transform: translate3d(40vw, 14vh, 0) rotate(75deg); }
    70%  { transform: translate3d(80vw, -8vh, 0) rotate(40deg); }
    100% { transform: translate3d(125vw, 6vh, 0) rotate(60deg); }
}

/* 4-Sided Subtle Self-Color Mantra Border */
.mantra-border-frame {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
    overflow: hidden;
}

.mantra-edge {
    position: absolute;
    font-family: 'Noto Serif Bengali', serif;
    font-size: 0.72rem;
    color: rgba(212, 175, 55, 0.22);
    letter-spacing: 3px;
    white-space: nowrap;
    user-select: none;
}

.mantra-edge.top { top: 5px; left: 0; width: 100%; text-align: center; }
.mantra-edge.bottom { bottom: 5px; left: 0; width: 100%; text-align: center; }
.mantra-edge.left { top: 50%; left: 6px; transform: translate(-50%, -50%) rotate(-90deg); }
.mantra-edge.right { top: 50%; right: 6px; transform: translate(50%, -50%) rotate(90deg); }

/* Floating Audio Button */
#audio-toggle {
    position: fixed;
    top: 22px;
    right: 20px;
    z-index: 1800;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(28, 4, 4, 0.85);
    border: 1.5px solid var(--gold-primary);
    color: var(--gold-light);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.7);
}

#audio-toggle.hidden { display: none; }

/* Tap Overlay */
#tap-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(24,3,3,0.72) 0%, rgba(8,1,1,0.92) 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    transition: opacity 0.9s ease;
}

.tap-box {
    border: 2px solid var(--gold-primary);
    padding: 38px 26px;
    border-radius: 170px 170px 24px 24px;
    background: rgba(22, 3, 3, 0.88);
    box-shadow: 0 0 50px rgba(0,0,0,0.95), 0 0 0 6px rgba(212,175,55,0.18), inset 0 0 25px rgba(212,175,55,0.2);
    max-width: 330px;
    width: 100%;
    backdrop-filter: blur(6px);
}

.bengali-blessing {
    font-family: 'Noto Serif Bengali', serif;
    font-size: 0.95rem;
    color: var(--gold-light);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.prajapati-crest {
    margin: 6px auto 10px;
    filter: drop-shadow(0 2px 8px rgba(212,175,55,0.5));
}

.tap-title {
    font-family: 'Noto Serif Bengali', serif;
    font-size: 2rem;
    color: var(--gold-light);
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
}

.tap-subtitle {
    font-size: 1.15rem;
    color: #f3e5ab;
    font-style: italic;
    margin-bottom: 24px;
}

.pulse-ring {
    width: 56px;
    height: 56px;
    border: 2px solid var(--gold-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: pulseGlow 1.6s infinite ease-out;
}

@keyframes pulseGlow {
    0% { transform: scale(0.85); opacity: 1; box-shadow: 0 0 0 0 rgba(212,175,55,0.7); }
    100% { transform: scale(1.45); opacity: 0; box-shadow: 0 0 0 15px rgba(212,175,55,0); }
}

.tap-action {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 2.5px;
    color: var(--gold-light);
    font-weight: 600;
}

/* Symmetrical Single-Image Rajbari Double Doors */
#door-container {
    position: fixed;
    inset: 0;
    display: flex;
    z-index: 1500;
    pointer-events: none;
}

.door-half {
    width: 50vw;
    height: 100lvh;
    background-image: url('assets/rajbari_gate.png');
    background-size: 200% 100%;
    background-repeat: no-repeat;
    transition: transform 2.5s cubic-bezier(0.7, 0, 0.2, 1), opacity 2.3s ease;
    box-shadow: inset 0 0 45px rgba(0,0,0,0.85);
}

.door-half.left { background-position: left center; border-right: 1.5px solid var(--gold-dark); }
.door-half.right { background-position: right center; border-left: 1.5px solid var(--gold-dark); }
.door-half.open-left { transform: translateX(-102%) scale(1.06); opacity: 0; }
.door-half.open-right { transform: translateX(102%) scale(1.06); opacity: 0; }

/* Floating Golden Particles */
.particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -20px;
    width: 7px;
    height: 7px;
    background: radial-gradient(circle, var(--gold-light) 0%, var(--gold-primary) 50%, transparent 75%);
    border-radius: 50%;
    opacity: 0.65;
    animation: floatUp 10s infinite linear;
}

.particle:nth-child(1) { left: 12%; animation-duration: 9s; animation-delay: 0s; }
.particle:nth-child(2) { left: 28%; width: 9px; height: 9px; animation-duration: 12s; animation-delay: 2s; }
.particle:nth-child(3) { left: 46%; animation-duration: 8.5s; animation-delay: 4s; }
.particle:nth-child(4) { left: 64%; width: 8px; height: 8px; animation-duration: 11s; animation-delay: 1s; }
.particle:nth-child(5) { left: 80%; animation-duration: 10s; animation-delay: 3s; }
.particle:nth-child(6) { left: 90%; width: 6px; height: 6px; animation-duration: 13s; animation-delay: 5s; }

@keyframes floatUp {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    25% { opacity: 0.85; }
    80% { opacity: 0.85; }
    100% { transform: translateY(-105lvh) translateX(22px); opacity: 0; }
}

/* Main Narrative Container */
#main-content {
    position: relative;
    z-index: 10;
}

#main-content.hidden { display: none; }

.royal-scene {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 20px 22px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.royal-scene:last-child { padding-bottom: 50px; }

/* Golden Connector Thread */
.golden-thread {
    width: 2px;
    height: 44px;
    background: linear-gradient(to bottom, var(--gold-primary), var(--gold-light), var(--gold-primary));
    position: relative;
    margin: 6px 0;
    box-shadow: 0 0 10px rgba(212,175,55,0.6);
}

.golden-thread::after {
    content: '❖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gold-light);
    font-size: 0.85rem;
    background: var(--royal-maroon);
    padding: 2px;
    line-height: 1;
}

/* Royal Arch Frame */
.arch-frame {
    position: relative;
    width: 100%;
    min-height: 78svh;
    border-radius: 215px 215px 26px 26px;
    border: 2.5px solid var(--gold-primary);
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.9),
        0 0 0 6px rgba(212, 175, 55, 0.2),
        inset 0 0 35px rgba(0,0,0,0.85);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 68px 22px 42px;
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity 0.85s ease-out, transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.arch-frame.active { opacity: 1; transform: translate3d(0, 0, 0); }

.arch-frame::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 205px 205px 18px 18px;
    border: 1px dashed rgba(251, 230, 155, 0.45);
    pointer-events: none;
    z-index: 4;
}

/* SCENE 2: Tight Top Clearance (Minimal Yellow Spread) */
.couple-full-arch {
    min-height: auto; /* Wraps snugly around your image without extra empty height */
    align-items: flex-end;
    padding: 0;
    background: linear-gradient(180deg, #f5b349 0%, #f9ca6b 12%, #e89e34 100%);
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.9),
        0 0 0 6px rgba(212, 175, 55, 0.25),
        inset 0 0 25px rgba(139, 69, 19, 0.35);
}

.couple-full-arch::after {
    border-color: rgba(92, 10, 10, 0.28);
}

.couple-natural-frame {
    position: relative;
    width: 100%;
    z-index: 1;
    padding-top: 16px; /* Reduced from 46px to 16px so the yellow top spread is barely a sliver */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: radial-gradient(circle at 50% 3%, #ffe394 0%, #f5b041 12%, transparent 35%);
}

.couple-enlarged-img {
    width: 100%;
    height: auto;
    display: block;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 2.5%, black 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 2.5%, black 100%);
}

/* Save The Following Dates Plaque */
.save-dates-plaque {
    width: 100%;
    padding: 18px 20px;
    border-radius: 40px;
    background: linear-gradient(135deg, rgba(38, 5, 5, 0.92), rgba(68, 10, 10, 0.92));
    border: 1.5px solid var(--gold-primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 15px rgba(212, 175, 55, 0.2);
    text-align: center;
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.save-dates-plaque.active { opacity: 1; transform: translate3d(0, 0, 0); }

.save-dates-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.25rem;
    color: var(--gold-light);
    letter-spacing: 1px;
    margin: 4px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.9);
}

.alpona-divider.small { font-size: 0.95rem; margin: 2px 0; }

/* Background Image Inside Standard Arches */
.arch-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
    filter: brightness(0.92) contrast(1.05);
    transform: scale(1.03);
}

.arch-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(22, 3, 3, 0.38) 0%,
        rgba(22, 3, 3, 0.52) 48%,
        rgba(16, 2, 2, 0.88) 100%
    );
    z-index: 2;
}

.arch-content {
    position: relative;
    z-index: 5;
    text-align: center;
    width: 100%;
}

/* Event layouts featuring fully removed sub-headers */
.arch-content.no-bengali-head {
    padding-top: 20px;
}

.bengali-tag {
    font-family: 'Noto Serif Bengali', serif;
    font-size: 1.4rem;
    color: var(--gold-light);
    margin-bottom: 4px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.95);
}

.bengali-sub-blessing {
    font-family: 'Noto Serif Bengali', serif;
    font-size: 1.02rem;
    color: #f7df8b;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.95);
}

.alpona-divider {
    color: var(--gold-primary);
    font-size: 1.25rem;
    letter-spacing: 4px;
    margin: 10px 0 14px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

.blessing-text {
    font-size: 1.26rem;
    line-height: 1.62;
    color: var(--ivory);
    margin-bottom: 16px;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0,0,0,0.95);
}

.event-medallion {
    width: 155px;
    height: 155px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    box-shadow: 0 10px 25px rgba(0,0,0,0.85);
}

.large-medallion {
    width: 185px;
    height: 185px;
    margin: -10px auto 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9);
}

.event-medallion img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.event-medallion img.pos-top { object-position: center 18%; }

.event-title {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.7rem;
    color: var(--gold-light);
    margin-bottom: 8px;
    line-height: 1.25;
    text-shadow: 0 3px 10px rgba(0,0,0,0.95);
}

.event-datetime {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ivory);
    margin-bottom: 6px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.95);
}

.event-datetime span {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gold-light);
}

.venue-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: #e6dec8;
    letter-spacing: 1px;
    margin-bottom: 22px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

.royal-btn {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--royal-maroon);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 100%);
    padding: 13px 28px;
    border-radius: 30px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.7);
    border: 1px solid #fff;
    transition: transform 0.2s ease;
}

.royal-btn:active { transform: scale(0.95); }

/* Countdown Grid */
.countdown-heading {
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.38rem;
    color: var(--gold-light);
    margin-bottom: 16px;
}

.countdown-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.time-pill {
    background: rgba(20, 3, 3, 0.82);
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    padding: 10px 6px;
    min-width: 64px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.65);
}

.time-pill span {
    display: block;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.45rem;
    color: var(--gold-light);
    line-height: 1.1;
}

.time-pill small {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #d8c8b8;
}

.outro-text {
    font-size: 1.18rem;
    margin-bottom: 16px;
    padding: 0 6px;
}

.family-signoff {
    font-size: 1.2rem;
    color: var(--gold-light);
    line-height: 1.5;
    margin-bottom: 16px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

.family-signoff strong {
    display: inline-block;
    font-size: 1.32rem;
    color: #fff;
    margin-top: 2px;
}

.royal-hashtag {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.55rem;
    font-weight: 700;
    font-style: italic;
    color: var(--gold-light);
    letter-spacing: 0.5px;
    text-transform: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.95);
}

/* Scroll Indicator */
.scroll-prompt {
    margin: 10px 0 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-light);
    opacity: 0.85;
    animation: gentleBounce 2s infinite;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}