/* CSS Design Tokens and Variables */
:root {
    --bg-dark: #07070a;
    --card-bg-fallback: rgba(15, 15, 25, 0.7);
    --font-title: 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Cyberpunk Theme Colors */
    --cyberpunk-glow: rgba(0, 242, 254, 0.4);
    --cyberpunk-glow-hover: rgba(0, 242, 254, 0.8);
    --cyberpunk-primary: #00f2fe;
    --cyberpunk-secondary: #4facfe;
    --cyberpunk-accent: #ff007f;

    /* Fantasy Theme Colors */
    --fantasy-glow: rgba(0, 255, 136, 0.3);
    --fantasy-glow-hover: rgba(0, 255, 136, 0.7);
    --fantasy-primary: #00ff88;
    --fantasy-secondary: #60efff;
    --fantasy-accent: #ffd700;

    /* Cosmic Theme Colors */
    --cosmic-glow: rgba(185, 0, 255, 0.3);
    --cosmic-glow-hover: rgba(185, 0, 255, 0.8);
    --cosmic-primary: #b900ff;
    --cosmic-secondary: #e800ff;
    --cosmic-accent: #00ffff;
}

/* Reset and Core Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: #f0f0f5;
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
    user-select: none;
}

/* Intro Video Styling */
#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    background-color: var(--bg-dark);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
    overflow: hidden;
}

.video-bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(35px) brightness(0.35);
    transform: scale(1.15);
    z-index: 1;
    pointer-events: none; /* Prevents browser native video controls on click */
}

.video-foreground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    pointer-events: none; /* Prevents browser native video controls on click */
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, rgba(7, 7, 10, 0.8) 100%);
    pointer-events: none;
    z-index: 3;
}

/* Skip Button */
#skip-btn {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 24px;
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 101;
}

#skip-btn:hover {
    color: #00f2fe;
    border-color: #00f2fe;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
    transform: translateY(-2px);
    background: rgba(15, 15, 25, 0.8);
}

#skip-btn:active {
    transform: translateY(0);
}

#menu-container {
    position: relative;
    width: 100%; /* Uses available space excluding scrollbars, preventing horizontal wiggle */
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Stacks items from top to bottom naturally */
    align-items: center;
    padding: 60px 20px 120px 20px; /* Generous bottom padding to allow scrolling past 8B */
    gap: 35px; /* Adds consistent spacing between header and grid */
    z-index: 10;
    opacity: 1;
    transform: scale(1);
    transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-y: auto;
    overflow-x: hidden;
}
 
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2; /* Sits above bg-glows */
}

#menu-container.hidden {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

/* Ambient Background Glows */
.bg-glows {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 1; /* Sits below particle-canvas */
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    animation: drift 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--cyberpunk-primary), transparent 70%);
    top: -200px;
    left: -200px;
}

.orb-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--cosmic-primary), transparent 70%);
    bottom: -300px;
    right: -200px;
    animation-delay: -5s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Header Section */
.menu-header {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
    z-index: 2;
    flex-shrink: 0; /* Prevents header from shrinking on mobile */
}

.main-title {
    font-family: var(--font-title);
    font-size: 3.8rem;
    font-weight: 900;
    letter-spacing: 8px;
    line-height: 1.2;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 40%, rgba(255, 255, 255, 0.4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    animation: titleFlicker 4s infinite alternate;
}
 
@keyframes titleFlicker {
    0%, 95%, 98% { opacity: 1; filter: none; }
    96%, 97%, 99% { opacity: 0.95; filter: drop-shadow(0 0 2px rgba(0, 242, 254, 0.5)); }
}
 
.main-subtitle {
    font-size: 1.8rem;
    color: #8fa0dd;
    letter-spacing: 3px;
    line-height: 1.4;
    font-weight: 600;
}

/* Card Grid Layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    width: 100%;
    max-width: 1560px;
    padding: 20px;
    margin: auto 0;
    z-index: 2;
    flex-shrink: 0; /* Prevents cards container from squishing on mobile */
}

/* Card Wrapper (for 3D context) */
.card-wrapper {
    perspective: 1000px;
    width: 100%;
    height: auto;
}
 
.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    height: auto;
}
 
/* Individual Card Styling (1:1 square portrait image container) */
.card {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    background-color: var(--card-bg-fallback);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.15s ease-out, box-shadow 0.25s ease-out, border-color 0.25s ease-out;
    transform-style: preserve-3d;
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Card background image styling */
.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
}

/* Interactive card glow (adds dynamic spotlight) */
.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(circle 200px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.06), transparent 80%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover .card-glow {
    opacity: 1;
}

.card:hover .card-bg {
    transform: scale(1.06);
}

/* Card Gradient Overlays (Different themes) */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(to bottom, transparent 80%, rgba(7, 7, 10, 0.7) 100%);
    transition: background 0.4s ease;
}

/* Theme Borders & Glows */
.card-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    border: 2px solid transparent;
    pointer-events: none;
    z-index: 5;
    transition: border 0.4s ease, box-shadow 0.4s ease;
}

/* Cyberpunk Glow style */
.cyberpunk-theme .card-border {
    border-color: rgba(0, 242, 254, 0.15);
}
.cyberpunk-theme:hover .card {
    box-shadow: 0 15px 35px var(--cyberpunk-glow), inset 0 0 15px rgba(0, 242, 254, 0.15);
    border-color: var(--cyberpunk-primary);
}
.cyberpunk-theme:hover .card-border {
    border-color: var(--cyberpunk-primary);
    box-shadow: 0 0 20px var(--cyberpunk-glow-hover);
}
 
/* Fantasy Glow style */
.fantasy-theme .card-border {
    border-color: rgba(0, 255, 136, 0.15);
}
.fantasy-theme:hover .card {
    box-shadow: 0 15px 35px var(--fantasy-glow), inset 0 0 15px rgba(0, 255, 136, 0.15);
    border-color: var(--fantasy-primary);
}
.fantasy-theme:hover .card-border {
    border-color: var(--fantasy-primary);
    box-shadow: 0 0 20px var(--fantasy-glow-hover);
}
 
/* Cosmic Glow style */
.cosmic-theme .card-border {
    border-color: rgba(185, 0, 255, 0.15);
}
.cosmic-theme:hover .card {
    box-shadow: 0 15px 35px var(--cosmic-glow), inset 0 0 15px rgba(185, 0, 255, 0.15);
    border-color: var(--cosmic-primary);
}
.cosmic-theme:hover .card-border {
    border-color: var(--cosmic-primary);
    box-shadow: 0 0 20px var(--cosmic-glow-hover);
}

/* Card Button/Action */
.card-action {
    overflow: hidden;
    height: 52px;
    position: relative;
    border-radius: 6px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--font-title);
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 2px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
 
/* Theme specific buttons before hover to prevent getting buried */
.cyberpunk-theme .action-btn {
    border: 1.5px solid rgba(0, 242, 254, 0.4);
    background: rgba(7, 7, 10, 0.82);
    color: #00f2fe;
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
 
.fantasy-theme .action-btn {
    border: 1.5px solid rgba(0, 255, 136, 0.4);
    background: rgba(7, 7, 10, 0.82);
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
 
.cosmic-theme .action-btn {
    border: 1.5px solid rgba(185, 0, 255, 0.4);
    background: rgba(7, 7, 10, 0.82);
    color: #e800ff;
    text-shadow: 0 0 8px rgba(185, 0, 255, 0.6);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Button hover styles */
.cyberpunk-theme:hover .action-btn {
    background: linear-gradient(135deg, var(--cyberpunk-primary), var(--cyberpunk-secondary));
    color: #07070a;
    border-color: transparent;
    box-shadow: 0 0 15px var(--cyberpunk-primary);
}

.fantasy-theme:hover .action-btn {
    background: linear-gradient(135deg, var(--fantasy-primary), var(--fantasy-secondary));
    color: #07070a;
    border-color: transparent;
    box-shadow: 0 0 15px var(--fantasy-primary);
}

.cosmic-theme:hover .action-btn {
    background: linear-gradient(135deg, var(--cosmic-primary), var(--cosmic-secondary));
    color: #07070a;
    border-color: transparent;
    box-shadow: 0 0 15px var(--cosmic-primary);
}

/* Custom Scrollbar for Menu Container */
#menu-container::-webkit-scrollbar {
    width: 6px;
}
#menu-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
#menu-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        max-width: 900px;
    }
    .card-wrapper {
        height: auto;
    }
    .card-wrapper:last-child {
        grid-column: span 2;
        max-width: 440px;
        margin: 0 auto;
        width: 100%;
    }
    #menu-container {
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2.8rem;
        letter-spacing: 4px;
        margin-bottom: 10px;
        -webkit-text-fill-color: #ffffff; /* Fixes WebKit gradient clip + text-shadow overlap bug */
        text-shadow: none; /* Removes the dark shadow that bleeds over the text on mobile */
    }
    .main-subtitle {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    .card-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        max-width: 400px;
        padding: 10px;
    }
    .card-wrapper {
        height: auto;
    }
    .card-wrapper:last-child {
        grid-column: span 1;
    }
    #skip-btn {
        bottom: 20px;
        right: 20px;
        padding: 10px 20px;
        font-size: 0.8rem;
    }
    .video-foreground {
        transform: scale(1.35); /* Zoom in on portrait screens to make landscape video larger */
    }
}
