/* Used by: who works with FYBY.
   The turn-taking is adapted from "Infinite CSS Logo Marquee" by Jhey Tompkins
   (https://codepen.io/jh3y/pen/RNwyqpL). Copyright (c) 2026 Jhey. MIT licence: /lab/used-by.LICENSE.txt.
   As in the original, each cell holds its logos in one place and they take turns. The marks stand free on the
   black page: no frame, no plate. A logo arrives by brightening into place (a flare of warm light behind it,
   then the mark, rising a few pixels) and leaves by rising out. Only opacity and transform ever change, so the
   turn is carried by the compositor and stays smooth. */
.ub { padding-block: clamp(30px, 3.6vw, 60px); }
.ub-frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px clamp(24px, 4vw, 72px);
}
.ub-title {
  max-width: 13ch;
  margin: 0;
  color: var(--peach-dim);
  font: var(--title-s);
  letter-spacing: var(--title-track);
}
.ub-sprite { position: absolute; width: 0; height: 0; }

.ub-marquee {
  /* One unit of a mark's height: a pixel, and a little more on a big monitor. */
  --u: clamp(1px, .8px + .021vw, 1.42px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 40px);
}
.ub-slot,
.ub-logo {
  position: relative;
  display: grid;
  grid-template: 1fr / 1fr;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ub-slot { height: calc(60 * var(--u)); }
.ub-logo { grid-area: 1 / 1; place-items: center; }
.ub-mark,
.ub-flare { grid-area: 1 / 1; display: grid; place-items: center; width: 100%; }
.ub-logo svg {
  display: block;
  width: auto;
  max-width: min(78%, 190px);
  height: calc(var(--h) * var(--u));
  fill: currentColor;
  overflow: visible;
}
.ub-mark { color: var(--pearl); }
/* The flare is a soft copy of the mark in the halo's orange. Its blur never changes, only its opacity. */
.ub-flare { color: var(--filament-halo); filter: blur(7px); opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .ub-mark, .ub-flare { animation: ub-turn var(--cycle) linear var(--delay) infinite both; }
  .ub-flare { animation-name: ub-flare; }
}
/* Still: every mark in its own place, eight in two rows. */
@media (prefers-reduced-motion: reduce) {
  .ub-slot { display: contents; }
  .ub-logo { grid-area: auto; height: calc(56 * var(--u)); }
  .ub-flare { display: none; }
}

/* Two logos to a cell. One rises out, and only then does the other arrive: first its flare, then the mark. */
@keyframes ub-turn {
  0%, 48.5% { opacity: 0; transform: translate3d(0, 12px, 0) scale(.975); animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
  58%, 92% { opacity: 1; transform: none; animation-timing-function: cubic-bezier(.5, 0, .75, .25); }
  98%, 100% { opacity: 0; transform: translate3d(0, -10px, 0) scale(.985); }
}
@keyframes ub-flare {
  0%, 48.5% { opacity: 0; transform: translate3d(0, 12px, 0) scale(.975); animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
  52% { opacity: .8; animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
  66%, 100% { opacity: 0; transform: none; }
}

/* The NVIDIA lockup is NVIDIA's own file, shown as supplied, with clear space round it. */
.ub-partner {
  display: grid;
  gap: 9px;
  justify-items: start;
  margin: 0;
  padding: 6px 0 6px clamp(24px, 4vw, 72px);
  border-left: 1px solid var(--hairline);
}
.ub-partner img { display: block; width: clamp(172px, 13vw, 240px); height: auto; }
.ub-partner span { color: var(--peach-dim); font: 400 12.5px/1.35 var(--sans); }

@media (max-width: 1080px) {
  .ub-frame { grid-template-columns: minmax(0, 1fr); }
  .ub-title { max-width: none; }
  .ub-partner {
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
    gap: 16px;
    padding: 20px 0 0;
    border-top: 1px solid var(--hairline);
    border-left: 0;
  }
}
@media (max-width: 640px) {
  .ub-marquee { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 6px; }
  .ub-partner { grid-auto-flow: row; gap: 10px; }
}
