:root {
  --primary-color: #4d5ae5;
  --secondary-color: #2e2f42;
  --text-color: #434455;
  --background-color: #fff;
  --hover-color: #404bbf;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
/* #region Common */

body {
  font-family: 'Roboto', sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
}
a {
  color: currentColor;
  text-decoration: none;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}
ul,
ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
button {
  font-family: inherit;
  color: currentColor;
  cursor: pointer;
  border: none;
  background-color: transparent;
  font: inherit;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
.container {
  max-width: 1158px;
  padding: 0 15px;
  margin: 0 auto;
}
/* #endregion */

/* #region */
.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;
}
.section-title {
  font-size: 36px;
  line-height: 1.11;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2e2f42;
  text-transform: capitalize;
  margin-bottom: 72px;
}
.subtitle {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #2e2f42;
  margin-bottom: 8px;
}
.subtitle-text {
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
}
/* #endregion */

/* #region header */
.page-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;
}
.header-nav {
  display: flex;
  align-items: center;
}
.header-logo .logo-part {
  color: var(--secondary-color);
}
.header-logo {
  padding: 24px 0;
  margin-right: 76px;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-link {
  display: block;
  padding: 24px 0;
  font-weight: 500;
  position: relative;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--secondary-color);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link.current {
  color: var(--hover-color);
}
.nav-link::after {
  content: '';
  position: absolute;
  display: block;
  width: 100%;
  height: 4px;
  background-color: var(--hover-color);
  border-radius: 2px;
  left: 0px;
  bottom: -1px;
  opacity: 0;
}
.nav-link:hover::after,
.nav-link:focus::after,
.nav-link.current::after {
  opacity: 1;
}
.nav-link:hover,
.nav-link:focus {
  color: var(--hover-color);
}

.contacts {
  font-style: normal;
  margin-left: auto;
}
.contacts-list {
  display: flex;
  align-items: center;
  gap: 40px;
}
.contacts-link {
  display: blockq;
  padding: 24px 0;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--text-color);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.contacts-link:hover,
.contacts-link:focus {
  color: var(--hover-color);
}
/* #endregion */

/* #region Hero */
.hero {
  /* background-color: var(--secondary-color); */
  text-align: center;
  padding-top: 188px;
  padding-bottom: 188px;
  background-image: linear-gradient(
      rgba(46, 47, 66, 0.7),
      rgba(46, 47, 66, 0.7)
    ),
    url('../images/people-office.jpg');
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
/* .hero .container {
 
} */
.hero-title {
  font-size: 56px;
  line-height: 1.07;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--background-color);
  max-width: 496px;
  margin: 0 auto;
  margin-bottom: 48px;
}
.btn {
  display: block;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--primary-color);
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--background-color);
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  padding: 16px 32px;
  min-width: 169px;
  min-height: 56px;
  border-radius: 4px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:hover,
.btn:focus {
  background-color: var(--hover-color);
}

/* #endregion */

/* #region features */

.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;
}
.features {
  padding-top: 120px;
  padding-bottom: 120px;
}
.features-card {
  display: flex;
  max-width: 100%;
  height: 112px;
  background-color: #f4f4fd;
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  border: 1px solid #8e8f99;
}
.features-list {
  display: flex;
  gap: 24px;
}
.features-item {
  width: calc((100% - 24px * 3) / 4);
}
/* #endregion */

/* #region Team */
.team {
  background-color: #f4f4fd;
  padding-top: 120px;
  padding-bottom: 120px;
}

.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}
.team-item {
  background-color: var(--background-color);
  width: calc((100% - 24px * 3) / 4);
  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-card {
  padding: 32px 0;
  text-align: center;
}
.social-list {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.social-link {
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  fill: #f4f4fd;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.social-link:hover,
.social-link:focus {
  background-color: var(--hover-color);
}
.margin-bt {
  margin-bottom: 8px;
}
/* #endregion */

/* #region Portfolio */
.portfolio {
  padding-top: 120px;
  padding-bottom: 120px;
}
.portfolio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  row-gap: 48px;
}
.portfolio-item {
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
  width: calc((100% - 24px * 2) / 3);
}
.portfolio-card {
  border-bottom: 1px solid #e7e9fc;
  border-left: 1px solid #e7e9fc;
  border-right: 1px solid #e7e9fc;
  padding: 32px 16px;
}
.overlay-card {
  position: relative;
  overflow: hidden;
}
.overlay-text {
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #f4f4fd;
  background-color: var(--primary-color);
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  transform: translatey(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  padding: 40px 32px;
}
.portfolio-item:hover .overlay-text {
  transform: translatey(0);
}
.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);
}
/* #endregion */

/* #region footer */
.page-footer {
  background-color: var(--secondary-color);
  padding-top: 100px;
  padding-bottom: 100px;
}
.page-footer .container {
  display: flex;
  align-items: baseline;
}
.footer-logo-container {
  margin-right: 120px;
}
.footer-logo .logo-part {
  color: #f4f4fd;
}
.footer-logo {
  display: inline-block;
  margin-bottom: 16px;
}
.footer-text {
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #f4f4fd;
  width: 264px;
}
.social-footer-text {
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #fff;
  margin-bottom: 16px;
}
.footer-contacts .social-list {
  gap: 16px;
}
.social-link.footer-link:hover,
.social-link.footer-link:focus {
  background-color: #31d0aa;
}
.footer-subscribe {
  margin-left: auto;
}
.subscribe-form {
  display: flex;
  gap: 24px;
  align-items: center;
}
.subscribe-input {
  border: 1px solid #fff;
  border-radius: 4px;
  width: 264px;
  height: 40px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  outline: transparent;
  background-color: transparent;
  padding-left: 16px;
  color: #fff;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.subscribe-input::placeholder {
  color: #fff;
}
.subscribe-input:focus {
  border-color: #31d0aa;
}
.subscribe-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 165px;
  background-color: #4d5ae5;
  border-radius: 4px;
  padding: 8px 24px;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: #fff;
}
.subscribe-btn:hover,
.subscribe-btn:focus {
  background-color: #31d0aa;
}
.subscribe-icon {
  fill: #fff;
  margin-left: 16px;
}

/* #endregion */

/* #region backdrop */
.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%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 408px;
  min-height: 584px;
  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;
  padding: 72px 24px 24px;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-close {
  position: absolute;
  top: 24px;
  right: 24px;
  border-radius: 50%;
  background-color: #e7e9fc;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  fill: #2e2f42;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-close-icon {
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-close:hover,
.btn-close:focus {
  background-color: #404bbf;
  fill: #ffffff;
  border: none;
}
.modal-title {
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2e2f42;
  margin-bottom: 16px;
}
.modal-form-label {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
  margin-bottom: 4px;
  display: block;
}
.modal-form-box {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
}
.modal-form-box:nth-of-type(4) {
  margin-bottom: 16px;
}
.modal-form-container {
  position: relative;
}
.modal-form-input {
  width: 100%;
  height: 40px;
  padding-left: 38px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  outline: transparent;
  background-color: transparent;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-form-input:focus {
  border-color: var(--primary-color);
}
.modal-input-container {
  position: relative;
}
.modal-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  fill: #2e2f42;
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-form-input:focus + .modal-icon {
  fill: var(--primary-color);
}
.modal-form-message {
  width: 100%;
  height: 120px;
  color: rgba(46, 47, 66, 0.4);
  background-color: transparent;
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  padding: 8px 16px;
  outline: transparent;
  resize: none;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-form-message:focus {
  border-color: var(--primary-color);
}
.modal-form-message::placeholder {
  color: rgba(46, 47, 66, 0.4);
}
.modal-form-agreement {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}
.modal-form-agreement-checkbox {
  display: inline-flex;
  margin-right: 8px;
  width: 16px;
  height: 16px;

  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 2px;
  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);
}
input[type='checkbox']:checked
  + .modal-form-agreement-field
  > .modal-form-agreement-checkbox {
  border-color: transparent;
  background-color: #404bbf;
  fill: #f4f4fd;
  border: none;
}

.modal-form-agreement-field {
  font-weight: 400;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
}
.modal-form-agreement-link {
  line-height: 1.33;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: #4d5ae5;
}
/* #endregion */
