/* footer.css — site footer grid, columns, watermark, meta rail,
   bottom bar, social links. Underline-hover language for column and
   social links lives in nav.css (shared); this file composes around it. */

.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--hairline);
  /* Phosphor horizon rising behind the sinking wordmark — the ground the
     composition lands on, not featureless black. */
  background:
    radial-gradient(58rem 20rem at 50% 100%, rgba(var(--phosphor-rgb), 0.08), transparent 72%),
    var(--ink);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 1.8fr) repeat(3, 1fr);
  gap: clamp(2rem, 6vw, 7rem);
  padding-top: clamp(3.25rem, 5.5vw, 5.5rem);
  padding-bottom: clamp(2.5rem, 4vw, 4rem);
}

.footer-brand > p {
  max-width: 24rem;
  margin-top: 1.5rem;
  color: var(--muted);
  font-family: var(--body);
  font-size: 0.9rem;
  font-weight: 390;
  line-height: 1.65;
}

.footer-column {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.9rem;
}

.footer-column h2 {
  margin-bottom: 0.7rem;
  color: var(--phosphor);
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Column links use the condensed editorial voice in sentence case and
   quiet weight instead of defaulting to bold UI sans. The phosphor
   underline sweep stays as defined in nav.css. */
.footer-column a {
  color: var(--paper-soft);
  font-family: var(--body);
  font-size: 0.95rem;
  font-weight: 420;
  letter-spacing: 0.005em;
  line-height: 1.25;
  text-transform: none;
}

/* Watermark — the wordmark sinking below the horizon line. Diegetic pixel
   type as material, not decoration; masked so it dissolves into the rail. */
.footer-watermark {
  margin: 0;
  padding-inline: var(--page-gutter);
  color: rgba(var(--paper-rgb), 0.085);
  font-family: var(--display);
  font-size: clamp(3.4rem, 17.5vw, 17rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.78;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(rgb(0 0 0), rgb(0 0 0 / 0.15));
  mask-image: linear-gradient(rgb(0 0 0), rgb(0 0 0 / 0.15));
}

/* A slow phosphor readout sweep passes through the glyphs on the marquee
   clock — the wordmark reads as a lit instrument surface, not dead ink.
   Both endpoints of the loop show flat paper, so the reset is invisible. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .footer-watermark {
    background-image: linear-gradient(
      100deg,
      rgba(var(--paper-rgb), 0.085) 42%,
      rgba(var(--phosphor-rgb), 0.3) 50%,
      rgba(var(--paper-rgb), 0.085) 58%
    );
    background-size: 300% 100%;
    background-position: 100% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: watermark-sweep var(--dur-marquee) var(--ease-linear) infinite;
  }
}

@keyframes watermark-sweep {
  0%,
  56% {
    background-position: 100% 50%;
  }

  86%,
  100% {
    background-position: 0% 50%;
  }
}

/* Meta rail — composed instrument microdetails: coordinates, license,
   timezone, back-to-top. Rewards close reading. */
.footer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem 2.5rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-meta p {
  margin: 0;
}

.back-to-top {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--paper-soft);
  transition: color var(--dur-1) var(--ease-standard);
}

.back-to-top::after {
  position: absolute;
  right: 0;
  bottom: -0.35rem;
  left: 0;
  height: 1px;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  background: var(--phosphor);
  transition: transform var(--dur-2) var(--ease-standard);
}

.back-to-top span {
  transition: transform var(--dur-1) var(--ease-standard);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  color: var(--phosphor);
}

.back-to-top:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.back-to-top:hover span {
  transform: translateY(-2px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 1.4rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--hairline-soft);
  color: var(--muted);
  font-size: 0.72rem;
}

/* Live build status — the sign-off carries a pulsing phosphor readout,
   same status-dot vocabulary as the intake channel. */
.footer-building {
  display: inline-flex;
  align-items: center;
  margin-left: 1.4rem;
  color: var(--paper-soft);
  font-family: var(--display);
  font-size: 0.6rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.footer-building .status-dot {
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.55rem;
  margin-left: 0;
}

/* Social row joins the mono instrument register instead of bold UI sans. */
.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.25rem;
}

.social-links a {
  font-family: var(--display);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.12em;
}

@media (max-width: 980px) {
  .footer-grid {
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 760px) {
  /* Mobile footer is a design: two dense columns, not a long loose scroll. */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 1.5rem;
    padding-top: 3rem;
    padding-bottom: 2.75rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--hairline);
  }

  .footer-column {
    gap: 0.65rem;
  }

  .footer-column h2 {
    margin-bottom: 0.4rem;
  }

  .footer-watermark {
    font-size: 14.25vw;
    letter-spacing: -0.03em;
  }

  .footer-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
  }

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

  .social-links {
    justify-content: flex-start;
    gap: 1rem 1.25rem;
  }
}

@media print {
  .footer-watermark,
  .back-to-top {
    display: none;
  }
}
