:root {
    --gallery-gap: 30px;
    --gallery-div: 30%
}

.main {
    width: 100%;
    position: relative;
    font-family: basic, sans-serif;
    box-shadow: 0 0 6px #0004;
}

.main .padded {
    padding: 50px 100px;
}

.main p {
    font-size: var(--font-size);
    position: relative;
    z-index: 1;
}

.flex {
    display: flex;
    width: 100%;
    gap: 50px
}

.flex img {
    align-self: center;
}

.icon-hold {
    /* position: absolute; */
    top: 0;
    left: 0;
    flex: 1 0 auto;
    min-width: 0;
    display: flex;
    justify-content: center;
    z-index: 0;
}

.icon {
    width: 100%;
    max-width: 180px;
    filter: drop-shadow(0 0 2px #0003);
}

.gallery {
    display: flex;
    gap: var(--gallery-gap);
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.gallery .img {
    flex: 1 1 calc(var(--gallery-div) - var(--gallery-gap) / 2);
    min-width: 0;
    max-width: calc(var(--gallery-div) - var(--gallery-gap) / 2);
    position: relative;
    transition: .3s;
    transform: scale(1);
}

.gallery .img.hidden {
    transform: scale(0);
}

.gallery .img:hover {
    cursor: pointer;
    transform: scale(1.04);
}

.gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 25%;
    border: 3px solid #975;
    box-shadow: .5px 1px 3px #0005;
    transition: .4s;
}

.gallery img:hover {
    border-radius: 15%;
}

.big-img {
    position: relative;
    height: 300px;
    overflow: hidden;
    transform: scaleY(1);
    transition: .5s cubic-bezier(.92,.04,.36,1);
}

.big-img.hidden {
    transform: scaleY(0);
}

.big-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleY(1);
    transition: .5s cubic-bezier(.92,.04,.36,1);
}

.big-img.hidden img {
    transform: scaleY(2);
}

.big-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset .5px 1px 4px #0009;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fffd;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
    transition: .3s;
}

.overlay.open {
    opacity: 1;
    pointer-events: all;
    cursor: pointer;
}

.overlay .side {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay img {
    height: 80%;
    width: 80vh;
    object-fit: cover;
    border-radius: 5px;
}

.button {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 15px 20px;
    background-color: #642;
    color: #fff;
    font-size: var(--font-size);
    font-family: title, monospace, sans-serif;
    border-radius: 20px;
    position: relative;
    transition: .1s;
}

.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% - 15px);
    height: calc(100% - 15px);
    border: 2px var(--nav-col-hover) solid;
    transform: translate(-50%, -50%);
    border-radius: 17px;
    transition: .1s;
}

.button:hover {
    color: var(--blue);
    padding-left: 25px;
    padding-right: 25px;
}

.button:hover::before {
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border-radius: 15px;
}

.thin {
    padding: 0 100px;
}

.small-icon {
    width: 100px;
}

.contacts {
    width: 100%;
    display: flex;
    gap: 25px;
    justify-content: center;
    font-size: var(--h4);
}

.contacts > a {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    transform: scale(1);
    transition: .1s;
}

.contacts > a:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
}

.foot {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
}

.foot span {
    display: inline-block;
}

@media screen and (max-width: 800px) {
    .main .padded {
        padding: 50px 100px;
    }

    :root {
        --gallery-gap: 40px;
        --gallery-div: 50%;
        --h2: 30px
    }

    .thin {
        padding: 0 70px;
    }

    .flex {
        flex-direction: column;
    }
}

@media screen and (max-width: 650px) {
    .main .padded {
        padding: 50px 30px;
    }

    .thin {
        padding: 0 30px;
    }

    #bars {
        display: block;
        transform: scale(1);
        transition: .2s;
    }

    .nav.open + #bars {
        transform: rotate(90deg) scale(.8);
    }

    .topnav .nav {
        display: flex;
        gap: 0;
        flex-direction: column;
        position: absolute;
        top: var(--topnav-height);
        left: 0;
        width: 100%;
        height: auto;
        padding: 10px 0;
        background-color: var(--blue);
        transform-origin: top;
        transform: scaleY(0);
        transition: .2s;
        opacity: 0;
        box-shadow: 0 0 2px #0004;
    }

    .topnav .nav.open {
        transform: scaleY(1);
        opacity: 1;
    }

    .topnav .nav .nav-button-hold {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .topnav .nav a.nav-button::before {
        display: none;
    }

    .topnav .nav .nav-button {
        width: 100%;
        padding: 10px 0;
        display: flex;
        justify-content: center;
    }
}

@media screen and (max-width: 450px) {
    .main .padded {
        padding: 50px 30px;
    }

    .thin {
        padding: 0;
    }

    :root {
        --gallery-gap: 40px;
        --gallery-div: 100%;
        --h2: 28px
    }
}