/* Візуальна мова: мінімалізм у дусі сучасних держсервісів (чорне на світло-сірому,
   кнопки-пігулки, 2px розділювачі, пастельна градієнтна лінія) — без державної символіки. */
:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #000000;
  --muted: #606060;
  --line: #000000;
  --soft-line: #dcdcdc;
  --link: #004bc1;
  --btn: #000000;
  --btn-ink: #ffffff;
  --ok: #1b7a43;
  --ok-bg: #e3f4e9;
  --bad: #b10e1e;
  --bad-bg: #ffe6e6;
  --warn-bg: #fff4d7;
  --accent-grad: linear-gradient(90deg, #a9c1f7 0%, #9ee6d2 50%, #f2d37a 100%);
  --hero-grad: radial-gradient(80% 120% at 90% -20%, rgba(242, 211, 122, .55) 0%, rgba(242, 211, 122, 0) 60%),
    radial-gradient(90% 120% at -10% 130%, rgba(120, 160, 245, .45) 0%, rgba(120, 160, 245, 0) 70%),
    linear-gradient(100deg, #d9e8fb 0%, #dcefe6 55%, #e6f4f2 100%);
  --focus: #0073e6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f10;
    --surface: #1a1a1c;
    --text: #f2f2f2;
    --muted: #a8a8ad;
    --line: #f2f2f2;
    --soft-line: #33343a;
    --link: #8cb4ff;
    --btn: #f2f2f2;
    --btn-ink: #000000;
    --ok: #74d69c;
    --ok-bg: #16301f;
    --bad: #ff8a80;
    --bad-bg: #3a1d1b;
    --warn-bg: #3a3115;
    --hero-grad: radial-gradient(80% 120% at 90% -20%, rgba(242, 211, 122, .18) 0%, rgba(242, 211, 122, 0) 60%),
      radial-gradient(90% 120% at -10% 130%, rgba(120, 160, 245, .22) 0%, rgba(120, 160, 245, 0) 70%),
      linear-gradient(100deg, #17202c 0%, #15231d 55%, #152523 100%);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 16px/24px "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.02em;
}
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
strong, b { font-weight: 500; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

/* шапка */
header.top { background: var(--surface); position: relative; }
header.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent-grad); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { font-weight: 500; font-size: 18px; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo span { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav.top { display: flex; gap: 8px; align-items: center; }
nav.top a {
  font-size: 13px; line-height: 20px; color: var(--text); text-decoration: none;
  padding: 8px 14px; border-radius: 40px;
}
nav.top a:hover { background: var(--bg); }
nav.top a.pill { background: var(--btn); color: var(--btn-ink); }
@media (max-width: 560px) { nav.top a { padding: 8px 10px; } }

/* загальне */
main { padding: 32px 0 64px; }
.narrow { max-width: 760px; }
h1 { font-weight: 400; font-size: 28px; line-height: 32px; margin: 12px 0 16px; letter-spacing: -0.02em; }
h2 { font-weight: 400; font-size: 24px; line-height: 28px; margin: 40px 0 16px; padding-top: 16px; border-top: 2px solid var(--line); }
@media (min-width: 768px) { h1 { font-size: 38px; line-height: 40px; } }
.crumbs { font-size: 12px; line-height: 16px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.lead { color: var(--muted); }

.hero { background: var(--hero-grad); padding: 40px 0 48px; }
.hero h1 { margin-top: 0; }
.hero .lead { color: var(--text); max-width: 680px; font-size: 18px; line-height: 28px; }
.hero + main { padding-top: 8px; }

.card { background: var(--surface); padding: 24px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid a.card {
  text-decoration: none; color: var(--text); border-top: 2px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; min-height: 140px;
  font-size: 18px; line-height: 24px; font-weight: 400;
}
.grid a.card strong { font-weight: 400; }
.grid a.card:hover { background: var(--surface); box-shadow: inset 0 -2px 0 0 transparent; }
.grid a.card:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.grid .count { color: var(--muted); font-size: 13px; line-height: 20px; margin-top: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--btn); color: var(--btn-ink); border: 2px solid var(--btn); border-radius: 40px;
  padding: 14px 26px; font: inherit; font-weight: 400; text-decoration: none; cursor: pointer;
  min-height: 56px;
}
.btn:hover { background: transparent; color: var(--text); }
.btn.secondary { background: transparent; color: var(--text); }
.btn.secondary:hover { background: var(--btn); color: var(--btn-ink); }
.btn:disabled { background: #ccc; border-color: #ccc; color: #fff; cursor: default; }

/* питання */
.options { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.options button {
  width: 100%; text-align: left; font: inherit; color: var(--text); letter-spacing: inherit;
  background: var(--surface); border: 2px solid transparent; border-radius: 16px;
  padding: 14px 16px; cursor: pointer; display: flex; gap: 12px; align-items: flex-start;
}
.options button:hover:not(:disabled) { border-color: var(--line); }
.options button:disabled { cursor: default; }
.options .letter {
  font-weight: 500; min-width: 28px; height: 28px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; border: 2px solid var(--line); font-size: 13px; flex: none;
}
.options .correct { border-color: var(--ok); background: var(--ok-bg); }
.options .correct .letter { border-color: var(--ok); color: var(--ok); }
.options .wrong { border-color: var(--bad); background: var(--bad-bg); }
.options .wrong .letter { border-color: var(--bad); color: var(--bad); }
.answer { position: relative; border-top: 2px solid var(--ok); }
.answer.hidden { display: none; }
.answer p { margin: 8px 0; }
blockquote {
  margin: 16px 0 4px; padding: 12px 16px; background: var(--bg); color: var(--text);
  border-left: 2px solid transparent; border-image: var(--accent-grad) 1;
}
blockquote small { color: var(--muted); font-size: 12px; }
.notice { background: var(--warn-bg); padding: 12px 16px; font-size: 14px; line-height: 20px; margin: 16px 0 0; }
.qlist { padding: 0; margin: 32px 0 0; list-style: none; counter-reset: q; border-top: 2px solid var(--line); }
.qlist li { counter-increment: q; border-bottom: 1px solid var(--soft-line); }
.qlist li a { display: flex; gap: 12px; padding: 12px 0; color: var(--text); text-decoration: none; }
.qlist li a::before { content: counter(q); color: var(--muted); min-width: 32px; font-variant-numeric: tabular-nums; }
.qlist li a:hover { text-decoration: underline; }
.qlist li.done a::after { content: "✓"; margin-left: auto; color: var(--ok); font-weight: 500; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.pager a { color: var(--text); }
.cta { margin: 32px 0 0; display: flex; gap: 12px; flex-wrap: wrap; }
.hero .cta { margin-top: 24px; }

/* тест */
.test-q { margin-bottom: 16px; border-top: 2px solid var(--line); }
.result { font-size: 24px; line-height: 28px; font-weight: 400; }
select {
  font: inherit; letter-spacing: inherit; padding: 14px 44px 14px 20px; border-radius: 40px;
  border: 2px solid var(--line); background: var(--surface); color: var(--text); max-width: 100%;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23808080' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center;
}
.timer { font-variant-numeric: tabular-nums; color: var(--muted); }

/* підвал */
footer { background: #000; color: #a0a4ab; font-size: 13px; line-height: 20px; padding: 40px 0; }
footer .wrap { border-top: 2px solid rgba(255, 255, 255, .3); padding-top: 24px; }
footer strong { color: #fff; font-weight: 400; }
footer a { color: #8cb4ff; }
