/* #region variables */
:root {
  /* colors */
  --primary-brand: #4d5ae5;
  --pressed-state: #404bbf;
  --dark: #2e2f42;
  --success: #31d0aa;
  --text: #434455;
  --subtle-text: #8e8f99;
  --accent: #e7e9fc;
  --light: #f4f4fd;
  --modal-overlay: rgba(46, 47, 66, 0.4);
  --hero-bg: rgba(46, 47, 66, 0.7);
  --white-bg: #fff;
  --modal-bg: #fcfcfc;

  /* others */
  --items: 4;
  --indent-col: 24px;
  --indent-row: 48px;
}
/* #endregion variables */

/* #region base */
body {
  font-family: "Roboto", sans-serif;
  background-color: var(--white-bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: 0.02em;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}
a {
  text-decoration: none;
  color: currentColor;
}
ul,
ol {
  list-style-type: none;
  margin: 0;
  padding-left: 0;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
button {
  color: currentColor;
  cursor: pointer;
}

/* #endregion base */

/* #region common */

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

/* Card-set */
.card-set {
  display: flex;
  gap: 24px;
}
.card-set-item {
  width: calc((100% - var(--indent-col) * (var(--items) - 1)) / var(--items));
}
.team__title,
.portfolio__title {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.11;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: capitalize;
  color: var(--dark);
  margin-bottom: 72px;
}
.team__subtitle,
.portfolio__subtitle,
.benefits__subtitle {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--dark);
  margin-bottom: 8px;
}
.site-logo {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary-brand);
}
.site-logo--dark {
  color: var(--dark);
}
.site-logo--light {
  color: var(--light);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(100%);
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* #endregion common */

/* #region header */
.site-header {
  border-bottom: 1px solid var(--accent);
  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);
  background: var(--white-bg);
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-nav {
  display: flex;
  align-items: center;
}
.header-site-logo {
  margin-right: 76px;
}
.header-nav__list {
  display: flex;
  align-items: center;
  gap: 40px;
}
.header-nav__link {
  position: relative;
  padding: 24px 0;
  font-weight: 500;
  color: var(--dark);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.header-nav__link:hover,
.header-nav__link:focus {
  color: var(--pressed-state);
}
.header-nav__link.active {
  color: var(--pressed-state);
}
.header-nav__link.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 4px;
  background: var(--pressed-state);
  border-radius: 2px;
  transition: width 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-info {
  font-style: normal;
}
.contact-info__list {
  display: flex;
  align-items: center;
  gap: 40px;
}
.contact-info__link {
  display: block;
  padding: 24px 0;
  color: var(--text);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.contact-info__link:hover,
.contact-info__link:focus {
  color: var(--pressed-state);
}
/* #endregion header */

/* #region hero */
.hero {
  max-width: 1440px;
  margin: 0 auto;
  min-height: 600px;
  background-color: var(--dark);
  padding: 188px 0;
  background-image:
    linear-gradient(var(--hero-bg), var(--hero-bg)),
    url(../images/hero/img-1.jpg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.hero__title {
  max-width: 496px;
  margin: 0 auto;
  font-weight: 700;
  font-size: 56px;
  line-height: 1.07;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--white-bg);
  margin-bottom: 48px;
}
.hero__btn {
  display: block;
  min-width: 169px;
  height: 56px;
  margin: 0 auto;
  padding: 16px 32px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  border: none;
  border-radius: 4px;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.15);
  color: var(--white-bg);
  background-color: var(--primary-brand);
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.hero__btn:hover,
.hero__btn:focus {
  font-weight: 600;
  background-color: var(--pressed-state);
}
.hero__btn:active {
  background-color: var(--pressed-state);
}
/* #endregion hero */

/* #region benefits */

.benefits__subtitle {
  margin-top: 0;
}
.card-set-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 264px;
  height: 112px;
  margin-bottom: 8px;
  border-radius: 4px;
  border: 1px solid var(--subtle-text);
  background: var(--light);
}

/* #endregion benefits */

/* #region team */
.team {
  background-color: var(--light);
}

.team__item {
  text-align: center;
  background-color: var(--white-bg);
  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);
}
.team-content {
  padding: 32px 16px;
}
.team__desc {
  letter-spacing: 0.02em;
}
.social-list {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.social-item {
  width: 40px;
  height: 40px;
}
.social-link {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--primary-brand);
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.social-link:hover,
.social-link:focus {
  background-color: var(--pressed-state);
}
.social-icon {
  fill: var(--light);
}
/* #endregion team */

/* #region portfolio */
.portfolio__subtitle {
  margin-top: 0;
  margin-bottom: 8px;
}
.portfolio-content {
  padding: 32px 16px;
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}
.portfolio__list {
  --items: 3;
  display: flex;
  column-gap: 24px;
  row-gap: 48px;
  flex-wrap: wrap;
}
.portfolio__item {
  transition: box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.portfolio__item:hover {
  cursor: pointer;
  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);
}
.portfolio__item:hover .overlay {
  transform: translateY(0%);
}
.portfolio-photo {
  position: relative;
  overflow: hidden;
}
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 40px 32px;
  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--light);
  background-color: var(--primary-brand);
}

/* #endregion portfolio */

/* #region footer */
.site-footer {
  background-color: var(--dark);
  padding: 100px 0;
}
.site-footer .container {
  display: flex;
  flex-direction: row;
  align-items: baseline;
}
.footer-site-logo {
  display: inline-block;
  margin-bottom: 16px;
}
.site-footer__text {
  width: 264px;
  color: var(--light);
}
.logo-text {
  margin-right: 120px;
  display: flex;
  flex-direction: column;
}
.social-text {
  color: var(--white-bg);
  margin-bottom: 16px;
  font-weight: 500;
}
.site-footer .social {
  margin-right: 80px;
}
.site-footer .social-list {
  gap: 16px;
  padding: 0;
}
.site-footer .social-link {
  margin: 0;
}
.subscribe-btn .icon {
  fill: var(--white-bg);
  margin-left: 16px;
}
.site-footer .social-link:hover,
.site-footer .social-link:focus {
  background-color: var(--success);
}

.subscribe {
  gap: 12px;
  margin-left: auto;
}

.subscribe-text {
  color: var(--white-bg);
  margin-bottom: 16px;
  font-weight: 500;
}

.subscribe-form {
  display: flex;
  flex-direction: row;
  gap: 24px;
}

.subscribe-btn {
  color: var(--white-bg);
  background-color: var(--primary-brand);
  border-radius: 4px;
  padding: 8px 24px;
  min-width: 165px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  border: none;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.subscribe-btn .icon {
  fill: var(--white-bg);
  margin-left: 16px;
}

.subscribe-btn:hover,
.subscribe-btn:focus {
  background-color: var(--success);
}

.subscribe-email {
  border: 1px solid var(--white-bg);
  border-radius: 4px;
  width: 264px;
  height: 40px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.15);
  background-color: transparent;
  font-size: 12px;
  color: var(--white-bg);
  padding: 8px 16px;
  line-height: 2;
  letter-spacing: 0.04em;
}
.subscribe-email {
  border: 1px solid var(--white-bg);
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.subscribe-email:focus {
  border-color: var(--success);
  outline: none;
}

.subscribe-email::placeholder {
  font-size: 12px;
  color: var(--white-bg);
}
/* #endregion footer */

/* #region modal */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background-color: var(--modal-overlay);
  transition:
    opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 4px;
  width: 408px;
  min-height: 584px;
  transform: translate(-50%, -50%);
  padding: 72px 24px 24px 24px;
  background-color: var(--modal-bg);
  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);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.close-btn:hover,
.close-btn:focus {
  background-color: var(--pressed-state);
  border: none;
}

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

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

.modal-title {
  margin-bottom: 16px;
  font-weight: 500;
  text-align: center;
  color: var(--dark);
}

.label-wrap {
  margin-bottom: 8px;
}

.label-wrap.comment {
  margin-bottom: 16px;
}

.modal-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: var(--subtle-text);
}

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

.modal-input:focus .modal-text:focus {
  border-color: var(--primary-brand);
  outline: none;
  fill: var(--primary-brand);
}

.input-wrap {
  position: relative;
}

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

.modal-input:focus + .icon.input {
  fill: var(--primary-brand);
}

.modal-text {
  display: block;
  margin-top: 4px;
  margin-bottom: 16px;
  width: 100%;
  height: 120px;
  font-size: 12px;
  border-radius: 4px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: rgba(46, 47, 66, 0.4);
  outline: transparent;
  background-color: transparent;
  border: 1px solid var(--modal-overlay);
  padding: 8px 16px;
  resize: none;
  transition: border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-text::placeholder {
  color: var(--modal-overlay);
}

.label-privacy {
  display: block;
  font-size: 12px;
  line-height: 1.33;
  letter-spacing: 0.04em;
  color: var(--subtle-text);
  user-select: none;
}
.privacy-form {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 24px;
}
.privacy-link {
  margin-left: 4px;
  color: var(--primary-brand);
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: underline;
}
.privacy-link:hover,
.privacy-link:focus {
  color: var(--pressed-state);
}
.custom-checkbox-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 2px;
  border: 1px solid rgba(46, 47, 66, 0.4);
  fill: transparent;
  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);
}
.checkbox-icon {
  opacity: 0;
}
.checkbox:checked + .label-privacy .custom-checkbox-wrap .checkbox-icon {
  opacity: 1;
}
.checkbox:checked + .label-privacy > .custom-checkbox-wrap {
  background-color: var(--pressed-state);
  border: none;
  border-color: var(--pressed-state);
  fill: var(--light);
}

.submit-btn {
  display: block;
  cursor: pointer;
  min-width: 169px;
  height: 56px;
  margin: 0 auto;
  padding: 16px 32px;
  border-radius: 4px;
  border: none;

  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--white-bg);
  background-color: var(--primary-brand);
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn:hover,
.submit-btn:focus {
  background-color: var(--pressed-state);
}

/* #endregion modal */
