.Work__section {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: clamp(2rem, 5vh, 4rem);
  overflow: hidden;
  isolation: isolate;

  opacity: 0.5;
  filter: saturate(0.25);
  transition:
    opacity var(--dur) var(--ease),
    filter var(--dur) var(--ease);
}

.Work__section.Work__resolved {
  opacity: 1;
  filter: saturate(1);
}

@media (min-width: 1024px) and (hover: hover) {
  .Work__section {
    filter: saturate(0.25) blur(4px);
  }

  .Work__section.Work__resolved {
    filter: saturate(1) blur(0px);
  }
}

.Work__head {
  display: grid;
  gap: 1.5rem;
  padding-inline: clamp(2rem, 6vw, 7rem);
}

.Work__heading {
  white-space: pre-line;
  color: var(--fg);
}

.Work__viewport {
  overflow: hidden;
}

.Work__row {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  /* Leading and trailing space so the first and last card can reach the
     horizontal centre, where the focus resolve happens. */
  padding-inline: clamp(2rem, 6vw, 7rem);
  width: max-content;
}

.Work__card {
  flex: 0 0 auto;
  width: clamp(260px, 30vw, 420px);
  display: grid;
  gap: 0.75rem;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;

  /* Every card is out of focus until it reaches the centre of frame. */
  opacity: 0.55;
  filter: saturate(0.3);
  transition:
    opacity var(--dur) var(--ease),
    filter var(--dur) var(--ease);
}

.Work__card:disabled {
  cursor: default;
}

.Work__card.Work__focused {
  opacity: 1;
  filter: saturate(1);
}

@media (min-width: 1024px) and (hover: hover) {
  .Work__card {
    filter: saturate(0.3) blur(4px);
  }

  .Work__card.Work__focused {
    filter: saturate(1) blur(0px);
  }
}

.Work__media {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 1px solid var(--grey-2);
  border-radius: 2px;
  overflow: hidden;
}

.Work__caption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.Work__card:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 6px;
}

/**
 * Below 720px the pinning is dropped entirely and this becomes a native swipe
 * row. Scroll-jacking a phone is the fastest way to make a site feel broken,
 * and CLAUDE.md forbids anything that stops a user reaching the bottom.
 */
@media (max-width: 720px) {
  .Work__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .Work__card {
    scroll-snap-align: center;
    width: 78vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .Work__section,
  .Work__section.Work__resolved {
    filter: none;
  }

  .Work__section {
    transition: opacity var(--dur) var(--ease);
  }

  .Work__card,
  .Work__card.Work__focused {
    filter: none;
  }

  /* No pinned horizontal translate; the row is swiped natively instead. */
  .Work__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .Work__row {
    transform: none !important;
  }
}
