.footer {
  box-sizing: border-box;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  justify-content: start;
  justify-items: start;
  align-content: start;
  align-items: start;
  gap: 7.2rem;
  width: 100%;
  max-width: 120rem;
  overflow: visible;
  background-color: transparent;
  padding: 10.4rem 2.4rem;
  margin: 0 auto;
  z-index: 3;
}

@media (min-width: 768px) {
  .footer {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto;
    justify-content: start;
    justify-items: start;
    align-content: start;
    align-items: start;
    gap: 7.2rem;
  }
}

.footer-logo {
  grid-column: 1;
  grid-row: 1;
  height: 4.8rem;
  width: auto;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2.4rem;
}

@media (min-width: 768px) {
  .footer-nav-left {
    grid-column: 1;
  }

  .footer-nav-right {
    grid-column: 2;
  }
}

.footer-title {
  font-size: 2.4rem;
  font-weight: 400;
  margin-bottom: 1.2rem;
}

.footer-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  font-family: montserrat, sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--light-grey);
}

.copyright-container {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.2rem;
  width: 100%;
  max-width: 120rem;
}

@media (min-width: 768px) {
  .copyright-container {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.afterEngines-link {
  font-family: montserrat, sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: underline;
  color: var(--light-grey);
}

.footer-background-container {
  position: relative;
  height: auto;
  width: 100%;
  background-color: var(--light-grey);
  z-index: 0;
  overflow-x: clip;
  overflow-y: hidden;
  z-index: 2;
}

@media (min-width: 1024px) {
  .footer-background-container {
    overflow-y: visible;
  }
}

.footer-background-image {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  height: auto;
  width: 100%;
  max-width: 100%;
  max-width: none;
  object-fit: cover;
  z-index: -1;
}

.footer-background-image-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .footer-background-image-desktop {
    display: block;
    top: -10.4rem;
  }

  .footer-background-image-mobile {
    display: none;
  }
}

@media (min-width: 1440px) {
  .footer-background-image-desktop {
    top: -20rem;
  }
}

/* Mobile fix: constrain the background image to the footer height */
@media (max-width: 1023px) {
  .footer-background-image-mobile {
    top: 0;
    bottom: 0;
    height: auto;
    width: 100%;
    object-fit: cover;
  }
}

.footer-background-image-extend {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60%; /* tweak if needed */
  background-color: var(--dark-grey);
  z-index: -1;
}

@media (min-width: 1024px) {
  .footer-background-image-extend {
    display: block;
  }
}

.footer-background-image,
.footer-background-image-desktop,
.footer-background-image-mobile,
.footer-background-image-extend {
  pointer-events: none;
  z-index: 1;
}
