/* Hallmark · base.css · theme: terrazzo (off-white) · genre: modern-minimal · scope: app · v2.0.0
 * What the Floor already decided: reset, document surfaces, controls in all eight
 * states, focus rings, reduced-motion fallback. Read tokens.css first. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { overflow-x: clip; }

body {
  background: var(--color-paper);
  color: var(--color-ink);
  font: 400 var(--text-md)/1.5 var(--font-body);
  min-height: 100vh;
}

/* Display heads: Syne 700, balanced, one colour */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  color: var(--color-ink);
  text-wrap: balance;
}
h1 { font-size: var(--text-display-s); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

/* Labels, captions, codes: body face or mono for measurements, never caps, never tracked */
label, .label { font: 500 var(--text-sm) var(--font-body); color: var(--color-muted); display: block; }
.code { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); }
.mono { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.price { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Helper line: reserves its height, error swaps in place (F14) */
.helper { min-height: 1.4em; font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-2xs); }
.helper.err { color: var(--color-error); }

/* ---- Controls: all eight states ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: var(--hit-target); padding: 0 var(--space-lg);
  border: 1px solid var(--color-ink); background: var(--color-ink); color: var(--color-plate);
  font: 500 var(--text-md) var(--font-body); white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--color-ink-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn--quiet { background: transparent; color: var(--color-ink); border-color: var(--color-rule); }
.btn--quiet:hover { background: var(--color-paper-2); }
.btn--danger { background: transparent; color: var(--color-error); border-color: var(--color-error); }
.btn--danger:hover { background: var(--color-accent-soft); }

/* ---- Fields: the border never changes width; the ring is reserved at rest ---- */
.well {
  width: 100%; padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-muted); background: var(--color-plate);
  font: 500 var(--text-md) var(--font-mono); color: var(--color-ink);
  outline: 2px solid transparent; outline-offset: -3px;
}
.well:hover { background: var(--color-paper-2); border-color: var(--color-muted); }
.well:focus-visible, .well:focus { outline-color: var(--color-focus); border-color: var(--color-ink); }
.well:disabled { opacity: 0.55; cursor: not-allowed; }
.well[aria-invalid="true"] { border-color: var(--color-error); }

/* ---- Cards: white plate, 2px ink bar, hard offset shadow ---- */
.card {
  background: var(--color-plate);
  border: var(--rule-bar) solid var(--color-ink);
  box-shadow: var(--shadow-card);
  padding: var(--space-md);
}
@media (hover: hover) {
  .card--hover:hover { box-shadow: var(--shadow-card-hover); }
}
.card--hover:focus-within { box-shadow: var(--shadow-card-hover); }

/* Ruled hairline rows: sibling stats and list rows part with a hairline */
.rowline { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); padding: var(--space-sm) 0; border-top: var(--rule-hair) solid var(--color-rule); }
.rowline:first-of-type { border-top: none; }

/* Bands: paper-2 wells edged by hairlines, two a screen at most */
.band { background: var(--color-paper-2); border-top: var(--rule-hair) solid var(--color-rule); border-bottom: var(--rule-hair) solid var(--color-rule); padding: var(--space-md); }

/* Corner ticks: the theme's alternative frame for wells and figures */
.ticks { position: relative; }
.ticks::before, .ticks::after { content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none; }
.ticks::before { top: -6px; left: -6px; border-top: var(--rule-hair) solid var(--color-muted); border-left: var(--rule-hair) solid var(--color-muted); }
.ticks::after { bottom: -6px; right: -6px; border-bottom: var(--rule-hair) solid var(--color-muted); border-right: var(--rule-hair) solid var(--color-muted); }

/* Segment: a choice between a few, native radios underneath */
.seg { display: flex; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { flex: 1; margin: 0; padding: var(--space-sm); border: 1px solid var(--color-rule); background: var(--color-plate); font: 500 var(--text-sm) var(--font-body); color: var(--color-ink); text-align: center; cursor: pointer; }
.seg label:hover { background: var(--color-paper-2); }
.seg input:checked + label { background: var(--color-ink); color: var(--color-plate); border-color: var(--color-ink); }
.seg input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.seg input:disabled + label { opacity: 0.55; cursor: not-allowed; }

/* Spinner: the one loading affordance */
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--color-accent-soft); border-top-color: var(--color-accent); border-radius: 50%; animation: spin 900ms linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty states: what is empty, why it matters, one action */
.empty { text-align: center; padding: var(--space-lg) var(--space-md); }
.empty .lead { font: 700 var(--text-lg) var(--font-display); }
.empty .why { color: var(--color-muted); font-size: var(--text-sm); margin-top: var(--space-2xs); }

/* The hidden attribute always wins over display rules */
[hidden] { display: none !important; }

/* Browser surfaces themed from the palette (F16) */
::selection { background: var(--color-accent-soft); color: var(--color-ink); }
html { scrollbar-color: var(--color-muted) var(--color-paper); caret-color: var(--color-ink); }

/* Reduced motion: everything settles at once */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
