:root {
    --section-padding-height: clamp(3.75rem, 8vw, 6.25rem);
    --section-padding-width: 16px;
    --default-font-size: clamp(1rem, 3vw, 2rem);
    --container-width: 1600px;
    --container-gap: clamp(3rem, 6vw, 4rem);
}

html {
    font-family: Roboto, sans-serif;
    font-size: var(--default-font-size);
}

main section {
    padding: var(--section-padding-height) var(--section-padding-width);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    font-weight: bolder;
}

p {
    margin: 0;
}

.medium {
    font-size: 1.2rem;
}

.big {
    font-size: 1.6rem;
}

.bigger {
    font-size: 2rem;
}

.biggest {
    font-size: 2.5rem;
}

div.container {
    width: 100%;
    margin: auto;
    max-width: var(--container-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--container-gap);
}

section#header {
    position: relative;
}

section#header::before {
    content: "";
    background: #0a90b1;
    position: absolute;
    width: 100%;
    height: 50%;
    z-index: -1;
    top: 0px;
    left: 0px;
    transform-origin: top left;
    transform: skewY(-22deg);
}

section#header .portrait-container {
    position: relative;
}

section#header .portrait-container h1 {
    color: white;
    text-shadow: 1px 2px 5px black;

    position: absolute;
    bottom: 8px;
    left: 16px;
}

section#header .about-me-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

section#header .about-me-container p {
    color: #555555;
}

.icons svg {
    width: clamp(1.5rem, 3vw, 1.7rem);
    margin: 0px 5px;
}

section#projects .grid {
    --grid-max-col-count: 3;
    --grid-min-col-size: 450px;
    --grid-gap: 1rem;

    --grid-col-size-calc: calc((100% - var(--grid-gap) * var(--grid-max-col-count)) / var(--grid-max-col-count));
    --grid-col-min-size-calc: min(100%,
            max(var(--grid-min-col-size), var(--grid-col-size-calc)));

    display: grid;
    gap: var(--grid-gap);

    grid-template-columns: repeat(auto-fit,
            minmax(var(--grid-col-min-size-calc), 1fr));
}

section#projects .project-cards {
    align-self: stretch;
}

section#projects .project-cards article {
    box-shadow: 1px 1px 4px 1px grey;
    height: 31rem;
}

section#projects .project-cards .screenshot {
    height: 55%;
    position: relative;
}

.project-cards .card_1 {
    --placeholder-bg: #7c75c8;
}

.project-cards .card_2 {
    --placeholder-bg: #d78e3b;
}

.project-cards .card_3 {
    --placeholder-bg: #5d8e4e;
}

.project-cards .card_4 {
    --placeholder-bg: #c97598;
}

.project-cards .card_5 {
    --placeholder-bg: #4792d7;
}

.project-cards .card_6 {
    --placeholder-bg: #5d8e4e;
}

.project-cards article .placeholder {
    background-color: var(--placeholder-bg);
}

.screenshot h3 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.description {
    padding: 1rem 1.2rem 0;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    row-gap: 25px;
}

.description .icons {
    justify-self: end;
    align-self: center;
}

.description p {
    color: #555555;
    grid-column: 1 / span 2;
}

section#contacts {
    background-color: #0a90b1;
    color: white;
}

section#contacts .container img {
    object-fit: cover;
    width: 100%;
    height: 300px;
}

section#contacts .container .info {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

section#contacts .info h2,
section#contacts .info .icons.bottom {
    align-self: center;
}

section#contacts div.phone,
section#contacts div.email {
    display: flex;
    align-items: center;
}

section#contacts .icons.bottom svg {
    width: 2.2rem;
}

@media screen and (max-width: 979px) {
    section#contacts {
        padding: 0;
    }

    section#contacts .container .info {
        padding: var(--section-padding-height) var(--section-padding-width);
    }

}

@media screen and (min-width: 980px) and (max-width: 1279px) {
    section#header .container {
        background-color: white;
        box-shadow: 1px 1px 4px 1px grey;
        display: block;

        max-width: calc(100vw - 10rem);
        padding: 50px;
    }

    section#header .container::after {
        display: block;
        content: "";
        clear: both;
    }

    section#header .portrait-container {
        float: left;
        margin-top: -5rem;
        margin-left: -5rem;

        transform: scale(85%);
    }

    section#header .about-me-container {
        display: block;
    }

    section#header .about-me-container h2 {
        text-align: center;
        margin-bottom: 25px;
    }

    section#header .about-me-container .icons {
        margin-top: 25px;
        float: right;
    }
}

@media screen and (min-width: 980px) {
    section#header::before {
        height: 100%;
    }

    section#contacts .container {
        flex-direction: row;
        gap: 20px;
    }

    section#contacts .container img {
        object-fit: cover;
        width: 100%;
        height: 600px;
        overflow: auto;
    }

    section#contacts .info h2,
    section#contacts .info .icons.bottom {
        align-self: flex-start;
    }
}

@media screen and (min-width: 1280px) {
    section#header .container {
        flex-direction: row;
        gap: 0;
    }

    section#header .about-me-container {
        background-color: white;
        box-shadow: 1px 1px 4px 1px grey;
        padding: 30px 25px;
    }

    section#header .about-me-container h2 {
        align-self: start;
    }

    section#header .about-me-container .icons {
        align-self: end;
    }
}