:root {
    --bg-color1: rgb(43, 35, 30);
    --bg-gr1: rgb(64, 46, 42);
    --bg-gr2: rgb(49, 40, 35);
    --font-color: rgb(253, 232, 190);
    --black-gr1: rgb(20, 20, 20);
    --black-gr2: rgb(19, 19, 19);
    --primary-font-color: #fff;
    --rope-bg: rgb(180, 156, 110, 0.2);
    --sky-color: rgb(115, 189, 190);
    --red-text-color: rgb(229, 28, 36);
    --grey-bg: rgb(40, 40, 40);

    --fs--2: clamp(0.7035rem, 0.8118rem + -0.1083vi, 0.7901rem);
    --fs--1: clamp(0.8889rem, 0.8767rem + 0.0611vi, 0.9377rem);
    --fs-0: clamp(1rem, 0.9375rem + 0.3125vi, 1.25rem);
    --fs-1: clamp(1.125rem, 0.9897rem + 0.6766vi, 1.6663rem);
    --fs-2: clamp(1.2656rem, 1.0268rem + 1.1944vi, 2.2211rem);
    --fs-3: clamp(1.4238rem, 1.0396rem + 1.9211vi, 2.9607rem);
    --fs-4: clamp(1.6018rem, 1.0156rem + 2.9311vi, 3.9467rem);
    --fs-5: clamp(1.802rem, 0.9373rem + 4.3236vi, 5.2609rem);
}

@font-face {
    font-family: 'Vag Rounded';
    src: url(assets/fonts/vag_rounded.ttf);
}

@font-face {
    font-family: 'Vag Rounded Backup';
    src: url(assets/fonts/VAG\ Round\ Cyrillic.eot);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    word-wrap: break-word;
}

img {
    max-width: 100%;
}

body {
    font-family: 'Vag Rounded', 'Vag Rounded Backup', sans-serif;
    min-height: 100vh;
    font-size: var(--fs-0);
    background: linear-gradient(to right, var(--black-gr1) 20%, var(--black-gr2));
}

/* Navigation */

.primary_nav {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1em;
}

nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
}

li {
    list-style: none;
    margin-inline: 1vw;
    padding-top: 0.5em;
}

h1 {
    font-size: var(--fs-4);
    line-height: 0.8;
    text-align: center;
}

h2 {
    font-size: var(--fs-3);
    text-align: center;
}

h3 {
    font-size: var(--fs-2);
}

h4 {
    font-size: var(--fs-1);
}

p {
    font-size: var(--fs-0);
}

nav a {
    text-decoration: none;
    color: var(--primary-font-color);
    font-size: var(--fs-2);
}

nav a:hover, nav a:focus  {
    text-decoration: underline;
    text-decoration-color: var(--primary-font-color);
    text-decoration-style: solid;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    outline: none;
}

nav .red:hover, nav .red:focus {
    text-decoration-color: var(--red-text-color);
}

nav .sky:hover, nav .sky:focus {
    text-decoration-color: var(--sky-color);
}

.image_placeholder {
    max-width: 25rem;
}

.prehidden {
    display: none;
}

@media screen and (max-width: 1100px) {
    .primary_nav {
        flex-direction: column;
    }
    .left_nav {
        display: none;
    }
    .prehidden {
        display: block;
    }
    ul {
        flex-wrap: wrap;
    }
    li {
        margin-inline: 1em;
    }
}


/* Body */

main {
    padding-inline: 2em;
    color: #fff;
    overflow-x: hidden;
}

.preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    font-family: 'Vag Rounded', 'Vag Rounded Backup', sans-serif;
    margin-block: 2em;
    text-align: center;
}

.main_page_preview {
    background-image: url(assets/images/bg-main.jpg);
    padding-block: 2em;
}

.contacts_preview {
    background-image: url(assets/images/contacts-bg.jpg);
    background-position: left bottom;
    background-size: cover;
    padding-block: 2em;
}

.preview_wrapper {
    width: 70%;
    border-radius: inherit;
}

.main_page_preview_wrapper {
    background-color: rgb(20, 20, 20, 0.7);
    padding: 2em;
}


h1, h2, h3, nav a {
    text-transform: uppercase;
}

.red {
    color: var(--red-text-color);
}

.sky {
    color: var(--sky-color);
}

.header_main_wrapper {
    margin-bottom: 1em;
    display: flex;
    justify-content: center;
}

.subsection {
    position: relative;
    display: grid;
    grid-template-columns: 20% 1fr 20%;
    border-radius: 10px;
    gap: 1em;
}

.section_wrapper {
    padding: 2em;
    max-width: 60ch;
    margin-inline: auto;
    background-color: var(--grey-bg);
    border-radius: 10px;
    text-align: center;
}

.section_image {
    max-width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    box-shadow: 
    2px 2px 10px 3px rgba(0,0,0,0.3);
}

/* Contacts page */

.links {
    margin-top: 2em;
    gap: 1em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.link_wrapper {
    display: flex;
    align-items: center;
    gap: 1em;
}
.contact_logo {
    width: 40px;
    border-radius: 50%;
}
.phone {
    padding: 10px;
    background-color: var(--sky-color);
}

/* Portfolio page */

.portfolio_preview_wrapper {
    text-align: center;
}

.gallery {
    border-radius: 10px;
    padding: 1em;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1em;
    background-color: var(--grey-bg);
}

.gallery_item {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.gallery_image {
    object-fit: cover;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: inherit;
    cursor: pointer;
    outline: none;
}

/* Gallery animation */

.img_zoomed {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease-in-out;
    width: 100vw;
    height: 100vh;
    z-index: 10;
}

/* Products page */
.products_preview_wrapper, .news_preview_wrapper {
    background-color: var(--grey-bg);
    padding: 1em;
    margin-bottom: 3em;
}
.products_preview p {
    margin-block: 1em;
    text-align: left;
}

.product_unordered_list {
    text-align: left;
    margin-bottom: 1em;
}

.product_image {
    width: 100%;
    height: 24em;
    margin-block: 1em;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 
    5px 5px 10px 3px rgba(0,0,0,0.3), -5px 5px 10px 3px rgba(0,0,0,0.3);
}

.main_page_link {
    color: var(--sky-color);
    text-underline-offset: 2px;
}

.main_page_link:hover, .main_page_link:focus {
    color: rgb(138, 221, 223);
}

@media screen and (max-width: 700px) {
    .subsection {
        grid-template-columns: 10% 1fr 10%;
        gap: 2vw;
    }
    .main_page_preview {
        padding-block: 1em;
    }
    .main_page_preview_wrapper {
        padding: 1.5em;
    }
    .preview_wrapper {
        width: 90%;
    }
    .product_image {
        margin-block: 0.5em;
        height: 16em;
    }
}

@media screen and (max-width: 450px) {
    .subsection {
        grid-template-columns: 0 1fr 0;
    }
    .main_page_preview {
        padding-block: 0;
    }
    .main_page_preview_wrapper {
        padding: 0.6em;
    }
    .preview_wrapper {
        width: 100%;
    }
    main {
        padding: 0;
    }
}