/* ==========================================================================
   Footer (every page; built by tools/footer/build.py: edit the words there)
   Ink. Who Spinta is in one breath, beside "Taking on new projects", the
   email and "Start your project"; a hairline; Services (each with its
   starting price), Studio, Areas we serve and Contact; the wordmark across
   the full width; the year, the studio's clock and "Back to top".
   The motion (footer.js), each part the first time it's in view:
   - the line about Spinta rises, then the email and the button;
   - the hairline draws across and the columns' headings and rows rise in
     turn, each priced row's own hairline drawing under it;
   - the wordmark's letters rise out of the baseline one after another;
   - hover: a link slides right as a short dash draws in before it, the
     email underlines itself, and the wordmark's letters lift towards the
     pointer, the nearest most, like keys under a finger.
   On touch screens a press gives the dash. Reduced motion: none of it.
   ========================================================================== */

.foot {
  position: relative;
  z-index: 1;
  overflow: clip;
  padding: clamp(80px, 9vw, 150px) var(--gutter) clamp(20px, 2vw, 32px);
  color: var(--bone);
  background: var(--ink);
}

.foot a,
.foot button {
  -webkit-tap-highlight-color: transparent;
}

.foot :focus-visible {
  outline-color: var(--bone);
}

/* ------------------------------------------------------------------ lead */

.foot__lead {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: end;
  gap: 48px clamp(40px, 6vw, 140px);
}

.foot__label {
  margin-bottom: clamp(18px, 1.6vw, 28px);
  letter-spacing: 0.14em;
  color: rgb(247 245 242 / 0.5);
}

/* The studio in one breath: the sentence search engines and assistants quote. */
.foot__intro {
  max-width: 25em;
  font-size: clamp(1.5rem, 2.3vw, 2.75rem);
  font-weight: 450;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}

.foot__start {
  display: grid;
  justify-items: start;
  gap: clamp(18px, 1.6vw, 26px);
  justify-self: end;
}

.foot__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.14em;
  color: rgb(247 245 242 / 0.62);
}

/* A bone dot with a ring that keeps breathing out of it. */
.foot__dot {
  position: relative;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bone);
}

.foot__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--bone);
  animation: foot-pulse 2400ms var(--ease-out) infinite;
}

@keyframes foot-pulse {
  0% {
    scale: 1;
    opacity: 0.55;
  }
  70%,
  100% {
    scale: 3.2;
    opacity: 0;
  }
}

.foot__mail {
  position: relative;
  max-width: 100%;
  padding-bottom: 0.08em;
  font-size: clamp(1.625rem, 2.6vw, 3rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.foot__mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  scale: 0 1;
  transform-origin: 100% 50%;
  transition: scale 600ms var(--ease-out);
}

.foot__start-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

/* The header's pill, turned bone on the ink. */
.foot .btn-cta--light {
  color: var(--ink);
  background: var(--bone);
}

.foot .btn-cta--light:active {
  scale: 0.97;
}

.foot__reply {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgb(247 245 242 / 0.5);
}

/* ------------------------------------------------------------------ columns */

.foot__cols {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) repeat(3, minmax(0, 1fr));
  gap: 48px clamp(32px, 4vw, 80px);
  margin-top: clamp(72px, 8vw, 132px);
  padding-top: clamp(28px, 2.4vw, 40px);
}

/* The hairline over the columns (its own layer, so it can draw in). */
.foot__cols::before,
.foot__base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgb(247 245 242 / 0.14);
  transform-origin: 0 50%;
}

.foot__h {
  margin-bottom: 20px;
  letter-spacing: 0.14em;
  color: rgb(247 245 242 / 0.5);
}

.foot__h--follow {
  margin-top: 32px;
}

.foot__list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot__link {
  position: relative;
  display: inline-block;
  font-size: 1rem;
  line-height: 1.4;
  color: rgb(247 245 242 / 0.75);
  transition:
    color 300ms ease,
    translate 450ms var(--ease-out);
}

/* The dash that draws in before a link. */
.foot__link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -14px;
  width: 8px;
  height: 1px;
  background: currentColor;
  scale: 0 1;
  transform-origin: 0 50%;
  transition: scale 450ms var(--ease-out);
}

.foot__link:active,
.foot__link:focus-visible,
.foot__link[aria-current="page"] {
  color: var(--bone);
}

.foot__link:active,
.foot__link:focus-visible {
  translate: 6px 0;
}

.foot__link:active::before,
.foot__link:focus-visible::before {
  scale: 1 1;
}

/* Services read like a price list: the name, its starting price on the
   right, a faint rule under each. */
.foot__list--priced {
  gap: 0;
}

.foot__list--priced li {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 16px;
  padding: 10px 0 11px;
}

.foot__list--priced li:first-child {
  padding-top: 0;
}

.foot__list--priced li::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgb(247 245 242 / 0.09);
  transform-origin: 0 50%;
}

.foot__from {
  white-space: nowrap;
  letter-spacing: 0.08em;
  color: rgb(247 245 242 / 0.5);
  transition: color 300ms ease;
}

.foot__list--plain li {
  font-size: 1rem;
  line-height: 1.4;
  color: rgb(247 245 242 / 0.75);
}

.foot__note {
  margin-top: 16px;
  max-width: 22ch;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgb(247 245 242 / 0.5);
}

.foot__address {
  font-style: normal;
  line-height: 1.6;
  color: rgb(247 245 242 / 0.75);
}

.foot__address span {
  display: block;
}

.foot__address .foot__link {
  margin-top: 12px;
}

.foot__list--social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}

.foot__link--out svg {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 5px;
  vertical-align: 0.05em;
  transition: translate 450ms var(--ease-out);
}

/* ------------------------------------------------------------------ wordmark */

.foot__mark {
  margin-top: clamp(64px, 7vw, 124px);
}

/* Full width. The viewBox leaves headroom over the letters for the lift, and
   the svg's own clip hides them below the baseline before they rise. */
.foot__word {
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
  fill: var(--bone);
}

.foot__letter {
  transform-box: fill-box;
  translate: 0 calc(var(--lift, 0) * -7%);
}

/* ------------------------------------------------------------------ base */

.foot__base {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  margin-top: clamp(20px, 2vw, 32px);
  padding-top: 14px;
  font-size: 0.8125rem;
  color: rgb(247 245 242 / 0.5);
}

.foot__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

.foot__legal-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  transition: color 300ms ease;
}

.foot__legal-link[aria-current="page"] {
  color: var(--bone);
}

.foot__clock time {
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--bone);
}

.foot__up {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: inherit;
  transition: color 300ms ease;
}

.foot__up svg {
  width: 14px;
  height: 14px;
  transition: translate 450ms var(--ease-out);
}

.foot__up:active svg {
  translate: 0 -3px;
}

@media (hover: hover) and (pointer: fine) {
  .foot__link:hover {
    color: var(--bone);
    translate: 6px 0;
  }

  .foot__link:hover::before {
    scale: 1 1;
  }

  .foot__list--priced li:hover .foot__from {
    color: var(--bone);
  }

  .foot__link--out:hover svg {
    translate: 2px -2px;
  }

  .foot__mail:hover::after {
    scale: 1 1;
    transform-origin: 0 50%;
  }

  .foot .btn-cta--light:hover {
    background: var(--white);
  }

  .foot__up:hover,
  .foot__legal-link:hover {
    color: var(--bone);
  }

  .foot__up:hover svg {
    translate: 0 -3px;
  }
}

/* ------------------------------------------------------------------ narrow */

/* Small laptops and tablets: the columns two by two. */
@media (max-width: 1099px) {
  .foot__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Portrait tablets and phones: the lead stacks. */
@media (max-width: 899px) {
  .foot__lead {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot__start {
    justify-self: start;
  }
}

/* Phones: Services across the width, Studio and Areas side by side,
   Contact under them. */
@media (max-width: 599px) {
  .foot__col--services,
  .foot__col--contact {
    grid-column: 1 / -1;
  }

  .foot__cols {
    gap: 44px 24px;
  }

  .foot__link,
  .foot__list--plain li {
    font-size: 0.9375rem;
  }

  .foot__base {
    flex-direction: column;
    align-items: flex-start;
  }

  .foot__up {
    min-height: 40px;
  }
}

@media (max-width: 359px) {
  .foot__cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

.no-js .foot__clock {
  display: none;
}

/* ------------------------------------------------------------------ reveal
   Armed by footer.js only when there's motion to play; each part plays as
   it comes into view (.is-in on it). --i orders the rows (footer.js). */

.foot.is-armed .foot__label,
.foot.is-armed .foot__intro,
.foot.is-armed .foot__start > *,
.foot.is-armed .foot__h,
.foot.is-armed .foot__list li,
.foot.is-armed .foot__note,
.foot.is-armed .foot__address > *,
.foot.is-armed .foot__base > * {
  opacity: 0;
  translate: 0 18px;
}

.foot.is-armed .foot__cols::before,
.foot.is-armed .foot__base::before,
.foot.is-armed .foot__list--priced li::after {
  scale: 0 1;
}

.foot.is-armed .foot__letter {
  translate: 0 112%;
}

.foot .foot__lead.is-in .foot__label,
.foot .foot__lead.is-in .foot__intro,
.foot .foot__lead.is-in .foot__start > * {
  opacity: 1;
  translate: none;
  transition:
    opacity 700ms ease var(--d, 0ms),
    translate 1100ms var(--ease-out) var(--d, 0ms);
}

.foot .foot__lead.is-in .foot__intro {
  --d: 80ms;
}

.foot .foot__lead.is-in .foot__start > :nth-child(1) {
  --d: 260ms;
}

.foot .foot__lead.is-in .foot__start > :nth-child(2) {
  --d: 340ms;
}

.foot .foot__lead.is-in .foot__start > :nth-child(3) {
  --d: 420ms;
}

.foot .foot__cols.is-in::before,
.foot .foot__base.is-in::before {
  scale: 1 1;
  transition: scale 1400ms var(--ease-out);
}

.foot .foot__cols.is-in .foot__h,
.foot .foot__cols.is-in .foot__list li,
.foot .foot__cols.is-in .foot__note,
.foot .foot__cols.is-in .foot__address > * {
  opacity: 1;
  translate: none;
  transition:
    opacity 600ms ease calc(180ms + var(--i, 0) * 35ms),
    translate 900ms var(--ease-out) calc(180ms + var(--i, 0) * 35ms);
}

.foot .foot__cols.is-in .foot__list--priced li::after {
  scale: 1 1;
  transition: scale 1100ms var(--ease-out) calc(260ms + var(--i, 0) * 35ms);
}

.foot .foot__mark.is-in .foot__letter {
  translate: 0 calc(var(--lift, 0) * -7%);
  transition: translate 1300ms var(--ease-out) calc(var(--n, 0) * 75ms);
}

/* Risen: the pointer drives the lift from here (footer.js eases it). */
.foot .foot__mark.is-settled .foot__letter {
  transition: none;
}

.foot .foot__base.is-in > * {
  opacity: 1;
  translate: none;
  transition:
    color 300ms ease,
    opacity 600ms ease 200ms,
    translate 900ms var(--ease-out) 200ms;
}

@media (prefers-reduced-motion: reduce) {
  .foot *,
  .foot *::before,
  .foot *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
