/* =========================================================
   --- TOP NAVIGATION BAR --- 
   ========================================================= */
/* INSTRUCTION: This is the container for the logo (left) and buttons (right). */
.sys-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 7000;
    pointer-events: none;
    /* Lets you click through empty space */
}

.sys-nav>* {
    pointer-events: auto;
}

/* Re-enables clicking on the actual buttons inside */

/* INSTRUCTION: Groups the identity and contact buttons so they stack cleanly on the right. */
.nav-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-center;
    gap: 15px;
}

.site-footer {
    position: fixed;
    right: 28px;
    bottom: 18px;
    z-index: 8600;
    min-width: 220px;
    padding-top: 8px;
    border-top: 1px solid #2a1e24;
    text-align: right;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.6rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.55;
    pointer-events: none;
}

body.project-active .site-footer {
    opacity: 0;
}

/* =========================================================
   --- HUB (MAIN INTERFACE) ATMOSPHERE --- 
   ========================================================= */
#hub {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #050105;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hub-bubbles-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* INSTRUCTION: This is the main canvas area (80% wide, 85% tall) inside which all blobs orbit. */
.blocks-container {
    position: relative;
    width: 80vw;
    height: 85vh;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* =========================================================
   --- VIEWER (PROJECT DETAILS SIDEBAR) --- 
   ========================================================= */
/* INSTRUCTION: This block of code governs the sliding right panel that appears when you click a category. */
#viewer {
    position: fixed;
    top: 0;
    left: 100vw;
    width: 100vw;
    height: 100vh;
    background: var(--bg-panel);
    z-index: 8000;
    display: flex;
    transition: left 0.6s cubic-bezier(0.85, 0, 0.15, 1);
}

#viewer.active {
    left: 0;
}

/* INSTRUCTION: The dark left-hand column inside the viewer that lists the projects. */
.sidebar {
    width: 420px;
    background: var(--bg-deep);
    padding: 60px 50px;
    border-right: 2px solid #2a1e24;
    display: flex;
    flex-direction: column;
}

/* INSTRUCTION: The large right-hand scrolling area showing the project details and images. */
.content {
    flex: 1;
    padding: 80px 120px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: var(--bg-panel);
}

.content::-webkit-scrollbar-thumb {
    background: #2a1e24;
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.viewer-footer {
    margin-top: 80px;
    padding: 24px 0 10px;
    border-top: 1px solid #2a1e24;
    color: var(--text-muted);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.6rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

/* =========================================================
   --- PROJECT LIST & CONTENT VIEWER ITEMS --- 
   ========================================================= */
.img-grid {
    column-count: 3;
    /* 3 masonry columns on desktop */
    column-gap: 40px;
    width: 100%;
}

/* Visual Art category: denser desktop grid */
.cat-visual-art .img-grid {
    column-count: 4;
}

/* Scale down to 2 columns on tablet/smaller screens */
@media (max-width: 1200px) {
    .img-grid {
        column-count: 2;
    }
}

/* Sidebar Footer Contact Link */
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #2a1e24;
    /* Visual separator */
}

.sidebar-footer a {
    color: var(--active-color, var(--text-light));
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    text-transform: lowercase;
    display: inline-block;
    /* Behave like a button */
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.sidebar-footer a:hover {
    border-bottom-color: var(--active-color, var(--text-light));
}

/* Phones: two columns */
@media (max-width: 768px) {
    .img-grid {
        column-count: 2;
        column-gap: 24px;
    }

    .cat-visual-art .img-grid {
        column-count: 2;
    }
}

/* Very narrow phones can fall back to a single column */
@media (max-width: 520px) {
    .img-grid {
        column-count: 1;
    }
}

/* =========================================================
   --- RESPONSIVE DESIGN (TABLET & MOBILE LAYOUTS) --- 
   ========================================================= */
@media (max-width: 1366px) {
    body {
        overflow-y: auto !important;
        overflow-x: hidden;
        height: auto;
        --nav-height: 250px;
    }

    .sys-nav {
        position: relative;
        z-index: 7000;
        background: transparent;
        padding: 30px 50px;
        backdrop-filter: none;
        border-bottom: none;
    }

    #hub {
        display: block;
        height: auto;
        min-height: 100vh;
        padding: 0 20px 80px;
    }

    .hub-bubbles-container {
        position: fixed;
    }

    .system-ghost-text {
        display: none;
    }

    .blocks-container {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 50px;
        max-width: 500px;
        margin: 0 auto;
        transform: none !important;
        perspective: none;
    }

    .img-grid {
        grid-template-columns: 1fr;
    }

    /* PERF: disable heavy blur animations on smaller screens to reduce GPU load. */
    .hub-bubble,
    .bubble,
    .bg-outline-bubble {
        animation: none !important;
    }

    .b1, .b3,
    .glow-purple-top-left,
    .glow-red-bottom-right,
    .glow-top-left,
    .glow-bottom-right,
    .glow-accent-pink {
        filter: none !important;
        will-change: auto !important;
    }
}

@media (max-width: 768px) {
    .sys-nav {
        padding: 20px;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .site-footer {
        right: 16px;
        bottom: 12px;
        min-width: auto;
        font-size: 0.55rem;
        text-align: right;
        max-width: 90vw;
    }

    .nav-actions {
        align-items: center;
        gap: 15px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .blocks-container {
        margin-top: 40px;
        gap: 40px;
    }

    #viewer {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 20px 18px;
        border-right: none;
        border-bottom: 2px solid #2a1e24;
    }

    .content {
        padding: 24px 18px;
    }

    .viewer-footer {
        margin-top: 60px;
        font-size: 0.55rem;
    }
}
