.back-to-top {
  --back-to-top-shadow: 0 8px 20px rgba(18, 53, 35, 0.12);

  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(217, 226, 220, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--green);
  box-shadow: var(--back-to-top-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  contain: layout paint style;
  will-change: opacity;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:focus {
  outline: none;
}

.back-to-top:focus-visible {
  box-shadow:
    0 0 0 3px rgba(47, 107, 73, 0.12),
    var(--back-to-top-shadow);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  display: block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  transform: translateZ(0);
  backface-visibility: hidden;
  shape-rendering: geometricPrecision;
}

.contacts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 32px clamp(18px, 5vw, 70px);
  background: var(--surface);
}

.contacts p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.contacts .contact-info {
  display: grid;
  gap: 5px;
}

.contacts .contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-self: center;
}

.contacts.animate-footer .contact-info {
  opacity: 0;
  transform: translateY(14px);
}

.contacts.animate-footer.is-visible .contact-info {
  animation: footerContactIn 620ms cubic-bezier(0.2, 0.72, 0.2, 1) 230ms forwards;
}

.contacts.animate-footer .contact-actions .btn {
  opacity: 0;
  transform: translateY(12px);
}

.contacts.animate-footer.is-visible .contact-actions .btn {
  animation: footerSocialIn 560ms cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.contacts.animate-footer.is-visible .contact-actions .btn:nth-child(1) {
  animation-delay: 340ms;
}

.contacts.animate-footer.is-visible .contact-actions .btn:nth-child(2) {
  animation-delay: 440ms;
}

.contacts.animate-footer.is-visible .contact-actions .btn:nth-child(3) {
  animation-delay: 540ms;
}

@keyframes footerContactIn {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes footerSocialIn {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.contacts .btn {
  border-color: var(--green);
  background: transparent;
  color: var(--green);
}

.contacts .btn:hover {
  background: var(--green);
  color: #fff;
}

.contacts a[href^="mailto:"] {
  color: var(--green);
}

@media (hover: none) {
  .contacts .contact-actions .btn {
    -webkit-tap-highlight-color: transparent;
    transition: none;
  }

  .contacts .contact-actions .btn:hover {
    background: transparent;
    color: var(--green);
    translate: 0;
    box-shadow: none;
  }

  .contacts .contact-actions .btn:active,
  .contacts .contact-actions .btn.is-tapping {
    background: var(--green);
    color: #fff;
    translate: 0;
    box-shadow: none;
  }
}

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

  .contacts .contact-actions {
    grid-row: 1;
    justify-content: center;
  }

  .contacts .contact-info {
    grid-row: 2;
  }

  .contacts.animate-footer.is-visible .contact-actions .btn:nth-child(1) {
    animation-delay: 230ms;
  }

  .contacts.animate-footer.is-visible .contact-actions .btn:nth-child(2) {
    animation-delay: 330ms;
  }

  .contacts.animate-footer.is-visible .contact-actions .btn:nth-child(3) {
    animation-delay: 430ms;
  }

  .contacts.animate-footer.is-visible .contact-info {
    animation-delay: 560ms;
  }
}

@media (max-width: 680px), (hover: none) and (pointer: coarse) and (max-width: 1180px), (orientation: portrait) and (max-width: 1180px) {
  .contacts {
    gap: 10px;
    padding: 16px 14px;
  }

  .contacts .contact-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
  }

  .contacts .contact-actions .btn {
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
  }

  .contacts .contact-info {
    gap: 4px;
    justify-items: center;
    width: 100%;
    text-align: center;
  }

  .contacts p {
    font-size: 14px;
    line-height: 1.35;
  }

  .contacts .contact-email,
  .contacts .contact-address {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .back-to-top {
    --back-to-top-shadow: 0 5px 14px rgba(18, 53, 35, 0.1);

    right: calc(12px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 40px;
    height: 40px;
  }

  .back-to-top svg {
    width: 18px;
    height: 18px;
  }
}
