.project-scroller {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 90px);
  min-height: min(680px, 79svh);
  padding-block: clamp(18px, 4vw, 60px);
  font-family: Arial, Helvetica, sans-serif;
}

.project-wheel {
  position: relative;
  --step: clamp(43px, 5.15vw, 82px);
  --title-size: clamp(20px, 9.5cqi, 74px);
  container-type: inline-size;
  user-select: none;
  touch-action: pan-x pinch-zoom;
  height: calc(var(--step) * 7.5);
}

.project-wheel-arrow {
  position: absolute;
  top: 50%;
  left: 0;
  translate: 0 -50%;
  width: var(--title-size);
  height: auto;
  filter: var(--icon-filter, none);
  pointer-events: none;
  z-index: 5;
}

.project-wheel-item {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: var(--step);
  --angle: clamp(-27deg, calc(12deg * var(--distance)), 27deg);
  transform: translate(calc(1.05cqi * var(--depth) * var(--depth)), calc(var(--step) * var(--distance) - 50%))
    rotate(var(--angle)) scale(calc(1 - .05 * var(--depth)));
  transform-origin: left center;
  opacity: clamp(0, calc(1.2 - .4 * var(--depth)), 1);
  filter: blur(calc(.65px * var(--depth)));
}

.project-wheel-item[inert] { visibility: hidden; }

.project-wheel button {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0 .55em 0 1.25em;
  background: transparent;
  color: inherit;
  font: 750 var(--title-size)/1.12 Arial, Helvetica, sans-serif;
  letter-spacing: -.075em;
  text-align: left;
  cursor: grab;
}

.project-wheel.is-dragging button { cursor: grabbing; }
.project-wheel button:focus-visible { outline-offset: -3px; }

.project-wheel-contact {
  display: flex;
  gap: .45em;
  align-items: center;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.25em;
  font-size: var(--title-size);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease;
}

.project-wheel-item:is(:hover, :focus-within, .is-contact-open):has(.project-wheel-contact) {
  z-index: 1;
}

.project-wheel-item:is(:hover, :focus-within, .is-contact-open):has(.project-wheel-contact) .project-wheel-label {
  opacity: 0;
}

.project-wheel-item:is(:hover, :focus-within, .is-contact-open) .project-wheel-contact {
  opacity: 1;
  visibility: visible;
}
.project-wheel-contact a { width: .72em; height: .72em; }
.project-wheel-contact img { width: 100%; height: 100%; display: block; filter: var(--icon-filter, none); }

.project-preview.is-contact > :not(.project-preview-contact) { visibility: hidden; }
.project-preview { position: relative; }
.project-preview-contact { position: absolute; inset: 0; align-content: center; }

.project-preview {
  display: grid;
  justify-items: end;
  gap: clamp(18px, 3vw, 48px);
  text-align: right;
}

.project-preview-image {
  width: 100%;
  height: clamp(175px, 32vw, 460px);
  object-fit: contain;
}

.project-preview-description {
  margin: 0;
  max-width: 35ch;
  font-size: clamp(18px, 2.5vw, 38px);
  line-height: 1.16;
  letter-spacing: -.055em;
}

.project-preview-link {
  border-radius: 100vw;
  padding: .16em .52em .23em;
  background: var(--page-ink, #111);
  color: var(--page-bg, #fff);
  font-size: clamp(17px, 2.25vw, 34px);
  line-height: 1;
  text-decoration: none;
}

@media (max-width: 820px) and (orientation: portrait) and (pointer: coarse) {
  .project-scroller { grid-template-columns: 1fr; gap: 0; min-height: 0; }
  .project-wheel {
    width: calc(100% - clamp(64px, 20vw, 140px));
    --step: clamp(39px, 8vw, 60px);
    --title-size: clamp(20px, 9.5cqi, 55px);
    overflow-x: clip;
  }
  .project-wheel-item { filter: none; }

  /* Blur just the lettering without filtering the whole rotating row. */
  .project-wheel-item button[aria-pressed="false"] .project-wheel-label {
    color: transparent;
    text-shadow: 0 0 calc(1.15px * var(--depth)) var(--page-ink, #111);
  }

  .project-preview { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .project-wheel-contact { transition: none; }
  .project-wheel-item { --angle: 0deg; }
}

.project-preview-contact:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 12px 24px;
  font-size: clamp(22px, 3vw, 44px);
}

.project-preview-contact a {
  text-decoration: underline;
  text-underline-offset: .18em;
}
