/* Site footer. Clay's footer anatomy (clay.global, studied 2026-10-20) rebuilt with our colors, type and pages:
   a dark band where a slow 3D scene sits behind "Let's talk". Clay's scene is one big clay helix turning in place;
   ours is dark clay turning in place (footer.js): Swirl by default, Clay's own sculpture matched to it by measurement (two
   tubes wound together, one dim color, a faint Anchor Blue rim), with twist, loop, blocks, slashes, bubbles and arches as
   alternatives to flip between until one is chosen.
   Since 2026-10-27 it fills the screen and ends every page on an end card (Rahul: "can the footer come up to the full
   viewport (on desktop, phone and other devices)", then his pick of the right-aligned end card, docs in log.md): the middle
   of the screen holds the call to talk (Let's talk, his photo with "Chat with the founder.", Book a call, the email and
   phone), flush right from 1024 px so the clay has the left side, centred below that; the page links, socials and legal
   sit in a bar along the bottom.
   Text fades up when the footer comes into view, and links draw a line on hover, like Clay's.
   Desktop (1024 px and up) gets the 3D scene; smaller screens get the same footer without it, like Clay. */

.site-footer {
  --footer-ease: cubic-bezier(0.16, 1, 0.3, 1); /* ease-out expo, Clay's curve for these fades */
  --footer-ui: cubic-bezier(0.23, 1, 0.32, 1);   /* the site's strong ease-out, for hover, press and the links' line */
  --footer-muted: rgb(250 250 250 / 0.64);       /* 7.9:1 on Night */
  --footer-line: rgb(250 250 250 / 0.2);
  --footer-top: 112px;                           /* clear of the fixed nav bar (16 px + 64 px) */
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  /* At least the whole screen, Safari's toolbar hidden (lvh), so at the end of a page nothing of the page shows above it
     whatever the toolbar does; with the toolbar showing, the extra (lvh - svh) is top padding, out of sight above the screen */
  min-height: 100vh;
  min-height: 100lvh;
  background-color: #0c0e12;
  color: #fafafa;
}
@media (min-width: 1024px) { .site-footer { --footer-top: 136px; } }

/* Cover: at the end of every page the last part of the page holds still and the footer slides up over it like a card, as
   in 21st.dev's smooth-scroll component (ui-layout, kept in ui-components/sections/smooth-scroll.tsx), Rahul's pick,
   2026-10-24. footer.js marks the part that holds ([data-footer-cover]: <main>, the testimonials on the home page), gives
   it --cover-top (where it starts in the page), --cover-h (its height) and --cover-c (the middle of its last part: the reviews
   row on the home page, the last card or row elsewhere), and puts .is-cover on the footer. The part holds once that last part
   reaches the middle of the screen (Rahul, 2026-10-27: "let the reviews marquee scroll up to the middle"), or once its bottom
   meets the bottom of the screen if that comes later, both measured with Safari's toolbar showing (svh) so the toolbar sliding
   away never moves it; on a page shorter than the screen it holds where it starts. Its top corners are square and it has no rim: once
   it covers the screen, nothing of the page above it shows, not even a line (Rahul, 2026-11-16).
   Reduced motion: the footer scrolls in with the page, still a full screen. */
@media (prefers-reduced-motion: no-preference) {
  [data-footer-cover] { position: sticky; top: min(var(--cover-top), calc(100vh - var(--cover-h)), calc(50vh - var(--cover-c))); }
  @supports (height: 100svh) { [data-footer-cover] { top: min(var(--cover-top), calc(100svh - var(--cover-h)), calc(50svh - var(--cover-c))); } }
  .site-footer.is-cover { z-index: 1; box-shadow: 0 -4px 0 0 #0c0e12; }   /* its own color 4 px above its edge: the hold stops a fraction of a pixel short of the top on many screens (0.05 to 0.47 px measured, 2026-11-17), which let a hairline of the page above show (Rahul: "I still see a tiny line") */   /* square top corners (Rahul, 2026-11-16): a full-screen footer shows nothing of the page through them */
}

/* The 3D scene: fills the footer behind the text, never takes clicks. footer.js adds the canvas and .is-ready. */
.site-footer__stage { display: none; position: absolute; inset: 0; z-index: 0; pointer-events: none; }
@media (min-width: 1024px) { .site-footer__stage { display: block; } }
.site-footer__stage canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 1.6s var(--footer-ease) 0.3s; }
.site-footer__stage.is-ready canvas { opacity: 1; }

.site-footer__inner {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--footer-top) 24px 32px;
}
@supports (height: 100svh) { .site-footer__inner { padding-top: calc(var(--footer-top) + 100lvh - 100svh); } }
@media (min-width: 640px) { .site-footer__inner { padding-inline: 32px; } }
@media (min-width: 768px) { .site-footer__inner { padding-inline: 48px; } }
@media (min-width: 1024px) { .site-footer__inner { padding-inline: 56px; padding-bottom: 36px; } }

/* The end card: in the middle of whatever height is left, centred; from 1024 px flush right, every line ending on the column's
   right edge. Its gaps shrink on short screens so it still fits. */
.site-footer__card { display: flex; flex-direction: column; align-items: center; margin-block: auto; padding: 24px 0 clamp(28px, 5vh, 56px); text-align: center; }
@media (min-width: 1024px) { .site-footer__card { align-items: flex-end; text-align: right; } }
.site-footer .site-footer__title { margin: 0; font-size: clamp(4rem, 1.6rem + 10vw, 10rem); }   /* larger than .t-hero: 64 to 160 */
.site-footer__founder { display: flex; align-items: center; gap: 14px; margin-top: clamp(16px, 3vh, 28px); text-align: left; }
.site-footer__founder img { flex: none; width: 52px; height: 52px; border-radius: 9999px; object-fit: cover; }
.site-footer__founder p { margin: 0; }
.site-footer__founder span { display: block; }
.site-footer__founder .t-small { color: var(--footer-muted); }

/* Book a call: the hero's white button. Pages that carry the booking dialog (the contact page, the service pages) open it in
   place (connect.js, data-connect-book); elsewhere the link opens the contact page with the calendar already open (#book). */
.site-footer__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  margin-top: clamp(16px, 3vh, 28px);
  padding: 0 24px 0 28px;
  border-radius: 9999px;
  background-color: #fff;
  color: #171717;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25), 0 4px 16px rgb(0 0 0 / 0.18), inset 0 1px 0 rgb(255 255 255 / 0.9), inset 0 -1px 0 rgb(0 0 0 / 0.08);
  transition: scale 160ms var(--footer-ui), background-color 150ms var(--footer-ui);
}
.site-footer__button svg { width: 20px; height: 20px; color: #404040; }
.site-footer__button:active { scale: 0.97; }   /* scale, not transform, which the entrance below uses */
@media (hover: hover) and (pointer: fine) { .site-footer__button:hover { background-color: #f5f5f5; } }
@media (max-width: 639px) { .site-footer__button { align-self: stretch; } }

.site-footer__contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 32px; margin: clamp(14px, 2.6vh, 28px) 0 0; }
@media (min-width: 1024px) { .site-footer__contact { justify-content: flex-end; } }
@supports (height: 100svh) {
  .site-footer__card { padding-bottom: clamp(28px, 5svh, 56px); }
  .site-footer__founder, .site-footer__button { margin-top: clamp(16px, 3svh, 28px); }
  .site-footer__contact { margin-top: clamp(14px, 2.6svh, 28px); }
}

/* The bar along the bottom: the pages in a row (two columns on phones), then the socials and the legal line */
.site-footer__bar { display: grid; gap: 20px; padding-top: 28px; border-top: 1px solid rgb(250 250 250 / 0.12); }
.site-footer__nav ul { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 639px) { .site-footer__nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; } }
.site-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
@media (max-width: 639px) { .site-footer__bottom { flex-direction: column; align-items: flex-start; } }

.site-footer__social { display: flex; gap: 8px; margin: 0 0 0 -10px; padding: 0; list-style: none; }
.site-footer__social a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9999px; color: rgb(250 250 250 / 0.8); transition: color 150ms var(--footer-ui); }
.site-footer__social svg { width: 20px; height: 20px; fill: currentColor; }
/* Five icons (the Google reviews link came off 2026-11-14 until client reviews are on the profile): on the narrowest phones they close up so the last one stays inside the gutter */
@media (max-width: 359px) { .site-footer__social { gap: 0; } }

.site-footer__legal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0; color: var(--footer-muted); }
.site-footer__legal a { color: var(--footer-muted); }
/* Narrow phones: the © line takes a row of its own, so the three links stay together instead of leaving one behind */
@media (max-width: 479px) { .site-footer__legal > span:first-child { flex-basis: 100%; } }
/* Phones: bigger tap targets without moving the links (padding that a negative margin takes back): the page links 34 px tall, the
   legal links 33, the email and the phone 44; the rows' gaps open just enough that no two targets overlap */
@media (max-width: 639px) {
  .site-footer__nav a { display: inline-block; padding-block: 3px; margin-block: -3px; }
  .site-footer__legal a { display: inline-block; padding-block: 5px; margin-block: -5px; }
  .site-footer__legal { row-gap: 12px; }
  .site-footer__contact { row-gap: 16px; }
  .site-footer__contact a { display: inline-block; padding-block: 8px; margin-block: -8px; }
}

/* Links: a faint line under each one; on hover a bright line draws in from the left and leaves to the right */
.site-footer a { text-decoration: none; }
.site-footer__link { color: inherit; }
.site-footer__link > span { position: relative; }
.site-footer__link > span::before,
.site-footer__link > span::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; }
.site-footer__link > span::after { background-color: var(--footer-line); }
.site-footer__link > span::before { z-index: 1; background-color: currentColor; transform: scaleX(0); transform-origin: right center; transition: transform 250ms var(--footer-ui); }
.site-footer__link--plain > span::after { content: none; }
@media (hover: hover) and (pointer: fine) {
  .site-footer__link:hover > span::before { transform: scaleX(1); transform-origin: left center; }
  .site-footer__social a:hover { color: #fafafa; }
}
.site-footer__link:focus-visible > span::before { transform: scaleX(1); transform-origin: left center; }
.site-footer a:focus-visible { outline: 2px solid #fafafa; outline-offset: 4px; border-radius: 4px; }
.site-footer .site-footer__button:focus-visible { border-radius: 9999px; }

/* Home page, phones: the pinned Let's talk bar steps aside once the end card's button is on screen, so one button shows
   (footer.js sets data-footer-near); it fades out, and comes back at once when the card leaves */
html[data-footer-near] [data-motion="cta-bar"] { opacity: 0 !important; visibility: hidden; pointer-events: none; transition: opacity 160ms ease, visibility 0s linear 160ms; }

/* Entrance: hidden only when scripts run (footer.js adds .is-in), so without scripts everything shows */
.js .site-footer [data-reveal] { opacity: 0; transition: opacity 1.6s var(--footer-ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js .site-footer [data-reveal="rise"] { transform: translateY(14px); transition: opacity 0.9s var(--footer-ease), transform 1.2s var(--footer-ease); transition-delay: calc(var(--i, 0) * 60ms); }
.js .site-footer.is-in [data-reveal] { opacity: 1; transform: none; }
/* the button rises in like the rest and keeps its own press and hover timing */
.js .site-footer .site-footer__button[data-reveal="rise"] { transition: opacity 0.9s var(--footer-ease), transform 1.2s var(--footer-ease), scale 160ms var(--footer-ui), background-color 150ms var(--footer-ui); transition-delay: calc(var(--i, 0) * 60ms), calc(var(--i, 0) * 60ms), 0s, 0s; }
@media (prefers-reduced-motion: reduce) {
  .js .site-footer [data-reveal],
  .js .site-footer [data-reveal="rise"] { transform: none; transition: opacity 0.2s ease; transition-delay: 0s; }
  .site-footer__stage canvas { transition: opacity 0.2s ease; }
  .site-footer__link > span::before { transition: none; }
  .js .site-footer .site-footer__button[data-reveal="rise"] { transition: opacity 0.2s ease, background-color 150ms var(--footer-ui); }
  .site-footer .site-footer__button:active { scale: none; opacity: 0.85; }   /* the press is a fade, not a scale */
}


/* The chat's corner. The chat widget's 58 px button sits at the bottom right of every page with this footer (chat.js, which
   footer.js adds). It is a layer of its own: nothing moves when it arrives, because its corner is free from the start, chat
   or no chat. On phones the pinned "Book a call" ends 66 px from the edge, the button plus an 8 px gap (--chat-slot, read by
   phone-bar.css and the home page's bar). From 640 px this footer's last row keeps 44 px on the right ("Sitemap" sat under
   the button at the end of every page). From 1024 px the home page's review block does the same; a margin, not a transform:
   the block's entrance animates its transform. */
@media (max-width: 767.98px) { html { --chat-slot: 66px; } }
@media (min-width: 640px) { .site-footer__bottom { padding-right: 44px; } }
@media (min-width: 1024px) { [data-motion="tagline"] { margin-right: 44px; } }
