/* ============================================
   nonewthing1 — Portfolio
   ============================================ */

body {
    background-color: #151315;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    margin: 0;
    font-family: 'Space Mono', monospace;
}

/* ----- Video Container ----- */

.video-container {
    width: 50%;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background-color: #000;
    overflow: hidden;
    z-index: 1;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.video-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

/* ----- Loading Overlay ----- */

.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(21, 19, 21, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-loading.active {
    opacity: 1;
}

.loading-text {
    color: #00ff00;
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.loading-text::after {
    content: '.';
    animation: loading-dots 1.5s infinite step-end;
}

@keyframes loading-dots {
    0%  { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
}

/* ----- Navigation ----- */

.nav-container {
    width: calc(50% - 6rem);
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 3rem;
    text-align: left;
    background-color: #151315;
    padding: 3rem;
    position: fixed;
    bottom: 3rem;
    left: 50%;
    z-index: 2;
}

.nav-container a {
    color: #00ff00;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 0.3rem 0;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-container a.dimmed {
    color: #336b33;
}

.nav-container a.hover-active {
    color: #00ff00;
}

.coming-soon {
    color: #336b33 !important;
    cursor: default !important;
}

/* ----- Project Details ----- */

.project-details {
    position: fixed;
    top: 0;
    left: 50%;
    width: calc(50% - 6rem);
    max-height: calc(100vh - 18rem);
    padding: 3rem;
    color: #e0e0e0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    background-color: #151315;
    z-index: 1;
}

.project-details.visible {
    opacity: 1;
    pointer-events: auto;
}

.project-details h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    font-weight: normal;
    color: #ffffff;
}

.project-details h2 {
    font-size: 1.2rem;
    margin: 0 0 1.5rem 0;
    color: #cccccc;
    font-weight: normal;
}

.project-details p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 3rem 0;
    color: #e0e0e0;
}

.project-details p a {
    color: #00ff00;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.project-details p a:hover {
    opacity: 0.8;
}

/* Description scrolling — desktop */

.project-details .description {
    overflow-y: auto;
    height: 100%;
    max-height: calc(100vh - 24rem);
    padding-bottom: 6rem;
    margin-bottom: 3rem;
    scrollbar-width: thin;
    scrollbar-color: #00ff00 #151315;
}

.project-details .description::-webkit-scrollbar {
    width: 2px;
}

.project-details .description::-webkit-scrollbar-track {
    background: #151315;
}

.project-details .description::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 1px;
}

.project-details .description::-webkit-scrollbar-button {
    display: block;
    height: 4px;
    background-color: #00ff00;
}

/* ----- Back Overlay (hidden on desktop) ----- */

.back-overlay {
    display: none;
}

.back-button {
    color: #00ff00;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    letter-spacing: 2px;
    padding-right: 2rem;
    padding-bottom: 1rem;
    user-select: none;
}

/* ============================================
   PORTRAIT / MOBILE
   ============================================ */

@media (orientation: portrait) {
    body {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
        position: relative;
    }

    .video-container {
        width: 100%;
        height: 55vh;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1;
    }

    .video-container video,
    .video-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .nav-container {
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 1.5rem 2rem 2rem;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem 2rem;
        background-color: rgba(21, 19, 21, 0.95);
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 3;
        display: grid;
        align-content: center;
        min-height: 35vh;
        max-height: 40vh;
        overflow: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        opacity: 1;
        visibility: visible;
    }

    .nav-container.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .nav-container a {
        font-size: min(3.8vw, 1.5rem);
        padding: 1.5rem 0;
        text-align: center;
        letter-spacing: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.2;
        transition: opacity 0.3s ease;
    }

    .nav-container a.coming-soon {
        font-size: min(3.2vw, 1.2rem);
        opacity: 0.5;
    }

    .nav-container a.dimmed {
        opacity: 0;
        pointer-events: none;
    }

    /* Project details — mobile */

    .project-details {
        width: 100%;
        height: 40vh;
        max-height: none;
        position: fixed;
        top: 60vh;
        left: 0;
        padding: 0;
        z-index: 2;
        pointer-events: none;
        opacity: 0;
        transform: translateY(100%);
        transition: transform 0.3s ease, opacity 0.3s ease;
        background-color: transparent;
    }

    .project-details .header {
        position: absolute;
        bottom: calc(40vh - 0.1rem);
        left: 0;
        width: 100%;
        padding: 4rem 2rem 2rem 2rem;
        background: linear-gradient(to top,
            #151315 0%,
            rgba(21,19,21,0.85) 40%,
            rgba(21,19,21,0.4) 70%,
            transparent 100%
        );
        z-index: 2;
        box-sizing: border-box;
    }

    .project-details .description {
        width: 100%;
        height: calc(40vh - 2rem);
        max-height: none;
        padding: 2rem;
        padding-top: 3rem;
        overflow-y: auto;
        background-color: #151315;
        box-sizing: border-box;
        margin-bottom: 0;
        padding-bottom: 6rem;
    }

    .project-details h1 {
        font-size: min(8vw, 6rem);
        margin-bottom: 0.5rem;
        color: #fff;
        line-height: 1.1;
        text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }

    .project-details h2 {
        font-size: min(6vw, 3rem);
        margin-bottom: 0;
        color: rgba(255,255,255,0.9);
        line-height: 1.2;
        text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }

    .project-details p {
        font-size: min(4.5vw, 3rem);
        line-height: 1.4;
        margin: 0;
        color: #e0e0e0;
    }

    .project-details p a {
        color: #00ff00;
        text-decoration: none;
    }

    .project-details.visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Back overlay — mobile only */

    .back-overlay {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 4rem;
        background: rgba(21, 19, 21, 0.95);
        z-index: 4;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-right: 2rem;
        padding-bottom: 1rem;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .back-overlay.visible {
        opacity: 1;
        visibility: visible;
    }
}

/* ----- Smaller phones ----- */

@media (orientation: portrait) and (max-height: 700px) {
    .nav-container {
        min-height: 32vh;
        height: 32vh;
        gap: 2.5rem 1.5rem;
    }

    .nav-container a {
        font-size: min(3.5vw, 1.3rem);
        padding: 1.2rem 0;
    }
}

/* ----- Larger tablets ----- */

@media (orientation: portrait) and (min-width: 768px) {
    .nav-container {
        min-height: 38vh;
        height: 38vh;
        gap: 3.5rem 2.5rem;
    }

    .nav-container a {
        font-size: min(3.2vw, 1.8rem);
        padding: 1.8rem 0;
    }
}
