/* lux-ux.css - Universal Command Palette & Transitions */

/* 1. Seamless Page Transitions */
.lux-transition-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #030303; z-index: 999999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.lux-transition-overlay.active {
    opacity: 1; pointer-events: all;
}

/* 2. Global Command Palette */
.cmd-palette-backdrop {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px);
    z-index: 999998; display: flex; justify-content: center; align-items: flex-start;
    padding-top: 15vh; opacity: 0; pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cmd-palette-backdrop.active {
    opacity: 1; pointer-events: all;
}
.cmd-palette {
    width: 600px; max-width: 90vw; background: rgba(15, 15, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transform: translateY(-20px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.cmd-palette-backdrop.active .cmd-palette {
    transform: translateY(0) scale(1);
}
.cmd-palette-header {
    padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#cmd-input {
    width: 100%; background: transparent; border: none; color: white;
    font-size: 1.1rem; outline: none; font-family: 'JetBrains Mono', monospace;
}
#cmd-input::placeholder { color: rgba(255, 255, 255, 0.3); }

.cmd-palette-results {
    max-height: 400px; overflow-y: auto; padding: 10px;
}
.cmd-group-label {
    padding: 10px; font-size: 0.65rem; color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
}
.cmd-item {
    padding: 12px 16px; border-radius: 8px; display: flex; align-items: center; gap: 12px;
    color: rgba(255, 255, 255, 0.7); font-size: 0.9rem; cursor: pointer; transition: all 0.15s;
}
.cmd-item.selected {
    background: rgba(41, 98, 255, 0.2); color: white;
    border-left: 2px solid #2962FF;
}
.cmd-icon {
    font-size: 1.1rem; width: 24px; text-align: center;
}

/* 3. Universal Custom Cursor & Lagging Ring */
.cursor {
    position: fixed;
    top: -100px;
    left: -100px;
    width: 8px;
    height: 8px;
    background: #ff3333;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000000;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.8);
    opacity: 0;
}
.cursor-ring {
    position: fixed;
    top: -100px;
    left: -100px;
    width: 30px;
    height: 30px;
    border: 1px solid #ffffff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s, opacity 0.3s;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
    opacity: 0;
}

/* Hover Scaling States */
.cursor.big {
    transform: translate(-50%, -50%) scale(2);
    background: #ff3333;
    box-shadow: 0 0 14px rgba(255, 51, 51, 1);
}
.cursor-ring.big {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: #ffffff;
    border-width: 2px;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background-color: #ff3333;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.8);
}

/* Hide standard cursor inside apps and portfolio when custom cursor is active */
body.custom-cursor-active, body.custom-cursor-active * {
    cursor: none !important;
}

/* Ensure inputs, selects, and textareas hide the default OS pointer */
body.custom-cursor-active input, 
body.custom-cursor-active textarea, 
body.custom-cursor-active select {
    cursor: none !important;
}

/* 4. Universal Premium Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold, #d4af37);
}

/* 5. Mobile Fullscreen Overlay and Global Layout Fixes */
@media screen and (max-width: 850px) {
    * { max-width: 100vw !important; box-sizing: border-box !important; }
    html, body { overflow-x: hidden !important; width: 100% !important; position: relative; }

    /* Hamburger Button */
    .hamburger-btn {
        display: flex !important;
        flex-direction: column; justify-content: center; align-items: center; gap: 5px;
        background: none; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
        padding: 8px 10px; cursor: pointer; z-index: 999999;
        transition: border-color 0.3s;
    }
    .hamburger-btn:hover { border-color: var(--accent-gold); }
    .hamburger-line {
        display: block; width: 22px; height: 2px;
        background: #fff; border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    }
    .hamburger-btn.active .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .hamburger-btn.active .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .hamburger-btn.active .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
    
    body.light-mode .hamburger-btn { border-color: rgba(0,0,0,0.15); }
    body.light-mode .hamburger-line { background: #1D1D1F; }

    /* Hide desktop nav */
    .nav-links, .nav-controls, #nav-links-desktop { display: none !important; }

    /* Compact floating nav bar */
    .nav-header {
        padding: 0.8rem 1.2rem !important;
        flex-direction: row !important;
        gap: 0 !important;
        width: calc(100% - 2rem) !important;
        top: 0.8rem !important;
        border-radius: 16px !important;
        justify-content: space-between !important;
    }
    .nav-logo { font-size: 1rem !important; }

    /* Fullscreen Menu Overlay */
    .mobile-menu-overlay {
        display: flex;
        position: fixed; inset: 0;
        background: rgba(3, 3, 3, 0.97);
        backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
        z-index: 99999;
        flex-direction: column;
        opacity: 0; pointer-events: none;
        transition: opacity 0.35s ease;
    }
    .mobile-menu-overlay.open { opacity: 1; pointer-events: auto; }
    body.light-mode .mobile-menu-overlay { background: rgba(245, 245, 247, 0.97); }

    .mobile-menu-inner {
        padding: 2rem; display: flex; flex-direction: column; height: 100%; width: 100%;
        overflow-y: auto;
    }
    .mobile-menu-header {
        display: flex; justify-content: space-between; align-items: center;
        border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 1.5rem; margin-bottom: 2rem;
    }
    body.light-mode .mobile-menu-header { border-bottom: 1px solid rgba(0,0,0,0.1); color: #1D1D1F; }

    .mobile-close-btn {
        background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer;
    }
    body.light-mode .mobile-close-btn { color: #1D1D1F; }

    .mobile-menu-links { display: flex; flex-direction: column; gap: 1.5rem; }
    .mobile-menu-links a {
        font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: 700; color: #fff;
        text-decoration: none; text-transform: uppercase; text-align: center;
    }
    body.light-mode .mobile-menu-links a { color: #1D1D1F; }
    .mobile-menu-links a:hover { color: var(--accent-gold); }

    .mobile-menu-divider {
        height: 1px; background: rgba(255,255,255,0.1); margin: 2rem 0;
    }
    body.light-mode .mobile-menu-divider { background: rgba(0,0,0,0.1); }

    .mobile-menu-sub-label {
        font-family: 'Space Mono', monospace; font-size: 0.75rem; color: #888;
        letter-spacing: 2px; margin-bottom: 1.5rem; text-align: center;
    }

    .mobile-menu-links.sub { gap: 1rem; }
    .mobile-menu-links.sub a { font-size: 1.1rem; font-weight: 500; font-family: 'Inter', sans-serif; }

    .mobile-menu-footer {
        margin-top: auto; padding-top: 2rem; display: flex; justify-content: center; align-items: center; gap: 1rem;
    }

    /* Force all grids to single column */
    .bento-works, .about-grid, .ecosystem-grid, .contact-modal, .stats-container, .cs-metrics, .cs-stack-grid, .cap-grid, .cs-split-grid, .bento-stats { 
        display: flex !important; flex-direction: column !important; width: 100% !important; 
        padding: 0 !important; gap: 1.2rem !important; margin: 0 !important;
    }
    
    .work-card, .eco-card, .stat-box, .scifi-card, .stat-card, .section { 
        width: 100% !important; min-width: unset !important; margin: 0 !important;
    }
    
    .work-card { min-height: 280px !important; border-radius: 20px !important; }
    .stat-card { padding: 1.5rem !important; border-radius: 20px !important; }
    .stat-num { font-size: 2.5rem !important; }

    /* Hide floating HUDs */
    #sys-hud, #audio-toggle, .core-hud, .sentinel-hud { display: none !important; }
    
    /* Fix canvases */
    #canvas-container { position: absolute; width: 100% !important; height: 100vh !important; overflow: hidden; }
    #canvas-container canvas { width: 100% !important; height: 100vh !important; object-fit: cover; }
    
    /* Typography Adjustments */
    .hero-title { font-size: 2.8rem !important; line-height: 1.05 !important; }
    .hero-title .hollow { font-size: 2.8rem !important; -webkit-text-stroke: 1px var(--text-main); }
    .hero-title::after { display: none !important; }
    h1, .contact-title { font-size: 2.2rem !important; }
    h2, .section-title { font-size: 1.8rem !important; }
    .hero-ctas { flex-direction: column; width: 100%; gap: 0.8rem; }
    .hero-ctas .btn { width: 100%; text-align: center; }
}
