/* Colors root */
:root {
  --primary-color: #4d5ae5;
  --pressed-color: #404bbf;
  --dark-color: #2e2f42;
  --text-color: #434455;
  --cloud-color: #f4f4fd;
  --white-color: #ffffff;
  --cornflower-color: #e7e9fc;
  --light-slate: #8e8f99;
}

/* #region Base */
body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--white-color);
  color: var(--text-color);
}

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

a {
  text-decoration: none;
  color: currentColor;
}

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

address {
  font-style: normal;
}

button {
  cursor: pointer;
}

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

/* #endregion */

/* visually hidden */
.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;
}

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

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

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);

  display: flex;
  align-items: center;
  justify-content: center;

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

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

.social-link svg {
  fill: var(--white-color);
}

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

/* LOGO */
.logo {
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.17;
  letter-spacing: 0.03em;
  text-transform: uppercase;

  color: var(--primary-color);
  text-decoration: none;
  margin-right: 76px;
}

.logo-studio-header {
  color: var(--dark-color);
}

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

/* NAVIGATION */
.nav {
  display: flex;
  align-items: center;
}

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

.nav-link {
  display: block;
  padding: 24px 0;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.02em;

  color: var(--dark-color);
  text-decoration: none;
  position: relative;
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;

  width: 100%;
  height: 4px;

  background-color: var(--pressed-color);
  border-radius: 2px;

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

.nav-link.current {
  color: var(--pressed-color);
}

.nav-link.current::after {
  opacity: 1;
}
.header-page {
  border-bottom: 1px solid var(--cornflower-color);
  box-shadow: 0px 1px 6px rgba(46, 47, 66, 0.08);
}

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

.header-contacts {
  margin-left: auto;
}

.header-contacts-list {
  display: flex;
  gap: 40px;
  letter-spacing: 0.02em;
}

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

  color: var(--text-color);
  text-decoration: none;

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

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

/* HERO SECTION */
.hero-section {
  background-color: var(--dark-color);
  text-align: center;
  padding: 188px 0;

  background-image:
    linear-gradient(rgba(46, 47, 66, 0.7), rgba(46, 47, 66, 0.7)),
    url('../images/hero/hero-bg.jpg');

  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;

  max-width: 1440px;
  margin: 0 auto;
}

.hero-title {
  max-width: 496px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 48px;

  font-size: 56px;
  line-height: 1.07;
  font-weight: 700;
  color: var(--white-color);
}

/* HERO BUTTON */
.hero-button {
  display: block;
  min-width: 169px;
  height: 56px;
  border: none;
  border-radius: 4px;
  margin: 0 auto;

  background-color: var(--primary-color);
  color: var(--white-color);

  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;

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

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

/* FEATURES SECTION */
.features-list {
  display: flex;
  gap: 24px;
}

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

.features-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;

  height: 112px;
  margin-bottom: 24px;

  background-color: var(--cloud-color);
  border-radius: 4px;
  border: 1px solid var(--light-slate);
}

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

.features-text {
  font-size: 16px;
  line-height: 1.5;
}

/* TEAM SECTION */
.team-section {
  background-color: var(--cloud-color);
}

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

.team-item {
  flex-basis: calc((100% - 72px) / 4);
  background-color: var(--white-color);
  border-radius: 0 0 4px 4px;
  overflow: hidden;

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

.team-content {
  padding: 32px 0;
}

.team-title {
  font-size: 36px;
  line-height: 1.11;
  text-align: center;
  text-transform: capitalize;
  color: var(--dark-color);
  margin-bottom: 72px;
}

.team-caption {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: var(--dark-color);

  text-align: center;
  margin-bottom: 8px;
}

.team-type {
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 8px;
}

/* PORTFOLIO SECTION */
.portfolio-list {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 24px;
}

.portfolio-item {
  flex-basis: calc((100% - 48px) / 3);
  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-title {
  font-size: 36px;
  line-height: 1.11;
  text-align: center;
  text-transform: capitalize;
  color: var(--dark-color);

  margin-bottom: 72px;
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  padding: 40px 32px;

  background-color: var(--primary-color);
  color: var(--cloud-color);

  transform: translateY(100%);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

.portfolio-thumb {
  position: relative;
  overflow: hidden;
}

/* CARD TEXT */
.portfolio-card-text {
  padding: 32px 16px;
  border: 1px solid var(--cornflower-color);
  border-top: none;
}

.portfolio-caption {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: var(--dark-color);

  margin-bottom: 8px;
}

.portfolio-type {
  font-size: 16px;
  line-height: 1.5;
}

/* FOOTER */
.footer-page {
  background-color: var(--dark-color);
  padding: 100px 0;
}

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

.footer-left {
  display: flex;
  flex-direction: column;
}

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

.footer-social {
  display: flex;
  flex-direction: column;
}

.footer-social-title {
  margin-bottom: 16px;
  color: var(--white-color);
}

.footer-social-list {
  display: flex;
  gap: 16px;
}

.footer-social-list .social-link {
  background-color: rgba(255, 255, 255, 0.1);
}

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

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

.subscribe-input {
  width: 264px;
  height: 40px;
  padding: 8px 16px;
  letter-spacing: 0.04em;

  border: 1px solid var(--white-color);
  background-color: transparent;
  color: var(--white-color);
}

.subscribe-button {
  display: flex;
  align-items: center;
  gap: 16px;
  letter-spacing: 0.04em;

  padding: 8px 24px;

  background-color: var(--primary-color);
  color: var(--white-color);
  border: none;
  border-radius: 4px;
}

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

/* BACKDROP */
.backdrop {
  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;

  transition:
    opacity 250ms,
    visibility 250ms;
}

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

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

/* MODAL */
.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);

  width: 408px;
  min-height: 584px;
  padding: 72px 24px 24px;

  background-color: var(--white-color);
  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);

  transition: transform 250ms;
}

.modal-submit {
  display: block;
  margin: 24px auto 0;

  min-width: 169px;
  height: 56px;

  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;

  background-color: var(--primary-color);
  color: var(--white-color);

  border: none;
  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);
}

.modal-submit:hover {
  background-color: var(--pressed-color);
}

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

/* CLOSE BUTTON */
.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;

  width: 24px;
  height: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background-color: var(--cornflower-color);

  transition:
    background-color 250ms,
    border 250ms;
}

.modal-close:hover {
  background-color: var(--pressed-color);
  border: none;
}

.modal-close svg {
  fill: var(--dark-color);
}

.modal-close:hover svg {
  fill: var(--white-color);
}

/* CHECKBOX */
.checkbox-input {
  position: absolute;
  opacity: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 12px;
  line-height: 1.17;
  letter-spacing: 0.04em;
  color: var(--light-slate);
}

.checkbox-custom {
  width: 16px;
  height: 16px;

  border: 1px solid var(--cornflower-color);
  border-radius: 2px;

  display: flex;
  align-items: center;
  justify-content: center;

  fill: transparent;
  transition:
    background-color 250ms,
    border 250ms;
}

.checkbox-input:checked + .checkbox-label .checkbox-custom {
  background-color: var(--primary-color);
  border: none;
  fill: var(--white-color);
}

.checkbox-custom svg {
  fill: var(--white-color);
}

/* FORM */
.form-field {
  margin-bottom: 8px;
}

.form-field:last-of-type {
  margin-bottom: 16px;
}

.form-label {
  font-size: 12px;
  color: var(--light-slate);
  display: block;
  margin-bottom: 4px;
}

.input-wrap {
  position: relative;
}

.form-input {
  width: 100%;
  height: 40px;
  padding-left: 40px;

  border: 1px solid var(--cornflower-color);
  border-radius: 4px;

  transition: border-color 250ms;
}

.form-input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.form-input::placeholder {
  color: rgba(142, 143, 153, 0.6);
}

.form-icon {
  position: absolute;
  left: 12px;
  top: 50%;

  transform: translateY(-50%);

  width: 18px;
  height: 18px;

  fill: var(--dark-color);
  pointer-events: none;
}

.form-input:focus + .form-icon {
  fill: var(--primary-color);
}

.form-textarea {
  width: 100%;
  height: 120px;
  padding: 8px 16px;

  border: 1px solid var(--cornflower-color);
  border-radius: 4px;
  resize: none;

  transition: border-color 250ms;
}

.form-textarea:focus {
  border-color: var(--primary-color);
  outline: none;
}

.form-checkbox {
  margin-top: 16px;
}

.privacy-link {
  color: var(--primary-color);
  text-decoration: underline;
  font-size: 12px;
}

.privacy-link:hover {
  color: var(--pressed-color);
}
