/* Miscited — public page.

   Art direction: quiet instrument on paper. Calm warm-neutral ground, near-black ink,
   generous air, and one geometric voice for prose against a mono voice for data. Colour
   is rationed: the page is essentially monochrome, and the only saturated marks on it are
   verdicts. Red is a wrong answer, green is a proven correction, blue is a citation, clay
   is the instrument's own channel marking. Nothing is coloured for decoration, because a
   page selling measurement should not be the first thing on screen that overstates. */

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

:root {
  /* ---------------------------------------------------------------- colour */
  /* Warm neutrals carry the whole page; the ground is paper, never pure white. */
  --color-bg:        #f7f6f3;
  --color-bg-2:      #f1efeb;
  --color-surface:   #ffffff;
  --color-surface-2: #eceae7;
  --color-line:      #ddd9d3;
  --color-line-soft: #e7e4df;

  --color-text:      #212121;
  --color-ink-soft:  #424242;
  --color-muted:     #63605b;   /* warm secondary grey, 6.2:1 on paper */
  --color-faint:     #726c64;   /* smallest labels still clear AA at 4.8:1 */

  --color-accent:    #9c6f4a;   /* clay: channel rules and small instrument marks only */
  --color-action:    #222222;   /* the primary action is ink, as on the reference */
  --color-focus:     #1a56c4;

  --color-success:   #2f6b4d;   /* corrected, and proven corrected */
  --color-warning:   #9a6b1f;
  --color-danger:    #b8452f;   /* a wrong answer, always */
  --color-cite:      #3c6389;   /* a source, always */

  --tint-accent:  rgba(156, 111, 74, 0.09);
  --tint-danger:  rgba(184, 69, 47, 0.10);
  --tint-success: rgba(47, 107, 77, 0.09);
  --tint-cite:    rgba(60, 99, 137, 0.09);

  /* ------------------------------------------------------------ typography */
  /* One geometric humanist voice for prose, one mono voice for every measurement. */
  --font-display: "Plus Jakarta Sans", "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
  --font-body:    "Plus Jakarta Sans", "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --text-xs:   0.6875rem;  --leading-xs:   1.45;
  --text-sm:   0.875rem;   --leading-sm:   1.62;
  --text-base: 1rem;       --leading-base: 1.66;
  --text-lg:   1.125rem;   --leading-lg:   1.62;
  --text-xl:   1.5rem;     --leading-xl:   1.3;
  --text-2xl:  clamp(1.75rem, 3vw, 2.5rem);     --leading-2xl: 1.14;
  --text-3xl:  clamp(2.25rem, 4.8vw, 3.5rem);   --leading-3xl: 1.05;

  --track-label: 0.14em;
  --track-tight: -0.035em;   /* geometric faces want tighter display tracking */

  /* --------------------------------------------------------------- spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  --measure: 60ch;
  --shell: 1180px;
  --gutter: clamp(20px, 5vw, 56px);

  /* ----------------------------------------------------- radius and shadow */
  /* Softer geometry than the console, matching the reference's product cards. */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  /* Shadows are warm and low-contrast; a black shadow on warm paper reads as grime. */
  --shadow-sm: 0 1px 2px rgba(60, 50, 40, 0.05);
  --shadow-md: 0 10px 30px -18px rgba(60, 50, 40, 0.28);
  --shadow-lg: 0 30px 70px -34px rgba(60, 50, 40, 0.36);
  --ring-action: 0 0 0 3px rgba(34, 34, 34, 0.14);

  /* ---------------------------------------------------------------- motion */
  --duration-fast: 120ms;
  --duration-base: 260ms;
  --duration-slow: 620ms;
  --ease-out: cubic-bezier(0.22, 0.68, 0.32, 1);
  --ease-spring: cubic-bezier(0.16, 1.04, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  background: var(--color-bg);
  color: var(--color-text);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* A hairline measuring grid, faded almost to nothing. On paper this reads as the ruled
   ground of a plotter sheet rather than as decoration, so it stays extremely faint. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(33, 33, 33, 0.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(33, 33, 33, 0.028) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 92% 55% at 50% 0%, #000 0%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse 92% 55% at 50% 0%, #000 0%, transparent 74%);
}

/* Paper tooth. Far lighter than a dark theme would carry: on a light ground, grain past
   about 4% stops reading as texture and starts reading as a dirty screen. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection { background: rgba(156, 111, 74, 0.20); color: var(--color-text); }

/* Anchor targets clear the sticky topbar instead of landing behind it. */
section[id] { scroll-margin-top: 84px; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-action);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-4);
  font: 600 var(--text-sm)/1 var(--font-body);
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip:focus { left: var(--space-4); top: var(--space-4); }

/* ==================================================================== atoms */

/* Section eyebrow: an instrument channel label, in the mono voice. */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.label::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--color-accent);
  flex: 0 0 auto;
}
.label.is-danger::before  { background: var(--color-danger); }
.label.is-success::before { background: var(--color-success); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  text-wrap: balance;
  color: var(--color-text);
}
h1 { font-size: var(--text-3xl); line-height: var(--leading-3xl); }
h2 { font-size: var(--text-2xl); line-height: var(--leading-2xl); }
h3 { font-size: var(--text-lg); line-height: 1.4; font-weight: 600; letter-spacing: -0.02em; }

p { max-width: var(--measure); color: var(--color-ink-soft); }
.lede { font-size: var(--text-lg); line-height: 1.62; color: var(--color-muted); }
.note { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--color-muted); }

.mono { font-family: var(--font-mono); }

/* The measurement chip — the page's shared data language. A number never appears
   without the interval and the sample size that produced it. */
.measure {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
}
.measure .val {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.measure .ci, .measure .n { color: var(--color-muted); }
.measure.is-danger  .val { color: var(--color-danger); }
.measure.is-success .val { color: var(--color-success); }

/* Verdict stamp. */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid currentColor;
}
.stamp.is-danger  { color: var(--color-danger);  background: var(--tint-danger); }
.stamp.is-success { color: var(--color-success); background: var(--tint-success); }
.stamp.is-cite    { color: var(--color-cite);    background: var(--tint-cite); }
.stamp.is-muted   { color: var(--color-muted);   background: rgba(33, 33, 33, 0.03); border-color: var(--color-line); }

/* ================================================================= controls */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--color-text);
  --btn-bd: var(--color-line);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 1px solid var(--btn-bd);
  border-radius: 999px;   /* the reference's pill actions */
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --btn-bg: var(--color-action);
  --btn-fg: #fbfaf8;
  --btn-bd: var(--color-action);
}
.btn-primary:hover { box-shadow: var(--ring-action); }

.btn-ghost {
  --btn-bg: var(--color-surface);
  --btn-bd: var(--color-line);
}
.btn-ghost:hover { --btn-bd: var(--color-muted); }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading: the label is swapped for a scanning bar, matching the sampling metaphor. */
.btn[data-state="loading"] { color: transparent; pointer-events: none; }
.btn[data-state="loading"]::after {
  content: "";
  position: absolute;
  inset: auto var(--space-6) 14px;
  height: 2px;
  border-radius: 2px;
  background: #fbfaf8;
  opacity: 0.7;
  animation: scan 900ms var(--ease-out) infinite;
}
@keyframes scan {
  0%   { transform: scaleX(0); transform-origin: left; }
  50%  { transform: scaleX(1); transform-origin: left; }
  51%  { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

/* ================================================================== topbar */

.lp-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 68px;
  padding-inline: var(--gutter);
  background: rgba(247, 246, 243, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--color-line-soft);
}
.lp-brand { display: flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; }
.lp-brand .mark { color: var(--color-accent); font-size: 18px; line-height: 1; }
.lp-brand .word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.04em;
}
.lp-nav-links { display: flex; gap: var(--space-6); margin-left: auto; }
.lp-nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  padding: var(--space-2) 0;
  border-bottom: 1px solid transparent;
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.lp-nav-links a:hover { color: var(--color-text); border-bottom-color: var(--color-accent); }
.lp-nav .btn { min-height: 38px; padding-inline: var(--space-4); }

/* =================================================================== hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(64px, 10vw, 120px) clamp(56px, 8vw, 96px);
  border-bottom: 1px solid var(--color-line-soft);
}
.hero-copy > * + * { margin-top: var(--space-6); }
.hero h1 { max-width: 17ch; }
/* The accent phrase is underscored by a rule that reads as a measurement bracket.
   A pseudo-element bar would run straight through the descenders; a real underline with
   skip-ink breaks cleanly around them instead. */
.hero h1 em {
  font-style: normal;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: rgba(156, 111, 74, 0.55);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.12em;
  text-decoration-skip-ink: auto;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-line);
}
.hero-proof div { display: flex; flex-direction: column; gap: 3px; }
.hero-proof dt {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-faint);
}
.hero-proof dd { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-ink-soft); }

/* ================================================ signature: the Exhibit */

.exhibit {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.exhibit-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-line-soft);
  background: var(--color-bg-2);
}
.exhibit-head .who {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.exhibit-head .spacer { flex: 1; }

.replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.replay:hover { color: var(--color-text); border-color: var(--color-muted); }
.replay[disabled] { opacity: 0.4; cursor: not-allowed; }

.exhibit-body { padding: var(--space-6) var(--space-6) var(--space-4); }

.answer {
  font-size: var(--text-base);
  line-height: 1.74;
  color: var(--color-text);
  max-width: none;
  min-height: 7.5em;
}
.answer .cursor {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  translate: 0 0.16em;
  background: var(--color-accent);
  animation: blink 1s steps(2, start) infinite;
}
.exhibit[data-phase="done"] .cursor,
.exhibit[data-phase="idle"] .cursor { display: none; }
@keyframes blink { to { visibility: hidden; } }

/* The false sentence. The flag fills left-to-right, like a marker being drawn. */
.claim {
  position: relative;
  padding: 1px 2px;
  border-radius: 2px;
  transition: background var(--duration-base) var(--ease-out);
}
.claim::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--color-danger);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-slow) var(--ease-out);
}
.exhibit[data-phase="flagged"] .claim::after,
.exhibit[data-phase="sources"] .claim::after,
.exhibit[data-phase="truth"] .claim::after,
.exhibit[data-phase="done"] .claim::after { transform: scaleX(1); }
.exhibit[data-phase="truth"] .claim,
.exhibit[data-phase="done"] .claim { background: var(--tint-danger); }

/* Reveal rail — each stage of the exhibit slides up as it becomes relevant. */
.stage {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
  pointer-events: none;
}
.stage[data-shown="true"] { opacity: 1; transform: none; pointer-events: auto; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-line);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-faint);
}
.meta-row b { color: var(--color-muted); font-weight: 500; }

.sources { margin-top: var(--space-4); }
.sources caption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-faint);
  text-align: left;
  padding-bottom: var(--space-2);
}
.sources table { width: 100%; border-collapse: collapse; }
.sources td {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-line-soft);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  vertical-align: middle;
}
.sources td:first-child { overflow-wrap: anywhere; padding-right: var(--space-3); }
.sources td:last-child { text-align: right; white-space: nowrap; }
.sources tr:last-child td { border-bottom: 0; }

.truth-card {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--tint-success);
  border: 1px solid rgba(47, 107, 77, 0.24);
  border-radius: var(--radius-md);
}
.truth-card .t-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.truth-card .t-head span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-success);
}
.truth-card p { font-size: var(--text-sm); color: var(--color-text); max-width: none; }
.truth-card .t-dates {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.exhibit-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  border-top: 1px solid var(--color-line-soft);
  background: var(--color-bg-2);
}
.exhibit-foot .spacer { flex: 1; }

/* ================================================================ sections */

.section {
  padding-block: clamp(64px, 9vw, 120px);
  border-bottom: 1px solid var(--color-line-soft);
}
.section-head { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-16); }
.section-head h2 { max-width: 19ch; }

/* --- anatomy: the deliberate grid break. The truth panel crosses the column rule. */
.anatomy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.anatomy-visual { position: relative; }
.anatomy-visual .plate {
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.anatomy-visual .plate p {
  font-size: var(--text-base);
  line-height: 1.78;
  color: var(--color-muted);
  max-width: none;
}
.anatomy-visual .plate .bad {
  color: var(--color-text);
  background: var(--tint-danger);
  box-shadow: inset 0 -2px 0 var(--color-danger);
  padding: 1px 2px;
}
.anatomy-visual .overlay {
  position: relative;
  margin: calc(var(--space-6) * -1) 0 0 clamp(0px, 4vw, 56px);
  padding: var(--space-4) var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-success);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.anatomy-visual .overlay .t-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-success);
  display: block;
  margin-bottom: var(--space-2);
}
.anatomy-visual .overlay p { font-size: var(--text-sm); color: var(--color-text); max-width: none; }

.beats { display: grid; gap: var(--space-8); }
.beat { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-4); }
.beat .idx {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
  padding-top: 4px;
}
.beat h3 { margin-bottom: var(--space-2); }
.beat p { color: var(--color-muted); font-size: var(--text-sm); }

/* --- the loop: an instrument strip, connected by a single rule */
.loop {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  position: relative;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}
.loop-step {
  padding: var(--space-8) var(--space-4);
  border-right: 1px solid var(--color-line-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: background var(--duration-base) var(--ease-out);
}
.loop-step:last-child { border-right: 0; }
.loop-step:hover { background: var(--color-bg-2); }
.loop-step .n {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  color: var(--color-accent);
}
.loop-step h3 { font-size: var(--text-base); }
.loop-step p { font-size: var(--text-sm); color: var(--color-muted); max-width: none; }
.loop-step .where {
  margin-top: auto;
  padding-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-faint);
  border-top: 1px dashed var(--color-line);
}

/* --- refusal ledger: the trust argument, as a signed register */
.ledger { border-top: 1px solid var(--color-line); }
.ledger-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--space-6);
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--color-line);
  align-items: start;
}
.ledger-row .x {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  line-height: 1;
  color: var(--color-danger);
  padding-top: 2px;
}
.ledger-row h3 { font-size: var(--text-base); }
.ledger-row .why { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--color-muted); max-width: none; }
.ledger-row .proof {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.8;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-line-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  word-break: break-word;
  max-width: none;
}
.ledger-row .proof b { color: var(--color-success); font-weight: 600; }

/* --- measurement design: a spec sheet */
.spec { width: 100%; border-collapse: collapse; }
.spec caption { text-align: left; padding-bottom: var(--space-4); }
.spec th, .spec td {
  text-align: left;
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}
.spec th {
  width: 32%;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 400;
}
.spec td { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-text); }

/* --- plans */
.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}
.plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6);
  border-right: 1px solid var(--color-line-soft);
}
.plan:last-child { border-right: 0; }
.plan.is-lead { background: var(--color-bg-2); }
.plan .pname {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-accent);
}
.plan .price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: var(--track-tight);
}
.plan .price small {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-weight: 400;
  letter-spacing: 0;
}
.plan p { font-size: var(--text-sm); color: var(--color-muted); max-width: none; }
.plan .btn { margin-top: auto; }

/* --- conversion block */
.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(64px, 9vw, 112px);
}
.cta h2 { max-width: 16ch; }
.cta .lede { margin-top: var(--space-4); }
.cta ul { list-style: none; margin-top: var(--space-8); display: grid; gap: var(--space-4); }
.cta li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.cta li::before { content: "→"; color: var(--color-accent); font-family: var(--font-mono); }

.audit-form {
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.audit-form h3 { margin-bottom: var(--space-2); }
.field { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-6); }
.field label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--color-muted);
}
.field input {
  min-height: 50px;
  padding: 0 var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.field input::placeholder { color: var(--color-faint); }
.field input:hover { border-color: var(--color-muted); }
.field input:focus {
  outline: none;
  background: var(--color-surface);
  border-color: var(--color-action);
  box-shadow: var(--ring-action);
}
.field input[aria-invalid="true"] { border-color: var(--color-danger); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(184, 69, 47, 0.16); }
.field .err {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-danger);
  min-height: 1em;
}
.audit-form .btn { width: 100%; margin-top: var(--space-6); }
.audit-form .fineprint { margin-top: var(--space-4); font-size: var(--text-xs); color: var(--color-muted); line-height: 1.65; }

/* Form outcome states — success and failure are both designed, never a browser default. */
.outcome {
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: none;
}
.outcome[data-kind="ok"] {
  display: block;
  background: var(--tint-success);
  border: 1px solid rgba(47, 107, 77, 0.28);
  color: var(--color-text);
}
.outcome[data-kind="error"] {
  display: block;
  background: var(--tint-danger);
  border: 1px solid rgba(184, 69, 47, 0.28);
  color: var(--color-text);
}
.outcome .retry {
  margin-top: var(--space-2);
  background: none;
  border: 0;
  padding: 0;
  font: 600 var(--text-sm)/1.4 var(--font-body);
  color: var(--color-text);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ================================================================= footer */

.lp-footer {
  padding-block: var(--space-16);
  color: var(--color-muted);
  font-size: var(--text-sm);
}
.lp-footer .rows { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: baseline; }
.lp-footer .rows .spacer { flex: 1; }
.lp-footer a { color: var(--color-ink-soft); border-bottom: 1px solid var(--color-line); }
.lp-footer a:hover { color: var(--color-text); border-bottom-color: var(--color-accent); }
.lp-footer .creed {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-line);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.85;
  color: var(--color-faint);
  max-width: 78ch;
}

/* ============================================================= responsive */

@media (max-width: 1040px) {
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan:nth-child(2) { border-right: 0; }
  .plan:nth-child(1), .plan:nth-child(2) { border-bottom: 1px solid var(--color-line-soft); }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop-step { border-bottom: 1px solid var(--color-line-soft); }
  .loop-step:nth-child(2n) { border-right: 0; }
  .loop-step:last-child { grid-column: 1 / -1; border-bottom: 0; }
}

@media (max-width: 900px) {
  .hero, .anatomy, .cta { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: 18ch; }
  .anatomy-visual .overlay { margin-left: var(--space-6); }
  .ledger-row { grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-4); }
  .ledger-row .proof { grid-column: 2; }
  /* The section links collapse below this width; the sign-in button inherits the push
     they were providing, so it stays anchored to the right edge. */
  .lp-nav-links { display: none; }
  .lp-nav > .btn { margin-left: auto; }
  .section-head { margin-bottom: var(--space-12); }
}

@media (max-width: 620px) {
  .loop { grid-template-columns: minmax(0, 1fr); }
  .loop-step { border-right: 0; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { border-right: 0; border-bottom: 1px solid var(--color-line-soft); }
  .plan:last-child { border-bottom: 0; }
  .spec th { width: auto; display: block; padding-bottom: 0; border-bottom: 0; }
  .spec td { display: block; padding-top: var(--space-1); }
  .hero-actions .btn { width: 100%; }
  .exhibit-body, .audit-form, .anatomy-visual .plate { padding: var(--space-6) var(--space-4); }
  .exhibit-foot { padding-inline: var(--space-4); }
}

/* Touch targets stay at 44px+ on coarse pointers. */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .replay { min-height: 44px; }
  .lp-nav-links a { padding-block: var(--space-3); }
}

/* ==================================================== reduced motion path */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .stage { opacity: 1; transform: none; pointer-events: auto; }
  .claim::after { transform: scaleX(1); }
  .answer .cursor { display: none; }
}

/* The stand-in notice on the audit form. Sits inside the form, above the fields, because a
   caveat placed after the submit button is a caveat read after the request. */
.audit-form .note.rehearsal {
  border-left: 3px solid var(--color-accent);
  background: var(--tint-accent);
  padding: 10px 12px;
  margin: 12px 0 4px;
  border-radius: 3px;
  color: var(--color-ink-soft);
}
