/* Variables */

:root {
  --primary-brand: #4d5ae5;
  --pressed-state: #404bbf;
  --dark: #2e2f42;
  --Success: #31d0aa;
  --text: #434455;
  --subtle-text: #8e8f99;
  --accent: #e7e9fc;
  --light: #f4f4fd;
  --white-background: #ffffff;

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

/* Body */

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

body {
  font-family: Roboto, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
}

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

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

/* Container */

.section {
  padding: 100px 0;
}

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

.header {
  border-bottom: 1px solid var(--accent);
  padding: 20px 0;
}

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

/* Logo */

.logo {
  color: var(--dark);
  text-decoration: none;
  font-family: Raleway, sans-serif;
  font-weight: 800;
}

.logo-span {
  color: var(--primary-brand);
}

/* Navigations */

.nav-list {
  display: flex;
  font-weight: 500;
  list-style: none;
  color: var(--dark);
  gap: 40px;
}

.nav-item {
  position: relative;
}

.nav-link {
  position: relative;
  display: block;
  padding: 24px 0;
  font-weight: 500;
  text-decoration: none;

  transition: color var(--animation);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -21px;
  width: 100%;
  height: 4px;

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

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

/* Address */

.address {
  display: flex;
  gap: 40px;
  font-style: normal;
  color: var(--text);
}
.address-link {
  text-decoration: none;
  color: var(--text);

  transition: color var(--animation);
}

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

.address-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.address-icon {
  width: 15px;
  height: 15px;
  margin-right: 5px;
}

/* Hero */

.hero {
  text-align: center;
  background-image:
    linear-gradient(rgba(47, 48, 58, 0.4), rgba(47, 48, 58, 0.4)),
    url(../images/background/people-office-bcg.jpg);
  max-width: 1440px;
  margin: 0 auto;
  height: 600px;
  background-color: var(--dark);
}

.hero-title {
  margin-top: 188px;
  margin-bottom: 48px;
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
  color: var(--white-background);
}

.hero-btn {
  min-width: 150px;
  min-height: 50px;
  padding: 16px 32px;
  cursor: pointer;
  background-color: var(--primary-brand);
  color: var(--white-background);
  font-weight: 500;
  border: none;

  transition:
    background-color var(--animation),
    color var(--animation);
}

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

/* Advantages */

.advantages-header {
  display: none;
}

.advantages {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 20px;
}

.advantages-title {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: var(--dark);
}

.advantages-list {
  flex-basis: calc((100% - 3 * 20px) / 4);
}

.advantages-text {
  color: var(--text);
}

.advantages-icon-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 112px;
  background-color: var(--light);
  margin-bottom: 8px;
}

.advantages-icon {
  width: 64px;
  height: 64px;
}

/* Works */

.work-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.work-item {
  flex-basis: calc((100% - 2 * 24px) / 3);

  position: relative;
}

.work-title {
  margin-bottom: 72px;
  text-align: center;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  color: var(--dark);
}

.work-text {
  background-color: rgba(46, 47, 66, 0.7);
  color: var(--white-background);
  font-size: 20px;
  line-height: 1.5;
  position: absolute;
  width: 100%;
  text-align: center;
  bottom: 0;
  padding: 10px;
}

/* Team */

.team-title {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  color: var(--dark);
}

.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.team-item {
  flex-basis: calc((100% - 3 * 24px) / 4);

  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  box-shadow:
    0px 1px 3px rgba(0, 0, 0, 0.12),
    0px 1px 1px rgba(0, 0, 0, 0.14),
    0px 2px 1px rgba(0, 0, 0, 0.2);
}

.team-name {
  text-align: center;
  margin-top: 10px;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  color: var(--dark);
}

.team-text {
  text-align: center;
  margin-top: 10px;
  color: var(--text);
  margin-bottom: 8px;
}

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

.team-icon-wrapper {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.team-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: var(--primary-brand);
  border-radius: 50%;
  padding: 12px;

  transition:
    background-color var(--animation),
    transform 250ms ease;
}

.team-link:hover,
.team-link:focus {
  background-color: var(--Success);
  transform: scale(1.2);
}

.team-icon {
  fill: var(--light);
  height: 16px;
  width: 16px;
}

/* Customers */

.customers-title {
  text-align: center;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  margin-bottom: 72px;
}

.customers-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;

  list-style: none;
  padding: 0;
  margin: 0;
}

.customers-item {
  flex-basis: calc((100% - 5 * 24px) / 6);
}

.customers-icon-link {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  height: 88px;

  border: 1px solid var(--subtle-text);
  border-radius: 4px;

  color: var(--subtle-text);

  transition:
    color var(--animation),
    border-color var(--animation);
}

.customers-icon-link:hover,
.customers-icon-link:focus {
  border-color: var(--pressed-state);
  color: var(--pressed-state);
}

.customers-icon {
  width: 104px;
  height: 56px;
  fill: currentColor;
}

/* Footer */

.footer {
  background-color: var(--dark);
  padding: 60px 0;
}

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

.footer-up {
  max-width: 260px;
}
.footer-logo {
  color: var(--primary-brand);
  text-decoration: none;
  font-family: Raleway, sans-serif;
  font-weight: 800;
}

.footer-span {
  color: var(--light);
}
.footer-text {
  color: var(--accent);
  margin-top: 10px;
}

.footer-media {
  margin-left: 120px;
  margin-top: 0;
}

.footer-social {
  font-weight: 400;
  font-size: 24px;
  line-height: 1.5;

  margin-bottom: 16px;
  color: var(--white-background);
}

/* Footer - Subscribe */

.subscribe-form {
  margin-left: 80px;
}
.text-subscribe {
  margin-bottom: 16px;
  color: var(--white-background);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
}

.subscribe-wrapper {
  display: flex;
  align-items: center;
  gap: 24px;
}

.email-subscribe {
  width: 264px;
  height: 40px;
  border: 1px solid var(--white-background);
  outline: none;
  background-color: var(--dark);
  box-sizing: border-box;
  border-radius: 4px;
  padding-left: 16px;

  color: var(--white-background);

  transition: var(--animation);
}

.email-subscribe::placeholder {
  font-size: 12px;
  line-height: 1.5;
  color: var(--white-background);
}

.email-subscribe:hover,
.email-subscribe:focus {
  border-color: var(--pressed-state);
}

.btn-subscribe {
  width: 165px;
  height: 40px;
  margin-left: 24px;
  background-color: var(--primary-brand);
  cursor: pointer;
  color: var(--white-background);
  border-radius: 4px;
  border: none;
  padding-left: 24px;
  display: flex;
  align-items: center;

  transition: var(--animation);
}

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

.btn-text-subscribe {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  color: var(--white-background);
}

.icon-subscribe {
  width: 24px;
  height: 24px;
  margin-left: 10px;
  fill: var(--white-background);
}

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

.dev-text {
  color: var(--white-background);
  font-size: 16px;
  line-height: 1.5;
}

.dev-item {
  display: flex;
  gap: 20px;
  list-style: none;
}

/* Portfolio */

/* App */

.app {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 0;
  margin-bottom: 80px;
}

.app-title {
  display: none;
}

.app-btn {
  font-weight: 500;
  color: var(--primary-brand);
  background-color: var(--accent);
  cursor: pointer;
  min-width: 69px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  transition:
    background-color var(--animation),
    color var(--animation);
}

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

/* Examples */

.examples {
  list-style: none;

  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0;
}

.examples-link {
  text-decoration: none;
}

.examples-item {
  flex-basis: calc((100% - 2 * 20px) / 3);

  border-bottom: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);

  transition: box-shadow var(--animation);
}

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

.text-overlay {
  position: absolute;
  inset: 0;

  padding: 40px 32px;

  background-color: rgba(77, 90, 229, 0.8);
  color: var(--white-background);

  transform: translateY(100%);
  transition: transform var(--animation);
}

.examples-link:hover .text-overlay,
.examples-link:focus .text-overlay {
  transform: translateY(0);
}

.examples-thumb:hover::after {
  opacity: 1;
}

.examples-item:hover {
  box-shadow:
    0px 3px 1px rgba(0, 0, 0, 0.1),
    0px 1px 2px rgba(0, 0, 0, 0.08),
    0px 2px 2px rgba(0, 0, 0, 0.12);
}
.examples-title {
  font-weight: 500;
  font-size: 20px;
  color: var(--dark);
  margin-bottom: 10px;
  margin-top: 20px;
}

.examples-text {
  color: var(--text);
  padding-bottom: 20px;
}

/* Modal */

.backdrop {
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  background-color: #2e2f4266;

  opacity: 1;
  visibility: visible;

  transition:
    opacity var(--animation),
    visibility var(--animation);
}

.backdrop.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;

  min-width: 408px;
  min-height: 584px;
  padding: 20px;
  border-radius: 4px;

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

  transition:
    transform var(--animation),
    opacity var(--animation);
}

.backdrop.is-hidden .modal {
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
}
.modal-text {
  margin-bottom: 50px;
}

.modal-button {
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--dark);
  margin-left: auto;
  margin-bottom: 24px;

  transition:
    color var(--animation),
    background-color var(--animation);
  border: none;

  cursor: pointer;
}

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

.no-scroll {
  overflow: hidden;
}

/* Modal-Form */

.modal-text {
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 16px;
}

.modal-span {
  font-size: 12px;
  line-height: 1.15;
  color: var(--subtle-text);
}

.modal-form {
  /* display: inline-block; */
  display: flex;
  flex-direction: column;
}

.svg-wrapper {
  position: relative;
  width: 100%;
  height: 40px;
  margin-bottom: 16px;
}

.svg-wrapper input {
  width: 100%;
  height: 100%;
  padding-left: 40px;
  box-sizing: border-box;
}

.modal-input {
  outline: none;
  border: 1px solid #2e62f426;
  transition: var(--animation);
}

.modal-input:hover,
.modal-input:focus {
  border: 1px solid var(--primary-brand);
}

.modal-svg {
  position: absolute;
  width: 18px;
  height: 18px;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  transition: var(--animation);
}

.svg-wrapper:focus-within .modal-svg {
  fill: var(--primary-brand);
}

.textarea {
  width: 100%;
  height: 120px;
  resize: none;
  padding-left: 16px;
  padding-top: 8px;
  margin-bottom: 16px;
}

.textarea::placeholder {
  color: var(--subtle-text);
}

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

.checkbox-text {
  font-size: 12px;
  line-height: 1.3;
  color: var(--subtle-text);
}

.modal-btn {
  display: block;
  margin: 0 auto;
  min-width: 150px;
  min-height: 50px;
  padding: 16px 32px;
  cursor: pointer;
  background-color: var(--primary-brand);
  color: var(--white-background);
  font-weight: 500;
  border: none;

  transition:
    background-color var(--animation),
    color var(--animation);
}

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

.real-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

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

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

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

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

  transition:
    background-color var(--animation),
    border-color var(--animation);
}

.checkbox-icon {
  width: 12px;
  height: 12px;
  fill: var(--white-background);
  opacity: 0;

  transition: opacity var(--animation);
}

.real-checkbox:checked + .custom-checkbox {
  background-color: var(--primary-brand);
  border-color: var(--primary-brand);
}

.real-checkbox:checked + .custom-checkbox .checkbox-icon {
  opacity: 1;
}

.real-checkbox:focus + .custom-checkbox {
  border-color: var(--primary-brand);
}
