/*
*  Footer Styles
*
*  Markup: footer.php
*  JS:     js/footer/footer-bg.js, footer-slider.js
*/

/* Scoped reset: these components were built against a global margin/padding reset */
.footer,
.footer *,
.footer *::before,
.footer *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.footer {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
  color: var(--ink);
}

:where(.footer) h1,
:where(.footer) h2,
:where(.footer) h3,
:where(.footer) h4,
:where(.footer) h5,
:where(.footer) h6 {
  clear: none;
}

:where(.footer) ul {
  list-style: none;
}

/* :where() keeps this at zero added specificity so a component class always wins */
:where(.footer) a {
  color: inherit;
  text-decoration: none;
}

:where(.footer) img {
  display: block;
  max-width: 100%;
}

:where(.footer) button {
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  min-height: 100svh;
  padding: clamp(48px, 6vh, 72px) 60px clamp(20px, 3vh, 28px);
  background: var(--page);
  color: #d2d2d8;
  overflow: hidden;
}

.footer__main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 760px);
  grid-template-areas:
    "left right"
    "cta cols";
  column-gap: 48px;
  row-gap: 40px;
  align-items: start;
  margin-bottom: 0;
}

.footer__left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding-top: clamp(24px, 5vh, 64px);
}

.footer__pitch {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 3.4vw, 3.375rem);
  line-height: 1;
  max-width: 10.5em;
  color: #d2d2d8;
}

.footer__pitch .accent {
  font-weight: 400;
  color: #e55306;
}

.footer__right {
  grid-area: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  width: 100%;
}

.footer__cols {
  grid-area: cols;
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: 105px 105px 105px;
  column-gap: 0;
  width: max-content;
  max-width: 100%;
  margin-left: auto;
  justify-content: end;
  align-self: end;
  z-index: 2;
}

.footer__cols > .footer__nav:nth-child(2) {
  margin-left: 10px;
}

.footer__cols > .footer__nav:nth-child(3) {
  margin-left: 69px;
}

.footer__cta {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  width: 100%;
  max-width: none;
  padding-right: min(420px, 32vw);
  box-sizing: border-box;
  color: #d2d2d8;
  margin-top: 0;
  text-decoration: none;
  align-self: end;
  z-index: 1;
}

/* Override global a:hover/a:active gray from styleguide.css so hover only underlines + rotates the arrow */
.footer__cta:hover,
.footer__cta:focus-visible,
.footer__cta:active {
  color: #d2d2d8;
}

.footer__cta-text {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 7.2vw, 8.25rem);
  line-height: 0.95;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.footer__cta-line {
  display: block;
  white-space: nowrap;
  font-size: clamp(1.75rem, 3.4vw, 3.375rem);
  line-height: 1.1;
  font-weight: 400;
  margin-bottom: 0.08em;
}

.footer__cta-main {
  position: relative;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 70px;
  white-space: nowrap;
  max-width: none;
  padding-bottom: 0.08em;
}

.footer__cta-main::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer__cta:hover .footer__cta-main::after,
.footer__cta:focus-visible .footer__cta-main::after {
  transform: scaleX(1);
  opacity: 1;
}

.footer__cta-touch {
  display: inline;
  white-space: nowrap;
}

.footer__cta-arrow {
  position: relative;
  top: 20px;
  display: inline-block;
  flex-shrink: 0;
  width: 0.45em;
  height: 0.45em;
  margin: 0;
  vertical-align: top;
  transform-origin: center center;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer__cta:hover .footer__cta-arrow,
.footer__cta:focus-visible .footer__cta-arrow {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  .footer__cta-main::after,
  .footer__cta-arrow {
    transition: none;
  }

  .footer__cta:hover .footer__cta-main::after,
  .footer__cta:focus-visible .footer__cta-main::after {
    transform: scaleX(1);
    opacity: 1;
  }
}

.footer__feature {
  display: grid;
  grid-template-columns: minmax(0, 402fr) minmax(0, 280fr);
  gap: 20px;
  width: 100%;
  max-width: 760px;
  align-items: start;
  margin-bottom: 56px;
}

.footer__feature-media {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #ddd;
  aspect-ratio: 402 / 190;
}

.footer__feature-slides {
  position: absolute;
  inset: 0;
}

.footer__feature-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.footer__feature-slides img.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 1;
}

.footer__feature-nav {
  position: absolute;
  left: 13px;
  bottom: 13px;
  z-index: 2;
  display: flex;
  gap: 3px;
}

.footer__feature-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  cursor: pointer;
  transition: background-color 0.25s ease-in-out;
}

.footer__feature-nav button img {
  width: 12px;
  height: 10px;
  display: block;
  transition: filter 0.25s ease-in-out;
}

.footer__feature-nav button[data-dir="prev"] img {
  transform: scaleX(-1);
}

.footer__feature-nav button:hover,
.footer__feature-nav button:focus-visible {
  background: var(--orange);
}

.footer__feature-nav button:hover img,
.footer__feature-nav button:focus-visible img {
  filter: brightness(0) invert(1);
}

.footer__feature-nav button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* Matches the 190px image, growing for three-line titles instead of squeezing them into the metric */
.footer__feature-panel {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  box-sizing: border-box;
}

.footer__feature-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding-bottom: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition:
    opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer__feature-body.is-exiting {
  opacity: 0;
  transform: translateY(6px);
}

.footer__feature-body.is-entering {
  opacity: 0;
  transform: translateY(-6px);
}

.footer__feature-progress {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: 1px;
  margin-top: auto;
  background: rgba(210, 210, 216, 0.22);
  overflow: hidden;
}

.footer__feature-progress > span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.footer__feature-progress > span.is-running {
  animation: footerSlideProgress var(--footer-slide-ms, 5s) linear forwards;
}

.footer__feature-progress > span.is-paused {
  animation-play-state: paused;
}

@keyframes footerSlideProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.footer__feature-meta {
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 0.6875rem;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: #d2d2d8;
  margin-bottom: 10px;
}

.footer__feature-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 28px;
  color: #d2d2d8;
  margin: 0 0 10px;
  min-height: calc(28px * 2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.footer__feature-metric {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.2;
  color: #d2d2d8;
  margin: 0;
  padding-bottom: 0;
}

.footer__feature-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 46px;
  color: #e65525;
  margin-top: auto;
  padding-bottom: 0;
  width: fit-content;

  &:hover, &:active {
    color: #e65525;
  }
}

.footer__feature-link img {
  width: 16px;
  height: 14px;
  display: block;
  flex-shrink: 0;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer__feature-link:hover img,
.footer__feature-link:focus-visible img {
  transform: translateX(8px);
}

@media (prefers-reduced-motion: reduce) {
  .footer__feature-slides img,
  .footer__feature-body {
    transition: none;
  }

  .footer__feature-slides img {
    transform: none;
  }

  .footer__feature-body.is-exiting,
  .footer__feature-body.is-entering {
    opacity: 1;
    transform: none;
  }

  .footer__feature-progress > span.is-running {
    animation: none;
    transform: scaleX(1);
  }

  .footer__feature-link img {
    transition: none;
  }
}

.footer__mark {
  width: 100px;
  height: 96px;
  object-fit: contain;
  object-position: center;
  margin: 0 0 56px;
  background: transparent;
  align-self: flex-end;
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer__nav a {
  position: relative;
  display: inline-flex;
  width: fit-content;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  line-height: 42px;
  color: #d2d2d8;
}

.footer__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer__nav a:hover::after,
.footer__nav a:focus-visible::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  .footer__nav a::after {
    transition: none;
  }
}

.footer__nav--social {
  align-items: flex-end;
  text-align: right;
}

.footer__nav--social a {
  text-transform: lowercase;
}

.footer__bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  padding-top: clamp(16px, 2vh, 28px);
  margin-top: 0;
  border-top: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 32px;
  letter-spacing: 0;
  color: #d2d2d8;
}

.footer__bottom > p:first-child {
  justify-self: start;
}

.footer__locale {
  justify-self: center;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #d2d2d8;
}

.footer__legal {
  display: flex;
  gap: 24px;
  justify-self: end;
}

.footer__legal a {
  color: #d2d2d8;
}

@media (max-width: 1100px) {
  .geo,
  .work,
  .logos,
  .footer {
    padding-left: 28px;
    padding-right: 28px;
  }

  .footer {
    height: auto;
    min-height: 100svh;
    overflow: visible;
    padding: 48px 28px 24px;
  }

  .footer__main,
  .footer__feature,
  .footer__cols,
  .footer__bottom {
    grid-template-columns: 1fr;
  }

  .footer__main {
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "right"
      "cta"
      "cols";
  }

  .footer__left {
    padding-top: 0;
    gap: 28px;
  }

  .footer__cta {
    grid-column: auto;
    grid-row: auto;
    margin-top: 0;
    width: 100%;
    padding-right: 0;
  }

  .footer__cta-text {
    font-size: clamp(2.25rem, 10vw, 4.5rem);
  }

  .footer__cta-main {
    white-space: nowrap;
  }

  .footer__right {
    align-items: stretch;
  }

  .footer__cols {
    grid-column: auto;
    grid-row: auto;
    max-width: none;
    width: 100%;
    justify-content: start;
    margin-left: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer__cols > .footer__nav:nth-child(2),
  .footer__cols > .footer__nav:nth-child(3) {
    margin-left: 0;
  }

  .footer__mark {
    align-self: flex-end;
    margin-bottom: 40px;
  }

  .footer__feature {
    margin-bottom: 32px;
  }

  .footer__nav--social {
    align-items: flex-start;
    text-align: left;
  }

  .footer__bottom {
    justify-items: start;
  }

  .footer__locale,
  .footer__legal {
    justify-self: start;
  }
}

@media (max-width: 768px) {
  .footer {
    min-height: 0;
    padding: 51px 16px 20px;
  }

  .footer__main {
    flex: 0 0 auto;
  }

  .footer__main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "feature feature"
      "pitch   mark"
      "cols    cols"
      "cta     cta";
    gap: 0;
  }

  .footer__right {
    display: contents;
  }

  .footer__feature {
    grid-area: feature;
  }

  .footer__left {
    grid-area: pitch;
  }

  .footer__cols {
    grid-area: cols;
    margin-top: 17px;
  }

  .footer__cta {
    grid-area: cta;
    margin-top: 29px;
  }

  .footer__pitch {
    font-size: clamp(1.625rem, 8vw, 2rem);
  }

  .footer__feature {
    gap: 28px;
    margin-bottom: 74px;
  }

  .footer__feature-title {
    font-size: 1.125rem;
  }

  .footer__feature-panel {
    height: auto;
    min-height: 0;
  }

  .footer__feature-body {
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: start;
    align-items: end;
    padding-top: 0;
    margin-bottom: 6px;
  }

  .footer__feature-meta {
    margin: 0 0 12px;
  }

  .footer__feature-title {
    margin: 0 0 9px;
  }

  .footer__feature-meta,
  .footer__feature-title {
    grid-column: 1 / -1;
  }

  .footer__feature-metric {
    grid-column: 1;
    margin-bottom: 0;
  }

  .footer__feature-link {
    grid-column: 2;
    margin-top: 0;
    line-height: 1.2;
  }

  .footer__feature-progress {
    margin-top: 0;
  }

  .footer__feature-nav {
    display: none;
  }

  .footer__cols {
    gap: 0 16px;
  }

  .footer__nav a {
    font-size: 0.875rem;
      line-height: 28px;
      color: var(--cream);
  }

  .footer__nav--social {
    align-items: flex-end;
    text-align: right;
  }

  .footer__mark {
    grid-area: mark;
    align-self: end;
    justify-self: end;
    width: 65px;
    height: auto;
    margin: 0;
  }

  .footer__cta-text {
    align-items: stretch;
    font-size: clamp(1.875rem, 9vw, 2.375rem);
  }

  .footer__cta-main {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    font-size: calc((100vw - 42px) / 7.876);
  }

  .footer__bottom {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0 16px;
    margin-top: 29px;
    padding-top: 19px;
    border-top: 1px solid rgba(210, 210, 216, 0.22);
    line-height: 20px;
  }

  .footer__bottom > p:first-child {
    grid-row: 2;
  }

  .footer__locale {
    grid-row: 1;
    grid-column: 1;
    justify-self: start;
  }

  .footer__legal {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-items: start;
    gap: 16px;
  }
}
