.site-footer {
  --footer-inset: var(--site-gutter, var(--page-gutter));
  padding: clamp(96px, 10vw, 160px) var(--footer-inset)
    max(clamp(64px, 6vw, 80px), var(--notes-clearance, 0px));
  text-align: center;
}

.footer-note {
  max-width: 42em;
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.6;
  letter-spacing: -.01em;
  color: #4a4a53;
  text-wrap: balance;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 2rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--caption-size);
  color: var(--muted);
}

.footer-link {
  position: relative;
  display: inline-block;
  padding-block: 8px;
  margin-block: -8px;
  color: inherit;
  white-space: nowrap;
  text-decoration: none;
}

.footer-link svg {
  position: absolute;
  left: 0;
  bottom: calc(8px + .05em);
  width: 100%;
  height: 4px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: .8;
  stroke-linecap: round;
  transition: transform 180ms ease;
}

.footer-link svg path { vector-effect: non-scaling-stroke; }
.footer-link:hover, .footer-link:focus-visible { color: var(--ink); }
.footer-link:hover svg, .footer-link:focus-visible svg { transform: translateY(.035em); }

@media (prefers-reduced-motion: reduce) {
  .footer-link svg { transition: none; }
}

.footer-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 24px;
}

.footer-legal a { text-decoration: none; }

.footer-meta a[href]:hover { color: var(--ink); }

/* On desktop the footer sits on the header's axis: the note on the wordmark's
   left edge at the nav's size, the site details on the contact link's right edge. */
@media (min-width: 961px) {
  .site-footer {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 2rem;
    padding-top: clamp(64px, 6vw, 96px);
    /* Mirrors the header: the line sits as far from the bottom edge as the
       nav does from the top. */
    padding-bottom: max(calc(var(--compact-top) + (var(--compact-menu-height) - 1.5rem) / 2), var(--notes-clearance, 0px));
    text-align: left;
  }
  .footer-note {
    max-width: none;
    margin: 0;
    font-size: 0.9375rem;
    letter-spacing: 0;
    color: #50505b;
    text-wrap: pretty;
  }
  .footer-meta {
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: flex-end;
    flex-shrink: 0;
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
  }
  .footer-meta a { min-height: 0; }
  /* The product hero leaves a peek strip above the fold; start the footer
     below it so a single-image page never shows a sliver of its text. */
  .portfolio-product .site-footer {
    padding-top: max(clamp(64px, 6vw, 96px), calc(var(--cover-space) + var(--peek) + 2 * var(--line)));
  }
}

@media (max-width: 620px) {
  .footer-note {
    font-size: 14px;
    text-wrap: wrap;
  }
  .footer-meta {
    gap: 0 12px;
    margin-top: 16px;
    font-size: .75rem;
  }
  .footer-meta > li { white-space: nowrap; }
}

@media (max-width: 960px) {
  .portfolio-product .site-footer,
  .portfolio-index .site-footer {
    --footer-inset: var(--page-gutter);
    padding-bottom: max(calc(56px + env(safe-area-inset-bottom, 0px)), var(--notes-clearance, 0px));
  }
}
