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

body {
  background-color: var(--white);
  color: var(--slate);
  font-family: 'Roboto', sans-serif;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

a {
  text-decoration: none;
}

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

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

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

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

.container {
  max-width: 320px;
  margin: 0 auto;
  padding: 0 16px;
}

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

.section {
  padding: 96px 0;
}

.section-title {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11;
  text-align: center;
  color: var(--navy-blue);
  margin-bottom: 72px;
}

.section-subtitle {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: var(--navy-blue);
  margin-bottom: 8px;
}

.social-links {
  display: flex;
}

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

.social-icon {
  fill: var(--cloud);
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.close-btn {
  margin-left: auto;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 24px;
  height: 24px;
  background-color: var(--cornflower);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 100%;
  cursor: pointer;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.icon-cross {
  fill: var(--navy-blue);
  transition: fill 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/************ HEADER ************/

.header {
  border-bottom: 1px solid var(--cornflower);
  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-inner {
  display: flex;
  align-items: center;
}

.header-logo {
  display: inline-block;
  padding: 24px 0px;
  font-family: 'Raleway', sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy-blue);
}

.header-logo .logo-accent {
  color: var(--iris);
}

.burger-button {
  display: flex;
  margin-left: auto;
  padding: 0;
  background-color: transparent;
  border: none;
}

.burger-icon {
  fill: #2f2f37;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 168px;
}

.nav-link {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11111;
  letter-spacing: 0.02em;
  color: var(--navy-blue);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-active {
  color: var(--ocean);
}

.contacts {
  margin-bottom: 48px;
  font-style: normal;
}

.contacts-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 24px;
}

.contacts-link {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--slate);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.header-social-links {
  gap: 40px;
}

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

/************ HERO SECTION ************/

.hero {
  padding: 72px 0;
  max-width: 1440px;
  margin: 0 auto;
  background-color: var(--navy-blue);
  background-image: linear-gradient(to bottom, var(--grey), var(--grey)),
    url(../images/hero-bg.jpg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.hero-title {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11111;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--white);
  max-width: 216px;
  margin: 0 auto 72px;
}

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

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

/************ FEATURES SECTION ************/

.features-list {
  display: flex;
  flex-direction: column;
  gap: 72px;
}

.features-subtitle {
  letter-spacing: 0.02em;
  text-align: center;
}

.features-icon-box {
  display: none;
}

/************ TEAM SECTION ************/

.team {
  background-color: var(--cloud);
}

.team-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 72px;
}

.team-card {
  background-color: var(--white);
  max-width: 264px;
  width: 100%;
  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-links {
  justify-content: center;
  gap: 24px;
}

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

.team-img {
  width: 100%;
  aspect-ratio: 264 / 260;
  object-fit: cover;
}

.team-info {
  padding: 32px 16px;
}

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

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

/************ PORTFOLIO SECTION ************/

.portfolio-list {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.portfolio-card {
  cursor: pointer;
}

.portfolio-img-box {
  position: relative;
  width: 100%;
  aspect-ratio: 288 / 280;
  overflow: hidden;
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 40px 32px;
  background-color: var(--iris);
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-description {
  color: var(--cloud);
}

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

.portfolio-info {
  padding: 31.6px 16px;
  border: 1px solid var(--cornflower);
  border-top: none;
}

/************ FOOTER ************/

.footer {
  background-color: var(--navy-blue);
  padding: 96px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 72px;
}

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

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

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

.footer-label {
  text-align: center;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 16px;
}

.footer-links {
  gap: 16px;
}

.footer-link:hover,
.footer-link:focus {
  background-color: var(--green);
}

.footer-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.footer-input {
  width: 288px;
  padding: 7.2px 16px;
  background-color: transparent;
  border: 1px solid var(--white);
  border-radius: 4px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  color: var(--white);
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.footer-input:hover,
.footer-input:focus {
  outline: none;
  border-color: var(--green);
}

.footer-button {
  flex-shrink: 0;
  display: flex;
  gap: 16px;
  align-items: center;
  border: none;
  border-radius: 4px;
  padding: 8px 24px;
  background-color: var(--iris);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--white);
  cursor: pointer;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/************ MODAL ************/

.modal-overlay {
  background-color: var(--navy-blue-modal);

  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

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

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

.modal {
  padding: 24px 16px;
  border-radius: 4px;
  width: 100%;
  max-width: 288px;
  max-height: 90%;
  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);
  overflow-y: auto;
}

.modal-close-btn {
  margin-right: 8px;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
  background-color: var(--ocean);
  border-color: var(--ocean);
}

.modal-close-btn:hover .icon-cross,
.modal-close-btn:focus .icon-cross {
  fill: var(--white);
}

.modal-text {
  margin-bottom: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--navy-blue);
}

.modal-form {
  display: flex;
  flex-direction: column;
}

.modal-label {
  font-size: 12px;
  line-height: 1.16667;
  letter-spacing: 0.04em;
  color: var(--light-slate);
  margin-bottom: 4px;
}

.modal-input-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.modal-input {
  padding: 7.2px 16px 7.2px 38px;
  width: 100%;
  border: 1px solid var(--navy-blue-modal);
  border-radius: 4px;
  outline: none;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-input:hover,
.modal-input:focus {
  border-color: var(--iris);
}

.modal-input-wrapper:focus-within .modal-input-icon {
  fill: var(--iris);
}

.modal-textarea {
  margin-bottom: 16px;
  padding: 8px 16px;
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--navy-blue-modal);
  border-radius: 4px;
  outline: none;
  resize: none;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
}

.modal-textarea:hover,
.modal-textarea:focus {
  border-color: var(--iris);
}
.modal-textarea::placeholder {
  color: var(--navy-blue-modal);
}

.modal-label-checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
}

.modal-checkbox {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid var(--navy-blue-modal);
  cursor: pointer;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-checkbox-icon {
  width: 100%;
  fill: var(--cloud);
  opacity: 0;
  transform: translateX(0.5px);
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-checkbox-input:checked + .modal-checkbox {
  background-color: var(--ocean);
  border-color: var(--ocean);
}

.modal-checkbox-input:checked + .modal-checkbox .modal-checkbox-icon {
  opacity: 1;
}

.modal-checkbox-text {
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: var(--light-slate);
}
.modal-policy {
  line-height: 1.33;
  text-decoration: underline;
  color: var(--iris);
}
.modal-send-btn {
  display: block;
  margin: 0 auto;
  min-width: 169px;
  padding: 16px 32px;
  border: none;
  border-radius: 4px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background-color: var(--iris);
  cursor: pointer;

  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--white);

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

.modal-send-btn:hover,
.modal-send-btn:focus {
  background-color: var(--ocean);
}

@media (max-width: 767.98px) {
  .contacts-number {
    color: var(--iris);
  }

  .header-wrapper {
    position: fixed;
    z-index: 999;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    padding: 24px 24px 40px 16px;
    background-color: var(--white);

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

  .header-wrapper.is-open {
    transform: translateX(-100%);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 1157.98px) {
  .features-subtitle {
    font-weight: 700;
    font-size: 36px;
    line-height: 1.11111;
  }
  .features-text {
    font-weight: 500;
  }

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

@media (min-width: 768px) and (max-width: 1157.98px) {
  .footer-inner {
    padding-left: 108px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }

  .burger-button {
    display: none;
  }

  .burger-close-btn {
    display: none;
  }

  .header-social-links {
    display: none;
  }

  /************ HEADER SECTION ************/

  .header-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
  }

  .nav-list {
    flex-direction: row;
    gap: 40px;
    margin-bottom: 0;
    margin-left: 120px;
  }

  .nav-link {
    display: inline-block;
    padding: 24px 0px;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
  }

  .nav-active {
    position: relative;
  }

  .nav-active::after {
    display: block;
    content: '';
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background-color: var(--ocean);
    position: absolute;
    bottom: -1px;
  }

  .contacts {
    margin-left: auto;
    margin-bottom: 0;
  }

  .contacts-list {
    gap: 12px;
  }

  .contacts-item {
    display: flex;
  }

  .contacts-link {
    display: inline-block;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.16667;
    letter-spacing: 0.04em;
  }

  .header-social-links {
    gap: 40px;
  }

  /************ HERO SECTION ************/

  .hero {
    padding: 112px 0;
  }

  .hero-title {
    font-size: 56px;
    line-height: 1.07143;
    max-width: 496px;
    margin-bottom: 36px;
  }

  /************ FEATURES SECTION ************/

  .features-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 72px 24px;
  }

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

  .features-subtitle {
    text-align: left;
  }

  /************ TEAM SECTION ************/

  .team-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 64px 24px;
  }

  .team-card {
    width: calc((100% - 24px) / 2);
  }

  /************ PORTFOLIO SECTION ************/

  .portfolio-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 72px 24px;
  }

  .portfolio-card {
    max-width: 356px;
    width: calc((100% - 24px) / 2);
  }

  .portfolio-img-box {
    aspect-ratio: 356 / 300;
  }

  /************ FOOTER ************/

  .footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
  }

  .footer-info {
    max-width: 264px;
    margin-bottom: 72px;
  }

  .footer-logo {
    text-align: left;
  }

  .footer-label {
    text-align: left;
  }

  .footer-social {
    margin-left: 24px;
  }

  .footer-form {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }
  .footer-input {
    width: 264px;
  }

  /************ MODAL ************/

  .modal {
    max-width: 408px;
  }

  .modal-close-btn {
    margin-right: 0px;
  }
}

@media (min-width: 1158px) {
  .container {
    max-width: 1158px;
    padding: 0 15px;
  }

  .section {
    padding: 120px 0;
  }

  /************ HEADER ************/

  .nav-list {
    margin-left: 76px;
  }

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

  .contacts-link {
    display: inline-block;
    padding: 24px 0;
    font-size: 16px;
    line-height: 1.5;
  }

  /************ HERO SECTION ************/

  .hero {
    padding: 188px 0;
  }

  .hero-title {
    margin-bottom: 48px;
  }

  /************ FEATURES SECTION ************/

  .features-list {
    gap: 24px;
  }

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

  .features-icon-box {
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 112px;
    background-color: var(--cloud);
    border: 1px solid var(--light-slate);
    border-radius: 4px;
  }

  .features-icon {
    --color1: var(--navy-blue);
    --color2: var(--iris);
  }

  /************ TEAM SECTION ************/

  .team-list {
    gap: 24px;
  }

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

  /************ PORTFOLIO SECTION ************/

  .portfolio-list {
    gap: 24px;
  }

  .portfolio-card {
    max-width: 360px;
    width: calc((100% - 48px) / 3);
    transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .portfolio-img-box {
    aspect-ratio: 360 / 300;
  }

  .portfolio-card:hover {
    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);
  }

  /************ FOOTER ************/

  .footer-inner {
    flex-wrap: nowrap;
  }

  .footer-info {
    margin-bottom: 0px;
  }

  .footer-social {
    margin-left: 120px;
  }

  .footer-subscribe {
    margin-left: 80px;
  }
}

@media (min-resolution: 2x) {
  .hero {
    background-image: linear-gradient(to bottom, var(--grey), var(--grey)),
      url(../images/hero-bg@2.jpg);
  }
}
