:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1e222d;
  --border: #2a2f3c;
  --text: #e6e8ee;
  --muted: #9aa2b1;
  --accent: #5b8cff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --panel-2: #eef0f4;
    --border: #dfe3ea;
    --text: #171a23;
    --muted: #5d6677;
    --accent: #3a6df0;
    --shadow: 0 10px 30px rgba(23, 26, 35, 0.1);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-header,
main {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.app-header { padding-top: clamp(2.5rem, 8vw, 5rem); }
.app-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  text-wrap: balance;
}

main { padding-top: clamp(1.75rem, 5vw, 3rem); padding-bottom: 4rem; }

.count {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Tiles */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.tile {
  --tile-accent: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tile:hover,
.tile:focus-visible {
  transform: translateY(-3px);
  border-color: var(--tile-accent);
  box-shadow: var(--shadow);
}
.tile:focus-visible { outline: 2px solid var(--tile-accent); outline-offset: 3px; }

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.tile-badge {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--tile-accent) 16%, transparent);
  color: var(--tile-accent);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}
.tile-arrow {
  color: var(--muted);
  font-size: 1.2rem;
  transition: transform 0.18s ease, color 0.18s ease;
}
.tile:hover .tile-arrow,
.tile:focus-visible .tile-arrow {
  transform: translateX(4px);
  color: var(--tile-accent);
}

.tile-title { margin: 0; font-size: 1.1rem; line-height: 1.3; }
.tile-desc { margin: 0; color: var(--muted); font-size: 0.93rem; }

.tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: auto 0 0;
  padding: 0.5rem 0 0;
  list-style: none;
}
.tile-tags li {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .tile, .tile-arrow { transition: none; }
  .tile:hover, .tile:focus-visible { transform: none; }
}
