/* ===============================================
   CURSED IN WONDERLAND - COMING SOON PAGE
   Dark Souls-like Aesthetic
   =============================================== */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Cinzel', serif;
    background-color: #000000;
    color: #F0F0F0;
    /* Prevent glow from being clipped */
    overflow-x: hidden;
    overflow-y: hidden;
}

/* ===== LOADER ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    max-width: 200px;
    width: 80%;
    height: auto;
    animation: logoFade 2s ease-in-out infinite;
}

/* Lightweight logo fade animation */
@keyframes logoFade {
    0%, 100% {
        opacity: 0.6;
        filter: drop-shadow(0 0 15px rgba(200, 0, 0, 0.5));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(200, 0, 0, 0.7));
    }
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top: 3px solid #D4AF37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== BACKGROUND ===== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 1;
    will-change: transform;
    transform: scale(1.2);
}

/* Desktop Background */
@media (min-width: 768px) {
    .background {
        background-image: url('background-desktop.png');
    }
}

/* Mobile Background */
@media (max-width: 767px) {
    .background {
        background-image: url('background-mobile.png');
    }
}

/* ===== VIGNETTE OVERLAY ===== */
.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.8),
                inset 0 0 100px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 5;
}

/* ===== CONTENT CONTAINER ===== */
.content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    max-width: 90%;
    width: 100%;
    /* Allow glow effects to overflow without clipping */
    padding: 60px 0px;
    overflow: visible;
}

/* ===== TITLE STYLING ===== */
.title {
    font-family: 'Cinzel Decorative', 'Uncial Antiqua', cursive;
    font-weight: 900;
    font-size: 7rem;
    color: #FFF5E1;
    letter-spacing: 0.16em;
    line-height: 1.4;
    text-transform: uppercase;
    margin-bottom: 0;
    position: relative;
    display: inline-block;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
    /* Allow glow to be visible */
    overflow: visible;
    padding: 20px 0;
}

.title .word {
    display: inline-block;
    white-space: nowrap;
}

.title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px);
    position: relative;
    /* Optimized shadows for performance */
    text-shadow: 
        0 0 8px rgba(200, 0, 0, 0.7),
        0 0 16px rgba(139, 0, 0, 0.5),
        0 0 24px rgba(80, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.9);
    filter: drop-shadow(0 0 6px rgba(200, 0, 0, 0.4));
    transition: all 0.3s ease;
}

/* Lightweight floating glow animation for each letter */
.title .letter.revealed {
    animation: letterFloat 6s ease-in-out infinite;
}

/* Simplified animation - less GPU intensive */
@keyframes letterFloat {
    0%, 100% {
        transform: translateY(0px);
        text-shadow: 
            0 0 8px rgba(200, 0, 0, 0.7),
            0 0 16px rgba(139, 0, 0, 0.5),
            0 0 24px rgba(80, 0, 0, 0.3),
            0 2px 8px rgba(0, 0, 0, 0.9);
    }
    50% {
        transform: translateY(-3px);
        text-shadow: 
            0 0 12px rgba(220, 0, 0, 0.8),
            0 0 24px rgba(160, 0, 0, 0.6),
            0 0 36px rgba(100, 0, 0, 0.4),
            0 2px 10px rgba(0, 0, 0, 0.95);
    }
}

/* Stagger animation delays for wave effect */
.title .letter:nth-child(1) { animation-delay: 0s; }
.title .letter:nth-child(2) { animation-delay: 0.15s; }
.title .letter:nth-child(3) { animation-delay: 0.3s; }
.title .letter:nth-child(4) { animation-delay: 0.45s; }
.title .letter:nth-child(5) { animation-delay: 0.6s; }
.title .letter:nth-child(6) { animation-delay: 0.75s; }
.title .letter:nth-child(7) { animation-delay: 0.9s; }
.title .letter:nth-child(8) { animation-delay: 1.05s; }
.title .letter:nth-child(9) { animation-delay: 1.2s; }
.title .letter:nth-child(10) { animation-delay: 1.35s; }

.title .space {
    display: inline-block;
    width: 0.35em;
}

/* ===== SUBTITLE STYLING ===== */
.subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: 2.2rem;
    color: #D4AF37;
    letter-spacing: 0.6em;
    text-transform: uppercase;
    margin-top: 3rem;
    opacity: 0;
    /* Optimized shadows for performance */
    text-shadow: 
        0 0 10px rgba(212, 175, 55, 0.7),
        0 0 20px rgba(212, 175, 55, 0.4),
        0 0 30px rgba(180, 140, 40, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.9);
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.4));
    font-style: italic;
    position: relative;
    display: inline-block;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

/* Lightweight continuous gold shimmer */
.subtitle.animated {
    animation: subtitleShimmer 4s ease-in-out infinite;
}

/* Simplified shimmer animation - less GPU intensive */
@keyframes subtitleShimmer {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(212, 175, 55, 0.7),
            0 0 20px rgba(212, 175, 55, 0.4),
            0 0 30px rgba(180, 140, 40, 0.25),
            0 2px 8px rgba(0, 0, 0, 0.9);
    }
    50% {
        text-shadow: 
            0 0 16px rgba(240, 200, 70, 0.85),
            0 0 32px rgba(220, 180, 60, 0.5),
            0 0 48px rgba(190, 150, 45, 0.3),
            0 2px 10px rgba(0, 0, 0, 0.92);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets */
@media (max-width: 1024px) {
    .title {
        font-size: 5.5rem;
        letter-spacing: 0.14em;
    }
    
    .subtitle {
        font-size: 1.8rem;
        letter-spacing: 0.5em;
    }
}

/* Medium screens */
@media (max-width: 900px) {
    .title {
        font-size: 4.5rem;
        letter-spacing: 0.12em;
    }
}

/* Tablet Portrait */
@media (max-width: 820px) {
    .title {
        font-size: 4rem;
        letter-spacing: 0.1em;
    }
    
    .subtitle {
        font-size: 1.6rem;
    }
}

/* Mobile Landscape */
@media (max-width: 767px) and (orientation: landscape) {
    .title {
        font-size: 3.2rem;
        letter-spacing: 0.12em;
    }
    
    .subtitle {
        font-size: 1.3rem;
        letter-spacing: 0.4em;
        margin-top: 1.5rem;
    }
    
    .content {
        max-width: 95%;
    }
}

/* Mobile Portrait */
@media (max-width: 767px) and (orientation: portrait) {
    .title {
        font-size: 2.8rem;
        letter-spacing: 0.1em;
        line-height: 1.35;
    }
    
    .subtitle {
        font-size: 1.3rem;
        letter-spacing: 0.45em;
        margin-top: 2rem;
    }
    
    .content {
        max-width: 90%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .title {
        font-size: 2.4rem;
        letter-spacing: 0.08em;
    }
    
    .subtitle {
        font-size: 1.1rem;
        letter-spacing: 0.35em;
        margin-top: 1.5rem;
    }
}

/* Very Small Mobile */
@media (max-width: 360px) {
    .title {
        font-size: 2rem;
        letter-spacing: 0.06em;
    }
    
    .subtitle {
        font-size: 1rem;
        letter-spacing: 0.3em;
    }
}

/* ===== PREMIUM PERFORMANCE OPTIMIZATIONS ===== */

/* Hardware acceleration hints */
.title,
.subtitle,
.title .letter,
.background {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent layout shifts during animation */
.content {
    will-change: contents;
}

/* GPU layer promotion for smooth animations */
@media (min-width: 768px) {
    .title {
        will-change: filter;
    }
    
    .subtitle {
        will-change: filter;
    }
}

/* ===== ACCESSIBILITY ===== */
/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .background,
    .title,
    .title .letter,
    .subtitle {
        animation: none !important;
        transition: none !important;
    }
    
    .background {
        transform: scale(1) !important;
    }
    
    .title .letter,
    .subtitle {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .title,
    .subtitle {
        filter: none !important;
    }
}

/* ===== LOADING STATE ===== */
body.loading .content {
    visibility: hidden;
}

body.loaded .content {
    visibility: visible;
}

/* ===== PERFORMANCE OPTIMIZATIONS FOR WEAK DEVICES ===== */
/* Detect low-end devices and reduce animation complexity */
@media (max-width: 767px) {
    /* Reduce glow intensity on mobile for better performance */
    .title .letter {
        text-shadow: 
            0 0 6px rgba(200, 0, 0, 0.6),
            0 0 12px rgba(139, 0, 0, 0.4),
            0 2px 6px rgba(0, 0, 0, 0.9);
        filter: drop-shadow(0 0 4px rgba(200, 0, 0, 0.3));
    }
    
    @keyframes letterFloat {
        0%, 100% {
            transform: translateY(0px);
        }
        50% {
            transform: translateY(-2px);
        }
    }
    
    .subtitle {
        text-shadow: 
            0 0 8px rgba(212, 175, 55, 0.6),
            0 0 16px rgba(212, 175, 55, 0.3),
            0 2px 6px rgba(0, 0, 0, 0.9);
        filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.3));
    }
    
    @keyframes subtitleShimmer {
        0%, 100% {
            opacity: 0.9;
        }
        50% {
            opacity: 1;
        }
    }
}

/* Extra optimization for very weak devices */
@media (max-width: 480px), (max-height: 600px) {
    /* Minimal animations for weakest devices */
    .title .letter.revealed {
        animation: none;
    }
    
    .subtitle.animated {
        animation: subtitleShimmerSimple 3s ease-in-out infinite;
    }
    
    @keyframes subtitleShimmerSimple {
        0%, 100% {
            opacity: 0.85;
        }
        50% {
            opacity: 1;
        }
    }
}

