/* Scrolling AI-tool logo band.
   One stylesheet for the whole site: the hub imports it (ToolsBand.astro) and the original home pages load a copy
   (public/assets/band.css, written by scripts/sync-band.mjs). Edit this file, not the copy.
   The band is the same blue in light and dark mode on purpose. Every tool is a white chip with its mark in the brand's own colours:
   a white chip keeps black marks (Notion, Cursor, Ollama) and bright ones (Mistral, Hugging Face) equally readable. */

.tb {
  position: relative; isolation: isolate; overflow: hidden; direction: ltr; color: #fff;
  background:
    radial-gradient(55% 170% at 18% -45%, rgb(140 185 255 / .3), transparent 65%),
    linear-gradient(100deg, #0950bb 0%, #2748cf 55%, #4739cc 100%);
  border-block: 1px solid rgb(255 255 255 / .16);
}
.tb *, .tb *::before, .tb *::after { box-sizing: border-box; }

/* faint eight-point star lattice, the same family of pattern as the rest of the site */
.tb::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' fill='none' stroke='%23fff' stroke-opacity='.1'%3E%3Cpath d='M32 0 64 32 32 64 0 32Z'/%3E%3Cpath d='M12 12h40v40H12Z'/%3E%3C/svg%3E") 0 0 / 64px 64px;
}

.tb-view {
  overflow: hidden; padding-block: 1.9rem;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.tb-track { display: flex; width: max-content; animation: tb-run 80s linear infinite; will-change: transform; }
.tb-set { display: flex; flex: none; margin: 0; padding: 0; list-style: none; }
.tb-item {
  display: flex; align-items: center; gap: .65rem; flex: none; margin: 0 .55rem; padding: .5rem 1.25rem .5rem .7rem;
  background: #fff; color: #0b1c44; border-radius: 999px;
  box-shadow: 0 10px 20px -12px rgb(3 14 56 / .75), 0 0 0 1px rgb(255 255 255 / .55);
  font-family: inherit; font-size: 1.0625rem; font-weight: 700; line-height: 1; letter-spacing: .005em; white-space: nowrap;
}
.tb-item--name { padding-inline: 1.25rem; }   /* a tool no icon collection carries: its name alone, never a redrawn logo */
.tb-logo { display: block; flex: none; height: 2rem; width: auto; max-width: 3.4rem; object-fit: contain; }

@keyframes tb-run { to { transform: translateX(-50%); } }   /* two identical sets: moving one set's width loops seamlessly */
.tb[data-paused] .tb-track { animation-play-state: paused; }
@media (hover: hover) { .tb:hover .tb-track { animation-play-state: paused; } }

/* WCAG 2.2.2: anything that moves on its own for more than five seconds needs a way to stop it */
.tb-pause {
  position: absolute; inset-block: 0; inset-inline-end: .9rem; z-index: 2; margin-block: auto;
  display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%;
  border: 1.5px solid rgb(255 255 255 / .55); background: rgb(8 32 112 / .55); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.tb-pause:hover { border-color: #fff; background: rgb(8 32 112 / .8); }
.tb-pause:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tb-pause svg { display: block; }
.tb-pause .i-play { display: none; }
.tb[data-paused] .tb-pause .i-play { display: block; }
.tb[data-paused] .tb-pause .i-pause { display: none; }

@media (max-width: 640px) {
  .tb-view { padding-block: 1.4rem; }
  .tb-item { gap: .5rem; margin-inline: .4rem; padding: .42rem 1rem .42rem .55rem; font-size: 1rem; }
  .tb-item--name { padding-inline: 1rem; }
  .tb-logo { height: 1.7rem; max-width: 2.9rem; }
  .tb-pause { inset-inline-end: .5rem; width: 1.9rem; height: 1.9rem; }
}

/* no motion asked for: a still, centred set of logos and no pause button */
@media (prefers-reduced-motion: reduce) {
  .tb-track { display: block; width: auto; animation: none; }
  .tb-view { -webkit-mask-image: none; mask-image: none; padding-inline: 1.5rem; }
  .tb-set { flex-wrap: wrap; justify-content: center; row-gap: 1.1rem; max-width: 100%; }
  .tb-set[aria-hidden="true"], .tb-pause { display: none; }
}
