/*
 * IQ Tester — editorial web app.
 *
 * Built to James's web-editorial-redesign spec, and deliberately the opposite
 * of the dark/gradient/glow version it replaces: paper tone, serif display
 * type, one restrained accent, hairline rules doing the structural work.
 *
 * Two rules worth keeping if you edit this:
 *   - No gradients, no glows, no drop shadows. Structure comes from rules and
 *     whitespace. That is what makes it read as print rather than as an app.
 *   - It is a desktop layout that reflows down, not a phone layout stretched
 *     out. Design changes should start at the wide end.
 */

:root {
  --paper: #f6f2e9;
  --paper-2: #efe9db;
  --shell: #e9e4d4;
  --ink: #1a1a17;
  --ink-2: #54503f;
  /*
   * Darker than the mockup's #8a8570. Muted is used for captions, bylines,
   * counts and footnotes — real body text, so it has to clear 4.5:1 on BOTH
   * paper tones, not just the lighter one. Do not lighten it back.
   */
  --muted: #6d6956;
  --rule: #d8d0ba;
  --accent: #8a1f11;
  --accent-2: #1f3d2f;

  --serif: Palatino, "Palatino Linotype", "Iowan Old Style", "Book Antiqua", Georgia,
           "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--paper);
  padding: 12px 20px; z-index: 10; font-weight: 700;
}
.skip-link:focus { left: 16px; top: 16px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.spacer { flex: 1 1 auto; }

/* --------------------------------------------------------------- masthead */
.topnav {
  max-width: 1224px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 56px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-bottom: none;
  margin-top: 32px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: .02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark i { color: var(--accent); font-style: normal; }
.navlinks { display: flex; gap: 36px; }
.navlinks a {
  font-size: 12.5px; font-weight: 600; letter-spacing: .03em;
  color: var(--ink-2); text-decoration: none;
}
.navlinks a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ sheet */
main { padding-bottom: 96px; }
.sheet {
  max-width: 1224px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--rule);
}

.kicker {
  display: block;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.error-kicker { color: var(--accent); }

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.deck {
  font-family: var(--serif);
  font-size: 19px;
  font-style: italic;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 42ch;
  margin: 0 0 30px;
}
.byline { font-size: 12.5px; color: var(--muted); margin: 22px 0 0; letter-spacing: .02em; }
.byline b { color: var(--ink-2); font-weight: 700; }
.footnote { font-size: 12.5px; color: var(--muted); margin: 40px 0 0; max-width: 40ch; line-height: 1.6; }
.actions { margin: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  letter-spacing: .01em;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 14px 26px;
  cursor: pointer;
  /* Square. A pill would read as app chrome. */
  border-radius: 0;
  transition: background .12s ease, color .12s ease;
}
.btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.btn.small { padding: 10px 18px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; }

.link-arrow {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font-family: var(--sans); font-weight: 700; font-size: 13.5px;
  color: var(--ink); text-decoration: underline; text-underline-offset: 4px;
}
.link-arrow:hover { color: var(--accent); }

/* -------------------------------------------------------------- 1 landing */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  border-bottom: 1px solid var(--rule);
}
.hero-copy { padding: 72px 64px 72px 56px; border-right: 1px solid var(--rule); }
.hero-copy h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 62px;
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 26px;
  max-width: 12ch;
}
.hero-figure {
  padding: 56px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--paper-2);
  margin: 0;
}
.figure-num {
  font-family: var(--serif);
  font-size: 200px;
  line-height: 1;
  letter-spacing: -0.03em;
  position: relative;
}
.figure-num sup {
  font-family: var(--sans);
  font-size: 26px; font-weight: 700;
  color: var(--accent);
  position: absolute; top: 10px; right: -28px;
}
.fig-caption {
  font-family: var(--serif); font-style: italic;
  font-size: 12.5px; color: var(--muted);
  margin-top: 20px; text-align: center; max-width: 26ch;
}

.toc { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0; padding: 0; }
.toc-item { padding: 34px 32px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc-item:last-child { border-right: none; }
.toc-item .n { font-family: var(--serif); font-size: 34px; color: var(--rule); margin-bottom: 10px; }
.toc-item h3 { font-size: 14.5px; margin: 0 0 8px; letter-spacing: .01em; }
.toc-item p { font-size: 13px; color: var(--ink-2); margin: 0; line-height: 1.5; }

.pull { padding: 64px 96px; text-align: center; border-bottom: 1px solid var(--rule); margin: 0; }
.pull .rule { width: 60px; height: 2px; background: var(--accent); margin: 0 auto 28px; }
.pull p { font-family: var(--serif); font-style: italic; font-size: 29px; line-height: 1.4; margin: 0; }

.land-footer {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 26px 56px; font-size: 12px; color: var(--muted);
}

/* ----------------------------------------------------------------- 2 test */
.test-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 26px 56px; border-bottom: 1px solid var(--rule);
}
.prog-kicker {
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.prog-rule { margin-top: 10px; height: 2px; background: var(--rule); position: relative; width: 340px; max-width: 40vw; }
.prog-rule i { position: absolute; left: 0; top: 0; height: 100%; background: var(--ink); transition: width .3s ease; }
.prog-count { font-family: var(--serif); font-size: 17px; color: var(--ink-2); }

.q-grid { display: grid; grid-template-columns: 220px 1fr; }
.q-numeral {
  font-family: var(--serif);
  font-size: 150px; line-height: 1;
  color: var(--rule);
  padding: 56px 0 0 56px;
  user-select: none;
}
.q-body { padding: 56px 64px 64px 0; max-width: 62ch; }
.q-text {
  font-family: var(--serif);
  font-size: 27px; line-height: 1.35;
  margin: 0 0 36px;
  /* Prompts carry newlines; grid items are aligned with spaces. */
  white-space: pre-wrap;
}
.q-text.grid {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px; line-height: 1.7;
}

.choices { border: 0; margin: 0 0 40px; padding: 0; border-top: 1px solid var(--ink); }
.choice { display: block; border-bottom: 1px solid var(--rule); }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice span {
  display: flex; align-items: baseline; gap: 16px;
  padding: 17px 8px;
  font-size: 16.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: color .1s ease, background .1s ease;
}
.choice span::before {
  content: attr(data-numeral);
  font-family: var(--serif); font-style: italic;
  font-size: 16px;
  color: var(--muted);
  min-width: 2.2em;
}
.choice span:hover { background: var(--paper-2); color: var(--ink); }
/* Selection is weight and colour, not a filled dot. */
.choice input:checked + span { color: var(--ink); font-weight: 700; background: var(--paper-2); }
.choice input:checked + span::before { color: var(--accent); font-weight: 700; }
.choice input:focus + span { outline: 2px solid var(--accent); outline-offset: -2px; }

.q-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

/* -------------------------------------------------------------- 4 paywall */
.pay-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; }
.pay-left { padding: 64px 56px; border-right: 1px solid var(--rule); }
.pay-left .display { font-size: 46px; }
.pay-left .sub { font-size: 14.5px; color: var(--ink-2); max-width: 42ch; margin: 0 0 40px; }

.cat-list { border-top: 1px solid var(--ink); }
.cat-row {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 20px 0; border-bottom: 1px solid var(--rule); font-size: 15px;
}
.cat-row .name { font-family: var(--serif); font-size: 17px; }
.cat-row .tag {
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent-2);
}
.cat-row .tag.mid { color: var(--muted); }
.cat-row.locked .name { color: var(--muted); }
/*
 * An editorial redaction, not a blur. It is honest about being withheld
 * rather than pretending to be information you might squint at.
 */
.redacted { display: inline-block; width: 120px; height: 13px; background: var(--ink); vertical-align: middle; }

.pay-right { padding: 64px 48px; background: var(--paper-2); }
.offer-box { border: 1.5px solid var(--ink); padding: 36px 32px; background: var(--paper); }
.offer-box .price { font-family: var(--serif); font-size: 56px; margin: 0 0 4px; line-height: 1; }
.offer-box .price-sub { font-size: 12.5px; color: var(--muted); margin: 0 0 28px; }
.offer-list { list-style: none; padding: 0; margin: 0 0 32px; }
.offer-list li {
  font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--rule);
  display: flex; gap: 10px; color: var(--ink-2);
}
.offer-list li::before { content: "—"; color: var(--accent); }
.skip {
  display: block; width: 100%; text-align: center; margin-top: 18px;
  background: none; border: 0; cursor: pointer;
  font-size: 12.5px; color: var(--muted); font-family: var(--sans);
  text-decoration: underline; text-underline-offset: 3px;
}
.skip:hover { color: var(--ink); }
.stub {
  margin: 20px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6;
  border-left: 2px solid var(--rule); padding-left: 14px;
}

/* -------------------------------------------------------------- 5 results */
.res-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; }
.res-left { padding: 64px 56px; border-right: 1px solid var(--rule); }
.res-actions { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.res-right { padding: 64px 56px; }

.bar-list { border-top: 1px solid var(--ink); }
.bar-row { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.bar-row .top { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; margin-bottom: 12px; }
.bar-row .top b { font-family: var(--serif); font-size: 16px; font-weight: 400; }
.bar-row .top .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { height: 2px; background: var(--rule); position: relative; }
.bar-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--ink); transition: width .5s ease; }

/* ------------------------------------------------------- centred sections */
.centre-sheet { padding: 80px 56px; max-width: 70ch; }
.wide-sheet { max-width: none; }

.review { list-style: none; margin: 32px 0 40px; padding: 0; border-top: 1px solid var(--ink); }
.review-item { padding: 26px 0; border-bottom: 1px solid var(--rule); }
.review-item .q-text { font-size: 19px; margin: 0 0 14px; }
.review-item .verdict { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 8px; }
.review-item.right .verdict { color: var(--accent-2); }
.review-item.wrong .verdict { color: var(--accent); }
.review-item .why { font-family: var(--serif); font-size: 16px; color: var(--ink-2); margin: 0; max-width: 62ch; line-height: 1.6; }

/* ------------------------------------------------------------ narrow view */
@media (max-width: 1000px) {
  .topnav, .sheet { margin-left: 16px; margin-right: 16px; }
  .topnav { padding: 18px 24px; flex-wrap: wrap; }
  .navlinks { display: none; }

  .hero, .toc, .pay-grid, .res-grid, .q-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 48px 28px; border-right: none; border-bottom: 1px solid var(--rule); }
  .hero-copy h1 { font-size: 42px; max-width: none; }
  .hero-figure { padding: 40px 28px; }
  .figure-num { font-size: 130px; }

  .toc-item { border-right: none; }
  .pull { padding: 48px 28px; }
  .pull p { font-size: 23px; }
  .land-footer { flex-direction: column; gap: 8px; padding: 22px 28px; }

  .test-head { padding: 20px 28px; }
  .prog-rule { width: 180px; }
  /* The page-number numeral is a print device; it earns no space when narrow. */
  .q-numeral { display: none; }
  .q-body { padding: 40px 28px 48px; }
  .q-text { font-size: 22px; }

  .pay-left, .pay-right, .res-left, .res-right, .centre-sheet {
    padding: 44px 28px;
    border-right: none;
  }
  .pay-left, .res-left { border-bottom: 1px solid var(--rule); }
  .pay-left .display { font-size: 34px; }
  .display { font-size: 32px; }
}

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

/* =========================================================================
 * Site pages and the longer landing.
 * Same editorial system: rules and whitespace, no gradients or shadows.
 * ========================================================================= */

.section-heading {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}
.prose { font-size: 16px; line-height: 1.7; color: var(--ink-2); max-width: 62ch; margin: 0 0 18px; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent); }

/* -------------------------------------------------- two-column split bands */
.split { display: grid; grid-template-columns: 1.05fr 0.95fr; border-bottom: 1px solid var(--rule); }
.split-copy { padding: 64px 56px; border-right: 1px solid var(--rule); }
.split-figure { padding: 56px; background: var(--paper-2); display: flex; flex-direction: column; justify-content: center; }
.split.reverse .split-copy { order: 2; border-right: none; border-left: 1px solid var(--rule); }
.split.reverse .split-figure { order: 1; }

.sample-q { font-size: 22px; margin: 0 0 28px; }
.sample-options { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.sample-opt {
  display: flex; gap: 16px; align-items: baseline;
  text-align: left; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--rule);
  padding: 15px 8px; cursor: pointer;
  font-family: var(--sans); font-size: 16px; color: var(--ink-2);
  border-radius: 0;
}
.sample-opt i { font-family: var(--serif); font-style: italic; color: var(--muted); min-width: 2.2em; }
.sample-opt:hover { background: var(--paper); color: var(--ink); }
.sample-opt[aria-pressed="true"] { font-weight: 700; color: var(--ink); background: var(--paper); }
.sample-opt.right { box-shadow: inset 3px 0 0 var(--accent-2); }
.sample-opt.wrong { box-shadow: inset 3px 0 0 var(--accent); }

.price-figure { align-items: flex-start; }
.price-large { font-family: var(--serif); font-size: 92px; line-height: 1; margin: 0; letter-spacing: -0.02em; }
.price-words { font-family: var(--serif); font-size: 44px; line-height: 1.05; margin: 0; letter-spacing: -0.01em; max-width: 11ch; }
.price-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; letter-spacing: .02em; }

/* --------------------------------------------------------- full-width band */
.band { border-bottom: 1px solid var(--rule); }
.band.alt { background: var(--paper-2); }
.band-inner { padding: 64px 56px; }

.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 56px; margin: 8px 0 28px; }
.method-grid h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 0 0 8px; }
.method-grid p { font-size: 15px; line-height: 1.65; color: var(--ink-2); margin: 0; max-width: 46ch; }

/* ------------------------------------------------------------- definitions */
.qa { margin: 0 0 24px; max-width: 74ch; border-top: 1px solid var(--ink); }
.qa dt { font-family: var(--serif); font-size: 19px; padding: 22px 0 6px; }
.qa dd { margin: 0 0 22px; padding-bottom: 22px; border-bottom: 1px solid var(--rule);
         font-size: 15.5px; line-height: 1.65; color: var(--ink-2); max-width: 66ch; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 0 0 18px; }
.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 560px; }
.compare th, .compare td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare thead th {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); border-bottom: 1px solid var(--ink);
}
.compare tbody th { font-family: var(--serif); font-size: 16px; font-weight: 400; }
.compare td { color: var(--ink-2); }
.table-note { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 68ch; margin: 0 0 18px; }

/* -------------------------------------------------------------- article page */
.article-head { padding: 72px 56px 48px; border-bottom: 1px solid var(--rule); }
.article-head h1 {
  font-family: var(--serif); font-weight: 400; font-size: 52px; line-height: 1.06;
  letter-spacing: -0.015em; margin: 0 0 22px; max-width: 18ch;
}
.article-body { padding: 8px 56px 64px; }
.page-section { padding: 44px 0; border-bottom: 1px solid var(--rule); }
.page-section:last-of-type { border-bottom: none; }
.article-cta { padding-top: 20px; margin: 0; }

/* ------------------------------------------------------------- site footer */
.site-footer {
  max-width: 1224px; margin: 0 auto;
  background: var(--paper-2);
  border: 1px solid var(--rule); border-top: none;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
  padding: 48px 56px;
}
.foot-title {
  display: block; font-size: 11.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.foot-col p { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); margin: 0; max-width: 34ch; }
.foot-col a { display: block; font-size: 13.5px; color: var(--ink-2); text-decoration: none; padding: 4px 0; }
.foot-col a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.land-footer { align-items: center; }

@media (max-width: 1000px) {
  .split, .split.reverse, .method-grid, .site-footer { grid-template-columns: 1fr; }
  .split-copy, .split.reverse .split-copy {
    padding: 44px 28px; border-right: none; border-left: none;
    border-bottom: 1px solid var(--rule); order: 1;
  }
  .split-figure, .split.reverse .split-figure { padding: 40px 28px; order: 2; }
  .band-inner, .article-head, .article-body { padding-left: 28px; padding-right: 28px; }
  .article-head { padding-top: 48px; }
  .article-head h1 { font-size: 36px; max-width: none; }
  .section-heading { font-size: 27px; }
  .price-large { font-size: 68px; }
  .site-footer { padding: 40px 28px; gap: 32px; }
}

/* =========================================================================
 * Elevated editorial v2 — James's direction, approved by the owner.
 *
 * Same bones as the editorial system above; this layer swaps tokens and
 * pushes the components: colour as structure, hard offset shadows, halftone,
 * stamps, a hazard-stripe lock, a marquee.
 *
 * ONE RULE THIS LAYER EXISTS TO KEEP: the loud orange (#ff3d1a) fails contrast
 * as small text — 3.0:1 on paper. So it is split in two:
 *   --fill    #ff3d1a  panels, bars, stamps, shadows. Never small text.
 *   --accent  #bd2d13  the same hue darkened to 5.0:1, for every small text
 *                      use. Every existing var(--accent) text stays compliant
 *                      without being touched.
 * On an orange panel, text is full ink (5.3:1). Paper text on orange is only
 * allowed at large sizes (the price, the hero figure), where 3:1 applies.
 * ========================================================================= */

:root {
  --paper: #f3ecdc;
  --paper-2: #eae0c9;
  --shell: #e2d7bd;
  --ink: #151209;
  /* Re-derived for the new paper tones: clears 4.5:1 on both. */
  --muted: #686452;
  --rule: #151209;
  --fill: #ff3d1a;
  --accent: #bd2d13;
  --stamp: #f4ff3d;
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ------------------------------------------------ structure: heavy rules */
.topnav { border: 3px solid var(--ink); border-bottom: none; }
.sheet { border: 3px solid var(--ink); }
.site-footer { border: 3px solid var(--ink); border-top: none; }
.hero, .toc-item, .pull, .split, .band, .test-head, .page-section, .article-head {
  border-color: var(--ink);
}
.hero { border-bottom-width: 3px; }
.hero-copy { border-right: 3px solid var(--ink); position: relative; }
.toc-item { border-right-width: 3px; border-bottom-width: 3px; }
.split { border-bottom-width: 3px; }
.split-copy { border-right-width: 3px; border-color: var(--ink); }
.band { border-bottom-width: 3px; }

.wordmark i {
  background: var(--ink); color: var(--paper);
  padding: 1px 9px; margin-left: 2px;
}
.navlinks a { font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--ink); }
.navlinks a:hover { color: var(--accent); }

/* ------------------------------------------ tactile hard-shadow buttons */
.btn {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .03em;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--fill);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover:not(:disabled) {
  background: var(--ink); border-color: var(--ink);
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--fill);
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--fill); }
.btn:disabled { box-shadow: none; }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.btn.ghost:hover:not(:disabled) { background: var(--paper); color: var(--ink); box-shadow: 9px 9px 0 var(--ink); }
.btn.small { box-shadow: 4px 4px 0 var(--fill); }

/* -------------------------------------------------------------- halftone */
/* Two classes, so no single-class .hero-figure rule — including the editorial
   layer's paper background — can wipe out the ink and dots. That exact bug
   shipped once: it left the cream caption on cream at 1:1. */
.hero-figure.halftone-dark, .halftone-dark {
  background-color: var(--ink);
  background-image: radial-gradient(circle, rgba(243, 236, 220, .16) 1.4px, transparent 1.4px);
  background-size: 9px 9px;
}
.band.alt, .article-head {
  background-image: radial-gradient(circle, rgba(21, 18, 9, .09) 1.4px, transparent 1.4px);
  background-size: 9px 9px;
}

/* ---------------------------------------------------------------- landing */
.marquee {
  background: var(--ink);
  color: var(--stamp);              /* 17:1 on ink */
  border-bottom: 3px solid var(--ink);
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
  font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.marquee-track { display: inline-flex; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-set { padding-right: 28px; }
@keyframes marquee { to { transform: translateX(-50%); } }

.stamp {
  position: absolute; top: 40px; right: 40px;
  background: var(--stamp); color: var(--ink);   /* 17:1 */
  border: 3px solid var(--ink);
  padding: 8px 14px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  transform: rotate(-6deg);
  box-shadow: 4px 4px 0 var(--ink);
}

.hero-copy h1 { font-size: 76px; line-height: .96; max-width: 11ch; }
.hero-copy h1 .mark {
  /* Paper on orange is 3.0:1 — allowed only because this is 76px display type. */
  background: var(--fill); color: var(--paper);
  padding: 0 14px; display: inline-block;
  transform: rotate(-1.2deg); margin: 4px 0;
}
.deck { font-family: var(--sans); font-style: normal; font-weight: 500; color: var(--ink); font-size: 17px; }

.figure-num {
  /* The hero card: orange panel, hard stamp-yellow shadow. Paper numerals are
     150px, so the large-text 3:1 threshold applies. */
  background: var(--fill); color: var(--paper);
  border: 3px solid var(--ink);
  padding: 34px 52px 40px;
  font-size: 150px; line-height: .85;
  transform: rotate(3deg);
  box-shadow: 10px 10px 0 var(--stamp);
}
.figure-num sup { font-family: var(--serif); font-weight: 400; font-size: 46px; color: var(--ink); top: 18px; right: 18px; }
.fig-caption {
  color: var(--paper); font-family: var(--sans); font-style: normal;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 36px;
}

.toc-item .n {
  font-size: 15px; color: var(--paper); background: var(--ink);
  display: inline-block; padding: 2px 9px;
}
.toc-item h3 { text-transform: uppercase; font-weight: 800; }
.pull .rule { width: 90px; height: 6px; background: var(--fill); }
.section-heading { font-size: 38px; }

/* The try-one panel is filled. Everything on it is full ink. */
#sample .split-figure { background: var(--fill); }
#sample .sample-q { color: var(--ink); }
#sample .sample-options { border-top: 3px solid var(--ink); }
#sample .sample-opt { color: var(--ink); font-weight: 700; border-bottom: 3px solid var(--ink); }
#sample .sample-opt i { color: var(--ink); }
#sample .sample-opt:hover, #sample .sample-opt[aria-pressed="true"] { background: var(--paper); }
#sample .sample-opt.right { box-shadow: inset 8px 0 0 var(--ink); background: var(--paper); }
#sample .sample-opt.wrong { box-shadow: inset 8px 0 0 var(--ink); background: var(--paper-2); }

/* ------------------------------------------------------------------- test */
.test-head { border-bottom-width: 3px; }
.prog-rule { height: 14px; border: 3px solid var(--ink); background: var(--paper-2); }
.prog-rule i { background: var(--fill); box-shadow: inset -3px 0 0 var(--ink); }

.q-numeral { color: var(--paper-2); -webkit-text-stroke: 2px var(--ink); }
.q-text { font-size: 30px; }

.choices { border-top: 0; display: grid; gap: 12px; }
.choice { border-bottom: 0; }
.choice span {
  border: 3px solid var(--ink);
  color: var(--ink); font-weight: 700; font-size: 15.5px;
  padding: 15px 18px;
}
.choice span::before { color: var(--accent); font-size: 18px; }
.choice span:hover { background: var(--paper-2); }
.choice input:checked + span { background: var(--ink); color: var(--paper); }
.choice input:checked + span::before { color: var(--stamp); }
.choice input:focus + span { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------------------------------------------------------------- paywall */
.pay-left { border-right: 3px solid var(--ink); }
.cat-list { border-top: 3px solid var(--ink); }
.cat-row { border-bottom: 3px solid var(--ink); text-transform: uppercase; font-weight: 800; font-size: 14px; }
.cat-row .name { font-family: var(--sans); font-size: 14px; }
.cat-row .tag { background: var(--paper-2); padding: 4px 10px; }
.cat-row.locked .name { color: var(--ink); }

/* The lock, upgraded from a plain bar to a hazard stripe. It still hides
   nothing real: no score is behind it. */
.redacted {
  position: relative;
  width: 150px; height: 28px;
  border: 3px solid var(--ink);
  background: repeating-linear-gradient(-45deg, var(--ink) 0 6px, var(--stamp) 6px 12px);
}
.redacted::after {
  content: "LOCKED";
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  background: var(--ink); color: var(--paper);  /* 15.9:1, never on the stripes */
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 2px 8px;
}

/* The money panel. Orange, so: ink text only, paper only for the big price. */
.pay-right { background: var(--fill); color: var(--ink); }
.pay-right .offer-box { background: transparent; border: 0; padding: 0; }
.pay-right .kicker,
.pay-right .price-sub,
.pay-right .offer-list li,
.pay-right .offer-list li::before,
.pay-right .skip,
.pay-right .stub { color: var(--ink); }
.pay-right .offer-box .price { color: var(--paper); font-size: 64px; }
.pay-right .offer-list li { border-bottom: 2px solid rgba(21, 18, 9, .35); font-weight: 700; }
.pay-right .stub { border-left-color: var(--ink); }
.pay-right .btn { background: var(--ink); color: var(--paper); box-shadow: 6px 6px 0 var(--ink); border-color: var(--paper); }
.pay-right .btn:hover:not(:disabled) { box-shadow: 9px 9px 0 var(--ink); }

/* ---------------------------------------------------------------- results */
.res-left { border-right: 3px solid var(--ink); }
/* The reveal (James, tk_ncntrG9wqa). One treatment for every score: the weight
   comes from scale and the frame, never from colouring a result good or bad. */
.reveal { position: relative; padding: 64px 56px 56px; text-align: center; background: var(--paper-2); border-bottom: 3px solid var(--ink); }
.reveal .kicker { display: block; }
/* Tabular figures, so the count-up does not jitter as digits change width. */
.reveal-score { font-family: var(--serif); font-size: clamp(96px, 14vw, 150px); line-height: 1; margin: 12px 0 0; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
/* Brainrot Test result: the archetype is the hero, the score is the paid extra. */
.reveal-archetype { font-family: var(--serif); font-size: clamp(48px, 11vw, 96px); line-height: 1.05; margin: 14px 0 0; }
.reveal-line { font-size: 18px; margin: 16px auto 0; max-width: 34ch; }
.reveal-exact { font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 18px 0 0; }
.reveal-band { display: inline-block; margin: 18px 0 0; padding: 8px 20px; background: var(--ink); color: var(--paper); font-family: var(--sans); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.reveal-caveat { margin: 16px auto 0; max-width: 46ch; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.reveal .reveal-stamp { top: 28px; right: 40px; transform: rotate(-5deg); }
.res-correct { font-family: var(--serif); font-size: 34px; line-height: 1.15; margin: 8px 0 0; }
.bar-list { border-top: 3px solid var(--ink); }
.bar-row { border-bottom: 3px solid var(--ink); }
.bar-row .top { text-transform: uppercase; font-weight: 800; }
.bar-row .top b { font-family: var(--sans); font-weight: 800; font-size: 14px; }
.bar-row .top .count { color: var(--ink); font-weight: 800; }
.bar-track { height: 22px; border: 3px solid var(--ink); background: var(--paper-2); }
/* Inset ink edge gives the fill a 3:1 boundary; at zero width nothing shows,
   so 0/5 never renders a misleading sliver. */
.bar-fill { background: var(--fill); box-shadow: inset -3px 0 0 var(--ink); }

/* ---------------------------------------------------------- review & pages */
.review { border-top: 3px solid var(--ink); }
.review-item { border-bottom: 3px solid var(--ink); }
.review-filter { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.filter-btn {
  font: inherit; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 10px 16px; border: 3px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer;
}
.filter-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filter-btn:focus-visible { outline: 3px solid var(--fill); outline-offset: 3px; }
/* Headings mirror the results screen's category rows. */
.review-group { margin-top: 40px; }
.review-group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 12px; }
.review-group-head h3 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.review-group-head .count { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.review-group .review { margin: 0; }
.review-item .q-num { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.qa { border-top: 3px solid var(--ink); }
.qa dd { border-bottom: 3px solid var(--ink); }
.compare thead th { border-bottom: 3px solid var(--ink); }
.compare th, .compare td { border-bottom-color: var(--ink); }
.article-head { border-bottom-width: 3px; }
.article-head h1 { font-size: 60px; }

/* ------------------------------------------------------------ narrow view */
@media (max-width: 1000px) {
  .hero-copy { border-right: none; border-bottom: 3px solid var(--ink); }
  .hero-copy h1 { font-size: 46px; }
  .stamp { top: 18px; right: 18px; }
  .figure-num { font-size: 100px; padding: 24px 36px 30px; }
  .pay-left, .res-left { border-right: none; border-bottom: 3px solid var(--ink); }
  .split-copy { border-bottom: 3px solid var(--ink); }
  .reveal .reveal-stamp { top: 18px; right: 18px; }
  .article-head h1 { font-size: 40px; }
  .section-heading { font-size: 29px; }
  .q-text { font-size: 23px; }
}

/* The sign-in gate: two buttons, stacked, nothing else to fill in. */
body.gate-end[data-view="gate"] #nav-start { visibility: hidden; }
.gate-done { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; font-weight: 700; color: var(--ink-2, inherit); }
.gate-bar { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: var(--rule, currentColor); overflow: hidden; }
.gate-bar i { display: block; width: 100%; height: 100%; background: var(--fill, currentColor); }
.gate-buttons { display: flex; flex-direction: column; gap: 16px; margin: 32px 0 24px; max-width: 30rem; }
.btn.wide { width: 100%; justify-content: center; text-align: center; }

/* The roast line (James's placement): commentary under the bars it is about,
   in the pull-quote voice used elsewhere, so it does not read as a data row. */
.roast { white-space: pre-line;

  margin: 22px 0 0; padding-top: 18px; border-top: 3px solid var(--ink);
  font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.5;
  color: var(--accent);
}

/* Record mode (?record=1): the reveal and the category bars, nothing else, so a
   screen recording carries no navigation, footer or buttons. Presentation only. */
body.record-mode .topnav,
body.record-mode .site-footer,
body.record-mode .marquee,
body.record-mode #view-result .res-left,
body.record-mode #battle,
body.record-mode #battles { display: none; }
body.record-mode #view-result .res-grid { grid-template-columns: 1fr; }
body.record-mode #view-result .res-right { padding: 48px 56px; }
@media (max-width: 700px) {
  body.record-mode #view-result .res-right { padding: 32px 24px; }
}

/* Phones: the stamp joins the flow above the kicker, so it can never sit on the number. */
@media (max-width: 700px) {
  .reveal { padding: 40px 24px 36px; }
  .reveal .reveal-stamp { position: static; display: inline-block; margin: 0 0 20px; }
}

/*
 * Reduced motion. The global rule above only shortens animation-duration —
 * which would make an infinite marquee FLICKER rather than stop. So it is
 * switched off explicitly, and the facts wrap onto the page instead of being
 * clipped: pause the scroll, don't hide the content.
 */
@media (prefers-reduced-motion: reduce) {
  .marquee { white-space: normal; padding: 12px 28px; }
  .marquee-track { animation: none !important; display: block; }
  .marquee-set[aria-hidden="true"] { display: none; }
  .btn:hover:not(:disabled), .btn:active:not(:disabled) { transform: none; }
}

/* =========================================================================
 * IQ Battle — James's challenge screens (iq-battle-screens.html), in v2.
 *
 * Class names are prefixed where the mock reused generic ones (.band, .score,
 * .row, .sub) that already style other things here — .band alone would have
 * given every head-to-head badge a 3px section border.
 * ========================================================================= */

.chal-hero { display: grid; grid-template-columns: 1.1fr .9fr; border-bottom: 3px solid var(--ink); }
.chal-copy { padding: 64px 52px; border-right: 3px solid var(--ink); position: relative; }
.chal-copy h2 {
  font-family: var(--serif); font-weight: 400; font-size: 64px; line-height: .98;
  margin: 0 0 24px; max-width: 12ch;
}
.chal-copy .deck b {
  /* The mock set this word in cream on orange: 3.0:1 at 17px, which fails. Ink is 5.3:1. */
  background: var(--fill); color: var(--ink); padding: 1px 8px;
}
.target-card {
  display: inline-flex; align-items: center; gap: 16px;
  border: 3px solid var(--ink); padding: 14px 20px; margin-bottom: 28px; background: var(--paper-2);
}
.target-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.target-band { font-family: var(--serif); font-size: 26px; }
.chal-fig { position: relative; display: flex; align-items: center; justify-content: center; margin: 0; }
.vs-card {
  position: relative; background: var(--fill); border: 3px solid var(--ink); padding: 40px 44px;
  transform: rotate(-2deg); box-shadow: 10px 10px 0 var(--stamp); text-align: center;
}
.vs-word { font-family: var(--serif); font-size: 110px; line-height: .85; color: var(--paper); } /* display size: 3:1 applies */
.vs-sub { color: var(--ink); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; margin-top: 10px; }
.chal-note {
  margin: 0; padding: 20px 52px; border-bottom: 3px solid var(--ink);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent);
}
.byline.consent { color: var(--ink); font-weight: 600; }

.h2h { border-top: 3px solid var(--ink); }
.h2h-top { padding: 44px 52px 30px; border-bottom: 3px solid var(--ink); text-align: center; }
.h2h-top h2 { font-family: var(--serif); font-weight: 400; font-size: 44px; margin: 0; }
.h2h-grid { display: grid; grid-template-columns: 1fr 90px 1fr; }
.h2h-col { padding: 44px; }
.h2h-col.win { background: var(--fill); }
.h2h-who { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; color: var(--accent); }
.h2h-col.win .h2h-who { color: var(--ink); }
.h2h-score { font-family: var(--serif); font-size: 96px; line-height: 1; }
.h2h-col.win .h2h-score { color: var(--paper); } /* 96px: large text, 3:1 applies */
.h2h-band {
  display: inline-block; margin-top: 8px; padding: 5px 12px; border: 2px solid var(--ink);
  font-size: 13px; font-weight: 800; text-transform: uppercase;
}
.h2h-col.win .h2h-band { background: var(--ink); color: var(--paper); }
.h2h-mid {
  display: flex; align-items: center; justify-content: center;
  border-left: 3px solid var(--ink); border-right: 3px solid var(--ink);
  font-family: var(--serif); font-size: 26px; font-style: italic; color: var(--accent);
}
.cat-mini { margin-top: 24px; display: grid; gap: 8px; }
.cat-mini-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; font-weight: 700; border-top: 2px solid rgba(21, 18, 9, .2); padding-top: 6px;
}
.h2h-foot { padding: 36px 52px; border-top: 3px solid var(--ink); text-align: center; }
.h2h-foot p { font-family: var(--serif); font-size: 19px; max-width: 52ch; margin: 0 auto 24px; line-height: 1.5; }
.h2h-foot p:last-child { margin-bottom: 0; }
.h2h-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.h2h-waiting { margin: 0; padding: 24px 52px; border-top: 3px solid var(--ink); font-size: 14px; color: var(--ink-2); text-align: center; }
#challenge-link-out { word-break: break-all; }

@media (max-width: 1000px) {
  .chal-hero, .h2h-grid { grid-template-columns: 1fr; }
  .chal-copy { padding: 44px 28px; border-right: none; border-bottom: 3px solid var(--ink); }
  .chal-copy h2 { font-size: 42px; max-width: none; }
  .chal-fig { padding: 40px 28px; }
  .vs-word { font-size: 80px; }
  .chal-note { padding: 18px 28px; }
  .h2h-top, .h2h-foot { padding: 28px; }
  .h2h-top h2 { font-size: 32px; }
  .h2h-col { padding: 28px; }
  .h2h-score { font-size: 72px; }
  .h2h-mid {
    border-left: none; border-right: none;
    border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); padding: 8px;
  }
  .h2h-waiting { padding: 20px 28px; }
}

/* ------------------------------------------------------- page transitions */
/*
 * Moving between pages: the old page fades out quickly, and the new one fades
 * in while settling up 10px. It stays under 250ms so it never gets in the way.
 * Browsers with cross-document view transitions (Chrome, Edge, Safari 18.2+)
 * animate real route changes. Everywhere else the content simply settles in on
 * load. Screens inside the app (landing, gate, test, paywall, result) use the
 * same motion through .view-enter. Reduced motion: instant, no transition.
 */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-out 120ms ease-in both; }
::view-transition-new(root) { animation: page-in 200ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } }

/* backwards, not both: no transform is left behind on the view once it settles. */
.view-enter { animation: page-in 200ms cubic-bezier(.2, .8, .2, 1) backwards; }

@supports not (view-transition-name: none) {
  main { animation: page-in 200ms cubic-bezier(.2, .8, .2, 1) backwards; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-old(root), ::view-transition-new(root), .view-enter, main { animation: none !important; }
}

/* --------------------------------------------------------- depth and motion */
/*
 * James's depth-and-motion system (depth-and-motion-system.html). Transform and
 * opacity only, all of it behind prefers-reduced-motion, and none of it on the
 * paywall's price, button or checkout hand-off.
 *
 * Scroll reveals: landing sections and content-page sections rise in as they
 * enter the viewport. `backwards` fills only before the range, so a section
 * already on screen at load is fully visible and nothing is left transformed.
 * Browsers without scroll timelines show a still, complete page.
 */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    @keyframes rise-in { from { opacity: 0; transform: translateY(28px); } }
    #view-landing .split, #view-landing .band, #view-landing .toc-item, .page-section {
      animation: rise-in linear backwards;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }

  /* IQ Tester: answer rows press in; the certificate preview leans toward you. */
  html:not([data-theme]) .choice span { transition: color .1s ease, background .1s ease, transform .08s ease; }
  html:not([data-theme]) .choice span:active { transform: scale(.985); }
  .cert-preview { transition: transform .25s ease; }
  .cert-preview:hover { transform: perspective(900px) rotateX(6deg) rotateY(-8deg); }
}

/* iq_offer B: the free score on the paywall, and the certificate preview. */
.pay-score { font-family: var(--serif); font-size: clamp(72px, 12vw, 120px); line-height: 1; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.cert-preview { display: grid; gap: 4px; border: 3px solid var(--ink); background: var(--paper); padding: 14px 16px; margin: 12px 0 18px; text-align: center; }
.cert-preview-title { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.cert-preview-name { font-family: var(--serif); font-size: 22px; border-bottom: 2px solid var(--ink); padding-bottom: 4px; }
.cert-preview-score { font-weight: 700; font-size: 14px; }
.cert-get { margin-top: 28px; display: grid; gap: 10px; max-width: 360px; }
.cert-label { font-weight: 700; font-size: 14px; }
.cert-input { font: inherit; font-size: 16px; padding: 12px 14px; border: 3px solid var(--ink); background: var(--paper); min-height: 44px; }

/* No "Start test" in the header once someone has a result (James). */
body:is([data-view="guess"], [data-view="scoring"], [data-view="paywall"], [data-view="result"], [data-view="review"], [data-view="skipped"]) #nav-start { visibility: hidden; }

/* paywall_layout B on IQ Tester (James, paywall-research-and-redesign.html): a
   page of the report above the price. Layout A never shows it; themes that do
   not carry the markup are unaffected. Ink on white (15.9:1) throughout. */
.report-preview { display: none; }
#view-paywall[data-layout="B"] .report-preview { display: grid; gap: 10px; margin: 6px 0 20px; }
.report-preview-title { font-family: var(--serif); font-size: 26px; line-height: 1.1; margin: 0 0 4px; color: var(--ink); }
.report-row {
  position: relative; display: grid; gap: 4px; text-align: left;
  background: #fffdf6; color: var(--ink); border: 3px solid var(--ink); padding: 12px 14px;
  font-family: var(--serif); font-size: 14px; line-height: 1.4;
}
.report-row b { font-family: var(--sans); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.report-stamp {
  position: absolute; top: -12px; right: 10px; transform: rotate(4deg);
  background: var(--stamp); color: var(--ink); border: 2px solid var(--ink);
  padding: 1px 8px; font: 800 10.5px var(--sans); letter-spacing: .08em; text-transform: uppercase;
}
.report-lines { display: grid; gap: 7px; padding-top: 4px; filter: blur(3px); }
.report-lines i { display: block; height: 10px; background: rgba(21, 18, 9, .45); }
.report-lines i:first-child { width: 88%; }
.report-lines i:last-child { width: 62%; }

/* Landing: sample result (labelled Sample) and the stated price */
.sample-result { position: relative; gap: 20px; }
.sample-result .sample-stamp { position: absolute; top: 20px; right: 24px; transform: rotate(-5deg); }
.sample-reveal { text-align: left; }
.sample-score { font-family: var(--serif); font-size: 88px; line-height: 1; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.sample-result .reveal-band { margin-top: 12px; }
.price-sub { margin: 12px 0 0; }

/* ------------------------------------------------------ embedded checkout */
/* checkout_ui "embedded" (James, pay-step-design.html): a sheet over the
   paywall with what they get beside Stripe's form. Theme tokens throughout, so
   every product's sheet matches its paywall. No trust badges, no countdown. */
.checkout-sheet {
  width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0;
  border: 3px solid var(--ink); background: var(--paper); color: var(--ink);
}
.checkout-sheet::backdrop { background: rgba(0, 0, 0, .55); }
.checkout-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 3px solid var(--ink); }
.checkout-brand { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.checkout-secure { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.checkout-close { margin-left: auto; min-height: 44px; white-space: nowrap; padding: 0 12px; background: none; border: 0; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.checkout-body { display: grid; grid-template-columns: 1fr 1.25fr; }
.checkout-summary { padding: 22px 22px 24px; border-right: 3px solid var(--ink); }
.checkout-price { font-family: var(--serif); font-size: 48px; line-height: 1; margin: 8px 0 6px; }
.checkout-sub { font-weight: 700; margin: 0 0 14px; }
.checkout-list { margin: 0 0 14px; padding-left: 18px; }
.checkout-list li { margin-bottom: 6px; }
.checkout-note { font-size: 13.5px; color: var(--muted); margin: 0; }
/* Stripe's iframe draws its own light surface; give it room and no clash. */
.checkout-mount { padding: 16px; background: #ffffff; min-height: 420px; overflow: auto; }
@media (max-width: 720px) {
  .checkout-body { grid-template-columns: 1fr; }
  .checkout-summary { border-right: 0; border-bottom: 3px solid var(--ink); padding: 16px 18px; }
  .checkout-price { font-size: 36px; }
  .checkout-list { font-size: 13.5px; margin-bottom: 0; }
  .checkout-note { display: none; }
}

/* ======================================================================
 * IQ Tester: "The Daily Exam" broadsheet (James, five-architectures.html §1)
 * A newspaper front page instead of the shared skeleton: centred masthead with
 * a dated edition line and section tabs, three unequal columns with the first
 * question on the front page, letters to the editor for the FAQ, an exam paper
 * with a margin, a report card, and the paywall as Section B. Only IQ Tester's
 * page carries data-layout="broadsheet"; themes and content pages are untouched.
 * No scroll reveal hides anything here.
 * ====================================================================== */
html[data-layout="broadsheet"] #view-landing * { animation: none; }

.masthead { max-width: 1224px; margin: 24px auto 0; background: var(--paper); border: 3px solid var(--ink); border-bottom: 0; text-align: center; padding: 14px 24px 0; }
.mast-meta {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font: 800 11px var(--sans); letter-spacing: .14em; text-transform: uppercase;
  border-bottom: 1px solid var(--ink); padding-bottom: 8px;
}
.mast-title { display: inline-block; margin: 10px 0 8px; font-family: var(--serif); font-size: clamp(48px, 9vw, 88px); line-height: 1; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.mast-title b { background: var(--ink); color: var(--paper); padding: 0 14px; font-weight: 400; }
.mast-tabs {
  display: flex; justify-content: center; align-items: center; gap: 22px; flex-wrap: wrap;
  border-top: 4px double var(--ink); padding: 10px 0;
  font: 800 12px var(--sans); letter-spacing: .12em; text-transform: uppercase;
}
.mast-tabs a { color: var(--ink); text-decoration: none; }
.mast-tabs a:hover { color: var(--accent); }
.mast-tabs .btn { margin-left: 8px; }
html[data-layout="broadsheet"] #view-landing { border-top: 1px solid var(--ink); }

.front { display: grid; grid-template-columns: 230px minmax(0, 1fr) 250px; border-bottom: 4px double var(--ink); }
.front .rail { padding: 24px 22px; font-size: 14px; line-height: 1.5; }
.front .rail-left { border-right: 1px solid var(--ink); }
.front .rail-right { border-left: 1px solid var(--ink); }
.rail-h { font: 800 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 22px 0 8px; }
.rail-h:first-child { margin-top: 0; }
.rail p { margin: 0 0 10px; }
.rail-num { font-family: var(--serif); font-size: 56px; line-height: 1; margin: 0 0 4px !important; }
.rail-index { list-style: none; margin: 0; padding: 0; }
.rail-index li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.rail-index b { font-family: var(--serif); font-weight: 400; color: var(--accent); margin-right: 8px; }

.report-card { border: 3px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -8px; background: var(--paper-2); padding: 16px 14px; text-align: center; }
.report-card-k { font: 800 10px var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.report-card .sample-score { font-size: 56px; margin: 6px 0 0; }
.report-card-band { font: 800 12px var(--sans); margin: 4px 0 10px; }
.report-card-grades { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font: 700 11.5px var(--sans); }
.report-card-grades span { border: 2px solid var(--ink); padding: 4px; }

.front .paper { padding: 26px 30px 30px; min-width: 0; }
.front .paper h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5.4vw, 66px); line-height: 1; letter-spacing: -.01em; margin: 6px 0 12px; max-width: none; }
.front .paper h1 .mark { background: var(--fill); color: var(--paper); padding: 0 10px; display: inline-block; transform: rotate(-1deg); }
.exam-sheet { border: 2px solid var(--ink); background: #fffdf6; padding: 20px 22px; margin: 18px 0 20px; }
.exam-qn { font: 800 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.exam-sheet .sample-q { font-size: 26px; margin: 0 0 12px; }
.exam-seq { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; }
.exam-seq i { font-style: normal; border: 2px solid var(--ink); padding: 8px 14px; font-family: var(--serif); font-size: 22px; min-width: 48px; text-align: center; }
.exam-seq i.blank { background: var(--stamp); }
#sample.exam-sheet .sample-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; }
.exam-sheet .sample-opt { border: 2px solid var(--ink); background: transparent; color: var(--ink); padding: 11px 14px; min-height: 44px; font: 700 16px var(--sans); text-align: left; cursor: pointer; display: flex; gap: 10px; }
.exam-sheet .sample-opt i { font-family: var(--serif); font-style: normal; font-weight: 400; color: var(--accent); }
.exam-sheet .sample-opt:hover, .exam-sheet .sample-opt[aria-pressed="true"] { background: var(--stamp); }
.exam-sheet .sample-opt.right { background: var(--stamp); box-shadow: inset 6px 0 0 var(--ink); }
.exam-sheet .sample-opt.wrong { background: var(--paper-2); box-shadow: inset 6px 0 0 var(--accent); }
.exam-sheet #sample-verdict { margin: 12px 0 0; font-size: 14.5px; }

.letters { padding: 26px 30px; border-bottom: 4px double var(--ink); }
.letters-h { font-family: var(--serif); font-weight: 400; font-size: 32px; text-align: center; margin: 0 0 18px; }
.letters .letters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; margin: 0; max-width: none; border-top: 0; }
.letters .letters-grid dd { border-bottom: 0; padding-bottom: 0; }
.letters .letters-grid dt { padding: 0; }
.letters-grid > div { padding: 0 18px 12px; border-left: 1px solid var(--ink); }
.letters-grid > div:first-child { border-left: 0; }
.letters-grid dt { font-family: var(--serif); font-style: italic; font-size: 17px; margin: 0 0 6px; }
.letters-grid dd { margin: 0; font-size: 14px; }
.letters > .prose { text-align: center; margin: 16px auto 0; max-width: none; }
.edition-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; }

/* The exam paper: a margin beside the question. */
html[data-layout="broadsheet"] .q-grid { grid-template-columns: auto minmax(0, 1fr) 200px; }
.q-margin { display: none; }
html[data-layout="broadsheet"] .q-margin { display: block; border-left: 1px solid var(--ink); padding: 0 0 0 18px; font-size: 13.5px; font-style: italic; }
.q-margin-k { display: block; font: 800 10.5px var(--sans); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* The report card and Section B. */
html[data-layout="broadsheet"] #view-result .reveal { border: 3px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -10px; margin: 24px; background: #fffdf6; }
.section-flag { display: none; }
html[data-layout="broadsheet"] .section-flag {
  display: block; margin: 0; padding: 10px 24px; border-bottom: 4px double var(--ink);
  font: 800 11px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); text-align: center;
}

@media (max-width: 900px) {
  .front { grid-template-columns: 1fr; }
  .front .rail-left, .front .rail-right { border: 0; }
  /* On a phone the exam comes first; the rails follow as notes. */
  .front .paper { order: -1; padding: 22px 18px; border-bottom: 1px solid var(--ink); }
  .front .rail-left { border-bottom: 1px solid var(--ink); }
  .letters-grid > div { border-left: 0; border-top: 1px solid var(--ink); padding: 12px 0; }
  html[data-layout="broadsheet"] .q-grid { grid-template-columns: minmax(0, 1fr); }
  html[data-layout="broadsheet"] .q-margin { border-left: 0; border-top: 1px solid var(--ink); padding: 12px 0 0; }
  /* Same side margins as the sheet below it. */
  .masthead { margin: 12px 16px 0; padding: 10px 14px 0; }
  .mast-meta span:first-child { display: none; }
  .mast-tabs { gap: 14px; }
}
@media (max-width: 480px) {
  #sample.exam-sheet .sample-options { grid-template-columns: 1fr; }
  .exam-sheet { padding: 16px; }
}
/* Past the front page the masthead is just the nameplate: no tabs, no start
   button above an exam that has already started. */
body:is([data-view="gate"], [data-view="test"], [data-view="guess"], [data-view="scoring"], [data-view="paywall"], [data-view="result"], [data-view="review"], [data-view="skipped"]) .masthead .mast-meta,
body:is([data-view="gate"], [data-view="test"], [data-view="guess"], [data-view="scoring"], [data-view="paywall"], [data-view="result"], [data-view="review"], [data-view="skipped"]) .masthead .mast-tabs { display: none; }
body:is([data-view="gate"], [data-view="test"], [data-view="guess"], [data-view="scoring"], [data-view="paywall"], [data-view="result"], [data-view="review"], [data-view="skipped"]) .masthead { padding-bottom: 10px; }
html[data-layout="broadsheet"] .prog-count { white-space: nowrap; }
