/* finale.css — page 9 end (downloads, back to top) and the footer. */

/*
 * No bottom padding: the footer's torn slope is what closes the page, and the
 * terrain that draws it sits right up against this section (`.site-footer`'s
 * margin-top reserves the band it lives in). Any padding here would read as a
 * dead strip of page background between "back to top" and the slope.
 */
.finale {
  display: grid;
  justify-items: center;
  gap: clamp(80px, 18vh, 200px);
  padding: clamp(120px, 24vh, 260px) 0 0;
}

.finale__downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
}

.finale__downloads .brand-btn {
  --btn-w: 340px;
  min-height: 76px;
}

.finale__downloads .brand-btn__title {
  font-size: 34px;
}

.finale__downloads .brand-btn__icon {
  width: 32px;
  height: 32px;
}

.finale__top {
  padding: 14px 64px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 62%, var(--bg));
  color: color-mix(in srgb, var(--bg) 78%, var(--fg));
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 300;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.6s ease, transform 0.7s var(--ease-brand), background-color 0.25s ease;
}

.finale__top:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-3px);
}

.finale__top.is-waiting {
  opacity: 0;
  transform: translateY(16px);
}

@media (max-width: 1100px) {
  .finale__downloads {
    justify-content: center;
  }
}

/* ── footer ──────────────────────────────────────────────────────────────── */

/* The footer flips the page: a light ground under the dark page (and a dark
   ground in light mode), entered through two torn, overlapping slopes. */
.site-footer {
  --foot-bg: #f4f4f5;
  --foot-fg: #0a0a0b;
  --foot-muted: #71717a;
  --foot-mid: #a8a8ad;
  position: relative;
  color: var(--foot-fg);
  background: var(--foot-bg);
  margin-top: 15vw;
}

:root[data-theme='light'] .site-footer {
  --foot-bg: #0a0a0b;
  --foot-fg: #f4f4f5;
  --foot-muted: #a1a1aa;
  --foot-mid: #3f3f46;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) .site-footer {
    --foot-bg: #0a0a0b;
    --foot-fg: #f4f4f5;
    --foot-muted: #a1a1aa;
    --foot-mid: #3f3f46;
  }
}

/*
 * The slope into the footer is the tops of two very wide ellipses:
 *   grey  — centred far off the left edge, so its top runs almost level and
 *           sinks slowly towards the right
 *   front — the footer colour, centred off the right edge, so its top climbs
 *           from low on the left to high on the right and crosses the grey
 *           about two-thirds of the way across
 * Sizes are in vw so the curve keeps its shape at any width; the box clips
 * everything below its own height, where the footer itself takes over.
 */
.site-footer__terrain {
  position: absolute;
  left: 0;
  right: 0;
  /* overlap the footer by a pixel so no hairline shows at the seam */
  bottom: calc(100% - 1px);
  height: 15vw;
  overflow: hidden;
  pointer-events: none;
}

.site-footer__terrain::before,
.site-footer__terrain::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.site-footer__terrain::before {
  left: -270vw; /* centre at x = −20vw */
  top: 0;
  width: 500vw;
  height: 120vw;
  background: var(--foot-mid);
}

.site-footer__terrain::after {
  left: -85vw; /* centre at x = 115vw */
  top: 1.3vw;
  width: 400vw;
  height: 140vw;
  background: var(--foot-bg);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  padding-top: 20px;
  padding-bottom: 40px;
}

.foot-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.foot-card__icon {
  display: grid;
  place-items: center;
  width: clamp(64px, 6.4vw, 100px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--foot-fg);
  color: var(--foot-bg);
  transition: transform 0.5s var(--ease-brand);
}

.foot-card__icon svg {
  width: 44%;
  height: 44%;
}

.foot-card:hover .foot-card__icon,
.foot-card:focus-visible .foot-card__icon {
  transform: rotate(-12deg) scale(1.06);
}

.foot-card__text {
  display: grid;
  gap: 4px;
}

.foot-card__text strong {
  font-size: 18px;
  font-weight: 600;
}

.foot-card__text span {
  color: var(--foot-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.site-footer__fine {
  padding-bottom: 12px;
  color: var(--foot-muted);
  font-size: 12px;
}

.site-footer__fine a {
  color: inherit;
}

/*
 * The creature walks on the footer's own ground, flush with the page bottom.
 * It used to walk on a 22px strip of `--foot-fg` — which in dark mode was the
 * same colour as the page, so the light footer plate looked like it stopped
 * 22px short of the bottom edge, with the page showing through underneath.
 */
.site-footer__crawl .crawler {
  margin-top: 8px;
}

@media (max-width: 820px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}
