/* ===================================
   SPLASH PAGE - AWWWARDS STYLE
   =================================== */

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

:root {
    --primary-blue: #4a7c9e;
    --deep-blue: #2c5f7d;
    --ocean-dark: #1a3a4a;
    --accent-cyan: #00d9ff;
    --accent-purple: #a855f7;
    --text-light: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --bg-dark: #0a0a0a;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    cursor: none;
}

/* ===================================
   LOADING SCREEN
   =================================== */

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.loaded {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.hourglass-loader {
    margin: 0 auto 2rem;
    animation: spin 2s infinite linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sand-top {
    animation: sand-fall 2s infinite ease-in-out;
}

@keyframes sand-fall {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--text-dim);
}

.loading-bar {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto 0.5rem;
    overflow: hidden;
    border-radius: 2px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    width: 0%;
    transition: width 0.3s ease;
}

.loading-percentage {
    font-size: 0.9rem;
    color: var(--text-dim);
    font-weight: 300;
}

/* ===================================
   CANVAS
   =================================== */

#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* ===================================
   SPLASH CONTENT
   =================================== */

#splash-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 2rem;
    pointer-events: none;
    opacity: 0;
    animation: fadeInContent 1s ease 0.5s forwards;
}

@keyframes fadeInContent {
    to { opacity: 1; }
}

/* ===================================
   LOGO
   =================================== */

.logo-container {
    text-align: center;
    pointer-events: none;
}

.brand-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.brand-z {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(0, 217, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(168, 85, 247, 0.8));
    }
}

.brand-rest {
    color: var(--text-light);
}

.brand-tagline {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ===================================
   CENTER MESSAGE
   =================================== */

.center-message {
    text-align: center;
    pointer-events: none;
}

.main-message {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.main-message .line {
    display: block;
    overflow: hidden;
}

.main-message .line::before {
    content: attr(data-text);
}

.sub-message {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 300;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

/* ===================================
   ENTER BUTTON
   =================================== */

.enter-button {
    position: relative;
    padding: 1.2rem 3rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border-radius: 50px;
    cursor: none;
    pointer-events: all;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.enter-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.enter-button:hover::before {
    width: 300%;
    height: 300%;
}

.enter-button:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-arrow {
    display: inline-block;
    margin-left: 0.5rem;
    transition: transform 0.4s ease;
}

.enter-button:hover .btn-arrow {
    transform: translateX(5px);
}

/* ===================================
   SCROLL INDICATOR
   =================================== */

.scroll-indicator {
    text-align: center;
    pointer-events: none;
    opacity: 0.6;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    margin: 0 auto 10px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll-down 2s infinite;
}

@keyframes scroll-down {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(16px);
    }
}

.scroll-indicator p {
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ===================================
   GRAIN OVERLAY
   =================================== */

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 100;
    animation: grain 0.5s steps(6) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -5%); }
    20% { transform: translate(-10%, 5%); }
    30% { transform: translate(5%, -10%); }
    40% { transform: translate(-5%, 15%); }
    50% { transform: translate(-10%, 5%); }
    60% { transform: translate(15%, 0); }
    70% { transform: translate(0, 10%); }
    80% { transform: translate(-15%, 0); }
    90% { transform: translate(10%, 5%); }
}

/* ===================================
   CUSTOM CURSOR
   =================================== */

.custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    transition: transform 0.15s ease, border-color 0.3s ease;
    mix-blend-mode: difference;
}

.custom-cursor.hover {
    transform: scale(1.5);
    border-color: var(--accent-purple);
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    body {
        cursor: auto;
    }

    #splash-content {
        padding: 2rem 1.5rem;
    }

    .main-message {
        margin-bottom: 1rem;
    }

    .enter-button {
        padding: 1rem 2rem;
        font-size: 0.9rem;
    }

    .scroll-indicator {
        display: none;
    }
}

/* ===================================
   PAGE TRANSITION
   =================================== */

body.transitioning #splash-content {
    animation: fadeOutContent 0.8s ease forwards;
}

body.transitioning #webgl-canvas {
    animation: zoomOut 1s ease forwards;
}

@keyframes fadeOutContent {
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

@keyframes zoomOut {
    to {
        transform: scale(1.5);
        opacity: 0;
    }
}
