:root {
    --color-cream: #FDFBF7;
    --color-rose: #C21E56;
    --color-rose-dark: #8a153d;
    --color-gold: #D4AF37;
    --color-text: #4A4A4A;
    --color-burgundy: #5e0d21;
    --color-red-silk: #aa2b58;

    --font-heading: 'Playfair Display', serif;
    --font-script: 'Great Vibes', cursive;
    --font-body: 'Lato', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-cream);
    color: var(--color-text);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--color-rose);
}

.section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
    font-style: italic;
}

/* Hero Section */
.hero-section {
    height: 200vh;
    /* Extra height for scroll scrubbing */
    position: relative;
    overflow: hidden;
    background-image: url('bg2.jpg');
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.6);
}

.hero-section::before {
    /* Silk Sheen/Texture Overlay */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(105deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            rgba(255, 255, 255, 0) 60%),
        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)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
}

.envelope-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 333px;
    z-index: 10;
    perspective: 1000px;
}

.envelope {
    width: 100%;
    height: 100%;
    position: relative;
    background: #f8f5f2;
    border-radius: 15px;
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.2);
    transform-style: preserve-3d;
    transition: box-shadow 0.6s ease;
    /* Paper Texture */
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.02) 0px, rgba(0, 0, 0, 0.02) 2px, transparent 2px, transparent 4px);
}

.envelope::after {
    /* Wax Seal Placeholder (Visual only for now) */
    content: '❤';
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #990000);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3), inset 0 2px 5px rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(100, 0, 0, 0.5);
    font-size: 20px;
    z-index: 20;
    pointer-events: none;
    border: 2px solid rgba(100, 0, 0, 0.2);
}

.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: #f8f5f2;
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    transform-origin: top;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.6s ease;
    z-index: 15;
    /* Higher than content */
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.02) 0px, rgba(0, 0, 0, 0.02) 2px, transparent 2px, transparent 4px);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
}

.flap::before {
    /* Gold Liner / Border effect on the inside/edge */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-gold) 0%, #b8860b 100%);
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    transform: scale(0.95) translateY(-2px);
    /* Simulate liner */
    z-index: -1;
    opacity: 0;
    /* Hidden on outside, visible when open? Hard to do with clip-path, simple border for now */
    /* Let's try a simple border trick via box-shadow or just texture */
}

.pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f0ede9;
    clip-path: polygon(0 0, 50% 50%, 100% 0, 100% 100%, 0 100%);
    z-index: 14;
    background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.02) 0px, rgba(0, 0, 0, 0.02) 2px, transparent 2px, transparent 4px);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

.letter-content {
    position: absolute;
    bottom: 0px;
    left: 10px;
    right: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
    /* Behind pocket initially */
}

.letter-text {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--color-rose);
    text-align: center;
    margin-bottom: 1rem;
    opacity: 0;
    /* Hidden initially */
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.photos-fan {
    position: relative;
    width: 100%;
    height: 150px;
}

.photo {
    position: absolute;
    width: 120px;
    height: auto;
    border: 3px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease, box-shadow 0.4s ease;
    opacity: 0;
}

.scroll-prompt {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--color-cream);
    /* Changed to cream for contrast on red */
    animation: bounce 2s infinite;
    z-index: 11;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: var(--font-heading);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.8rem;
}

@keyframes bounce {

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

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

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

/* Grid Section */
.content-section#grid {
    padding: 100px 20px;
    position: relative;
    z-index: 20;
    background-color: #800020;
    /* Velvet Red */
    background-image:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 100%),
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px, transparent 10px);
    border-top: 4px solid var(--color-gold);
    border-bottom: 4px solid var(--color-gold);
}

.content-section#grid .section-title {
    color: var(--color-cream);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.content-section#grid .caption {
    color: var(--color-rose);
    /* Dark red text on white card */
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.grid-item {
    background: white;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
}

.grid-item img {
    width: 100%;
    height: 300px;
    /* Uniform height */
    object-fit: cover;
    /* Crop to fit */
    border-radius: 4px;
    margin-bottom: 10px;
    display: block;
    /* Remove bottom space */
}

.caption {
    font-family: var(--font-script);
    font-size: 1.5rem;
    color: var(--color-text);
    text-align: center;
}

/* Proposal Section */
.proposal-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('bg3.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.proposal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Dark overlay for readability */
    z-index: 1;
}

.proposal-content {
    text-align: center;
    z-index: 10;
}

.proposal-heading {
    font-size: 4rem;
    margin-bottom: 3rem;
    color: white;
    animation: pulsate 3s infinite ease-in-out;
}

@keyframes pulsate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.buttons-container {
    position: relative;
    height: 100px;
    width: 100%;
}

.btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: var(--font-heading);
}

.yes-btn {
    background-color: var(--color-rose);
    color: white;
    box-shadow: 0 4px 15px rgba(194, 30, 86, 0.4);
}

.yes-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(194, 30, 86, 0.6);
}

.no-btn {
    background-color: #e0e0e0;
    color: #555;
    position: absolute;
    /* Needed for movement */
    left: 60%;
    /* Offset from Yes button */
    top: 0;
    transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }



    .proposal-heading {
        font-size: 2.5rem;
        padding: 0 20px;
    }

    .buttons-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .no-btn {
        position: relative;
        /* On mobile, maybe simpler or specialized logic */
        left: auto;
        top: auto;
    }
}