/* ========= Global styles ========= */


:root {
    --primary-color: #4d5ae5;
    --primary-hover-color: #404bbf;
    --secondary-color: #2e2f42;
    --text-color: #434455;
    --light-color: #f4f4fd;
    --footer-hover-color: #31d0aa;
    --icon-color: #f4f4fd;
    --icon-hover-color: #ffffff;
}

body {
    font-family: "Roboto", sans-serif;
    color: var(--text-color);
    background-color: #fff;
}

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

h1,
h2,
h3,
p {
    margin: 0;
}

a {
    text-decoration: none;
}

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

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

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

/* ========= Header ========= */
.page-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;
    align-items: center;
}

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

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

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

.header-logo .logo-part {
    color: var(--secondary-color);
}

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

.nav-link {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--secondary-color);
    padding: 24px 0;
    display: block;
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-link.current::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background-color: var(--primary-hover-color);
}

.nav-link:hover,
.nav-link:focus,
.nav-link.current {
    color: var(--primary-hover-color);
}

.contacts {
    margin-left: auto;
    font-style: normal;
}

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

.contacts-link {
    display: block;
    padding: 24px 0;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--text-color);
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.contacts-link:hover,
.contacts-link:focus {
    color: var(--primary-hover-color);
}

/* ========= Hero ========= */
.hero {
    background-color: var(--secondary-color);
    padding: 188px 0;
    background-image: linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
        url('../images/office-1.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    max-width: 1440px;
    margin: 0 auto;
}

.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-title {
    font-weight: 700;
    font-size: 56px;
    line-height: 1.07;
    letter-spacing: 0.02em;
    text-align: center;
    color: #fff;
    max-width: 496px;
    margin-bottom: 48px;
}

.order-button {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #fff;
    background-color: var(--primary-color);
    cursor: pointer;
    padding: 16px 32px;
    margin: 0 auto;
    border-radius: 4px;
    min-width: 169px;
    height: 56px;
    border: none;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.order-button:hover,
.order-button:focus {
    background-color: var(--primary-hover-color);
}

/* ========= Features ========= */
.features-section {
    padding: 120px 0;
}

.sections-list {
    display: flex;
    gap: 24px;
}

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

.section-title {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--secondary-color);
    margin: 8px 0;
}

.section-item {
    width: calc((100% - 3 * 24px) / 4);
}

.section-text {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--text-color);
}

/* ========= Team ========= */
.team-section {
    background-color: var(--light-color);
    padding: 120px 0;
}

.team-hero {
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--secondary-color);
    text-transform: capitalize;
    margin-bottom: 72px;
}

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

.team-item {
    background-color: #fff;
    border-radius: 0px 0px 4px 4px;
    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);
}

.team-decor {
    padding: 32px 0;
}

.team-title {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

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

.social-list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.social-item {
    width: 40px;
    height: 40px;
}

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

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

.social-icon {
    fill: var(--icon-color);
    transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========= Portfolio ========= */
.portfolio-section {
    padding: 120px 0;
}

.portfolio-hero {
    color: var(--secondary-color);
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    text-align: center;
    margin-bottom: 72px;
}

.portfolio-list {
    display: flex;
    flex-wrap: wrap;
    column-gap: 24px;
    row-gap: 48px;
    align-items: center;
}

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

.portfolio-item: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-image-wrapper {
    position: relative;
    overflow: hidden;
}

.portfolio-description {
    padding: 40px 32px;
    background-color: var(--primary-color);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--light-color);
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(100%);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.portfolio-title {
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--secondary-color);
    text-transform: capitalize;
    margin-bottom: 8px;
}

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

/* ========= Footer ========= */
.footer {
    background-color: #2e2f42;
    height: 312px;
    padding: 100px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

.footer-container {
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

.footer-description {
    margin-right: 120px;
}

.logo-link {
    font-family: "Raleway", sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 117%;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #4d5ae5;
    display: inline-block;
    margin-bottom: 16px;
}

.footer-logo-text {
    color: var(--light-color);
}

.footer-text {
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0.02em;
    color: #f4f4fd;
    width: 264px;
}

/* ========= Footer Social Media ========= */
.footer-social-subscribe {
    display: flex;
    align-items: baseline;
    gap: 80px;
    width: 208px;
}

.social-wrapper {
    margin-right: 80px;
}

.social-heading {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #ffffff;
    margin-bottom: 16px;
}

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

.footer .social-item {
    width: 40px;
    height: 40px;
}

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

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

.footer .social-icon {
    fill: var(--light-color);
}

/* ========= Footer Subscribe Form ========= */

.subscription-heading {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0.02em;
    color: #ffffff;
    margin-bottom: 16px;
}

.subscription-form {
    display: flex;
    flex-direction: row;
    gap: 24px;
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0.02em;
    color: #fff;
}

.subscription-label {
    display: flex;
    flex-direction: row;
    gap: 24px;
}

.subscription-input {
    border: 1px solid #fff;
    background-color: transparent;
    border-radius: 4px;
    width: 264px;
    height: 40px;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
    padding-left: 16px;
    font-weight: 400;
    font-size: 12px;
    line-height: 200%;
    letter-spacing: 0.04em;
    color: #fff;
}

.subscription-input::placeholder {
    color: #ffffff;
}

.subscription-button {
    border-radius: 4px;
    border: none;
    padding: 8px 24px;
    min-width: 165px;
    height: 40px;
    background-color: #4d5ae5;
    font-family: "Roboto", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0.04em;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.subscription-button:hover,
.subscription-button:focus {
    background-color: var(--primary-hover-color);
}

.subscription-icon {
    fill: #fff;
    margin-left: 16px;
}

:root {
    --primary-color: #4d5ae5;
    --primary-hover-color: #404bbf;
    --light-color: #f4f4fd;
    --text-secondary: #8e8f99;
}

/* ========= Modal ========= */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(46, 47, 66, 0.4);
    z-index: 999;
    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);
    margin-bottom: 8px;
}

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

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

.backdrop:not(.is-open) .modal {
    transform: translate(-50%, -50%) scale(1.5);
}

/* ========= Close button ========= */
.close-button {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e7e9fc;
    border: 1px solid rgba(0, 0, 0, 0.1);
    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-button:hover,
.close-button:focus {
    background-color: var(--primary-hover-color);
    border: none;
}

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

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

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

/* ========= Modal Form ========= */
.modal-form {
    display: flex;
    flex-direction: column;
}

.modal-prefix {
    margin-bottom: 8px;
}
.modal-prefix-comment {
    margin-bottom: 16px;
}

.modal-label {
    font-weight: 400;
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.modal-input-wrapper {
    position: relative;
}

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

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

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

.modal-input:focus~.input-icon {
    fill: var(--primary-color);
}

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

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

.modal-textarea::placeholder {
    color: rgba(46, 47, 66, 0.4);
}

/* ========= Modal Checkbox ========= */
.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;
}

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

.custom-checkbox-label {
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    align-items: center;
    gap: 8px;
}

.checkbox-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(46, 47, 66, 0.4);
    border-radius: 2px;
    fill: transparent;
    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);
}

.custom-checkbox-input:checked+.custom-checkbox-label .checkbox-icon {
    background-color: var(--primary-hover-color);
    border: none;
    fill: var(--light-color);
}

.checkbox-svg {
    width: 10px;
    height: 8px;
}

.privacy-policy-link {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ========= Modal Submit Button ========= */
.modal-button {
    display: block;
    min-width: 169px;
    height: 56px;
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #ffffff;
    cursor: pointer;
    background-color: var(--primary-color);
    border: none;
    border-radius: 4px;
    margin: 0 auto;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-button:hover,
.modal-button:focus {
    background-color: var(--primary-hover-color);
}