/* Lumber Weight CSS — hand-written, no build, no reset lib. Dark mode is
   prefers-color-scheme only, no toggle, no JS. */

:root {
  --bg: #faf8f5; --surface: #fff; --text: #1f1b16; --muted: #6b6156; --border: #ddd5c9;
  --accent: #8a5a2b; --accent-soft: rgba(138, 90, 43, .14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, Consolas, "SFMono-Regular", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17140f; --surface: #221e18; --text: #ece6db; --muted: #a89d8c; --border: #3a352c;
    --accent: #d1994f; --accent-soft: rgba(209, 153, 79, .18);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .92em; background: var(--accent-soft); padding: .1em .35em; border-radius: .25em; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
nav.crumbs, table.data caption, table.data thead th, figure.xsec figcaption, footer.site, .grid a span { font-size: .82rem; color: var(--muted); }
header.site, nav.top, nav.nojs, nav.crumbs ol, form.calc, footer.site nav { display: flex; flex-wrap: wrap; }

header.site { align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
a.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
nav.top { gap: 1.1rem; font-size: .93rem; }
nav.nojs { padding: .5rem 1.25rem; font-size: .85rem; gap: .3rem .9rem; }
nav.top a, nav.nojs a, nav.crumbs a, footer.site nav a { color: var(--muted); text-decoration: none; }
nav.top a:hover, nav.nojs a:hover, nav.crumbs a:hover, footer.site nav a:hover { color: var(--accent); text-decoration: underline; }
nav.crumbs { padding: .6rem 1.25rem; border-bottom: 1px solid var(--border); }
nav.crumbs ol { list-style: none; padding: 0; gap: .35rem; }
nav.crumbs li + li::before { content: "› "; color: var(--border); }

main, footer.site { max-width: 46rem; margin-inline: auto; }
main { padding: 2rem 1.25rem 3rem; }
main > * + * { margin-top: 1.15rem; }
h1, h2 { font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; margin-top: 0; }
h2 { font-size: 1.15rem; margin-top: 2rem; }

form.calc { gap: 1rem 1.25rem; padding: 1rem 1.1rem; margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: .5rem; }
form.calc label { display: flex; flex-direction: column; gap: .3rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
form.calc select, form.calc input { font: inherit; font-size: .95rem; font-variant-numeric: tabular-nums; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: .35rem; padding: .45rem .55rem; }
form.calc input[type="number"] { width: 6.5rem; }
form.calc select:disabled, form.calc input:disabled { opacity: .55; cursor: not-allowed; }
form.calc select:not(:disabled):hover, form.calc input:not(:disabled):hover { border-color: var(--accent); }

p.answer { font-size: 1.25rem; line-height: 1.5; }
p.answer output { display: inline-block; min-width: 9ch; }
p.answer output b { font-weight: 800; font-size: 1.5rem; color: var(--accent); }
p.stats { font-size: .85rem; color: var(--muted); }
p.goto { font-size: .9rem; }
p.goto a { font-weight: 600; }

figure.xsec { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1rem 0; }
figure.xsec svg { max-width: 100%; height: auto; }
.xsec-nominal { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.xsec-actual { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.xsec-text { font-family: inherit; font-size: 11px; fill: var(--muted); }
figure.xsec figcaption { text-align: center; }

p.note { font-size: .88rem; color: var(--muted); border-left: 3px solid var(--accent); padding-left: 1rem; margin-left: .1rem; }
p.note a { color: var(--accent); }

table.data { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data caption { caption-side: top; text-align: left; padding-bottom: .5rem; }
table.data th, table.data td { padding: .5rem .7rem; text-align: left; white-space: nowrap; }
table.data thead th { border-bottom: 1px solid var(--text); font-weight: 600; }
table.data tbody th { font-weight: 500; }
table.data tbody tr { border-bottom: 1px solid var(--border); }
table.data tbody tr:hover { background: var(--accent-soft); }
table.data td.num, table.data th.num { text-align: right; }
table[data-sortable] thead th { cursor: pointer; user-select: none; }
table[data-sortable] thead th::after { content: " ↕"; font-size: .82em; }
table[data-sortable] thead th[aria-sort]::after { color: var(--accent); }
table[data-sortable] thead th[aria-sort="ascending"]::after { content: " ↑"; }
table[data-sortable] thead th[aria-sort="descending"]::after { content: " ↓"; }

ul.rel { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .95rem; }
span.nodata { color: var(--muted); font-style: italic; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .75rem; margin-top: 1.15rem; }
.grid a { display: flex; flex-direction: column; gap: .2rem; padding: .75rem .85rem; border: 1px solid var(--border); border-radius: .4rem; text-decoration: none; color: var(--text); font-size: 1.05rem; font-weight: 600; }
.grid a:hover { border-color: var(--accent); background: var(--accent-soft); }
.grid a span { font-weight: 400; }

/* ad slot: off for now; enabling sets a min-height in the same deploy (no CLS) */
div.ad { display: none; }

footer.site { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.5rem 1.25rem 2.5rem; }
footer.site nav { gap: 1rem; margin-bottom: .75rem; }
