/* ── Home "Clients" (site/clients.py) ───────────────────────────────────────
   The live site's client logos in full colour on matte clay. Two structures:
   .cbd  — (renamed from .cb 17 Oct: .cb is the CMS content-block section) the CORRIDOR BOARD (homepage): clay tiles pinned along a soft bronze
          route between an INDIA and a USA marker; tiles above, the route,
          tiles below — 7 / 5 / 3 columns by width, same structure throughout.
   .rv  — the LOGO RIVER (/_preview/clients-river/ only): two slow
          counter-drifting rows on a clay slab, magnetic hover lift.
   Colour comes from the logos only; every surface is a clay token. Motion is
   transform-only and stops under prefers-reduced-motion. */

.clients-sec .head-row h2 { max-width: 16ch; }

/* shared: the clay tile a logo sits on */
.cbd__tile, .rv__tile {
  display: grid; place-items: center; aspect-ratio: 1.9 / 1;
  border-radius: clamp(12px, 1.2vw, 17px);
  background: linear-gradient(178deg, var(--sand-980) 0%, var(--sand-955) 58%, var(--sand-929) 100%);
  box-shadow: var(--clay-sm);
}
.cbd__logo, .rv__logo { display: block; width: calc(var(--lw, 60%) * .8); height: auto; max-width: 92%;
  user-select: none; -webkit-user-drag: none; pointer-events: none; }

/* ── corridor board ─────────────────────────────────────────────────────── */
.cbd { --rg: 18px; --cg: 14px; --sp: 22px; --route-h: 64px;
  padding: clamp(18px, 3.4vw, 46px);
  border-radius: var(--r-xl);
  background: linear-gradient(178deg, var(--sand-980) 0%, var(--sand-955) 58%, var(--sand-929) 100%);
  box-shadow: var(--clay-lg); }
.cbd__grid { list-style: none; margin: 0; padding: 0; display: grid; row-gap: var(--rg); column-gap: var(--cg);
  grid-template-columns: repeat(4, minmax(0, 1fr)) var(--sp) repeat(6, minmax(0, 1fr)) var(--sp) repeat(4, minmax(0, 1fr)); }
.cbd__tile { position: relative; z-index: 3; grid-column: var(--dc) / span 2; grid-row: var(--dr);
  transform: translate(var(--jx), var(--jy)) rotate(var(--jr));
  animation: cb-float var(--fd, 8s) ease-in-out var(--fl, 0s) infinite; }
@keyframes cb-float {
  0%, 100% { transform: translate(calc(var(--jx) - 1px), calc(var(--jy) + 1.5px)) rotate(calc(var(--jr) - .45deg)); }
  50%      { transform: translate(calc(var(--jx) + 1px), calc(var(--jy) - 2px)) rotate(calc(var(--jr) + .45deg)); }
}
.cbd[data-idle] .cbd__tile { animation-play-state: paused; }

/* the route: a soft pressed-in groove with a bronze line, the two markers at its ends */
.cbd__route { position: relative; grid-column: 1 / -1; grid-row: var(--drt); display: flex; align-items: center;
  height: var(--route-h); }
.cbd__line { position: relative; z-index: 0; flex: 1 1 auto; height: 12px; margin: 0 -12px; border-radius: 999px;
  background: linear-gradient(178deg, var(--sand-917b) 0%, var(--sand-938) 100%); box-shadow: var(--clay-in); }
.cbd__line i { position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px;
  background: var(--bronze); opacity: .9; }
.cbd__mark { position: relative; z-index: 4; flex: none; display: grid; place-items: center;
  height: clamp(34px, 3.3vw, 46px); padding: 0 clamp(14px, 1.7vw, 24px) 0 calc(clamp(14px, 1.7vw, 24px) + .16em);
  border-radius: clamp(11px, 1.1vw, 15px);
  background: linear-gradient(178deg, var(--sand-980) 0%, var(--sand-955) 58%, var(--sand-929) 100%);
  box-shadow: var(--clay-md);
  font: 400 clamp(12px, 1.1vw, 15.5px)/1 Newsreader, Georgia, serif; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); }

/* pins: one per column, from the inner tile above, through the route, to the inner tile below */
.cbd__pin { position: relative; z-index: 1; display: none; grid-column: var(--c) / span 2; grid-row: var(--r); }
.cbd__pin--d { display: block; }
.cbd__pin::before { content: ""; position: absolute; left: 50%; width: 1px; margin-left: -.5px;
  top: calc(5px - var(--rg)); bottom: calc(5px - var(--rg)); background: rgba(var(--bronze-rgb), .42); }
.cbd__pin i { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: var(--bronze-bright); box-shadow: 0 0 0 3px rgba(var(--bronze-rgb), .16); }

@media (max-width: 1180px) { .cbd { --rg: 15px; --cg: 11px; --sp: 16px; --route-h: 58px; } }
/* 5 columns */
@media (max-width: 900px) {
  .cbd { --rg: 13px; --cg: 9px; --route-h: 54px; }
  .cbd__grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .cbd__tile { grid-column: var(--tc) / span 2; grid-row: var(--tr); }
  .cbd__route { grid-row: var(--trt); }
  .cbd__pin--d { display: none; }
  .cbd__pin--t { display: block; }
}
/* 3 columns */
@media (max-width: 560px) {
  .cbd { --rg: 11px; --cg: 8px; --route-h: 50px; padding: 14px; border-radius: var(--r-lg); }
  .cbd__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cbd__tile { grid-column: var(--mc) / span 2; grid-row: var(--mr); }
  .cbd__route { grid-row: var(--mrt); }
  .cbd__pin--t { display: none; }
  .cbd__pin--m { display: block; }
  .cbd__mark { height: 32px; padding: 0 12px 0 calc(12px + .16em); }
}

/* ── logo river (preview) ───────────────────────────────────────────────── */
.rv { --g: clamp(14px, 1.5vw, 22px); display: grid; gap: clamp(6px, 1vw, 14px); padding: clamp(18px, 2.6vw, 34px) 0;
  overflow: hidden; border-radius: var(--r-xl); }
.rv__row { overflow: hidden; padding: 14px 0 18px;
  -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%); }
.rv__track { list-style: none; margin: 0; display: flex; gap: var(--g); width: max-content; padding: 0 var(--g) 0 0;
  animation: rv-drift 84s linear infinite; }
.rv__row--b .rv__track { animation-duration: 98s; animation-direction: reverse; }
@keyframes rv-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.rv__row:hover .rv__track, .rv[data-idle] .rv__track { animation-play-state: paused; }
.rv__tile { flex: none; width: clamp(116px, 11.5vw, 168px);
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.rv__tile.is-lift { box-shadow: var(--clay-hover); transition-duration: .18s, .3s; }

@media (prefers-reduced-motion: reduce) {
  .cbd__tile { animation: none; }
  .rv__track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; padding: 0 clamp(18px, 3vw, 40px); }
  .rv__tile[aria-hidden="true"] { display: none; }
  .rv__row { -webkit-mask-image: none; mask-image: none; }
  .rv__tile { transition: none; transform: none; }
}
