:root {
    --bg: #050505;
    --text: #909090;
    --accent: #e0e0e0;
    --highlight: #e8740c;
    --highlight-glow: rgba(232, 116, 12, 0.3);
    --purple: #7b2fff;
    --purple-glow: rgba(123, 47, 255, 0.25);
    --font: 'JetBrains Mono', 'Courier New', Courier, monospace;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    user-select: none;
}

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

/* -- Login / Entry Screen ------------------------------------------------- */

#login-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--accent);
    letter-spacing: 6px;
    cursor: pointer;
    transition: opacity 0.5s;
}

#login-content { text-align: center; }

.login-btn {
    font-size: 18px;
    padding: 12px 28px;
    border: 1px solid var(--purple);
    text-align: center;
    transition: all 0.4s;
    font-weight: normal;
    color: var(--accent);
    opacity: 0.7;
    display: none;
    cursor: pointer;
    font-family: var(--font);
    background: none;
    text-transform: uppercase;
}

.login-btn:hover {
    border-color: var(--highlight);
    color: var(--highlight);
    opacity: 1;
    letter-spacing: 10px;
    box-shadow: 0 0 20px var(--highlight-glow);
}

/* -- Boot Sequence -------------------------------------------------------- */

#loading-ui {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#boot-sequence {
    max-height: 200px;
    overflow: hidden;
    text-align: left;
}

.boot-line {
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text);
    opacity: 0;
    animation: bootFadeIn 0.3s forwards;
    line-height: 1.8;
}

.boot-ready {
    color: var(--highlight);
    letter-spacing: 4px;
    font-size: 11px;
    margin-top: 6px;
}

@keyframes bootFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 0.7; transform: translateY(0); }
}

@keyframes blink {
    0%   { opacity: 0.4; }
    50%  { opacity: 1; }
    100% { opacity: 0.4; }
}

/* -- Main Interface ------------------------------------------------------- */

#interface {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10;
    pointer-events: none;
    display: none;
}

/* -- Sidebar -------------------------------------------------------------- */

#sidebar {
    width: 340px;
    height: 100%;
    background: rgba(5, 5, 5, 0.85);
    border-right: 1px solid rgba(123, 47, 255, 0.2);
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    pointer-events: all;
    backdrop-filter: blur(20px);
    z-index: 100;
}

#header {
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(232, 116, 12, 0.3);
    padding-bottom: 20px;
}

h1 {
    font-size: 13px;
    font-weight: normal;
    letter-spacing: 3px;
    margin: 0 0 5px 0;
    color: var(--accent);
}

.meta {
    font-size: 9px;
    opacity: 0.5;
    letter-spacing: 1px;
}

.contact-btn {
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.6;
    color: var(--highlight);
    margin-top: 8px;
    display: inline-block;
}

.contact-btn:hover {
    color: var(--accent);
    opacity: 1;
}

/* -- Project List --------------------------------------------------------- */

#project-list {
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #222 transparent;
    padding-right: 15px;
}

#project-list::-webkit-scrollbar       { width: 1px; }
#project-list::-webkit-scrollbar-track { background: transparent; }
#project-list::-webkit-scrollbar-thumb { background: #333; }
#project-list::-webkit-scrollbar-thumb:hover { background: var(--purple); }

.project-item {
    font-size: 11px;
    padding: 14px 0;
    border-bottom: 1px solid #151515;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    opacity: 0.5;
    letter-spacing: 0.5px;
}

.project-item:hover,
.project-item.active {
    opacity: 1;
    padding-left: 12px;
    color: var(--highlight);
    border-bottom: 1px solid var(--purple);
}

.project-id {
    font-size: 8px;
    opacity: 0.25;
    margin-right: 10px;
    color: var(--purple);
    display: inline-block;
    min-width: 48px;
    text-align: right;
    flex-shrink: 0;
}

/* -- Info Panel (bottom-right) -------------------------------------------- */

#info-panel {
    position: absolute;
    bottom: 40px; right: 40px;
    width: 400px;
    text-align: right;
    pointer-events: none;
    z-index: 50;
}

#info-title {
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--purple-glow);
    transition: all 0.4s ease;
}

#info-title.dreaming {
    text-transform: lowercase;
    font-style: italic;
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--purple);
    text-shadow: 0 0 20px var(--purple-glow), 0 0 40px rgba(123, 47, 255, 0.1);
    opacity: 0.7;
}

#info-desc {
    font-size: 11px;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
    font-style: italic;
    color: var(--text);
}

#info-desc.visible {
    max-height: 200px;
    opacity: 1;
}

/* -- Thought Stream ------------------------------------------------------- */

#thought-stream {
    margin-top: 20px;
    font-size: 8px;
    color: var(--purple);
    height: 100px;
    overflow: hidden;
    opacity: 0.6;
    font-style: italic;
    line-height: 1.5;
    letter-spacing: 0.3px;
}

/* -- Project Modal -------------------------------------------------------- */

#project-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(5, 5, 5, 0.9);
    z-index: 500;
    justify-content: center;
    align-items: center;
    pointer-events: all;
    backdrop-filter: blur(12px);
}

#modal-window {
    width: 800px;
    max-width: 90%;
    max-height: 85vh;
    background: #080808;
    border: 1px solid rgba(123, 47, 255, 0.25);
    padding: 50px;
    box-sizing: border-box;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 80px rgba(123, 47, 255, 0.08), 0 0 2px var(--purple-glow);
}

#modal-close {
    position: absolute;
    top: 18px; right: 18px;
    cursor: pointer;
    font-size: 9px;
    letter-spacing: 2px;
    color: #555;
    transition: color 0.3s;
}

#modal-close:hover { color: var(--highlight); }

#modal-body h2 {
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 25px;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(232, 116, 12, 0.2);
    padding-bottom: 12px;
}

#modal-body p {
    font-size: 12px;
    line-height: 1.8;
    margin-bottom: 18px;
    color: var(--text);
}

#modal-body img {
    width: 100%;
    margin-bottom: 25px;
    border: 1px solid #1a1a1a;
}

#modal-body a {
    color: var(--highlight);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 1px;
    transition: color 0.2s;
}

#modal-body a:hover {
    color: var(--accent);
}

#modal-body h1 {
    font-size: 16px;
    color: var(--accent);
    margin-bottom: 18px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 10px;
}

/* -- Mobile --------------------------------------------------------------- */

#mobile-menu-btn,
#mobile-menu,
#mobile-view-file {
    display: none;
}

@media (max-width: 768px) {
    #sidebar { display: none !important; }
    #info-panel { display: none !important; }

    #mobile-menu-btn {
        display: none;
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 200;
        font-size: 10px;
        letter-spacing: 3px;
        color: var(--accent);
        opacity: 0.6;
        cursor: pointer;
        pointer-events: all;
        padding: 8px 18px;
        border: 1px solid rgba(123, 47, 255, 0.3);
        background: rgba(5, 5, 5, 0.6);
        backdrop-filter: blur(10px);
        font-family: var(--font);
        transition: all 0.3s;
    }

    #mobile-menu-btn:active {
        opacity: 1;
        border-color: var(--highlight);
        color: var(--highlight);
    }

    #mobile-menu {
        display: none;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        z-index: 300;
        background: rgba(5, 5, 5, 0.92);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        pointer-events: all;
    }

    #mobile-menu.open {
        display: flex;
    }

    #mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 9px;
        letter-spacing: 2px;
        color: #555;
        cursor: pointer;
        font-family: var(--font);
        transition: color 0.3s;
    }

    #mobile-menu-close:active { color: var(--highlight); }

    #mobile-menu-header {
        margin-bottom: 30px;
        text-align: center;
    }

    #mobile-project-list {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        margin-bottom: 30px;
    }

    .mobile-project-item {
        font-size: 11px;
        letter-spacing: 1px;
        color: var(--text);
        opacity: 0.6;
        padding: 12px 24px;
        cursor: pointer;
        transition: all 0.2s;
        text-align: center;
        font-family: var(--font);
        border-bottom: 1px solid transparent;
    }

    .mobile-project-item:active,
    .mobile-project-item.active {
        opacity: 1;
        color: var(--highlight);
        border-bottom: 1px solid var(--purple);
    }

    #mobile-info-btn {
        font-size: 9px;
        letter-spacing: 2px;
        color: var(--highlight);
        opacity: 0.6;
        cursor: pointer;
        font-family: var(--font);
        transition: opacity 0.3s;
    }

    #mobile-info-btn:active { opacity: 1; }

    #mobile-view-file {
        display: none;
        position: fixed;
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 200;
        font-size: 10px;
        letter-spacing: 3px;
        color: var(--accent);
        opacity: 0.7;
        cursor: pointer;
        pointer-events: all;
        padding: 10px 24px;
        border: 1px solid rgba(123, 47, 255, 0.3);
        background: rgba(5, 5, 5, 0.6);
        backdrop-filter: blur(10px);
        font-family: var(--font);
        transition: all 0.3s;
    }

    #mobile-view-file.visible {
        display: block;
    }

    #mobile-view-file:active {
        opacity: 1;
        border-color: var(--highlight);
        color: var(--highlight);
    }

    /* Hide menu btn when menu or modal is open */
    #mobile-menu.open ~ #mobile-menu-btn { display: none; }

    /* Modal adjustments for mobile */
    #modal-window {
        max-width: 95%;
        padding: 30px 20px;
    }
}

/* -- Scanlines Overlay ---------------------------------------------------- */

.scanlines {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.08) 50%),
        linear-gradient(90deg, rgba(232, 116, 12, 0.02), rgba(123, 47, 255, 0.01), rgba(232, 116, 12, 0.02));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 20;
    opacity: 0.5;
}
