/* Shared look for the site's content pages (home, progress). The games keep
   their own full-screen styles but use the same colours. */

:root {
  --bg: #0e1a24;
  --panel: #16283a;
  --field: #0f1e2b;
  --border: #2c4560;
  --line: #23394f;
  --text: #e6eef5;
  --muted: #8fa6ba;
  --accent: #4fb3ff;
  --good: #4cd18a;
  --bad: #ff6b6b;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding-inline: 16px; }

h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 44px); margin: 0 0 12px; }
h2 { font-size: 26px; margin: 0 0 8px; }
h3 { font-size: 19px; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 18px; max-width: 62ch; margin: 0 0 24px; }
.muted { color: var(--muted); }

/* ---- Header & footer ---- */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-block: 14px; }
.brand { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: 0.01em; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.site-nav { display: flex; gap: 20px; margin-left: auto; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

main { flex: 1; }

.site-footer { border-top: 1px solid var(--line); margin-top: 64px; }
.site-footer .wrap { padding-block: 24px; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0 0 6px; max-width: 80ch; }

/* ---- Sections ---- */

.section { padding-block: 40px 8px; }
.section-head { margin-bottom: 20px; }
.section-head p { color: var(--muted); margin: 0; max-width: 62ch; }

.hero { padding-block: 56px 24px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.button {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: #04121e; font-weight: 600; }
.button:hover { filter: brightness(1.1); }

/* ---- Selection stages ---- */

.stages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; counter-reset: stage; }
.stages li { counter-increment: stage; padding: 14px 16px; border-top: 3px solid var(--border); background: var(--panel); border-radius: 0 0 8px 8px; }
.stages li::before { content: counter(stage); display: block; color: var(--accent); font-weight: 700; font-size: 14px; }
.stages b { display: block; margin-bottom: 2px; }
.stages span { color: var(--muted); font-size: 14px; }

/* ---- Test catalogue ---- */

.group { margin-bottom: 32px; }
.group > h3 { margin-bottom: 2px; }
.group > p { color: var(--muted); margin: 0 0 14px; max-width: 62ch; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
a.card:hover, a.card:focus-visible { border-color: var(--accent); outline: none; }
.card h4 { margin: 0; font-size: 18px; color: var(--accent); }
.card.soon { opacity: 0.6; border-style: dashed; }
.card.soon h4 { color: var(--text); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; font-size: 13px; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.chip.score { border-color: var(--accent); color: var(--text); }
.chip.soon { border-style: dashed; }

/* ---- Progress ---- */

.summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.test-progress { padding: 18px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.test-progress header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.test-progress h3 { margin: 0; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.figures div { font-size: 13px; color: var(--muted); }
.figures b { display: block; font-size: 24px; color: var(--text); font-variant-numeric: tabular-nums; }
.spark { display: block; width: 100%; height: 56px; margin-bottom: 12px; }
.recent { width: 100%; border-collapse: collapse; font-size: 14px; }
.recent th, .recent td { text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.recent th { color: var(--muted); font-weight: 500; }
.recent td.num, .recent th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

.empty { padding: 28px; background: var(--panel); border: 1px dashed var(--border); border-radius: 10px; }
.empty p { margin: 0 0 14px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
