/* CartIntel: landing page stylesheet.
   World: newsroom copy desk. White ground, near-black ink, highlighter yellow for
   verified passages and the one action, red pencil for what was refused.
   No build step; this file is served as written. */

/* ---------- Fonts (self-hosted, latin subsets) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/BricolageGrotesque-300_800-normal.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/CourierPrime-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/CourierPrime-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/CourierPrime-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  --paper: #fbfbf9;
  --paper-2: #f1f1ed;
  --ink: #16171a;
  --ink-2: #45474c;
  --ink-3: #6f7278;
  --rule: #d6d7d2;
  --rule-strong: #16171a;

  --hi: #ffe45c;
  --hi-soft: #fff4b8;
  --hi-ink: #16171a;

  --pencil: #c2312a;
  --pencil-soft: #f6dcd9;
  --graphite: #5a5d63;

  --sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;

  --measure: 64ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 1180px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 180ms;
  --t-slow: 900ms;
  --t-hi: 1600ms;

  --shadow-sheet: 0 1px 0 rgb(22 23 26 / 0.08), 0 8px 18px -12px rgb(22 23 26 / 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151514;
    --paper-2: #1d1d1b;
    --ink: #ecebe6;
    --ink-2: #b9b8b1;
    --ink-3: #8a8a84;
    --rule: #33332f;
    --rule-strong: #ecebe6;
    --hi: #f0d33a;
    --hi-soft: #4d4315;
    --hi-ink: #151514;
    --pencil: #e5574d;
    --pencil-soft: #3d1f1c;
    --graphite: #a5a49d;
    --shadow-sheet: 0 1px 2px rgb(0 0 0 / 0.5), 0 14px 40px -18px rgb(0 0 0 / 0.8);
  }
}
:root[data-theme="dark"] {
  --paper: #151514;
  --paper-2: #1d1d1b;
  --ink: #ecebe6;
  --ink-2: #b9b8b1;
  --ink-3: #8a8a84;
  --rule: #33332f;
  --rule-strong: #ecebe6;
  --hi: #f0d33a;
  --hi-soft: #4d4315;
  --hi-ink: #151514;
  --pencil: #e5574d;
  --pencil-soft: #3d1f1c;
  --graphite: #a5a49d;
  --shadow-sheet: 0 1px 2px rgb(0 0 0 / 0.5), 0 14px 40px -18px rgb(0 0 0 / 0.8);
}

/* ---------- Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--ink-3); }
a:hover { text-decoration-color: var(--ink); }
strong { font-weight: 600; }
small { font-size: 0.875em; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Browser surfaces carry the world too. */
::selection { background: var(--hi); color: var(--hi-ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 1px; }
html { caret-color: var(--ink); scrollbar-color: var(--ink-3) var(--paper-2); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: var(--ink-3); border: 3px solid var(--paper-2); border-radius: 0; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -3rem;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; z-index: 40;
  transition: top var(--t-fast) var(--ease-out);
}
.skip-link:focus { top: 0.75rem; }

/* ---------- Type ---------- */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; letter-spacing: -0.02em; line-height: 1.05; }
h1 { font-size: clamp(2.375rem, 4.4vw, 3.375rem); }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); letter-spacing: -0.018em; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.3; }
.lede { font-size: clamp(1.125rem, 1.4vw, 1.3125rem); line-height: 1.45; color: var(--ink-2); max-width: 36ch; text-wrap: pretty; }
.prose { max-width: var(--measure); text-wrap: pretty; }
.prose p + p { margin-top: 1em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* Source mark: superscript reference the way a fact-checker cites. */
.src {
  font-family: var(--mono); font-size: 0.72em; vertical-align: super; line-height: 0;
  color: var(--graphite); text-decoration: none; margin-left: 0.15em;
}
.src:hover { color: var(--ink); }

/* Verified passage: highlighter that sweeps in once. */
.hi {
  background-image: linear-gradient(var(--hi), var(--hi));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: 0 0;
  color: var(--hi-ink);
  padding: 0.05em 0.15em;
  margin: 0 -0.15em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .sweep .hi { background-size: 0% 100%; transition: background-size var(--t-hi) var(--ease-out) 120ms; }
  html.js .sweep.in-view .hi { background-size: 100% 100%; }
}

/* Killed passage: red pencil strike that draws once. */
.kill { position: relative; color: var(--ink-2); }
.kill::after {
  content: ""; position: absolute; left: -0.1em; right: -0.1em; top: 52%;
  height: 2px; background: var(--pencil); transform: rotate(-1.2deg); transform-origin: left center;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .sweep .kill::after { transform: scaleX(0) rotate(-1.2deg); transition: transform var(--t-slow) var(--ease-out) 200ms; }
  html.js .sweep.in-view .kill::after { transform: scaleX(1) rotate(-1.2deg); }
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(4rem, 9vw, 7.5rem); border-top: 1px solid var(--rule); }
.section > .wrap > h2 { margin-bottom: clamp(1.75rem, 4vw, 3rem); max-width: 22ch; }
.section-tight { padding-block: clamp(3rem, 6vw, 5rem); }
.grid { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); }
@media (min-width: 900px) {
  .grid-7-5 { grid-template-columns: 7fr 5fr; align-items: start; }
  .grid-5-7 { grid-template-columns: 5fr 7fr; align-items: start; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-4-8 { grid-template-columns: 4fr 8fr; }
}

/* ---------- Buttons and links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.9rem 1.25rem; border: 1px solid var(--ink); border-radius: 2px;
  background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none;
  white-space: nowrap; line-height: 1;
  transition: transform var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.btn .i { width: 1.05em; height: 1.05em; transition: transform var(--t-fast) var(--ease-out); }
.btn:hover .i { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--hi); color: var(--hi-ink); border-color: var(--hi); }
.btn-primary:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-lg { padding: 1.05rem 1.5rem; font-size: 1.0625rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 500; }
.link-arrow .i { width: 1em; height: 1em; transition: transform var(--t-fast) var(--ease-out); }
.link-arrow:hover .i { transform: translateY(2px); }
.i { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ---------- Preview strip and pending decisions ---------- */
.preview-strip { display: none; }
body[data-preview="true"] .preview-strip {
  display: block; background: var(--paper-2); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-2); padding: 0.55rem 0; text-align: center;
}
body[data-preview="true"] .todo {
  text-decoration: underline; text-decoration-style: dashed; text-decoration-color: var(--pencil); text-underline-offset: 0.2em;
  cursor: help;
}
body[data-preview="true"] .synthetic-label { display: inline-block; }
.synthetic-label { display: none; font-family: var(--mono); font-size: 0.75rem; color: var(--pencil); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.wordmark { font-weight: 700; letter-spacing: -0.03em; font-size: 1.25rem; text-decoration: none; display: inline-flex; align-items: baseline; gap: 0.35rem; }
.wordmark span { font-family: var(--mono); font-weight: 400; letter-spacing: 0; font-size: 0.8125rem; color: var(--ink-3); }
.nav-links { display: flex; gap: clamp(1rem, 2.5vw, 2rem); }
.nav-links a { text-decoration: none; font-weight: 500; color: var(--ink-2); padding: 0.25rem 0; border-bottom: 1px solid transparent; }
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav .btn { padding: 0.7rem 1rem; }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .wordmark span:last-child { display: none; }
  .nav .btn { padding: 0.65rem 0.85rem; font-size: 0.9375rem; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem); }
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-top: 2rem; }
.hero-note { margin-top: 2.5rem; max-width: 40ch; font-size: 0.9375rem; color: var(--ink-3); text-wrap: pretty; }
.hero-note a { color: var(--ink-2); }

/* ---------- The manuscript sheet (record) ---------- */
.sheet {
  position: relative; background: var(--paper); border: 1px solid var(--rule); border-radius: 2px;
  box-shadow: var(--shadow-sheet); padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 2.5vw, 1.75rem);
  font-family: var(--mono); font-size: 0.9375rem; line-height: 1.5; color: var(--ink);
}
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.35rem 1rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--rule-strong); font-size: 0.8125rem; color: var(--ink-2); }
.sheet-head b { color: var(--ink); font-weight: 700; }
.sheet dl { display: grid; grid-template-columns: max-content 1fr; column-gap: 1.25rem; row-gap: 0.55rem; margin-top: 1rem; }
.sheet dt { color: var(--ink-3); font-size: 0.8125rem; padding-top: 0.15em; }
.sheet dd { margin: 0; overflow-wrap: anywhere; }
.sheet .evidence { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--rule); }
.sheet .evidence p { margin-top: 0.4rem; line-height: 1.6; }
.sheet .cite { margin-top: 0.75rem; font-size: 0.8125rem; color: var(--ink-2); }
.sheet .cite a { color: var(--ink); }
.sheet .cite li + li { margin-top: 0.35rem; }
.sheet-foot { margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); font-size: 0.8125rem; color: var(--ink-3); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tag { display: inline-block; font-family: var(--mono); font-size: 0.75rem; padding: 0.1em 0.45em; border: 1px solid var(--ink); border-radius: 2px; line-height: 1.5; }
.tag-a { background: var(--hi); border-color: var(--hi); color: var(--hi-ink); }
.tag-kill { border-color: var(--pencil); color: var(--pencil); }

/* Margin note: the checker's annotation, graphite, hanging in the gutter on wide screens. */
.margin-note {
  font-family: var(--mono); font-size: 0.8125rem; line-height: 1.45; color: var(--graphite);
  display: flex; gap: 0.5rem; align-items: flex-start; margin-top: 1.1rem;
}
.margin-note .i { width: 1rem; height: 1rem; margin-top: 0.1rem; }
.margin-note.confirmed .i { color: var(--ink); }
.margin-note.killed { color: var(--pencil); }
.margin-note.killed .i { color: var(--pencil); }
@media (min-width: 1440px) {
  .sheet-with-margin { position: relative; }
  .sheet-with-margin .margin-note { position: absolute; left: calc(100% + 0.9rem); top: 4.25rem; width: min(11rem, calc((100vw - var(--max)) / 2 - 1.6rem)); margin: 0; }
}

/* ---------- Problem statement ---------- */
.statement { font-size: clamp(1.375rem, 2.4vw, 1.875rem); line-height: 1.3; letter-spacing: -0.012em; max-width: 30ch; font-weight: 500; text-wrap: pretty; }
.statement + .prose { margin-top: 1.75rem; }

/* ---------- Definition grid (what's in a record) ---------- */
.fields { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule-strong); }
.fields > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.fields dt { font-family: var(--mono); font-size: 0.9375rem; color: var(--ink); }
.fields dd { margin: 0; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
.fields dd .mono { color: var(--ink); font-size: 0.9375rem; }
@media (max-width: 600px) { .fields > div { grid-template-columns: 1fr; gap: 0.3rem; } }
@media (min-width: 900px) { .fields { grid-template-columns: 1fr 1fr; column-gap: 3rem; } }

/* ---------- Tiers ledger ---------- */
.tiers { border-top: 1px solid var(--rule-strong); }
.tier { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--rule); align-items: start; }
.tier-letter { font-family: var(--mono); font-weight: 700; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1; letter-spacing: -0.02em; }
.tier-letter.hi { padding: 0.05em 0.2em; margin: 0; display: inline-block; }
.tier-letter.killed { color: var(--pencil); }
.tier h3 { margin-bottom: 0.4rem; }
.tier p { color: var(--ink-2); max-width: 56ch; text-wrap: pretty; }
.tier .example { grid-column: 2; margin-top: 0.9rem; font-family: var(--mono); font-size: 0.9375rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; align-items: baseline; }
.tier .example .faint { font-size: 0.8125rem; }
@media (min-width: 900px) {
  .tier { grid-template-columns: 4.5rem 1.15fr 1fr; }
  .tier .example { grid-column: 3; margin-top: 0.15rem; flex-direction: column; gap: 0.3rem; }
}

/* ---------- Process ---------- */
.process { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 900px) { .process { grid-template-columns: 5fr 7fr; } }
.moves { display: grid; gap: 1.5rem; }
.moves h3 { margin-bottom: 0.35rem; }
.moves p { color: var(--ink-2); max-width: 40ch; text-wrap: pretty; }
.checklist { border-top: 1px solid var(--rule-strong); }
.checklist li { display: grid; grid-template-columns: 2rem 1fr; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); align-items: start; }
.checklist .box { width: 1.5rem; height: 1.5rem; border: 1.5px solid var(--ink); border-radius: 2px; display: grid; place-items: center; margin-top: 0.2rem; }
.checklist .box .i { width: 1rem; height: 1rem; }
.checklist .q { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 500; letter-spacing: -0.012em; line-height: 1.3; text-wrap: balance; }
.checklist .a { margin-top: 0.4rem; color: var(--ink-2); max-width: 48ch; text-wrap: pretty; }
.process-foot { margin-top: 1.25rem; font-family: var(--mono); font-size: 0.875rem; color: var(--ink-2); display: flex; gap: 0.5rem; align-items: flex-start; }
.process-foot .i { margin-top: 0.15rem; }

/* ---------- Refused record / check it yourself ---------- */
.refused .sheet { border-color: var(--rule); }
.refused .sheet-head b { color: var(--pencil); }
.howto { counter-reset: step; }
.howto li { display: grid; grid-template-columns: 2.25rem 1fr; gap: 0.75rem; padding: 0.9rem 0; border-top: 1px solid var(--rule); }
.howto li:first-child { border-top-color: var(--rule-strong); }
.howto li::before { counter-increment: step; content: counter(step) "."; font-family: var(--mono); color: var(--ink-3); }
.howto li b { display: block; }
.howto li span { color: var(--ink-2); }

/* ---------- Price sheet ---------- */
.prices { border-top: 1px solid var(--rule-strong); display: grid; }
.price { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.price h3 { font-size: 1.125rem; }
.price .count { font-family: var(--mono); color: var(--ink-2); font-size: 0.9375rem; }
.price .amount { grid-column: 1 / -1; justify-self: start; font-family: var(--mono); font-weight: 700; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.02em; margin-top: 0.25rem; }
.price .amount.free { background: var(--hi); color: var(--hi-ink); padding: 0.05em 0.25em; }
.price .what { grid-column: 1 / -1; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
@media (min-width: 900px) {
  .prices { grid-template-columns: repeat(3, 1fr); column-gap: 2.5rem; }
  .price { grid-template-columns: 1fr; align-content: start; padding: 1.5rem 0 1.75rem; }
}
.delivery { margin-top: 2rem; display: grid; gap: 1rem 2.5rem; }
@media (min-width: 900px) { .delivery { grid-template-columns: repeat(3, 1fr); } }
.delivery div { font-size: 0.9375rem; color: var(--ink-2); max-width: 36ch; text-wrap: pretty; }
.delivery b { color: var(--ink); display: block; margin-bottom: 0.15rem; }

/* ---------- Guarantee ---------- */
.promise { display: grid; gap: 2rem; }
@media (min-width: 900px) { .promise { grid-template-columns: 1fr 1fr; gap: 3.5rem; } }
.promise h3 { padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule-strong); margin-bottom: 0.25rem; }
.promise li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.75rem; color: var(--ink-2); }
.promise li b { color: var(--ink); font-weight: 600; }
.promise li .i { margin-top: 0.3rem; }
.promise .no li .i { color: var(--pencil); }
.promise .yes li .i { color: var(--ink); }
.promise-note { margin-top: 1.5rem; color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }

/* ---------- Sample form ---------- */

.form { border-top: 1px solid var(--rule-strong); padding-top: 1.5rem; }
.form h3 { margin-bottom: 0.5rem; }
.form > p { color: var(--ink-2); max-width: 48ch; text-wrap: pretty; }
.field { display: grid; gap: 0.4rem; margin-top: 1.25rem; }
.field label { font-weight: 500; }
.field .help { font-size: 0.875rem; color: var(--ink-3); }
.field input, .field textarea {
  width: 100%; padding: 0.8rem 0.9rem; background: var(--paper); border: 1px solid var(--ink-3); border-radius: 2px;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.field textarea { min-height: 5.5rem; resize: vertical; font-family: var(--mono); font-size: 0.9375rem; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--hi-soft); }
.field.invalid input, .field.invalid textarea { border-color: var(--pencil); }
.error { display: none; font-size: 0.875rem; color: var(--pencil); }
.field.invalid .error { display: block; }
.form-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.form-actions .alt { font-size: 0.9375rem; color: var(--ink-2); }
.form-status { margin-top: 1.25rem; padding: 1rem 1.1rem; border: 1px solid var(--rule-strong); border-radius: 2px; display: none; }
.form-status.show { display: block; }
.form-status b { display: block; margin-bottom: 0.25rem; }
.form-status code { font-family: var(--mono); background: var(--paper-2); padding: 0.1em 0.3em; }
@media (min-width: 640px) { .form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; } .form .row .field { margin-top: 1.25rem; } }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0 3rem; }
@media (min-width: 900px) { .faq { grid-template-columns: 1fr 1fr; } }
.faq details { border-top: 1px solid var(--rule); }
.faq details:first-of-type { border-top-color: var(--rule-strong); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 0; font-weight: 500; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { width: 1rem; height: 1rem; color: var(--ink-3); transition: transform var(--t-fast) var(--ease-out); flex: none; }
.faq details[open] summary .i { transform: rotate(180deg); }
.faq .answer { padding: 0 0 1.25rem; color: var(--ink-2); max-width: 56ch; text-wrap: pretty; }
.faq .answer a { color: var(--ink); }

/* ---------- Closing ask ---------- */
.close { text-align: left; }
.close h2 { max-width: 20ch; }
.close .lede { margin-top: 1rem; }
.close .btn { margin-top: 2rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--rule-strong); padding-block: 2.5rem 3rem; font-size: 0.9375rem; color: var(--ink-2); }
.footer .wrap { display: grid; gap: 1.5rem 3rem; }
@media (min-width: 900px) { .footer .wrap { grid-template-columns: 1.2fr 1fr 1fr; } }
.footer h3 { font-size: 0.9375rem; color: var(--ink); margin-bottom: 0.5rem; }
.footer address { font-style: normal; line-height: 1.6; }
.footer ul { display: grid; gap: 0.35rem; }
.footer .legal { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--ink-3); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; }

/* ---------- Legal pages ---------- */
.doc { padding-block: clamp(3rem, 6vw, 5rem); }
.doc h1 { font-size: clamp(2rem, 4vw, 2.75rem); max-width: 20ch; }
.doc .updated { margin-top: 1rem; font-family: var(--mono); font-size: 0.875rem; color: var(--ink-3); }
.doc .prose { margin-top: 2.5rem; }
.doc h2 { font-size: 1.375rem; margin-top: 2.5rem; margin-bottom: 0.75rem; letter-spacing: -0.012em; }
.doc ul { list-style: disc; padding-left: 1.25rem; }
.doc li + li { margin-top: 0.4rem; }
.doc p { color: var(--ink-2); }
.doc li { color: var(--ink-2); }

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Content never hides. Only strokes wait for the line (see the motion layer). */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

@media print {
  .nav, .preview-strip, .skip-link, .form { display: none; }
  .section { border-top-color: #000; }
  a { text-decoration: none; }
}

/* Dark desk, white paper: the manuscript sheet keeps its material under a dark scheme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sheet {
    --paper: #fbfbf9; --paper-2: #f1f1ed; --ink: #16171a; --ink-2: #45474c; --ink-3: #6f7278;
    --rule: #d6d7d2; --rule-strong: #16171a; --hi: #ffe45c; --hi-soft: #fff4b8; --hi-ink: #16171a;
    --pencil: #c2312a; --graphite: #5a5d63;
    box-shadow: 0 1px 0 rgb(0 0 0 / 0.6), 0 10px 24px -12px rgb(0 0 0 / 0.9);
  }
}
:root[data-theme="dark"] .sheet {
  --paper: #fbfbf9; --paper-2: #f1f1ed; --ink: #16171a; --ink-2: #45474c; --ink-3: #6f7278;
  --rule: #d6d7d2; --rule-strong: #16171a; --hi: #ffe45c; --hi-soft: #fff4b8; --hi-ink: #16171a;
  --pencil: #c2312a; --graphite: #5a5d63;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.6), 0 10px 24px -12px rgb(0 0 0 / 0.9);
}

/* Refused record: the pencil goes through the whole field block, not one line. */
.refused .sheet dl { position: relative; color: var(--ink-2); }
.refused .sheet dl::after { content: none; }
@media (prefers-reduced-motion: no-preference) {
  html.js .refused.sweep .sheet dl::after { content: none; }
}
.section-note { margin-top: 1.5rem; max-width: 56ch; color: var(--ink-2); text-wrap: pretty; }
.howto-wrap { margin-top: 1rem; }
.i-sm { width: 0.85em; height: 0.85em; }
.sprite { position: absolute; }

/* ======================================================================
   Motion layer. One grammar: the checker's desk. Things get typed,
   highlighted, ticked and struck, once, as they come into view.
   ====================================================================== */

/* Hero entrance on load: copy rises in order, the sheet settles into place. */
@media (prefers-reduced-motion: no-preference) {
  .enter { opacity: 0; transform: translateY(14px); animation: rise 760ms var(--ease-out) forwards; animation-delay: calc(var(--d, 0) * 110ms + 60ms); }
  .enter-sheet { opacity: 0; transform: translateY(10px) scale(0.985); animation: settle 900ms var(--ease-out) forwards; animation-delay: 220ms; }
  @keyframes rise { to { opacity: 1; transform: none; } }
  @keyframes settle { to { opacity: 1; transform: none; } }
}

/* Typewriter: fields are typed in, the caret is a block of ink. */
[data-typewriter] .typing::after { content: ""; display: inline-block; width: 0.55em; height: 1em; background: var(--ink); vertical-align: -0.15em; margin-left: 1px; animation: caret 900ms steps(2, jump-none) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  html.js [data-typewriter] .evidence, html.js [data-typewriter] .sheet-foot { opacity: 0; transition: opacity 500ms var(--ease-out); }
  html.js [data-typewriter].typed .evidence, html.js [data-typewriter].typed .sheet-foot { opacity: 1; }
  /* The sweep is keyed to the end of typing, so it is seen. */
  html.js [data-typewriter] .hi { background-size: 0% 100%; transition: background-size var(--t-hi) var(--ease-out) 160ms; }
  html.js [data-typewriter].typed .hi { background-size: 100% 100%; }
  html.js [data-typewriter] .margin-note { opacity: 0; transform: translateX(-6px); transition: opacity 400ms var(--ease-out) 1300ms, transform 400ms var(--ease-out) 1300ms; }
  html.js [data-typewriter].typed .margin-note { opacity: 1; transform: none; }
}

/* Drawn check marks: stroke-dasharray is inherited, so the <use>d path draws itself. */
html.js svg.draw { stroke-dasharray: 26; stroke-dashoffset: 26; }
html.js .sweep.in-view svg.draw, html.js .typed svg.draw, html.js .is-sent svg.draw { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  html.js svg.draw { transition: stroke-dashoffset 480ms var(--ease-out); transition-delay: 160ms; }
  [data-typewriter] .margin-note svg.draw { transition-delay: 1500ms; }
}
@media (prefers-reduced-motion: reduce) { svg.draw { stroke-dashoffset: 0; } }
.margin-note svg.draw, .promise svg.draw, .ask-list svg.draw { width: 1.05rem; height: 1.05rem; stroke-width: 2.25; }
.checklist .box svg.draw { width: 1rem; height: 1rem; }

/* Staggered arrival for lists that appear as lists; capped at eight rows. */
.tier, .checklist li, .promise li, .price, .fields > div, .faq details, .ask-list li, .moves > div, .howto li { --i: 0; }
.tier:nth-child(2), .checklist li:nth-child(2), .promise li:nth-child(2), .price:nth-child(2), .fields > div:nth-child(2), .faq details:nth-child(2), .ask-list li:nth-child(2), .moves > div:nth-child(2), .howto li:nth-child(2) { --i: 1; }
.tier:nth-child(3), .checklist li:nth-child(3), .promise li:nth-child(3), .price:nth-child(3), .fields > div:nth-child(3), .faq details:nth-child(3), .ask-list li:nth-child(3), .moves > div:nth-child(3), .howto li:nth-child(3) { --i: 2; }
.tier:nth-child(4), .promise li:nth-child(4), .fields > div:nth-child(4), .faq details:nth-child(4) { --i: 3; }
.fields > div:nth-child(5), .faq details:nth-child(5) { --i: 4; }
.fields > div:nth-child(6), .faq details:nth-child(6) { --i: 5; }
.faq details:nth-child(n+7) { --i: 5; }
@media (prefers-reduced-motion: no-preference) {

  /* Headings come into focus rather than sliding. Blur is bounded to the heading box. */

}

/* Highlighter hover on primary buttons: ink fills from the left, like a pen stroke. */
.btn-primary {
  background-image: linear-gradient(var(--ink), var(--ink)); background-repeat: no-repeat; background-size: 0% 100%; background-position: left center;
  transition: background-size 320ms var(--ease-out), color 200ms var(--ease-out), transform var(--t-fast) var(--ease-out), border-color 200ms var(--ease-out);
}
.btn-primary:hover, .btn-primary:focus-visible { background-size: 100% 100%; color: var(--paper); border-color: var(--ink); }
.btn .i-done { display: none; }
.btn.is-sent .i-arrow { display: none; }
.btn.is-sent .i-done { display: block; }
.btn.is-sent { background-color: var(--ink); background-size: 100% 100%; color: var(--paper); border-color: var(--ink); }

/* Nav condenses once the page has scrolled. */
.nav .wrap { transition: height 260ms var(--ease-out); }
.nav .btn { transition: padding 260ms var(--ease-out), background-size 320ms var(--ease-out), color 200ms var(--ease-out), transform var(--t-fast) var(--ease-out), border-color 200ms var(--ease-out); }
.nav.scrolled .wrap { height: 54px; }
.nav.scrolled .btn { padding: 0.55rem 0.85rem; }
.nav-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 12px; pointer-events: none; }

/* FAQ answers unfold. */
@media (prefers-reduced-motion: no-preference) {
  .faq details[open] .answer { animation: unfold 300ms var(--ease-out); }
  @keyframes unfold { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}

/* Form acknowledgment. */
.form-status.show { animation: unfold 320ms var(--ease-out); }
.field.invalid input, .field.invalid textarea { box-shadow: 0 0 0 3px var(--pencil-soft); }
.field .error { transition: opacity 200ms var(--ease-out); }

/* Ask section. */
.ask-list { margin-top: 1.5rem; display: grid; gap: 0.75rem; }
.ask-list li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.6rem; color: var(--ink-2); align-items: start; }
.ask-list svg { margin-top: 0.25rem; color: var(--ink); }
.ask .form { border-top: none; padding-top: 0; }
@media (max-width: 899px) { .ask .form { border-top: 1px solid var(--rule-strong); padding-top: 1.5rem; } }
.hero h1.enter { --d: 0; } .hero .lede.enter { --d: 1; } .hero-actions.enter { --d: 2; } .hero-note.enter { --d: 3; }

/* Typewriter: the real text stays in the accessibility tree; typing happens in an aria-hidden twin. */
[data-typewriter] .dd-src.visually-hidden { position: absolute; }

/* ---------- Pass 3: comparison, refused mirror, nav state, hierarchy, mobile ledger ---------- */
.compare { margin-top: clamp(2.5rem, 5vw, 4rem); display: grid; gap: 2rem; position: relative; }
@media (min-width: 900px) { .compare { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.compare-item { margin: 0; }
.compare-label { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-2); margin-bottom: 0.75rem; }
.sheet.sheet-sm { padding: 1rem 1.1rem; font-size: 0.875rem; }
.sheet.sheet-sm dl { margin-top: 0; row-gap: 0.45rem; }
.sheet dd.blank { border-bottom: 1px dashed var(--pencil); min-height: 1.2em; }
.compare .margin-note { margin-top: 0.85rem; }
.compare-note { position: absolute; right: 0; top: -1.6rem; margin: 0; }
.refused-grid { align-items: start; }
.howto-col h3 { font-size: 1.3125rem; }

/* Nav button: outline while the hero's own button is on screen, highlighter once it has scrolled away. */
.btn-nav { background: transparent; color: var(--ink); border-color: var(--ink); background-image: linear-gradient(var(--hi), var(--hi)); background-repeat: no-repeat; background-size: 0% 100%; background-position: left center; transition: background-size 320ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out), padding 260ms var(--ease-out), transform var(--t-fast) var(--ease-out); }
.btn-nav:hover, .btn-nav:focus-visible { background-size: 100% 100%; color: var(--hi-ink); border-color: var(--hi); }
.nav.past-hero .btn-nav { background-size: 100% 100%; color: var(--hi-ink); border-color: var(--hi); }
.nav.past-hero .btn-nav:hover, .nav.past-hero .btn-nav:focus-visible { background-image: linear-gradient(var(--ink), var(--ink)); color: var(--paper); border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .btn-nav { background-size: 100% 100%; color: var(--hi-ink); border-color: var(--hi); } }

/* Row hierarchy: a clearer step between a row's title and its body. */
.tier h3, .price h3, .moves h3 { font-size: 1.3125rem; }
.promise li b, .howto li b { font-size: 1.0625rem; }

/* Mobile ledger: the tier letter sits above its text instead of eating a column. */
@media (max-width: 599px) {
  .tier { grid-template-columns: 1fr; gap: 0.5rem; }
  .tier-letter { font-size: 1.75rem; justify-self: start; }
  .tier .example { grid-column: 1; }
  .sheet-head { font-size: 0.75rem; }
}
.copy-btn { margin-top: 0.75rem; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; border: 1px solid var(--ink); border-radius: 2px; background: transparent; color: var(--ink); font-size: 0.9375rem; font-weight: 500; }
.copy-btn:hover { background: var(--paper-2); }
.copy-btn .i { width: 1em; height: 1em; }

/* ======================================================================
   Pass 4: the pencil. Cross-outs draw as strokes, stamps land, blanks
   are ruled in, underlines are drawn. Same grammar, same one-shot rule.
   ====================================================================== */

/* Drawn X: two strokes, the second after the first. */
html.js svg.draw-x { stroke-dasharray: 100; stroke-dashoffset: 100; }
html.js .sweep.in-view svg.draw-x, html.js .typed svg.draw-x { stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  html.js svg.draw-x { transition: stroke-dashoffset 560ms cubic-bezier(0.3, 0, 0.2, 1); transition-delay: 160ms; }
}
@media (prefers-reduced-motion: reduce) { svg.draw-x { stroke-dashoffset: 0; } }
.margin-note svg.draw-x, .promise svg.draw-x { width: 1.05rem; height: 1.05rem; }
.tier-letter svg.draw-x { width: 0.85em; height: 0.85em; }

/* Pencil line through the refused record: a slight curve, drawn left to right, then the stamp lands. */
.refused .sheet .struck { position: relative; }
.pencil-strike { position: absolute; left: -0.6rem; right: -0.6rem; top: 0; height: 100%; width: calc(100% + 1.2rem); color: var(--pencil); pointer-events: none; opacity: 0.92; }
.pencil-strike line { stroke-dasharray: none; }
@media (prefers-reduced-motion: no-preference) {
  html.js .pencil-strike path { transition: stroke-dashoffset 560ms cubic-bezier(0.3, 0, 0.2, 1) 180ms; }
  /* The stamp: lands after the line, from slightly large to true size. */
  html.js .sweep .tag-kill, html.js .sweep .tag-stamp { opacity: 0; }
  html.js .sweep.in-view .tag-kill, html.js .sweep.in-view .tag-stamp { animation: stamp 460ms cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 760ms; }
  html.js .example.sweep.in-view .tag-kill { animation-delay: 950ms; }
  html.js .compare-item.sweep.in-view .tag-stamp { animation-delay: 700ms; }
  @keyframes stamp {
    0%   { opacity: 0; transform: scale(1.7) rotate(-9deg); }
    45%  { opacity: 1; transform: scale(0.94) rotate(-3deg); }
    70%  { transform: scale(1.04) rotate(-3deg); }
    100% { opacity: 1; transform: scale(1) rotate(-3deg); }
  }
  /* Inline kill: a pencil stroke with a soft end, not a laser. */
  .kill::after { border-radius: 1px; height: 2.2px; }
}
@media (prefers-reduced-motion: reduce) { .pencil-strike path { stroke-dashoffset: 0 !important; } .tag-kill, .tag-stamp { opacity: 1; animation: none; } }

/* Blank fields in the cheap row: the dashed rule is drawn in, then reads as missing. */
.sheet dd.blank { border-bottom: none; background-image: repeating-linear-gradient(90deg, var(--pencil) 0 4px, transparent 4px 8px); background-repeat: no-repeat; background-position: left bottom; background-size: 100% 1px; }
@media (prefers-reduced-motion: no-preference) {
  html.js .sweep dd.blank { background-size: 0% 1px; transition: background-size 640ms var(--ease-out) 320ms; }
  html.js .sweep.in-view dd.blank { background-size: 100% 1px; }
}

/* Checklist boxes press as their tick lands. */
@media (prefers-reduced-motion: no-preference) {
  html.js .checklist li.sweep .box { transform: scale(0.9); transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1.15); transition-delay: 120ms; }
  html.js .checklist li.sweep.in-view .box { transform: none; }
}

/* Source marks appear once the highlight has landed. */
@media (prefers-reduced-motion: no-preference) {
  html.js [data-typewriter] .src, html.js [data-typewriter] .cite { opacity: 0; transition: opacity 400ms var(--ease-out); }
  html.js [data-typewriter].typed .src { opacity: 1; transition-delay: 1500ms; }
  html.js [data-typewriter].typed .cite { opacity: 1; transition-delay: 1650ms; }
}
@media (prefers-reduced-motion: reduce) { [data-typewriter] .src, [data-typewriter] .cite { opacity: 1; } }

/* Nav links: the underline is drawn from the left. */
.nav-links a { border-bottom: none; background-image: linear-gradient(var(--ink), var(--ink)); background-repeat: no-repeat; background-size: 0% 1px; background-position: left calc(100% - 0.1em); transition: background-size 260ms var(--ease-out), color var(--t-fast) var(--ease-out); }
.nav-links a:hover, .nav-links a:focus-visible { background-size: 100% 1px; }

/* Form: the label wakes when its field has focus; the caret in the FAQ nudges on hover. */
.field label { color: var(--ink-2); transition: color var(--t-fast) var(--ease-out); }
.field:focus-within label { color: var(--ink); }
.faq summary:hover .i { transform: translateY(2px); }
.faq details[open] summary:hover .i { transform: rotate(180deg) translateY(2px); }

/* Stamps sit slightly askew once they have landed, like ink from a hand stamp. */
.tag-kill, .tag-stamp { display: inline-block; transform: rotate(-3deg); transform-origin: center; }
@media (prefers-reduced-motion: reduce) { .tag-kill, .tag-stamp { transform: rotate(-3deg); } }

/* Tick spark: a small white four-point spark flashes at the check as the stroke lands.
   On the light page it carries a hairline of ink and a soft highlighter glow so it still reads. */
.tick { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.tick::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.1em; height: 1.1em; margin: -0.55em 0 0 -0.55em;
  background: #fff; opacity: 0; transform: scale(0.2) rotate(0deg); pointer-events: none; z-index: 2;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  filter: drop-shadow(0 0 1px rgb(22 23 26 / 0.85)) drop-shadow(0 0 5px var(--hi));
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tick::after { filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.7)); } }
:root[data-theme="dark"] .tick::after { filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.7)); }
@media (prefers-reduced-motion: no-preference) {
  html.js .sweep.in-view .tick::after, html.js .row-anim.in-view .tick::after { animation: spark 520ms cubic-bezier(0.2, 0.7, 0.3, 1) 500ms both; }
  html.js [data-typewriter].typed .tick::after { animation: spark 520ms cubic-bezier(0.2, 0.7, 0.3, 1) 1850ms both; }
  html.js .btn.is-sent .tick::after { animation: spark 520ms cubic-bezier(0.2, 0.7, 0.3, 1) 100ms both; }
  @keyframes spark {
    0%   { opacity: 0; transform: scale(0.2) rotate(0deg); }
    25%  { opacity: 1; transform: scale(1) rotate(20deg); }
    100% { opacity: 0; transform: scale(1.35) rotate(60deg); }
  }
}
.checklist .box .tick { width: 100%; height: 100%; }
.checklist .box .tick::after { margin-left: -0.15em; margin-top: -0.9em; }
