/* =============================================================================
   Leadhouse — shared design tokens. Visual source: Texas county deed records.
   Survey ink, limestone paper, recorder's-stamp violet. Radius 0 everywhere.
   ============================================================================= */
:root {
  --ink:        #17222B;
  --ink-soft:   #4A5A65;
  --paper:      #EFF1EC;
  --panel:      #FFFFFF;
  --rule:       #C9D0CA;
  --rule-soft:  #E1E5DF;
  --stamp:      #2C3A85;
  --stamp-deep: #1E2960;
  --brass:      #8A6D2B;
  --flag:       #A33726;
  --flag-soft:  #F4E3DF;
  --ok:         #2F6B47;
  --ok-soft:    #E1EEE5;
  --muted:      #9AA5AC;      /* empty-row dashes on the record card */

  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body:    'Public Sans', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 62ch;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--stamp); text-underline-offset: .15em; }
a:hover { color: var(--stamp-deep); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
strong { font-weight: 600; }
small { font-size: .85em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

/* Eyebrows / labels: the ledger voice */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 .5rem;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.soft { color: var(--ink-soft); }
.flag { color: var(--flag); }

/* Section titles sit above a 2px ink rule */
.section-title {
  border-top: 2px solid var(--ink);
  padding-top: .75rem;
  margin: 0 0 1.25rem;
}

/* Focus: always visible */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--stamp); outline-offset: 2px;
}

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

/* ----------------------------------------------------------------- buttons */
.btn {
  font: inherit; font-weight: 600; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.1rem; min-height: 2.75rem;
  border: 1px solid var(--ink); background: var(--panel); color: var(--ink);
  cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--rule-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--stamp); border-color: var(--stamp); color: #fff; }
.btn-primary:hover { background: var(--stamp-deep); border-color: var(--stamp-deep); }
.btn-quiet { border-color: var(--rule); color: var(--ink-soft); background: transparent; }
.btn-quiet:hover { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn-danger { border-color: var(--flag); color: var(--flag); background: transparent; }
.btn-danger:hover { background: var(--flag-soft); }
.btn-sm { padding: .4rem .7rem; min-height: 2rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------- forms */
.field { display: flex; flex-direction: column; gap: .35rem; margin: 0 0 1rem; }
.field > label, .field-label { font-size: .9rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--ink-soft); }
.field .opt { font-weight: 400; color: var(--ink-soft); }
.input, input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="date"], input[type="search"], select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  width: 100%; min-height: 2.75rem;
  padding: .6rem .75rem;
  background: var(--panel); border: 1px solid var(--rule);
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { min-height: 6rem; resize: vertical; line-height: 1.45; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2317222B' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right .8rem center;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-soft); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--stamp); outline-offset: 0; box-shadow: 0 0 0 1px var(--stamp) inset; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--flag); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.num, input[inputmode="decimal"], input[inputmode="numeric"] { font-family: var(--font-mono); }
.field-error { font-size: .85rem; color: var(--flag); font-weight: 500; }
.field-error:empty { display: none; }
.form-error { border: 1px solid var(--flag); background: var(--flag-soft); color: var(--flag); padding: .65rem .8rem; font-size: .9rem; font-weight: 500; margin: 0 0 1rem; }

/* Pill radio groups */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.pill span {
  display: inline-flex; align-items: center; min-height: 2.5rem;
  padding: .45rem .85rem; border: 1px solid var(--rule); background: var(--panel);
  font-size: .93rem; font-weight: 500; cursor: pointer; user-select: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.pill span:hover { border-color: var(--ink); }
.pill input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill input:focus-visible + span { outline: 2px solid var(--stamp); outline-offset: 2px; }

/* Checkbox row */
.check { display: grid; grid-template-columns: 1.25rem 1fr; gap: .7rem; align-items: start; font-size: .9rem; }
.check input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--stamp); }

/* --------------------------------------------------------------- utilities */
.wrap { width: min(100% - 2 * var(--gutter), 72rem); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.tag { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .45rem; border: 1px solid var(--rule); color: var(--ink-soft); white-space: nowrap; }
.tag-flag { border-color: var(--flag); color: var(--flag); }
.tag-ok   { border-color: var(--ok); color: var(--ok); }
.tag-stamp{ border-color: var(--stamp); color: var(--stamp); }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
