:root {
  --accent-color: #4d5ae5;
  --subtitle-color: #2e2f42;
  --main-title-color: #2e2f42;
  --main-text-color: #434455;
}

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

ul {
  margin: 0;
  padding-left: 0;
}

img {
  display: block;
}

body {
  font-family: 'Roboto', sans-serif;
  color: var(--main-text-color);
}

.list {
  list-style: none;
}

.link {
  text-decoration: none;
}

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

/* ---------COMPONENTS -----------*/

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

.section-subtitle {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.22;
  letter-spacing: 0.02em;
  color: var(--subtitle-color);
}

.section-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--main-text-color);
}

.section-title {
  font-size: 36px;
  line-height: 1.11;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  color: var(--main-title-color);
}

.logo {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.33;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-color);
}

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

/* -----------HEADER -------------*/

.header {
  padding-top: 24px;
  padding-bottom: 24px;
  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);
}

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

.header-logo {
  margin-right: 76px;
}

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

.header-navigation {
  display: flex;
  align-items: center;
  margin-right: auto;
}

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

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

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

  .header-menu-link:first-child::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 4px;
  background-color: #404bbf;
  border-radius: 2px;
}

.header-contacts {
  font-style: normal;
}

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

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

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

/* -----------HERO -------------*/

.hero {
  max-width: 1440px;
  margin: 0 auto;
  background-color: #2e2f42;
  background-image: linear-gradient(
      rgba(46, 47, 66, 0.7),
      rgba(46, 47, 66, 0.7)
    ),
    url(../images/hero-bg.jpeg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  padding-top: 188px;
  padding-bottom: 188px;
}

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

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

/* -----------FEATURES -------------*/

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

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

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

.features-subtitle {
  margin-bottom: 8px;
}

/* -----------DOING -------------*/

.doing {
  padding-top: 0;
}

.doing-title {
  margin-bottom: 72px;
}

.doing-list {
  display: flex;
  gap: 24px;
}

.doing-item {
  width: calc((100% - 48px) / 3);
}
/* -----------TEAM -------------*/

.team {
  background-color: #f4f4fd;
}

.team-title {
  margin-bottom: 72px;
}

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

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

.team-item-wrap {
  padding: 32px 16px;
}

.team-subtitle {
  text-align: center;
  margin-bottom: 8px;
}

.team-item-text {
  text-align: center;
  margin-bottom: 8px;
}

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

.team-social-item {
  width: 40px;
  height: 40px;
}
.team-social-link {
  width: 100%;
  height: 100%;
  background-color: var(--accent-color);
  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;
}
/* -----------CUSTOMERS -------------*/

.customers-title {
  margin-bottom: 72px;
}

.customers-list {
  display: flex;
  gap: 24px;
}

.customers-item {
  width: calc((100% - 150px) / 6);
  height: 88px;
}
.customers-link {
  width: 100%;
  height: 100%;
  border: 1px solid #8e8f99;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #afb1b8;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.customers-icon {
  fill: currentColor;
}

.customers-link:hover,
.customers-link:focus {
  border-color: #404bbf;
  color: #404bbf;
}

/* -----------PORTFOLIO -------------*/

.portfolio {
  padding-top: 96px;
}

.portfolio-btn-list {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 72px;
}

.portfolio-btn {
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: var(--accent-color);
  cursor: pointer;
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1),
  background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
  border-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
  box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-btn:hover,
.portfolio-btn:focus {
  background-color: #404bbf;
  box-shadow: 0px 3px 1px rgba(0, 0, 0, 0.1), 0px 2px 1px rgba(0, 0, 0, 0.08),
    0px 2px 2px rgba(0, 0, 0, 0.12);
  color: #ffffff;
}

.portfolio-card-list {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  row-gap: 48px;
}

.portfolio-card-item {
  width: calc((100% - 48px) / 3);
}

.portfolio-card-link {
  display: block;
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card-link:hover,
.portfolio-card-link: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-card-link:hover .portfolio-card-top-text,
.portfolio-card-link:focus .portfolio-card-top-text {
  transform: translateY(0%);
}

.portfolio-card-top-wrap {
  position: relative;
  overflow: hidden;
}

.portfolio-card-top-text {
  position: absolute;
  top: 0;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #f4f4fd;
  padding: 40px 32px;
  background-color: #4d5ae5;
  height: 100%;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card-wrap {
  padding: 32px 16px;
  border: 1px solid #e7e9fc;
  border-top: none;
}
/* -----------FOOTER -------------*/

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

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

.footer-logo {
  display: block;
  margin-bottom: 16px;
}
.logo-light {
  color: #f4f4fd;
}
.footer-text {
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #e7e9fc;
  max-width: 264px;
}

.footer-soc-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: rgba(255, 255, 255, 0.1);
  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;
}

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

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(46, 47, 66, 0.4);
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
  padding: 72px 24px 24px 24px;
}

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

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 408px;
  min-height: 576px;
  background: #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: 24px;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.backdrop.is-hidden .modal {
  transform: translate(-50%, -50%) scaleY(0);
}

.modal-close-btn {
  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);
  margin-left: auto;
  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-icon {
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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