/* TSP homepage, hero: the client-logo marquee band (th-marquee). v3, proof track.
   A full-width band at the foot of section#hero: the label "Clients and collaborators" on the hero's text column, then
   the logos in a slow, seamless loop, faded at both edges. The track holds three identical lists and moves left by
   exactly one list (transform only, on the compositor), so the loop has no seam at any screen width up to two lists
   (about 3400px). Every logo, the last included, has the same space after it, which is what makes the join exact.
   It pauses under the pointer, on keyboard focus of the band and on a tap (no Pause button: the owner, 2026-11-26).
   Off screen and in a hidden tab it is paused, and the stops and starts are eased (marquee.js). Without the script the CSS loop
   still runs and still pauses on hover. Under prefers-reduced-motion it is one static, centred set of logos.
   The logos: the live site's files with their transparent margins trimmed (assets/logos/trim/, pixels unchanged),
   each sized by --h (its height in px on desktop) so they match optically: a wide wordmark sits lower than a compact
   mark, a dense one smaller than a light one. One tone: every logo is drawn white at 60% opacity.
   No layout shift: the logo row's height is fixed here and every <img> has width and height attributes.
   Needs tokens.css. Every rule is scoped under .th-marquee, except the hero's own layout rules at the end, which apply
   only while the band is in the hero (.th-hero:has(> .th-marquee)). */

.th-marquee {
  --mq-k: 1;                          /* logo scale on this screen size: a logo is (--h × --mq-k) px tall */
  --mq-gap: 64px;                     /* space after every logo */
  --mq-row: 56px;                     /* height of the logo row */
  --mq-dur: 56s;                      /* one list (about 1720px on desktop) per loop: about 31 px/s */
  --mq-fade: clamp(40px, 9vw, 168px); /* edge fade, each side */
  position: relative;
  width: 100%;
  min-width: 0;
  color: var(--text-3);
}
.th-marquee,
.th-marquee *,
.th-marquee *::before,
.th-marquee *::after { box-sizing: border-box; }
.th-marquee .th-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* The label row sits on the hero's text column (same wrap and gutter); the Pause button at its right end. */
.th-marquee__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 28px; max-width: var(--wrap); margin: 0 auto 14px; padding: 0 var(--gutter); }   /* min-height: the button's, so showing it moves nothing */
.th-marquee__label { margin: 0; font: 500 14px/1.4 var(--f-body); letter-spacing: 0; color: var(--text-3); }

/* No Pause button (the owner, 2026-11-26): the band itself is focusable, and keyboard focus holds it still. */
.th-marquee__viewport:focus { outline: none; }
.th-marquee__viewport:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; border-radius: 8px; }
/* The moving strip: full width, faded at both edges. */
.th-marquee__viewport { position: relative; height: var(--mq-row); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--mq-fade), #000 calc(100% - var(--mq-fade)), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 var(--mq-fade), #000 calc(100% - var(--mq-fade)), transparent 100%); }
.th-marquee__track { display: flex; width: max-content; height: 100%; animation: th-marquee-loop var(--mq-dur) linear infinite; will-change: transform; }
.th-marquee__list { display: flex; flex: none; align-items: center; height: 100%; margin: 0; padding: 0; list-style: none; }
.th-marquee__item { display: flex; flex: none; align-items: center; margin: 0 var(--mq-gap) 0 0; padding: 0; }
.th-marquee__logo { display: block; width: auto; max-width: none; height: calc(var(--h, 28) * var(--mq-k) * 1px); filter: brightness(0) invert(1); opacity: .6; transition: opacity .3s ease; -webkit-user-drag: none; user-select: none; }
.th-marquee__item:hover .th-marquee__logo { opacity: .95; }
@keyframes th-marquee-loop { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(calc(-100% / 3), 0, 0); } }

/* Pausing. With marquee.js the animation is driven through the Web Animations API (eased stops); these cover the
   cases without it: no script (hover pauses), or a browser without getAnimations (the script toggles .is-held). */
.th-marquee:not(.is-js) .th-marquee__viewport:hover .th-marquee__track,
.th-marquee.is-held .th-marquee__track { animation-play-state: paused; }

@media (max-width: 640px) {
  .th-marquee { --mq-k: .78; --mq-gap: 40px; --mq-row: 46px; --mq-dur: 50s; --mq-fade: 36px; }
}

/* Reduced motion: no loop, no fade; one centred set of logos (two rows of five from 641px, wrapped rows
   on a phone). The copies are not rendered. Decided by the media query at first paint, so nothing shifts. */
@media (prefers-reduced-motion: reduce) {
  .th-marquee__viewport { height: auto; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .th-marquee__track { width: auto; max-width: var(--wrap); height: auto; margin: 0 auto; padding: 0 var(--gutter); animation: none; transform: none; will-change: auto; }
  .th-marquee__list { display: grid; flex: 1 1 auto; grid-template-columns: repeat(5, auto); justify-content: center; align-items: center; gap: 14px 56px; height: auto; }
  .th-marquee__list[aria-hidden="true"] { display: none; }
  .th-marquee__item { justify-content: center; height: var(--mq-row); margin: 0; }
  .th-marquee__logo { transition: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 640px) {
  .th-marquee__list { display: flex; flex-wrap: wrap; gap: 4px 30px; }
  .th-marquee__item { height: 42px; }
}

/* ----------------------------------------------------------------------------------------------------------------
   The hero with the band at its foot. section#hero is a flex row today (home.css); with the band it becomes a
   two-row grid: the content stays centred in the space above, the band sits at the bottom. These rules apply only
   while the band is a direct child of the hero, so the hero is unchanged without it. On a short desktop screen the
   globe gives up a little size so the band stays in the first screen. When this is folded into home.css, merge
   them into the .th-hero rules and drop the :has(). */
.th-hero:has(> .th-marquee) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; align-items: center; padding-bottom: clamp(20px, 3.4vh, 36px); }
.th-hero > .th-marquee { align-self: end; margin-top: clamp(28px, 5vh, 56px); }
@media (min-width: 961px) {
  /* The owner (13:19): a larger globe. The column keeps the old size (so the ring's left edge and the H1's room don't
     move); the globe is about a third larger and grows right, past the content edge (home.css, .th-hero__stage). Its
     layout height is .76 of its size, so the band still sits in the first screen. */
  .th-hero:has(> .th-marquee) > .th-hero__inner { --col: calc(clamp(340px, min(33vw, 100svh - 318px), 480px) - clamp(0px, (100vw - var(--wrap)) / 2, 96px)); --h1r: calc((100cqw - min(100cqw, var(--wrap))) / 2 + var(--gutter) + 8.75 * clamp(3rem, 5.6vw, 5rem)); --globe: clamp(360px, min(100cqw - 60px - var(--h1r), (100svh - 318px) * 1.3), 620px); }
  .th-hero:has(> .th-marquee) .th-hero__ctas { margin-bottom: clamp(28px, 4.4vh, 44px); }
  /* 2026-11-29, the owner: the credentials row "a bit above the marquee logo slider", with no divider (creds.css). The
     text column now fills the space above the band (stretch instead of centred), the H1, the sub and the buttons are
     centred in it as before (the two 1fr rows), and the row takes the last row, at the column's foot. The globe still
     spans every row. The band's empty head goes (its label is hidden in the hero: the row says "and trusted by:"), so
     the logos come up to the row. */
  .th-hero:has(> .th-marquee) > .th-hero__inner { align-self: stretch; grid-template-rows: 1fr auto auto auto 1fr auto; grid-template-areas: ". stage" "h1 stage" "sub stage" "cta stage" ". stage" "creds stage"; }
  .th-hero:has(> .th-marquee) .th-marquee__head { display: none; }
  .th-hero:has(> .th-marquee) > .th-marquee { margin-top: clamp(16px, 2.4vh, 24px); }
}
/* 2026-11-27 mobile pass H1: the globe after the buttons, at most 56svh (46svh on phones); H2: the band's empty head goes */
@media (max-width: 960px) {
  .th-hero:has(> .th-marquee) > .th-hero__inner { --globe: min(440px, 76vw, 56svh); }
  .th-hero .th-marquee__head { display: none; }
  .th-hero > .th-marquee { margin-top: 14px; }
}
/* 2026-11-27 (page review): short desktop screens. The globe already gives up size on them (--globe above follows
   100svh), but the text block did not, so at the owner's laptop size (1431 x 743) the hero was 788px tall and the
   logos ran 10px past the bottom of the first screen (1444 x 727: 786px, 25px past). Up to 800px of window height the
   hero's vertical spacing tightens instead (the globe's size and place are untouched): the space under the site
   header, under the H1, the sub and the buttons, above the credentials, above the band and under it. The hero then
   fits inside one screen from 1280 x 720 up (v3/page-fix/logs/hero-fit-*.txt). Above 800px nothing changes. */
@media (min-width: 961px) and (max-height: 800px) {
  .th-hero:has(> .th-marquee) { padding-top: calc(var(--nav-h) + 24px); padding-bottom: 16px; }
  .th-hero:has(> .th-marquee) .th-hero__h1 { margin-bottom: 22px; }
  .th-hero:has(> .th-marquee) .th-hero__sub { margin-bottom: 24px; }
  .th-hero:has(> .th-marquee) .th-hero__ctas { margin-bottom: 22px; }
  .th-hero:has(> .th-marquee) > .th-marquee { margin-top: 16px; }
}

/* A browser without :has() (Firefox before 121) keeps the hero's flex row: the band wraps onto its own line under the
   content instead. */
@supports not selector(:has(*)) {
  .th-hero { flex-wrap: wrap; }
  .th-hero > .th-marquee { flex: 0 0 100%; }
}
/* 2026-11-29 (release check, the owner: "the hero fits the first screen"): stacked, the hero ran past the first screen
   (987px at 390 x 844, 1160px at 768 x 1024), the logos under the fold. Now the globe takes the height the text leaves
   (100svh less the rest of the hero), between a floor and its old size, and the spacing around it tightens; on phones
   the credentials take one row with their label (creds.css). So the band ends inside the first screen at 390 x 844
   and 768 x 1024; a shorter screen keeps the floor and scrolls, as before. */
@media (max-width: 960px) {
  .th-hero:has(> .th-marquee) { padding-top: calc(var(--nav-h) + 28px); }
  .th-hero:has(> .th-marquee) > .th-hero__inner { --globe: max(280px, min(440px, 76vw, 100svh - 680px)); }
  .th-hero:has(> .th-marquee) .th-hero__ctas { margin-bottom: 24px; }
  .th-hero:has(> .th-marquee) .th-hero__stage { margin: 0 0 8px; }
}
@media (max-width: 640px) {
  .th-hero:has(> .th-marquee) { padding-top: calc(var(--nav-h) + 24px); padding-bottom: 16px; }
  .th-hero:has(> .th-marquee) > .th-hero__inner { --globe: clamp(200px, 100svh - 590px, min(300px, 78vw)); }
  .th-hero:has(> .th-marquee) .th-hero__h1 { margin-bottom: 16px; }
  .th-hero:has(> .th-marquee) .th-hero__sub { margin-bottom: 20px; }
  .th-hero:has(> .th-marquee) .th-hero__ctas { margin-bottom: 12px; }
  .th-hero:has(> .th-marquee) .th-hero__stage { margin: 0; }
  .th-hero:has(> .th-marquee) > .th-marquee { margin-top: 10px; }
}
/* H4: landscape phones */
@media (max-width: 960px) and (max-height: 500px) { .th-hero:has(> .th-marquee) > .th-hero__inner { --globe: min(300px, 70svh); } }
