/**
 * Kamos Intelligent Machine - Cybernetic HUD & 2Advanced Style
 */

:root {
    --cyber-emerald: #10b981;
    --cyber-cyan: #10b981; /* alias for compatibility */
    --cyber-purple: #a855f7;
    --cyber-moss: #0d281e;
    --cyber-bg: #030c08;
    --hud-glass: rgba(7, 22, 16, 0.82);
    --hud-border: rgba(16, 185, 129, 0.32);
    --hud-border-glow: rgba(16, 185, 129, 0.65);
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll !important;
}

body {
    background-color: var(--cyber-bg);
    color: #f8fafc;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
}

/* 100vh First-View 3D Viewport (Scrolls naturally with hero, no fixed chasing) */
#metropolis-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: grab;
    outline: none;
}
#metropolis-stage:active {
    cursor: grabbing;
}

/* CRT Scanline & Vignette Overlay */
.scanline-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
                radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.75) 100%);
    background-size: 100% 3px, 100% 100%;
    opacity: 0.65;
}

/* 2Advanced Style HUD Glass Panels */
.hud-glass-panel {
    background: var(--hud-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--hud-border);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.1), inset 0 0 15px rgba(16, 185, 129, 0.05);
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.hud-glass-panel:hover {
    border-color: var(--hud-border-glow);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.2);
}

/* Metallic Deck Background using Extracted Card Texture */
#hud-code-deck {
    background: linear-gradient(135deg, rgba(7, 22, 16, 0.88) 0%, rgba(3, 12, 8, 0.94) 100%);
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.15), inset 0 0 20px rgba(139, 92, 246, 0.05);
}

/* HUD Corner Brackets (2A Signature Target Framing) */
.hud-bracket-top-left {
    position: absolute;
    top: -1px;
    left: -1px;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--cyber-cyan);
    border-left: 2px solid var(--cyber-cyan);
    pointer-events: none;
}
.hud-bracket-top-right {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-top: 2px solid var(--cyber-cyan);
    border-right: 2px solid var(--cyber-cyan);
    pointer-events: none;
}
.hud-bracket-bottom-left {
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid var(--cyber-cyan);
    border-left: 2px solid var(--cyber-cyan);
    pointer-events: none;
}
.hud-bracket-bottom-right {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid var(--cyber-cyan);
    border-right: 2px solid var(--cyber-cyan);
    pointer-events: none;
}

/* Left Node Buttons */
.node-btn {
    background: rgba(8, 17, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.node-btn:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateX(2px);
}
.node-btn.active {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--cyber-cyan);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.25), inset 0 0 10px rgba(0, 240, 255, 0.15);
}
.node-btn.active .node-name {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

/* Right Code Deck Slide & Collapse */
#hud-code-deck {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}
#hud-code-deck.collapsed {
    transform: translateX(calc(100% - 44px));
    opacity: 0.85;
}

/* Cyber Sliders */
.cyber-range {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(15, 30, 50, 0.8);
    border-radius: 2px;
    outline: none;
    border: 1px solid rgba(0, 240, 255, 0.2);
}
.cyber-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: var(--cyber-cyan);
    cursor: pointer;
    box-shadow: 0 0 10px var(--cyber-cyan);
    border: 1px solid #ffffff;
    transition: transform 0.15s ease;
}
.cyber-range::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

/* Reticle Aim in Viewport Center */
.center-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 8;
    width: 44px;
    height: 44px;
    opacity: 0.35;
    transition: opacity 0.3s ease;
}
.center-reticle svg {
    width: 100%;
    height: 100%;
    stroke: var(--cyber-cyan);
}

/* Custom Scrollbar for Code Deck */
.code-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.code-content::-webkit-scrollbar-track {
    background: #020610;
}
.code-content::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.25);
    border-radius: 3px;
}
.code-content::-webkit-scrollbar-thumb:hover {
    background: var(--cyber-cyan);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #hud-left-nodes {
        max-width: 220px;
    }
    #hud-code-deck {
        max-width: 320px;
    }
}
@media (max-width: 768px) {
    #hud-left-nodes {
        position: fixed;
        bottom: 70px;
        left: 12px;
        width: auto;
        max-width: calc(100vw - 24px);
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
    }
    #hud-left-nodes .node-btn {
        width: auto;
        padding: 6px 10px;
    }
    #hud-code-deck {
        position: fixed;
        bottom: 130px;
        right: 12px;
        left: 12px;
        max-width: none;
        max-height: 45vh;
    }
    #hud-code-deck.collapsed {
        transform: translateY(calc(100% - 36px));
    }
}

/* Moss Palette Classes */
.bg-moss-950 { background-color: #030c08; }
.bg-moss-900 { background-color: #071610; }
.bg-moss-800 { background-color: #0f261c; }

/* 2 Advanced Homage Loader Styles & Keyframes */
@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes spinReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}
.animate-spin-slow {
    animation: spinSlow 20s linear infinite;
}
.animate-spin-reverse {
    animation: spinReverse 12s linear infinite;
}

#machine-loader-overlay {
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#machine-loader-overlay.loaded {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.08);
    pointer-events: none;
}

