/* ============================================================
   KompanyOS — site footer (3 Sided Cube design language)
   Owned separately from the hero engine. Linked per page; do NOT
   fold into hero.css. One ink band that reads the same on the light,
   dark and green grounds. Relies on each page's :root brand vars
   (--font --mono --green --pink --ink --black --white) with hard-coded
   fallbacks so it stands alone (e.g. inside the styles.html styleguide,
   which uses its own --cube-* tokens).

   The contact card (.ft-card) mirrors the 3SC footer's vision card
   (3sc-website → components/extensive/(beta)/Footer/VisionCard.tsx): a tilted,
   black-bordered card that sits proud of the footer's top edge, green-dot panel
   with the question, white panel with the action. Ours asks about seeing
   KompanyOS on your own systems and lands on contact.html.

   Placement on the experience pages: sits after .spacer in the DOM.
   The Grind window is position:fixed (z-index 20); this footer is
   position:relative with a higher z-index and an opaque ground, so on
   the last stretch of scroll it slides up and covers the pinned window
   — the page's natural sign-off. No hero.js / hero.css changes.
   ============================================================ */

.site-footer {
  position: relative;
  z-index: 30;
  /* The contact card hangs ~55px above the footer's top edge (its pull-up plus
     what the tilt adds), so the band needs clear air above it or the card lands
     on whatever the page ends with. Belongs here, not on the pages: it's the
     component's own requirement. Collapses with the previous sibling's own
     bottom margin, so a page that already leaves a gap doesn't get two. */
  margin-top: clamp(88px, 7vw, 120px);
  --ft-green: var(--green, #00ed71);
  --ft-white: var(--white, #fff);
  --ft-font: var(--font, 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif);
  --ft-mono: var(--mono, 'Anonymous Pro', ui-monospace, monospace);

  color: var(--ft-white);
  font-family: var(--ft-font);
  /* The dark GRID ground, on the site's shared 40px cell — the same recipe
     dark.html gives its body, so the closing band reads as the page's own
     ground gone dark rather than a separate dotted panel. Falls back to the
     cell/width values when hero.css isn't on the page. */
  background-color: #0a0a0a;
  --ft-grid-line: rgba(255, 255, 255, 0.07);   /* a shade up from dark.html's .05: a 1px line reads fainter than the dot it replaces */
  background-image:
    linear-gradient(var(--ft-grid-line) var(--grid-line-w, 1px), transparent 0),
    linear-gradient(90deg, var(--ft-grid-line) var(--grid-line-w, 1px), transparent 0);
  background-size:
    var(--grid-cell, 40px) var(--grid-cell, 40px),
    var(--grid-cell, 40px) var(--grid-cell, 40px);
  border-top: 4px solid var(--ft-green);
}

.site-footer * { box-sizing: border-box; }

.ft-inner {
  --ft-pad-top: clamp(48px, 7vh, 84px);
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--ft-pad-top) clamp(24px, 5vw, 64px) clamp(36px, 5vh, 58px);
}

/* ---------- Top row: link columns on the left, contact card on the right ----------
   .ft-no-card is the enquiry page: it already IS the call to action, so the
   card would just repeat it. Everything else about the footer is identical. */
.site-footer.ft-no-card .ft-top { grid-template-columns: minmax(0, 1fr); }
/* with no card on the right, spread the columns across the band rather than
   leaving a card-shaped hole where one used to be */
.site-footer.ft-no-card .ft-cols { justify-content: space-between; }
.site-footer.ft-no-card .ft-brand-col { flex-grow: 0; }

.ft-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: clamp(28px, 3.6vw, 48px);
  align-items: start;
}

/* ---------- Link columns ---------- */
/* A row of columns rather than a fixed grid: pages carry one or two link
   columns depending on what they have to link to, and both should sit tight
   under the brand block rather than stretching to fill a 4-track grid. */
.ft-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 32px clamp(28px, 3vw, 44px);
}
.ft-col { min-width: 132px; }

.ft-brand-col { flex: 1 1 220px; max-width: 32ch; }
.ft-logo {
  height: 26px;
  width: auto;
  display: block;
  margin-bottom: 18px;
  /* solid-black wordmark → knock out to white on the ink band */
  filter: brightness(0) invert(1);
}
.ft-tagline {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

.ft-col-label {
  font-family: var(--ft-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--ft-green);
  margin-bottom: 16px;
}
.ft-col ul { list-style: none; margin: 0; padding: 0; }
.ft-col li { margin-bottom: 11px; }
.ft-col a {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  transition: color .15s ease;
}
.ft-col a:hover { color: var(--ft-green); }

/* ---------- Contact card (the 3SC footer's vision card, our subject) ----------
   Tilted, hard-bordered, hard-shadowed, and pulled up by the footer's own top
   padding plus a little more so it sits PROUD of the green top border — the same
   move 3SC makes with `-top-7`. Sized in the grid track, so it never has to
   guess the column width. */
.ft-card {
  display: block;
  position: relative;
  margin-top: calc((var(--ft-pad-top) + 34px) * -1);
  border: 3px solid var(--cube-black, #000);
  border-radius: var(--cube-radius-s, 8px);
  box-shadow: var(--cube-shadow-m, 4px 4px 0 0 rgba(0, 0, 0, 1));
  overflow: hidden;                 /* clips the sticker to the card, like the source */
  /* Everything inside is sized in cqw: "YOUR SYSTEMS?" is a long word-pair in a
     900-weight uppercase face, and it has to hold ONE line at every card width
     the layout produces. vw can't do that — the card's width and the viewport's
     don't track each other once it reflows. */
  container-type: inline-size;
  color: #0a0a0a;
  text-decoration: none;
  transform: rotate(6deg);
  transition: transform .3s ease;
}
.ft-card:hover,
.ft-card:focus-visible { transform: rotate(0deg); }
.ft-card:focus-visible { outline: 3px solid var(--ft-green); outline-offset: 4px; }

/* top panel — the question, on the house green dot ground (values from
   3sc-website/src/styles/backgrounds.css `bg-green-dot-pattern`) */
.ft-card-top {
  position: relative;
  z-index: 1;                       /* so the sticker spills OVER the white panel */
  padding: clamp(16px, 7cqw, 30px);
  /* extra room under the question so the sticker has somewhere to sit without
     landing on the letters — the source's phone clears "VISION?" the same way */
  padding-bottom: clamp(26px, 10cqw, 44px);
  border-bottom: 3px solid var(--cube-black, #000);
  background-color: var(--cube-pink, var(--pink, #f70087));
  background-image:
    radial-gradient(#00000026 1.5px, transparent 1.5px),
    radial-gradient(#00000026 1.5px, transparent 1.5px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
}
.ft-card-q {
  margin: 0;
  /* 1.06 packed the marker's block straight up against the line above it —
     an inline background paints the font's content area, so the only thing
     that separates it from the previous line is the leading. */
  font: 900 clamp(19px, 7.8cqw, 32px)/1.28 var(--ft-font);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ft-white);           /* on the pink; the marked line flips back to ink */
}
.ft-card-hl { color: #0a0a0a; }
/* The marker under the second line — brand yellow on the pink.
   An INLINE-BLOCK with its own line-height, not a plain inline: an inline
   background paints the font's content area, and Poppins' is ~1.83em, far
   taller than any sane leading — so the marker's block ran up behind the line
   above it whatever we set. A block box hugs the cap height instead, which is
   also how the source does it (a div around the h3, not a span behind it). */
.ft-card-hl {
  display: inline-block;
  line-height: 1;
  padding: .13em .16em .17em;       /* the bottom is descender room for "y" */
  margin-left: -.16em;
  background: var(--cube-yellow, var(--yellow, #ffd100));
}
.ft-card-sticker {
  position: absolute;
  right: -14px;
  bottom: -26px;
  width: clamp(80px, 27cqw, 112px);
  height: auto;
  transform: rotate(-8deg);
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* bottom panel — the action */
.ft-card-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(13px, 5.2cqw, 24px) clamp(16px, 7cqw, 30px);
  background: var(--ft-white);
}
.ft-card-action {
  font: 900 clamp(16px, 7cqw, 28px)/1.1 var(--ft-font);
  text-transform: uppercase;
  color: #0a0a0a;
}
.ft-card-arrow {
  width: clamp(20px, 7cqw, 30px);
  height: auto;
  flex: none;
  transition: transform .2s ease;
}
.ft-card:hover .ft-card-arrow { transform: translateX(4px); }

/* ---------- Bottom bar (mono, mirrors 3SC's legal row) ----------
   Its own solid-black band, full width, sitting under the grid ground, with a
   rule across the whole width — not inset to the content measure like the old
   1px hairline was. 3SC's FooterBar does the same thing in white, at 3px. */
.ft-bottom {
  background: #000;
  border-top: 3px solid rgba(255, 255, 255, 0.22);
  padding: clamp(20px, 2.8vh, 30px) clamp(24px, 5vw, 64px);
  font-family: var(--ft-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.5);
}
.ft-bottom-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
}
.ft-bottom .ft-kos { color: var(--ft-green); font-weight: 700; }
.ft-bottom a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color .15s ease;
}
.ft-bottom a:hover { color: var(--ft-white); }
.ft-bottom-left { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; }
.ft-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* Policy links — the same four 3SC pages its own footer bar links, underlined
   the way it underlines them (3sc-website → Footer/FooterBar.tsx). */
.ft-policies { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ft-policies a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
/* Below the two-column split the card goes FIRST and full width, still proud of
   the top edge — the same reordering 3SC does with its landscape card. Its tilt
   flips the other way so the pull-up doesn't leave a wedge of ground showing. */
@media (max-width: 1120px) {
  .ft-top { grid-template-columns: minmax(0, 1fr); gap: clamp(34px, 6vw, 52px); }
  .ft-card {
    order: -1;
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
    transform: rotate(-3deg);
  }
}
@media (max-width: 860px) {
  .ft-cols { gap: 30px 40px; }
  .ft-brand-col { flex-basis: 100%; }
}
@media (max-width: 560px) {
  .ft-cols { flex-direction: column; }
  .ft-bottom-inner { flex-direction: column; align-items: flex-start; }
  /* a smaller overlap on a phone: the card is nearly the screen's width, so a
     deep pull-up starts eating the section above it */
  .ft-card { margin-top: calc((var(--ft-pad-top) + 10px) * -1); }
}

/* respect the engine's reduced-motion fallback: static flow, no overlay tricks */

