:root {
  --main-color: #434455;
  --accent-color: #404bbf;
  --main-color-black: #2e2f42;
  --bg-color: #2e2f42;
  --white-color: #ffffff;
  --section-bg-color: #f4f4fd;
  --bg-button: #4d5ae5;
  --header-accent: #4d5ae5;
  --social-hover: #31d0aa;
  --modal-label-color: #8e8f99;
  --modal-checkbox-fill: #f4f4fd;

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

body {
  color: var(--main-color);
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  background-color: var(--white-color);
}

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

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

a {
  text-decoration: none;
}

button {
  padding: 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;
}

.list {
  list-style: none;
}

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

.container {
  max-width: 320px;
  padding-left: 16px;
  padding-right: 16px;
  margin-left: auto;
  margin-right: auto;

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

  @media screen and (min-width: 1158px) {
    max-width: 1158px;
    padding-left: 15px;
    padding-right: 15px;
  }
}

.hide {
  display: none;
}

.section {
  padding: 96px 0;

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

.icons {
  fill: #f4f4fd;
}

/* #region Socials */
.social-list {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #4d5ae5;
  border-radius: 50%;

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

.social-link:hover,
.social-link:focus {
  background-color: var(--accent-color);
}

/* #endregion */

/* #region HEADER */
.header {
  padding: 16px 0;
  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);

  @media screen and (min-width: 1158px) {
    padding: 24px 0;
  }
}

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

.header__logo-accent {
  color: var(--main-color-black);
}

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

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

.header__menu {
  display: none;

  @media screen and (min-width: 768px) {
    display: flex;
    align-items: center;
    gap: 40px;
  }
}

.menu-button {
  margin-left: auto;
  background-color: transparent;
  border: none;

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

.header__menu-link {
  position: relative;
  padding: 24px 0;

  color: var(--main-color-black);
  font-weight: 500;

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

.active {
  color: #404bbf;
}

.active::after {
  content: "";
  display: block;
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 4px;

  background-color: var(--accent-color);
  border-radius: 2px;
}

.header__menu-link:hover,
.header__menu-link:focus {
  color: var(--accent-color);
}

.header__contacts {
  display: none;
  margin-left: auto;

  @media screen and (min-width: 768px) {
    display: block;
  }
}

.header__contacts-list {
  display: flex;

  @media screen and (min-width: 768px) {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  @media screen and (min-width: 1158px) {
    flex-direction: row;
    gap: 40px;
  }
}

.header__contacts-link {
  padding: 24px 0;
  color: var(--main-color);

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

.header__contacts-link:hover,
.header__contacts-link:focus {
  color: var(--accent-color);
}

address {
  font-style: normal;
}

/* #endregion */

/* #region HERO */
.hero {
  max-width: 1440px;
  margin: 0 auto;
  padding: 72px 0;
  /* padding: 188px 0; */
  background-color: var(--bg-color);
  text-align: center;
  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-size: cover;
  background-position: center;

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

  @media screen and (min-width: 768px) {
    padding: 112px 0;
  }

  @media screen and (min-width: 1158px) {
    padding: 188px 0;
  }
}

.hero__title {
  max-width: 216px;
  margin: 0 auto;
  margin-bottom: 48px;
  color: var(--white-color);
  font-size: 36px;
  line-height: 1.11;
  text-align: center;
  letter-spacing: 0.02em;

  @media screen and (min-width: 768px) {
    max-width: 496px;
    font-size: 56px;
    line-height: 1.07;
  }
}

.hero__button {
  display: block;
  min-width: 169px;
  padding: 16px 32px;
  margin: 0 auto;

  color: var(--white-color);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  background-color: var(--bg-button);
  border: none;
  border-radius: 4px;
  cursor: pointer;

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

.hero__button:hover,
.hero__button:focus {
  background-color: var(--accent-color);
}

/* #endregion */

/* #region Features */
.features__title {
  color: var(--main-color-black);
  font-size: 36px;
  line-height: 1.11;
  text-transform: capitalize;
  text-align: center;
}

.features__list {
  display: grid;

  grid-template-columns: auto;
  row-gap: 72px;

  @media screen and (min-width: 768px) {
    grid-template-columns: repeat(2, 356px);
    column-gap: 24px;
  }

  @media screen and (min-width: 1158px) {
    grid-template-columns: repeat(4, 264px);
    row-gap: 24px;
  }
}

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

  @media screen and (min-width: 1158px) {
    display: flex;
  }
}

.features__subtitle {
  margin-bottom: 8px;
  color: var(--main-color-black);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11;

  @media screen and (min-width: 1158px) {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 500;
  }
}

.features__text {
  font-weight: 500;

  @media screen and (min-width: 1158px) {
    font-weight: 400;
  }
}

/* #endregion */

/* #region OUR TEAM */
.team {
  background-color: var(--section-bg-color);
}

.team__title {
  margin-bottom: 72px;

  color: var(--main-color-black);
  font-size: 36px;
  line-height: 1.11;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  text-align: center;
}

.team__list {
  display: grid;
  grid-template-columns: auto;
  row-gap: 72px;
  justify-content: center;

  @media screen and (min-width: 768px) {
    grid-template-columns: repeat(2, 264px);
    column-gap: 24px;
    row-gap: 64px;
  }

  @media screen and (min-width: 1158px) {
    grid-template-columns: repeat(4, 264px);
    row-gap: 24px;
  }
}

.team__item {
  background-color: var(--white-color);
  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);
}

.team__item-body {
  padding: 32px 0;
}

.team__name {
  margin-bottom: 8px;
  text-align: center;
  color: var(--main-color-black);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.team__position {
  margin-bottom: 8px;
  text-align: center;
}

/* #endregion */

/* #region PORTFOLIO */
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;

  border-radius: 50%;
  background-color: #4d5ae5;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio__title {
  margin-bottom: 72px;

  color: var(--main-color-black);
  font-size: 36px;
  line-height: 1.11;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  text-align: center;
}

.portfolio__list {
  display: grid;
  grid-template-columns: auto;
  row-gap: 48px;

  @media screen and (min-width: 768px) {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 64px;
  }

  @media screen and (min-width: 1158px) {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 48px;
  }
}

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

.portfolio__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__item-details {
  padding: 32px 16px;
  border-bottom: 1px solid #e7e9fc;
  border-left: 1px solid #e7e9fc;
  border-right: 1px solid #e7e9fc;
}

.portfolio__name {
  margin-bottom: 8px;

  color: var(--main-color-black);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.portfolio__image-wrapper {
  position: relative;
  overflow: hidden;
}

.portfolio__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;

  padding: 40px 32px;
  background-color: #4d5ae5;
  color: #f4f4fd;

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

.portfolio__item:hover .portfolio__overlay {
  transform: translateY(0);
}

/* #endregion */

/* #region FOOTER */
.footer-container {
  display: flex;
  align-items: baseline;
  flex-direction: column;
  gap: 80px;

  @media screen and (min-width: 1158px) {
    flex-direction: row;
  }
}

.footer {
  padding: 96px 0;
  background-color: var(--bg-color);

  @media screen and (min-width: 768px) {
    padding: 100px 0;
  }
}

.footer-info-wrapper {
  display: flex;
  flex-direction: column;
  gap: 72px;

  @media screen and (min-width: 768px) {
    flex-direction: row;
    gap: 24px;
  }

  @media screen and (min-width: 1158px) {
    gap: 120px;
  }
}

.footer__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;

  @media screen and (min-width: 768px) {
    display: inline-block;
  }

  @media screen and (min-width: 1158px) {
    gap: 120px;
  }
}

.footer__logo-accent {
  color: #f4f4fd;
}

.footer__text {
  max-width: 264px;
  color: #f4f4fd;
}

.footer__info {
  width: 288px;

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

.footer__social-title {
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--white-color);
  text-align: center;

  @media screen and (min-width: 768px) {
    text-align: start;
  }
}

.footer .social-link:hover,
.footer .social-link:focus {
  background-color: var(--social-hover);
}

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

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

  @media screen and (min-width: 768px) {
    text-align: start;
  }
}

.form-subscribe {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 24px;

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

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

.subscribe-form-input::placeholder {
  color: #ffffff;
}

.subscribe-form-input:focus {
  border: 1px solid #31d0aa;
}

.subscribe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 165px;
  height: 40px;
  border-radius: 4px;
  background-color: #4d5ae5;
  cursor: pointer;
  border: none;

  font-family: "Roboto", sans-serif;
  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);
}

.subscribe-close-icon {
  margin-left: 16px;
}

.subscribe-btn:hover {
  background-color: var(--social-hover);
}

/* #endregion */

/* #region MODAL */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background-color: rgba(46, 47, 66, 0.4);
  transition:
    opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);

  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

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

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 288px;
  min-height: 584px;
  padding: 72px 24px 24px 24px;
  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-color: #fcfcfc;
  z-index: 999;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);

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

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

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

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

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

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

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

.label-name {
  margin-bottom: 4px;
  display: block;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: var(--modal-label-color);
}

.input-wrapper {
  position: relative;
}

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

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

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

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

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

.form-textarea {
  width: 100%;
  height: 120px;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: rgba(46, 47, 66, 0.4);
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  background-color: transparent;
  padding: 8px 16px;
  outline: transparent;
  resize: none;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.form-textarea:focus {
  border-color: #4d5ae5;
}

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

.checkbox-label {
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: var(--modal-label-color);
}

.custom-checkbox {
  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);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  fill: transparent;
  margin-right: 8px;
}

.checkbox-text {
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: var(--modal-label-color);
}

.checkbox-input:checked + .checkbox-label .custom-checkbox {
  background-color: #404bbf;
  border: none;
  fill: var(--modal-checkbox-fill);
}

.policy-link {
  text-decoration: underline;
  color: var(--bg-button);
}

.form-submit-btn {
  display: block;
  min-width: 169px;
  height: 56px;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ffffff;
  cursor: pointer;
  background-color: #4d5ae5;
  border: none;
  border-radius: 4px;
  margin: 0 auto;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* #endregion */

.menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--white-color);
  z-index: 2;
  display: none;
}

.menu.is-open {
  display: flex;
}

.menu-wrapper {
  display: flex;
  flex-direction: column;
  padding: 72px 24px 40px 16px;
}

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

.menu-link {
  padding: 24px 0;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11;
  color: #2e2f42;
}

.active-link {
  color: #404bbf;
}

.menu-contacts {
  margin-top: auto;
}

.menu__contacts-address {
  margin-bottom: 48px;
}

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

.menu__contacts-link {
  color: var(--main-color);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
}

.menu__contacts-item:first-child .menu__contacts-link {
  color: var(--accent-color);
}
