body {
  font-family: Roboto, sans-serif;
  color: #434455;
  background-color: #ffffff;
}

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

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

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

img {
  display: block;
}

/* Header */

.page-header {
  border-bottom: 1px solid #e7e9fc;
  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-container {
  display: flex;
  align-items: center;
}

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

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

.logo {
  font-family: Raleway, sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  color: #2e2f42;
  text-decoration: none;
  letter-spacing: 0.03em;
  font-size: 18px;
  line-height: 1.17;
}

.logo-span {
  color: #4d5ae5;
  text-decoration: none;
  display: inline-block;
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

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

.link-line.current {
  position: relative;
}

.link-line.current::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 4px;
  left: 0;
  bottom: -1px;
  background-color: #404bbf;
  border-radius: 2px;
}
.page-nav .link:hover,
.page-nav .link:focus,
.link-line.current {
  color: #404bbf;
}

.page-nav .link-line:hover,
.page-nav .link-line:focus {
  color: #404bbf;
}
.page-nav .link-line:active {
  text-decoration: underline;
}

.address-list {
  margin-left: auto;
}
.contacts-list {
  display: flex;
  align-items: center;
  gap: 40px;
}

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

/* Main */

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

.hero-wrap {
  display: block;
  text-align: center;
  padding: 188px 0;
}
.hero-title {
  color: #ffffff;
  text-align: center;
  font-size: 56px;
  letter-spacing: 0.02em;
  line-height: 1.07;
  font-weight: 700;
  margin: 0 auto;
  max-width: 496px;
}

.hero-button {
  background-color: #4d5ae5;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #ffffff;
  padding: 16px 32px;
  border: none;
  margin-top: 48px;
  border-radius: 4px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hero-button:hover,
.hero-button:focus {
  background-color: #404bbf;
}

/* Hidden "Our 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 */

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

.features {
  padding-top: 120px;
  padding-bottom: 120px;
}
.features-list {
  display: flex;
  gap: 24px;
}

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

.features-text {
  margin-top: 8px;
}

/* Team Section */
.team-container {
  padding: 120px 0;
}
.team-list {
  display: flex;
  gap: 24px;
  align-items: center;
}

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

.image-container {
  padding: 32px 16px;
}

.team-name {
  padding-bottom: 8px;
}

.team-section {
  background-color: #f4f4fd;
}

.team-section h2 {
  text-align: center;
  font-size: 36px;
  letter-spacing: 0.02em;
  line-height: 1.11;
}
.team-section ul li {
  background-color: #ffffff;
}
.team-section ul h3,
.team-section ul p {
  text-align: center;
}

.icon-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  border-radius: 50%;
  margin-top: 8px;
}

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

.icon-list .icon-item {
  width: 40px;
  height: 40px;
}

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

.social-icon-team {
  fill: #f4f4fd;
}
/* Portfolio */
.portfolio-container {
  padding: 120px 0;
}

.post-portfolio {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 24px;
}

.portfolio-text {
  position: absolute;
  top: 0;
  padding: 40px 32px 164px 32px;
  font-weight: 400;
  font-size: 16px;

  /* line-height: 24px; */
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #f4f4fd;
  background-color: #4d5ae5;
  height: 100%;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.portfolio-list:hover .portfolio-text {
  transform: translateY(0);
}

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

.post-subtitle {
  padding-bottom: 72px;
  text-align: center;
  font-size: 36px;
  letter-spacing: 0.02em;
  line-height: 1.11;
  font-weight: 700;
}

.image-portfolio-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  border: 1px solid #e7e9fc;
  border-top: none;
  padding: 32px 16px;
}

/* Footer */

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

.footer-section .logo {
  color: #f4f4fd;
}

.footer-text {
  max-width: 264px;
}

.footer-logo {
  margin-bottom: 16px;
  display: block;
}

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

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

.footer-send-icon {
  fill: #ffffff;
}

.footer-icon-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

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

.social-icon {
  fill: #f4f4fd;
}

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

.footer-media-text {
  font-weight: 500;
  font-size: 16px;

  /* line-height: 24px; */
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: #ffffff;
  padding-bottom: 16px;
}

.footer-form-container {
  margin-left: auto;
  justify-content: center;
}

.footer-form {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-button {
  box-sizing: border-box;
  flex-shrink: 0;
  border-radius: 4px;
  padding: 8px 24px;
  min-width: 169px;
  height: 40px;
  background-color: #4d5ae5;
  gap: 16px;
  cursor: pointer;
  border: none;
  font-weight: 500;
  font-size: 16px;

  /* line-height: 24px; */
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;

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

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

.footer-input {
  margin-right: 24px;
  color: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 4px;
  width: 264px;
  height: 40px;
  background-color: transparent;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  padding-left: 16px;
  outline: none;
  transition: border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-input::placeholder {
  font-weight: 400;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.04em;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-form-container .footer-input:hover,
.footer-form-container .footer-input:focus {
  border: 1px solid #31d0aa;
}

/* Global h and p */
h3 {
  color: #2e2f42;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
h2 {
  color: #2e2f42;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11111;
  letter-spacing: 0.02em;
}

p {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Modal window */

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

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

.modal {
  border-radius: 4px;
  width: 408px;
  min-height: 584px;
  background-color: #fcfcfc;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 72px 24px 24px 24px;
  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);
}

.modal-close-button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: #e7e9fc;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 24px;
  right: 24px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-button:hover,
.modal-close-button:focus {
  background-color: #404bbf;
  cursor: pointer;
}

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

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

.modal-field {
  margin-top: 8px;
}

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

.modal-title {
  font-weight: 500;
  font-size: 16px;

  /* line-height: 24px; */
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-align: center;
  color: #2e2f42;
  max-width: 360px;
  margin-bottom: 16px;
}

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

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

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

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

.modal-textarea {
  border: 1px solid rgba(46, 47, 66, 0.4);
  border-radius: 4px;
  width: 100%;
  height: 120px;
  background-color: transparent;
  padding: 8px 16px;
  outline: transparent;
  resize: none;
  transition: border 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-textarea::placeholder {
  font-weight: 400;
  font-size: 12px;

  /* line-height: 14px; */
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: rgba(46, 47, 66, 0.4);
}

.modal-textarea:focus::placeholder,
.modal-textarea:hover::placeholder {
  color: #4d5ae5;
}

.modal-button {
  border-radius: 4px;
  min-width: 169px;
  height: 56px;
  background-color: #4d5ae5;
  cursor: pointer;
  border: none;
  font-weight: 500;
  font-size: 16px;

  /* line-height: 24px; */
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.form-label {
  font-weight: 400;
  font-size: 12px;

  /* line-height: 14px; */
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: #8e8f99;
  display: block;
  margin-bottom: 4px;
}

.modal-field-privacy {
  margin-top: 16px;
  margin-bottom: 24px;
}

.custom-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  width: 16px;
  height: 16px;
  border-radius: 2px;
  fill: transparent;
  border: 1px solid rgba(46, 47, 66, 0.4);
}

.modal-checkbox:checked + .form-label > .custom-checkbox {
  background-color: #404bbf;
  border-radius: 2px;
  fill: #ffffff;
  border: 1px solid #404bbf;
}

.privacy-link {
  color: #4d5ae5;
  text-decoration: underline;
}
