:root {
  --font-family: "Roboto", sans-serif;
  --second-family: "Raleway", sans-serif;
}

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

a {
    text-decoration: none;
}

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


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

button {
    cursor: pointer;  
}

body {
    font-family: var(--font-family);
    color: #434455;
    background-color: #fff;
}

.container {
    width: 1158px;
    margin-right: auto;
    margin-left: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.section {
    padding: 120px 0;
}

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



/* ========== COMPONENTS ========== */

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

.logo {
    font-family: var(--second-family);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.17;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color:  #4d5ae5;
}


/* ========== 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);
}

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

.piece-logo-header {
    color: #2e2f42;
}

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

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

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


.nav-list-link {
    position: relative;
    display: block;
    padding: 24px 0;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #2e2f42;
    overflow: hidden;
    transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-list-link:hover,
.nav-list-link:focus,
.nav-list-link.current {
    overflow: visible;
}

.nav-list-link:hover,
.nav-list-link:focus,
.address-list-link:hover,
.address-list-link:focus,
.nav-list-link.current {
    color: #404bbf;
}

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

.nav-list-link:hover::after,
.nav-list-link:focus::after,
.nav-list-link.current::after {
    transform: translateX(0);
}

.address {
    font-style: normal;
}

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

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


/* ========== HERO ========== */

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

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

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

.modal-btn:hover,
.modal-btn:focus {
    background-color:  #404bbf;
}



/* ========== BENEFITS ========== */


.benefits-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

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

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

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

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




/* ========== TEAM ========== */


.team {
    background-color: #F4F4FD;
}

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

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

.team-card-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 0;
}

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

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


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

.social-list-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);

}

.social-list-icon {
    fill: #f4f4fd;
}

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


/* ========== PORTFOLIO ========== */

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

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

.portfolio-list-item:hover,
.portfolio-list-item:focus {
    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-img-wrapper {
    position: relative;
    overflow: hidden;
}

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

.portfolio-list-item:hover .overlay,
.portfolio-list-item:focus .overlay {
     transform: translateY(0%);
}

.portfolio-card-content-wrapper {
    border-bottom: 1px solid  #e7e9fc;
    border-left: 1px solid  #e7e9fc;
    border-right: 1px solid  #e7e9fc;
    padding: 32px 16px;
    width: 360px;
    height: 120px;
}

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

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




/* ========== FOOTER ========== */

.footer {
    padding: 100px 0;
    background-color: #2e2f42;
}

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

.logo-footer-container {
    margin-right: auto;
}

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

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

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

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

.social-list-footer-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);

}

.social-list-footer-icon {
    fill: #f4f4fd;
}

.social-list-footer-link:hover,
.social-list-footer-link:focus {
    background-color: #31d0aa;
} 

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

.footer-form-container {
    margin-left: auto;
}

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

.footer-form-input {
    padding-left: 16px;
    border: 1px solid #fff;
    border-radius: 4px;
    width: 264px;
    height: 40px;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
    background-color: transparent;
    outline: none;
    font-weight: 400;
    font-size: 12px;
    line-height: 2;
    letter-spacing: 0.04em;
    color: #fff;
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-form-input:focus {
    border-color: #31d0aa;
}

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

.footer-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 165px;
    padding: 8px 24px;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.04em;
    text-align: center;
    color: #fff;
    border-radius: 4px;
    background-color: #4d5ae5;
    border: none;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-modal-btn-icon {
    margin-left: 16px;
    fill: #fff;
}

.footer-modal-btn:hover,
.footer-modal-btn:focus {
    background-color: #31d0aa;
}



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

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

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

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

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


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

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

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

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

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

.modal-form-wrapper {
    margin-bottom: 8px;
    width: 100%;
}

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

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

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

    font-weight: 400;
    font-size: 12px;
    line-height: 1.16667;
    letter-spacing: 0.04em;
    color: black);
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

.modal-form-message-wrapper {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-form-message {
    padding: 8px 16px;
    border: 1px solid rgba(46, 47, 66, 0.4);
    border-radius: 4px;
    width: 100%;
    height: 120px;
    resize: none;
    background-color: transparent;
    outline: transparent;

    font-weight: 400;
    font-size: 12px;
    line-height: 1.17;
    letter-spacing: 0.04em;
    color: rgba(46, 47, 66, 0.4);
    transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-form-message:focus {
    outline: none;
    border-color:  #4d5ae5;
}

textarea::placeholder {
    font-weight: 400;
    font-size: 12px;
    line-height: 1.16667;
    letter-spacing: 0.04em;
    color: rgba(46, 47, 66, 0.4);
}

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

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

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

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


.modal-form-checkbox:checked+.modal-form-checkbox-desc>.custom-checkbox {
    border: 1px solid #404bbf;
    background-color: #404bbf;
    fill: #f4f4fd;
    border: none;
}

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

.modal-form-submit-btn:hover,
.modal-form-submit-btn:focus {
    background-color: #404bbf;
}

