body {
    font-family: "Roboto", sans-serif;
    color: #434455;
    background-color: #FFFFFF;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
    margin-bottom: 0;
}

ul {
    list-style-type: none;
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 0;
}

a {
    text-decoration: none;
}

input,
textarea {
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    white-space: nowrap;
    clip-path: inset(100%);
    clip: rect(0 0 0 0);
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 320px;
    padding: 0 16px;
    margin: 0 auto;
}

@media screen and (min-width:768px) {
    .container {
            max-width: 768px;
        }
}

@media screen and (min-width:1158px) {
    .container {
        max-width: 1158px;
        padding: 0 15px;
    }
}

/* header */

.header {
    border-bottom: 1px solid #E7E9FC;
    box-shadow: 0 1px 6px 0 rgba(46, 47, 66, 0.08), 0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 2px 1px 0 rgba(46, 47, 66, 0.08);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-list,
.contacts {
    display: none;
}

.studio-name {
    font-family: "Raleway", sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.17;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #4D5AE5;
}

.name-header {
    padding: 16px 0;
    display: block;
}

.accent {
    color: #2E2F42;
}

.burger-btn {
    padding: 0;
    border: none;
    background-color: transparent;
}

.burger-icon {
    display: block;
    fill: #2f2f37;
}

@media screen and (min-width:768px) {
    .nav {
        display: flex;
        align-items: center;
        }
        
    .name-header {
        padding: 24px 0;
        margin-right: 120px;
    }

    .nav-list {
        display: flex;
        align-items: center;
        gap: 40px;
    }

    .nav-item.current {
        position: relative;
    }

    .nav-item.current::after {
        position: absolute;
        left: 0;
        bottom: -1px;
        content: '';
        border-radius: 2px;
        width: 100%;
        height: 4px;
        background-color: #404BBF;
    }

    .nav-item {
        font-weight: 500;
        font-size: 16px;
        line-height: 1.5;
        letter-spacing: 0.02em;
        color: #2E2F42;
        display: inline-block;
        padding-top: 24px;
        padding-bottom: 24px;
        transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-item:hover,
    .nav-item:focus,
    .contacts-item:hover,
    .contacts-item:focus,
    .nav-item.current {
        color: #404BBF;
    }

    .contacts {
        display: block;
        font-style: normal;
    }

    .contacts-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .contacts-item {
        font-size: 12px;
        line-height: 1.17;
        letter-spacing: 0.04em;
        color: #434455;
        display: block;
        transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .burger-btn {
        display: none;
    }
}

@media screen and (min-width:1158px) {
.name-header {
        margin-right: 76px;
    }

    .contacts-list {
        flex-direction: row;
        align-items: center;
        gap: 40px;
    }

    .contacts-item {
        font-size: 16px;
        line-height: 1.5;
        letter-spacing: 0.02em;
        padding-top: 24px;
        padding-bottom: 24px;
    }
}

/* mobile menu */

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-container {
    position: relative;
    padding-top: 72px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.close {
    position: absolute;
    top: 24px;
    right: 24px;
    background-color: #e7e9fc;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    cursor: pointer;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.close:hover,
.close:focus {
    background-color: #404bbf;
    border: none;
}

.icon-close {
    fill: #2e2f42;
    transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.close:hover .icon-close,
.close:focus .icon-close {
    fill: #ffffff;
}

.mobile-menu-nav {
    margin-bottom: auto;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.mobile-nav-item {
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    color: #2E2F42;
    display: block;
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-item:hover,
.mobile-nav-item:focus,
.mobile-contacts-item:hover,
.mobile-contacts-item:focus,
.mobile-contacts-item.current,
.mobile-nav-item.current {
    color: #404BBF;
}

.mobile-contacts {
    margin-bottom: 48px;
}

.mobile-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-contacts-item {
    font-weight: 500;
    font-style: normal;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #434455;
    display: block;
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-soc-list {
    display: flex;
    gap: 40px;
    justify-content: space-between;
}

.link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4D5AE5;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.link:hover,
.link:focus {
    background-color: #404BBF;
}

.icon-soc {
    fill: #f4f4fd;
}

@media screen and (min-width:768px) {
    .mobile-menu {
        display: none;
    }
}

/* hero section */

.section.main-page {
    background: #2E2F42;
    padding-top: 72px;
    padding-bottom: 72px;
    background-image: linear-gradient(to bottom, rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)), url(../images/hero-bg/mobile-bg-min.jpg);
    background-repeat: no-repeat;
    max-width: 320px;
    background-size: cover;
    background-position: center;
    margin: 0 auto;
}

.main-page-title {
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-align: center;
    color: #FFFFFF;
    max-width: 216px;
    margin: 0 auto;
    margin-bottom: 72px;
}

.main-page-button {
    font-family: "Roboto", sans-serif;
    background: #4D5AE5;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #FFFFFF;
    cursor: pointer;
    border-radius: 4px;
    margin-right: auto;
    margin-left: auto;
    display: block;
    min-width: 169px;
    height: 56px;
    border: none;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.main-page-button:hover,
.main-page-button:focus {
    background-color: #404BBF;
}

@media screen and (min-resolution: 192dpi) {
    .section.main-page {
        background-image: linear-gradient(to bottom, rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)), url(../images/hero-bg/mobile-bg@2x-min.jpg);
    }
}

@media screen and (min-width: 768px) {
    .section.main-page {
        padding-top: 112px;
        padding-bottom: 112px;
        background-image: linear-gradient(to bottom, rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)), url(../images/hero-bg/tablet-bg-min.jpg);
        max-width: 768px;
    }
    
    .main-page-title {
        font-size: 56px;
        line-height: 1.07;
        max-width: 496px;
        margin-bottom: 36px;
    }
}

@media screen and (min-width: 768px) and (min-resolution: 192dpi) {
    .section.main-page {
            background-image: linear-gradient(to bottom, rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)), url(../images/hero-bg/tablet-bg@2x-min.jpg);
        }
}

@media screen and (min-width: 1158px) {
    .section.main-page {
        padding-top: 188px;
        padding-bottom: 188px;
        background-image: linear-gradient(to bottom, rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)), url(../images/hero-bg/desktop-bg-min.jpg);
        max-width: 1440px;
        }

    .main-page-title {
        margin-bottom: 48px;
    }
}

@media screen and (min-width: 1158px) and (min-resolution: 192dpi) {
    .section.main-page {
        background-image: linear-gradient(to bottom, rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)), url(../images/hero-bg/desktop-bg@2x-min.jpg);
    }
}

/* benefits section */

.section {
    padding-top: 96px;
    padding-bottom: 96px;
}

.rectangle {
    display: none;
}

.benefits-list {
    display: flex;
    gap: 72px;
    flex-wrap: wrap;
}

.benefits-item {
    width: 100%;
}

.benefits-title {
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-align: center;
    color: #2E2F42;
    margin-bottom: 8px;
}

.benefits-text {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #434455;
}

@media screen and (min-width: 768px) {
   
    .benefits-list {
        row-gap: 72px;
        column-gap: 24px;
    }

    .benefits-item {
        width: calc((100% - 24px) / 2);
    }

    .benefits-title {
        text-align: left;
    }
}

@media screen and (min-width: 1158px) {

    .section {
        padding-top: 120px;
        padding-bottom: 120px;
    }

    .rectangle {
        border: 1px solid #8E8F99;
        border-radius: 4px;
        background: #F4F4FD;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 24px 100px;
        margin-bottom: 8px;
        height: 112px;
    }

    .benefits-list {
        gap: 24px;
    }

    .benefits-item {
        width: calc((100% - 72px) / 4);
    }

    .benefits-title {
        font-weight: 500;
        font-size: 20px;
        line-height: 1.2;
    }
    
    .benefits-text {
        font-weight: 400;
    }
}

/* team section */

.team {
    background: #F4F4FD;
}

.container.team-container {
    padding: 0 28px;
}

.team-title {
    text-transform: capitalize;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-align: center;
    color: #2E2F42;
    margin-bottom: 72px;
}

.team-list {
    display: flex;
    flex-wrap: wrap;
    gap: 72px;
}

.team-item {
    background-color: #FFFFFF;
    width: 100%;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 1px 0 rgba(46, 47, 66, 0.08), 0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 1px 6px 0 rgba(46, 47, 66, 0.08);
}

.team-name {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
    color: #2E2F42;
    margin-bottom: 8px;
}

.team-position {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-align: center;
    color: #434455;
    margin-bottom: 8px;
}

.soc-list {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.card-container {
    padding: 32px 0;
}

@media screen and (min-width: 768px) {

    .container.team-container {
        padding: 0 108px;
    }

    .team-list {
        column-gap: 24px;
        row-gap: 64px;
    }

    .team-item {
        width: calc((100% - 24px) / 2);
    }
}

@media screen and (min-width: 1158px) {

    .container.team-container {
        padding: 0 15px;
    }

    .team-list {
        gap: 24px;
    }

    .team-item {
        width: calc((100% - 72px) / 4);
    }
}

/* portfolio section */

.portfolio-title {
    text-transform: capitalize;
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-align: center;
    color: #2E2F42;
    margin-bottom: 72px;
}

.portfolio-list {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
}

.portfolio-item {
    width: 100%;
    box-shadow: 0 2px 1px 0 rgba(46, 47, 66, 0.08), 0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 1px 6px 0 rgba(46, 47, 66, 0.08);
}

.portfolio-card-title {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #2E2F42;
    margin-bottom: 8px;
}

.portfolio-text {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #434455;
}

.portfolio-card {
    border-bottom: 1px solid #E7E9FC;
    border-left: 1px solid #E7E9FC;
    border-right: 1px solid #E7E9FC;
    padding: 32px 16px;
}

.overlay-text {
    display: none;
}

@media screen and (min-width: 768px) {

    .portfolio-list {
        column-gap: 24px;
        row-gap: 72px;
    }

        .portfolio-item {
        width: calc((100% - 24px) / 2);
    }
}

@media screen and (min-width: 1158px) {

    .portfolio-list {
        row-gap: 48px;
    }

    .portfolio-item {
        width: calc((100% - 48px) / 3);
        box-shadow: none;
        transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .portfolio-item:hover {
        box-shadow: 0 2px 1px 0 rgba(46, 47, 66, 0.08), 0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 1px 6px 0 rgba(46, 47, 66, 0.08);
    }

    .thumb {
        position: relative;
        overflow: hidden;
    }

    .overlay-text {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        font-size: 16px;
        line-height: 1.5;
        font-weight: 400;
        letter-spacing: 0.02em;
        color: #F4F4FD;
        padding: 40px 32px;
        background-color: #4D5AE5;
        height: 100%;
        width: 100%;
        transform: translateY(100%);
        transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
    }

    .portfolio-item:hover .overlay-text {
        transform: translateY(0);
    }
}

/* footer */

.footer {
    background: #2E2F42;
    padding-top: 96px;
    padding-bottom: 96px;
}

.container.container-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 72px;
}

.logo-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.studio-name.name-footer {
    display: block;
    margin-bottom: 16px;
    align-self: center;
}

.accent-footer {
    color: #F4F4FD;
}

.footer-text {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #F4F4FD;
    max-width: 264px;
}

.footer-soc {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-soc-text {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #FFFFFF;
    margin-bottom: 16px;
}

.soc-list-footer {
    display: flex;
    gap: 16px;
}

.link-footer:hover,
.link-footer:focus {
    background-color: #31D0AA;
}

.footer-mail {
    width: 100%;
}

.footer-mail-text {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #FFFFFF;
    margin-bottom: 16px;
    text-align: center;
}

.form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.email-input {
    border: 1px solid #FFFFFF;
    border-radius: 4px;
    width: 288px;
    height: 40px;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
    opacity: 0.3;
    background-color: transparent;
    padding-left: 16px;
}

.email.input::placeholder {
    color: #FFFFFF;
    font-size: 12px;
    line-height: 2;
    letter-spacing: 0.04em;
    color: #FFFFFF;
    opacity: 0.6;
}

.footer-button {
    min-width: 165px;
    border-radius: 4px;
    border: none;
    width: 165px;
    height: 40px;
    background-color: #4D5AE5;
    font-family: "Roboto", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-button:hover,
.footer-button:focus {
    background-color: #404BBF;
}

.icon-send {
    margin-left: 16px;
    fill: #ffffff;
}

@media screen and (min-width: 768px) {

    .container.container-footer {
        column-gap: 24px;
        row-gap: 72px;
        justify-content: left;
        padding: 0 108px;
    }

    .logo-wrap {
        max-width: 264px;
        display: block;
    }

    .footer-soc {
        max-width: 208px;
        display: block;
    }

    .footer-mail-text {
        margin-bottom: 16px;
        text-align: left;
    }

    .form {
        justify-content: left;
        gap: 24px;
    }

    .email-input {
        width: 264px;
    }
}

@media screen and (min-width: 1158px) {

    .footer {
        padding-top: 100px;
        padding-bottom: 100px;
    }

    .container.container-footer {
        gap: 0;
        padding: 0 15px;
        flex-wrap: nowrap;
    }

    .logo-wrap {
        margin-right: 120px;
    }

    .footer-soc {
        margin-right: 80px;
    }

    .form {
        gap: 24px;
        justify-content: center;
    }

    .email-input {
        opacity: 1;
    }

    .email.input::placeholder {
        opacity: 1;
    }

}

/* modal */

.modal-overlay {
    background-color: rgba(46, 47, 66, 0.4);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1), visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 2px 1px 0 rgba(0, 0, 0, 0.2);
    background: #fcfcfc;
    border-radius: 4px;
    width: 288px;
    min-height: 623px;
    padding: 72px 16px 24px 16px;
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-title {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-align: center;
    color: #2e2f42;
    margin-bottom: 16px;
}

.form-wrap {
    margin-bottom: 8px;
}

.modal-label {
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: #8e8f99;
    display: block;
    margin-bottom: 4px;
}

.modal-input {
    border: 1px solid rgba(46, 47, 66, 0.4);
    border-radius: 4px;
    background-color: transparent;
    width: 100%;
    height: 40px;
    padding-left: 34px;
    outline: transparent;
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-input:focus-within {
    border-color: #4D5AE5;
}

.modal-input:focus-within+.icon-modal {
    fill: #4d5ae5;
}

.input-form {
    position: relative;
}

.icon-modal {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.textarea-wrap {
    margin-bottom: 16px;
}

.modal-textarea {
    width: 100%;
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: rgba(46, 47, 66, 0.4);
    border: 1px solid rgba(46, 47, 66, 0.4);
    border-radius: 4px;
    background-color: transparent;
    height: 120px;
    padding: 8px 16px;
    resize: none;
    outline: transparent;
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-textarea:focus-within {
    border-color: #4D5AE5;
}

.checkbox {
    margin-bottom: 24px;
}

.checkbox-label {
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: #8e8f99;
    display: flex;
    align-items: center;
}

.checkbox-span {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(46, 47, 66, 0.4);
    border-radius: 2px;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1), border 250ms cubic-bezier(0.4, 0, 0.2, 1), fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    fill: transparent;
    margin-right: 8px;
    flex-shrink: 0;
}

.checkbox-input:checked+label>.checkbox-span {
    background-color: #404bbf;
    border: none;
    fill: #F4F4FD;
}

.checkbox-link {
    color: #4d5ae5;
    line-height: 1.33;
    text-decoration: underline;
    text-decoration-skip-ink: none;
}

.send-button {
    display: block;
    margin: 0 auto;
    border-radius: 4px;
    min-width: 169px;
    height: 56px;
    border: none;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
    background: #4d5ae5;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #FFFFFF;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.send-button:hover,
.send-button:focus {
    background-color: #404BBF;
}

@media screen and (min-width: 768px) {
    .modal {
        width: 408px;
        min-height: 584px;
        padding: 72px 24px 24px 24px;
    }
}

@media screen and (min-width: 1158px) {
    .modal-input {
        padding-left: 38px;
    }
}

