:root {
  --main-font: 'Roboto', sans-serif;
  --secondary-font: 'Raleway', sans-serif;
  --primary-bg: #fff;
  --text-opposite: var(--primary-bg);
  --secondary-bg: var(--headers-color);
  --footer-text: var(--team-bg);
  --team-bg: #f4f4fd;
  --primary-text: #434455;
  --headers-color: #2e2f42;
  --logo-color: #4d5ae5;
  --button-color: var(--logo-color);
  --hover-focus: #404bbf;
  --border-color: #e7e9fc;
}

/* base reset */
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

a {
  text-decoration: none;
}

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

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

/* common */
.container {
  max-width: 1158px;
  padding: 0 15px;
  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;
}

.section {
  padding: 120px 0;
  margin: 0 auto;
}

.section-title {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--headers-color);
  text-transform: capitalize;
  text-align: center;
  margin: 0 auto 72px;
}

.social-icon {
  fill: var(--team-bg);
}

/* header */
.site-header {
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 6px 0 #2e2f4214, 0 1px 1px 0 #2e2f4229, 0 2px 1px 0 #2e2f4214;
}

/* Логотип */
.logo.header-logo,
.logo.footer-logo {
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--logo-color);
  font-family: var(--secondary-font);
  margin-right: 76px;
}

.header-logo .logo-part {
  color: var(--headers-color);
}

/* Навігація */
.container.nav-container,
.site-header-navigation,
.navigation-list,
.contacts-list,
.feature-list,
.our-team-list,
.our-portfolio-list {
  display: flex;
  align-items: center;
}

.nav-container,
.site-header-navigation {
  margin-right: auto;
}

.navigation-list,
.contacts-list {
  gap: 40px;
}

.navigation-link,
.contacts-link,
.header-logo {
  padding: 24px 0;
}

.navigation-link {
  display: block;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--headers-color);
  position: relative;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.navigation-link::after {
  position: absolute;
  content: '';
  width: 100%;
  height: 4px;
  left: 0;
  bottom: -1px;
  background-color: var(--hover-focus);
  border-radius: 2px;
  opacity: 0;
}

.contacts {
  font-style: normal;
}

.contacts-link {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--primary-text);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.navigation-link.current {
  color: var(--hover-focus);
}

.navigation-link:hover,
.navigation-link:focus,
.contacts-link:hover,
.contacts-link:focus,
.navigation-link.current::after,
.navigation-link:hover::after,
.navigation-link:focus::after {
  color: var(--hover-focus);
  opacity: 1;
}

.section.hero-image,
.page-footer {
  background-color: var(--secondary-bg);
}

/* Спеціалізація */
.section.hero-image {
  padding: 188px 0;
  background-image: linear-gradient(to bottom, #2e2f42b3, #2e2f42b3),
    url(../images/people-office-background.jpg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  max-width: 1440px;
}

.section-title.hero-image-title {
  font-size: 56px;
  color: var(--text-opposite);
  text-transform: none;
  margin-bottom: 48px;
  max-width: 496px;
}

.primary-btn {
  font-family: var(--main-font);
  background-color: var(--button-color);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--text-opposite);
  cursor: pointer;
  text-align: center;
  display: block;
  padding: 16px 32px;
  border: none;
  min-width: 169px;
  height: 56px;
  margin: 0 auto;
  border-radius: 4px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn.hero-image:hover {
  background-color: var(--hover-focus);
}

/* Features Studio */
.feature-list,
.our-team-list {
  gap: 24px;
}

.feature-title {
  color: var(--headers-color);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.feature-item {
  text-align: left;
  width: calc((100% - 72px) / 4);
}

.feature-icon-box {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
  width: 264px;
  height: 112px;
  background-color: var(--team-bg);
  margin-bottom: 8px;
  border: 1px solid #8e8f99;
}

/* Команда / Портфоліо */
.our-team {
  background-color: var(--team-bg);
}

.person-card-content {
  margin-bottom: 8px;
}

.person-card {
  padding-top: 32px;
  padding-bottom: 32px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.project-card {
  border-bottom: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  padding: 32px 16px;
}

.our-team-item {
  background-color: var(--primary-bg);
  width: calc((100% - 72px) / 4);
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 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-social-list {
  display: flex;
  gap: 24px;
  padding: 0 16px;
  justify-content: center;
}

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

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

/* Портфоліо */
.person-card-title,
.project-card-title {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--headers-color);
  margin-bottom: 8px;
}

.project-card {
  text-align: left;
}

.our-portfolio-list {
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 48px;
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.our-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);
}
.overlay {
  position: relative;
  overflow: hidden;
}

.overlay-text {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: var(--logo-color);
  display: flex;
  justify-content: center;
  align-items: baseline;
  transform: translateY(100%);
  color: var(--team-bg);
  padding: 40px 32px;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.our-portfolio-item:hover .overlay-text {
  transform: translateY(0);
}

/* Футер */
.footer-logo {
  display: inline-block;
  margin-bottom: 16px;
}

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

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

.logo-part,
.page-footer-text {
  color: var(--footer-text);
}

.footer-logo-wrapper {
  display: flex;
  flex-direction: column;
  margin-right: 120px;
}

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

.footer-social-box {
  max-width: 208px;
  margin-right: 80px;
}
.footer-social-item {
  width: calc((100% - 3 * 16px) / 4);
}

/* Subscribe form */
.footer-subscribe-box {
  max-width: 453px;
  display: flex;
  flex-direction: column;
  margin-left: auto;
}
.footer-social-title {
  margin-bottom: 16px;
  color: var(--primary-bg);
  font-weight: 500;
}

.footer-form-input {
  border: 1px solid var(--primary-bg);
  border-radius: 4px;
  width: 264px;
  height: 40px;
  color: var(--primary-bg);
  background-color: transparent;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  padding-left: 16px;
  padding-top: auto;
  padding-bottom: auto;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  outline: none;
  margin-right: 24px;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-form-input:focus {
  border-color: #31d0aa;
}

.footer-form-input::placeholder {
  font-weight: 400;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  color: var(--primary-bg);
}

.footer-btn {
  border-radius: 4px;
  padding: 8px 24px;
  min-width: 165px;
  height: 40px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--primary-bg);
  background: var(--logo-color);
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.subscribe-icon {
  fill: var(--primary-bg);
  margin-left: 16px;
}

.footer-subscribe-button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  border-radius: 4px;
  padding: 8px 24px;
  width: 165px;
  height: 40px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--primary-bg);
}
.footer-form {
  border: 1px solid #212121;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.footer-social-list {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: row;
  gap: 16px;
}

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

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

/* modal_window */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: 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: 408px;
  min-height: 584px;
  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;
  border-radius: 4px;
  transform: translate(-50%, -50%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  padding: 72px 24px 24px;
}

.backdrop:not(.is-open) .modal {
  transform: translate(-50%, -50%);
}

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

.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

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

.popup-close-btn:hover .icon-close,
.popup-close-btn:focus .icon-close {
  fill: #fff;
}

.popup-close-btn:hover,
.popup-close-btn:focus {
  background-color: var(--hover-focus);
  border: none;
}

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

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

.modal-form-box.text-input {
  margin-bottom: 16px;
}

.modal-input-wrapper {
  position: relative;
}

.modal-label {
  display: block;
  margin-bottom: 4px;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
  width: 100%;
}

.link-privacy {
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: var(--logo-color);
}

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

.modal-form-input {
  border: 1px solid #2e2f4266;
  border-radius: 4px;
  width: 100%;
  height: 40px;
  background-color: transparent;
  padding-left: 38px;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  outline: transparent;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-form-input:focus {
  border-color: var(--logo-color);
}

.modal-icon {
  fill: var(--headers-color);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-form-input:focus + .modal-icon {
  fill: var(--logo-color);
}

.link-privacy:hover {
  color: var(--logo-color);
}

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

.modal-text-input:focus {
  border-color: var(--logo-color);
}

.form-checkbox-wrapper {
  position: relative;
}

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

.label-privacy {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
  gap: 8px;
}

.form-checkbox-input:checked + .label-privacy .form-checkmark {
  fill: var(--team-bg);
  background-color: #404bbf;
  border: none;
}

.modal-icon-checkbox {
  fill: var(--primary-bg);
}

.primary-btn.send-btn:hover,
.primary-btn.send-btn:focus {
  background-color: var(--hover-focus);
  border: none;
}

.primary-btn.send-btn {
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
