html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background: #fff;
  color: #2e2f42;
  margin: 0;
}

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

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

a {
  text-decoration: none;
}

button {
  font-family: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: 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;
}

.container {
  width: 100%;
  max-width: 320px;
  margin-inline: auto;
  padding-inline: 16px;
}

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

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

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

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

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

.logo {
  color: #2e2f42;
  padding-block: 16px;
}

.logo-span {
  color: #4d5ae5;
}

.menu-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  border: none;
  background-color: transparent;
  color: #2e2f42;
}

.menu-burger svg {
  fill: currentColor;
}

.navigation,
.contacts {
  display: none;
}

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

.navigation-list {
  display: flex;
  align-items: center;
}

.navigation-section {
  display: block;
  padding-block: 24px;
  color: #2e2f42;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.navigation-section.current {
  color: #4d5ae5;
  position: relative;
}

.navigation-section.current::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #404bbf;
}

.navigation-section:hover,
.navigation-section:focus,
.mail:hover,
.mail:focus,
.number:hover,
.number:focus {
  color: #404bbf;
}

.contacts {
  font-style: normal;
}

.contact-list {
  display: flex;
}

.mail,
.number {
  color: #434455;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

  .menu-burger {
    display: none;
  }

  .navigation {
    display: flex;
    align-items: center;
    margin-left: 120px;
  }

  .navigation-list {
    gap: 24px;
  }

  .contacts {
    display: block;
    margin-left: auto;
  }

  .contact-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .mail,
  .number {
    font-size: 12px;
    line-height: 1.16667;
    letter-spacing: 0.04em;
    padding-block: 0;
  }
}

@media screen and (min-width: 1158px) {
  .navigation {
    margin-inline: 0;
    margin-left: 76px;
  }

  .navigation-list {
    gap: 24px;
  }

  .contacts {
    margin-left: auto;
  }

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

  .mail,
  .number {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    padding-block: 24px;
  }
}

/* hero */

.hero {
  background-color: #2e2f42;
  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;
  max-width: 320px;
  margin: 0 auto;
  padding-block: 72px;
}

@media (min-resolution: 192dpi), (min-device-pixel-ratio: 2) {
  .hero {
    background-image:
      linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
      url('../images/people-office@2x.jpg');
  }
}

.hero-container {
  display: flex;
  justify-content: center;
}

.hero-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-title {
  max-width: 216px;
  margin-bottom: 72px;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11111;
  letter-spacing: 0.02em;
  text-align: center;
  color: #fff;
}

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

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

@media screen and (min-width: 768px) {
  .hero {
    max-width: 768px;
    padding-block: 112px;
  }

  .main-title {
    max-width: 496px;
    margin-bottom: 36px;
    font-size: 56px;
    line-height: 1.07143;
  }
}

@media screen and (min-width: 1158px) {
  .hero {
    max-width: 1440px;
    padding-block: 188px;
  }

  .main-title {
    margin-bottom: 48px;
  }
}

/* features */

.features {
  padding-block: 96px;
}

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

.features-item {
  width: 100%;
}

.feature-icon {
  display: none;
}

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

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

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

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

  .feature-name {
    text-align: left;
  }
}

@media screen and (min-width: 1158px) {
  .features {
    padding-block: 120px;
  }

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

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

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

  .feature-name {
    font-weight: 500;
    font-size: 20px;
    line-height: 1.2;
  }

  .feature-description {
    font-weight: 400;
  }
}

/* team */

.team {
  background: #f4f4fd;
  padding-block: 96px;
}

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

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

.team-member {
  width: 264px;
  border-radius: 0 0 4px 4px;
  background: #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-info {
  padding: 32px 16px;
}

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

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

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

.social-list-link {
  width: 40px;
  height: 40px;
}

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

@media screen and (min-width: 1158px) {
  .team {
    padding-block: 120px;
  }

  .team-list {
    flex-wrap: nowrap;
  }
}

/* portfolio */

.portfolio-container {
  padding-block: 96px;
}

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

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

.portfolio-item {
  background: #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);
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

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

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

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

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

@media screen and (min-width: 1158px) {
  .portfolio-container {
    padding-block: 120px;
  }

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

  .portfolio-item {
    width: calc((100% - 48px) / 3);
  }
}

@media screen and (min-width: 1158px) {
  .portfolio-item {
    box-shadow: none;
  }

  .portfolio-item:hover,
  .portfolio-item:focus-within {
    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 */

.footer {
  background: #2e2f42;
  padding-block: 96px;
}

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

.footer-decor,
.social-box,
.subscribe-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-footer {
  color: #f4f4fd;
}

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

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

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

.footer-social-link {
  width: 40px;
  height: 40px;
}

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

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

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

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

.subscribe-input:focus {
  outline: none;
  border-color: #31d0aa;
}

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

.subscribe-button:hover,
.subscribe-button:focus {
  background-color: #31d0aa;
}

.icon-send {
  fill: #fff;
}

@media screen and (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    column-gap: 24px;
    row-gap: 72px;
    padding-inline: 92px;
  }

  .footer-decor,
  .social-box,
  .subscribe-box {
    align-items: flex-start;
  }

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

  .subscribe-input {
    width: 264px;
  }

  .subscribe-button {
    margin-inline: 0;
  }
}

@media screen and (min-width: 1158px) {
  .footer {
    padding-block: 100px;
  }

  .footer-container {
    flex-wrap: nowrap;
    column-gap: 0;
    padding-inline: 0;
  }

  .footer-decor {
    margin-right: 120px;
  }

  .social-box {
    margin-right: 80px;
  }

  .subscribe-box {
    margin-left: auto;
  }
}

/* modal */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(46, 47, 66, 0.4);
  opacity: 0;
  visibility: hidden;
  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 {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - 32px);
  max-width: 288px;
  min-height: 623px;
  padding: 72px 16px 24px;
  border-radius: 4px;
  background: #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);
  transform: translate(-50%, -50%);
}

.modal-close {
  background-color: #e7e9fc;
  color: #2e2f42;
}

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

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

.form-field {
  margin-bottom: 8px;
}

.form-field label,
.policy-label {
  font-size: 12px;
  line-height: 1.16667;
  letter-spacing: 0.04em;
  color: #8e8f99;
}

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

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

.input-wrapper {
  position: relative;
}

.input-wrapper input,
textarea {
  width: 100%;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  outline: none;
  background-color: transparent;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper input {
  height: 40px;
  padding-left: 38px;
}

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

.input-wrapper input:focus,
textarea:focus {
  border-color: #4d5ae5;
}

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

textarea {
  height: 120px;
  padding: 8px 16px;
  resize: none;
  font-size: 12px;
  line-height: 1.16667;
  letter-spacing: 0.04em;
  color: rgba(46, 47, 66, 0.4);
}

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

.policy-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.policy-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}

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

.policy-icon svg {
  fill: transparent;
}

.policy-checkbox:checked + .policy-icon {
  background-color: #404bbf;
  border: none;
  fill: #f4f4fd;
}

.policy-checkbox:checked + .policy-icon svg {
  fill: #f4f4fd;
}

.privacy {
  margin-left: 4px;
  line-height: 1.33333;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: #4d5ae5;
}

.modal-submit {
  display: block;
  min-width: 169px;
  height: 56px;
  margin: 0 auto;
  border: none;
  border-radius: 4px;
  background-color: #4d5ae5;
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  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-submit:hover,
.modal-submit:focus {
  background-color: #404bbf;
}

@media screen and (min-width: 768px) {
  .modal {
    max-width: 408px;
    width: 408px;
    min-height: 584px;
    padding: 72px 24px 24px;
  }
}

/* mobile menu */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.mobile-menu-container {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 72px 24px 40px 16px;
}

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

.mobile-menu-close {
  background-color: transparent;
  color: #2e2f42;
}

.mobile-menu-close:hover,
.mobile-menu-close:focus,
.modal-close:hover,
.modal-close:focus {
  background-color: #404bbf;
  color: #fff;
}

.mobile-menu-close-icon,
.modal-close-svg {
  fill: currentColor;
}

.mobile-navigation {
  margin-bottom: auto;
}

.mobile-navigation-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.mobile-navigation-link {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11111;
  letter-spacing: 0.02em;
  color: #2e2f42;
}

.mobile-navigation-link.current,
.mobile-navigation-link:hover,
.mobile-navigation-link:focus {
  color: #404bbf;
}

.mobile-menu-bottom {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.mobile-contacts {
  font-style: normal;
}

.mobile-contact-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mobile-number,
.mobile-mail {
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.mobile-number {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #4d5ae5;
}

.mobile-mail {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #434455;
}

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

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

.mobile-social-link {
  width: 40px;
  height: 40px;
}

.mobile-social-link .icon,
.social-list-link .icon,
.footer-social-link .icon {
  fill: currentColor;
}

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

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