/* ============================================================
   Haxfer — shared site footer
   One implementation for the landing page and every content page,
   so the bottom of the site matches the top.

   Self-contained: uses --page-width / --u when the page defines them
   (landing page poster scaling), otherwise fixed 1440px / 1px.
   ============================================================ */

.site-foot {
  --f-u: var(--u, 1px);
  --f-max: var(--page-width, var(--shell-max, 1920px));
  --f-pad: var(--shell-pad, calc(80 * var(--f-u)));
  --f-ink: #0b0d12;
  --f-heading: #263247;
  --f-muted: #495566;
  --f-dim: #57606d;   /* 4.9:1 on the footer aurora; #8b929c was 2.4:1 */
  --f-accent: #2f6bff;
  --f-line: rgba(10, 11, 13, 0.08);
  --f-font: var(--font-inter, var(--sans, "Inter", -apple-system, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif));
  --f-mono: var(--font-fragment-mono, var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace));

  position: relative;
  overflow: clip;
  padding-top: calc(40 * var(--f-u));
  color: var(--f-ink);
  font-family: var(--f-font);
  background: transparent;
}

/* Padding ladder must match the header (nav.css) so the footer logo sits on
   the same vertical line as the nav logo at every width. On the landing page
   --shell-pad is undefined, so the fallback scales with the poster unit. */
@media (width <= 1200px) { .site-foot { --f-pad: var(--shell-pad, calc(48 * var(--f-u))); } }
@media (width <= 900px) { .site-foot { --f-pad: var(--shell-pad, calc(32 * var(--f-u))); } }
@media (width <= 580px) { .site-foot { --f-pad: var(--shell-pad, calc(20 * var(--f-u))); } }

/* Bottom glow: the same three blobs the landing page animates on canvas,
   rendered as static gradients so content pages need no extra JS. */
/* The page backdrop is fixed, so its blooms sit behind the footer too. Fade
   them out here: the footer has its own aurora, and 13px mono text needs a
   calm ground (the raw blooms drop that text to ~2.4:1). */
.site-foot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(246, 247, 250, 0.55) 0%,
    rgba(246, 247, 250, 0.88) 45%,
    rgba(246, 247, 250, 0.95) 100%
  );
}

.sf-aurora {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  height: calc(620 * var(--f-u));
  pointer-events: none;
  background-image:
    radial-gradient(38% 62% at 18% 60%, rgba(76, 141, 255, 0.30), rgba(76, 141, 255, 0.10) 46%, transparent 72%),
    radial-gradient(32% 54% at 52% 74%, rgba(53, 224, 255, 0.20), rgba(53, 224, 255, 0.07) 46%, transparent 72%),
    radial-gradient(36% 60% at 84% 56%, rgba(120, 86, 255, 0.24), rgba(120, 86, 255, 0.08) 46%, transparent 72%);
}

.sf-inner {
  position: relative;
  z-index: 2;
  max-width: var(--f-max);
  margin-inline: auto;
  padding: 0 var(--f-pad);
}

.sf-top {
  display: flex;
  justify-content: space-between;
  gap: calc(48 * var(--f-u));
  padding: calc(48 * var(--f-u)) 0 calc(64 * var(--f-u));
}

.sf-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: calc(360 * var(--f-u));
}
.sf-logo { display: block; }
.sf-logo img { display: block; height: calc(40 * var(--f-u)); width: auto; }
.sf-tagline {
  margin: 0;
  color: var(--f-dim);
  font-size: clamp(13px, 1.05vw, 16px);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-wrap: pretty;
}
:lang(en) .sf-tagline { letter-spacing: 0.015em; }

.sf-cols { display: flex; gap: calc(72 * var(--f-u)); }
.sf-col .h {
  margin: 0 0 12px;
  color: var(--f-heading);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.sf-col ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sf-col a {
  display: block;
  color: var(--f-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  text-decoration: none;
  transition: color 150ms ease;
}
.sf-col a:is(:hover, :focus-visible) { color: var(--f-accent); }

.sf-word {
  display: block;
  width: min(calc(560 * var(--f-u)), 74vw);
  height: auto;
  margin: 0 auto;
  padding-bottom: calc(24 * var(--f-u));
  -webkit-mask-image: linear-gradient(to bottom, #000 26%, rgba(0, 0, 0, 0.12) 96%);
  mask-image: linear-gradient(to bottom, #000 26%, rgba(0, 0, 0, 0.12) 96%);
}

.sf-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: calc(24 * var(--f-u)) 0 calc(40 * var(--f-u));
  border-top: 1px solid var(--f-line);
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 20px;
  color: var(--f-dim);
}
.sf-bottom .r { display: flex; flex-wrap: wrap; gap: 24px; }
.sf-bottom a { color: var(--f-dim); text-decoration: none; }
.sf-bottom a:hover { color: var(--f-accent); }

@media (width <= 900px) {
  .sf-top { flex-direction: column; gap: 32px; }
  .sf-cols { gap: 40px; flex-wrap: wrap; }
  .sf-word { width: min(calc(420 * var(--f-u)), 74vw); }
}
@media (width <= 580px) {
  .sf-cols { gap: 28px; }
  .sf-word { width: min(calc(240 * var(--f-u)), 72vw); }
  .sf-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}
