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

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

a {
    text-decoration: none;
}

address {
    font-style: normal;
}

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

img {
    display: block;
}

button {
    cursor: pointer;
}

.container {
    max-width: 1158px;
    padding-left: 15px;
    padding-right: 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------ */

.header {
    border-bottom: 1px solid #e7e9fc;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 999;
}

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

.header-logo {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.17;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #4d5ae5;
    font-family: "Raleway", sans-serif;
    margin-right: 76px;
}

.header-studio {
    color: #2e2f42;
}

.header-list {
    display: flex;
    gap: 40px;
}

.header-item {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #2e2f42;
}

.header-nav-link {
    color: #2e2f42;
    padding: 24px 0;
    display: block;
    position: relative;
    color: #404bbf;
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.header-nav-link:hover, .header-nav-link:active,
.contacts-link:hover, .contacts-link:active {
    color: #404bbf;
}

.nav-link-studio::after {
    content: "";
    width: 100%;
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 4px;
    background-color: #404bbf;
    border-radius: 2px;
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.header-contacts {
    margin-left: auto;
}

.header .container {
    display: flex;
    align-items: center;
    padding: 0 15px;
    margin: 0 auto;
}

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

.contacts-item {}

.contacts-link {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #434455;
}


/* ----- HERO ----- */
.hero {
    background-color: #2e2f42;
    max-width: 1440px;
    height: 600px;
    padding-top: 188px;
    padding-bottom: 188px;
    margin: 0 auto;
    background-image: linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)), url("../images/people-office.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.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: 0 auto 48px;

}

.hero-btn {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #fff;
    background-color: #4d5ae5;
    display: block;
    border-radius: 4px;
    height: 56px;
    border: none;
    min-width: 169px;
    margin: 0 auto;
    font-family: "Roboto", sans-serif;
    transition-property: background-color, color;
    transition-duration: 250ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);

}

.hero-btn:hover, .hero-btn:focus {
    background: #404bbf;
}
/* -----ADVANTAGES ----- */

.advantages {
    padding: 120px 0;
}

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

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

.advantages-icon-wrapper {
    background-color: #f4f4fd;
    border: 1px solid #8e8f99;
    border-radius: 4px;
    width: 264px;
    height: 112px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.advantages-subtitle {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #2e2f42;
    margin-bottom: 8px;
}

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

/* ----- TEAM ----- */

.team {
    background: #f4f4fd;
    padding: 120px 0;
}

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

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

.team-item {
    width: calc((100% - 72px) / 4);
    border-radius: 0px 0px 4px 4px;
    background-color: #fff;
    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-img {}

.employee-info {
    padding: 32px 0;
}

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

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

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

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

.socials-icon {
    fill:#f4f4fd
}

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

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

/* ----- PORTFOLIO ----- */

.portfolio {
    padding: 120px 0;
}

.portfolio-title {
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11;
    letter-spacing: 0.02em;
    text-align: center;
    color: #2e2f42;
}

.portfolio-list {
    display: flex;
    column-gap: 24px;
    row-gap: 48px;
    margin-top: 72px;
    flex-wrap: wrap;
}

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

.portfolio-item:hover {
    transform: translateY(0%);
    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-item:hover .flip-text {
    transform: translateY(0);
}

.portfolio-img {}

.flip-card {
    position: relative;
    overflow: hidden;
}

.flip-text {
    position: absolute;
    top: 0;
    left: 0;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #f4f4fd;
    background: #4d5ae5;
    padding: 40px 32px 164px;
    height: 100%;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}


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

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

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

/* ----- FOOTER ----- */

.footer {
    background: #2e2f42;
    padding-top: 100px;
    padding-bottom: 132px;
}

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

.footer-about {}

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

.footer-logo-word {
    color: #f4f4fd;
}

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

.socials-footer {
    margin-left: 120px;
    
}

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

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

.footer-socials-item {
    width: 40px;
    height: 40px;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.footer-socials-link:hover, .footer-socials-link:focus {
    background-color: #31d0aa
}

.form-subscribe {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-subscribe {
    margin-left: 80px;
    width: 453px;
    height: 80px;
}

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

.subscribe-input:placeholder {
    font-size: 12px;
    line-height: 2;
    letter-spacing: 0.04em;
    color: #fff;
}


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

.subscribe-button {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    border: none;
    min-width: 165px;
    height: 40px;
    background-color: #4d5ae5;
    color: #fff;
    text-align: center;
    align-items: center;
    justify-content: center;
    font-family: "Roboto", sans-serif;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.04em;
}

.subscribe-button:hover, .subscribe-button:focus {
    background-color: #404bbf;
}

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

/* ---- MODAL ----- */

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

.is-open .modal-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 250ms ease-in-out, visibility 250ms ease-in-out; 
}

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

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    fill: #2e2f42; 
    background-size: 16px 16px;
    background-color: #e7e9fc;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0;
    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: #404bbf;
    fill: #fff;
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.modal-close-icon {
    transition: fill 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;
    margin-top: 24px;
}

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

.input-wrapper {
    position: relative;
}

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

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

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

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

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

.modal-btn {
    border-radius: 4px;
    border: none;
    padding: 16px 32px;
    min-width: 169px;
    height: 56px;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
    background-color: #4d5ae5;
    text-align: center;
    color: #fff;
    font-weight: 500;
    display: block;
    margin: 24px auto;
    font-family: "Roboto", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);

}

.input-icon {
    fill: #2e2f42;
    padding: 3px 0px;
    width: 18px;
    height: 24px;
    position: absolute;
    left: 16px;
    top: 50%;
    transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-50%);
}

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

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

}

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

.modal-field-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.modal-checkbox {
    border-radius: 2px;
    border: 1px solid rgba(46, 47, 66, 0.4);
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.modal-checkbox:checked + .checkbox-label > .modal-check {
    background-color: #404bbf;
    border: none;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
    fill: #f4f4fd;
}

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

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

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

.check-icon {
    fill: #f4f4fd;
}