/* ====================================================================
   THE LINEUP — the row of figures that closes the home page.

   Fifteen looks stood side by side on one floor. One is in focus in the
   middle; the rest fall away from it, smaller, paler and softer the further
   out they stand, so the row reads as depth rather than as a filmstrip.
   Stepping it walks the whole row past the middle.

   The figures are pre-cut: scripts/lineup_images.py crops each frame to its
   model and scales every one to the same figure height, so this file never
   has to tune a pose into place. Feet land on one line because the images
   are bottom-aligned and the images *are* the figures.

   The falloff is driven by one number per figure — --d, how many places it
   stands from the middle, signed — written on the element by lineup.js.
   Everything here is a function of that, so there is one place to change
   how deep the row reads.
   ==================================================================== */

.lineup {
  /* Its own ground rather than the page's. The figures that are not cutouts
     carry a white box with them (star-studded's burgundy run ships as the
     supplied still), and on white that box has no edge. */
  background: #fff;
  padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;

  /* The drop panes above this are sticky and stack at z-index 10 and 11,
     each sliding up over the last. The lineup is the next one up, so it
     takes the next number and the same lifted edge — without it the panes
     pin over the top of the row instead of clearing it. */
  position: relative;
  z-index: 12;
  box-shadow: 0 -24px 60px rgba(12, 10, 9, 0.18);
}

.lineup__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.lineup__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
}

.lineup__sub {
  margin: 0.35rem 0 0;
  max-width: 34rem;
  font-size: 0.86rem;
  color: var(--fg-muted);
}

/* ------------------------------------------------------------- the stage

   A fixed-height box the figures are laid out in. They are absolutely
   positioned and bottom-aligned, so the floor is the box's bottom edge and
   no figure can push the box around as the row steps. */

.lineup__stage {
  position: relative;
  height: clamp(20rem, 52vh, 34rem);
  margin: 0 auto;
  /* The row is wider than the shell on purpose — the outermost figures are
     meant to run off the sides rather than stop short of them. */
  touch-action: pan-y;
  cursor: grab;

  /* One place, as a distance. It lives here rather than on the figure
     because the gauge below has to read the same number, and because the
     drag divides pixels by it to turn a hand's travel into places. */
  --step: clamp(6.5rem, 15vw, 13rem);
}

.lineup__stage.is-grabbing {
  cursor: grabbing;
}

/* --step is a clamp(), and a clamp() cannot be read back off a custom
   property in pixels. This is a zero-height box one place wide, so
   measuring it gives lineup.js the resolved number — and it stays right
   through a resize or a zoom without anything having to recompute it. */
.lineup__gauge {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--step);
  height: 0;
  visibility: hidden;
  pointer-events: none;
}

.lineup__figure {
  position: absolute;
  left: 50%;
  bottom: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  height: 100%;
  /* --d is how many places this figure stands from the middle, signed, and
     it is a fraction rather than a whole number: the row is dragged, so
     between two places it really is at 1.4 of them. --ad is its size, which
     everything below is a curve on.

     Nothing here transitions. The row is driven frame by frame from
     lineup.js — a drag has to follow the hand, and a wrap has to be able to
     pass the seam without a transition animating it the long way round. */
  --ad: max(var(--d), calc(-1 * var(--d)));
  transform:
    translateX(calc(-50% + var(--d) * var(--step)))
    scale(calc(1 - 0.11 * var(--ad)));
  transform-origin: 50% 100%;
  opacity: calc(1 - 0.26 * var(--ad));
  filter: blur(calc(var(--ad) * 1.4px));
  z-index: calc(10 - var(--ad));
  cursor: pointer;
}

/* While the row is moving the blur comes off entirely. It is a filter on
   fifteen tall photographs, and re-rasterising those every frame is what
   took the renderer down the first time this was built — depth is carried
   by the scale and the fade on the way past, and the blur settles back in
   when the row stops. */
.lineup__stage.is-moving .lineup__figure {
  filter: none;
}

.lineup__figure img {
  display: block;
  height: 100%;
  width: auto;
  /* A pose is the figure and nothing else, so it is never cropped or
     stretched — the element takes whatever width the model happens to be. */
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* Past the second place out a figure is more blur than look, and on a narrow
   screen it would be off the side anyway. The third place is still drawn, so
   the figure stepping in travels rather than appears; past that it is taken
   out of painting altogether. Leaving fifteen blurred photographs composited
   and merely transparent is what made the section expensive. */
.lineup__figure[data-out] {
  opacity: 0;
  pointer-events: none;
}

.lineup__figure[data-far] {
  display: none;
}

.lineup__figure.is-lead {
  filter: none;
}

/* The lead alone answers the pointer, and only when the row is still: the
   others are stepped to rather than opened, and a lift under a moving row
   would fight the travel. */
.lineup__stage:not(.is-moving):hover .lineup__figure.is-lead {
  transform:
    translateX(calc(-50% + var(--d) * var(--step)))
    scale(1.015);
  transition: transform 220ms var(--ease);
}

/* --------------------------------------------------------------- the bar

   Name, colourway and price for whatever is in the middle, with the step
   controls. It sits under the floor line rather than over the figures. */

.lineup__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
}

.lineup__now {
  min-width: 0;
}

.lineup__name {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.lineup__meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.lineup__steps {
  display: flex;
  gap: 0.5rem;
  flex: none;
}

.lineup__step {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background 220ms var(--ease), border-color 220ms var(--ease);
}

.lineup__step:hover {
  background: var(--bg);
  border-color: var(--border-strong);
}

.lineup__step:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.lineup__step svg {
  width: 1rem;
  height: 1rem;
}

/* ------------------------------------------------------------- the strip

   The whole set along the bottom, so the row's length is visible without
   stepping through it. These are the grid/ copies — card-shaped, on white,
   already built for the shop — so the strip costs no new images. */

.lineup__strip {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.lineup__strip::-webkit-scrollbar {
  display: none;
}

.lineup__thumb {
  flex: 0 0 auto;
  width: clamp(4.5rem, 8vw, 6.5rem);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  scroll-snap-align: center;
  text-align: left;
}

.lineup__thumb span {
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.07);
  transition: box-shadow 260ms var(--ease), opacity 260ms var(--ease);
  opacity: 0.55;
}

.lineup__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lineup__thumb:hover span {
  opacity: 0.85;
}

.lineup__thumb.is-lead span {
  opacity: 1;
  box-shadow: inset 0 0 0 1px var(--fg);
}

.lineup__thumb:focus-visible span {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ------------------------------------------------------------ the phone

   Three figures rather than five, stepped closer together: at this width
   the second place out is off the screen, and five would be two figures
   nobody can see paying for their own decode. */

@media (max-width: 47.999rem) {
  .lineup__stage {
    --step: 7.5rem;
  }

  .lineup__bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }

  .lineup__steps {
    align-self: flex-end;
  }
}

/* Nothing travels for someone who asked for that. The row still steps — it
   just arrives instead of crossing. */
@media (prefers-reduced-motion: reduce) {
  .lineup__thumb span {
    transition: none;
  }

  .lineup__stage:not(.is-moving):hover .lineup__figure.is-lead {
    transform: translateX(calc(-50% + var(--d) * var(--step)));
    transition: none;
  }
}
