/* IQ Centre. Test-booklet paper, graphite ink, answer-sheet green-grey rules; one green for actions,
   examiner's red only for the missing piece and "you are here". Type: IBM Plex Serif for display and scores,
   IBM Plex Sans for everything you read and tap. */
@font-face { font-family: "Plex Sans"; src: url(/assets/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/assets/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/assets/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url(/assets/fonts/ibm-plex-serif-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url(/assets/fonts/ibm-plex-serif-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Serif"; src: url(/assets/fonts/ibm-plex-serif-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #F4F6F4;
  --sheet: #FFFFFF;
  --ink: #1F2328;
  --ink-2: #4A535B;
  --ink-3: #5F6870;
  --rule: #D6DDD8;
  --rule-2: #C2CBC6;
  --mark: #1F6F5C;
  --mark-ink: #FFFFFF;
  --mark-soft: #E3EFEA;
  --examiner: #C2412D;
  --serif: "Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "Plex Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --wrap: 1120px;
  --gutter: 24px;
  color-scheme: light;
}
@media (max-width: 640px) { :root { --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { max-width: 100%; display: block; }
a { color: var(--mark); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 1.6rem + 3vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ── header ── */
.top { position: sticky; top: 0; z-index: 20; background: rgba(244, 246, 244, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 500 1.15rem/1 var(--serif); }
.brand svg { width: 26px; height: 26px; }
.top nav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 0.95rem; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top nav .btn { color: var(--mark-ink); }
@media (max-width: 640px) { .top nav .hide-sm { display: none; } .top nav { gap: 14px; } }
.brand, .top nav a { white-space: nowrap; }
/* phones: bigger tap targets, one "Start the test" on the home screen, price rows stacked, a compact cookie note */
@media (max-width: 560px) {
  .top nav a:not(.btn) { padding: 12px 2px; }
  .home .top nav .btn { display: none; }
  .btn.small { min-height: 44px; }
  .foot ul { gap: 0; }
  .foot ul a { display: inline-block; padding: 10px 0; }
  .price .row { flex-direction: column; gap: 2px; }
  .price .row span { text-align: left; }
  .cookie { left: 10px; right: 10px; bottom: 10px; padding: 12px 14px; }
  .cookie p { font-size: 0.85rem; line-height: 1.45; }
  .cookie .btns { margin-top: 8px; }
  .cookie .btn { min-height: 44px; flex: 1; }
}
body.testing .top nav { display: none; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r); border: 1px solid transparent;
  background: var(--mark); color: var(--mark-ink); font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 120ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.btn:hover { background: #185C4C; }
.btn:active { transform: scale(0.98); }
.btn[disabled] { background: #9DB3AB; cursor: not-allowed; transform: none; }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn.quiet:hover { background: var(--sheet); border-color: var(--ink-3); }
.btn.danger { background: var(--examiner); }
.btn.danger:hover { background: #A63522; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn.block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--mark); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ── the lattice background: faint dots, and a hidden layer of shapes that the pointer uncovers ── */
.lattice { position: relative; isolation: isolate; overflow: hidden; }
/* dots sit at 14px + 28px steps, exactly where the hidden shapes are, so under the pointer each dot becomes a shape */
.lattice::before { content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background-image: radial-gradient(circle at 14px 14px, var(--rule-2) 1.2px, transparent 1.7px); background-size: 28px 28px; }
.lattice.awake::before {
  -webkit-mask-image: radial-gradient(circle 160px at var(--x, 70%) var(--y, 40%), transparent 0%, transparent 45%, #000 85%);
  mask-image: radial-gradient(circle 160px at var(--x, 70%) var(--y, 40%), transparent 0%, transparent 45%, #000 85%); }
.lattice .reveal { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 300ms var(--ease);
  -webkit-mask-image: radial-gradient(circle 160px at var(--x, 70%) var(--y, 40%), #000 0%, #000 40%, transparent 85%);
  mask-image: radial-gradient(circle 160px at var(--x, 70%) var(--y, 40%), #000 0%, #000 40%, transparent 85%); }
.lattice.awake .reveal { opacity: 1; }
.lattice .reveal svg { width: 100%; height: 100%; }

/* ── home ── */
.hero { padding: 56px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero h1 { max-width: 16ch; }
/* the test's name, set like the cover of a printed test booklet */
.test-title { font-size: clamp(3.4rem, 2.2rem + 4.6vw, 5.6rem); line-height: 1; letter-spacing: -0.025em; }
.test-facts { display: flex; flex-wrap: wrap; margin: 24px 0 0; border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--rule-2); }
.test-facts div { padding: 10px 22px 12px 0; margin-right: 22px; border-right: 1px solid var(--rule); }
.test-facts div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.test-facts dt { font-size: 0.8rem; color: var(--ink-3); }
.test-facts dd { margin: 2px 0 0; font: 500 1.2rem/1.2 var(--serif); font-variant-numeric: lining-nums; }
.hero .test-facts { max-width: 460px; }
.hero .cta { margin-top: 26px; }
.cover .test-title { margin-bottom: 0; }
.cover .instr { font-size: 1.3rem; margin: 28px 0 8px; }
@media (max-width: 560px) { .test-facts div { padding-right: 14px; margin-right: 14px; } .test-facts dd { font-size: 1.05rem; } }
.hero .lede { margin-top: 18px; font-size: 1.15rem; color: var(--ink-2); max-width: 34ch; }
.hero .cta { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.hero .terms { margin-top: 14px; font-size: 0.875rem; color: var(--ink-2); max-width: 46ch; }
.try { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(31, 35, 40, 0.35); }
.try-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.try-head b { font: 500 1.05rem var(--serif); }
.try-head span { font-size: 0.85rem; color: var(--ink-3); }
.try .rot-stem svg { width: 150px; height: 150px; }
.try .series span { min-width: 46px; font-size: 1.25rem; padding: 10px; }
.try .opts { margin-top: 14px; }
.try .opts.k-rotation { grid-template-columns: repeat(4, 1fr); }
.try .opt[aria-disabled="true"] { cursor: default; }
/* the hero's question is a picture: nothing in it can be pressed */
.try.preview { margin: 0; }
.try.preview .opt { cursor: default; pointer-events: none; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 36px; } .hero { padding: 36px 0 48px; } }

.band-sec { padding: 72px 0; border-top: 1px solid var(--rule); }
.band-sec > .wrap > h2 { max-width: 22ch; }
.band-sec > .wrap > .intro { margin-top: 12px; max-width: 60ch; color: var(--ink-2); }
.areas { margin-top: 36px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.areas > div { padding: 22px 18px 24px; border-left: 1px solid var(--rule); }
.areas > div:first-child { border-left: 0; padding-left: 0; }
.areas .pic { height: 74px; display: flex; align-items: center; margin-bottom: 14px; }
.areas .pic svg { height: 74px; width: auto; }
.areas h3 { font-size: 1.1rem; }
.areas p { margin-top: 6px; font-size: 0.93rem; color: var(--ink-2); }
@media (max-width: 960px) { .areas { grid-template-columns: 1fr 1fr; } .areas > div { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); } .areas > div:nth-child(-n+2) { border-top: 0; } }
@media (max-width: 560px) { .areas { grid-template-columns: 1fr; } .areas > div:nth-child(2) { border-top: 1px solid var(--rule); } }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; margin-top: 32px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 32px; } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 22px 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font: 500 0.95rem var(--serif); }
.steps b { display: block; font-weight: 600; }
.steps span { color: var(--ink-2); font-size: 0.97rem; }

.price { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 26px; }
.price .row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.price .row:last-of-type { border-bottom: 0; }
.price .row b { font-weight: 600; }
.price .row span { text-align: right; color: var(--ink-2); }
.price p { margin-top: 14px; font-size: 0.9rem; color: var(--ink-2); }

.faq { margin-top: 28px; max-width: 760px; }
.faq details { border-top: 1px solid var(--rule); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 6px; top: 24px; width: 10px; height: 10px; border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2); transform: rotate(45deg); transition: transform 200ms var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg); top: 28px; }
.faq details p { padding: 0 0 18px; color: var(--ink-2); max-width: 68ch; }

.guides-list { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.guides-list a { display: block; padding: 20px 20px 22px 0; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--rule); }
.guides-list a b { display: block; font: 500 1.15rem/1.25 var(--serif); }
.guides-list a span { display: block; margin-top: 6px; font-size: 0.92rem; color: var(--ink-2); }
.guides-list a:hover b { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 860px) { .guides-list { grid-template-columns: 1fr; } }

/* ── footer ── */
.foot { margin-top: 0; border-top: 1px solid var(--rule); padding: 40px 0 48px; font-size: 0.9rem; color: var(--ink-2); }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.foot h4 { margin: 0 0 10px; font: 600 0.9rem var(--sans); color: var(--ink); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { color: var(--ink-2); }
.foot .legal-line { grid-column: 1 / -1; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 0.82rem; }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: 1fr 1fr; } .foot .wrap > div:first-child { grid-column: 1 / -1; } }

/* ── items (shared by the hero, the test, the report and practice) ── */
.prompt { font: 500 1.2rem/1.35 var(--serif); margin: 0 0 16px; max-width: 46ch; }
/* Pattern grids: the options are drawn at exactly the size of a grid cell, so "same size" really looks the same.
   --cell comes from the width of whatever holds the puzzle (a container), capped at 97px. */
.q-body, [data-try], figure.example, .review-item { container-type: inline-size; }
.stem, .opts { --gap: 10px; --pad: 6px; --cell: min(97px, calc((100cqi - 3 * var(--gap) - 10px) / 4 - 2 * var(--pad) - 3px)); }
@media (max-width: 560px) { .stem, .opts { --gap: 6px; --pad: 4px; } }
.stem { display: flex; justify-content: center; }
.stem > svg { width: calc(var(--cell) * 3.12); height: auto; }
.opts { display: grid; gap: 10px; margin-top: 18px; }
.opts.k-matrix { grid-template-columns: repeat(4, calc(var(--cell) + 2 * var(--pad) + 3px)); gap: var(--gap); justify-content: center; }
.opts.k-matrix .opt { padding: var(--pad); }
.opts.k-matrix .opt svg { width: var(--cell); margin: 0 auto; }
.opts.k-matrix .opt svg > rect:first-of-type { stroke: none; }
/* the letter sits on the corner, outside the drawing, so it never covers part of a shape */
.opts:not(.k-verbal) .opt .key { left: -8px; top: -8px; z-index: 1; }

.opts.k-series { grid-template-columns: repeat(3, 1fr); }
.opts.k-rotation { grid-template-columns: repeat(4, 1fr); }
.opts.k-folding { grid-template-columns: repeat(5, 1fr); }
.opts.k-verbal { grid-template-columns: 1fr; max-width: 420px; }
@media (max-width: 560px) { .opts.k-folding { grid-template-columns: repeat(3, 1fr); } .opts.k-rotation { grid-template-columns: repeat(2, 1fr); } }
.opt { position: relative; display: block; width: 100%; padding: 8px; background: var(--sheet); border: 1.5px solid #8C9792; border-radius: var(--r); cursor: pointer; color: var(--ink); font: inherit; text-align: center;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), transform 100ms var(--ease); }
.opt:hover { border-color: var(--ink-3); }
.opt:active { transform: scale(0.98); }
.opt .key { text-align: center; position: absolute; left: 7px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--rule-2); font: 600 0.72rem/19px var(--sans); color: var(--ink-2); background: var(--sheet); transition: background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease); }
.opt svg { width: 100%; height: auto; }
.opt .num, .opt .word { display: block; padding: 12px 6px; font: 500 1.3rem/1.2 var(--serif); }
.opts.k-verbal .opt { text-align: left; padding: 14px 16px; }
.opts.k-verbal .opt .key { left: 14px; top: 50%; margin-top: -11px; }
.opts.k-verbal .opt .word { padding: 0; font: 500 1.05rem/1.35 var(--sans); }
.opt[aria-pressed="true"] { border-color: var(--ink); background: #F7F9F8; }
.opt[aria-pressed="true"] .key { background: var(--ink); border-color: var(--ink); color: #fff; }
.opt.right { border-color: var(--mark); background: var(--mark-soft); }
.opt.right .key { background: var(--mark); border-color: var(--mark); color: #fff; }
.opt.wrong { border-color: var(--examiner); }
.opt.wrong .key { background: var(--examiner); border-color: var(--examiner); color: #fff; }
.series { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.series span { min-width: 56px; padding: 12px 12px; border: 1.5px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); font: 500 1.45rem/1 var(--serif); text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .series { gap: 6px; } .series span { min-width: 44px; padding: 10px 7px; font-size: 1.2rem; } }
.series .q.filled { border-style: solid; border-color: var(--ink); color: var(--ink); animation: settle 260ms var(--ease); }
@keyframes settle { from { transform: scale(1.06); } }
.series .q { border-style: dashed; border-color: var(--examiner); color: var(--examiner); }
.rot-stem svg { width: 190px; height: 190px; }
.fold-steps { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.fold-steps figure { margin: 0; text-align: center; }
.fold-steps svg { width: 104px; height: 104px; }
.fold-steps figcaption { font-size: 0.82rem; color: var(--ink-3); margin-top: 4px; }

/* ── the test ── */
.test-shell { min-height: calc(100vh - 64px); padding: 28px 0 120px; }
.test-shell .wrap { max-width: 760px; }
.test-shell .report-wrap { max-width: 880px; }
.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 0.9rem; color: var(--ink-2); }
.progress .bar { flex: 1; height: 4px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 400ms var(--ease); }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 26px; }
@media (max-width: 560px) { .card { padding: 18px 14px; border-radius: var(--r); min-height: 0; } }
.q-body { transition: opacity 160ms var(--ease), transform 220ms var(--ease); }
.q-body.out { opacity: 0; transform: translateY(-8px); }
.q-body.in { opacity: 0; transform: translateY(8px); transition: none; }
.actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.actions .hint { font-size: 0.85rem; color: var(--ink-3); }
.actions .btn { margin-left: auto; min-width: 160px; }
/* phones: during the test the header goes, the progress bar is the top line, and nothing hides behind the Next bar */
@media (max-width: 560px) {
  body.testing .top { display: none; }
  body.testing .test-shell { padding-top: 14px; }
  body.testing .prompt { font-size: 1.05rem; margin-bottom: 12px; }
  html:has(body.testing) { scroll-padding-bottom: 104px; }
}
@media (max-width: 560px) {
  .actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; margin: 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--rule); backdrop-filter: blur(6px); }
  .actions .hint { display: none; }
  .actions .btn { width: 100%; margin: 0; }
}
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: var(--r); background: var(--mark-soft); color: #134A3D; font-size: 0.95rem; }
.feedback.no { background: #FBEDEA; color: #7A2617; }

.panel { max-width: 620px; }
.panel h1, .panel h2 { margin-bottom: 14px; }
.panel p + p { margin-top: 12px; }
.panel .btn { margin-top: 24px; }
.panel ul { margin: 14px 0 0; padding-left: 20px; color: var(--ink-2); }
.panel ul li + li { margin-top: 6px; }
.panel .lead { font-size: 1.1rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.cta-row .btn, .panel .cta-row .btn { margin-top: 0; }
.card .panel { padding: 8px 4px; }
.result { max-width: 860px; }
.result h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); max-width: 18ch; }
.result .num { color: var(--ink); }
.or-line { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

/* memory task (block tapping) */
.corsi { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 18px auto 0; background: #EEF2EF; border-radius: var(--r-lg); border: 1px solid var(--rule); touch-action: manipulation; }
.corsi button { position: absolute; width: 17%; aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--rule-2); background: var(--sheet); cursor: pointer; transition: background-color 120ms linear, transform 100ms var(--ease); }
.corsi button.lit { background: var(--ink); border-color: var(--ink); }
.corsi button.tap { background: var(--mark); border-color: var(--mark); }
.corsi button:active { transform: scale(0.96); }
.corsi.watch button { cursor: default; }
.corsi-status { text-align: center; margin-top: 14px; min-height: 1.6em; color: var(--ink); font-weight: 600; }
.corsi-status.small { color: var(--ink-2); font-weight: 400; }
.corsi:not(.watch) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

/* scoring moment: the grid fills cell by cell, then the missing piece drops in */
.scoring { display: grid; place-items: center; gap: 18px; padding: 80px 0; text-align: center; }
.scoring svg { width: 120px; height: 120px; }
.scoring .c { fill: var(--sheet); stroke: var(--rule-2); transition: fill 200ms linear; }
.scoring .c.on { fill: var(--ink); stroke: var(--ink); }
.scoring .c.miss { stroke: var(--examiner); stroke-dasharray: 4 3; }
.scoring .c.miss.on { fill: var(--examiner); stroke-dasharray: 0; }

/* ── working out the score ── */
.gen-bar { width: min(320px, 80%); height: 4px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.gen-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 800ms var(--ease); }
.gen-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; text-align: left; min-width: min(320px, 80%); color: var(--ink-3); }
.gen-steps li { position: relative; padding-left: 26px; transition: color 200ms var(--ease); }
.gen-steps li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--rule-2); }
.gen-steps li.now { color: var(--ink); }
.gen-steps li.now::before { border-color: var(--ink); border-top-color: transparent; animation: spin 700ms linear infinite; }
.gen-steps li.done { color: var(--ink-2); }
.gen-steps li.done::before { border-color: var(--mark); background: var(--mark); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── the paywall: the old site's layout (dark header, list, price, card form) in this site's style ── */
.paywall { max-width: 600px; margin: 0 auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 26px 50px -38px rgba(31, 35, 40, 0.5); animation: rise 360ms var(--ease); }
.pw-head { position: relative; isolation: isolate; background: var(--ink); color: #fff; text-align: center; padding: 34px 24px 30px; }
.pw-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(circle at 14px 14px, rgba(255, 255, 255, 0.16) 1.1px, transparent 1.6px); background-size: 28px 28px; }
.pw-mark { width: 44px; height: 44px; margin: 0 auto 14px; display: block; }
.pw-head h2 { color: #fff; font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.4rem); margin: 0; }
.pw-head p { color: rgba(255, 255, 255, 0.74); margin: 8px auto 0; max-width: 36ch; font-size: 0.97rem; }
.pw-body { padding: 22px 26px 26px; }
.pw-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.pw-list li { position: relative; padding: 10px 0 10px 26px; border-top: 1px solid var(--rule); font-size: 0.97rem; }
.pw-list li::before { content: ""; position: absolute; left: 3px; top: 16px; width: 11px; height: 6px; border-left: 2px solid var(--mark); border-bottom: 2px solid var(--mark); transform: rotate(-45deg); }
.pw-price { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 16px; border-top: 1.5px solid var(--ink); }
.pw-price span { color: var(--ink-2); font-size: 0.95rem; }
.pw-price b { font: 500 2.6rem/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums; }
.pw-go { margin-top: 16px; min-height: 52px; font-size: 1.02rem; gap: 10px; }
.pw-small { margin-top: 10px; font-size: 0.82rem; color: var(--ink-2); text-align: center; line-height: 1.5; }
.card-brands { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 0; }
.card-brands span { font-size: 0.74rem; font-weight: 500; color: var(--ink-2); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 3px 8px; background: var(--paper); }
.pw-guarantee { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; background: var(--mark-soft); border-radius: var(--r); color: #134A3D; font-size: 0.9rem; }
.pw-guarantee p { margin: 0; }
.pw-guarantee svg { flex: none; margin-top: 2px; }
/* phones: keep the button in the first screen */
@media (max-width: 560px) {
  .pw-head { padding: 22px 16px 20px; } .pw-mark { width: 32px; height: 32px; margin-bottom: 10px; }
  .pw-head h2 { font-size: 1.7rem; } .pw-head p { font-size: 0.9rem; }
  .pw-body { padding: 12px 16px 20px; }
  .pw-list { column-gap: 12px; } .pw-list li { font-size: 0.86rem; padding: 8px 0 8px 20px; line-height: 1.3; } .pw-list li::before { left: 1px; top: 12px; width: 9px; height: 5px; }
  .pw-price { margin-top: 8px; padding-top: 12px; } .pw-price b { font-size: 2.2rem; }
}

/* the sign-in step before the paywall */
.pw-signin { padding-top: 24px; }
.pw-signin h3 { font-size: 1.25rem; text-align: center; }
.pw-signin > p.pw-small { margin-top: 6px; }
.pw-signin .signin { max-width: 380px; margin: 0 auto; }
.pw-signin .gbtn { min-height: 52px; font-size: 1.02rem; }

/* ── the locked report card ── */
.locked-report { margin-top: 22px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 8px 22px; max-width: 620px; }
.lr-score { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rule); font: 500 1.2rem var(--serif); }
.lr-big { display: grid; place-items: center; width: 108px; height: 64px; border-radius: var(--r); background: repeating-linear-gradient(135deg, #EEF2EF 0 8px, #E4E9E6 8px 16px); color: var(--ink-3); }
.lr-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); font-size: 0.95rem; color: var(--ink-2); }
.lr-row:last-child { border-bottom: 0; }
.lr-hidden { display: grid; place-items: center; width: 92px; height: 22px; border-radius: 6px; background: repeating-linear-gradient(135deg, #EEF2EF 0 6px, #E4E9E6 6px 12px); color: var(--ink-3); flex: none; }
.lr-hidden.wide { width: 140px; }
.lock { width: 13px; height: 13px; }
.lr-big .lock { width: 20px; height: 20px; }
@media (max-width: 560px) { .locked-report { padding: 4px 16px; } .lr-hidden { width: 64px; } .lr-hidden.wide { width: 84px; } }

/* ── result preview, report ── */
.curve { width: 100%; height: auto; overflow: visible; }
.curve .area { fill: #E7ECE9; }
.curve .line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.curve .band { fill: var(--mark); opacity: 0.18; }
.curve .you { stroke: var(--examiner); stroke-width: 2; }
.curve text { font: 500 13px var(--sans); fill: var(--ink-3); }
.curve-wrap { position: relative; }
.curve-ticks { position: relative; height: 22px; margin-top: 4px; font-size: 0.8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.curve-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.curve-label { position: relative; height: 26px; }
.curve-label span { position: absolute; bottom: 0; transform: translateX(-50%); white-space: nowrap; font: 600 0.9rem var(--sans); color: var(--examiner); font-variant-numeric: tabular-nums; }
.curve .bracket { fill: none; stroke: var(--examiner); stroke-width: 2; stroke-linejoin: round; }
.curve .bracket.slide { animation: bracket 900ms var(--ease) 300ms both; }
.curve-label .slide { animation: label 900ms var(--ease) 300ms both; }
@keyframes bracket { from { transform: translateX(var(--dx)); opacity: 0; } 30% { opacity: 1; } }
@keyframes label { from { left: var(--from); opacity: 0; } 30% { opacity: 1; } }
.curve .draw { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 900ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.big { font: 400 clamp(4.2rem, 3rem + 6vw, 6.6rem)/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.blur { filter: blur(14px); user-select: none; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin-top: 18px; }
@media (max-width: 760px) { .preview-grid { grid-template-columns: 1fr; gap: 20px; } }
.range-line { font: 500 1.6rem/1.2 var(--serif); }
.unlock { margin-top: 30px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 24px; }
.unlock h2 { font-size: 1.5rem; }
.unlock ul { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); }
.keyinfo { margin-top: 18px; border: 1.5px solid var(--ink); border-radius: var(--r); padding: 16px 18px; background: #FBFCFB; }
.keyinfo h3 { font: 600 0.95rem var(--sans); margin-bottom: 8px; }
.keyinfo dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 0.95rem; }
.keyinfo dt { color: var(--ink-2); }
.keyinfo dd { margin: 0; }
.keyinfo dd b { font-weight: 600; }
.unlock ul.gets { columns: 2; column-gap: 32px; }
.unlock ul.gets li { break-inside: avoid; margin-bottom: 4px; }
@media (max-width: 560px) { .unlock ul.gets { columns: 1; } .keyinfo dl { grid-template-columns: 1fr; gap: 2px; } .keyinfo dt { margin-top: 8px; font-size: 0.85rem; } }
.ack { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; font-size: 0.95rem; cursor: pointer; }
.ack input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--mark); flex: none; }
.cardbox { margin-top: 16px; padding: 14px 14px; border: 1.5px solid var(--rule-2); border-radius: var(--r); background: var(--sheet); min-height: 48px; }
.cardbox.focus { border-color: var(--ink); }
.pay-error { margin-top: 10px; color: var(--examiner); font-size: 0.92rem; min-height: 1.4em; }
.fine { margin-top: 14px; font-size: 0.82rem; color: var(--ink-3); }

.report-head { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
@media (max-width: 760px) { .report-head { grid-template-columns: 1fr; gap: 12px; } }
.report-head .meta { color: var(--ink-2); }
.report-head .meta h1 { color: var(--ink); }
.report-wrap .curve { max-width: 720px; }
.report-head .meta b { color: var(--ink); font-weight: 600; }
.areas-report { margin-top: 10px; }
.areas-report .a { display: grid; grid-template-columns: 180px 1fr 70px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.areas-report .meter { height: 8px; background: var(--rule); border-radius: 8px; overflow: hidden; }
.areas-report .meter i { display: block; height: 100%; background: var(--ink); width: 0; transition: width 700ms var(--ease); }
@media (max-width: 560px) { .areas-report .a { grid-template-columns: 1fr 64px; } .areas-report .meter { grid-column: 1 / -1; grid-row: 2; } }
.review-item { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.review-item .mark { display: inline-block; font: 600 0.8rem var(--sans); padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; }
.review-item .mark.ok { background: var(--mark-soft); color: #134A3D; }
.review-item .mark.no { background: #FBEDEA; color: #7A2617; }
.review-item { padding: 0; }
.review-item details { padding: 18px 0; }
.review-item summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.review-item summary::-webkit-details-marker { display: none; }
.review-item summary .mark { margin-bottom: 0; }
.review-item details[open] summary { margin-bottom: 12px; }
.review-item details:not([open]) summary::after { content: "Show"; margin-left: auto; font-size: 0.85rem; color: var(--mark); text-decoration: underline; text-underline-offset: 3px; }
.strip { list-style: none; display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin: 16px 0 8px; padding: 0; max-width: 520px; }
.strip a { display: grid; place-items: center; height: 40px; border-radius: var(--r-sm); font: 600 0.9rem var(--sans); text-decoration: none; font-variant-numeric: tabular-nums; }
.strip a.ok { background: var(--mark-soft); color: #134A3D; }
.strip a.no { background: #FBEDEA; color: #7A2617; }
.feedback.paid { margin: 0 0 20px; }
.review-item .why { margin-top: 14px; color: var(--ink-2); max-width: 68ch; }
.review-item .opts .opt { cursor: default; }
.review-item .opts.k-series, .review-item .opts.k-rotation, .review-item .opts.k-folding { max-width: 620px; }
.review-item .rot-stem svg { width: 160px; height: 160px; }
.section { margin-top: 48px; }
.section > h2 { margin-bottom: 8px; }
.prose-sm { max-width: 66ch; }
.prose-sm p { color: var(--ink-2); }
.prose-sm p + p { margin-top: 12px; }
.areas-report .a b { font-weight: 600; }
.areas-report .a .num { text-align: right; color: var(--ink-2); }
.cert-form { margin-top: 16px; max-width: 460px; }
.cert-form label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.cert-form .row { display: flex; gap: 10px; }
.cert-form input { flex: 1; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--rule-2); border-radius: var(--r); font: 400 1rem var(--sans); }
.cert { display: none; }
body.testing .foot { display: none; }

/* ── account ── */
.status { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; }
.status .when { font: 500 1.25rem/1.3 var(--serif); margin: 4px 0 10px; }
.status .btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.results-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.97rem; }
.results-table th, .results-table td { text-align: left; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--rule); }
.results-table th { font-weight: 600; color: var(--ink-2); font-size: 0.85rem; }
.chart { margin-top: 14px; }
.practice-pick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ── prose (guides, legal) ── */
.prose { max-width: 700px; padding: 48px 0 72px; }
.prose h1 { margin-bottom: 16px; }
.prose .byline { color: var(--ink-3); font-size: 0.92rem; margin-bottom: 28px; }
.prose h2 { font-size: 1.6rem; margin: 40px 0 12px; }
.prose h3 { font-size: 1.2rem; margin: 28px 0 8px; }
.prose p, .prose li { font: 400 1.07rem/1.72 var(--serif); }
.prose p + p { margin-top: 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 12px 0; }
.prose li + li { margin-top: 6px; }
.prose figure { margin: 22px 0; padding: 18px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); }
.prose figure svg { max-width: 260px; margin: 0 auto; }
.prose figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--ink-2); text-align: center; }
.prose table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 0.97rem; }
.prose th, .prose td { text-align: left; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--rule); }
.prose .callout { margin: 24px 0; padding: 18px 20px; background: var(--sheet); border-left: 3px solid var(--mark); border-radius: 0 var(--r) var(--r) 0; }
.prose figure.example { padding: 20px; }
.prose figure.example svg { max-width: none; }
.prose figure.example .prompt { font: 500 1.05rem/1.35 var(--serif); }
.prose figure.example .opt { cursor: default; padding: 6px; }
.prose figure.example .opt .num { font-size: 1.1rem; padding: 8px 4px; }
.prose figure.example .fold-steps svg { width: 88px; height: 88px; }
.prose figure.example .rot-stem svg { width: 160px; height: 160px; }
.prose figure.example details { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 10px; }
.prose figure.example summary { cursor: pointer; font: 600 0.95rem var(--sans); color: var(--mark); }
.prose figure.example details p { font: 400 0.98rem/1.6 var(--sans); margin-top: 8px; color: var(--ink-2); }
.prose figure.example figure { padding: 0; border: 0; margin: 0; background: none; }
.prose .callout p { font-family: var(--sans); font-size: 1rem; }
.crumbs { font-size: 0.85rem; color: var(--ink-3); padding-top: 22px; }
.crumbs a { color: var(--ink-3); }

/* ── sign-in dialog, toast, cookie note ── */
.dlg-bg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(31, 35, 40, 0.45); }
.dlg { width: min(100%, 420px); background: var(--sheet); border-radius: var(--r-lg); padding: 26px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); animation: rise 220ms var(--ease); }
.dlg h2 { font-size: 1.5rem; margin-bottom: 6px; }
.dlg .x { float: right; width: 36px; height: 36px; margin: -10px -10px 0 0; border: 0; background: none; border-radius: 50%; cursor: pointer; font-size: 22px; color: var(--ink-2); }
.signin label { display: block; font-size: 0.9rem; font-weight: 600; margin: 14px 0 6px; }
.signin input[type=email], .signin input[type=password], .signin input[type=text] { width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--rule-2); border-radius: var(--r); font: 400 1rem var(--sans); background: #fff; }
.signin input:focus { border-color: var(--ink); outline: none; }
.signin .or { display: flex; align-items: center; gap: 10px; margin: 16px 0 2px; color: var(--ink-3); font-size: 0.85rem; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.signin .msg { margin-top: 10px; font-size: 0.92rem; min-height: 1.3em; }
.signin .msg.err { color: var(--examiner); }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; border: 1.5px solid var(--rule-2); background: #fff; border-radius: var(--r); font: 600 1rem var(--sans); color: var(--ink); cursor: pointer; margin-top: 16px; }
.gbtn:hover { border-color: var(--ink-3); }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r); font-size: 0.95rem; max-width: calc(100% - 32px); animation: rise 200ms var(--ease); }
.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 560px; margin-left: auto; background: var(--sheet); border: 1px solid var(--rule-2); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: 0 18px 40px -24px rgba(0,0,0,.4); font-size: 0.92rem; }
.cookie .btns { display: flex; gap: 10px; margin-top: 12px; }
@media (min-width: 761px) {
  .cookie { left: 50%; right: auto; transform: translateX(-50%); width: min(calc(100% - 32px), 860px); max-width: none; display: flex; align-items: center; gap: 18px; padding: 12px 14px 12px 18px; }
  .cookie p { flex: 1; }
  .cookie .btns { margin-top: 0; flex: none; }
}
/* on phones the test has a fixed Next bar at the bottom; keep the cookie note above it, never over it */
@media (max-width: 560px) { body.testing .toast { bottom: calc(88px + env(safe-area-inset-bottom)); } }
@media (max-width: 560px) { body.testing .cookie { bottom: calc(84px + env(safe-area-inset-bottom)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .lattice .reveal { display: none; }
}
@media print {
  .top, .foot, .no-print, .cookie, .toast { display: none !important; }
  body { background: #fff; }
  /* the certificate is page one; the full report follows */
  .cert { display: block; text-align: center; border: 2px solid var(--ink); padding: 56px 40px; margin: 0 0 24px; break-after: page; }
  .cert-brand { font: 500 1.4rem var(--serif); }
  .cert-name { font: 400 2rem var(--serif); margin-top: 28px; min-height: 1em; }
  .cert-score { font: 400 6rem/1 var(--serif); margin: 18px 0 10px; }
  .cert-k { color: var(--ink-2); margin-top: 6px; }
  .cert-fine { margin-top: 36px; font-size: 0.8rem; color: var(--ink-3); }
  .review-item { break-inside: avoid; }
  .curve .draw { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
}
