/* Colours follow the Stoat web client's dark Material theme. */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format("woff2"); }

:root {
  --bg: #1a1b20;
  --surface: #24252b;
  --surface-high: #2e3038;
  --outline: #44474f;
  --text: #e3e2e9;
  --muted: #a3a6b4;
  --primary: #b7c4ff;
  --on-primary: #1d2c61;
  --tonal: #434a5f;
  --on-tonal: #dce1f9;
  --radius: 28px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 10px; }
.brand .sub { color: var(--muted); font-weight: 500; }

main { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
h1 { margin: 0 0 6px; font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 40px 4px 16px; font-size: 20px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
}
.loading { color: var(--muted); }

.hero { display: flex; align-items: center; gap: 28px; padding: 32px; }
.hero-icon { width: 120px; height: 120px; border-radius: 32px; background: #101823; flex-shrink: 0; }
.hero p { margin: 0 0 18px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.hero .small { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: filter 0.15s;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.tonal { background: var(--tonal); color: var(--on-tonal); }
.btn.small { min-height: 34px; padding: 0 16px; font-size: 13px; }
.btn .size { opacity: 0.7; font-size: 12px; }

.chip {
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--outline);
  color: var(--muted);
  font-size: 13px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.platform { display: flex; flex-direction: column; gap: 14px; outline: 2px solid transparent; transition: outline-color 0.2s; }
.platform.current { outline-color: var(--primary); }
.platform-head { display: flex; align-items: center; gap: 14px; }
.platform-head svg { width: 36px; height: 36px; fill: var(--primary); flex-shrink: 0; }
.platform-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.platform-head .badge { margin-left: auto; font-size: 12px; color: var(--on-primary); background: var(--primary); padding: 2px 10px; border-radius: 999px; }
.downloads { display: flex; flex-direction: column; gap: 8px; }
.downloads .btn { justify-content: space-between; }
.platform .hint { margin: 0; font-size: 13px; color: var(--muted); }
.platform ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.platform code { background: var(--surface-high); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

.list { padding: 8px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 16px; font-weight: 500; }
.crumbs span { color: var(--muted); }
.row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: 16px;
  color: var(--text);
}
.row:hover { background: var(--surface-high); text-decoration: none; }
.row svg { width: 22px; height: 22px; fill: var(--muted); }
.row.dir svg { fill: var(--primary); }
.row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 16px; color: var(--muted); }

footer { max-width: 1080px; margin: 48px auto 32px; padding: 0 24px; text-align: center; }

@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; padding: 28px 20px; }
  .hero-actions { justify-content: center; }
  .row { grid-template-columns: 24px 1fr auto; }
  .row .date { display: none; }
}
