:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #182230;
  --muted: #526071;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --line: #dce2ea;
  --ok-bg: #e7f6ee;
  --ok-ink: #14532d;
  --bad-bg: #fdecec;
  --bad-ink: #7f1d1d;
  --shadow: 0 8px 24px rgba(24, 34, 48, 0.06);
  --radius: 14px;
  --content: 1180px;
  --quiz: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--content), calc(100% - 32px)); margin: 0 auto; }
.quiz-wrap { width: min(var(--quiz), calc(100% - 32px)); margin: 0 auto; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 4;
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 72px; flex-wrap: wrap; padding: 10px 0; }
.brand { color: var(--text); text-decoration: none; font-weight: 750; font-size: 22px; letter-spacing: -0.03em; }
.nav { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-size: 16px; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 650; }
.nav-toggle, .button, .answer, .pager button {
  font: inherit;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
}
.nav-toggle {
  display: none;
  min-height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border-color: var(--line);
}
.search { margin-left: auto; display: flex; gap: 8px; }
.search input, .filters select, .filters input {
  font: inherit;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
}
.search input { width: 220px; }

.hero { padding: 40px 0 12px; }
.hero h1 { font-size: 42px; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 12px; max-width: 16ch; }
.lede { font-size: 20px; max-width: 42rem; margin: 0 0 20px; }
.section { padding: 12px 0 28px; }
.section h2 { font-size: 28px; margin: 0 0 14px; }
.muted { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.chips a, .tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card a.card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.cover { aspect-ratio: 16 / 9; background: #e8eef6; }
.cover img, .cover svg { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.eyebrow { margin: 0; color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.card h3, .card h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.meta { color: var(--muted); font-size: 16px; margin: 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
}
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.button:disabled { opacity: 0.65; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.crumbs { font-size: 16px; color: var(--muted); margin: 18px 0; }
.crumbs a { color: var(--muted); }
.intro h1, .page-title { font-size: 36px; line-height: 1.2; margin: 0 0 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); margin: 12px 0; padding: 0; }
.facts div { min-height: 32px; display: flex; align-items: center; }
.push-note, .push-wait, .attempt-note, .callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.prose p { margin: 0 0 14px; }
.figure-credit { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

.progress-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.bar { height: 8px; background: #e6ebf2; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.question-text { font-size: 28px; line-height: 1.3; margin: 18px 0; }
.answers { display: grid; gap: 10px; }
.answer {
  min-height: 52px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.answer-key {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-weight: 700;
  flex: 0 0 auto;
}
.answer.is-correct { background: var(--ok-bg); border-color: #86efac; }
.answer.is-wrong { background: var(--bad-bg); border-color: #fca5a5; }
.answer small { display: block; font-size: 14px; font-weight: 700; }
.explanation { margin-top: 14px; }
.review { display: grid; gap: 12px; }
.review article { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.score { font-size: 42px; margin: 0; letter-spacing: -0.03em; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pager button, .pager a { min-height: 44px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; display: inline-flex; align-items: center; border-radius: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 28px; padding: 28px 0 40px; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 12px 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text); }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 700px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding-bottom: 8px; }
  .nav.is-open { display: flex; }
  .search { margin-left: 0; width: 100%; }
  .search input { flex: 1; width: auto; }
  .grid { grid-template-columns: 1fr; }
  .question-text { font-size: 22px; }
  .intro h1, .page-title { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
