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

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

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

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

a {
  text-decoration: none;
}

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

.container {
  max-width: 1158px;
  padding: 0 15px;
  margin: 0 auto;
}

/*----------------Header----------------*/

.header {
  background-color: #ffffff;
  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-navigation {
  display: flex;
  align-items: center;
}

.header-logo {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #2e2f42;
  padding: 24px 0;
  margin-right: 76px;
}

.header-logo-accent {
  color: #4d5ae5;
}

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

.header-menu-item {
}

.header-menu-link {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #2e2f42;
  display: block;
  padding: 24px 0;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.header-menu-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background-color: #404bbf;
  opacity: 0;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.header-menu-link:hover::after,
.header-menu-link:focus::after,
.header-menu-link.current::after {
  opacity: 1;
}

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

.header-menu-link:active {
  text-decoration: underline;
}

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

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

.header-contacts-item {
}

.header-contacts-link {
  font-size: 16px;
  font-style: normal;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
  display: block;
  padding: 24px 0;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/*----------------Section hero----------------*/

.hero {
  background: #2e2f42;
  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: 0 auto;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 188px 0;
}

.hero-title {
  font-weight: 700;
  font-size: 56px;
  line-height: 1.07;
  letter-spacing: 0.02em;
  text-align: center;
  color: #fff;
  margin: 0 auto 48px;
  max-width: 496px;
}

.hero-btn {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #fff;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background-color: #4d5ae5;
  cursor: pointer;
  display: block;
  /*align-items: center;
  justify-content: center;*/
  border-radius: 4px;
  padding: 16px 32px;
  margin: 0 auto;
  border: none;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  /*outline:none;*/
}

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

/*----------------Section features----------------*/

.features {
  background-color: #ffffff;
  padding: 120px 0;
}

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

.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-list {
  display: flex;
  gap: 24px;
  padding: 0;
  margin: 0;
}

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

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

.feature-icon {
}

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

.features-list-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
}

/*----------------Section team----------------*/

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

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

.team-list {
  display: flex;
  gap: 24px;
  padding: 0;
  margin: 0;
}

.team-list-item {
  background-color: #ffffff;
  width: calc((100% - 72px) / 4);
  border-radius: 0 0 4px 4px;
  overflow: hidden;
  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-list-image {
}

.team-card-content {
  padding: 32px 16px;
}

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

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

.team-social-list {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 8px;
  padding: 0;
}

.team-social-item {
  width: 40px;
  height: 40px;
}

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

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

.team-social-icon {
  fill: #f4f4fd;
}
/*----------------Section portfolio----------------*/

.portfolio {
  background-color: #ffffff;
  padding: 120px 0;
}

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

.portfolio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 24px;
  padding: 0;
  margin: 0;
}

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

.portfolio-list-item:hover,
.portfolio-list-item:focus-within {
  box-shadow:
    0 2px 1px rgba(46, 47, 66, 0.08),
    0 1px 1px rgba(46, 47, 66, 0.16),
    0 1px 6px rgba(46, 47, 66, 0.08);
}

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

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #4d5ae5;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-overlay-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #f4f4fd;
}

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

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

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

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

.portfolio-list-image {
}

/*----------------Section footer----------------*/

.footer {
  background: #2e2f42;
  padding: 100px 0;
}

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

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

.footer-logo {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #f4f4fd;
  display: inline-block;
  margin-bottom: 16px;
}

.footer-logo-accent {
  color: #4d5ae5;
}

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

.footer-social-media {
  margin-right: 80px;
}

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

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

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

.footer-social-link {
  width: 100%;
  height: 100%;
  background-color: #4d5ae5;
  border-radius: 50%;
  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 {
  background-color: #31d0aa;
}

.footer-social-icon {
  fill: #f4f4fd;
}

.footer-subscribe {
  display: flex;
  flex-direction: column;
  margin-left: auto;
}

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

.subscribe-form {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-left: auto;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subscribe-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.input-wrapper {
  display: flex;
  width: 264px;
}

.subscribe-input {
  flex: 1;
  height: 40px;
  border: 1px solid #fff;
  border-radius: 4px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.15);
  padding: 8px 16px;
  font-weight: 400;
  font-size: 12px;
  line-height: 2;
  color: #fff;
  letter-spacing: 0.04em;
  background-color: transparent;
  outline: none;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.subscribe-input:hover,
.subscribe-input:focus {
  border-color: #31d0aa;
}

.subscribe-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 165px;
  height: 40px;
  padding-inline: 16px;
  font-weight: 500;
  font-size: 16px;
  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);
}

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

.subscribe-icon {
  fill: #fff;
}

/*----------------MODAL----------------*/

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

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

.modal {
  border-radius: 4px;
  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;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /*alternative: flex + margin:auto;*/
  padding: 72px 24px 24px 24px;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

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

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

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

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

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

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

.modal-input:focus,
.modal-input:hover {
  border-color: #4d5ae5;
}

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

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

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

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

.modal-form-field:has(.modal-text-area) {
  margin-bottom: 16px;
}

.modal-text-area:focus,
.modal-text-area:hover {
  border-color: #4d5ae5;
}

/*.modal-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
  alternative to visually-hidden
  */

.modal-check-label {
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.04em;
  color: #8e8f99;
  display: flex;
  align-items: center;
}

.modal-check-box {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  transition:
    background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-check-icon {
  fill: #f4f4fd;
  display: none;
}

.modal-check:checked + .modal-check-label .modal-check-box {
  background-color: #404bbf;
  border-color: #404bbf;
}

.modal-check:checked + .modal-check-label .modal-check-icon {
  display: block;
}

.privacy-policy {
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: #4d5ae5;
}

.modal-submit-btn {
  border-radius: 4px;
  padding: 16px 32px;
  width: 169px;
  height: 56px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background-color: #4d5ae5;
  cursor: pointer;
  display: block;
  align-items: center;
  justify-content: center;
  margin: 24px auto 0;
  border: none;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: #fff;
  /*outline:none;*/
}

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