/* Custom Styles - Clean & Joyful */

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

/* Hide default scrollbar but keep functionality */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}
html, body {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Base styles */
body {
    cursor: none; /* Custom cursor */
}

/* Stable Header Fix */
header#main-header {
    position: fixed !important;
    top: 1rem !important;
    right: 1rem !important;
    left: auto !important;
    z-index: 99999 !important;
    transform: none !important;
    pointer-events: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: auto !important;
}

.glass-panel i {
    color: #C5A059 !important; /* Force high contrast for mobile icons */
    text-shadow: 0 0 10px rgba(197, 160, 89, 0.3);
}

@media (min-width: 768px) {
    header#main-header {
        top: 1.5rem !important;
        right: 1.5rem !important;
    }
}

/* Glassmorphism Controls Only */
.glass-panel {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(197, 160, 89, 0.4) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.dark .glass-panel {
    background: rgba(15, 15, 15, 0.9) !important;
    border: 1px solid rgba(197, 160, 89, 0.3) !important;
}

/* Custom Cursor */
.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #C5A059;
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
    box-shadow: 0 0 10px rgba(197, 160, 89, 0.5);
}

.cursor-outline {
    width: 35px;
    height: 35px;
    border: 1.5px solid rgba(197, 160, 89, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1), height 0.3s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.3s;
}

a:hover ~ .cursor-outline, 
button:hover ~ .cursor-outline,
.cursor-pointer:hover ~ .cursor-outline,
#envelope-container:hover ~ .cursor-outline {
    width: 55px;
    height: 55px;
    background-color: rgba(197, 160, 89, 0.15);
    border-color: rgba(197, 160, 89, 0.8);
}

/* 3D Scene Container Fixes */
#scene-container {
    overflow: hidden !important;
    width: 100% !important;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
}

.scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
}

#scene-1 {
    opacity: 1;
    visibility: visible;
}

/* Joyful Envelope Styles */
.envelope-back {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border: 1px solid #3d3d3d;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
}
.dark .envelope-back {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 1px solid #222;
}

.envelope-flap-bottom {
    background: #252525;
    clip-path: polygon(0 100%, 50% 40%, 100% 100%);
    filter: drop-shadow(0 -5px 10px rgba(0,0,0,0.4));
    transform-origin: bottom;
}
.dark .envelope-flap-bottom {
    background: #121212;
}

.envelope-flap-left {
    background: #222222;
    clip-path: polygon(0 0, 52% 50%, 0 100%);
    filter: drop-shadow(5px 0 10px rgba(0,0,0,0.3));
    transform-origin: left;
}
.dark .envelope-flap-left {
    background: #101010;
}

.envelope-flap-right {
    background: #222222;
    clip-path: polygon(100% 0, 48% 50%, 100% 100%);
    filter: drop-shadow(-5px 0 10px rgba(0,0,0,0.3));
    transform-origin: right;
}
.dark .envelope-flap-right {
    background: #101010;
}

.envelope-flap-top {
    background: linear-gradient(180deg, #353535 0%, #2a2a2a 100%);
    clip-path: polygon(0 0, 100% 0, 50% 65%);
    transform-origin: top;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
    z-index: 40;
}
.dark .envelope-flap-top {
    background: linear-gradient(180deg, #222 0%, #111 100%);
}

/* Fireworks Styles */
.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
}

/* Particle styles (Subtle dust) */
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(197, 160, 89, 0.4);
    pointer-events: none;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-150px) translateX(30px); opacity: 0; }
}

/* Ambient Glow */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(197,160,89,0.2) 0%, rgba(197,160,89,0) 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* Joyful Gold Accents */
.text-joy {
    background: linear-gradient(to right, #E6C998, #C5A059, #9B7A3D, #C5A059, #E6C998);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: shine 4s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

/* Cinematic Overlays */
.montage-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
    mix-blend-mode: screen;
    opacity: 0.3;
}

.light-leak {
    background: radial-gradient(circle at 0% 0%, rgba(197, 160, 89, 0.4) 0%, transparent 50%),
                radial-gradient(circle at 100% 100%, rgba(197, 160, 89, 0.3) 0%, transparent 50%);
    filter: blur(40px);
}

.vignette-heavy {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 80;
    background: radial-gradient(circle, transparent 40%, rgba(0,0,0,0.6) 100%);
}

/* Luxurious Card Effects */
#the-card {
    background: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%);
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.text-joy {
    background: linear-gradient(to right, #E6C998, #C5A059, #F0E68C, #C5A059, #E6C998);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: shine 3s linear infinite;
    text-shadow: 0 0 30px rgba(197, 160, 89, 0.4);
}

.scene-bg {
    transition: transform 10s ease-out;
}

.scene:hover .scene-bg {
    transform: scale(1.1);
}

/* Mobile */
@media (max-width: 768px) {
    body { cursor: auto; }
    .scene-bg { background-attachment: scroll !important; }
    
    /* Ensure scenes have enough space for scrolling content on mobile */
    .scene {
        height: 100vh;
        width: 100% !important;
        position: fixed;
        top: 0;
        left: 0;
        overflow: hidden !important;
    }

    #scene-1 {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Adjust envelope for small mobile */
    @media (max-height: 600px) {
        #envelope-container {
            transform: scale(0.8);
        }
        #envelope-welcome {
            margin-bottom: 1rem;
        }
    }

    /* Gallery stack for mobile */
    .gallery-container {
        height: auto !important;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .gallery-item {
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 300px;
        margin: 0 auto;
    }
}