body {
  font-family: "Roboto", sans-serif;
  color: #434455;
  background-color: #fff;
  line-height: 24px;
  font-size: 16px;
}
a {
  text-decoration: none;
}
ul {
  list-style: none;
}
img {
  display: block;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
ul {
  margin: 0;
  padding-left: 0;
}
button {
  font-family: "Roboto", sans-serif;
  background: #4d5ae5;
  color: #fff;
  cursor: pointer;
  min-width: 169px;
  display: block;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 4px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.container {
  max-width: 320px;
  padding: 0 16px;
  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;
}
.logo-header {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4d5ae5;
  padding: 16px 0;
}
.header {
  border-bottom: 1px solid #e7e9fc;
  box-shadow: 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;
  justify-content: space-between;
}
.header-nav {
  display: flex;
  align-items: center;
  margin-bottom: auto;
}
.header-nav .logo-header {
  margin-right: 76px;
}
.header-mobile-btn {
  margin: 16px 0;
  height: 24px;
  background: transparent;
  min-width: 24px;
}
.mobile-top-menu {
  background: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  opacity: 0;
  pointer-events: none;
}
.top-menu-mob {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.mobile-menu-container {
  width: 320px;
  padding: 72px 16px 40px;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.mobile-top-menu .button-close {
  background-color: rgba(231, 233, 252, 0.1);
  border: 1px solid rgba(46, 47, 66, 0.1);
}
.logo-hader-part {
  color: #2e2f42;
}

.logo-footer-part {
  color: #f4f4fd;
}
.contacts-us-mob .contacts-us-menu {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 48px;
}
.contacts-us-mob .link {
  font-size: 20px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.02em;
  font-style: normal;
}

.mobile-menu-container .social-links {
  justify-content: left;
  align-self: normal;
  margin-top: 0;
  gap: 40px;
}
.link {
  font-size: 36px;
  font-weight: 700;
  line-height: 40px;
  letter-spacing: 0.02em;
  position: relative;
  color: #2e2f42;
  display: flex;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.contacts-us {
  align-items: flex-end;
  font-style: normal;
}
.link:hover,
.link:focus,
.contacts-us .link:hover,
.contacts-us .link:focus,
.active {
  color: #404bbf;
}

.contacts-us .link {
  color: #434455;
  font-weight: 400;

  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.our-portfolio {
  padding-top: 120px;
  padding-bottom: 120px;
}

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

.our-portfolio-list {
  display: flex;
  flex-wrap: wrap;
  row-gap: 48px;
  column-gap: 24px;
}
.our-portfolio-item-description {
  padding: 32px 16px;
  border: 1px solid #e7e9fc;
  border-top: none;
}
.our-portfolio-item {
  box-shadow: 0px 2px 1px 0px #2e2f4214, 0px 1px 1px 0px #2e2f4229,
    0px 1px 6px 0px #2e2f4214;
}
.our-portfolio-item-img {
  max-width: 100%;
}
.our-portfolio-item-overlay {
  position: relative;
  overflow: hidden;
}
.our-portfolio-subtitle {
  color: #2e2f42;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.our-portfolio-item-text {
  color: #434455;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
}
.orders-section {
  background-color: #2e2f42;
  background-image: linear-gradient(
      to bottom,
      rgba(46, 47, 66, 0.7),
      rgba(46, 47, 66, 0.7)
    ),
    url(../images/people-officex2.jpg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: inset blur 50% grey;
  text-align: center;
  padding: 72px 0;
  margin: 0 auto;
  max-width: 320px;
}

.orders-section-header {
  color: #fff;
  font-weight: 700;
  line-height: 1.07;
  letter-spacing: 0.02em;
  max-width: 216px;
  font-size: 36px;
  margin: 0 auto 72px;
}
.orders-section-button {
  margin: auto;
  text-align: center;
  padding: 16px 32px;
  box-shadow: 0px 4px 4px 0px #00000026;
}
.orders-section-button:hover,
.orders-section-button:focus,
.subscribe-button:hover,
.subscribe-button:focus,
.form-button:hover,
.form-button:focus {
  background-color: #404bbf;
  cursor: pointer;
}
.features,
.our-team,
.our-portfolio,
.footer {
  padding: 96px 0;
}

.features-list {
  flex-wrap: wrap;
}
.top-menu,
.contacts-us,
.features-icon-container {
  display: none;
}
.features-header {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #2e2f42;
}
.features-item {
  width: 100%;
  margin-bottom: 72px;
}

.features-icon {
  display: block;
  margin: 24px auto;
}
.features-item-header {
  font-size: 36px;
  font-weight: 700;
  line-height: 40px;
  letter-spacing: 0.02em;
  color: #2e2f42;
  margin-bottom: 8px;
  text-align: center;
}
.features-item-description {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
}
.our-team {
  background-color: #f4f4fd;
  padding-top: 120px;
  padding-bottom: 120px;
}
.our-team-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  gap: 72px;
}
.our-team-item {
  background-color: #ffffff;
  display: inline-block;
  text-align: center;

  border-radius: 0px 0px 4px 4px;
  box-shadow: 0px 2px 1px 0px #2e2f4214, 0px 1px 1px 0px #2e2f4229,
    0px 1px 6px 0px #2e2f4214;
}
.our-team-item:last-child,
.features-item:last-child {
  margin-bottom: 0;
}
.our-team-item-desc {
  padding: 32px 0;
}
.our-team-item-header {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2e2f42;
  margin-bottom: 8px;
}

.our-team-item .our-team-photo {
  width: 100%;
}
.our-team-header {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.11;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: capitalize;
  color: #2e2f42;
  margin-bottom: 72px;
}
.our-team-description {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.02em;
  text-align: center;
}
.social-links {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
  justify-content: center;
  align-self: flex-end;
  margin-top: 8px;
}
.social-links .social-media-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);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 40px 32px;
  background-color: #4d5ae5;
  color: #f4f4fd;
  font-family: sans-serif;
  letter-spacing: 0.02em;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.social-links .social-media-link:hover,
.social-links .social-media-link:focus {
  background-color: #404bbf;
}
.social-links .social-icon {
  fill: #f4f4fd;
}

.footer-desc {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.02em;
  max-width: 264px;
  text-align: left;
}
body .footer-desc {
  color: #f4f4fd;
}
.footer {
  background-color: #2e2f42;
  padding: 100px 0 100px;
}
.footer .container .logo-header {
  display: inline-block;
  margin-bottom: 16px;
  padding: 0;
}
.footer-soc-block-header {
  color: #fff;
  letter-spacing: 0.02em;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}
.footer-text-block {
  text-align: center;
  margin-right: 0;
}
.footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 72px;
}
.footer .social-links {
  gap: 16px;
}
.footer .social-links .social-media-link:hover,
.footer .social-links .social-media-link:focus {
  background-color: #31d0aa;
}
.social-media-link-block {
  margin-right: 0;
  text-align: center;
}
.modal-overlay {
  background: rgba(46, 47, 66, 0.4);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 250ms cubic-bezier(0.4, 0, 0.2, 1),
    scale 300ms cubic-bezier(0.4, 0, 0.2, 1);

  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  
}
.modal-overlay.is-open,
.mobile-top-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible; 
  
}
.modal-overlay.is-open .modal {
  scale: 01;
 


}
.modal {
  background-color: #fcfcfc;
  box-shadow: 0px 1px 1px 0px #00000024, 0px 1px 3px 0px #0000001f,
    0px 2px 1px 0px #00000033;
  border-radius: 4px;
  scale: 0.1;
  max-height: 95%;
  overflow-y: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 288px;
  padding: 72px 16px 24px;
  transform: translate(-50%, -50%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),
    scale 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
}
.subscribe-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.subscribe-input {
  padding-left: 16px;
  width: 288px;
  height: 40px;
  border: 1px solid #fff;
  border-radius: 4px;
  background-color: transparent;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
  font-size: 12px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.04em;
  color: #ffffff;
  transition: border 250ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: transparent;
}
.subscribe-button {
  padding: 8px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 165px;
  border: none;
  border-radius: 4px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.button-icon {
  fill: #fff;
  margin-left: 16px;
}
.button-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e7e9fc;
  border: 1px solid rgba(0, 0, 0, 0.1);
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  position: absolute;
  right: 24px;
  top: 24px;
  fill: #2e2f42;
  transition: border 250ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.form-header {
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: 16px;
  color: #2e2f42;
}
.form-label {
  color: #8e8f99;
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.17;
  letter-spacing: 0.04em;
}
.form-label-checkbox {
  color: #8e8f99;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.17;
  letter-spacing: 0.04em;
  display: flex;
  letter-spacing: 0.04em;
  align-items: center;
}
.form-checkbox-border {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 2px;
  flex-shrink: 0;
  margin-right: 8px;
  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);
}
.form-checkbox:checked + .form-label-checkbox .form-checkbox-border,
.button-close:hover,
.button-close:focus {
  border: none;
  background-color: #404bbf;
  fill: #f4f4fd;
}
.button-close:hover,
.button-close:focus {
  fill: #fff;
}

.form-label-checkbox .privacy {
  color: #4d5ae5;
  text-decoration: underline;
}


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

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




.form-input {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0.02em;
  width: 100%;
  background-color: transparent;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  padding: 8px 16px 8px 38px;
  height: 40px;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: transparent;
}
.form-input:focus,
.form-texarea:focus,
.subscribe-input:focus {
  border-color: #4d5ae5;
}
.subscribe-input::placeholder {
  color: #fff;
}
.form-input::placeholder,
.form-texarea::placeholder {
  font-size: 12px;
  font-weight: 400;
  line-height: 14px;
  letter-spacing: 0.04em;
}
.form-texarea {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: rgba(46, 47, 66, 0.4);
  width: 100%;
  height: 120px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  padding: 8px 16px;
  background-color: transparent;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  outline: transparent;
  resize: none;
}
.form-button {
  margin: 0 auto;
  padding: 16px 32px;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
}
.input-icon {
  fill: #2e2f42;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.form-input:focus + .input-icon {
  fill: #4d5ae5;
}
.form-field-wrap {
  position: relative;
}
.element-checkbox {
  position: relative;
  margin-bottom: 24px;
}
.element-input {
  margin-bottom: 8px;
}
.element-textarea {
  margin-bottom: 16px;
}

/*** tablet***/
@media screen and (min-width: 768px) {
  .container {
    max-width: 768px;
    padding: 0 16px;
  }

  .header-mobile-btn,
  .mobile-top-menu {
    display: none;
  }
  .contacts-us {
    display: block;
  }
  .top-menu {
    display: flex;
    gap: 40px;
  }
   .link {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    padding: 24px 0;
  } 

  .top-menu .top-menu-item .link:hover::after, 
  .active::after {
    content: "";
    height: 4px;
    width: 100%;
    background-color: #404bbf;
    border-radius: 2px;
    display: inline-block;
    position: absolute;
    left: 0;
    bottom: -1px;
  }

  .contacts-us-menu {
    margin: 16px 0;
    display: flex;
    gap: 12px;
    flex-direction: column;
  }

  .contacts-us .top-menu-item .link {
    font-size: 12px;
    font-weight: 400;
    line-height: 14px;
    letter-spacing: 0.04em;
    padding: 0;
  }
  .orders-section {
    background-image: linear-gradient(
        to bottom,
        rgba(46, 47, 66, 0.7),
        rgba(46, 47, 66, 0.7)
      ),
      url(../images/people-officex1.jpg);
    max-width: 768px;
    padding: 112px 0;
  }

  .orders-section-header {
    max-width: 496px;
    margin: 0 auto 36px;
  }

  .features-list {
    display: flex;
    row-gap: 72px;
    column-gap: 24px;
  }
  .features-item {
    margin-bottom: 0;
    width: calc((100% - 24px) / 2);
  }
  .features-item-header {
    text-align: left;
  }
  .our-team-list {
    column-gap: 24px;
    row-gap: 72px;
  }
  .our-portfolio-list {
    row-gap: 72px;
  }
  .our-portfolio-item {
    width: calc((100% - 24px) / 2);
  }
  .subscribe-form {
    gap: 24px;
    justify-content: flex-start;
    flex-direction: row;
  }
  .subscribe-input {
    width: 264px;
  }

  .footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    row-gap: 72px;
    column-gap: 24px;
    padding-left: 108px;
  }
  .modal {
    width: 408px;
    min-height: 584px;
    padding: 72px 24px 24px;
  }
  .footer-text-block,
  .footer-soc-block-header {
    text-align: left;
  }
}

/*** desktop ***/
@media screen and (min-width: 1158px) {
  .container {
    max-width: 1158px;
    padding: 0 15px;
  }
  .logo-header {
    padding: 24px 0;
  }

  .our-team-item:last-child {
    margin-bottom: auto;
  }
  .contacts-us-menu {
    gap: 40px;
    flex-direction: row;
    margin: 0;
  }

  .contacts-us .top-menu-item .link {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    padding: 24px 0;
  }
  .features,
  .our-team,
  .our-portfolio,
  .footer {
    padding: 120px 0;
  }
  .orders-section {
    background-image: linear-gradient(
        to bottom,
        rgba(46, 47, 66, 0.7),
        rgba(46, 47, 66, 0.7)
      ),
      url(../images/group-people-working-website-template.jpg);
    padding: 188px 0;
    max-width: 1440px;
  }

  .oorders-section-header {
    margin: 0 auto 48px;
    font-size: 56px;
  }

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

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

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

  .features-item-header {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
  }
  .features-item-description {
    font-weight: 400;
  }

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

  .our-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);
  }
  .our-portfolio-item:hover .overlay {
    transform: translateY(0);
  }
  .footer .container {
    gap: 0;
    align-items: baseline;
    flex-wrap: nowrap;
    justify-content: left;
    padding-left: 15px; not sure if I need it
  }
  .subscribe-form {
    gap: 24px;
    justify-content: flex-start;
    flex-direction: row;
  }
  .footer-text-block {
    margin-right: 120px;
    text-align: left;
  }
  .social-media-link-block {
    margin-right: 80px;
  }
}
