/* The product page's researched apps: the heading with the row's back and more buttons, then a row
   of cards that scrolls sideways, each the app's first phone screen rising out of its own colour
   (--pk, set on the card from the map's data), and under it the way to the market map. The next
   card always shows a little at the row's end, so there is more to see. Only tokens. */

.peek {
  container-type: inline-size;
  padding-top: var(--space-8);
}
.peek-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);
}
.peek-head h2 {
  margin-top: var(--space-5);
}
.peek-head .lead {
  max-width: 640px;
  margin-top: var(--space-4);
}
.peek-nav {
  display: flex;
  flex: none;
  gap: var(--space-2);
}
.peek-nav[hidden] {
  display: none;
}
.peek-btn {
  justify-content: center;
  width: var(--target);
  min-height: var(--target);
  padding: 0;
  border-radius: var(--radius-pill);
}
.peek-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}
.peek-back {
  transform: scaleX(-1);
}

/* The row: from the window's left edge to its right, the cards lined up with the words above and
   snapping there, so cards scrolled past fill the left and the next ones the right. --edge is the
   room beside the container; cqw is the section's width (a hundredth), 50% half the container's. */
.peek-row {
  --edge: max(var(--gutter), (100cqw - var(--container)) / 2);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 268px;
  gap: var(--space-4);
  margin: var(--space-10) calc(50% - 50cqw) 0;
  padding: var(--space-1) calc(50cqw - 50%) var(--space-2);
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
}
.peek-row::-webkit-scrollbar {
  display: none;
}
.pk {
  scroll-snap-align: start;
}
.pk a {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  overflow: hidden;
  border: var(--border) solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.pk a:hover {
  border-color: var(--line-strong);
}
.pk a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

/* The screen, in a phone, rising out of the app's colour */
.pk-shot {
  display: flex;
  justify-content: center;
  height: 252px;
  padding-top: var(--space-6);
  overflow: hidden;
  background:
    radial-gradient(
      120% 90% at 50% 100%,
      color-mix(in srgb, var(--pk, var(--accent)) 42%, transparent),
      transparent 72%
    ),
    color-mix(in srgb, var(--pk, var(--accent)) 8%, var(--surface-2));
}
.pk-shot .device {
  flex: none;
  width: 66%;
  height: max-content;
  padding: 5px;
  border-radius: 28px;
  transition: transform var(--duration-base) var(--ease-out);
}
.pk-shot .device img {
  border-radius: 23px;
}
.pk a:hover .device {
  transform: translateY(calc(-1 * var(--space-2)));
}

/* The words: the market, the app, the niche it's for, what that niche spends */
.pk-t {
  display: grid;
  align-content: start;
  gap: var(--space-1);
  padding: var(--space-5);
  border-top: var(--border) solid var(--line);
}
.pk-m {
  font-size: var(--size-small);
  line-height: var(--leading-ui);
  color: var(--text-muted);
}
.pk-t > b {
  font-size: var(--size-h4);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  color: var(--text-strong);
}
.pk-n {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: var(--size-ui);
  line-height: var(--leading-ui);
}
.pk-size {
  margin-top: var(--space-3);
  font-size: var(--size-small);
  color: var(--text-muted);
}
.pk-size b {
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
}

.peek-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  margin-top: var(--space-8);
}
.peek-foot p {
  font-size: var(--size-small);
  line-height: var(--leading-ui);
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .peek {
    padding-top: var(--space-4);
  }
  .peek-nav {
    display: none;
  }
  .peek-row {
    grid-auto-columns: calc(100cqw - 2 * var(--gutter) - var(--space-12));
    gap: var(--space-3);
    margin-top: var(--space-8);
  }
  .pk-shot {
    height: 236px;
  }
  .pk-shot .device {
    width: 58%;
  }
  .peek-foot .btn {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pk-shot .device {
    transition: none;
  }
  .pk a:hover .device {
    transform: none;
  }
}
