@font-face {
  font-family: 'Source Serif 4';
  src: url(/fonts/source-serif-4.woff2) format('woff2');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url(/fonts/archivo.woff2) format('woff2');
  font-weight: 700 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #f5f5f1;
  --ink: #1a1a1a;
  --muted: #55554f;
  --faint: #d6d6cf;
  --genuine: #1d6a39;
  --meh: #875600;
  --inflated: #b1241b;
  --unknown: #4d4d48;
  --focus: #1a4fd6;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --stamp: 'Archivo', 'Arial Narrow', Arial, sans-serif;
  --measure: 40rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--serif);
  font-optical-sizing: auto;
  font-variant-numeric: tabular-nums lining-nums;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem; z-index: 2; }
.skip:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- frame ---------- */

.masthead, main, .colophon {
  max-width: calc(var(--measure) + 2.5rem);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.masthead {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.5rem 0.9rem;
  border-bottom: 1px solid var(--ink);
}
.wordmark {
  font: 800 1.35rem/1 var(--stamp);
  font-stretch: 72%;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.masthead nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-size: 1rem; }
.masthead nav a { text-decoration: none; }
.masthead nav a:hover, .masthead nav a[aria-current='page'] { text-decoration: underline; }

main { padding-block: 2.5rem 4rem; }

.colophon {
  border-top: 1px solid var(--ink);
  padding-block: 1.25rem 3rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.colophon p { margin: 0 0 0.5rem; max-width: 36rem; }
.colophon a { margin-right: 1rem; color: var(--ink); }

/* ---------- type ---------- */

h1 {
  font-size: clamp(2.5rem, 8vw, 4.1rem);
  line-height: 1.02;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.prose h1 { font-size: clamp(2.1rem, 6vw, 3rem); line-height: 1.08; }
h2 { font-size: 1.45rem; line-height: 1.25; font-weight: 650; margin: 2.5rem 0 0.6rem; text-wrap: balance; }
h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 650; margin: 1.75rem 0 0.4rem; }
p, ul, ol { margin: 0 0 1rem; }
.lede { font-size: 1.25rem; line-height: 1.5; max-width: 34em; margin-bottom: 2.25rem; }

/* ---------- the form ---------- */

fieldset { border: 0; margin: 0 0 2rem; padding: 1rem 0 0; min-width: 0; border-top: 4px double var(--ink); }
legend { font-size: 1.3rem; font-weight: 650; padding: 0 0.5rem 0 0; float: left; width: 100%; margin-bottom: 0.75rem; }
legend + * { clear: both; }

.claim { display: grid; gap: 0 2rem; }
@media (min-width: 38rem) { .claim { grid-template-columns: 1fr 1fr; } .claim legend { grid-column: 1 / -1; } }

.field { margin-bottom: 0.75rem; }
label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.hint { color: var(--muted); font-size: 0.95rem; margin: 0.35rem 0 0; max-width: 36em; }
.evidence > .hint { margin-bottom: 1rem; }
.error { color: var(--inflated); font-weight: 600; font-size: 0.95rem; margin: 0.3rem 0 0; }
.error:empty { display: none; }
.error:not(:empty)::before { content: 'Error: '; }

.money { display: flex; align-items: baseline; border-bottom: 2px solid var(--ink); }
.money span { font-size: 1.6rem; padding-right: 0.15rem; }
input {
  font: inherit; color: inherit; font-variant-numeric: tabular-nums;
  background: transparent; border: 0; border-radius: 0;
  width: 100%; min-width: 0; padding: 0.3rem 0.1rem;
}
.money input { font-size: 1.6rem; padding-block: 0.15rem 0.2rem; }
.money:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.money input:focus-visible { outline: none; }
input::placeholder { color: #9a9a93; }
input[type='date'] { border-bottom: 2px solid var(--ink); font-size: 1.1rem; padding-block: 0.55rem 0.4rem; min-height: 2.9rem; }
[aria-invalid='true'] { background: #fbe9e7; }
.money:has([aria-invalid='true']) { border-bottom-color: var(--inflated); }

.rows-head, .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 5.5rem; gap: 0 1.25rem; align-items: start; }
.rows-head { font-weight: 600; font-size: 0.95rem; color: var(--muted); }
.rows { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.row { padding-block: 0.35rem; }
.row .money input { font-size: 1.3rem; }
.row .money span { font-size: 1.3rem; }
.remove { align-self: center; }

button { font: inherit; cursor: pointer; }
button.primary {
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); border-radius: 2px;
  padding: 0.7rem 1.4rem; font-weight: 650; font-size: 1.15rem;
}
button.primary:hover { background: #000; }
button.quiet, .remove {
  background: none; border: 0; padding: 0.35rem 0; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em;
}
button.quiet:hover, .remove:hover { text-decoration-thickness: 2px; }
.remove { font-size: 0.95rem; color: var(--muted); }
.submit { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; }

@media (max-width: 30rem) {
  .rows-head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 0.9rem; padding-block: 0.6rem; border-bottom: 1px solid var(--faint); }
  .row .remove { grid-column: 1 / -1; justify-self: start; }
  .row label.visually-hidden { position: static !important; width: auto; height: auto; margin: 0 0 0.2rem; clip: auto; overflow: visible; white-space: normal; font-size: 0.9rem; color: var(--muted); }
}

.error-summary { border: 3px solid var(--inflated); padding: 1rem 1.25rem 0.25rem; margin-bottom: 2rem; }
.error-summary h2 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.error-summary a { color: var(--inflated); font-weight: 600; }
.notice { border: 2px solid var(--ink); padding: 0.75rem 1rem; }

/* ---------- the finding ---------- */

.finding { border-top: 4px double var(--ink); margin-top: 3rem; padding-top: 2rem; scroll-margin-top: 1rem; }

.finding-top { display: grid; gap: 2rem; align-items: center; margin-bottom: 2rem; }
@media (min-width: 40rem) { .finding-top { grid-template-columns: auto minmax(0, 1fr); gap: 2.5rem; } }

.stamp {
  --c: var(--ink);
  justify-self: start;
  margin: 0.5rem 0 0 0.5rem;
  color: var(--c);
  border: 5px solid currentColor;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px currentColor;
  padding: 0.35em 0.6em 0.3em;
  font: 900 clamp(2.4rem, 11vw, 3.5rem)/0.95 var(--stamp);
  font-stretch: 70%;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transform: rotate(-6deg);
  /* Uneven ink: a speckle mask, so the stamp reads as pressed rather than printed. */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.2 0 0 0 2.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.2 0 0 0 2.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp span { display: block; }
.stamp-genuine { --c: var(--genuine); transform: rotate(-4deg); }
.stamp-meh { --c: var(--meh); transform: rotate(3deg); }
.stamp-inflated { --c: var(--inflated); transform: rotate(-7deg); }
.stamp-unknown { --c: var(--unknown); font-size: clamp(1.6rem, 7vw, 2.1rem); max-width: 9em; line-height: 1.05; transform: rotate(-3deg); }

@media (prefers-reduced-motion: no-preference) {
  .is-new .stamp { animation: press 260ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
  @keyframes press { from { opacity: 0; scale: 1.35; } 60% { opacity: 1; } to { scale: 1; } }
}

.ledger { margin: 0; }
.ledger div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--faint); }
.ledger div:last-child { border-top: 4px double var(--ink); border-bottom: 0; font-weight: 650; }
.ledger div:nth-last-child(2) { border-bottom: 0; }
.ledger dt { color: var(--muted); }
.ledger div:last-child dt { color: var(--ink); }
.ledger dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

figure { margin: 0 0 1.75rem; }
.chart { display: block; width: 100%; height: auto; font-family: var(--serif); font-variant-numeric: tabular-nums; overflow: visible; }
.chart .grid { stroke: var(--faint); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 13px; }
.chart .pt { fill: var(--ink); }
.chart line.ref-was { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 8 5; }
.chart line.ref-typical { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 1.5 4; stroke-linecap: round; }
.chart line.ref-now { stroke: var(--ink); stroke-width: 2.5; }
.chart .ref-label { fill: var(--ink); font-size: 14px; font-weight: 600; }
figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.5rem; max-width: 38em; }

.reasons p { font-size: 1.2rem; line-height: 1.55; max-width: 36em; margin-bottom: 0.8rem; }
.finding-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; margin-top: 1.5rem; }
.copied { font-size: 0.95rem; color: var(--muted); }
.copied:empty { display: none; }
.finding-meta { font-size: 0.95rem; color: var(--muted); }

/* ---------- prose pages ---------- */

.prose { max-width: var(--measure); }
.prose p, .prose li { max-width: 38em; }
.prose li { margin-bottom: 0.4rem; }
.prose .standfirst { font-size: 1.25rem; line-height: 1.5; margin-bottom: 2rem; }
.prose blockquote { margin: 1.25rem 0; padding: 0 0 0 1.25rem; border-left: 3px solid var(--ink); }
.prose blockquote p { font-size: 1.05rem; }
.prose .cite { font-size: 0.95rem; color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; font-size: 1rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--faint); }
.prose th { border-bottom: 2px solid var(--ink); }
.sources { border-top: 4px double var(--ink); margin-top: 3rem; padding-top: 0.5rem; font-size: 0.95rem; }
.sources h2 { font-size: 1.15rem; margin-top: 1rem; }
.sources li { margin-bottom: 0.5rem; }

.rules { padding-left: 1.5rem; }
.rules li { margin-bottom: 0.75rem; padding-left: 0.25rem; }
.rules li::marker { font-weight: 650; }

.guide-list { list-style: none; padding: 0; }
.guide-list li { border-top: 1px solid var(--ink); padding: 1rem 0 0.25rem; }
.guide-list a { font-size: 1.3rem; font-weight: 650; }
.guide-list p { margin: 0.3rem 0 0.75rem; color: var(--muted); }

.disclaimer { border: 2px solid var(--ink); padding: 0.9rem 1.1rem; margin: 1.5rem 0 2rem; }
.disclaimer p { margin: 0; }

@media print {
  .masthead nav, .colophon, form, .finding-actions { display: none; }
}

/* Price and date boxes in a row share one height so their rules line up. */
.row .cell { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.row .money, .row input[type='date'] { height: 2.9rem; align-items: center; }
.row:has(.error:not(:empty)) .cell { justify-content: flex-start; }

/* Narrow screens: tables become stacked records instead of scrolling sideways. */
@media (max-width: 34rem) {
  .prose table, .prose tbody, .prose tr, .prose td { display: block; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose tr { border-top: 1px solid var(--ink); padding: 0.6rem 0; }
  .prose td { border: 0; padding: 0.15rem 0; }
  .prose td:first-child { font-weight: 650; }
}
