/* The collection: app cards that fly in from the field and tilt with the cursor. */

.collection {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--sfx-space-24) var(--sfx-space-6);
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: var(--sfx-space-12);
}

.collection__head { display: grid; gap: var(--sfx-space-3); }
.collection__title {
  margin: 0;
  font-size: clamp(var(--sfx-text-2xl), 6vw, var(--sfx-text-4xl));
}
.collection__lead { color: var(--sfx-grey-300); font-size: var(--sfx-text-lg); }

.collection__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sfx-space-6);
  perspective: 1400px;
}

.app-card {
  --rx: 0deg;
  --ry: 0deg;
  display: grid;
  padding: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform var(--sfx-fast) var(--sfx-ease), border-color var(--sfx-fast) var(--sfx-ease);
}
.app-card:hover { border-color: var(--sfx-grey-500); }
.app-card::before { z-index: 2; transform: translateZ(14px); }

/* Entry: from deep in the field, along the slant, no bounce. */
.js .app-card:not(.is-in) {
  opacity: 0;
  transform: translate3d(18px, 100px, -360px) rotateX(16deg);
}
.js .app-card.is-entering {
  transition: transform 560ms var(--sfx-ease), opacity var(--sfx-slow) var(--sfx-ease);
}

.app-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sfx-surface-2);
  transform: translateZ(6px);
}
.app-card__media .promo-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-card__media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.app-card__body {
  display: grid;
  gap: var(--sfx-space-4);
  padding: var(--sfx-space-6);
  transform: translateZ(12px);
}
.app-card__logo { width: min(220px, 70%); height: auto; }
.app-card__tags { display: flex; flex-wrap: wrap; gap: var(--sfx-space-2); }
.app-card__text { color: var(--sfx-grey-300); }
.app-card__actions { display: flex; flex-wrap: wrap; gap: var(--sfx-space-3); }

.app-card--soon {
  align-content: center;
  justify-items: start;
  gap: var(--sfx-space-4);
  padding: var(--sfx-space-8) var(--sfx-space-6);
  cursor: pointer;
}
.app-card--soon > * { transform: translateZ(12px); }
.soon__name {
  font-size: var(--sfx-text-3xl);
  color: var(--sfx-grey-400);
  white-space: nowrap;
}
.soon__text { color: var(--sfx-grey-400); font-size: var(--sfx-text-sm); }

@media (max-width: 820px) {
  .collection__grid { grid-template-columns: 1fr; }
  .soon__name { font-size: var(--sfx-text-2xl); }
}

@media (prefers-reduced-motion: reduce) {
  .js .app-card:not(.is-in) { transform: none; }
}
