/* Aziq Test
   The look borrows from paper answer sheets: pale green sheet paper,
   ballpoint-blue marks and a highlighter for notes. Atkinson Hyperlegible
   is used everywhere because it was designed for easy reading. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
}

:root {
  --paper: #f3f6f1;
  --sheet: #ffffff;
  --ink: #19222f;
  --ink-2: #4a5852;
  --rule: #cfddd2;
  --rule-strong: #93aa99;
  --pen: #2340c8;
  --pen-hover: #1a32a3;
  --pen-ink: #ffffff;
  --pen-soft: #e6eafb;
  --mark: #fbefb4;
  --mark-edge: #e7cf5c;
  --alert: #b42318;
  --alert-soft: #fdeceb;
  --fig-mid: #a7b2ad;

  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 6px;
  --wrap: 46rem;
  --gutter: 1.25rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a17;
    --sheet: #18231f;
    --ink: #e6eee9;
    --ink-2: #a9b9b1;
    --rule: #2b3c35;
    --rule-strong: #4c6458;
    --pen: #93a6ff;
    --pen-hover: #b3c0ff;
    --pen-ink: #0e1533;
    --pen-soft: #212c52;
    --mark: #3a3418;
    --mark-edge: #8a7a2c;
    --alert: #ff9d90;
    --alert-soft: #3b1f1b;
    --fig-mid: #6d7d76;
    color-scheme: dark;
  }
}

/* Base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3rem); margin: 0 0 0.75rem; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem); margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.75rem 0 0.4rem; letter-spacing: -0.005em; }

p, ul, ol, dl { margin: 0 0 1rem; }
p, li, dd { max-width: 68ch; }

a { color: var(--pen); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--pen-hover); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; border-radius: 2px; }
[tabindex="-1"]:focus { outline: none; }

::selection { background: var(--mark); color: var(--ink); }

img, svg { max-width: 100%; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 42rem; }

.lede { font-size: 1.2rem; line-height: 1.5; color: var(--ink); }
.byline { color: var(--ink-2); font-size: 0.95rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 0.75rem; top: -3rem;
  background: var(--pen); color: var(--pen-ink);
  padding: 0.5rem 0.9rem; border-radius: var(--radius);
  z-index: 10;
}
.skip-link:focus { top: 0.75rem; color: var(--pen-ink); }

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

.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header__inner {
  max-width: 64rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4rem;
}

.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 2.6rem; height: auto; overflow: visible; }
.brand__mark circle { fill: none; stroke: var(--rule-strong); stroke-width: 1.5; }
.brand__mark circle.is-filled { fill: var(--pen); stroke: var(--pen); }
.brand__name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }

.site-nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.98rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] {
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em;
}

.site-footer { margin-top: 5rem; border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; color: var(--ink-2); font-size: 0.95rem; }
.site-footer__inner { max-width: 64rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; padding: 0; }
.site-footer__links a { color: var(--ink); }
.site-footer__copy { margin: 0; }

/* Breadcrumbs ------------------------------------------------------------ */

.crumbs { margin: 1.5rem 0 1.75rem; font-size: 0.92rem; color: var(--ink-2); }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.crumbs li + li::before { content: "/"; margin: 0 0.5rem; color: var(--rule-strong); }
.crumbs a { color: var(--ink-2); }

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.7rem 1.35rem;
  border-radius: var(--radius); border: 2px solid transparent;
  font: inherit; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--pen); color: var(--pen-ink); }
.btn--primary:hover { background: var(--pen-hover); color: var(--pen-ink); }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--quiet:hover { border-color: var(--ink); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn[hidden] { display: none; }

/* Notes and alerts ------------------------------------------------------- */

.callout {
  background: var(--mark);
  border-left: 4px solid var(--mark-edge);
  padding: 0.9rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}
.callout p { margin: 0; }

.form-alert {
  background: var(--alert-soft); color: var(--ink);
  border-left: 4px solid var(--alert);
  padding: 0.9rem 1.1rem; margin: 0 0 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.form-alert h2 { font-size: 1.15rem; margin: 0 0 0.3rem; }
.form-alert p { margin: 0; }

.form-success {
  background: var(--pen-soft); border-left: 4px solid var(--pen);
  padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.form-success h2 { margin-top: 0; font-size: 1.25rem; }
.form-success p { margin: 0; }

/* Page heads ------------------------------------------------------------- */

.page-head { margin-bottom: 1.25rem; }
.page-head .lede { margin-bottom: 0.75rem; }
.page-plain h1 { margin-top: 2.5rem; }
.page-plain .crumbs + h1 { margin-top: 0; }

/* The answer sheet ------------------------------------------------------- */

.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.5rem;
  margin: 1.75rem 0 3rem;
  scroll-margin-top: 1rem;
}

.sheet__intro { color: var(--ink-2); margin-bottom: 0.5rem; }
.sheet.is-stepped .sheet__intro { margin-bottom: 0; }

.sheet__progress { margin-bottom: 1rem; }
.sheet__progress[hidden] { display: none; }
.sheet__count { font-weight: 700; margin: 0 0 0.45rem; font-variant-numeric: tabular-nums; }
.sheet__track { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.sheet__fill { height: 100%; width: 0; background: var(--pen); border-radius: 3px; transition: width 220ms ease-out; }

.item {
  border: 0;
  border-top: 1px dashed var(--rule);
  margin: 0;
  padding: 1.4rem 0 1.25rem;
  min-width: 0;
  scroll-margin-top: 1rem;
}
.item:first-of-type { border-top: 0; }
.sheet.is-stepped .item { display: none; border-top: 0; padding-bottom: 0.5rem; }
.sheet.is-stepped .item.is-current { display: block; }

.item__q {
  display: flex; gap: 0.75rem; align-items: baseline;
  padding: 0; margin-bottom: 1.1rem;
  font-size: 1.2rem; font-weight: 700; line-height: 1.4;
  float: left; width: 100%;
}
.item__q + * { clear: both; }
.item__num {
  flex: none;
  min-width: 1.6rem;
  color: var(--pen);
  font-variant-numeric: tabular-nums;
}
.item__text { max-width: 60ch; }
.item__hint { color: var(--ink-2); margin-top: -0.25rem; }
.item__error { color: var(--alert); font-weight: 700; margin: 0 0 0.75rem; }
.item.is-missing .bubble__dot { border-color: var(--alert); }

/* Answer bubbles: the 5-point frequency scale */

.scale {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.25rem;
}
.scale::before {
  /* the printed line that joins the bubbles */
  content: "";
  position: absolute;
  top: 1.25rem; left: 10%; right: 10%;
  height: 2px;
  background: var(--rule);
}

.bubble {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.25rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.bubble input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.bubble__dot {
  position: relative;
  width: 2.25rem; height: 2.25rem;
  border: 2px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--sheet);
  transition: border-color 120ms;
}
.bubble__dot::after {
  /* the pen mark */
  content: "";
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--pen) 70%, var(--sheet)) 0 18%, var(--pen) 60%);
  transform: scale(0);
  transition: transform 160ms cubic-bezier(.3, 1.4, .6, 1);
}
.bubble__label { font-size: 0.98rem; line-height: 1.25; color: var(--ink-2); }

@media (hover: hover) {
  .bubble:hover .bubble__dot { border-color: var(--pen); }
}
.bubble input:checked + .bubble__dot { border-color: var(--pen); }
.bubble input:checked + .bubble__dot::after { transform: scale(1); }
.bubble input:checked ~ .bubble__label { color: var(--ink); font-weight: 700; }
.bubble input:focus-visible + .bubble__dot { outline: 3px solid var(--pen); outline-offset: 3px; }

/* Narrow screens: a vertical list of large tap targets, and a shorter
   page head so the first question is visible without scrolling */
@media (max-width: 34rem) {
  .test-page .crumbs { margin: 1rem 0 1rem; }
  .test-page .lede { font-size: 1.05rem; }
  .test-page .byline { font-size: 0.88rem; margin-bottom: 0; }
  .test-page .callout { margin: 1rem 0; padding: 0.7rem 0.9rem; font-size: 0.98rem; }
  .sheet { padding: 1rem 1rem 1.25rem; margin: 1.25rem calc(var(--gutter) * -0.5) 3rem; }
  .sheet__intro { font-size: 0.95rem; }
  .item { padding-top: 1rem; }
  .item__q { font-size: 1.12rem; }
  .scale { grid-template-columns: 1fr; gap: 0.35rem; }
  .scale::before { top: 1.4rem; bottom: 1.4rem; left: calc(0.75rem + 1.125rem - 1px); right: auto; width: 2px; height: auto; }
  .bubble { flex-direction: row; gap: 0.9rem; padding: 0.3rem 0.75rem; min-height: 3rem; text-align: left; }
  .bubble__label { font-size: 1.05rem; }
}

/* Optional background questions */
.context-q { border: 0; margin: 0 0 1.25rem; padding: 0; min-width: 0; }
.context-q legend { padding: 0; font-weight: 700; margin-bottom: 0.6rem; line-height: 1.4; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.bubble--inline { flex-direction: row; gap: 0.6rem; padding: 0.35rem 0.5rem 0.35rem 0.25rem; min-height: 2.75rem; }
.bubble--inline .bubble__dot { width: 1.75rem; height: 1.75rem; }
.bubble--inline .bubble__label { font-size: 1rem; }

.sheet__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.25rem; }
.sheet__actions [data-next], .sheet__actions [data-submit] { margin-left: auto; }
.sheet:not(.is-stepped) .sheet__actions [data-submit] { margin-left: 0; }
.sheet__privacy { color: var(--ink-2); font-size: 0.9rem; margin: 1rem 0 0; }

@media (max-width: 34rem) {
  .sheet__actions .btn--primary { flex: 1 1 12rem; }
}

/* Article ---------------------------------------------------------------- */

.prose h2 { scroll-margin-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.35rem; }
.prose li::marker { color: var(--ink-2); }
.prose sup { line-height: 0; font-size: 0.72em; margin-left: 0.1em; }
.prose sup a { text-decoration: none; padding: 0 0.1em; }
.prose sup + sup::before { content: ","; color: var(--ink-2); }

.steps { padding-left: 1.6rem; }
.steps li { margin-bottom: 0.7rem; padding-left: 0.2rem; }
.steps li::marker { color: var(--pen); font-weight: 700; }

.table-scroll { overflow-x: auto; margin: 1.25rem 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; }
caption { text-align: left; font-weight: 700; padding-bottom: 0.5rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.75rem 0.65rem 0; border-bottom: 1px solid var(--rule); }
thead th { color: var(--ink-2); font-weight: 700; font-size: 0.92rem; border-bottom-width: 2px; }
tbody th { font-weight: 700; }
.bands caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.faq h3 { margin-top: 1.6rem; }
.sources { font-size: 0.95rem; color: var(--ink-2); padding-left: 1.4rem; }
.sources li { margin-bottom: 0.45rem; scroll-margin-top: 1rem; }
.sources li:target { background: var(--mark); }
.back-to-test { margin-top: 2.5rem; }

/* Results ---------------------------------------------------------------- */

.result-head h1 { max-width: 22ch; }

.tallies {
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.tallies h2 { margin-top: 0; font-size: 1.3rem; }
.tallies__intro { color: var(--ink-2); }
.tally { padding: 1rem 0 0.4rem; border-top: 1px dashed var(--rule); }
.tally:first-of-type { border-top: 0; }
.tally__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.25rem 1rem; }
.tally__head h3 { margin: 0; font-size: 1.1rem; }
.tally__count { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tally__count strong { color: var(--ink); font-size: 1.5rem; }
.tally__row { display: flex; gap: clamp(0.3rem, 1.5vw, 0.6rem); padding: 0.75rem 0 1.6rem; }
.tally__dot {
  position: relative;
  width: clamp(1.4rem, 7vw, 2rem); aspect-ratio: 1;
  border: 2px solid var(--rule-strong); border-radius: 50%;
  flex: none;
}
.tally__dot.is-filled {
  border-color: var(--pen);
  background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--pen) 70%, var(--sheet)) 0 18%, var(--pen) 60%);
  box-shadow: inset 0 0 0 2px var(--sheet);
}
.tally__dot.is-threshold::after {
  content: "5";
  position: absolute; top: calc(100% + 0.2rem); left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem; font-weight: 700; color: var(--ink-2);
  border-top: 2px solid var(--ink-2);
  padding-top: 0.05rem; width: 1.1rem; text-align: center;
}
.tallies__total { margin: 0.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule); font-variant-numeric: tabular-nums; }

.notes p { background: var(--pen-soft); padding: 0.9rem 1.1rem; border-radius: var(--radius); }

.result-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 1rem; }

.answers h2 { margin-bottom: 0.25rem; }
.answers__num { display: inline-block; min-width: 1.6rem; color: var(--pen); font-variant-numeric: tabular-nums; }
.answers__table td { width: 9rem; }
.answers__table tr.is-flagged td { font-weight: 700; }
.answers__table tr.is-flagged td::before {
  content: ""; display: inline-block; width: 0.6rem; height: 0.6rem;
  border-radius: 50%; background: var(--pen); margin-right: 0.45rem; vertical-align: 0.05em;
}

.support { margin-top: 2.5rem; color: var(--ink-2); font-size: 0.95rem; border-top: 1px solid var(--rule); padding-top: 1rem; }

/* Home ------------------------------------------------------------------- */

.home { max-width: 60rem; }

.home .hero { padding: 5rem 0 2.5rem; text-align: center; }
.home .hero h1 { font-size: clamp(2.5rem, 1.4rem + 5vw, 4.25rem); max-width: 20ch; margin-inline: auto; line-height: 1.06; }
.home .hero .lede { max-width: 48ch; margin-inline: auto; color: var(--ink-2); font-size: 1.3rem; }

.tests { margin-top: 1rem; }
.tests h2, .principles h2 { font-size: 1.5rem; }
.tests__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.25rem; }

.test-card {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1.25rem;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.75rem;
  color: var(--ink);
  text-decoration: none;
}
.test-card:hover { border-color: var(--pen); color: var(--ink); }
.test-card:hover .test-card__cta { text-decoration-thickness: 2px; }
.test-card__sheet { display: grid; gap: 0.6rem; padding-bottom: 1.25rem; border-bottom: 1px dashed var(--rule); }
.test-card__row { display: flex; gap: 0.5rem; }
.test-card__row i { width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--rule-strong); border-radius: 50%; }
.test-card__row i.is-filled { background: var(--pen); border-color: var(--pen); }
.test-card__body { display: grid; gap: 0.4rem; align-content: start; }
.test-card__title { font-size: 1.55rem; font-weight: 700; letter-spacing: -0.015em; }
.test-card__desc { color: var(--ink-2); font-size: 1.05rem; }
.test-card__cta { color: var(--pen); font-weight: 700; font-size: 1.05rem; text-decoration: underline; text-underline-offset: 0.2em; margin-top: 0.5rem; }
.tests__soon { color: var(--ink-2); margin-top: 1.5rem; text-align: center; }

@media (max-width: 34rem) {
  .home .hero { padding: 3rem 0 1.5rem; }
  .home .hero .lede { font-size: 1.15rem; }
  .tests__grid { grid-template-columns: 1fr; }
}

.home-about, .home-tests-overview { margin-top: 3rem; max-width: 46rem; }
.home .faq { margin-top: 3rem; max-width: 46rem; }

.principles { margin-top: 3.5rem; }
.principles dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem 2.5rem; margin-top: 1.25rem; }
.principles dt { font-weight: 700; font-size: 1.12rem; margin-bottom: 0.25rem; }
.principles dd { margin: 0; color: var(--ink-2); }

/* Contact form ----------------------------------------------------------- */

.contact-form { margin-top: 1.5rem; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.field__opt { font-weight: 400; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: var(--sheet);
  border: 2px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.65rem 0.8rem;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.field.has-error input, .field.has-error textarea { border-color: var(--alert); }
.field__error { color: var(--alert); font-weight: 700; margin: 0 0 0.35rem; }
.field__note { color: var(--ink-2); font-size: 0.95rem; }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.link-list { padding-left: 1.2rem; }

/* Ads -------------------------------------------------------------------- */

.ad-slot { margin: 2.5rem 0; min-height: 280px; }
.ad-slot__label { font-size: 0.8rem; color: var(--ink-2); margin: 0 0 0.35rem; }

/* IQ test: figures ------------------------------------------------------- */

.fig { display: block; width: 100%; height: auto; overflow: visible; }
.fig .fig-o { fill: var(--sheet); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.fig .fig-m { fill: var(--fig-mid); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.fig .fig-f { fill: var(--ink); stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.fig .fig-line { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; fill: none; }
.fig .fig-dot { fill: var(--ink); }
.fig .fig-guide { fill: none; stroke: var(--rule-strong); stroke-width: 1.5; stroke-dasharray: 3 4; }
.fig .fig-guide--solid { stroke-dasharray: none; stroke: var(--rule); }
.fig .fig-cell { fill: var(--sheet); stroke: var(--rule-strong); stroke-width: 1.5; }
.fig .fig-missing { fill: var(--pen-soft); stroke: var(--pen); stroke-width: 2.5; stroke-dasharray: 7 6; }
.fig .fig-qmark { fill: var(--pen); font: 700 44px var(--font); }

.iq-figure { margin: 0 0 1.25rem; }
.iq-figure .fig--matrix { max-width: 19rem; margin-inline: auto; }
.iq-figure .fig--sequence { max-width: 26rem; }

.series { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.25rem; padding: 0; }
.series__box {
  min-width: 3rem; height: 3rem; padding: 0 0.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--sheet);
  font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.series__box.is-missing { border: 2.5px dashed var(--pen); color: var(--pen); background: var(--pen-soft); }
.series--small .series__box { min-width: 2.4rem; height: 2.4rem; font-size: 1.05rem; }

/* IQ test: answer choices ------------------------------------------------ */

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.choices--figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.choice {
  position: relative;
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.6rem 0.8rem;
  background: var(--sheet);
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.08rem;
  -webkit-tap-highlight-color: transparent;
}
.choices--figures .choice { flex-direction: column; gap: 0.4rem; padding: 0.6rem 0.5rem 0.75rem; }
.choices--figures .choice__body { width: 100%; max-width: 6.5rem; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

.choice__letter {
  flex: none;
  width: 2rem; height: 2rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--rule-strong); border-radius: 50%;
  font-weight: 700; font-size: 0.95rem; color: var(--ink-2);
  background: var(--sheet);
  transition: background-color 140ms, border-color 140ms, color 140ms;
}
.choice input:checked ~ .choice__letter { background: var(--pen); border-color: var(--pen); color: var(--pen-ink); }
.choice:has(input:checked) { border-color: var(--pen); box-shadow: inset 0 0 0 1.5px var(--pen); }
.choice input:focus-visible ~ .choice__letter { outline: 3px solid var(--pen); outline-offset: 3px; }
@media (hover: hover) {
  .choice:hover { border-color: var(--pen); }
}
.iq-item.is-missing .choice { border-color: var(--alert); }

@media (max-width: 34rem) {
  .choices { grid-template-columns: 1fr; }
  .choices--figures { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem; }
  .choices--figures .choice { padding: 0.45rem 0.25rem 0.5rem; gap: 0.25rem; }
  .choices--figures .choice__letter { width: 1.7rem; height: 1.7rem; font-size: 0.85rem; }
  .choices--figures .choice__body { max-width: 4.5rem; }
  .iq-figure .fig--matrix { max-width: 15rem; }
}

/* IQ result -------------------------------------------------------------- */

.bell-wrap { margin: 1.5rem 0 0.5rem; }
.bell-wrap figcaption { color: var(--ink-2); font-size: 0.92rem; margin-top: 0.25rem; }
.bell { display: block; width: 100%; height: auto; overflow: visible; }
.bell .bell-range { fill: var(--mark-edge); opacity: 0.45; }
.bell .bell-area { fill: var(--pen-soft); }
.bell .bell-curve { fill: none; stroke: var(--ink-2); stroke-width: 2; }
.bell .bell-axis, .bell .bell-tick { stroke: var(--rule-strong); stroke-width: 1.5; }
.bell .bell-label { fill: var(--ink-2); font: 400 14px var(--font); }
.bell .bell-marker { stroke: var(--pen); stroke-width: 3; }
.bell .bell-dot { fill: var(--pen); }
.bell .bell-value { fill: var(--pen); font: 700 22px var(--font); }

.tally__blurb { font-weight: 400; color: var(--ink-2); font-size: 0.95rem; margin-left: 0.35rem; }
.iq-result .tally__row { padding-bottom: 0.75rem; }

.review-item { padding: 1.5rem 0; border-top: 1px dashed var(--rule); }
.review-item__q { display: flex; gap: 0.75rem; align-items: baseline; margin: 0 0 0.35rem; font-size: 1.1rem; line-height: 1.4; }
.review-item__status { font-weight: 700; margin-bottom: 0.9rem; }
.review-item.is-right .review-item__status { color: var(--pen); }
.review-item.is-wrong .review-item__status { color: var(--alert); }
.iq-figure--small .fig--matrix { max-width: 13rem; margin-inline: 0; }
.iq-figure--small .fig--sequence { max-width: 19rem; }
.review-options { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.review-options--figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.review-options li {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.5rem 0.7rem; border: 1.5px solid var(--rule); border-radius: var(--radius);
  background: var(--sheet); max-width: none;
}
.review-options--figures li { flex-direction: column; text-align: center; }
.review-options--figures .choice__body { width: 100%; max-width: 4.5rem; }
.review-options li.is-answer { border-color: var(--pen); box-shadow: inset 0 0 0 1.5px var(--pen); }
.review-options li.is-answer .choice__letter { background: var(--pen); border-color: var(--pen); color: var(--pen-ink); }
.review-options li.is-chosen { border-color: var(--alert); border-style: dashed; }
.review-tag { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.review-options li.is-answer .review-tag { color: var(--pen); }
.review-options li.is-chosen .review-tag { color: var(--alert); }
.review-item__explain { color: var(--ink-2); margin-top: 0.75rem; }

@media (max-width: 34rem) {
  .review-options { grid-template-columns: 1fr; }
  .review-options--figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Certificate ------------------------------------------------------------ */

.cert-page { max-width: 60rem; }
.cert-tools { max-width: 42rem; }
.cert-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.cert-form .field { flex: 1 1 16rem; margin: 0; }

.cert {
  margin: 2rem 0;
  background: #fffdf6;
  color: #19222f;
  border-radius: var(--radius);
  padding: clamp(0.6rem, 2vw, 1rem);
  border: 1px solid var(--rule);
}
.cert__inner {
  border: 3px double #2340c8;
  padding: clamp(0.75rem, 2.5vw, 1.4rem);
  background: radial-gradient(circle at 12px 12px, #cfddd2 2.5px, transparent 3px) 0 0 / 24px 24px #fffdf6;
}
.cert__content {
  background: #fffdf6;
  border: 1px solid #cfddd2;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 3rem);
  text-align: center;
}
.cert__brand { display: flex; justify-content: center; align-items: center; gap: 0.5rem; font-weight: 700; margin: 0 0 0.5rem; max-width: none; }
.cert__brand .brand__mark circle { stroke: #93aa99; }
.cert__brand .brand__mark circle.is-filled { fill: #2340c8; stroke: #2340c8; }
.cert__title { font-size: clamp(1.7rem, 1.2rem + 2.5vw, 2.8rem); margin: 0.75rem 0 1rem; }
.cert__line { margin: 0 auto 0.5rem; max-width: none; }
.cert__name {
  font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem); font-weight: 700; letter-spacing: -0.02em;
  margin: 0.4rem auto 0.6rem; max-width: none;
  border-bottom: 2px solid #19222f; display: table; padding: 0 1.5rem 0.2rem;
}
.cert__name.is-placeholder { color: #93aa99; }
.cert__scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 3rem; margin: 1.75rem 0 1.5rem; }
.cert__scores dt { font-size: 0.9rem; color: #4a5852; }
.cert__scores dd { margin: 0; font-size: 1.8rem; font-weight: 700; color: #2340c8; font-variant-numeric: tabular-nums; }
.cert__note { font-size: 0.82rem; color: #4a5852; margin: 0 auto; max-width: 52ch; }

/* Typing test ------------------------------------------------------------ */

.tt { padding: 0; overflow: hidden; }
.tt__controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule);
}
.tt__durations { display: flex; gap: 0.5rem; }
.tt__dur-btn { min-height: 2.25rem; padding: 0.35rem 0.9rem; font-size: 0.95rem; }
.tt__dur-btn.is-active { background: var(--pen); color: var(--pen-ink); border-color: var(--pen); }
.tt__stats { display: flex; align-items: center; gap: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tt__timer { font-size: 1.5rem; color: var(--pen); min-width: 3.5rem; text-align: right; }
.tt__wpm-live { font-size: 1rem; color: var(--ink-2); }
.tt__wpm-live span { font-size: 1.3rem; color: var(--ink); }

.tt__text-area { position: relative; }
.tt__text {
  padding: 1.25rem 1.25rem 0;
  font-size: 1.25rem; line-height: 1.85;
  height: 10rem; overflow-y: auto;
  color: var(--ink-2);
  font-family: var(--font);
  white-space: pre-wrap; word-break: break-word;
  user-select: none;
}
.tt__input {
  display: block; width: 100%;
  padding: 0.9rem 1.25rem;
  font: inherit; font-size: 1.1rem;
  color: var(--ink); background: var(--sheet);
  border: 0; border-top: 1px dashed var(--rule);
  outline: none; resize: none;
}
.tt__input:focus { background: var(--pen-soft); }
.tt__input:disabled { opacity: 0.6; cursor: not-allowed; }

.tt__overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--sheet) 85%, transparent);
  backdrop-filter: blur(2px);
}
.tt__overlay[hidden] { display: none; }

.tt__actions { padding: 0.75rem 1.25rem; }
.tt__actions [hidden] { display: none; }

.tt-correct { color: var(--pen); }
.tt-error { color: var(--alert); background: var(--alert-soft); border-radius: 2px; }
.tt-cursor { border-left: 2px solid var(--pen); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { border-color: transparent; } }

.tt-result__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem; margin: 1.25rem 0;
}
.tt-result__stat { text-align: center; padding: 1rem 0.5rem; border: 1px solid var(--rule); border-radius: var(--radius); }
.tt-result__stat--main { border-color: var(--pen); background: var(--pen-soft); }
.tt-result__value { display: block; font-size: 2rem; font-weight: 700; color: var(--pen); font-variant-numeric: tabular-nums; }
.tt-result__stat--main .tt-result__value { font-size: 2.5rem; }
.tt-result__label { display: block; font-size: 0.92rem; color: var(--ink-2); margin-top: 0.15rem; }
.tt-result__bench { margin-top: 1.5rem; }
.tt-result__bench h3 { margin-top: 0; }

@media (max-width: 34rem) {
  .tt__controls { padding: 0.75rem 1rem; }
  .tt__dur-btn { padding: 0.3rem 0.65rem; font-size: 0.88rem; }
  .tt__text { padding: 1rem; font-size: 1.1rem; height: 8rem; }
  .tt__input { padding: 0.75rem 1rem; }
  .tt-result__grid { grid-template-columns: repeat(2, 1fr); }
  .tt-result__stat--main { grid-column: span 2; }
}

/* Motion & print --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  :root { --paper: #fff; --sheet: #fff; }
  body { font-size: 11pt; }
  .site-header nav, .site-footer nav, .skip-link, .result-actions, .ad-slot, .crumbs { display: none !important; }
  .site-footer { margin-top: 2rem; padding: 1rem 0 0; }
  .tallies, .callout, .notes p { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .tally__dot.is-filled { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* The certificate prints on its own page */
  body:has(.cert) .site-header, body:has(.cert) .site-footer, .cert-tools { display: none !important; }
  .cert-page { padding: 0; max-width: none; }
  .cert { margin: 0; border: 0; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@page { margin: 12mm; }
