/* =========================================================
   ROOT VARIABLES
   Full Metallic Gold & Bronze Theme (No Reds)
   ========================================================= */

:root {
    --gold: #d4af37;        /* Bright Metallic Gold */
    --gold-dim: #9e7e1b;    /* Burnished Gold for depth */
    --bronze-dark: #2a1f0e; /* Dark Bronze base */
    --env-bg: #14110b;      /* Near-black Metallic base */
    --text-gold: #f3e5ab;   /* Silk/Wheat color for text */
}

/* =========================================================
   GLOBAL RESET & BASE STYLES
   ========================================================= */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0805 !important; 
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
}

/* =========================================================
   BACKGROUND LAYERS
   ========================================================= */

.bg-image {
    position: fixed !important;
    inset: 0 !important;
    z-index: -10 !important;
    background: url("../images/main-background/main-background.png") no-repeat center center !important;
    background-size: cover !important;
    display: block !important;
}

#particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.6)); 
}

/* =========================================================
   SPLASH SCREEN
   ========================================================= */

#splash-screen {
    position: fixed;
    inset: 0;
    background: rgba(10, 8, 5, 0.85) !important; 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition:
        transform 1.2s cubic-bezier(0.7, 0, 0.3, 1),
        opacity 1s;
}

/* Splash exit animation */
.splash-open {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* =========================================================
   ENVELOPE STRUCTURE
   ========================================================= */

.envelope {
    position: relative;
    width: 500px;
    height: 350px;
    background: var(--env-bg);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.9);
    perspective: 1500px;
}

/* Envelope pocket (front V shape) */
.envelope::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 3;
    border-left: 250px solid transparent;
    border-right: 250px solid transparent;
    /* Deep Bronze pocket */
    border-bottom: 180px solid #362812; 
}

/* Envelope pocket (inner depth layer) */
.envelope::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 2;
    border-top: 175px solid transparent;
    border-bottom: 175px solid transparent;
    border-left: 250px solid var(--env-bg);
    border-right: 250px solid var(--env-bg);
}

/* =========================================================
   ENVELOPE FLAP
   ========================================================= */

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    width: 0;
    height: 0;
    border-left: 250px solid transparent;
    border-right: 250px solid transparent;
    /* Burnished Gold Flap */
    border-top: 200px solid #4d3a1a; 
    transform-origin: top;
    transition: transform 0.8s ease;
}

/* Flap opening animation */
.flap-open {
    transform: rotateX(160deg);
    z-index: 1;
}

/* =========================================================
   WAX SEAL (Gold Medallion)
   ========================================================= */

#seal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: pointer;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Visible + animated state */
#seal-container.ready {
    opacity: 1 !important;
    animation: sealBounce 2s infinite ease-in-out;
}

.wax-seal {
    width: 110px;
    height: 110px;
    background: linear-gradient(145deg, #d4af37, #9e7e1b);
    border: 3px solid #f1d592; 
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(212, 175, 55, 0.5); 
}

.wax-seal img {
    /* Pure white logo to contrast against the gold medallion */
    filter: brightness(0) invert(1);
}

.seal-label {
    margin-top: 20px;
    color: var(--gold);
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Floating bounce animation */
@keyframes sealBounce {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -58%) scale(1.05); }
}

/* =========================================================
   CONTENT LOADER
   ========================================================= */

#content-loader {
    position: relative;
    z-index: 5;
    width: 100%;
    min-height: 100vh;
    display: none;
    background: transparent !important;
}

/* =========================================================
   RESPONSIVE (MOBILE)
   ========================================================= */

@media (max-width: 600px) {
    .envelope {
        width: 320px;
        height: 224px;
    }

    .envelope::before {
        border-left: 160px solid transparent;
        border-right: 160px solid transparent;
        border-bottom: 110px solid #362812;
    }

    .envelope::after {
        border-left: 160px solid var(--env-bg);
        border-right: 160px solid var(--env-bg);
        border-top: 112px solid transparent;
        border-bottom: 112px solid transparent;
    }

    .envelope-flap {
        border-left: 160px solid transparent;
        border-right: 160px solid transparent;
        border-top: 130px solid #4d3a1a;
    }

    .wax-seal {
        width: 85px;
        height: 85px;
    }
}