:root {
  --bg: #f2f3f5; --surface: #ffffff; --text: #1c1f24; --muted: #5d6673;
  --accent: #5b6cff; --shadow: 0 2px 10px rgba(0,0,0,.12);
  --tile: 150px; --gap: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --surface: #1d2229; --text: #f0f2f5; --muted: #a2adbb; --shadow: 0 2px 10px rgba(0,0,0,.5); }
}
@media (min-width: 820px) { :root { --tile: 200px; --gap: 24px; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.site-header { max-width: 1200px; margin: 0 auto 24px; text-align: center; }
.logo { width: 120px; height: 120px; border-radius: 22px; box-shadow: var(--shadow); }
.site-header h1 { margin: 16px 0 4px; font-size: clamp(1.6rem, 5vw, 2.4rem); }
.site-header p { margin: 0; color: var(--muted); }
.grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
}
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 1; padding: 12px; overflow: hidden; text-align: center;
  background: var(--surface); color: inherit; text-decoration: none;
  border-radius: 22px; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tile .icon { width: 52%; aspect-ratio: 1; object-fit: contain; border-radius: 22%; }
.tile .letter {
  width: 52%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 22%;
  background: var(--accent); color: #fff; font-size: 2.6rem; font-weight: 700;
}
.tile .title { margin-top: 10px; font-weight: 600; line-height: 1.2; }
.tile .desc {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 14px; background: var(--accent); color: #fff; font-size: .9rem;
  opacity: 0; transition: opacity .18s ease; pointer-events: none;
}
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) {
  .tile:hover { transform: translateY(-3px); }
  .tile:hover .desc, .tile:focus-visible .desc { opacity: 1; }
}
/* Touch devices can't hover: show the description under the title instead. */
@media (hover: none) {
  .tile { aspect-ratio: auto; min-height: var(--tile); justify-content: flex-start; padding-top: 18px; }
  .tile .desc { position: static; opacity: 1; background: none; color: var(--muted); padding: 6px 0 0; font-size: .8rem; }
  .tile:active { transform: scale(.97); }
}
.status { text-align: center; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .tile, .desc { transition: none; } }
