@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap");

:root {
    --primary-gold: #c5a059;
    --bg-cream: #f8f5f0;
    /* Soft cream from your image */
    --bg-burgundy: #2d0505;
    /* Deep Burgundy */
    --bg-burgundy-dark: #1a0202;
    /* Darker variant for gradients */
    --card-burgundy: #3d0a0a;
    --text-brown: #8c7c73;
    --envelope-cream: #ffffff;
    --wax-gold: #c5a059;
    --table-burgundy: #2d0a0a;
}

/* Prevent all scrolling by default */
body.locked {
    overflow: hidden !important;
    height: 100vh;
    width: 100vw;
    position: fixed;
    touch-action: none;
}

body {
    font-family: "Lato", sans-serif;
    background-color: var(--envelope-cream);
    overflow-x: hidden;
}

.font-serif-elegant {
    font-family: "Playfair Display", serif;
}

#scene {
    display: flex;
    width: 200%;
    height: 100vh;
    transition: transform 1.5s cubic-bezier(0.87, 0, 0.13, 1);
}

#envelope-wrapper,
#main-content {
    flex: 0 0 50%;
    height: 100%;
}

#envelope-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 1s cubic-bezier(0.87, 0, 0.13, 1),
        opacity 0.8s ease;
    padding: 20px;
    /* Realistic Table: Wood Grain Texture */
    background-color: var(--bg-burgundy-dark);
    background-image:
        repeating-linear-gradient(90deg,
            transparent,
            transparent 40px,
            rgba(0, 0, 0, 0.05) 41px,
            transparent 42px),
        repeating-linear-gradient(0deg,
            var(--bg-burgundy),
            var(--bg-burgundy-dark) 100px,
            var(--bg-burgundy-dark) 200px);
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.6);
    /* Vignette for depth */
}


#main-content {
    pointer-events: none;
}

.scene-reveal #main-content {
    pointer-events: auto;
}

/* Ambient noise overlay for table texture */
#envelope-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.15;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.envelope {
    position: relative;
    width: min(90vw, 420px);
    aspect-ratio: 4 / 6;
    /* Shorter ratio */

    border: 10px solid #111;
    border-radius: 38px;
    overflow: hidden;

    background: var(--bg-burgundy);
    perspective: 1200px;
    transform-style: preserve-3d;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.08),
        0 10px 20px rgba(0, 0, 0, 0.05);

    cursor: pointer;
}

.envelope:hover {
    /* transform: rotate(-1deg) translateY(-5px) scale(1.02); */
    box-shadow:
        -8px 25px 45px rgba(0, 0, 0, 0.5),
        0 10px 15px rgba(0, 0, 0, 0.2);
}

.envelope-body {
    position: absolute;
    inset: 0;
    background: var(--bg-burgundy);
    box-shadow:
        -12px 20px 40px rgba(0, 0, 0, 0.5),
        -2px 5px 10px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    z-index: 2;
}

/* The Card inside the envelope */
.letter-card {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    background: #420b0b;
    z-index: 1;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
    transform: translateY(20%);
    text-align: center;
}

.envelope-svg {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 3;
    /* Above the card */
    overflow: visible;
}

/* Flap Opening Animation */
#right-flap {
    transform-origin: 100% 0%;
    transition: transform 8s cubic-bezier(0.22, 1, 0.36, 1);
    transform-box: fill-box;
}

/* .envelope.open {
    transform: rotate(-3deg) scale(1.02);
    transition: transform 1.2s ease;
} */

.envelope.open .letter-card {
    transform: translateY(-80%);
}

.envelope.open #right-flap {
    transform: rotateY(-140deg);
}

.envelope.open .wax-seal {
    transform: translate(-50%, -120%) scale(0.6) rotate(-8deg);
    opacity: 0;
}

.card-slide-out {
    transform: translateY(-100%);
}

.scene-reveal {
    transform: translateX(-50%);
}

.wax-seal {
    position: absolute;
    top: 60%;
    /* Perfect center where all SVG lines meet */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background-image: url("./assets/wax_removed.png");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Soft shadow to lift it off the paper */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
    transition:
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease;
}

.wax-initials {
    color: #3d3d3d;
    font-weight: bold;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.initial-divider {
    width: 1.5px;
    height: 22px;
    background: #3d3d3d;
}

.image-divider {
    width: 100%;
    height: 70vh;
    background-size: cover;
    background-position: center;
    animation: floatSideToSide 3s ease-in-out infinite;
}

@keyframes floatSideToSide {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(20px); /* Adjust this for more/less movement */
  }
  100% {
    transform: translateX(0);
  }
}

@media (max-width: 640px) {
    #scene {
        width: 100%;
    }

    #envelope-wrapper,
    #main-content {
        flex: 0 0 100%;
    }

    .scene-reveal {
        transform: translateX(-100%);
        height: 100%;
    }

    .envelope {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        border: none;
        /* remove black frame */
        border-radius: 0;
        box-shadow: none;
    }

    .envelope-svg {
        width: 100%;
        height: 100%;
        display: block;
    }

    .wax-seal {
        top: 55%;
        left: 35%;
        width: 150px;
        height: 150px;
    }

    .wax-initials {
        /* No longer need to rotate initials since envelope isn't rotated */
        transform: none;
        font-size: 2rem;
    }

    /* Fix hover for mobile to avoid jumping */
    .wax-seal:hover {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

.wax-seal:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

@media (max-width: 640px) {
    .wax-seal:hover {
        transform: translate(-50%, -50%) rotate(-90deg) scale(1.05);
    }
}

.envelope.open .wax-seal {
    opacity: 0;
    pointer-events: none;
}

/* --- CONTENT STYLES --- */
.hero-image {
    background-image: url("./assets/IMG_3306.jpeg");
    background-size: cover;
    background-position: center;
}

.gold-texture {
    background: linear-gradient(to bottom right,
            #d4af37,
            #fcf6ba,
            #d4af37,
            #aa771c);
    opacity: 0.25;
}

/* --- HERO TRIPTYCH DESIGN --- */
        .triptych-container {
            display: grid;
            grid-template-columns: 1fr 1.5fr 1fr;
            gap: 1.5rem;
            width: 100%;
            height: 100vh;
            padding: 2rem;
            align-items: center;
            overflow: hidden;
            background: var(--bg-burgundy-dark);
            /* Set the shared background image here */
            background-image: url('./assets/IMG_3306.jpeg');
            background-size: cover;
            background-position: center;
        }

        .triptych-panel {
            position: relative;
            height: 85vh;
            border: 1px solid rgba(197, 160, 89, 0.2);
            overflow: hidden;
            /* Semi-transparent background to let the shared image through */
            background: rgba(26, 2, 2, 0.2);
            backdrop-filter: blur(2px);
        }

        .panel-center {
            height: 95vh;
            border: 1px solid rgba(197, 160, 89, 0.4);
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            padding: 3rem;
            background: transparent;
            backdrop-filter: none;
        }

        /* Animations */
        .float-up { animation: floatUp 6s ease-in-out infinite; }
        .float-down { animation: floatDown 6s ease-in-out infinite; }

        @keyframes floatUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
        @keyframes floatDown { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(20px); } }

        .vertical-name {
            writing-mode: vertical-rl;
            text-orientation: mixed;
            position: absolute;
            top: 2rem;
            font-size: 0.75rem;
            letter-spacing: 0.8em;
            text-transform: uppercase;
            color: var(--primary-gold);
            opacity: 0.8;
            text-shadow: 0 2px 4px rgba(0,0,0,0.5);
        }

        @media (max-width: 768px) {
            .triptych-container { grid-template-columns: 1fr; padding: 1rem; }
            .panel-side { display: none; }
            .panel-center { height: 80vh; margin-top: 10vh; }
        }
.btn-rsvp {
    border: 1px solid var(--text-brown);
    color: var(--text-brown);
    padding: 0.6rem 2.5rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    display: inline-block;
}

.btn-rsvp:hover {
    background-color: var(--text-brown);
    color: white;
}

html {
    scroll-behavior: smooth;
}

button:disabled {
  animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

@keyframes bounce {

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

    50% {
        transform: translateY(8px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}