


.envelope-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--main-font);
    color: var(--accent-gold);
    opacity: 1;
}


.flap {
    position: absolute;
    
    transition: transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}




.envelope-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.flap-svg path {
    
    fill: var(--primary-green);
    stroke: var(--accent-gold);
    stroke-width: 1.5px;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
    transition: fill 0.3s ease;
}


.flap-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    
    width: 100%;
    position: relative;
    z-index: 2;
}


.top-flap {
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    
    z-index: 5;
    transform-origin: top center;
    pointer-events: none;
    
}

.flap-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8vh;
    width: 100%;
    position: relative;
    z-index: 2;
}


.monogram-box {
    width: 80px;
    height: 100px;
    border: 1px solid var(--accent-gold);
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    opacity: 0.9;
}

.monogram-text {
    font-family: var(--decorative-font);
    font-size: 1.5rem;
    color: var(--accent-gold);
    line-height: 1.2;
    text-align: center;
}


.title-script {
    font-family: var(--decorative-font);
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 400;
    margin: 0;
    line-height: 1;
    color: var(--white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.subtitle-serif {
    font-family: var(--main-font);
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    font-weight: 300;
    text-transform: lowercase;
    margin-top: 5px;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    opacity: 0.9;
}


.bottom-flap {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55%;
    z-index: 4;
    transform-origin: bottom center;
    pointer-events: none;
}

.bottom-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 8vh;
    text-align: center;
    width: 100%;
    height: 100%;
}

.info-block {
    text-align: center;
}

.info-block p {
    margin: 6px 0;
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 300;
    letter-spacing: 0.08em;
    color: var(--accent-gold);
}

.info-block .date {
    font-style: italic;
}

.star-deco {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 1rem;
    color: var(--accent-gold);
    opacity: 0.5;
}


.left-flap {
    left: 0;
    top: 0;
    width: 55%;
    height: 100%;
    z-index: 3;
    transform-origin: left center;
    pointer-events: none;
}

.left-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 6vw;
    height: 100%;
}


.right-flap {
    right: 0;
    top: 0;
    width: 55%;
    height: 100%;
    z-index: 3;
    transform-origin: right center;
    pointer-events: none;
}

.right-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 6vw;
    height: 100%;
}


.flap-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.4));
    overflow: visible;
    
}




.flap-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    
}

.top-flap .flap-content {
    padding-top: 8vh;
    justify-content: flex-start;
}

.bottom-flap .flap-content {
    justify-content: flex-end;
    padding-bottom: 8vh;
}

.left-flap .flap-content {
    justify-content: flex-start;
    padding-left: 6vw;
    align-items: flex-start;
    
}

.right-flap .flap-content {
    justify-content: flex-end;
    padding-right: 6vw;
    align-items: flex-end;
    
}


.wax-seal-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    outline: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;

    
    animation: sealBreathe 3s ease-in-out infinite;
}


.wax-seal-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(197, 163, 125, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: sealGlow 4s ease-in-out infinite;
}

@keyframes sealGlow {

    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.4);
    }
}


.wax-seal-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    border: 1px solid var(--accent-gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    animation: sealRing 3s ease-out infinite 1s;
}

@keyframes sealRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

@keyframes sealBreathe {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.04);
    }
}

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

.wax-seal-btn:active {
    transform: translate(-50%, -50%) scale(0.92);
}

.seal-inner {
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.35));
    overflow: hidden;
    border-radius: 50%;
}


.seal-inner::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -150%;
    width: 50%;
    height: 200%;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: rotate(30deg);
    animation: sealShimmer 3s infinite;
}

@keyframes sealShimmer {
    0% {
        left: -150%;
    }

    30%,
    100% {
        left: 150%;
    }
}

.wax-seal-btn.is-idle {
    animation: sealNudge 2s ease-in-out infinite;
}

@keyframes sealNudge {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.08);
    }
}

.seal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}


.click-hint {
    position: absolute;
    bottom: -65px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--accent-gold);
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.23em;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    animation: fadeInHint 2s ease-out 1s forwards;
}

.click-hint::before {
    content: "◇";
    font-size: 0.65rem;
    opacity: 0.5;
    margin-bottom: -5px;
}

.click-hint span:first-of-type {
    display: none;
    
}

@keyframes fadeInHint {
    to {
        opacity: 0.8;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes bounceArrow {

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

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



.animate-open .top-flap {
    transform: translateY(-110%);
    
}

.animate-open .bottom-flap {
    transform: translateY(110%);
}

.animate-open .left-flap {
    transform: translateX(-110%);
}

.animate-open .right-flap {
    transform: translateX(110%);
}

.animate-open .wax-seal-btn {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
    transition: all 0.4s ease;
}


.envelope-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
}


@media (max-width: 600px) {
    .flap-content {
        padding-top: 8vh;
    }

    .monogram-box {
        width: 70px;
        height: 95px;
    }

    .monogram-text {
        font-size: 1.4rem;
    }

    .seal-inner {
        width: 130px;
        height: 130px;
    }



    .bottom-content {
        padding-bottom: 10vh;
    }
}