:root {
    --bg-color: #fdfbf7;
    --text-color: #5a5a5a;
    --accent-color: #8da399;
    --envelope-color: #e6dfc8;
    /* Paper-like envelope color */
    --envelope-shadow: rgba(0, 0, 0, 0.1);
    --font-script: 'Great Vibes', cursive;
    --font-serif: 'Cormorant Garamond', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    overflow: hidden;
    /* Prevent scroll when envelope is closed */
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

/* Envelope Animation Container */
.envelope-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    z-index: 100;
}

.envelope {
    position: relative;
    width: 700px;
    /* Match invitation width */
    height: 500px;
    background-color: var(--envelope-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transition: all 1.5s ease-in-out;
    transform-style: preserve-3d;
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Wax Seal */
/* Wax Seal - Realistic v2 */
.wax-seal {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 30% 30%, #c63d3d, #8a1c1c, #5e0e0e);
    border-radius: 45% 55% 40% 60% / 55% 45% 60% 40%;
    /* More organic irregular shape */
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    cursor: pointer;
    /* Layered shadows for 3D wax blobing */
    box-shadow:
        inset 5px 5px 10px rgba(255, 255, 255, 0.3),
        /* Highlight top-left */
        inset -5px -5px 12px rgba(0, 0, 0, 0.4),
        /* Shadow bottom-right */
        3px 3px 10px rgba(0, 0, 0, 0.4),
        /* Drop shadow */
        0 0 0 6px rgba(138, 28, 28, 0.1);
    /* Subtle outer glow/thin wax edge */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wax-seal::after {
    content: '';
    position: absolute;
    width: 65%;
    height: 65%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 1px 1px 3px rgba(0, 0, 0, 0.4),
        0 1px 1px rgba(255, 255, 255, 0.2);
    /* Indented ring effect */
}

/* Text removed from seal */

.wax-seal:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Envelope Flaps */
.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 350px solid transparent;
    border-right: 350px solid transparent;
    border-top: 250px solid #dcd3b8;
    /* Slightly darker top flap */
    transform-origin: top;
    transition: transform 1s ease 0.5s, z-index 0.1s linear 1s;
    /* Delays for open sequence */
    z-index: 60;
}

.pocket {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 350px solid transparent;
    border-right: 350px solid transparent;
    border-bottom: 250px solid var(--envelope-color);
    z-index: 55;
}

/* Invitation Content - Hidden Initially */
.invitation-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Align top so it scrolls naturally */
    overflow-y: auto;
    /* Allow scrolling inside if needed */
    opacity: 0;
    transform: scale(0.8) translateY(50px);
    transition: all 1s ease 1s;
    /* Delay appearance until envelope opens */
    z-index: 40;
    pointer-events: none;
    /* Block interaction until open */
}

/* 
   Animation State: OPEN 
   Controlled by JS adding .open class to wrapper
*/

.envelope-wrapper.open .envelope {
    background-color: transparent;
    /* Hide envelope bg */
    box-shadow: none;
}

.envelope-wrapper.open .flap {
    transform: rotateX(180deg);
    z-index: 1;
    /* Move behind content */
    opacity: 0;
    /* Fade out */
}

.envelope-wrapper.open .pocket {
    opacity: 0;
    /* Fade out */
    transition: opacity 1s ease 1s;
}

.envelope-wrapper.open~.invitation-content {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    z-index: 200;
    /* Bring to front */
    position: fixed;
    /* Take over screen */
    background-color: rgba(253, 251, 247, 0.95);
    /* Semi-transparent bg */
    height: 100vh;
    padding: 0;
    /* Reset for scroll */
}

.envelope-wrapper.open~.invitation-content .invitation-container {
    margin: 0 auto 50px auto;
    /* Convert top margin to bottom margin for scrolling */
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.2s;
    /* Slide up invitation */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- Original Invitation Styles (Preserved & Adjusted) --- */

.invitation-container {
    background-color: #fffaf0;
    width: 100%;
    max-width: 700px;
    padding: 80px 50px;
    text-align: center;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    /* Softer shadow */
    margin: 40px auto;
    /* Initial state relative to .invitation-content wrapper */
}

/* Typography Refinements */
h1,
h2,
.signature-names {
    font-family: var(--font-script);
    font-weight: 400;
    color: #4a4a4a;
}

p {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

/* Header */
.intro-text {
    font-family: var(--font-script);
    font-size: 2rem;
    margin-bottom: 20px;
    margin-top: 60px;
    /* Push down to avoid floral overlap */
    color: #6b6b6b;
    line-height: 1.4;
    position: relative;
    z-index: 2;
    /* Ensure text is above flowers if they do touch */
}

.sub-intro {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
    margin-bottom: 50px;
    border-bottom: 1px solid #dcdcdc;
    display: inline-block;
    padding-bottom: 12px;
    color: #888;
}

/* Names */
.names-section {
    margin-bottom: 50px;
}

.names {
    font-size: 4rem;
    line-height: 1.2;
    margin: 20px 0;
    color: #333;
}

.ampersand {
    font-size: 2.5rem;
    color: var(--accent-color);
    display: block;
    margin: 15px 0;
    font-family: var(--font-serif);
    font-style: italic;
}

/* Details */
.date-time {
    font-size: 1.4rem;
    margin: 50px auto;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    width: 80%;
    color: #555;
}

.icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

.separator {
    color: #ddd;
    font-weight: 300;
}

/* Gift Info */
.gift-info {
    font-size: 1.1rem;
    margin-bottom: 60px;
    color: #777;
    font-style: italic;
}

/* Footer */
.footer {
    position: relative;
    z-index: 10;
}

.signature-intro {
    font-family: var(--font-script);
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: #666;
}

.signature-names {
    font-size: 3rem;
    margin-bottom: 30px;
}

.final-msg {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 80px;
    /* Push up from bottom flower */
    font-size: 0.8rem;
    color: #999;
    position: relative;
    z-index: 2;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn {
    text-decoration: none;
    color: #555;
    border: 1px solid #ccc;
    padding: 14px 28px;
    border-radius: 4px;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    background-color: transparent;
}

.btn:hover {
    background-color: #555;
    color: white;
    border-color: #555;
}

/* Floral Corners */
.floral-corner {
    position: absolute;
    width: 350px;
    height: 350px;
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 999;
}

.top-left {
    top: -40px;
    left: -40px;
    background-image: url('assets/floral_top_left.png');
}

.top-right {
    display: none;
}

.bottom-left {
    display: none;
}

.bottom-right {
    bottom: -40px;
    right: -40px;
    background-image: url('assets/floral_bottom_right.png');
}

/* Responsive */
@media (max-width: 600px) {
    .names {
        font-size: 3rem;
    }

    .invitation-container {
        padding: 50px 20px;
    }

    .floral-corner {
        width: 200px;
        height: 200px;
    }

    .top-left {
        top: -20px;
        left: -20px;
    }

    .bottom-right {
        bottom: -20px;
        right: -20px;
    }

    .date-time {
        flex-direction: column;
        gap: 10px;
    }

    .separator {
        display: none;
    }

    /* Mobile Envelope Tweaks */
    .envelope {
        width: 90vw;
        height: 60vh;
    }

    .flap {
        border-left-width: 45vw;
        border-right-width: 45vw;
    }

    .pocket {
        border-left-width: 45vw;
        border-right-width: 45vw;
    }
}

/* --- New Section Styles for Eder & Raquel --- */

.section-title {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 25px;
    margin-top: 50px;
    font-weight: 400;
}

/* Itinerary Timeline */
.timeline {
    text-align: left;
    max-width: 320px;
    margin: 30px auto;
    border-left: 2px solid #e0e0e0;
    padding-left: 25px;
    position: relative;
}

.timeline-item {
    margin-bottom: 30px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    /* Adjust to sit on the line */
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e0e0e0;
}

.timeline .time {
    display: block;
    font-weight: 600;
    color: #5a5a5a;
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-family: var(--font-serif);
}

.timeline .event {
    color: #777;
    font-style: italic;
    font-size: 1rem;
}

/* Dress Code */
.code-type {
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.dress-icons {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.dress-item {
    text-align: center;
}

.dress-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #444;
}

.dress-desc {
    font-size: 0.95rem;
    color: #777;
    line-height: 1.4;
}

/* Adults Only */
.adults-only {
    background-color: rgba(141, 163, 153, 0.1);
    /* Light accent bg */
    padding: 30px;
    border-radius: 8px;
    margin: 50px auto;
    max-width: 80%;
}

.adults-only p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* Gifts */
.gift-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.gift-card {
    border: 1px solid #e6dfc8;
    background-color: #fff;
    padding: 25px 15px;
    border-radius: 8px;
    width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
}

.gift-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.gift-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.btn-small:hover {
    background-color: var(--accent-color);
    color: white !important;
}