/* TapReflex — single stylesheet, zero external dependencies */
:root {
  --bg: #0f1420;
  --bg-soft: #171e2e;
  --text: #e8ecf4;
  --muted: #9aa5b8;
  --accent: #ffd166;
  --ready: #2b3a55;
  --wait: #c0392b;
  --go: #1e9e5a;
  --line: #26304a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: inherit; }

/* header */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(15,20,32,.92); backdrop-filter: blur(6px);
  z-index: 10;
}
.brand { font-weight: 700; text-decoration: none; font-size: 18px; letter-spacing: .5px; }
.site-head nav a { text-decoration: none; margin-left: 18px; color: var(--muted); }
.site-head nav a.active, .site-head nav a:hover { color: var(--accent); }

main { max-width: 860px; margin: 0 auto; padding: 28px 20px 60px; }

/* home */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(26px, 6vw, 42px); line-height: 1.35; margin: 0 0 14px; }
.hero h1 em { color: var(--accent); font-style: normal; }
.lead { color: var(--muted); max-width: 560px; margin: 0 auto 26px; }
.cta {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 18px;
  background: var(--accent); color: #1a1408; padding: 13px 34px; border-radius: 999px;
}
.cta:active { transform: scale(.97); }
h2 { font-size: 22px; margin: 38px 0 14px; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--bg-soft); }
.steps li span { color: var(--accent); font-weight: 700; margin-right: 8px; }
strong { color: var(--accent); }

.grade-table { width: 100%; border-collapse: collapse; background: var(--bg-soft); border-radius: var(--radius); overflow: hidden; }
.grade-table caption { caption-side: top; text-align: left; color: var(--muted); font-size: 14px; padding-bottom: 8px; }
.grade-table th, .grade-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.grade-table thead th { color: var(--muted); font-weight: 600; }
.note { color: var(--muted); font-size: 14px; }
.roadmap { list-style: none; padding: 0; display: grid; gap: 8px; }
.roadmap li { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--muted); }

/* test page */
.page-title { margin: 10px 0 4px; font-size: 26px; }
.page-desc { color: var(--muted); margin-top: 0; }
.arena {
  margin: 18px 0; min-height: 320px; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation; background: var(--ready);
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s linear; padding: 20px;
}
/* The panel is a div with role=button and tabindex=0, so Tab has somewhere to land. */
.arena:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.arena.state-wait { background: var(--wait); }
.arena.state-go { background: var(--go); }
.arena.state-false { background: #7a4a1f; }
.arena .big { font-size: clamp(28px, 7vw, 46px); font-weight: 800; margin: 0; }
.arena .small { font-size: 15px; opacity: .85; margin: 8px 0 0; }
.ms-hero-num { font-size: clamp(48px, 14vw, 96px); font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ms-unit { font-size: 20px; color: var(--muted); }

.stats { display: flex; gap: 12px; margin: 16px 0; }
.stat-card {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; text-align: center;
}
.stat-card b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: 13px; }

.attempts { margin: 14px 0; }
.attempt-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.attempt-row i { width: 58px; font-style: normal; color: var(--muted); }
.bar-track { flex: 1; height: 12px; background: var(--bg-soft); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--go), var(--accent)); border-radius: 6px; width: 0; transition: width .3s ease; }
.attempt-row u { text-decoration: none; width: 74px; text-align: right; font-variant-numeric: tabular-nums; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.btn {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
  padding: 11px 22px; border-radius: 999px; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--accent); color: #1a1408; border-color: var(--accent); font-weight: 700; }
.btn[disabled] { opacity: .5; cursor: default; }
[hidden] { display: none !important; }

/* assessment against published norms */
.assess { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft); padding: 16px 18px; margin: 18px 0; }
.assess h2 { font-size: 19px; margin: 0 0 10px; }
.assess p { margin: 8px 0; font-size: 15px; }
.assess-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.assess-row label { color: var(--muted); font-size: 14px; }
.assess select {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit;
}
.assess-keep { color: var(--muted); font-size: 13px; }
.assess-verdict { color: var(--accent); font-weight: 600; }
.assess-figs { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 4px; }
.assess-figs > div { flex: 1 1 140px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.assess-figs dt { color: var(--muted); font-size: 13px; }
.assess-figs dd { margin: 4px 0 0; font-size: 20px; font-variant-numeric: tabular-nums; }
.assess-bar { position: relative; height: 22px; margin: 14px 0 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; }
.assess-bar .band-shade { position: absolute; top: 0; bottom: 0; background: var(--ready); border-radius: 8px; }
.assess-bar .band-marker { position: absolute; top: -4px; width: 4px; height: 30px; background: var(--accent); border-radius: 2px; }
.assess-scale { color: var(--muted); font-size: 14px; }
.cite { color: var(--muted); }
.grade-badge { display: inline-block; padding: 3px 14px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 14px; color: var(--accent); }
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--muted); }

/* 404 */
.notfound { text-align: center; padding: 80px 0; }
.notfound .big-emoji { font-size: 64px; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding: 24px 20px 40px; text-align: center; color: var(--muted); font-size: 14px; }
.site-foot nav { margin-bottom: 8px; }
.site-foot a { color: var(--muted); }

@media (max-width: 560px) {
  .stats { flex-direction: column; }
  .arena { min-height: 280px; }
  .assess-row { gap: 8px; }
  .assess select { flex: 1 1 140px; }
  .assess-figs > div { flex: 1 1 100%; }
}

/* article typography */
article { max-width: 720px; margin: 0 auto; }
article h2 { margin-top: 44px; }
article p { margin: 14px 0; }
.bullets { padding-left: 22px; }
.bullets li { margin: 8px 0; }
code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; font-size: 14px; }
.cta { margin-top: 10px; }
