/* Site footer, shared by every page (footer.js does the moving parts).

   The page above appears to curve down into a solid dark footer. Everything is
   drawn as background layers so the corners stay see-through to whatever is
   above it. footer.js sets:
     --pull       0 → 1 as the footer scrolls in: deepens the curve, brightens the glow
     --lift       curtain reveal: the contents hold still while the edge uncovers them
     --glow       this page's colour (see the table in footer.js)
   The footer overlaps the page above by the curve's height, so the real content
   (not a flat fill) shows past the corners. */

footer.footer {
  --pull: 0;
  --glow: #2997ff;
  --lip-max: clamp(24px, 3.4vw, 48px);
  --lip: calc(var(--lip-max) * (.35 + var(--pull) * .65));   /* corner radius */
  --off: calc(var(--lip-max) - var(--lip));                   /* corners sit on the band's fixed top edge */
  --foot: #0d0d0f;
  --edge: rgb(255 255 255 / .2);                               /* hairline along the curve, like the glass nav */
  --black: #f5f5f7; --ink: #f5f5f7; --mid: rgb(255 255 255 / .82); --muted: rgb(255 255 255 / .82);
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  /* Tuck the curved top band up over the end of the page above, so whatever is
     really there (a gradient, an image, a video) shows past the corners instead
     of a flat strip of page colour. The band itself lets clicks through. */
  margin: calc(-1 * var(--lip-max)) 0 0;
  pointer-events: none;
  padding: 0 0 env(safe-area-inset-bottom, 0px);   /* the name runs off the page's bottom edge */
  border: 0; border-radius: 0;
  color: var(--mid);
  background:
    /* concave corners, with the hairline traced just inside the curve. Each runs 2px
       past the page edge and into the fill below, so fractional sizes never leave a
       sliver of the page above showing through. */
    radial-gradient(circle at 100% 0, transparent calc(var(--lip) - 1.25px), var(--edge) calc(var(--lip) - .75px), var(--edge) calc(var(--lip) - .25px), var(--foot) calc(var(--lip) + .25px))
      -2px var(--off) / calc(var(--lip) + 2px) calc(var(--lip) + 2px) no-repeat,
    radial-gradient(circle at 0 0, transparent calc(var(--lip) - 1.25px), var(--edge) calc(var(--lip) - .75px), var(--edge) calc(var(--lip) - .25px), var(--foot) calc(var(--lip) + .25px))
      right -2px top var(--off) / calc(var(--lip) + 2px) calc(var(--lip) + 2px) no-repeat,
    /* hairline along the straight top edge, on the same 1px row the corner rings end on */
    linear-gradient(var(--edge), var(--edge))
      var(--lip) calc(var(--lip-max) - 1px) / calc(100% - 2 * var(--lip)) 1px no-repeat,
    /* this page's glow, rising from the bottom edge */
    radial-gradient(ellipse 55% calc(22% + var(--pull) * 14%) at 50% 106%,
      color-mix(in oklab, var(--glow) calc(8% + var(--pull) * 14%), transparent),
      color-mix(in oklab, var(--glow) 3%, transparent) 55%, transparent 75%)
      0 var(--lip-max) / 100% calc(100% - var(--lip-max)) no-repeat,
    linear-gradient(var(--foot), var(--foot))
      0 var(--lip-max) / 100% calc(100% - var(--lip-max)) no-repeat;
  /* A footer-coloured shadow below, so a trackpad/phone bounce past the end shows
     more footer. Shadows don't lengthen the page or paint inside the lip. */
  box-shadow: 0 50lvh 0 50lvh var(--foot);
  text-shadow: none;
}
/* ask.css pads the footer 72px on phones to keep the Ask pill off the links; the
   links now sit well above it and the pill floats over the decorative name instead. */
body:has(#ask) footer.footer { padding-bottom: env(safe-area-inset-bottom, 0px); }
footer.footer,
footer.footer p { line-height: 1.3; }

/* Curtain reveal: the footer scrolls in as usual, but its contents hold still on
   screen and are uncovered as the curved edge rises past them. */
footer.footer > * { pointer-events: auto; }
footer.footer > .container {
  overflow: clip;
  flex: 1;
  display: flex; flex-direction: column;
  margin-top: var(--lip-max);
  padding-top: 48px;   /* breathing room under the curve */
}
footer.footer .footer__inner { width: 100%; }
footer.footer .footer__inner,
footer.footer .footer__mark {
  transform: translateY(calc(-1 * var(--lift, 0px)));
  opacity: calc(.35 + var(--pull) * .65);
}

/* The giant name below says who this is: drop the small label, let the tagline lead. */
footer.footer .footer__logo { display: none; }
footer.footer .footer__tagline { margin: 0; color: var(--black); font-size: .95rem; font-weight: 600; }
footer.footer .footer__careers { color: var(--black); }

/* Giant name, kept quiet: a 1px outline rising from the very bottom of the page,
   its lower quarter cut off by the footer's bottom edge (like Fleetline). */
.footer__mark {
  container-type: inline-size;
  margin: 28px 0 0;
  overflow: clip;   /* the page's bottom edge cuts the letters */
  user-select: none; pointer-events: none;
  font-family: var(--serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif); font-weight: 600;
  line-height: .9; letter-spacing: -.05em; white-space: nowrap;
}
.footer__mark > span {
  display: inline-block;   /* shrink-wraps the text so footer.js can measure and fit it */
  font-size: 16cqi;        /* first guess; footer.js fits it to the exact width */
  vertical-align: top;
  line-height: 1.1;                     /* full room above, so only the bottom is cut */
  text-box: trim-end cap alphabetic;    /* box ends at the baseline */
  /* Sink the word past the bottom edge by ~25% of its cap height (caps are ~.72em).
     The negative margin keeps its top where it was; the translate moves it down. */
  --sink: .18em;
  margin-top: calc(-1 * var(--sink));
  translate: 0 var(--sink);
  -webkit-text-fill-color: transparent; color: transparent;
  -webkit-text-stroke: 1px rgb(255 255 255 / .2);
}

/* Links: a line that grows in from the left, and (desktop) letters that roll up. */
footer.footer .footer__link { color: var(--mid); }
footer.footer .footer__link,
footer.footer .footer__careers { position: relative; text-decoration: none; }
footer.footer .footer__link::after,
footer.footer .footer__careers::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
}
footer.footer .footer__link:hover,
footer.footer .footer__careers:hover { color: #fff; text-decoration: none; }
footer.footer .footer__link:hover::after,
footer.footer .footer__careers:hover::after { transform: scaleX(1); transform-origin: left; }
.footer .sr-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.footer .roll { white-space: pre; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .footer .roll { display: inline-flex; overflow: hidden; vertical-align: top; }
  .footer .roll > span { position: relative; display: inline-block;
    transition: transform .5s cubic-bezier(.22, 1, .36, 1) calc(var(--i) * 18ms); }
  .footer .roll > span::after { content: attr(data-c); position: absolute; top: 100%; left: 0; }
  .footer a:is(:hover, :focus-visible) .roll > span { transform: translateY(-100%); }
}

/* Phones: one line instead of a tall stack (Careers on the left, the three links
   as icons on the right), and tighter gaps. The tagline is dropped and the link
   labels shrink to nothing, but stay in the DOM so screen readers still say them. */
@media (max-width: 640px) {
  footer.footer > .container { padding-top: 22px; }
  footer.footer .footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  footer.footer .footer__inner > div:first-child { display: flex; align-items: baseline; gap: 14px; min-width: 0; white-space: nowrap; }
  footer.footer .footer__tagline { display: none; }
  footer.footer .footer__careers { margin: 0; }
  footer.footer .footer__links { flex-direction: row; align-items: center; gap: 2px; }
  footer.footer .footer__link { font-size: 0; gap: 0; justify-content: center; width: 40px; height: 40px; border-radius: 50%; }   /* finger-sized tap targets */
  footer.footer .footer__link svg { width: 18px; height: 18px; }
  footer.footer .footer__link::after { display: none; }
  footer.footer .footer__link:hover { background: rgb(255 255 255 / .14); }
  .footer__mark { margin-top: 10px; }
  .footer__mark > span { line-height: .95; }
}
