/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f7f7f5;
    color: #171717;

    line-height: 1.5;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 25px 5vw;

    border-bottom: 1px solid #deded9;

    background: rgba(247, 247, 245, 0.9);

    position: sticky;
    top: 0;
    z-index: 100;

    backdrop-filter: blur(12px);
}
.logo {
    color: #171717;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
div.logo-img{
    display: inline;
    float: center;
}
.site-header nav {
    display: flex;
    gap: 28px;
}

.site-header nav a {
    color: #777;
    text-decoration: none;

    font-size: 14px;

    transition: color 0.25s ease;
}

.site-header nav a:hover,
.site-header nav a.active {
    color: #111;
}


/* =========================================================
   INTRO
========================================================= */

.gallery-intro {
    max-width: 1100px;

    margin: 0 auto;

    padding: 110px 30px 80px;

    text-align: center;
}

.eyebrow {
    color: #777;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.18em;

    text-transform: uppercase;

    margin-bottom: 16px;
}

.gallery-intro h1 {
    font-size: clamp(45px, 7vw, 88px);

    line-height: 0.95;

    font-weight: 500;

    margin-bottom: 28px;
}

.intro-text {
    max-width: 550px;

    margin: 0 auto;

    color: #777;

    font-size: 17px;
}


/* =========================================================
   PROJECT SECTION
========================================================= */

.projects-section {
    max-width: 1400px;

    margin: 0 auto;

    padding: 0 5vw 120px;
}

.projects-container {
    display: flex;

    flex-direction: column;

    gap: 120px;
}


/* =========================================================
   PROJECT CARD
========================================================= */

.project-card {
    display: grid;

    grid-template-columns: 1fr 0.35fr;

    gap: 45px;

    align-items: end;
}

.project-visual {
    min-width: 0;
}


/* Project preview images */

.preview-grid {
    display: grid;

    grid-template-columns: 2fr 1fr;

    grid-template-rows: 260px 180px;

    gap: 10px;
}

.preview-image {
    position: relative;

    overflow: hidden;

    background: #ddd;

    cursor: pointer;
}

.preview-image:first-child {
    grid-row: span 2;
}

.preview-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    transition:
        transform 0.7s cubic-bezier(.2,.7,.2,1),
        filter 0.4s ease;
}

.preview-image:hover img {
    transform: scale(1.05);

    filter: brightness(0.88);
}


/* Number overlay */

.image-number {
    position: absolute;

    top: 14px;
    left: 14px;

    padding: 6px 9px;

    background: rgba(0, 0, 0, 0.65);

    color: white;

    font-size: 11px;

    backdrop-filter: blur(5px);
}


/* More images overlay */

.more-images {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.5);

    color: white;

    font-size: 14px;
    font-weight: 600;

    opacity: 0;

    transition: opacity 0.3s ease;
}

.preview-image:hover .more-images {
    opacity: 1;
}


/* =========================================================
   PROJECT INFO
========================================================= */

.project-info {
    padding-bottom: 5px;
}

.project-number {
    color: #999;

    font-size: 12px;

    margin-bottom: 16px;
}

.project-title {
    font-size: clamp(28px, 3vw, 44px);

    font-weight: 500;

    line-height: 1;

    letter-spacing: -0.035em;

    margin-bottom: 18px;
}

.project-category {
    color: #777;

    font-size: 13px;

    margin-bottom: 20px;
}

.project-description {
    color: #777;

    font-size: 14px;

    line-height: 1.7;

    margin-bottom: 28px;
}

.view-project {
    display: inline-flex;

    align-items: center;

    gap: 12px;

    border: none;

    background: transparent;

    color: #111;

    font: inherit;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    padding: 0;

    border-bottom: 1px solid #111;

    padding-bottom: 5px;

    transition:
        gap 0.3s ease,
        opacity 0.3s ease;
}

.view-project:hover {
    gap: 20px;

    opacity: 0.65;
}


/* =========================================================
   PROJECT MODAL
========================================================= */

.project-modal {
    position: fixed;

    inset: 0;

    z-index: 500;

    visibility: hidden;

    opacity: 0;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}

.project-modal.active {
    visibility: visible;

    opacity: 1;
}

.modal-backdrop {
    position: absolute;

    inset: 0;

    background: rgba(10, 10, 10, 0.88);
}

.modal-content {
    position: relative;

    z-index: 2;

    width: min(1300px, 94vw);

    height: 94vh;

    margin: 3vh auto;

    overflow-y: auto;

    background: #f7f7f5;

    padding: 50px;

    transform: translateY(30px);

    transition: transform 0.4s ease;
}

.project-modal.active .modal-content {
    transform: translateY(0);
}


/* Modal close */

.modal-close {
    position: absolute;

    top: 22px;
    right: 25px;

    width: 42px;
    height: 42px;

    border: 1px solid #ccc;

    border-radius: 50%;

    background: transparent;

    color: #111;

    font-size: 28px;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.25s ease,
        color 0.25s ease;
}

.modal-close:hover {
    background: #111;

    color: white;
}


/* Modal header */

.modal-header {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 30px;

    padding-right: 60px;

    margin-bottom: 15px;
}

.modal-header h2 {
    font-size: clamp(38px, 5vw, 70px);

    line-height: 0.95;

    letter-spacing: -0.05em;

    font-weight: 500;
}

.modal-counter {
    color: #777;

    font-size: 13px;

    white-space: nowrap;
}

.modal-description {
    max-width: 650px;

    color: #777;

    font-size: 14px;

    line-height: 1.7;

    margin-bottom: 45px;
}


/* =========================================================
   BENTO / MASONRY PROJECT GALLERY
========================================================= */

.modal-gallery {
    display: grid;

    grid-template-columns: repeat(12, 1fr);

    grid-auto-rows: 80px;

    gap: 10px;
}

.gallery-item {
    position: relative;

    overflow: hidden;

    background: #ddd;

    cursor: zoom-in;
}

.gallery-item img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}

.gallery-item:hover img {
    transform: scale(1.04);
}


/*
   Automatic alternating layouts.

   Every few images gets a different size.
*/

.gallery-item:nth-child(1) {
    grid-column: span 8;
    grid-row: span 6;
}

.gallery-item:nth-child(2) {
    grid-column: span 4;
    grid-row: span 4;
}

.gallery-item:nth-child(3) {
    grid-column: span 4;
    grid-row: span 2;
}

.gallery-item:nth-child(4) {
    grid-column: span 5;
    grid-row: span 5;
}

.gallery-item:nth-child(5) {
    grid-column: span 7;
    grid-row: span 5;
}

.gallery-item:nth-child(6) {
    grid-column: span 7;
    grid-row: span 5;
}

.gallery-item:nth-child(7) {
    grid-column: span 5;
    grid-row: span 5;
}

.gallery-item:nth-child(8) {
    grid-column: span 4;
    grid-row: span 5;
}

.gallery-item:nth-child(9) {
    grid-column: span 8;
    grid-row: span 5;
}


/* =========================================================
   LIGHTBOX
========================================================= */

.lightbox {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.96);

    visibility: hidden;

    opacity: 0;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.lightbox.active {
    visibility: visible;

    opacity: 1;
}

.lightbox-image-container {
    max-width: 90vw;
    max-height: 90vh;

    display: flex;

    flex-direction: column;

    align-items: center;
}

.lightbox-image-container img {
    max-width: 90vw;
    max-height: 82vh;

    width: auto;
    height: auto;

    object-fit: contain;

    display: block;
}

.lightbox-caption {
    color: #aaa;

    font-size: 12px;

    margin-top: 15px;
}


/* Lightbox close */

.lightbox-close {
    position: absolute;

    top: 25px;
    right: 30px;

    border: none;

    background: transparent;

    color: white;

    font-size: 40px;

    font-weight: 200;

    cursor: pointer;

    z-index: 2;
}


/* Previous / next */

.lightbox-nav {
    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    width: 55px;
    height: 55px;

    border: 1px solid rgba(255,255,255,0.3);

    border-radius: 50%;

    background: rgba(0,0,0,0.3);

    color: white;

    font-size: 22px;

    cursor: pointer;

    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}

.lightbox-nav:hover {
    background: white;

    border-color: white;

    color: black;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .project-card {
        grid-template-columns: 1fr;

        gap: 30px;
    }

    .project-info {
        padding: 0 5px;
    }

    .preview-grid {
        grid-template-rows: 220px 150px;
    }

    .modal-content {
        padding: 35px 25px;
    }

    .modal-gallery {
        grid-template-columns: repeat(6, 1fr);

        grid-auto-rows: 70px;
    }

    .gallery-item:nth-child(n) {
        grid-column: span 3;
        grid-row: span 4;
    }

    .gallery-item:nth-child(1),
    .gallery-item:nth-child(4),
    .gallery-item:nth-child(7) {
        grid-column: span 6;
        grid-row: span 5;
    }

    .gallery-item:nth-child(2),
    .gallery-item:nth-child(5),
    .gallery-item:nth-child(8) {
        grid-column: span 3;
    }

    .gallery-item:nth-child(3),
    .gallery-item:nth-child(6),
    .gallery-item:nth-child(9) {
        grid-column: span 3;
    }
}


@media (max-width: 600px) {

    .site-header {
        padding: 20px;
    }

    .site-header nav {
        gap: 18px;
    }

    .gallery-intro {
        padding: 75px 20px 60px;
    }

    .projects-section {
        padding: 0 20px 80px;
    }

    .projects-container {
        gap: 80px;
    }

    .preview-grid {
        grid-template-columns: 1fr 1fr;

        grid-template-rows: 180px 120px;

        gap: 6px;
    }

    .preview-image:first-child {
        grid-row: span 2;
    }

    .modal-content {
        width: 100%;
        height: 100vh;

        margin: 0;

        padding: 70px 18px 30px;
    }

    .modal-header {
        padding-right: 40px;

        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }

    .modal-gallery {
        grid-template-columns: 1fr 1fr;

        grid-auto-rows: 100px;

        gap: 6px;
    }

    .gallery-item:nth-child(n) {
        grid-column: span 1;
        grid-row: span 2;
    }

    .gallery-item:nth-child(1),
    .gallery-item:nth-child(4),
    .gallery-item:nth-child(7) {
        grid-column: span 2;
        grid-row: span 3;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;

        font-size: 16px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 15px;
        right: 18px;
    }

    .lightbox-image-container img {
        max-width: 82vw;

        max-height: 75vh;
    }
}


/* =========================================================
   PREVENT SCROLL WHEN MODALS ARE OPEN
========================================================= */

body.modal-open {
    overflow: hidden;
}