:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --tile: #f0efe9;
  --line: #e5e3db;
  --line-strong: #cbc8bc;
  --fg: #1d1d24;
  --body: #55544c;
  --muted: #8b8a80;
  --dim: #a8a69c;
  --accent: #c99a2e;
  --quote-bg: #faf9f3;
  --shadow: 0 4px 14px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a; --card: #1e1e22; --tile: #26262b;
    --line: #2c2c31; --line-strong: #3d3d43;
    --fg: #ecebe5; --body: #c3c1b8; --muted: #8b8a80; --dim: #6f6e67;
    --accent: #d9ad4a; --quote-bg: #212126;
    --shadow: 0 4px 14px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 40px 20px 72px; }
h1 { font-size: 28px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
.lede { max-width: 46rem; margin: 0 0 10px; color: var(--body); font-size: .95em; }
.muted { color: var(--muted); font-size: .86em; margin: 4px 0 0; }
a { color: var(--fg); }
header { margin-bottom: 28px; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 17px; text-decoration: none; color: inherit; outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow);
}
.card:focus-visible { box-shadow: var(--shadow), 0 0 0 2px var(--line-strong); }
.hd { display: flex; gap: 13px; align-items: center; }
/* Each problem gets a small grid glyph derived from its id. These are grid
   problems, so the mark is a scrap of one. */
.px { width: 52px; height: 52px; flex: none; background: var(--tile);
      border-radius: 8px; padding: 6px; }
.px rect { fill: var(--accent); }
.name { font-weight: 600; color: var(--fg); }
.meta { color: var(--muted); font-size: .78em; margin-top: 3px;
        font-variant-numeric: tabular-nums; }
.desc { color: var(--body); font-size: .86em; line-height: 1.35;
        margin: 10px 0 12px; }
.stats {
  display: block; margin-top: auto; padding: 7px 10px;
  background: var(--quote-bg); border-left: 3px solid var(--line-strong);
  border-radius: 0 6px 6px 0; font-size: .76em; line-height: 1.5;
}
.stats span { color: var(--muted); }
.stats b { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: .9em; }
footer { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line);
         color: var(--muted); font-size: .82em; }
pre { overflow-x: auto; padding: 1rem; background: var(--card);
      border: 1px solid var(--line); border-radius: 10px; font-size: .82em; }
@media (max-width: 520px) { .wrap { padding: 28px 16px 56px; } h1 { font-size: 24px; } }
