/*
 * The "works with" wall (art direction 2.7, after every.to/agent): a
 * full-bleed band of the pale woven cloth, every logo in one identical
 * 120px white tile, the row drifting under a static woven centre card
 * raised 56px above the band. Markup: wall() in src/web/pages/site.js
 * (two copies of the row, the second hidden from assistive technology).
 *
 * Motion is CSS only (MOTION.md 1.4): one copy's width every 115s (71s on
 * a phone), paused on hover or focus, still under reduced motion, where
 * the row wraps and every logo is in view at once. Logos are the owners'
 * own files: nothing here recolours, filters or crops one. The strip fades
 * to nothing at both outer edges and as it nears the centre card, so no
 * logo is ever seen half covered (round 9 judges).
 */

.lw {
  --lw-tile: 120px;
  --lw-gap: 28px;
  --lw-card: 248px;
  --lw-band: 220px;
  --lw-ink: var(--ink);
  --lw-muted: var(--text-muted);
  position: relative;
  margin-top: 136px;
  color: var(--lw-ink);
}

/* the band: pale cloth, full bleed, no dots and no rules */
.lw-band { position: relative; height: calc(var(--lw-band) + 64px); background: linear-gradient(rgba(220, 238, 251, .6), rgba(220, 238, 251, .6)), var(--sky-pale) url("/assets/textile-pale.webp") 0 0 / 600px 600px; }

/* the strip: two copies of the row travel one copy's width, then repeat */
.lw-strip { position: absolute; left: 0; right: 0; top: 0; height: var(--lw-band); display: flex; align-items: center; overflow: hidden; }
.lw-strip {
  --lw-hub: calc(var(--lw-card) / 2);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 200px, #000 calc(100% - 200px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 200px, #000 calc(100% - 200px), transparent 100%);
}
@media (prefers-reduced-motion: reduce) { .lw-strip { -webkit-mask-image: none; mask-image: none; } }
.lw-track { display: flex; align-items: center; gap: var(--lw-gap); width: max-content; margin: 0; padding: 0 0 0 var(--lw-gap); list-style: none; }
@media (prefers-reduced-motion: no-preference) {
  .lw-track { animation: lw-scroll 115s linear infinite; }
  .lw-strip:is(:hover, :focus-within) .lw-track, .lw[data-offscreen] .lw-track { animation-play-state: paused; }
}
@keyframes lw-scroll { to { transform: translateX(-50%); } }

/* one identical tile for every logo */
.lw-tile { flex: none; display: grid; place-items: center; width: var(--lw-tile); height: var(--lw-tile); background: #FFFFFF; border-radius: 14px; box-shadow: 0 0 0 1px rgba(14, 16, 25, .08), 0 1px 2px rgba(14, 16, 25, .06), 0 6px 14px rgba(14, 16, 25, .06); cursor: default; transition: box-shadow 200ms ease-out; }
.lw-tile:hover, .lw-tile:focus-visible { box-shadow: 0 0 0 1px var(--cobalt), 0 1px 2px rgba(14, 16, 25, .06), 0 10px 22px rgba(14, 16, 25, .1); outline: none; }
.lw-tile .lw-l { display: grid; place-items: center; width: var(--lw-w); height: var(--lw-h); }
.lw-tile :is(img, svg) { display: block; width: 100%; height: 100%; max-width: none; object-fit: contain; }

/* the centre card: static, above the strip, raised 56px over the band; inside it the app icon, the paper and coral mark on Every-black (founder, 8 Oct 2026) */
.lw-card { position: absolute; z-index: 20; left: 50%; top: -56px; width: var(--lw-card); height: var(--lw-card); transform: translateX(-50%); padding: 16px; box-sizing: border-box; background: #FFFFFF; border-radius: 20px; box-shadow: var(--sh-3), 0 0 0 1px rgba(14, 16, 25, .05); }
.lw-card > span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 10px; background: #0B0D15; }
/* the mark at 0.6875 of the tile, as in /apple-touch-icon.png */
.lw-mark { width: 68.75%; height: 68.75%; }

/* what Immiscible does with the tool under the cursor: shown at once, no fade */
.lw-say { position: absolute; z-index: 25; top: calc(var(--lw-band) / 2 + var(--lw-tile) / 2 + 12px); left: var(--lw-x, 50%); width: 280px; margin: 0; padding: 14px 16px; box-sizing: border-box; background: #FFFFFF; border-radius: 10px; box-shadow: 0 0 0 1px rgba(14, 16, 25, .08), 0 12px 28px rgba(14, 16, 25, .16); font: 400 15px/1.45 "Timeless Sans", system-ui, sans-serif; color: var(--lw-ink); pointer-events: none; }
.lw-say b { font-weight: 500; }

.lw-foot { position: absolute; left: 0; right: 0; bottom: 22px; margin: 0; padding: 0 20px; text-align: center; font: 400 13px/1.4 "Timeless Sans", system-ui, sans-serif; color: var(--lw-muted); }

/* still: reduced motion. The row becomes a grid instead of drifting, so
   every logo is seen; full rows only (critic, 8 Oct 2026: no stray tiles
   at 1024 or 768). The wall holds a count with many divisors (wallItems in
   pages/site.js keeps it to 36), set six, four or three across. */
@media (prefers-reduced-motion: reduce) {
  .lw-band { height: auto; padding: 220px 20px 72px; }
  .lw-strip { position: static; height: auto; overflow: visible; }
  .lw-track { display: grid; grid-template-columns: repeat(6, var(--lw-tile)); justify-content: center; width: auto; margin: 0 auto; padding: 0; animation: none; }
  .lw-tile[aria-hidden="true"] { display: none; }
  .lw-card { top: -56px; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 940px) {
  .lw { --lw-tile: 104px; --lw-gap: 16px; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 720px) {
  .lw-track { grid-template-columns: repeat(4, var(--lw-tile)); }
}
@media (prefers-reduced-motion: reduce) and (max-width: 640px) {
  .lw-band { padding-top: 132px; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 420px) {
  .lw { --lw-tile: 76px; --lw-gap: 10px; }
}

@media (max-width: 640px) {
  .lw { --lw-tile: 84px; --lw-gap: 12px; --lw-card: 120px; --lw-band: 168px; margin-top: 88px; }
  .lw-card { top: -32px; padding: 8px; border-radius: 14px; }
  .lw-card > span { border-radius: 8px; }
  .lw-tile { border-radius: 12px; }
  .lw-tile .lw-l { width: calc(var(--lw-w) * .7); height: calc(var(--lw-h) * .7); }
  .lw-say { width: min(280px, calc(100vw - 32px)); }
  .lw-foot { bottom: 18px; }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .lw-track { animation-duration: 71s; }
}

/* round 10 judges: no logo ever slides under the raised card. The strip is masked to a clear gap 12px wider than
   the card on each side, eased over 40px, and the outer fade is short, so the edge tiles read whole or not at all. */
@media (prefers-reduced-motion: no-preference) {
  .lw-strip {
    --lw-m: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(50% - var(--lw-hub) - 52px), transparent calc(50% - var(--lw-hub) - 12px), transparent calc(50% + var(--lw-hub) + 12px), #000 calc(50% + var(--lw-hub) + 52px), #000 calc(100% - 48px), transparent 100%);
    -webkit-mask-image: var(--lw-m); mask-image: var(--lw-m);
  }
}
