header {
    position: relative;
}

#project-selection {
    padding-top: 50px;

    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#project-selection .background {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    z-index: -2;
}

#project-selection .background img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    filter: blur(1px);
}

#project-selection .background .transition {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 100px;
    bottom: 0px;
    left: 0px;
    background: linear-gradient(0deg, var(--color-page-main) 10%, rgba(255, 255, 255, 0) 100%);

    transition-duration: var(--transition-short);
}

#project-selection .background .transition::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0px;
    top: 0px;
    opacity: 0.2;

    background-color: var(--color-page-main);
}

#project-selection .textbox {
    position: relative;
    padding: 0px;
    border-radius:60px;
}

#project-selection .textbox .title {
    padding: 10px 160px 10px 160px;
}

#project-selection .textbox .title h1::before {
    display: none;
}

#project-selection .textbox .decorations {
    position: absolute;
    z-index: -1;
}

#project-selection .textbox .decorations img {
    filter: grayscale(1);
    filter: brightness(0) saturate(100%) invert(100%) sepia(28%) saturate(5226%) hue-rotate(313deg) brightness(107%) contrast(98%);
}

#project-selection .textbox .decorations img.second {
    left: -15px;
    top: -5px;
    height: 60px;
    width: auto;
    transform: scaleY(1);
}

#project-selection .textbox .decorations img.first {
    right: -15px;
    top: -5px;
    bottom: auto;
    height: 60px;
    width: auto;
    transform: scale(-1, 1);
}

#project-selection .items {
    margin-top: 200px;
    display: flex;
    flex-direction: row;
    gap: 100px 150px;
    flex-wrap: wrap;
    z-index: 1;
}

#project-selection .items article {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 0px 0px 15px 0px;
    overflow: hidden;
    outline: 1px solid var(--heading-color-original);
    border-radius: 5px;
}

#project-selection .items article::before {
    content: '';
    position: absolute;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: -1;

    opacity: 1;
    background-color: var(--color-page-main);
}

#project-selection .items article :is(h1, h2, h3) {
    font-weight: normal;
    color: var(--color-text-main);
    margin: 0px;
}

#project-selection .items article h1 {
    font-size: 2em;
}

#project-selection .items article h2 {
    font-size: 1.5em;
    text-shadow: 0px 0px 2px var(--color-text-heading) !important;
}

#project-selection .items article h3 {
    font-size: 0.8em;
    text-transform: uppercase;
}

#project-selection .items article a {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0;
}

#project-selection .items article .image-wrapper {
    width: 400px;
    aspect-ratio: 4/3;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

#project-selection .items article .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-short);
}

@media (hover: hover) {
    #project-selection .items article:hover {
        box-shadow: 0px 0px 10px var(--color-text-heading);
    }

    #project-selection .items article:hover .image-wrapper img {
        transform: scale(1.1);
    }
}

@media (orientation: landscape) {
    @media (width < 1920px) {
        #project-selection {
            padding-top: 40px;
        }

        #project-selection .background img {
            height: 350px;
        }

        #project-selection .items {
            margin-top: 50px;
        }
    }

    @media (max-width: 1024px) {
        #project-selection .items {
            gap: 50px 70px;
        }

        #project-selection .items article .image-wrapper {
            width: 340px;
        }
    }

    @media (max-width: 768px) {
        #project-selection .items {
            gap: 50px 30px;
        }
    }
}

@media (orientation: portrait) {
    #project-selection {
        padding-top: 20px;
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }

    #project-selection .background {
        width: 100%;
        height: 100%;
        position: fixed;
    }

    #project-selection .background img {
        height: 100vh;
    }

    #project-selection .background .transition {
        display: none;
    }

    #project-selection .textbox .title {
        padding: 10px 80px 10px 80px;
    }

    #project-selection .textbox .decorations img.second {
        height: 80px;
        left: -50px;
        top: -5px;
    }

    #project-selection .textbox .decorations img.first {
        height: 80px;
        right: -50px;
        top: -5px;
    }

    #project-selection .items {
        margin-top: 30px;
        margin-bottom: 10px;
        flex-direction: column;
        gap: 30px;
    }

    #project-selection .items article::before {
        opacity: 0.9;
    }

    @media (max-width: 425px) {
        #project-selection {
            padding-top: 10px;
        }

        #project-selection .textbox {
            width: 100%;
        }

        #project-selection .textbox .title {
            padding: 10px;
        }

        #project-selection .items article .image-wrapper {
            width: 100%;
        }

        #project-selection .items {
            margin-top: 10px;
            gap: 10px;
        }
    }
}