:root {
    --bg-dark: #050505;
    --matrix-green: #e0e0e0;
    --matrix-dark-green: #555555;
    --wonderland-purple: #9000ff; /* Kept for H1 */
    --wonderland-magenta: #ff00bf; /* Kept for H1 */
    --gold: #ffffff;
    --gold-glow: rgba(255, 255, 255, 0.4);
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.15);
    
    font-size: 16px;
}

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

body, html {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-dark);
    color: white;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* --- TYPOGRAPHY --- */
.matrix-text {
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.1em;
    color: var(--matrix-green);
    text-shadow: 0 0 5px var(--matrix-dark-green);
}

.wonderland-text {
    font-family: 'Cinzel', serif;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.text-small {
    font-size: 0.8rem;
}

/* --- EFFECTS & UTILITIES --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.2; /* Subtly in the background */
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
}

/* --- HEADER --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    text-align: center;
    padding: 2rem;
    background: radial-gradient(circle at center, transparent 0%, #050505 80%);
}

.cryptic-message {
    margin-bottom: 2rem;
    z-index: 2;
}

.cryptic-message p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.cryptic-message h1 {
    font-size: 4rem;
    background: -webkit-linear-gradient(45deg, #ff8c00, #ff2a00, #8a0303);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(255, 42, 0, 0.6));
}

.symbol-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    margin: 2rem 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.symbol-container:hover {
    transform: scale(1.05);
}

#festival-symbol {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gradient-text-glow {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: -webkit-linear-gradient(45deg, #00ffff, var(--wonderland-magenta), var(--wonderland-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(255, 0, 191, 0.6));
    animation: textPulseGlow 4s ease-in-out infinite alternate;
}

@keyframes textPulseGlow {
    0% { filter: drop-shadow(0 0 10px rgba(144, 0, 255, 0.5)) brightness(1); }
    100% { filter: drop-shadow(0 0 25px rgba(255, 0, 191, 0.9)) brightness(1.2); }
}

.scroll-prompt {
    position: absolute;
    bottom: 40px;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* --- MAIN CONTENT --- */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 6rem;
    position: relative;
    z-index: 2;
}

.info-section .glass-panel,
.signup-section .glass-panel {
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: box-shadow 0.5s ease;
}

.info-section .glass-panel:hover,
.signup-section .glass-panel:hover {
    box-shadow: 0 0 70px rgba(255, 255, 255, 0.25), inset 0 0 30px rgba(255, 255, 255, 0.08);
}

.info-section h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.neon-gold { color: #ffffff; text-shadow: 0 0 10px rgba(255,255,255,0.4); }
.neon-purple { color: #ffffff; text-shadow: 0 0 15px rgba(255,255,255, 0.5); }

.subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    border-left: 2px solid var(--matrix-green);
    padding-left: 1.5rem;
}

.label {
    color: #e0e0e0;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    margin-right: 0.5rem;
}

.description {
    font-size: 1.25rem;
    line-height: 1.6;
    max-width: 80%;
}

/* Image Grid Placeholders */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.grid-card {
    height: 250px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.grid-card:hover { transform: translateY(-10px) scale(1.02); }
.grid-card:nth-child(1) { background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.1)); }
.grid-card:nth-child(2) { background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(0,0,0,0.1)); }
.grid-card:nth-child(3) { background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.1)); }

/* Signup Section */
.signup-section { text-align: center; }
.signup-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.matrix-btn {
    display: inline-block;
    padding: 1rem 3rem;
    margin: 2rem 0;
    color: var(--bg-dark);
    background-color: var(--matrix-green);
    border: 1px solid var(--matrix-green);
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 4px;
    box-shadow: 0 0 15px var(--matrix-dark-green);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.matrix-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.matrix-btn:hover {
    background-color: transparent;
    color: var(--matrix-green);
    box-shadow: 0 0 25px var(--matrix-green) inset;
}

.matrix-btn:hover::before { left: 100%; }

.iframe-note { font-size: 0.8rem; margin-bottom: 2rem; opacity: 0.5; }

iframe {
    border-radius: 8px;
    background: rgba(255,255,255,0.05); /* So it has a skeleton UI feel before loading */
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 3rem;
    opacity: 0.5;
}

/* --- ANIMATION CLASSES (Handled by JS) --- */
.fade-in-delayed { animation: fadeUp 2s ease forwards 1s; opacity: 0; transform: translateY(20px); }
.fade-in-delayed-more { animation: fadeUp 3s ease forwards 2s; opacity: 0; transform: translateY(30px); }
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 0.15em solid var(--matrix-green);
    margin: 0 auto;
    animation: typing 2.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}
@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--matrix-green); }
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.fade-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RED MOON SECTION --- */
.red-moon-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
}

.red-moon-container {
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#red-moon-visual {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 25px rgba(255, 0, 0, 0.4));
    animation: gentleBob 6s ease-in-out infinite alternate;
}

@keyframes gentleBob {
    0% { transform: translateY(0); filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.3)); }
    100% { transform: translateY(-15px); filter: drop-shadow(0 0 40px rgba(255, 0, 0, 0.6)); }
}

/* --- GALLERY PLACEHOLDERS --- */
.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    mix-blend-mode: luminosity;
    opacity: 0.7;
    transition: opacity 0.3s ease, mix-blend-mode 0.3s ease;
}

.grid-card:hover .gallery-img {
    opacity: 1;
    mix-blend-mode: normal;
}

/* --- TYPEFORM CONTAINER --- */
.typeform-container {
    width: 100%;
    height: 600px;
    margin-top: 2rem;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
}

/* --- GATEWAY PORTAL --- */
.gateway-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.gateway-panel {
    text-align: center;
    max-width: 450px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gateway-panel h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.gateway-prompt {
    margin-bottom: 2rem;
    opacity: 0.7;
}

.password-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.matrix-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--matrix-dark-green);
    color: #ffffff;
    font-family: 'Space Mono', monospace;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 4px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.matrix-input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.small-btn {
    padding: 1rem 2rem;
    margin: 0;
    width: 100%;
}

.error-text {
    color: rgba(255, 50, 50, 0.8);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.hidden {
    display: none;
}

.shake {
    animation: shakeAnim 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeAnim {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.gateway-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
}

.back-link {
    color: var(--wonderland-magenta);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.5rem 1.5rem;
    border: 1px solid rgba(255, 0, 191, 0.4);
    border-radius: 20px;
    background: rgba(255, 0, 191, 0.05);
    box-shadow: 0 0 15px rgba(255, 0, 191, 0.2);
}

.back-link:hover {
    text-shadow: 0 0 10px var(--wonderland-magenta);
    border-color: rgba(255, 0, 191, 0.8);
    background: rgba(255, 0, 191, 0.1);
    box-shadow: 0 0 25px rgba(255, 0, 191, 0.5);
    transform: translateY(-2px);
}

/* ========================================= */
/* --- MASSIVE MOBILE OPTIMIZATION LAYER --- */
/* ========================================= */
@media (max-width: 768px) {
    /* Ensure Hero takes up exact screen on mobile */
    .hero {
        padding: 1rem;
        justify-content: center;
        overflow: hidden; /* Prevent horizontal scroll */
    }
    
    .cryptic-message { 
        margin-bottom: 0.5rem; 
        width: 100%;
        padding: 0 1rem;
    }
    
    .cryptic-message p {
        font-size: 0.9rem; /* Smaller to fit */
    }
    
    /* Fix the typewriter breaking the viewport width */
    .typewriter {
        white-space: normal !important;
        animation: none !important;
        border-right: none !important;
        width: 100% !important;
    }
    
    .cryptic-message h1 { 
        font-size: 2.2rem; 
        line-height: 1.2;
    }
    
    .matrix-btn {
        width: auto; /* Revert from 100% block */
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }
    
    /* Make symbol distinct but not overwhelming */
    .symbol-container {
        width: 200px;
        height: 200px;
        margin: 1rem 0;
    }
    
    /* Prominent Red Moon guiding layout */
    .red-moon-section {
        padding: 2rem 1rem 4rem 1rem;
    }
    
    .red-moon-container {
        width: 100%; /* Full mobile width */
        max-width: 300px;
        height: auto;
        aspect-ratio: 1/1;
    }
    
    /* Optimize Panels */
    .glass-panel { 
        padding: 2rem 1.5rem; 
        border-radius: 12px;
    }
    
    /* Readable text sizes */
    .info-section h2 { font-size: 2rem; }
    .description { font-size: 1rem; }
    
    /* Grid to flexbox for cards */
    .image-grid { 
        display: flex;
        flex-direction: column;
        gap: 1.5rem; 
    }
    
    .grid-card { height: 250px; }

    /* Hide graphic2 and graphic3 */
    .grid-card:nth-child(2),
    .grid-card:nth-child(3) {
        display: none !important;
    }
    
    /* Emphasize Typeform and ensure height doesn't clip */
    .typeform-container {
        height: 500px; 
    }
    
    /* gateway mobile tweak */
    .gateway-panel {
        padding: 2rem 1rem;
    }
}
