site-footer {
  display: block;
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: calc(clamp(2rem, 5vw, 5rem) + 2rem) 2rem 2rem;
  color: var(--base-color-bright);

  site-footer[theme="light"] & {
    color: var(--base-color-dark);
  }

  @media (max-width: 750px) {
    gap: 0;
    padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem);
  }
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  gap: 0.25rem;

  @media (max-width: 750px) {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    align-self: stretch;
  }
}

.site-footer__logo {
  width: 160px;
  height: auto;

  @media (max-width: 750px) {
    width: 70px;
    margin-top: -1rem;
  }
}

.site-footer__copyright {
  padding-bottom: 1rem;
  font-size: 1.25rem;

  @media (max-width: 750px) {
    padding-bottom: 0;
    font-size: 1rem;
    font-weight: bold;
  }
}

.site-footer__links {
  display: flex;
  justify-content: space-between;
  width: 100%;
  list-style: none;

  @media (max-width: 900px) {
    gap: clamp(1rem, 3vw, 8rem);
  }

  @media (max-width: 750px) {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 2rem 1rem;
    padding: 0 1rem;

    & li:first-child {
      grid-column: 1 / -1;
      justify-self: end;
      margin-right: -1rem;
    }
  }
}

.site-footer__link {
  position: relative;
  display: inline-block;
  min-width: 9rem;
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius-button);
  color: inherit;
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none;

  @media (max-width: 750px) {
    min-width: 0;
    padding: 0;
    font-size: 1rem;
  }

  & span {
    position: relative;
    z-index: 1;
  }

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: var(--border-radius-button);
    background: var(--highlight-color-2-teal);
    transform: scale(0);
    transform-origin: center;
    transition: transform 1s ease;
  }

  &:hover::before {
    transform: scale(1);
  }

  &::after {
    content: "";
    position: absolute;
    top: -35%;
    right: -0.5rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: translateX(-150%) translateY(-50%) rotate(-360deg);
    transition:
      transform 0.8s ease,
      opacity 0.2s ease;
  }

  &:hover::after {
    opacity: 1;
    transform: translateX(0) translateY(-50%) rotate(0deg);
  }

  @media (max-width: 750px) {
    &::before,
    &::after {
      display: none;
    }
  }
}

site-footer[theme="light"]
  .site-footer__link:not(.site-footer__link--legal)::after {
  filter: brightness(0);
}

.site-footer__link--github::after {
  background-image: url("../assets/svg/social/github.svg");
}

.site-footer__link--linkedin::after {
  background-image: url("../assets/svg/social/linkedin.svg");
}

.site-footer__link--mail::after {
  background-image: url("../assets/svg/social/mail.svg");
}

.site-footer__link--legal {
  display: flex;
  min-width: 0;
  padding: 0.75rem 0 0;
  border-radius: 0;

  @media (max-width: 750px) {
    padding: 0;
  }

  &::before {
    display: none;
  }

  &::after {
    inset: -15px -30px;
    z-index: auto;
    width: auto;
    height: auto;
    background-image: url("../assets/img/scribbles/nav-contact.svg");
    opacity: 1;
    filter: var(--highlight-filter-color-2-teal);
    clip-path: inset(0 100% 0 0);
    transform: none;
    transition: clip-path 0.7s ease;
  }

  &:hover::after {
    transform: none;
    clip-path: inset(0 0% 0 0);
  }
}
