:root {
    --iris: #4d5ae5;
    --ocean: #404bbf;
    --navy-blue: #2e2f42;
    --green: #31d0aa;
    --slate: #434455;
    --light-slate: #8e8f99;
    --cornflower: #e7e9fc;
    --cloud: #f4f4fd;
    --navy-blue-modal: rgba(46, 47, 66, 0.4);
    --grey: rgba(46, 47, 66, 0.7);
    --white: #fff;
    --dairy: #fcfcfc;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
    padding: 0;
}

ul {
    margin: 0;
    padding: 0;
}

li {
    list-style-type: none;
}

body {
    font-family:"Roboto", sans-serif;
    background-color: var(--white);
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--slate);
}

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

.container {
    max-width: 1158px;
    padding: 0 15px;
    margin: 0 auto;
}

/* header section */

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

.header .container {
    display: flex;
}

.header-nav {
    display: flex;
    align-items: center;
}

.header-nav .logo {
    padding-top: 24px 0;
    margin-right: 76px;
}

.header-list {
    display: flex;
/*     padding: 24px 0; */
    gap: 40px;
}

.header-links {
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    position: relative;
    padding: 24px 0;
}

.header-list > li:first-child > a:after {
    content: "";
    width: 100%;
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 4px;
    border-radius: 2px;
    background-color: #404bbf;
}

.header-list > li:first-child > a {
    color: #404bbf;
}

.contacts-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 40px;
    margin-left: 332px;
    padding: 24px 0;
    margin-right: 0;
}

.contacts-list a {
    white-space: nowrap;
}

.head-contact {
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.main {
    margin: 0 auto;
}

.main-tag {
    font-weight: 700;
    font-size: 56px;
    line-height: 1.07;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--white);
}

.second-tag {
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-align: center;
    text-transform: capitalize;
    color: var(--navy-blue);
}

.third-tag {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--navy-blue);
}

.logo {
    font-family: "Raleway", sans-serif;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.17;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.header-links {
    text-decoration: none;
    font-weight: 500;
    color: var(--navy-blue);
}

.header-links:hover,
.header-links:focus {
    color: var(--ocean)
}

.header-contacts {
    font-style: normal;
}

.head-contact {
    text-decoration: none;
    color: var(--slate);
}

.head-contact:hover,
.head-contact:focus {
    color: var(--ocean)
}

/* main section */

.main {
    background-color: var(--navy-blue);
    display: block;
    padding-top: 188px;
    padding-bottom: 188px;
    background-image: linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
    url(../images/background_main.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% 50%;
    max-width: 1440px;
}

.main-tag {
    display: block;
    margin: 0 auto;
    text-align: center;
    max-width: 496px;
    max-height: 120px;
}

.main-button {
    display: block;
    margin: 0 auto;
    justify-content: center;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: var(--white);
    background-color: var(--iris);
    cursor: pointer;
    margin-top: 48px;
    padding: 16px 32px;
    min-width: 169px;
    height: 56px;
    border: none;
    border-radius: 4px;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.main-button:hover,
.main-button:focus {
    background-color: var(--ocean);
}

.second-tag {
    text-align: center;
}

/* advantages section */

.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;
}

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

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

.advantages-list li {
    max-width: 264px;
}

.adv-container {
    width: 264px;
    height: 112px;
    background-color: var(--cloud);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    border: 1px solid #8e8f99;
    border-radius: 4px;
}

.advantages-list-cell {
    width: calc((100% - 72px) / 4);
}

.advantages-list li h3 {
    margin-bottom: 8px;
}

/* profiles section */

.profiles {
    background-color: var(--cloud);
    padding: 120px 0;
}

.profiles .second-tag {
    margin-bottom: 72px;
}

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

.profiles-list li {
    background-color: var(--white);
    width: calc((100% - 72px) /4);
    border-radius: 0px 0px 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);
}

.profiles-container-desc {
    padding: 32px 0;
}

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

.prof-list-socials li {
    width: 40px;
    height: 40px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
}

.prof-social-link {
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.prof-social-link {
    width: 100%;
    height: 100%;
    background-color: var(--iris);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prof-social-link:hover,
.prof-social-link:focus {
    background-color: var(--ocean);
}

.svg-profile {
    fill: var(--cloud);
}

.profiles-list .third-tag {
    margin-bottom: 8px;
    text-align: center;
}

.profiles-text {
    text-align: center;
    margin-bottom: 8px;
}

/* porfolio section */

.portfolio {
    padding: 120px 0;
}

.portfolio .second-tag {
    margin-bottom: 72px;
}

.portfolio-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    flex-direction: row;
    gap: 24px;
    row-gap: 48px;
}

.portfolio-list-cell {
    width: calc((100% - 48px) / 3);
}

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

.portfolio-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-list .third-tag {
    margin-bottom: 8px;
}

.portfolio-container {
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-image-text {
    height: 100%;
    width: 100%;
    position: absolute;
    inset: 0;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #f4f4fd;
    padding: 40px 32px;
    background-color: #4d5ae5;
    transform: translateY(100%);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-list-cell:hover .portfolio-image-text {transform: translateY(0);}

.portfolio-container-text {
    padding: 32px 16px;
    border: 1px solid #e7e9fc;
    border-top: none;
}

.portfolio-container-text h3 {
    margin-bottom: 8px;
}

/* footer section */

.footer {
    background-color: var(--navy-blue);
    padding: 100px 0;
}

.footer .container {
    display: flex;
    align-items: baseline;
    margin-left: 0;
    margin-right: 0;
    max-width: 1158px;
    margin: 0 auto;
}

.footer-cont-logo {
    margin-right: 120px;
}

.footer .logo {
    display: inline-block;
    margin-bottom: 16px;
}

.footer-logo-text {
    color: var(--cloud);
    max-width: 264px;
}

.footer-social-text {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--white);
    margin-bottom: 16px;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 16px;
    fill: var(--cloud);
}

.footer-socials-cell {
    background-color: var(--iris);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    position: relative;
}

.footer-social-link {
    width: 100%;
    height: 100%;
    background-color: var(--iris);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social-link:hover,
.footer-social-link:focus {
    background-color: var(--green);
}

.svg-footer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.footer-subscribe {
    margin-left: auto;
}

.footer-subscribe-buttons {
    display: flex;
    gap: 24px;
}

.footer-subscribe-input {
    display: inline-block;
    width: 264px;
    height: 40px;
    border: 1px solid var(--white);
    border-radius: 4px;
    width: 264px;
    height: 40px;
    background-color: inherit;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
    padding: 8px 16px;
    font-size: 12px;
    line-height: 2;
    letter-spacing: 0.04em;
    color: #ffffff;
    outline: none;
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-subscribe-input::placeholder {
    color: #ffffff;
}

.footer-subscribe-buttons input:hover,
.footer-subscribe-buttons input:focus,
.footer-subscribe-buttons input:active {
    border-color: var(--green);
}

.subscribe-submit {
    font-family: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 165px;
    height: 40px;
    background-color: var(--iris);
    border-radius: 4px;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: var(--white);
    cursor: pointer;
    border: none;
}

.subscribe-submit:hover,
.subscribe-submit:focus {
    background-color: var(--green);
}

.footer-subscribe-text {
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--white);
}

.subscribe-submit svg {
    fill: #F4F4FD;
    margin-left: 16px;
}

/* modal window */

.modal_background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 47, 66, 0.4);
    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);
}

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

.modal-window {
    padding: 72px 24px 24px 24px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--dairy);
    width: 408px;
    min-height: 584px;
    border-radius: 4px;
    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);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal_background:not(.is-open) .modal-window {
    transform: translate(-50%, -100%);
}

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

.modal-close:hover,
.modal-close:focus {
    background-color: var(--ocean);
    border: none;
    fill: #ffffff;
}

.svg-modal {
    transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-form {
    min-height: 336px;
}

.modal-text {
    display: block;
    font-weight: 500;
    text-align: center;
    margin-bottom: 16px;
    color: #2e2f42;
}

.modal-forms {
    width: 360px;
    min-height: 58px;
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

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

.modal-lables-container {
    position: relative;
}

.modal-lable-form {
    position: relative;
    margin-bottom: 8px;
}

.modal-input {
    width: 100%;
    border: 1px solid var(--navy-blue-modal);
    border-radius: 4px;
    height: 40px;
    padding-left: 38px;
    outline: none;
    background-color: transparent;
    outline: transparent;
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-input:focus {
    border-color: var(--iris);
}

.modal-input:focus ~ svg {
    fill: var(--iris);
}

.modal-lable-textarea {
    margin-bottom: 16px;
}

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

.modal-textarea:focus {
    border-color: var(--iris);
}

.modal-textarea::placeholder {
    font-weight: 400;
    font-size: 12px;
    line-height: 1.16667;
    letter-spacing: 0.04em;
    color: var(--navy-blue-modal);
}

.modal-lable-checkbox {
    margin-bottom: 24px;
}

.modal-checkbox {
    font-weight: 400;
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: #8e8f99;
    text-align: center;
}

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

.modal_button_send:hover,
.modal_button_send:focus {
    background-color: var(--ocean);
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-link {
    color: var(--iris);
}

.custom-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid var(--navy-blue-modal);
    position: relative;
    margin-right: 8px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background-color: var(--white);
    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);
    fill: transparent;
}

.modal-vector {
    fill: transparent;
}

#user-privacy:checked + .modal-checkbox > .custom-checkbox {
    background-color: var(--ocean);
    fill: #F4F4FD;
    border: none;
}

#user-privacy:checked+.modal-checkbox>.custom-checkbox>.modal-vector {
    fill: #F4F4FD;
    border: none;
}