body {
  font-family: Roboto, sans-serif;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: #434455;
  background-color: #fff;
}

address {
  margin-left: auto;
  font-style: normal;
}

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

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

img {
  display: block;
}

p {
  margin: 0;
}

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

/* ------ header------ */

.page-header {
  border-bottom: 1px solid #e7e9fc;
  box-shadow:
    0px 2px 1px rgba(46, 47, 66, 0.08),
    0px 1px 1px rgba(46, 47, 66, 0.16),
    0px 1px 6px rgba(46, 47, 66, 0.08);
}

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

.logo-link {
  text-transform: uppercase;
  text-decoration: none;
  color: #4d5ae5;
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  padding: 24px 0;
}

.logo-link-span {
  color: #2e2f42;
}

.navigation {
  margin-left: 76px;
}

.nav-list {
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-nav {
  display: block;
  padding: 24px 0;
  position: relative;

  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #2e2f42;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

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

/* Декоративное подчеркивание только для текущей страницы */
.link-nav.current::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;

  width: 100%;
  height: 4px;
  border-radius: 2px;
  background-color: #404bbf;
}

.link-address {
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
  text-decoration: none;
  padding: 24px 0;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.link-address:hover,
.link-address:active,
.link-address:focus {
  color: #404bbf;
}

.contacts-list {
  display: flex;
  gap: 40px;
}

/*----- main----- */

/* flex-direction: column; /* Элементы друг под другом */
/* align-items: center;    /* Центрируем по горизонтали */
/* text-align: center;     /* Центрируем текст внутри h1 */
.hero-background {
  display: flex;
  flex-direction: column;
  padding: 188px 0;
  align-items: center;
  text-align: center;
  background-color: #2e2f42;
  background-image:
    linear-gradient(to bottom, rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
    url("../images/herobackground.peopleoffice.jpg");

  /* Ограничиваем ширину блока по центру */
  max-width: 1440px;
  /* Центрируем сам блок на очень широких экранах */
  margin: 0 auto;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-text {
  text-align: center;
  /* Чтобы текст переносился как в макете */
  max-width: 496px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 48px;

  font-weight: 700;
  font-size: 56px;
  letter-spacing: 0.02em;
  line-height: 1.07;
  color: #ffffff;
}

.button {
  display: block;
  padding: 16px 32px;
  /* Дополнительная страховка центрирования */
  margin: 0 auto;
  border: none;
  border-radius: 4px;

  color: #ffffff;
  background-color: #4d5ae5;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;

  min-width: 169px;
  height: 56px;

  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.15);
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* задаем внешние отступы сверху и снизу */
.our-features {
  padding-top: 120px;
  padding-bottom: 120px;
}

/* ----our-features----- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/*Элемент списка: рассчитываем ширину, чтобы их влезло ровно 4 */
/*(100% - (количество зазоров * размер зазора)) / количество элементов */
.features-item {
  width: calc((100% - 3 * 24px) / 4);
}

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

.features-icon {
  fill: #2e2f42;
}

/* Заголовок внутри карточки */
/* Небольшой отступ от заголовка до текста */
.our-features-title {
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #2e2f42;
}

/*Текст параграфа */
.features-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
  margin: 0;
}

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

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

  margin-bottom: 72px;
}

.team-content {
  padding: 32px 16px;
  text-align: center;
}

/* 3. Список карточек (ul): выстраиваем в одну строку */
.list-our-team {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.team-card-backgrounds {
  background-color: #fff;
  text-align: center;
  width: calc((100% - 3 * 24px) / 4);
  /* скругляет только нижние углы элемента (левый и правый) на 4 пикселя, оставляя верхние углы острыми (0px). */
  border-radius: 0px 0px 4px 4px;
  /* добавляет тень к элементу */
  box-shadow:
    0px 1px 6px rgba(46, 47, 66, 0.08),
    0px 1px 1px rgba(46, 47, 66, 0.16),
    0px 2px 1px rgba(46, 47, 66, 0.08);
}

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

  margin-bottom: 8px;
}

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

  margin: 0;
}

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

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

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

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

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

.section-our-portfolio {
  padding: 120px 0;
}

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

  margin-bottom: 72px;
}

.portfolio-list {
  display: flex;
  /* Позволяет карточкам падать на новый ряд */
  flex-wrap: wrap;
  /* Расстояние между колонками */
  column-gap: 24px;
  /* Расстояние между рядами по вертикали */
  row-gap: 48px;
  margin: 0;
  padding: 0;
}

.portfolio-list-item {
  width: calc((100% - 48px) / 3);
  /* 1. Добавляем плавный переход для тени */
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/*  2. Добавляем саму тень при наведении */

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

.portfolio-thumb {
  position: relative;
  overflow: hidden;
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #4d5ae5;
  color: #f4f4fd;
  padding: 40px 32px;

  /* Начальное положение — полностью внизу за пределами видимости */
  transform: translateY(100%);
  /* Анимация только трансформации */
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Появление при ховере на ВСЮ карточку */
.portfolio-list-item:hover .portfolio-overlay,
.portfolio-list-item:focus .portfolio-overlay {
  transform: translateY(0);
}

.our-portfolio-title {
  text-align: left;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #2e2f42;

  margin: 0 0 8px 0;
}

.our-portfolio-article {
  margin: 0;
}

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

/* Убираем лишний margin у параграфа, чтобы padding снизу отработал точно 32px */
.our-portfolio-article {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
}

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

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

/* 2. Контейнер: выстраиваем логотип и текст в колонку */
.footer-container {
  display: flex;
  /* Чтобы логотип и заголовок соцсетей выровнялись по одной линии */
  align-items: baseline;
}

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

.footer-logo {
  /* Позволяет margin-bottom работать правильно */
  display: inline-block;
  /* Тот самый отступ 16px до текста */
  margin-bottom: 16px;
  padding: 0;
}

.logo-link-span-footer {
  color: #f4f4fd;
}

.footer-text {
  color: #f4f4fd;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  /* Ключевой параметр для переноса строк как в макете */
  max-width: 264px;
  margin: 0;
}

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

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

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

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

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

.footer-social-icon {
  /* цвет иконок */
  fill: #f4f4fd;
}

.footer-subscribe {
  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;
}

.footer-subscribe-form {
  display: flex;
  gap: 24px; /* Расстояние между инпутом и кнопкой */
}

.footer-subscribe-input {
  width: 264px;
  height: 40px;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;

  color: #ffffff;

  padding-left: 16px;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  border: 1px solid #ffffff;
  background-color: transparent;
  outline: transparent;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.footer-subscribe-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 165px;
  height: 40px;
  background-color: #4d5ae5;
  border-radius: 4px;
  border: none;
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.footer-subscribe-icon {
  margin-left: 16px;
  fill: #ffffff;
}

.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%);
  width: 408px;
  min-height: 584px;
  background-color: #fcfcfc;
  box-shadow:
    0px 1px 1px rgba(0, 0, 0, 0.14),
    0px 1px 3px rgba(0, 0, 0, 0.12),
    0px 2px 1px rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 72px 24px 24px 24px;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn {
  /* Позиционируем относительно родителя .modal */
  position: absolute;
  top: 24px;
  right: 24px;
  /* Делаем кнопку идеально круглой */
  width: 24px;
  height: 24px;
  border-radius: 50%;

  /* Центрируем иконку-крестик внутри круга */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Оформление фона и рамки */
  background-color: #e7e9fc;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0; /* Сбрасываем внутренние отступы кнопки */
  cursor: pointer;

  /* Плавные переходы для ховера */
  transition:
    background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Эффект при наведении */
.modal-close-btn:hover,
.modal-close-btn:focus {
  background-color: #404bbf;
  border: none;
  fill: #ffffff; /* Крестик станет белым */
}

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

/* Изменение цвета иконки ПРИ наведении на КНОПКУ */
.modal-close-btn:hover .modal-close-icon,
.modal-close-btn:focus .modal-close-icon {
  fill: #ffffff;
}

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

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

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

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

/* --- Textarea --- */
.modal-checkbox-label {
  display: flex; /* Выравнивает иконку и текст в ряд */
  align-items: center; /* Центрирует галочку по высоте текста */

  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
}

/* Добавь небольшой отступ для ссылки, если нужно */
.privacy-link {
  color: #4d5ae5;
  text-decoration: underline;
  margin-left: 4px; /* Чтобы "the" и "Privacy" не слипались */
}

.modal-custom-checkbox {
  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;
  /* Важно: фон прозрачный */
  background-color: transparent;

  /* Добавляем transition для плавности */
  transition:
    background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-check-icon {
  fill: transparent;
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-checkbox:checked + .modal-checkbox-label .modal-custom-checkbox {
  background-color: #404bbf;
  border: none;
}

.modal-checkbox:checked + .modal-checkbox-label .modal-check-icon {
  fill: #f4f4fd; /* Галочка становится белой и "проявляется" */
}

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

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

.modal-label {
  display: block;

  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
  margin-bottom: 4px;
}

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

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

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

.modal-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  fill: #2e2f42;
  /* Плавный переход для иконки */
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Изменение цвета иконки при фокусе на инпуте */
.modal-input:focus + .modal-icon {
  fill: #4d5ae5;
}

/* ---Поле комментариев */

.modal-comment-wrap {
  margin-bottom: 16px;
}

.modal-comment {
  display: block;
  width: 100%;
  height: 120px;
  resize: none; /* Требование C11 (запрет растягивания) */

  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;

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

.modal-comment:focus {
  border-color: #4d5ae5;
}

.modal-checkbox-wrap {
  /* Расстояние от текста политики до кнопки Send */
  margin-bottom: 24px;
}

.modal-submit-btn {
  display: block;
  /* Центрируем кнопку горизонтально */
  margin: 0 auto;
  /* Размеры и стили из макета */
  min-width: 169px;
  height: 56px;

  /* Оформление */
  background-color: #4d5ae5;
  border: none;
  border-radius: 4px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;

  /* Плавный переход для ховера */
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
