.site-footer {
  width: 100%;
  background: #f6f6f6;
  box-sizing: border-box;
  padding-top: 2.5rem;
}

.site-footer__divider {
  width: 100%;
  height: 0.0625rem;
  background-color: #a9a9a9;
}

.site-footer__inner {
  width: 100%;
  max-width: 98.75rem;
  margin: 0 auto;
  padding: 2.5rem 5rem 3rem;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 2rem;
  row-gap: 1.5rem;
  align-items: center;
}

.site-footer__profile {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  min-width: 0;
}

.site-footer__back-to-top {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  border-radius: 20rem;
  background-color: #f4f4f4;
  border: 0.0625rem solid #e2e2e2;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: #646464;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.site-footer__copyright {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 400;
  color: #9c9c9c;
}

.site-footer__social {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
}

.site-footer__avatar {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  flex-shrink: 0;
  border-radius: 1rem;
  object-fit: cover;
}

.site-footer__profile-copy {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  text-align: left;
  padding-top: 0.0625rem;
}

.site-footer__name {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.2;
  font-weight: 500;
  color: #323232;
}

.site-footer__role {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 400;
  color: #707070;
}

.site-footer__back-to-top:hover,
.site-footer__back-to-top:focus-visible {
  color: #262626;
  background-color: #ededed;
  border-color: #d8d8d8;
}

.site-footer__back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #646464;
  flex-shrink: 0;
}

.site-footer__back-arrow {
  display: block;
  animation: site-footer-arrow-up 2.4s ease-in-out infinite;
}

@keyframes site-footer-arrow-up {
  0%,
  100% {
    transform: translateY(0.125rem);
    opacity: 0.55;
  }

  50% {
    transform: translateY(-0.1875rem);
    opacity: 1;
  }
}

.site-footer__social-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.site-footer__social-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.site-footer__social-icon--hover {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
}

.site-footer__social-link:hover,
.site-footer__social-link:focus-visible {
  transform: translateY(-0.0625rem);
}

.site-footer__social-link:hover .site-footer__social-icon--default,
.site-footer__social-link:focus-visible .site-footer__social-icon--default {
  opacity: 0;
}

.site-footer__social-link:hover .site-footer__social-icon--hover,
.site-footer__social-link:focus-visible .site-footer__social-icon--hover {
  opacity: 1;
}

@media (max-width: 56.25rem) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    padding: 2rem 1.5rem 2.5rem;
    column-gap: 0.75rem;
    row-gap: 1.25rem;
    align-items: center;
  }

  .site-footer__profile {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .site-footer__back-to-top {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.125rem;
    gap: 0.5rem;
    white-space: nowrap;
  }

  .site-footer__copyright {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .site-footer__social {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
  }

  .site-footer__name {
    font-size: 1.25rem;
  }

  .site-footer__role {
    font-size: 0.9375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-footer__back-to-top,
  .site-footer__social-link,
  .site-footer__social-icon {
    transition: none;
  }

  .site-footer__back-arrow {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
