* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html,
body {
    min-height: 100%;
}


body {
    background: #050708;
    color: #d0d7d2;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    overflow-x: hidden;
}


/* =========================================================
   AMBIENT SCREEN EFFECT
   ========================================================= */

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    z-index: 20;

    opacity: 0.06;

    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 3px,
            rgba(160, 177, 168, 0.08) 4px
        );
}


body::after {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    z-index: 21;

    background:
        radial-gradient(
            ellipse at center,
            transparent 48%,
            rgba(0, 0, 0, 0.34) 100%
        );
}


/* =========================================================
   MAIN PAGE
   ========================================================= */

.projects-page {
    width: min(
        1720px,
        calc(100% - 42px)
    );

    margin: 0 auto;

    padding:
        30px
        0
        38px;

    position: relative;
}


/* =========================================================
   HEADER
   ========================================================= */

.projects-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    gap: 30px;

    padding:
        18px
        20px
        24px;

    border: 1px solid #303a37;

    background: #080c0d;

    animation:
        page-enter
        550ms
        ease
        both;
}


.projects-header-left {
    min-width: 0;
}


.projects-kicker {
    display: flex;

    align-items: center;

    gap: 9px;

    color: #748078;

    font-size: 9px;

    letter-spacing: 3px;

    margin-bottom: 13px;
}


.status-dot {
    width: 5px;
    height: 5px;

    border-radius: 50%;

    background: #91ad9c;

    box-shadow:
        0 0 8px
        rgba(
            145,
            173,
            156,
            0.22
        );

    animation:
        status-idle
        4.4s
        ease-in-out
        infinite;
}


.projects-header h1 {
    font-size:
        clamp(
            34px,
            6vw,
            68px
        );

    font-weight: 500;

    letter-spacing: 7px;

    color: #d3dad5;

    line-height: 0.95;
}


.projects-subline {
    margin-top: 12px;

    color: #59645f;

    font-size: 9px;

    letter-spacing: 2px;
}


.projects-header-right {
    display: flex;

    flex-direction: column;

    align-items: flex-end;

    gap: 9px;

    padding-top: 3px;

    color: #59645f;

    font-size: 9px;

    letter-spacing: 2px;

    white-space: nowrap;
}


/* =========================================================
   ARCHIVE DIVIDER
   ========================================================= */

.projects-rule {
    display: flex;

    align-items: center;

    gap: 12px;

    margin:
        24px
        0
        0;

    color: #65726c;

    font-size: 8px;

    letter-spacing: 3px;
}


.projects-rule span {
    height: 1px;

    flex: 1;

    background: #252e2c;
}


/* =========================================================
   PROJECT GRID
   ========================================================= */

#project-grid {
    display: flex;
    flex-direction: row;
    height: 70vh;
    min-height: 450px;
    gap: 8px;
    margin-top: 12px;
    animation: page-enter 650ms ease 70ms both;
}

.project-card {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #303a37;
    background: #070a0b;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
}

.project-card:hover, .project-card.selected {
    flex: 4;
    border-color: #4a5651;
    z-index: 2;
}

.project-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.project-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.5) contrast(1.1) brightness(0.6);
    transition: filter 0.6s ease, transform 0.6s ease;
}

.project-card:hover .project-bg img, .project-card.selected .project-bg img {
    filter: grayscale(0.1) contrast(1.1) brightness(0.85);
    transform: scale(1.05);
}

.project-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(5,7,8,0.95) 0%, rgba(5,7,8,0.6) 50%, rgba(5,7,8,0.2) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.project-card:hover .project-bg-overlay, .project-card.selected .project-bg-overlay {
    opacity: 1;
}

/* SCANLINE OVERLAY */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 4px, rgba(190, 205, 198, 0.04) 5px);
    pointer-events: none;
    z-index: 1;
}

.project-vertical-title {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 24px;
    z-index: 2;
    transition: opacity 0.4s ease;
}

.project-card:hover .project-vertical-title, .project-card.selected .project-vertical-title {
    opacity: 0;
    pointer-events: none;
}

.project-number {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 16px;
    font-weight: bold;
    color: #cbd3ce;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.project-name-vert {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 10px;
    color: #748078;
    letter-spacing: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 60%;
}

.project-expanded-info {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
    pointer-events: none;
}

.project-card:hover .project-expanded-info, .project-card.selected .project-expanded-info {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.project-index {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #59645f;
    font-size: 8px;
    letter-spacing: 2px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(48, 58, 55, 0.5);
    margin-bottom: auto;
}

.project-state {
    color: #748078;
}

.project-info-inner {
    margin-bottom: 20px;
}

.project-category {
    color: #91ad9c;
    font-size: 8px;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.project-title {
    color: #d3dad5;
    font-size: 32px;
    font-weight: 500;
    letter-spacing: 2px;
    line-height: 1.1;
    margin-bottom: 12px;
}

.project-description {
    color: #87928c;
    font-size: 12px;
    line-height: 1.6;
    max-width: 90%;
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tag {
    padding: 5px 9px;
    border: 1px solid rgba(48, 58, 55, 0.8);
    background: rgba(8, 12, 13, 0.6);
    color: #748078;
    font-size: 8px;
    letter-spacing: 1px;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid rgba(48, 58, 55, 0.5);
    color: #59645f;
    font-size: 9px;
    letter-spacing: 2px;
}

.project-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #91ad9c;
}

/* =========================================================
   FOOTER
   ========================================================= */

.projects-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-top: 24px;

    padding:
        16px
        20px;

    border:
        1px solid #303a37;

    background: #080c0d;

    animation:
        page-enter
        700ms
        ease
        140ms
        both;
}


.projects-footer button {

    border:
        1px solid #303a37;

    background:
        transparent;

    color: #87928c;

    padding:
        10px
        12px;

    font: inherit;

    font-size: 8px;

    letter-spacing: 2px;

    cursor: pointer;

    transition:
        background 180ms ease,
        border-color 180ms ease,
        color 180ms ease;
}


.projects-footer button:hover {

    background: #0c1112;

    border-color: #4a5651;

    color: #c3cbc6;
}


.projects-footer-meta {

    display: flex;

    gap: 20px;

    color: #59645f;

    font-size: 8px;

    letter-spacing: 2px;
}


/* =========================================================
   PAGE ANIMATION
   ========================================================= */

@keyframes page-enter {

    from {
        opacity: 0;
        transform:
            translateY(10px);
    }

    to {
        opacity: 1;
        transform:
            translateY(0);
    }
}


@keyframes status-idle {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.9;
    }
}


@keyframes scanline {

    0% {
        transform:
            translateY(0);

        opacity: 0;
    }

    12% {
        opacity: 0.18;
    }

    70% {
        opacity: 0.18;
    }

    100% {

        transform:
            translateY(235px);

        opacity: 0;
    }
}


/* =========================================================
   PAGE LEAVE
   ========================================================= */

body.page-leaving {

    animation:
        page-leave
        420ms
        ease
        forwards;
}


@keyframes page-leave {

    from {
        opacity: 1;
        transform:
            translateY(0);
    }

    to {
        opacity: 0;
        transform:
            translateY(-10px);
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    #project-grid {

        grid-template-columns:
            repeat(
                5,
                minmax(
                    0,
                    1fr
                )
            );
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .projects-page {

        width:
            min(
                100% - 20px,
                520px
            );

        padding-top: 14px;
    }


    .projects-header {

        padding: 15px;
    }


    .projects-header-right {

        display: none;
    }


    #project-grid {

        grid-template-columns:
            repeat(
                3,
                minmax(
                    0,
                    1fr
                )
            );
    }


    .project-cover-wrap {

        padding:
            12px
            12px
            9px;
    }


    .project-info {

        padding:
            0
            11px
            12px;
    }


    .project-title {

        font-size: 14px;
    }


    .projects-footer {

        align-items: flex-start;

        flex-direction: column;

        padding:
            14px
            15px;
    }
}


/* =========================================================
   SMALL PHONE
   ========================================================= */

@media (max-width: 430px) {

    #project-grid {

        grid-template-columns:
            repeat(
                2,
                minmax(
                    0,
                    1fr
                )
            );
    }
}