/* common */

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

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

a {
  text-decoration: none;
  font-style: normal;
}

input {
  outline: none;
}

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

img {
  display: block;
}

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

/* header */

.header {
  border-bottom: 1px solid #e7e9fc;
  box-shadow: 0 1px 6px 0 rgba(46, 47, 66, 0.08),
    0 1px 1px 0 rgba(46, 47, 66, 0.16), 0 2px 1px 0 rgba(46, 47, 66, 0.08);
}

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

.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: #4d5ae5;
}

.header-logo {
  padding: 16px 0;
}

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

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

.header-nav-list,
.header-contacts-list {
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
}

.header-nav-link {
  display: block;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #2e2f42;
  padding: 24px 0;

  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.header-nav-link.current,
.header-nav-link:hover,
.header-nav-link:focus,
.header-contacts-link:hover,
.header-contacts-link:focus,
.mob-menu-contacts-link.header-contacts-link.current {
  color: #404bbf;
}

.header-contacts-link {
  display: block;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #434455;

  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.header-menu-btn {
  display: block;
  background-color: transparent;
  border: none;
  padding: 16px 0;
}

.header-menu-ico {
  fill: #2f2f37;
}

/* hero section */

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

@media screen and (min-resolution: 2x) {
  .hero-section {
    background-image: linear-gradient(
        rgba(46, 47, 66, 0.7),
        rgba(46, 47, 66, 0.7)
      ),
      url(../images/hero-section/mob/hero-img@2x.jpg);
  }
}

.hero-title {
  font-size: 36px;
  line-height: 1.11;
  letter-spacing: 0.02em;
  text-align: center;
  color: #fff;
  max-width: 216px;
  margin: 0 auto 0 auto;
}

.btn {
  display: block;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #fff;
  background-color: #4d5ae5;
  border: none;
  border-radius: 4px;
  cursor: pointer;

  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-btn {
  height: 56px;
  min-width: 169px;
  margin: 72px auto 0 auto;

  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
}

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

/* benefits section */

.benefits-section {
  padding: 96px 0;
}

.benefits-list {
  display: flex;
  flex-direction: column;
  gap: 72px;
}

.benefits-item {
  width: 100%;
}

.benefits-tablet-br {
  display: none;
}

.benefits-item-icon-bg,
.benefits-item-icon {
  visibility: hidden;
  position: absolute;
}

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

.benefits-item-text {
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* team section */

.team-section {
  background-color: #f4f4fd;
  padding: 96px 0;
}

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

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

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

.team-item {
  background-color: #ffffff;
  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);
  width: 264px;
}

.team-item-title {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2e2f42;

  margin-bottom: 8px;
}

.team-item-text {
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;

  margin-bottom: 8px;
}

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

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

.socials-item-circle {
  display: flex;
  align-items: center;
  justify-content: center;

  background-color: #4d5ae5;
  border-radius: 50%;
  width: 100%;
  height: 100%;

  position: relative;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.socials-item-icon {
  position: absolute;
  fill: #f4f4fd;
}

/* portfolio section */

.portfolio-section {
  padding: 96px 0;
}

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

.portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

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

.porftolio-item {
  width: 100%;

  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-item-img-overlay {
  position: absolute;
  visibility: hidden;
}

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

.portfolio-item-text {
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* footer */

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

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

.footer-logo {
  display: block;
  text-align: center;
  margin-bottom: 16px;
}

.footer-slogan {
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #f4f4fd;
  width: 264px;
}

.logo-n-slogan {
  margin-bottom: 72px;
}

.footer-socials {
  margin-bottom: 72px;
  align-self: center;
}

.footer-socials-media,
.footer-subscribe {
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #fff;

  margin-bottom: 16px;
  text-align: center;
}

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

.footer-socials-item-circle:hover,
.footer-socials-item-circle:focus {
  background-color: #31d0aa;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.subscribe-label {
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #fff;
}

.subscribe-input {
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  background-color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  width: 288px;
  height: 40px;
  color: #fff;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);

  display: block;
  padding-left: 16px;
}

.subscribe-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.subscribe-btn {
  display: inherit;
  justify-content: center;
  align-items: center;
  gap: 16px;

  min-width: 165px;
  align-self: center;
  height: 40px;

  text-align: start;
  padding: 0 24px;
}

.subscribe-icon {
  fill: #fff;
}

/* modal form */

.modal-overlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;

  opacity: 0;
  visibility: hidden;

  background-color: rgba(46, 47, 66, 0.4);

  transition: visibility 250ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  border-radius: 4px;
  width: 288px;
  min-height: 623px;
  padding: 72px 16px 24px 16px;

  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);

  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-x-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 0;

  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;

  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  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);
}

.x-btn-icon {
  fill: #2e2f42;

  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-x-btn:hover .x-btn-icon,
.modal-x-btn:focus .x-btn-icon {
  fill: #fff;
}

.modal-form-title {
  text-align: center;

  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2e2f42;

  margin-bottom: 16px;
}

.modal-form {
  display: inherit;
  flex-direction: column;
}

.modal-form-label-div {
  margin-bottom: 8px;
}

.modal-form-label {
  display: block;
  margin-bottom: 4px;

  font-size: 12px;
  line-height: 1.67;
  letter-spacing: 0.04em;
  color: #8e8f99;
}

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

.modal-form-input,
.modal-form-textarea {
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  background-color: transparent;
  outline: transparent;

  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-form-input:focus-within,
.modal-form-textarea:focus-within {
  border-color: #4d5ae5;
}

.modal-form-input {
  width: 100%;
  height: 40px;

  padding-left: 34px;
}

.modal-form-icons {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);

  fill: #2e2f42;
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-form-textarea-div {
  margin-bottom: 16px;
}

.modal-form-textarea {
  padding: 8px 16px;
  resize: none;

  width: 100%;
  height: 120px;
  font-size: 12px;
  line-height: 1.67;
  letter-spacing: 0.04em;
}

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

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

.modal-form-label-conditions {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
}

.checkbox-n-conditions {
  margin-bottom: 24px;
}

.modal-form-custom-checkbox {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  fill: transparent;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 2px;

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

.modal-form-checkbox:checked
  + .modal-form-label-conditions
  .modal-form-custom-checkbox {
  background-color: #404bbf;
  border: none;
  fill: #f4f4fd;
}

.modal-form-conditions-link {
  text-decoration: underline;
  color: #4d5ae5;
  line-height: 1.33;
}

.modal-form-btn {
  align-self: center;
  min-width: 169px;
  height: 56px;

  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
}

/* mob menu */

.mob-menu {
  background-color: #fff;
}

.mob-menu-container {
  position: relative;
  padding-top: 72px;
  padding-bottom: 40px;

  display: flex;
  flex-direction: column;
  width: 100%;
}

.mob-menu-x-btn {
  border-color: #2e2f42;
  background-color: #fdfdff;
}

.mob-menu-nav {
  margin-bottom: auto;
}

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

.mob-menu-link {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11;
  padding: 0;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: static;
}

.mob-menu-contacts {
  margin-bottom: 48px;
}

.mob-menu-contacts-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 24px;
}

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

.is-open {
  opacity: 1;
  visibility: visible;
}

/* tablet */

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

  /* header */

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

  .header-nav {
    width: 496px;
    justify-content: space-between;
  }

  .header-nav-list,
  .header-contacts-list {
    visibility: visible;
    position: static;
  }

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

  .header-nav-link::after {
    position: absolute;
    left: 0;
    bottom: -1px;

    content: "";
    border-radius: 2px;
    width: 100%;
    height: 4px;
    background-color: transparent;
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .header-nav-link.current::after {
    background-color: #404bbf;
  }

  .header-nav-link:hover::after,
  .header-nav-link:focus::after {
    background-color: #404bbf;
  }

  .header-contacts-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .header-contacts-link {
    font-weight: 400;
    font-size: 12px;
    line-height: 1.16667;
    letter-spacing: 0.04em;
  }

  .header-menu-btn {
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
  }

  /* hero */

  .hero-section {
    padding: 112px 0;
    max-width: 768px;
    background-image: linear-gradient(
        rgba(46, 47, 66, 0.7),
        rgba(46, 47, 66, 0.7)
      ),
      url(../images/hero-section/tablet/hero-img.jpg);
  }

  @media screen and (min-resolution: 2x) {
    .hero-section {
      background-image: linear-gradient(
          rgba(46, 47, 66, 0.7),
          rgba(46, 47, 66, 0.7)
        ),
        url(../images/hero-section/tablet/hero-img@2x.jpg);
    }
  }

  .hero-title {
    max-width: 496px;
    font-size: 56px;
    line-height: 1.07;
  }

  .hero-btn {
    margin: 36px auto 0 auto;
  }

  /* benefits */

  .benefits-list {
    flex-direction: row;
    row-gap: 72px;
    column-gap: 24px;
    flex-wrap: wrap;
  }

  .benefits-item {
    width: calc((100% - 24px) / 2);
  }

  .benefits-tablet-br {
    display: inline;
  }

  .benefits-item-title {
    text-align: start;
  }

  /* team */

  .team-list {
    flex-direction: row;
    row-gap: 64px;
    column-gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .team-item {
    width: 264px;
  }

  /* portfolio */

  .portfolio-list {
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 72px;
    column-gap: 24px;
  }

  .porftolio-item {
    width: calc((100% - 24px) / 2);
  }

  /* footer */

  .footer-items {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0 108px;
  }

  .logo-n-slogan {
    margin: 0 24px 72px 0;
  }

  .footer-socials {
    margin: 0;
    align-self: normal;
  }

  .footer-socials-media,
  .footer-subscribe,
  .footer-logo {
    text-align: start;
  }

  .subscribe-form {
    flex-direction: row;
    gap: 24px;
  }

  .subscribe-input {
    width: 264px;
  }

  /* modal form */

  .modal {
    width: 408px;
    min-height: 584px;
    padding: 72px 24px 24px 24px;
  }

  .modal-form-input {
    padding-left: 38px;
  }

  /* mob menu */

  .mob-menu {
    display: none;
  }
}

/* desktop */

@media screen and (min-width: 1158px) {
  .container {
    max-width: 1158px;
    padding: 0 15px;
  }

  /* header */

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

  .header-nav {
    width: auto;
  }

  .header-contacts-list {
    flex-direction: row;
    align-items: center;
    gap: 40px;
  }

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

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

  /* hero */

  .hero-section {
    padding: 188px 0;
    max-width: 1440px;
    background-image: linear-gradient(
        rgba(46, 47, 66, 0.7),
        rgba(46, 47, 66, 0.7)
      ),
      url(../images/hero-section/hero-img.jpg);
  }

  @media screen and (min-resolution: 2x) {
    .hero-section {
      background-image: linear-gradient(
          rgba(46, 47, 66, 0.7),
          rgba(46, 47, 66, 0.7)
        ),
        url(../images/hero-section/hero-img@2x.jpg);
    }
  }

  .hero-btn {
    margin: 48px auto 0 auto;
  }

  /* benefits */

  .benefits-section {
    padding: 120px 0;
  }

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

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

  .benefits-tablet-br {
    display: none;
  }

  .benefits-item-icon-bg,
  .benefits-item-icon {
    visibility: visible;
  }

  .benefits-item-icon-bg {
    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #8e8f99;
    border-radius: 4px;

    height: 112px;
    background-color: #f4f4fd;

    margin-bottom: 8px;
    position: relative;
  }

  .benefits-item-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .benefits-item-title {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
  }

  .benefits-item-text {
    font-weight: 400;
  }

  /* team */

  .team-section {
    padding: 120px 0;
  }

  .team-list {
    display: flex;
    gap: 24px;
    flex-wrap: nowrap;
    justify-content: normal;
  }

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

  /* portfolio */

  .portfolio-section {
    padding: 120px 0;
  }

  .portfolio-list {
    row-gap: 48px;
  }

  .porftolio-item {
    width: calc((100% - 48px) / 3);
    box-shadow: none;

    transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .portfolio-item-img-n-overlay {
    position: relative;
    overflow: hidden;
  }

  .portfolio-item-img-overlay {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #f4f4fd;
    background-color: #4d5ae5;

    padding: 40px 32px;

    transform: translateY(100%);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);

    visibility: visible;
  }

  .portfolio-item-img-overlay-text {
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #f4f4fd;

    max-width: 296px;
    margin: 40px 32px 0 32px;
  }

  .porftolio-item:hover .portfolio-item-img-overlay {
    transform: translateY(0%);
  }

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

  /* footer */

  .page-footer {
    padding: 100px 0;
  }

  .footer-items {
    flex-wrap: nowrap;
    padding: auto;
  }

  .logo-n-slogan {
    margin: 0 120px 0 0;
  }

  .footer-socials {
    margin: 0 80px 0 0;
  }

  .subscribe-input {
    border-color: #fff;
  }
  .subscribe-input::placeholder {
    color: #fff;
  }
}
