/* ========================================
   THE VOID - Grayscale Glitch Theme
   ======================================== */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'WDXL Lubrifont JP N', sans-serif;
    background-color: #000;
    color: #e5e5e5;
    overflow-x: hidden;
    height: 8000px;
}

/* ========================================
   Canvas & Containers
   ======================================== */

#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#css3d-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

#css3d-container * {
    pointer-events: auto;
}

/* ========================================
   Scanline Overlay
   ======================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Noise Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' 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: 9998;
    animation: noiseMove 0.5s steps(10) infinite;
}

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

/* ========================================
   3D Panel Styling
   ======================================== */

.panel-3d {
    font-family: 'WDXL Lubrifont JP N', sans-serif;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2rem;
    border-radius: 2px;
    box-shadow: 0 0 80px rgba(255, 255, 255, 0.05),
                inset 0 0 60px rgba(0, 0, 0, 0.5),
                0 0 1px rgba(255, 255, 255, 0.3);
    color: #e5e5e5;
    backface-visibility: hidden;
    position: relative;
}

/* Panel glitch border effect */
.panel-3d::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    background-size: 200% 200%;
    animation: borderGlitch 4s ease infinite;
    z-index: -1;
    opacity: 0;
}

.panel-3d:hover::before {
    opacity: 1;
}

@keyframes borderGlitch {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================
   Typography
   ======================================== */

.text-gradient {
    background: linear-gradient(to right, #ffffff, #aaaaaa, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGlitch 3s ease-in-out infinite;
}

@keyframes textGlitch {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; transform: translateX(-2px); }
    94% { opacity: 1; transform: translateX(2px); }
    95% { opacity: 0.9; transform: translateX(0); }
}

h1, h2, h3 {
    font-family: 'WDXL Lubrifont JP N', sans-serif;
}

.glow-text {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
                 0 0 20px rgba(255, 255, 255, 0.3),
                 0 0 40px rgba(255, 255, 255, 0.1);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
                     0 0 20px rgba(255, 255, 255, 0.3),
                     0 0 40px rgba(255, 255, 255, 0.1);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.7),
                     0 0 30px rgba(255, 255, 255, 0.5),
                     0 0 60px rgba(255, 255, 255, 0.2);
    }
}

/* Glitch text effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff0000;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    animation: glitchTop 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: 2px 0 #00ffff;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    animation: glitchBottom 1.5s infinite linear alternate-reverse;
}

@keyframes glitchTop {
    0%, 100% { clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%); transform: translate(0); }
    20% { clip-path: polygon(0 15%, 100% 15%, 100% 40%, 0 40%); transform: translate(-2px); }
    40% { clip-path: polygon(0 10%, 100% 10%, 100% 35%, 0 35%); transform: translate(2px); }
    60% { clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%); transform: translate(-1px); }
    80% { clip-path: polygon(0 5%, 100% 5%, 100% 30%, 0 30%); transform: translate(1px); }
}

@keyframes glitchBottom {
    0%, 100% { clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%); transform: translate(0); }
    20% { clip-path: polygon(0 60%, 100% 60%, 100% 90%, 0 90%); transform: translate(2px); }
    40% { clip-path: polygon(0 65%, 100% 65%, 100% 95%, 0 95%); transform: translate(-2px); }
    60% { clip-path: polygon(0 50%, 100% 50%, 100% 85%, 0 85%); transform: translate(1px); }
    80% { clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%); transform: translate(-1px); }
}

/* ========================================
   Navigation
   ======================================== */

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(0, 0, 0, 0.95);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-logo {
    font-family: 'WDXL Lubrifont JP N', sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: white;
    letter-spacing: 0.2em;
}

.nav-links {
    display: none;
}

.nav-cta {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.nav-cta:hover::before {
    left: 100%;
}

.nav-cta:hover {
    background: white;
    color: black;
}

/* ========================================
   Progress Indicator
   ======================================== */

.progress-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 8px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: white;
    border-color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5),
                0 0 30px rgba(255, 255, 255, 0.2);
}

/* ========================================
   Scroll Hint
   ======================================== */

.scroll-hint {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    animation: pulse 2s infinite;
    font-size: 0.75rem;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) translateY(0); }
    50% { opacity: 1; transform: translateX(-50%) translateY(-5px); }
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   Buttons
   ======================================== */

.btn-gold {
    background: linear-gradient(135deg, #333, #666, #fff, #666, #333);
    background-size: 200% 200%;
    animation: shimmer 3s ease infinite;
    color: #000;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gold::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.btn-gold:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3),
                0 0 60px rgba(255, 255, 255, 0.1);
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* ========================================
   Depth Indicator
   ======================================== */

.depth-indicator {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.2em;
    font-family: monospace;
}

/* ========================================
   Lane Switcher (Header)
   ======================================== */

.lane-switcher {
    display: flex;
    flex-direction: row;
    gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    padding: 2px;
}

.lane-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'WDXL Lubrifont JP N', sans-serif;
    font-size: 8px;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lane-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.lane-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

.lane-name {
    white-space: nowrap;
}

/* ========================================
   Responsive: Tablet and Desktop (768px+)
   ======================================== */

@media (min-width: 768px) {
    .nav-container {
        padding: 1rem 2rem;
    }

    .nav-logo {
        font-size: 1.5rem;
    }

    .nav-links {
        display: flex;
        gap: 2rem;
    }

    .nav-links a {
        color: #9ca3af;
        font-size: 0.8rem;
        letter-spacing: 0.1em;
        text-decoration: none;
        transition: color 0.3s ease;
        position: relative;
    }

    .nav-links a::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 1px;
        background: white;
        transition: width 0.3s ease;
    }

    .nav-links a:hover {
        color: white;
    }

    .nav-links a:hover::after {
        width: 100%;
    }

    .nav-cta {
        padding: 0.5rem 1.5rem;
        font-size: 0.8rem;
    }

    .progress-bar {
        bottom: 30px;
        gap: 10px;
    }

    .progress-dot {
        width: 12px;
        height: 12px;
    }

    .scroll-hint {
        bottom: 80px;
        font-size: 0.875rem;
    }

    .btn-gold, .btn-outline {
        padding: 1rem 2rem;
        font-size: 0.9rem;
    }

    .depth-indicator {
        right: 30px;
        font-size: 12px;
    }

    .panel-3d {
        padding: 3rem;
    }

    .lane-switcher {
        gap: 4px;
        padding: 3px;
    }

    .lane-btn {
        padding: 6px 12px;
        font-size: 10px;
    }
}
