/* ==========================================================================
   Shop by character — horizontal pinned wall

   Three tiers, all driven from the same markup:
     mobile / tablet      native horizontal swipe strip
     desktop, motion ok   GSAP pins the section and scrubs the track sideways
     reduced motion       falls back to the swipe strip at every width
   ========================================================================== */

.characters {
  position: relative;
  background: var(--u-ink);
  color: var(--u-paper);
  padding-block: var(--section-y);
  overflow: hidden;
}

.characters__pin {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* While pinned the section holds the viewport, so the wall has to fill it —
   otherwise the cards sit in the top third above a well of empty ink. */
.characters.is-pinned .characters__pin {
  min-height: calc(100svh - var(--header-h));
}

/* --- Ghost title (parallax) ------------------------------------------------ */

.characters__ghost {
  position: absolute;
  top: 50%;
  left: 0;
  translate: 0 -50%;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--fs-ghost);
  font-weight: 400;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 246, 236, 0.14);
  opacity: 0.9;
}

/* --- Head ------------------------------------------------------------------ */

.characters__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.characters__head .u-eyebrow { color: var(--u-accent); }

.characters__counter {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--u-accent);
}

/* --- Track ----------------------------------------------------------------- */

.characters__viewport {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-block: 0.5rem 1.5rem;
}

.characters__track {
  display: flex;
  gap: clamp(1rem, 2vw, 1.75rem);
  width: max-content;
  padding-inline: var(--gutter);
}

/* When GSAP owns the horizontal motion, the native scrollbar must go away —
   otherwise the section can be scrolled two different ways at once. */
.characters.is-pinned .characters__viewport {
  overflow: hidden;
  scroll-snap-type: none;
}

/* --- Card ------------------------------------------------------------------ */

.char-card {
  flex: 0 0 clamp(260px, 78vw, 360px);
  scroll-snap-align: center;
}

@media (min-width: 640px)  { .char-card { flex-basis: 380px; } }
@media (min-width: 1280px) { .char-card { flex-basis: 420px; } }

.char-card__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--accent);
  color: var(--fg);
}

.char-card__index {
  position: absolute;
  top: 0.85rem;
  right: 1.1rem;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 400;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px currentColor;
  opacity: 0.55;
}

.char-card__media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: var(--ink-w) solid var(--u-ink);
  background: var(--u-paper);
}
.char-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale var(--t-slow) var(--ease-out);
}
.char-card:hover .char-card__media img { scale: 1.07; }

.char-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.35rem 1.5rem 1.6rem;
}

.char-card__name {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1.1;
}

.char-card__tagline { font-size: 0.9375rem; opacity: 0.92; }

.char-card__count {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}
