@import "./reset.css";

@font-face {
    font-family: DM-Sans;
    src: url("../fonts/dm-sans/DMSans-VariableFont_opsz\,wght.ttf");
}

@font-face {
    font-family: Poppins-Regular;
    src: url("../fonts/poppins/Poppins-Regular.ttf");
}

@font-face {
    font-family: Poppins-Medium;
    src: url("../fonts/poppins/Poppins-Medium.ttf");
}

@font-face {
    font-family: Poppins-Bold;
    src: url("../fonts/poppins/Poppins-Bold.ttf");
}

/*
font-family: DM-Sans, sans-serif;
font-family: Poppins-Regular, sans-serif;
font-family: Poppins-Medium, sans-serif;
font-family: Poppins-Bold, sans-serif;
*/

:root {
    /* Light mode */
    --bg-color: #fafafa;
    --text-color: #171718;
    --accent-color: #575aff;
    --border-color: rgba(60, 60, 60, .12);
    --theme-switcher-bg: #f1f1f1;
    --project-bg: #ffffff;
    --project-box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.15);
    --preview-img: url("../img/icons/preview-light.png");
    color-scheme: light;
}

.dark {
    /* Dark mode */
    --bg-color: #1a1a1a;
    --text-color: rgba(255, 255, 255, .87);
    --accent-color: #578aff;
    --border-color: rgba(84, 84, 84, .48);
    --theme-switcher-bg: #3f3f3f;
    --project-bg: #252525;
    --project-box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.8);
    --preview-img: url("../img/icons/preview-dark.png");
    color-scheme: dark;
}

body {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);

    font-family: DM-Sans, sans-serif;
    letter-spacing: -0.5px;
    color: var(--text-color);
}

/* General */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section {
    padding: 70px 0 80px;
    background-color: var(--bg-color);
}

.title-1 {
    margin-bottom: 60px;
    font-size: 60px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--accent-color);
    text-align: center;
    cursor: default;
}

.title-2 {
    margin-bottom: 20px;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.3;
    cursor: default;
}

/* Button style */

.btn {
    display: inline-block;
}

.btn-icon {
    display: flex;
    column-gap: 10px;
    align-items: center;
}

.btn, .btn-icon {
    height: 48px;
    padding: 12px 28px;
    border-radius: 5px;

    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.15px;
    line-height: 1.45;

    background-color: var(--accent-color);
    color: #ffffff;
    transition: background-color 0.25s;
}

@media (hover: hover) {
    .btn:hover, .btn-icon:hover {
        background-color: #474df5;
    }
}

@media (hover: none) {
    .btn:active, .btn-icon:active {
        background-color: #474df5;
    }
}

.btn:active, .btn-icon:active {
    position: relative;
    top: 1px;
}

/* Nav style */

.nav {
    padding: 17px 0;

    position: sticky;
    top: 0;
    z-index: 3;

    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);

    color: var(--text-color);
    letter-spacing: normal;
}

.nav-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    column-gap: 43px;
    row-gap: 20px;
    flex-wrap: wrap;
}

.logo {
    margin-right: auto;
    font-size: 24px;
    font-family: Poppins-Regular, sans-serif;
    color: var(--text-color);
}

.logo strong {
    font-family: Poppins-Bold, sans-serif;
    color: var(--accent-color);
}

.nav-list {
    display: flex;
    align-items: center;
    row-gap: 10px;
    column-gap: 43px;
    flex-wrap: wrap;

    font-size: 16px;
    font-family: Poppins-Medium, sans-serif;
}

.nav-list__link {
    position: relative;
    color: var(--text-color);
}

.nav-list__link::before {
    content: "";

    position: absolute;
    left: 0;
    top: 100%;

    display: block;
    height: 2px;
    width: 0%;
    background-color: var(--accent-color);
    transition: all 0.3s ease-in;
}

@media (hover: hover) {
    .nav-list__link:hover::before {
        width: 100%;
    }
}

.nav-list__link--active {
    position: relative;
}

.nav-list__link--active::before {
    content: "";

    position: absolute;
    left: 0;
    top: 100%;

    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--accent-color);
}

/* Dark mode button style */

.dark-mode-btn {
    width: 60px;
    height: 32px;
    padding: 7px;

    position: relative;

    display: flex;
    justify-content: space-between;
    order: 9;

    border-radius: 50px;
    border: 1px solid var(--border-color);
    background-color: var(--theme-switcher-bg);
    transition: border-color .25s;
}

@media (hover: hover) {
    .dark-mode-btn:hover {
        border-color: #8e8e8e;
    }
}

.dark-mode-btn::before {
    content: "";

    position: absolute;
    top: 1px;
    left: 1px;

    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);
    transition: left 0.2s ease-in;
}

.dark-mode-btn--active::before {
    left: 29px;
}

.dark-mode-btn__icon {
    position: relative;
    z-index: 9;
}

/* Preview style */

.preview {
    min-height: 700px;
    padding: 40px 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background-image: var(--preview-img);
    background-repeat: no-repeat;
    background-size: auto;
    background-position: center center;

    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    text-align: center;
}

.preview__wrapper {
    padding: 0 15px;
    max-width: 660px;
}

.preview__title {
    margin-bottom: 20px;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.4;
    cursor: default;
}

.preview__title strong {
    font-size: 60px;
    font-weight: 700;
}

.preview__title em {
    font-style: normal;
    color: var(--accent-color);
}

.preview__text {
    margin-bottom: 35px;
    font-size: 18px;
    line-height: 1.333;
    cursor: default;
}

.preview__text p + p {
    margin-top: 0.5em;
}

/* Projects style */

.projects {
    padding: 10px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    column-gap: 30px;
    row-gap: 30px;
}

.project {
    max-width: 370px;
    border-radius: 10px;
    background-color: var(--project-bg);
    box-shadow: var(--project-box-shadow);
    transition: transform .25s;
}

@media (hover: hover) {
    .project:hover {
        transform: translateY(5px);
    }
}

.project__img {
    border-radius: 10px 10px 0 0;
}

.project__title {
    padding: 15px 20px 17px;

    font-size: 23px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color);

    transition: all 0.2s ease-in;
}

@media (hover: hover) {
    .project:hover .project__title {
        color: var(--accent-color);
    }
}

/* Project details style */

.project-details {
    margin: 0 auto;
    max-width: 865px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}

.project-details__cover {
    max-width: 100%;
    margin-bottom: 50px;
    box-shadow: var(--project-box-shadow);
    border-radius: 10px;
}

.project-details__desc {
    margin-bottom: 38px;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.3em;
    cursor: default;
}

/* Content list style */

.content-list {
    margin: 0 auto;
    max-width: 570px;

    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 40px;

    text-align: center;
}

.content-list a {
    font-weight: 500;
    color: var(--accent-color);
    transition: color 0.25s;
}

@media (hover: hover) {
    .content-list a:hover {
        color: #474df5;
    }
}

.content-list__item {
    font-size: 21px;
    line-height: 1.5;
    cursor: default;
}

.content-list__item p + p {
    margin-top: 0.5em;
}

/* Footer style */

.footer {
    margin-top: auto;
    padding: 43px 0 35px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-color);
}

.footer__wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 27px;
}

.social {
    display: flex;
    align-items: center;
    column-gap: 50px;
}

.social__item a {
    display: block;
    font-size: 43px;
    color: var(--text-color);
    transition: color .25s;
}

@media (hover: hover) {
    .social__item a:hover {
        color: var(--accent-color);
    }
}

.copyright {
    font-size: 16px;
    cursor: default;
}

.copyright p + p {
    margin-top: 0.5em;
}

@media (max-width: 581px) {
    .section {
        padding: 40px 0 50px;
    }

    .title-1 {
        margin-bottom: 28px;
        font-size: 40px;
    }

    .title-2 {
        margin-bottom: 10px;
        font-size: 30px;
    }

    .btn, .btn-icon {
        padding: 12px 25px;
    }

    .nav-row {
        justify-content: space-between;
    }

    .dark-mode-btn {
        order: 0;
    }

    .preview {
        min-height: 500px;
    }

    .preview__title {
        font-size: 30px;
    }

    .preview__title strong {
        font-size: 40px;
    }

    .preview__text {
        margin-bottom: 30px;
        font-size: 16px;
    }

    .project__title {
        font-size: 21px;
    }

    .project-details__cover {
        margin: 10px 0 35px;
    }

    .project-details__cover:not(:last-of-type) {
        margin: 10px 0 25px;
    }

    .project-details__desc {
        margin-bottom: 30px;
        font-size: 21px;
    }

    .content-list {
        row-gap: 20px;
    }

    .content-list__item {
        font-size: 18px;
    }

    .footer {
        padding: 28px 0 25px;
    }

    .footer__wrapper {
        row-gap: 18px;
    }

    .social {
        column-gap: 38px;
    }

    .social__item a {
        font-size: 38px;
    }

    .copyright {
        font-size: 15px;
    }
}

@media (max-width: 374px) {
    .title-1 {
        font-size: 28px;
    }

    .title-2 {
        font-size: 25px;
    }

    .btn, .btn-icon {
        height: 45px;
        padding: 10px 20px;
        font-size: 16px;
        line-height: 1.5;
    }

    .nav-row {
        column-gap: 35px;
    }

    .nav-list {
        column-gap: 35px;
    }

    .preview {
        min-height: 450px;
    }

    .preview__title {
        margin-bottom: 15px;
        font-size: 25px;
    }

    .preview__title strong {
        font-size: 28px;
    }

    .preview__text {
        margin-bottom: 25px;
        font-size: 15px;
    }

    .project__title {
        font-size: 18px;
    }

    .project-details__cover:not(:last-of-type) {
        margin: 10px 0 15px;
    }

    .project-details__desc {
        font-size: 18px;
    }

    .content-list__item {
        font-size: 17px;
    }

    .social {
        column-gap: 35px;
    }

    .social__item a {
        font-size: 35px;
    }

    .copyright {
        font-size: 14px;
    }
}
