/* ###########################################################################
   VARIABLES
########################################################################### */

:root {
    --offset-title:   clamp(60px, 12vw, 150px);
    --offset-content: clamp(120px, 22vw, 500px);
    --works-title-size: clamp(72px, 8vw, 112px);
    --page-padding-x: clamp(40px, 5vw, 80px);

    /* GRID CONTROLS */
    --grid-gap:         20px;
    --grid-item-height: 32vw;

    /* GALLERY IMAGE CONTROLS — padding od góry i dołu sekcji z 2 zdjęciami */
    --gallery-padding-top:    50px;
    --gallery-padding-bottom: 50px;

    /* GALLERY IMAGE CONTROLS — kadrowanie obrazka wewnątrz kontenera */
    --gallery-img-offset: -20%;
    --gallery-img-height: 140%;
}

/* ###########################################################################
   ANIMATIONS
########################################################################### */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ###########################################################################
   BODY
########################################################################### */

body {
    padding-top: 100px;
}

/* ###########################################################################
   NAVBAR
########################################################################### */

.navbar {
    position: absolute;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    flex-shrink: 0;
}

/* ###########################################################################
   WORKS HERO
########################################################################### */

.works-hero {
    max-width: 1500px;
    margin: 0 auto;
    padding: 10px var(--page-padding-x) 0;
}

.works-title-wrapper {
    position: relative;
    display: inline-block;

    margin-bottom: 62px;
    margin-left: var(--offset-title);
}

.works-title {
    font-size: var(--works-title-size);
    font-weight: 700;
    line-height: 0.9;

    margin: 0;

    opacity: 0;
    transform: translateY(60px);
    animation: slideUp 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.works-tag-wrapper {
    position: absolute;

    left: 58%;
    top: 58%;

    transform: translate(10%, -30%) rotate(1deg);

    width: 180px;

    overflow: visible;
    pointer-events: none;
    z-index: 2;
}

.works-tag {
    display: block;
    width: 100%;
    height: auto;
}

.works-tag-mask {
    position: absolute;
    inset: 0;
    background-color: #000;

    transform: translateX(0%);

    animation: revealLogoFromLeft 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 0.3s;
}

.works-intro {
    margin-left: var(--offset-content);

    display: flex;
    flex-direction: column;
    gap: 20px;

    max-width: 350px;

    margin-bottom: 50px;
}

.works-symbol {
    font-size: 14px;
    font-weight: 300;

    opacity: 0;
    transform: translateY(60px);
    animation: slideUp 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 1.2s;
}

.works-intro p {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.4;

    opacity: 0;
    transform: translateY(60px);
    animation: slideUp 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 1.4s;
}

/* ###########################################################################
   WORKS PHOTO SECTION
########################################################################### */

.works-photo-section {
    width: 100%;
    height: 50vh;
    overflow: hidden;

    opacity: 0;
    transform: translateY(60px);
    animation: slideUp 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 1.6s;
}

.works-photo-parallax {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.works-photo-img {
    position: absolute;
    top: -20%;
    left: 0;

    width: 100%;
    height: 140%;

    object-fit: cover;
    display: block;

    will-change: transform;
}

/* ###########################################################################
   WORKS OUTRO TEXT
########################################################################### */

.works-outro {
    margin-left: var(--offset-content);
    max-width: 350px;

    margin-top: 80px;
    margin-bottom: 160px;

    opacity: 0;
    transform: translateY(60px);
    animation: slideUp 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    animation-delay: 1.8s;
}

.works-outro p {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
}

/* ###########################################################################
   "MY WORK" SECTION HEADER
########################################################################### */

.works-header-container {
    display: flex;
    align-items: center;
    gap: 180px;

    width: 100%;

    border-top: 1px solid #333;

    padding: 100px 0;
    padding-left: clamp(120px, 14vw, 260px);
}

.works-section-title {
    font-size: 14px;
    font-weight: 400;
}

/* ###########################################################################
   PROJECTS GRID
########################################################################### */

.works-grid-section {
    width: 100%;
    padding: 0 16px;
    padding-bottom: 220px;
    box-sizing: border-box;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: var(--grid-item-height);
    gap: var(--grid-gap);
}

.works-grid-item {
    display: block;
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background-color: #0a0a0a;

    text-decoration: none;
}

.works-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    transition: filter 0.6s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.works-grid-item:hover img {
    filter: contrast(1.1);
    transform: scale(1.03);
}

.works-grid-item--empty {
    pointer-events: none;
    background-color: transparent;
}


/* ###########################################################################
   RESPONSIVE
########################################################################### */

@media (max-width: 1400px) {
    :root {
        --grid-item-height: 32vw;
    }
}

@media (max-width: 1100px) {
    :root {
        --grid-item-height: 52vw;
    }

    .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .works-title-wrapper {
        margin-left: 5vw;
        margin-bottom: 40px;
    }


    .works-intro,
    .works-outro {
        margin-left: 5vw;
        max-width: 90vw;
    }

    .works-header-container {
        gap: 40px;
        padding-left: 5vw;
        padding: 40px 5vw;
    }

    :root {
        --grid-item-height: 75vw;
    }

    .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .works-grid-section {
        padding: 0 8px;
        padding-bottom: 120px;
    }
}

@media (max-width: 480px) {

    .works-hero {
        padding-left: 0;
        padding-right: 0;
    }

    /* Przywracamy marginesy tam, gdzie powinny zostać */
    .works-title-wrapper,
    .works-intro,
    .works-outro {
        padding-left: 10vw; /* Przywrócenie pierwotnego odstępu */
        padding-right: 10vw;
    }

    .works-photo-section {
        width: 100vw; /* Wymuszenie pełnej szerokości viewportu */
        margin-left: 0;
        margin-right: 0;
    }

    .works-title {
        font-size: clamp(40px, 12vw, 56px);
        margin-left: 5vw;
    }

    .works-tag-wrapper {
        display: block;
        width: 100px;
        left: 50%;
        right: auto;
        top: 50%;
        transform: translate(0, -30%) rotate(1deg);
        overflow: visible;
    }

    .works-intro,
    .works-outro {
        margin-left: 4vw;
    }

    .works-photo-section {
        height: 20vh;
        width: 100%;
    }


    :root {
        --grid-item-height: 38vh;
        --grid-gap:         5px;
    }

    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        padding-bottom: 50px;
    }

    .works-grid-section {
        padding: 0 5px;
        padding-bottom: 80px;
    }
}