/* Reckon base + shared components. Requires tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--t-body) / 1.55 var(--font);
  font-optical-sizing: auto;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 700; }
p { text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--ink); color: var(--ground); padding: 0.75rem 1rem; border-radius: 8px; font-weight: 650; text-decoration: none; }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter) max(20px, env(safe-area-inset-right, 0px)); }

/* Figures: the main face, tabular, slightly condensed and tight when big. */
.fig { font-variant-numeric: tabular-nums lining-nums; font-stretch: 88%; letter-spacing: -0.035em; font-weight: 650; line-height: 0.95; }
.fig-sm { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Header */
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 750; font-size: 1.5rem; letter-spacing: -0.02em; text-decoration: none; }
.brand svg { width: 40px; height: 40px; }
.site-nav { display: flex; gap: 1.4rem; font-size: var(--t-small); }
.site-nav a { text-decoration: none; color: var(--ink-2); min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { color: var(--ink); }
@media (max-width: 640px) { .site-nav .opt { display: none; } }

/* Paste box */
.paste { display: grid; gap: 0.6rem; max-width: 40rem; }
.paste-row { display: flex; gap: 0; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; padding: 6px; transition: border-color .2s; }
.paste-row:focus-within { border-color: var(--signal); outline: 3px solid var(--signal); outline-offset: 2px; }
.paste input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.05rem; padding: 0.75rem 0.8rem; }
.paste input:focus-visible { outline: none; }
.paste input::placeholder { color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.25rem; border-radius: 10px; border: 0; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; transition: transform .1s ease-out, background-color .2s; }
.btn:active { transform: scale(0.97); }
.btn-signal, .btn-primary { background: var(--signal); color: var(--on-signal); }
.btn-signal:hover, .btn-primary:hover { background: color-mix(in oklch, var(--signal), var(--ink) 10%); }
.paste-note { font-size: var(--t-small); color: var(--ink-2); min-height: 1.4em; }
.paste-note[data-state='ok'] { color: var(--ink); }
.paste-note[data-state='bad'] { color: var(--signal-text); }
@media (max-width: 480px) {
  .paste-row { flex-direction: column; gap: 6px; }
  .paste-row .btn { width: 100%; }
}

/* Section rhythm */
.section { padding-block: clamp(4.5rem, 3rem + 7vw, 9rem); }
.section-head { display: grid; gap: 1rem; max-width: 46rem; }
.section-head h2 { font-size: var(--t-h2); line-height: 1.02; letter-spacing: -0.03em; font-stretch: 94%; }
.section-head p { font-size: var(--t-lead); color: var(--ink-2); max-width: var(--measure); }
.example-note { font-size: var(--t-small); color: var(--ink-2); }

/* Footer */
.site-foot { border-top: 1px solid var(--rule); padding-block: 2.5rem 3rem; font-size: var(--t-small); color: var(--ink-2); display: grid; gap: 0.8rem; }
.site-foot p { max-width: 62rem; }

/* The thread: one measured line down the page (dimension line with end ticks). */
.thread { position: relative; }
.thread::before { content: ''; position: absolute; left: calc(var(--gutter) - 12px); top: 0; bottom: 0; width: 1.5px; background: var(--rule); }
@media (max-width: 720px) { .thread::before { display: none; } }

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

/* Evidence chart (render.js evidenceChart). */
.rk-ev-svg { width: 100%; height: auto; overflow: visible; display: block; }
.rk-ev-svg .row-rule { stroke: var(--rule-soft); stroke-width: 1; }
.rk-ev-svg .stem { stroke: var(--rule); stroke-width: 1.5; }
.rk-ev-svg .axis { stroke: var(--ink); stroke-width: 1.5; }
.rk-ev-svg .t-axis { font: 500 calc(var(--fs) * 0.9) var(--font); fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.rk-ev-svg .t-when { font: 650 var(--fs) var(--font); fill: var(--ink); font-variant-numeric: tabular-nums; }
.rk-ev-svg .t-type { font: 400 calc(var(--fs) * 0.88) var(--font); fill: var(--ink-2); }
.rk-ev-svg .t-price { font: 650 var(--fs) var(--font); fill: var(--ink); font-variant-numeric: tabular-nums; }
.rk-ev-svg .t-tag { font: 500 calc(var(--fs) * 0.88) var(--font); fill: var(--ink-2); }
.rk-ev-svg .row circle { fill: var(--ink); stroke: var(--ground); stroke-width: 3; }
.rk-ev-svg .row.is-kept circle { fill: var(--signal); }
.rk-ev-svg .row.is-kept .t-tag { fill: var(--signal-text); font-weight: 700; }
.rk-ev-svg .row.is-kept .stem { stroke: var(--signal); }
.rk-ev-svg .row.is-dropped circle { fill: var(--ground); stroke: var(--dropped); stroke-width: 2; }
.rk-ev-svg .row.is-dropped .t-price { fill: var(--dropped); text-decoration: line-through; }
.rk-ev-svg .band { fill: var(--signal-wash); }
.rk-ev-svg .band-edge { stroke: var(--signal); stroke-width: 1; stroke-dasharray: 2 4; }
.rk-ev-svg .band-bar { fill: var(--signal); }
.rk-ev-svg .ml { stroke: var(--signal); stroke-width: 3; }
.rk-ev-svg .ask { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 6 5; }
.rk-ev-svg .t-ask { font: 650 calc(var(--fs) * 0.95) var(--font); fill: var(--ink); font-variant-numeric: tabular-nums; }

/* Confidence gauge (render.js confidenceGauge). */
.rk-gauge { display: grid; gap: 0.4rem; }
.rk-gauge-track { height: 10px; background: var(--rule-soft); border-radius: 5px; overflow: hidden; }
.rk-gauge-fill { display: block; height: 100%; width: var(--v); background: var(--ink); border-radius: 5px; }
.rk-gauge-scale { display: flex; justify-content: space-between; font-size: var(--t-small); color: var(--ink-2); }
.rk-mark { width: 30px; height: 30px; }

/* Hero ruler (render.js rangeRuler). */
.rk-ruler { margin: 0; display: grid; gap: 1.1rem; }
.rk-ruler-line { position: relative; height: 3.4rem; margin-top: 2.6rem; border-bottom: 2px solid var(--ink); }
.rk-ruler-tick { position: absolute; bottom: -2px; width: 0; height: 12px; border-left: 1.5px solid var(--ink); }
.rk-ruler-tick > span { position: absolute; top: 16px; left: 0; transform: translateX(-50%); font-size: var(--t-small); color: var(--ink-2); white-space: nowrap; }
.rk-ruler-band { position: absolute; bottom: -7px; left: var(--lo); width: calc(var(--hi) - var(--lo)); height: 12px; background: var(--signal); border-radius: 6px; transform-origin: var(--ml-in-band) 50%; }
.rk-ruler-ml { position: absolute; bottom: -14px; left: var(--ml); width: 4px; height: 26px; margin-left: -2px; background: var(--ink); border-radius: 2px; }
.rk-ruler-ask { position: absolute; bottom: 0; left: var(--ask); height: 3.4rem; border-left: 2px dashed var(--ink-2); }
.rk-ruler-ask > span { position: absolute; top: -1.9rem; left: 0; transform: translateX(-50%); font-size: var(--t-small); font-weight: 650; white-space: nowrap; color: var(--ink); }
.rk-ruler-read { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; margin-top: 1.4rem; }
.rk-ruler-fig { font-size: clamp(2.6rem, 1.8rem + 3vw, 4.4rem); font-weight: 680; font-stretch: 88%; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.rk-ruler-say { color: var(--ink-2); max-width: 34rem; }
@media (max-width: 560px) { .rk-ruler-tick:nth-child(even) > span { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .rk-ruler-band { animation: rk-band-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both; }
  .rk-ruler-ml { animation: rk-fade-in 0.4s ease-out 0.9s both; }
}
@keyframes rk-band-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rk-fade-in { from { opacity: 0; } to { opacity: 1; } }
