/* The sketchbook's front page. */

body { padding: 40px 24px 48px; }
main { max-width: 760px; margin: 0 auto; }

.pixel-friends img, .footer-heart img { display: block; image-rendering: pixelated; }

.page-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 32px 0 0; padding: 0; list-style: none; }
.page-list a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  container-type: inline-size; /* lets the pixel friends size to the card (cqw) */
}
.page-list a:focus-visible { outline: 2px solid var(--highlight); outline-offset: 3px; }

/* the same shape as a link preview */
.page-preview { display: block; aspect-ratio: 1200 / 630; background: var(--checkerboard); }
.preview-picture { display: block; width: 100%; height: 100%; object-fit: cover; }
/* padding-bottom centres the row: (52.5cqw preview − 21cqw kitties) / 2 */
.pixel-friends { display: flex; align-items: flex-end; justify-content: center; gap: 3.5cqw; padding-bottom: 15.75cqw; }
.pixel-friends img { flex: none; width: auto; height: calc(var(--friend-height) * 1cqw); }
.page-list li:hover .pixel-friends img { animation: hop .4s steps(4) var(--hop-delay); }
@keyframes hop { 50% { transform: translateY(-8px); } }

.page-text { display: block; padding: 14px 16px 16px; }
.page-text b { display: block; margin-bottom: 2px; font-size: 15px; color: var(--accent); }
.page-text b::after { content: " →"; display: inline-block; margin-left: 4px; color: var(--text-placeholder); }
.page-list li:hover .page-text b::after { color: var(--accent); transform: translateX(3px); }

.home-footer { margin-top: 36px; text-align: center; }
.home-footer a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-placeholder); text-decoration: none; }
.home-footer a:hover { color: var(--accent-light); }

@media (max-width: 600px) {
  body { padding: 24px 16px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .page-list li:hover .pixel-friends img { animation: none; }
}
