/* Pixels, PPI & Print Size — print-shop spec-sheet look.
   Paper ground, ink text, one press-red accent, hairline rules.
   System stacks only; no external assets. */

:root {
  --paper: #faf7f2;
  --ink: #1c1a17;
  --accent: #b3261e;
  --rule: #d8d2c6;
  --ok: #1b5e20;
  --err: #8a1c12;
  --muted: #6b6459;
  --field: #ffffff;
}

* { box-sizing: border-box; }

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

body {
  margin: 0 auto;
  max-width: 46rem;
  padding: 1.25rem 1.25rem 3rem;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

.kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.masthead h1 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.6rem;
}

.lede {
  color: var(--muted);
  margin: 0.75rem 0 0;
  max-width: 38rem;
}

/* --- Tool cards ------------------------------------------------------- */

.tool, .prose {
  margin-top: 2rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}

.tool h2, .prose h2 {
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: 1.3rem;
  margin: 0 0 0.35rem;
}

.tool-intro { color: var(--muted); margin: 0 0 1rem; max-width: 40rem; }

.field-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.field { flex: 1 1 12rem; }
.field-narrow { flex: 0 1 9rem; min-width: 8rem; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

label .assumed {
  display: block;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

input, select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 3px;
  min-height: 44px;
}

input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[aria-invalid="true"] { border-color: var(--err); }

.hint, .field-error {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
}
.hint { color: var(--muted); }
.field-error { color: var(--err); font-weight: 600; min-height: 1em; }

.presets {
  border: 0;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.presets legend {
  float: left;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.chip {
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0.35rem 0.9rem;
  min-height: 44px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* --- Results ---------------------------------------------------------- */

.result {
  margin-top: 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--field);
  padding: 0.9rem 1rem;
}

.result-lead { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.9rem; }

.numbers {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0 0 0.6rem;
}

.numbers div { min-width: 7rem; }

.numbers dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.numbers dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.result-plain strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 1.2rem;
}

.muted { color: var(--muted); font-size: 0.85rem; }

.ghost {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  min-height: 44px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
}

.ghost:hover { border-color: var(--accent); color: var(--accent); }

.note { margin: 0.5rem 0 0; font-size: 0.8rem; color: var(--ok); }
.note.is-error { color: var(--err); }

.error-summary {
  margin-top: 1rem;
  padding: 0.6rem 0.9rem;
  border-left: 4px solid var(--err);
  background: #fbeae8;
  color: var(--err);
  font-weight: 600;
}

/* --- Disclosure & prose ----------------------------------------------- */

.disclosure {
  margin-top: 2rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
}

.disclosure summary {
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  padding: 0.25rem 0;
}

.disclosure[open] summary { margin-bottom: 0.75rem; }
.disclosure form { margin-top: 0.5rem; }
.disclosure .result { margin-top: 0.75rem; }

.prose h3 {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  margin: 1.4rem 0 0.35rem;
}

.prose p, .prose li { max-width: 42rem; }

.defs dt { font-weight: 700; margin-top: 0.9rem; }
.defs dd { margin: 0.15rem 0 0; max-width: 42rem; }

.colophon {
  margin-top: 2.5rem;
  border-top: 3px solid var(--ink);
  padding-top: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* --- Responsive ------------------------------------------------------- */

@media (max-width: 40rem) {
  body { padding: 1rem 1rem 2.5rem; }
  .field, .field-narrow { flex: 1 1 100%; }
  .numbers { gap: 1rem; }
  .numbers dd { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
