:root {
  --primary-color: #4d5ae5;
  --selected-color: #404bbf;
  --dark-background: #2e2f42;
  --light-text-color: #f4f4fd;
  --social-hover-color: #31d0aa;
  --modal-text-color: #8e8f99;
  --modal-border-color: rgba(46, 47, 66, 0.4);
}

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

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

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

a {
  text-decoration: none;
  color: inherit;
}

body {
  font-family: Roboto, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: #434455;
  letter-spacing: 0.02em;
  background: #fff;
  /* display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column; */
}

.section {
  width: 100vw;
  padding: 96px 0;
  /* max-width: 1440px; */
}

.container {
  width: 100%;
  padding: 0 16px;
  margin-left: auto;
  margin-right: auto;
  max-width: 1440px;
}

@media screen and (min-width: 768px) {
  .container {
    width: 768px;
  }

  .section {
  }
}

@media screen and (min-width: 1440px) {
  .container {
    width: 1440px;
    padding: 0 156px;
  }

  .section {
    padding: 120px 0;
  }
}

h1 {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  color: #fff;
}

@media screen and (min-width: 768px) {
  h1 {
    font-size: 56px;
  }
}

@media screen and (min-width: 1440px) {
  h1 {
  }
}

h2,
h3 {
  line-height: 1.2;
  color: var(--dark-background);
  letter-spacing: 0.02em;
}

h2 {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 72px;
}

h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

@media screen and (min-width: 1440px) {
  h3 {
    font-weight: 500;
    font-size: 20px;
  }
}

h4 {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.primary-button {
  border-radius: 4px;
  padding: 16px 30px;
  text-align: center;
  width: 169px;
  height: 56px;
  border: transparent;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background-color: var(--primary-color);
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #fff;
}

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

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

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

.logo-first-word {
  color: var(--primary-color);
}

/* HEADER */

.header-section {
  width: 100vw;
  max-width: 1440px;
}

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

.header-nav {
  display: flex;
  justify-content: space-between;
}
.header-nav .logo {
  margin-right: 50px;
  padding: 20px 12px;
}

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

@media screen and (max-width: 767px) {
  .header-nav-list {
    display: none;
  }
}

.header-nav-list-item {
  padding: 0 26px;
}

.header-nav-list-item a {
  position: relative;
  display: inline-block;
  padding: 20px 0;
}

.header-nav-list-item a::after,
.header-contact-list-item a::after {
  content: '';
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background-color: var(--selected-color);
  position: absolute;
  left: 0;
  bottom: 0;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.header-nav-list-item a:hover::after,
.header-contact-list-item a:hover::after {
  opacity: 1;
}

.header-nav-list-item a.active::after {
  opacity: 1;
}

.header-contact-list {
  display: none;
}

@media screen and (min-width: 768px) {
  .header-contact-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
  }
}

@media screen and (min-width: 1440px) {
  .header-contact-list {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
  }
}

.header-contact-list-item a {
  position: relative;
  display: inline-block;
  padding: 6px 0;
}

.header-contact-list-item a::after {
}

.header-nav li:hover,
.header-nav li:focus {
  color: var(--selected-color);
}

.header-contact-list li:hover,
.header-contact-list li:focus {
  color: var(--selected-color);
}

/* HERO */

.hero-section {
  background-color: var(--dark-background);
  background-image: linear-gradient(
      to bottom,
      rgba(46, 47, 66, 0.7),
      rgba(46, 47, 66, 0.7)
    ),
    url(/images/hero-bg.jpg);
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: cover;
  padding: 72px 0;
}

.hero-section .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 72px;
  padding: 0 52px;
}

@media screen and (min-width: 768px) {
  .hero-section {
    padding: 112px 0;
  }
  .container {
    gap: 40px;
  }
}

@media screen and (min-width: 1440px) {
  .hero-section {
    padding: 188px 0;
  }
}

.hero-heading {
  max-width: 500px;
}

/* BENEFITS */

.benefits-heading {
  display: none;
}

.benefits-list {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 72px;
}

@media screen and (min-width: 768px) {
  .benefits-list {
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 72px;
    column-gap: 24px;
  }
}

@media screen and (min-width: 1440px) {
  .benefits-list {
  }
}

.benefits-list-item {
  /* width: 100%; */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media screen and (min-width: 768px) {
  .benefits-list-item {
    flex-basis: calc((100% - 24px) / 2);
  }
}

@media screen and (min-width: 1440px) {
  .benefits-list-item {
    flex-basis: calc((100% - 72px) / 4);
  }
}

.benefits-card-icon-wrap {
  display: none;
}

@media screen and (min-width: 1440px) {
  .benefits-card-icon-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0;
    width: 100%;
    background-color: var(--light-text-color);
    margin-bottom: 8px;
    border: 1px solid var(--modal-text-color);
    border-radius: 4px;
  }
}

.benefits-icon {
  fill: var(--dark-background);
}

/* TEAM */

.team-section {
  background: var(--light-text-color);
}

@media screen and (min-width: 768px) and (max-width: 1439px) {
  .team-container {
    padding: 0 108px;
  }
}

.team-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 72px;
}

@media screen and (min-width: 768px) {
  .team-list {
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 24px;
    row-gap: 64px;
  }
}

@media screen and (min-width: 1440px) {
  .team-list {
    padding: 0;
  }
}

.team-list-item {
  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;
  width: 100%;
}

@media screen and (min-width: 768px) {
  .team-list-item {
    flex-basis: calc((100% - 24px) / 2);
  }
}

@media screen and (min-width: 1440px) {
  .team-list-item {
    flex-basis: calc((100% - 72px) / 4);
  }
}

.team-list-item:hover {
  box-shadow: 0 4px 3px 0 rgba(46, 47, 66, 0.08),
    0 3px 3px 0 rgba(46, 47, 66, 0.16), 0 3px 10px 0 rgba(46, 47, 66, 0.08);
}

.team-list-item img {
  width: 100%;
}

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

.team-card-text-wrap {
  text-align: center;
  margin-bottom: 8px;
}

.team-card-text-wrap h3 {
  margin-bottom: 8px;
}

.social-media-list {
  display: flex;
  flex-direction: row;
  /* gap: 24px; */
  justify-content: space-between;
  max-width: 232px;
  width: 100%;
}

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

.social-media-item:hover,
.social-media-item:focus {
  background-color: var(--social-hover-color);
}

.social-media-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

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

/* PORTFOLIO */

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

.portfolio-list-item {
  border: 1px solid #e7e9fc;
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media screen and (min-width: 768px) {
  .portfolio-list-item {
    flex-basis: calc((100% - 24px) / 2);
  }
}

@media screen and (min-width: 1440px) {
  .portfolio-list-item {
    flex-basis: calc((100% - 48px) / 3);
  }
}

.portfolio-list-item:hover {
  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-list-item:hover .portfolio-img-desc {
  transform: translateY(0);
}

.portfolio-img-wrap {
  position: relative;
  overflow: hidden;
}

.portfolio-img-wrap img {
  width: 100%;
}

.portfolio-img-desc {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(77, 90, 229, 0.8);
  color: var(--light-text-color);
  transform: translateY(100%);
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
  padding: 40px 32px;
}

.portfolio-card-text-wrap {
  padding: 32px 16px;
}

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

/* FOOTER */

.footer-section {
  background: var(--dark-background);
  color: var(--light-text-color);
  padding: 100px 0;
  width: 100%;
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 72px;
}

@media screen and (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 72px;
    column-gap: 24px;
    padding: 0 108px;
  }
}

@media screen and (min-width: 1440px) {
  .footer-container {
    justify-content: flex-start;
  }
}

.logo.logo-footer {
  color: var(--light-text-color);
  display: block;
  margin-bottom: 16px;
}

.footer-desc-wrap {
  /* margin-right: 120px; */
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.footer-text {
  max-width: 264px;
}

.footer-social-wrap {
  /* margin-right: 80px; */
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

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

.footer-wrap-heading {
  color: #fff;
  margin-bottom: 16px;
}

.subscribe-wrap {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

@media screen and (min-width: 768px) {
  .subscribe-wrap {
    align-items: flex-start;
  }
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

@media screen and (min-width: 768px) {
  .subscribe-form {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media screen and (min-width: 1440px) {
  .subscribe-form {
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 24px;
  }
}

.subscribe-input {
  width: 100%;
  border: 1px solid var(--light-text-color);
  border-radius: 4px;
  width: 264px;
  height: 40px;
  padding: 8px 16px;
  background-color: transparent;
}

.subscribe-button {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 24px;
  height: 40px;
}

.subscribe-icon {
  margin-left: 16px;
  fill: var(--light-text-color);
}

/* MODAL */

.backdrop {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(46, 47, 66, 0.4);
  z-index: 998;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-wrap {
  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);
  background: #fcfcfc;

  width: 95%;
  height: 95%;
  padding: 72px 24px 24px;
  position: relative;
}

@media screen and (min-width: 768px) {
  .modal-wrap {
    max-width: 410px;
    max-height: 80%;
    height: auto;
  }
}

.modal-close-button {
  border-radius: 100%;
  fill: #e7e9fc;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: absolute;
  top: 24px;
  right: 24px;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-close-button:hover,
.modal-close-button:focus {
  background-color: var(--selected-color);
}

.modal-close-button::before,
.modal-close-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
  width: 10px;
  height: 1px;
  background-color: var(--light-text-color);
  opacity: 0;
}

.modal-close-button:hover::before {
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 1;
}

.modal-close-button:hover::after {
  transform: translate(-50%, -50%) rotate(-45deg);
  opacity: 1;
}

.modal-heading {
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--dark-background);
  font-weight: 500;
  margin-bottom: 16px;
}

.modal-input-label {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.16667;
  letter-spacing: 0.04em;
  color: var(--modal-text-color);
  margin-bottom: 4px;
}
.modal-input-wrap {
  margin: 0;
  position: relative;
  width: 100%;
  margin-bottom: 8px;
}
.modal-input {
  width: 100%;
  border: 1px solid var(--modal-border-color);
  border-radius: 4px;
  height: 40px;
  padding: 8px 16px 8px 44px;
}

.modal-input:hover,
.modal-input:focus {
  border: 2px solid var(--primary-color);
  outline: none;
}

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

.modal-textarea {
  width: 100%;
  border: 1px solid var(--modal-border-color);
  border-radius: 4px;
  height: 40px;
  padding: 8px 16px;
  resize: none;
  height: 120px;
}

.modal-textarea:hover,
.modal-textarea:focus {
  border: 2px solid var(--primary-color);
  outline: none;
}

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

.modal-input-icon {
  position: absolute;
  top: 8px;
  left: 16px;
  fill: var(--dark-background);
}

.modal-terms-wrap {
}

.terms-checkbox-hidden {
  display: none;
}

.terms-checkbox-hidden:hover + .terms-checkbox-label,
.terms-checkbox-hidden:focus + .terms-checkbox-label {
  color: var(--selected-color);
  cursor: pointer;
}
.terms-checkbox-hidden:checked + .terms-checkbox-label .terms-checkbox-box {
  background-color: var(--selected-color);
}

.terms-checkbox-hidden:checked + .terms-checkbox-label .terms-checkbox-icon {
  opacity: 1;
}

.terms-checkbox-label {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.16667;
  letter-spacing: 0.04em;
  color: var(--modal-text-color);
  position: relative;
  padding-left: 22px;
}

.terms-checkbox-box {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid var(--modal-border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  transition: background-color 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.terms-checkbox-icon {
  fill: var(--light-text-color);
  opacity: 0;
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.terms-link {
  color: var(--primary-color);
}

.terms-link:hover,
.terms-link:focus {
  color: var(--selected-color);
  text-decoration: underline;
}

.form-submit-button {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

/* MOBILE-MENU */

.mob-menu-backdrop {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--light-text-color);
  z-index: 995;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms cubic-bezier(0.4, 0, 0.2, 1);
  padding: 72px 16px 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-y: scroll;
}
.mob-menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mob-menu-button {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 999;
  padding: 0;
  border: none;
  width: 24px;
  height: 24px;
}

.mob-menu-nav-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: auto;
}

.mob-menu-nav-link {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11111;
  letter-spacing: 0.02em;
  color: var(--dark-background);
  cursor: pointer;
}

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

.mob-menu-contact-list {
  margin-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mob-menu-contact-link {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #434455;
}

.mob-menu-contact-link:hover,
.mob-menu-contact-link:focus {
  color: var(--primary-color);
}

.mob-menu-social-media-list {
  justify-content: space-between;
  width: 100%;
  max-width: none;
}

@media screen and (min-width: 768px) {
  .mob-menu-button {
    display: none;
  }
}

.mob-menu-button span {
  width: 24px;
  height: 4px;
  background-color: var(--dark-background);
  display: block;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mob-menu-button::before {
  content: '';
  width: 24px;
  height: 4px;
  background-color: var(--dark-background);
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mob-menu-button::after {
  content: '';
  width: 24px;
  height: 4px;
  background-color: var(--dark-background);
  position: absolute;
  bottom: 0;
  left: 0;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.mob-menu-button.close span {
  opacity: 0;
}

.mob-menu-button.close::before {
  transform: translateY(10px) rotate(45deg);
}
.mob-menu-button.close::after {
  transform: translateY(-10px) rotate(-45deg);
}
