/* FROM — the footer, on every page. Full width in FROM orange, with the pages as big words, the smaller links
   beside them, and the rider from home section 1 sitting on his parcel in the corner. */

.footer {
  position: relative;
  background: var(--orange);
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px clamp(40px, 6vw, 96px);
  padding: clamp(72px, 9vw, 128px) 0 clamp(96px, 11vw, 168px);
}

/* ---------- The pages, big ---------- */

.footer__pages {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__pages a {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 2px 0;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 1.02;
  font-weight: 760;
  letter-spacing: -0.055em;
  transition: color 0.25s, transform 0.4s var(--ease-out);
}

.footer__pages .icon {
  width: 0.5em;
  height: 0.5em;
  stroke-width: 2.4;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.25s, transform 0.4s var(--ease-out);
}

.footer__pages a:hover {
  color: #fff;
}

.footer__pages a:hover .icon {
  opacity: 1;
  transform: none;
}

.footer__pages a[aria-current="page"] {
  color: #fff;
}

/* ---------- Everything else, small ---------- */

.footer__side {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  justify-content: space-between;
  align-content: start;
  gap: 40px 32px;
  padding-top: 12px;
}

.footer__heading {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}

.footer__links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links a {
  font-size: 17px;
  font-weight: 500;
  color: rgba(7, 13, 23, 0.78);
  background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.35s var(--ease-out), color 0.2s;
}

.footer__links a:hover {
  color: var(--ink);
  background-size: 100% 2px;
}

.footer__apps {
  font-size: 15px;
  line-height: 1.5;
  color: rgba(7, 13, 23, 0.7);
}

.footer__apps span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--ink);
}

.footer__apps .icon {
  width: 18px;
  height: 18px;
}

/* ---------- Bottom line ---------- */

.footer__base {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  padding: 24px 0 28px;
  border-top: 1.5px solid rgba(7, 13, 23, 0.2);
  font-size: 15px;
  color: rgba(7, 13, 23, 0.72);
}

.footer__legal {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.footer__legal a {
  font-weight: 600;
  color: var(--ink);
  background: linear-gradient(var(--ink), var(--ink)) 0 100% / 0 2px no-repeat;
  transition: background-size 0.35s var(--ease-out);
}

.footer__legal a:hover {
  background-size: 100% 2px;
}

/* The orange logo, turned ink to sit on orange. */
.footer__logo {
  width: 96px;
  height: auto;
  filter: brightness(0);
}

/* The rider, resting on his parcel at the bottom right, feet on the bottom line. */
.footer__rider {
  position: absolute;
  right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter) - 40px));
  bottom: 62px;
  width: clamp(220px, 22vw, 300px);
  height: auto;
  pointer-events: none;
  z-index: -1;
}

/* ---------- Tablet and phone ---------- */

@media (max-width: 1000px) {
  .footer__top {
    grid-template-columns: 1fr;
  }

  .footer__side {
    padding-top: 0;
  }

  .footer__rider {
    width: 220px;
  }
}

@media (max-width: 560px) {
  .footer__top {
    padding-bottom: 250px;
  }

  /* The bottom line wraps to three rows here, so the rider sits higher. */
  .footer__rider {
    right: 4px;
    bottom: 138px;
    width: 200px;
  }

  .footer__legal {
    margin-left: 0;
  }

  .footer__base {
    font-size: 14px;
  }

  .footer__side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* "Get in touch" has the longest links, so it takes the full width under the other two. */
  .footer__side > nav:last-child {
    grid-column: 1 / -1;
  }
}
