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

ul {
  list-style: none;
}

/* main styles */
body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  color: #434455;
  background-color: #fff;
}

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

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

.section {
  padding-top: 120px;
  padding-bottom: 120px;
}

/* Header */
.header {
  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);
  background-color: #fff;
  border-bottom: 1px solid #e7e9fc;
  position: sticky;
  z-index: 999;
  top: 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.head-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;
  text-decoration: none;
  margin-right: 76px;
}

.logo-part {
  color: #2e2f42;
}

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

.contacts-list {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
  flex-basis: calc((100% - 40px) / 2);
}

.nav-item {
  display: block;
  text-decoration: none;
  position: relative;
  padding: 24px 0;
  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);
}

.nav-item.active {
  color: #404bbf;
}

.nav-item.active:after {
  position: absolute;
  bottom: -1px;
  left: 0;
  border-radius: 2px;
  height: 4px;
  width: 100%;
  background: #404bbf;
  content: "";
}

.nav-item:hover,
.nav-item:focus,
.contact-link:hover,
.contact-link:focus {
  color: #404bbf;
  outline: none;
}

.contacts {
  font-style: normal;
}

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

/* Hero */
.hero.section {
  padding: 188px 0;
}

.hero {
  background: #2e2f42;
  color: #fff;
  display: flex;
  justify-content: center;
  background-image: linear-gradient(
      to bottom,
      rgba(46, 47, 66, 0.7),
      rgba(46, 47, 66, 0.7)
    ),
    url(../images/hero-bg.jpg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  max-width: 1440px;
  margin: 0 auto;
}

.hero .container {
  text-align: center;
}

.hero-title {
  max-width: 496px;
  font-weight: 700;
  font-size: 56px;
  line-height: 1.07;
  letter-spacing: 0.02em;
  margin-bottom: 48px;
}

.hero-btn {
  display: block;
  min-width: 169px;
  border-radius: 4px;
  padding: 16px 32px;
  background: #4d5ae5;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #fff;
  cursor: pointer;
  border: none;
  margin: 0 auto;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* 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-list,
.team-list {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

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

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

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

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

/* Team */
.team {
  background: #f4f4fd;
}

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

.member {
  border-radius: 0 0 4px 4px;
  width: 264px;
  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);
  background: #fff;
  text-align: center;
}

.member-info-wrapper {
  padding: 32px 0;
}

.social-list {
  display: flex;
  justify-content: center;
  flex-direction: row;
  gap: 24px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.member .list-item-text {
  margin-bottom: 8px;
}

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

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

/* Portfolio */
.portfolio-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.portfolio-item:hover {
  transform: translateY(0%);
  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-image-box {
  position: relative;
  overflow: hidden;
}

.overlay-text {
  position: absolute; /* Позиціонуємо відносно батьківського контейнера */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 40px 32px;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #f4f4fd; /* Колір тексту */
  background-color: #4d5ae5; /* Фон для накладки */
  transform: translateY(100%); /* Початково ховаємо текст вниз */
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1); /* Анімація */
}

.portfolio-item:hover .overlay-text {
  transform: translateY(0); /* Показуємо текст при ховері */
}

.portfolio-info-wrapper {
  padding: 32px 16px;
  border-bottom: 1px solid #e7e9fc;
  border-right: 1px solid #e7e9fc;
  border-left: 1px solid #e7e9fc;
}

.portfolio-list {
  gap: 24px;
  row-gap: 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex-basis: calc((100% - 48px) / 3);
}

/* Footer */
.footer {
  background-color: #2e2f42;
  padding-top: 100px;
  padding-bottom: 100px;
}

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

.footer-text-box {
  margin-right: 120px;
}

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

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

.foot-logo-part {
  color: #f4f4fd;
}

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

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

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

.social-list-link:hover {
  background-color: #31d0aa;
  outline: none;
}

.social-list-link:focus {
  background-color: #31d0aa;
  outline: none;
}
