/* App tiles, shared by the homepage and the control app preview.
   Pages define: --surface --ink --muted --line --focus */

.cat { margin: 0 0 56px; }
.cat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 18px; }
.cat-head h2 { font: 400 1.5rem/1.15 "Archivo Black", "Archivo", system-ui, sans-serif; letter-spacing: -0.01em; margin: 0; }
.cat-head p { margin: 0; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px; }

.tile {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.tile-art {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--c); color: var(--on);
}
.tile-art > img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* The app's icon, drawn huge and cropped by the tile edge. */
.tile-bigicon {
  position: absolute; right: -14%; bottom: -46%; height: 150%; width: auto;
  stroke-width: 1.1; opacity: 0.92;
}
.tile-chip {
  position: absolute; left: 14px; top: 14px; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center; background: var(--surface); color: var(--c);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--on) 25%, transparent);
}
.tile-art:not(.has-cover) .tile-chip { display: none; }
.tile-chip svg { width: 24px; height: 24px; }
.tile-flag {
  position: absolute; left: 14px; bottom: 12px; padding: 3px 9px; border-radius: 999px;
  font: 700 0.75rem/1.4 "Archivo", system-ui, sans-serif;
  background: var(--on); color: var(--c);
}
.tile-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.tile-name { font: 400 1.3rem/1.15 "Archivo Black", "Archivo", system-ui, sans-serif; margin: 0; letter-spacing: -0.005em; }
.tile-link { color: inherit; text-decoration: none; }
/* Whole tile is clickable through the name link. */
.tile-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tile-link:focus-visible { outline: none; }
.tile:has(.tile-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.tile:has(.tile-link):hover { border-color: var(--c); }
.tile:has(.tile-link):hover .tile-name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--c); }
.tile-text { margin: 0; color: var(--muted); line-height: 1.45; }
.tile-meta { margin: auto 0 0; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.875rem; color: var(--muted); }
.tile-meta a { position: relative; z-index: 1; color: var(--ink); }
.tile-host { color: var(--muted); }
.tile.is-soon .tile-art { filter: saturate(0.55); }
.tile.is-soon .tile-name { color: var(--muted); }

.empty {
  margin: 0; padding: 28px 22px; border: 1.5px dashed var(--line); border-radius: 14px;
  color: var(--muted); max-width: 560px;
}

@media (prefers-reduced-motion: no-preference) {
  .tile-bigicon { transition: transform 0.35s ease; }
  .tile:has(.tile-link):hover .tile-bigicon { transform: rotate(-6deg) scale(1.04); }
}
