/*
  The box-shadow is not a shadow — it's the footer's own colour, extended past
  the end of the document.

  Mobile browsers rubber-band past the end of a page, and the strip they
  expose is painted with the *canvas* colour. The canvas takes its colour from
  `body`, which is the page background (white in light mode) — not from the
  footer. So scrolling to the bottom and pulling revealed a white band beneath
  a near-black footer, which reads as the footer failing to reach the bottom
  of the page.

  A zero-blur shadow with equal offset and spread paints a solid rectangle
  that starts exactly at the footer's top edge (offset cancels spread there)
  and runs 2x the spread below it. Because box-shadow neither participates in
  layout nor contributes scrollable overflow, this adds no height at all — the
  strip is simply already the right colour on the rare occasions it's visible.
*/
.site-footer {
  margin-top: 5rem;
  padding: 4.5rem 1.5rem 2rem;
  background: var(--color-footer-bg);
  box-shadow: 0 25vh 0 25vh var(--color-footer-bg);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-brand) 50%, transparent);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* Top: brand + link columns */

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand {
  max-width: 340px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.footer-logo-image {
  display: block;
  width: 32px;
  height: 32px;
}

.footer-logo-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-footer-cream);
}

.footer-tagline {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--color-footer-muted);
}

.footer-heading {
  margin: 0 0 1.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-footer-cream);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--color-footer-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--color-brand);
}

/* Connect column */

.footer-socials {
  list-style: none;
  margin: 0 0 1.3rem;
  padding: 0;
  display: flex;
  gap: 0.7rem;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-circle);
  border: 1px solid rgba(var(--color-footer-cream-rgb), 0.16);
  color: var(--color-footer-muted);
  transition: background-color var(--response-fast) var(--ease-exit),
    color var(--response-fast) var(--ease-exit),
    border-color var(--response-fast) var(--ease-exit),
    transform var(--response-fast) var(--ease-exit);
}

.footer-social-link svg {
  width: 17px;
  height: 17px;
}

.footer-social-link:hover,
.footer-social-link:focus-visible {
  background-color: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-on-brand);
  transform: translateY(var(--motion-lift));
  transition: background-color var(--response-fast) var(--ease-enter),
    color var(--response-fast) var(--ease-enter),
    border-color var(--response-fast) var(--ease-enter),
    transform var(--response-fast) var(--ease-enter);
}

.footer-social-link.is-pressed,
.footer-social-link.is-pressed:hover {
  transform: translateY(0) scale(var(--press-scale));
  transition: transform var(--response-instant) var(--ease-enter);
}

.footer-email {
  display: inline-block;
  color: var(--color-footer-cream);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--color-footer-cream-rgb), 0.25);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-email:hover,
.footer-email:focus-visible {
  color: var(--color-brand);
  border-color: var(--color-brand);
}

/* Bottom bar */

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(var(--color-footer-cream-rgb), 0.1);
}

.footer-copyright {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-footer-copyright);
}

.footer-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1.5px solid rgba(var(--color-brand-rgb), 0.5);
  border-radius: var(--radius-pill);
  background: rgba(var(--color-brand-rgb), 0.1);
  color: var(--color-footer-pill-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--response-fast) var(--ease-exit),
    border-color var(--response-fast) var(--ease-exit),
    color var(--response-fast) var(--ease-exit),
    transform var(--response-fast) var(--ease-exit);
}

.footer-to-top svg {
  width: 14px;
  height: 14px;
}

.footer-to-top:hover,
.footer-to-top:focus-visible {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-on-brand);
  transform: translateY(var(--motion-lift));
  transition: background-color var(--response-fast) var(--ease-enter),
    border-color var(--response-fast) var(--ease-enter),
    color var(--response-fast) var(--ease-enter),
    transform var(--response-fast) var(--ease-enter);
}

.footer-to-top.is-pressed,
.footer-to-top.is-pressed:hover {
  transform: translateY(0) scale(var(--press-scale));
  transition: transform var(--response-instant) var(--ease-enter);
}

/* Scroll reveal (base hidden state + reduced-motion reset: css/components/reveal.css) */

.footer-top,
.footer-bottom {
  transition: opacity var(--response-slow) var(--ease-enter),
    transform var(--response-slow) var(--ease-enter);
}

.site-footer.in-view .footer-top {
  opacity: 1;
  transform: translateY(0);
}

.site-footer.in-view .footer-bottom {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 100ms;
}

/* `--motion-lift` and `--press-scale` already flatten under reduced motion
   (css/base/motion.css); the color changes are kept, since they carry the
   feedback and aren't the part that causes trouble. */

/* Tablet */

@media (max-width: 860px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    row-gap: 2.75rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: 480px;
  }
}

/* Mobile */

@media (max-width: 560px) {
  .site-footer {
    padding: 3.5rem 1.25rem 2rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    row-gap: 2.25rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
}
