/* design-023 (v4): the closing, and the footer laid in the earth. Scoped under .closing and .footer.
   Needs ../../tokens.css. The closing block is v3's, unchanged. */

.closing, .footer { font-family: var(--f-text); }

/* ---------- closing ---------- */
.closing {
  padding: var(--s-160) var(--gutter) 0;
  text-align: center;
  color: var(--ink);
}
.closing__h { color: var(--ink); }
.closing__line { margin: var(--s-24) auto 0; color: var(--ink-2); max-width: 30em; }
.closing__btns {
  display: flex; justify-content: center; gap: var(--s-12);
  margin-top: var(--s-32);
}

/* The closing buttons are the shared .cta classes (index template): cocoa primary, quiet ghost, shadows from tokens.css (design-033). */

/* ---------- footer ---------- */
.footer {
  --img-w: 100vw;
  --img-h: calc(var(--img-w) * .5631);   /* 941 / 1671 */
  --sky: .0478;                          /* transparent sky above the tallest figure, fraction of image height */
  --seam: 160px;                         /* the image fades into the floor colour over its last 160px */
  --rule: var(--line-earth);
  --wm-w: min(var(--content), 100vw - 2 * var(--gutter));

  position: relative; isolation: isolate; overflow: hidden;
  margin-top: max(0px, calc(var(--s-40) - var(--img-h) * var(--sky)));
  padding-top: calc(var(--img-h) * var(--earth-start));
  padding-bottom: var(--s-48);           /* 48 under the wordmark's baseline: no rule, no bar */
  color: var(--on-earth);
}
/* the floor: flat colour under the image's last rows, down to the end of the page */
.footer::before {
  content: ""; position: absolute; z-index: -2; left: 0; right: 0; bottom: 0;
  top: calc(var(--img-h) - var(--seam));
  background: var(--earth-floor);
}
/* the image, its last 160px dissolving into the floor so a tall footer shows no join */
.footer::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: var(--img-h);
  background: url("../../img/footer-deep.webp") 50% 0 / var(--img-w) auto no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - var(--seam)), transparent);
          mask-image: linear-gradient(to bottom, black calc(100% - var(--seam)), transparent);
}
.footer__in {
  max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto;
  padding: 0 var(--gutter);
}
.footer a { color: inherit; text-decoration: none; }
.footer a:focus-visible { outline: 2px solid var(--on-earth); outline-offset: 3px; border-radius: 4px; }

/* ---------- the ruled grid ---------- */
.fgrid {
  margin-top: var(--s-96);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}
.fcell { position: relative; padding: var(--s-40) var(--s-32); }
.fcell--lockup {
  grid-column: 1 / span 4; padding-left: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-48);
}
.fcols { grid-column: 5 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fcell--col { border-left: 1px solid var(--rule); }
/* the dot where a column's rule meets the top rule: centred on the crossing */
.fcell--col::before {
  content: ""; position: absolute; left: -2px; top: -3px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--on-earth);
}

.lockup { display: inline-flex; align-items: center; }
.lockup__img { display: block; height: 32.7px; width: auto; aspect-ratio: 6598.62 / 1001.70; }  /* brand-023: wordmark 26px */
.fcell__line { margin: var(--s-20) 0 0; max-width: 20em; color: var(--on-earth); text-wrap: balance; }
.fcell__social { display: flex; gap: var(--s-12); margin-top: var(--s-24); }
.footer .tile {
  width: 40px; height: 40px; border-radius: var(--r-8);
  border: 1px solid color-mix(in srgb, var(--on-earth) 25%, transparent);
  display: grid; place-items: center; color: var(--on-earth);
  transition: background-color .15s ease, border-color .15s ease;
}
.footer .tile:hover { background: color-mix(in srgb, var(--on-earth) 10%, transparent); border-color: var(--on-earth-2); }
.footer .tile svg { display: block; }
/* optical size: the square mark reads larger than the disc at equal box size */
.footer .tile__ln { width: 18px; height: 18px; }
.footer .tile__ph { width: 20px; height: 20px; }
.fcell__copy { margin: 0; color: var(--on-earth-2); }

.fcell__h { margin: 0 0 var(--s-16); font-size: var(--t-body); line-height: 24px; color: var(--on-earth-2); }
.fcell ul { list-style: none; margin: 0; padding: 0; }
.fcell li { margin: 0; }
.fcell li a {
  display: block; font-family: var(--f-text); font-weight: 500; font-size: var(--t-body); line-height: 40px;
  color: var(--on-earth); letter-spacing: 0;
}
.fcell li a:hover { text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }

/* ---------- the giant wordmark ---------- */
.wm { display: block; width: var(--wm-w); height: auto; margin-top: var(--s-72); overflow: visible; }
/* The letters are filled with the arch image's earth as it is, sunk into the ground: the look the client picked (variant B, sections/footer/shots/r01/
   footer-B-1440x900-light.png). A logotype is exempt from the WCAG text contrast target, so no brightness lift (design-033; design-024's 1.5 is gone). */
.wm__img { filter: none; }

/* ---------- tablet: lockup on its own row, four columns under it ---------- */
@media (max-width: 1099px) {
  .fcell--lockup { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: flex-end; padding-right: 0; gap: var(--s-32); }
  .fcols { grid-column: 1 / -1; }
  .fcell--col { border-top: 1px solid var(--rule); padding: var(--s-32) var(--s-24); }
  .fcell--col:first-child { border-left: 0; padding-left: 0; }
  .fcell--col:first-child::before { display: none; }
  .fcell--col::before { top: -3px; }
  .fgrid { margin-top: var(--s-72); }
}

/* ---------- mobile: lockup, then the columns two by two; scene widened on the arch ---------- */
@media (max-width: 700px) {
  .closing { padding-top: var(--s-96); }
  .closing__h br { display: none; }
  .closing__btns { flex-direction: column; }
  .closing .cta { width: 100%; }
  .footer { --img-w: 200vw; --seam: 120px; }
  .fgrid { margin-top: var(--s-56); }
  .fcell--lockup { flex-direction: column; align-items: flex-start; gap: var(--s-32); padding-top: var(--s-32); padding-bottom: var(--s-32); }
  .fcols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fcell--col { padding: var(--s-32) var(--s-16) var(--s-32) var(--s-20); }
  .fcell--col:nth-child(odd) { border-left: 0; padding-left: 0; }
  .fcell--col:nth-child(odd)::before { display: none; }
  .wm { margin-top: var(--s-56); }
}
@media (prefers-reduced-motion: reduce) {
  .footer .tile { transition: none; }
}
