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

img {
}

:root {
  --iris: #4d5ae5;
  --ocean: #404bbf;
  --navy-blue: #2e2f42;
  --green: #31d0aa;
  --slate: #434455;
  --light-slate: #8e8f99;
  --cornflower: #e7e9fc;
  --cloud: #f4f4fd;
  --navy-blue-modal: rgba(46, 47, 66, 0.4);
  --grey: rgba(46, 47, 66, 0.7);
  --white: #fff;
  --dairy: #fcfcfc;

  --font-family: 'Roboto', sans-serif;
  --second-family: 'Raleway', sans-serif;
}

.section-title {
  font-weight: 700;
  font-size: 36px;
  line-height: 111%;
}

body {
  font-family: var(--font-family);
  color: var(--slate);
  background-color: var(--white);
  margin: 0;
}

img {
  display: block;
}

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

.section {
}

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

a {
  text-decoration: none;
}

address {
  font-style: normal;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

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

h3 {
  font-weight: 500;
  font-size: 20px;
}

p {
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.02em;
  color: var(--slate);
}

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

/* HEADER */

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

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

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

.header-logo {
  font-family: var(--second-family);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #4d5ae5;
  margin-right: 76px;
}

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

.header-menu {
  display: flex;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.02em;
  gap: 40px;
  align-items: center;
}

.header-menu-link {
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #2e2f42;
  padding-bottom: 24px;
  padding-top: 24px;
  display: block;
}

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

.nav-item-second {
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-item-first {
  position: relative;
  color: #404bbf;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.header-menu-link:hover,
.header-menu-link:focus {
  color: var(--ocean);
}

.header-menu-item {
  color: var(--navy-blue);
}

.header-contacts {
  font-family: inherit;
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
  letter-spacing: 0.02em;
}

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

.header-contacts-link {
  font-family: inherit;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #434455;
}

.header-contacts-item {
  color: var(--slate);
}

.header-contacts-link:hover,
.header-contacts-link:focus {
  color: var(--ocean);
}

/* HERO */

.hero-section {
  background: var(--navy-blue);
  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/hero_img.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  max-width: 1440px;
  margin: 0 auto;
}

.hero-title {
  font-weight: 700;
  font-size: 56px;
  line-height: 107%;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--white);
  max-width: 496px;
  margin: 0 auto;
  margin-bottom: 48px;
}

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

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

/* ADVANTAGES */

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

.advantages-list {
  display: flex;
  gap: 24px;
}
.advantages-item {
  max-width: 264px;
  width: calc((100% - 72px) / 4);
  /* (ширина контейнера - (колитчество гепов * на их размер))/ кол-во элементов */
}

.icon-advantage {
  width: 60px;
  height: 64px;
  fill: currentColor;
}
.advantages-item-title {
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--navy-blue);
  margin-bottom: 8px;
}

.advantages-item-text {
}

.advantage-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 264px;
  height: 112px;
  background-color: #f4f4fd;
  border-radius: 4px;
  border: 1px solid #8e8f99;
  margin-bottom: 8px;
  padding: 0;
}

.advantage-photo svg {
  width: 64px;
  height: 64px;
  fill: currentColor;
}

/* TEAM */

.team-section {
  background: var(--cloud);
  padding-top: 120px;
  padding-bottom: 120px;
}

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

.team-item {
  border-radius: 0px 0px 4px 4px;
  background: var(--white);
  min-width: 264px;
  max-height: 428px;
}
.team-item:first-child {
  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-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
}

.team-title {
  text-align: center;
  letter-spacing: 0.02em;
  color: var(--navy-blue);
  text-transform: capitalize;
  margin-bottom: 72px;
}

.team-item-title {
  display: flex;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--navy-blue);
  margin-bottom: 8px;
  text-align: center;
}

.team-item-text {
  text-align: center;
}

.team-link {
  width: 40px;
  height: 40px;
  fill: transparent;
  stroke: var(--light-slate);
  margin-top: 16px;
}

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

.social-link:hover,
.social-link:focus {
  background-color: var(--ocean);
}

.social-icon {
  width: 16px;
  height: 16px;
  fill: var(--cloud);
}

.team-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* PORTFOLIO */

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

.portfolio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 24px;
  justify-content: center;
}

.portfolio-item {
  border: 1px solid var(--cornflower);
  width: calc((100% - 48px) / 3);
  height: 420px;
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.portfolio-item:hover {
  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-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

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

.portfolio-item:hover .portfolio-overlay {
  transform: translateY(0%);
}

.portfolio-item-info {
  display: flex;
  flex-direction: column;
  padding: 32px 16px;
  border: 1px solid #e7e9fc;
  border-top: none;
}

.portfolio-title {
  text-align: center;
  letter-spacing: 0.02em;
  color: var(--navy-blue);
  text-transform: capitalize;
  margin-bottom: 72px;
}

.portfolio-item-title {
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--navy-blue);
  margin-bottom: 8px;
}

/* FOOTER */

.footer {
  background: var(--navy-blue, #1f2a6b);
  color: var(--white, #ffffff);
  padding: 100px 0;
}

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

.footer-left {
  margin-right: 120px;
  display: flex;
  flex-direction: column;
}

.footer-social {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-right: 80px;
}

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

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

.social-link-footer:hover,
.social-link-footer:focus {
  background-color: var(--green); /* #31d0aa */
}

.social-icon-footer {
  width: 24px;
  height: 24px;
  fill: var(--cloud, #f4f4fd);
  display: block;
}

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

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

.footer-logo {
  font-family: var(--second-family);
  font-weight: 700;
  font-size: 18px;
  line-height: 117%;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--iris);
  display: inline-block;
  margin-bottom: 16px;
}

.footer-logo-color {
  color: var(--cloud);
}

.footer-text {
  color: var(--cloud);
  max-width: 264px;
  margin-top: 16px;
}

.footer-modal-text {
  font-weight: 500;
  color: var(--white, #ffffff);
  margin-bottom: 16px;
}

.icon-sub {
  fill: var(--white);
}

.footer-email {
  border: 1px solid var(--white);
  border-radius: 4px;
  width: 264px;
  height: 40px;
  background: transparent;
  padding: 8px 16px;
  font-weight: 400;
  font-size: 12px;
  line-height: 200%;
  letter-spacing: 0.04em;
  color: var(--white);
}

.footer-email::placeholder {
  color: var(--white);
}

.footer-email:focus {
  outline: none;
}

.footer-inputs {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  right: 0px;
}

.footer-submit-button {
  display: flex;
  gap: 16px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background: var(--iris);
  border-radius: 4px;
  padding: 8px 24px;
  width: 165px;
  height: 40px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--white);
  border: 0;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-submit-button:hover,
.footer-submit-button:focus {
  background-color: var(--ocean);
}

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

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--navy-blue-modal);
  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);
  /* display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10; */
}

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

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 24px;

  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: var(--dairy);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cls-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 24px;
  right: 24px;
  width: 24px;
  height: 24px;
  fill: var(--navy-blue);
  background: var(--cornflower);
  border-radius: 50%;
  border: 1px solid var(--navy-blue-modal);
  cursor: pointer;
  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);
}

.cls-btn:hover,
.cls-btn:focus {
  background-color: var(--ocean);
  border: none;
  fill: var(--white);
}

.icon-modal {
  fill: var(--navy-blue);
}

.modal-inputs {
  position: relative;
}
.modal-input {
  border: 1px solid var(--navy-blue-modal);
  border-radius: 4px;
  width: 360px;
  height: 40px;
  background-color: transparent;
  padding-left: 38px;
}
.input-content {
  display: flex;
  align-items: center;
}

.icon-modal {
  position: absolute;
  left: 16px;
}

.modal-input + svg:focus {
  fill: var(--iris);
  outline: var(--iris);
}
