/***
 * List a list of links.
 */

#links {
  position: relative;
  z-index: 1;
}

@media only screen and (min-width: 768px) {
  #links {
    align-items: center;
    display: flex;
    justify-content: center;
  }
}

#links-navigation {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: calc(60 * 100vw / var(--page-width)) 0;
  position: relative;
  width: 100%;
}

@media only screen and (min-width: 768px) {
  #links-navigation {
    justify-content: center;
    padding-bottom: 0;
    padding-top: 0;
    z-index: 1;
  }
}

.links-group {
  align-items: flex-start;
  display: flex;
  justify-content: center;
}

@media only screen and (min-width: 768px) {
  .links-group {
    gap: calc(400 * 100vw / var(--page-lg-width));
    justify-content: flex-start;
    padding-bottom: calc(40 * 100vw / var(--page-lg-width));
    padding-left: calc(180 * 100vw / var(--page-lg-width));
    padding-top: calc(40 * 100vw / var(--page-lg-width));
  }

  .links-group:nth-child(n + 2) {
    border-top: 2px solid var(--color-main-bg);
  }

  .links-group-2 {
    padding-left: calc(450 * 100vw / var(--page-lg-width));
  }

  .links-group-3 {
    padding-left: calc(744 * 100vw / var(--page-lg-width));
  }
}

.links-cta {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity 0.5s ease-in;
}

@media only screen and (max-width: 767px) {
  /* Widths are eyeballed based on the widest item in the column design */
  .links-cta:first-child {
    width: 34%;
    margin-top: calc(-15 * 100vw / var(--page-width));
  }

  .links-cta:last-child {
    margin-top: calc(100 * 100vw / var(--page-width));
    width: 56%;
  }
}

.links-cta span {
  display: block;
}

.links-cta-label,
.links-cta-label + span {
  margin-top: calc(20 * 100vw / var(--page-width));
}

@media only screen and (min-width: 768px) {
  .links-cta-label,
  .links-cta-label + span {
    margin-top: calc(20 * 100vw / var(--page-lg-width));
  }
}

#links-video {
  height: 100%;
  left: 0;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transition: opacity 0.5s ease-in;
  width: 100%;
}

/* Active state: video playing */
@media only screen and (min-width: 768px) {
  [data-video-playing='true'] .links-cta {
    opacity: 0.5;
  }
}

[data-video-playing='true'] #links-video {
  opacity: 0.3;
}

@media (hover: hover) {
  [data-video-playing='true'] .links-cta:focus,
  [data-video-playing='true'] .links-cta:hover,
  .links-cta:focus,
  .links-cta:hover {
    color: var(--color-accent-sun);
    opacity: 1;
  }

  /* Used on nodes with no page, e.g: case studies that are "coming soon" */
  [data-video-playing='true'] .no-link:focus,
  [data-video-playing='true'] .no-link:hover {
    color: var(--color-light);
    opacity: 1;
  }
}

/* Links balls */

@keyframes drop {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(120vh);
  }
}

.links-ball {
  display: none;
}

.animate-ball .links-ball {
  animation-duration: 1.5s;
  animation-fill-mode: forwards;
  animation-name: drop;
  animation-timing-function: cubic-bezier(0.32, 0, 0.67, 0);
}

@media only screen and (min-width: 768px) {
  /* Logic need to be updated if element with longest delay is changed. */
  .links-ball {
    animation-delay: 0s;
    border-radius: 50%;
    display: block;
    height: calc(100 * 100vw / var(--page-lg-width));
    left: calc(28 * 100vw / var(--page-lg-width));
    position: fixed;
    top: -18vh;
    width: calc(100 * 100vw / var(--page-lg-width));
    z-index: 1;
  }

  .links-ball-02 {
    animation-delay: 0.1s;
    left: calc(204 * 100vw / var(--page-lg-width));
  }

  .links-ball-03 {
    animation-delay: 0.15s;
    left: calc(360 * 100vw / var(--page-lg-width));
  }

  .links-ball-04 {
    animation-delay: 0.1s;
    left: calc(380 * 100vw / var(--page-lg-width));
  }

  .links-ball-05 {
    animation-delay: 0.15s;
    left: calc(479 * 100vw / var(--page-lg-width));
  }

  .links-ball-06 {
    animation-delay: 0.05s;
    left: calc(618 * 100vw / var(--page-lg-width));
  }

  .links-ball-07 {
    animation-delay: 0.15s;
    left: calc(856 * 100vw / var(--page-lg-width));
  }

  .links-ball-08 {
    animation-delay: 0.1s;
    left: calc(995 * 100vw / var(--page-lg-width));
  }

  .links-ball-09 {
    animation-delay: 0.05s;
    left: calc(1045 * 100vw / var(--page-lg-width));
  }

  .links-ball-10 {
    animation-delay: 0.15s;
    left: calc(1198 * 100vw / var(--page-lg-width));
  }

  .links-ball-11 {
    animation-delay: 0;
    left: calc(1376 * 100vw / var(--page-lg-width));
  }

  .links-ball-12 {
    animation-delay: 0.05s;
    left: calc(1436 * 100vw / var(--page-lg-width));
  }

  .links-ball-13 {
    animation-delay: 0.1s;
    left: calc(1558 * 100vw / var(--page-lg-width));
  }
}
