/* HaulBrief — minimal editorial stylesheet
   Single file, no build step, no external requests. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-alt: #f4f1ec;
  --text: #1c1b19;
  --muted: #5f5c57;
  --line: #e4e0d9;
  --accent: #a9491a;
  --accent-soft: #fbf1ea;
  --ok: #2f6b4f;
  --warn: #8a5a12;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", Times, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 68rem;
  --read: 40rem;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131210;
    --surface: #1a1917;
    --surface-alt: #201e1b;
    --text: #ece9e3;
    --muted: #a39e95;
    --line: #302d29;
    --accent: #e08a56;
    --accent-soft: #241d18;
    --ok: #7fbf9d;
    --warn: #d9a75a;
  }
}

* { box-sizing: border-box; min-width: 0; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 68px; flex-wrap: wrap;
}
.brand {
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none; display: inline-block;
}
.brand span { color: var(--accent); }
.brand small {
  display: block; font-weight: 400; font-size: .72rem; color: var(--muted);
  letter-spacing: .02em; text-transform: uppercase;
}
.site-nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: .25rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- layout ---------- */

main { padding: 2.5rem 0 4rem; }
.narrow { max-width: var(--read); }

.crumbs { font-size: .84rem; color: var(--muted); margin: 0 0 1.5rem; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 .4rem; opacity: .5; }

/* ---------- typography ---------- */

h1, h2, h3, h4 {
  line-height: 1.22; letter-spacing: -0.015em; margin: 0 0 .6rem;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(1.6rem, 1.15rem + 2vw, 2.6rem); font-weight: 700; }
h2 { font-size: 1.42rem; margin-top: 2.6rem; font-weight: 650; }
h3 { font-size: 1.12rem; margin-top: 1.9rem; font-weight: 650; }

.lede { font-size: 1.14rem; color: var(--muted); margin: 0 0 1.8rem; line-height: 1.6; }

.prose { font-family: var(--serif); font-size: 1.06rem; line-height: 1.75; }
.prose h2, .prose h3 { font-family: var(--sans); }
.prose p { margin: 0 0 1.15rem; }
.prose ul, .prose ol { margin: 0 0 1.15rem; padding-left: 1.35rem; }
.prose li { margin-bottom: .5rem; }
.prose strong { font-weight: 700; }

/* ---------- article meta ---------- */

.meta {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
  font-size: .84rem; color: var(--muted);
  padding: .85rem 0; margin: 0 0 2rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.meta strong { color: var(--text); font-weight: 600; }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 1.6rem; }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .94rem; }
th, td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-alt); font-weight: 650; font-size: .85rem; letter-spacing: .01em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
caption { caption-side: bottom; padding-top: .7rem; font-size: .82rem; color: var(--muted); text-align: left; }

/* ---------- callouts ---------- */

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 1rem 1.1rem;
  margin: 0 0 1.6rem;
  font-family: var(--sans);
  font-size: .96rem;
}
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--text); }

.sources {
  margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-family: var(--sans); font-size: .9rem;
}
.sources h2 { font-size: 1rem; margin-top: 0; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sources ol { padding-left: 1.2rem; color: var(--muted); }
.sources li { margin-bottom: .5rem; }

/* ---------- cards / grids ---------- */

.grid { display: grid; gap: 1.1rem; }
@media (min-width: 42rem) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 56rem) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
}
.card h3 { margin-top: 0; font-size: 1.05rem; }
.card h3 a { text-decoration: none; color: var(--text); }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: .94rem; }
.card .kicker {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); font-weight: 650; margin-bottom: .4rem; display: block;
}

/* ---------- hero ---------- */

.hero { padding: 1rem 0 2.5rem; border-bottom: 1px solid var(--line); margin-bottom: 2.5rem; }
.hero h1 { max-width: 22ch; }
.hero .lede { max-width: 54ch; margin-bottom: 0; }

/* ---------- link list ---------- */

.linklist { list-style: none; padding: 0; margin: 0; }
.linklist li { border-bottom: 1px solid var(--line); }
.linklist a {
  display: block; padding: .95rem 0; text-decoration: none; color: var(--text); font-weight: 600;
}
.linklist a:hover { color: var(--accent); }
.linklist small { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; margin-top: .2rem; }

/* ---------- calculator ---------- */

.calc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; margin: 0 0 2rem;
}
.calc fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.calc legend {
  font-weight: 650; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 0; margin-bottom: .9rem;
}
.field {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .75rem 1rem; margin-bottom: .8rem; flex-wrap: wrap;
}
.field label { font-size: .94rem; flex: 1 1 11rem; }
.field .hint { display: block; font-size: .8rem; color: var(--muted); }
.field input {
  flex: 0 1 9.5rem; width: 9.5rem; max-width: 100%;
  padding: .45rem .6rem; font: inherit; font-size: .95rem;
  font-variant-numeric: tabular-nums; text-align: right;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--text);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.result {
  background: var(--surface-alt); border-radius: var(--radius); padding: 1.25rem; margin-top: 1.25rem;
}
.result .big {
  font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em; line-height: 1.1;
}
.result .big small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.bench { margin-top: 1.1rem; font-size: .92rem; }
.bench-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .45rem 0; border-top: 1px solid var(--line);
}
.tag { font-size: .78rem; font-weight: 650; padding: .1rem .45rem; border-radius: 3px; white-space: nowrap; }
.tag-over { background: #fbeae2; color: #8c3b12; }
.tag-under { background: #e6f1ea; color: #23573f; }
.tag-near { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) {
  .tag-over { background: #3a2116; color: #f0a883; }
  .tag-under { background: #16291f; color: #8fd0ae; }
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 2.5rem 0; font-size: .9rem; color: var(--muted);
}
.footer-grid { display: grid; gap: 1.75rem; }
@media (min-width: 46rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h4 {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text); margin: 0 0 .7rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.colophon { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .84rem; }

/* ---------- utilities ---------- */

.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mt0 { margin-top: 0; }
.center { text-align: center; }
