/* Look: lumberyard catalog. Off-white paper, one forest green, Archivo in sentence case.
   Shape rule: 4px corners on everything. One accent colour; red is used only for errors. */
@font-face {
  font-family: Archivo; src: url(/assets/archivo.woff2) format("woff2");
  font-weight: 400 800; font-stretch: 62% 125%; font-display: swap;
}
:root {
  --paper: #f2f3ee; --surface: #fafaf7; --ink: #17201b; --muted: #55605a; --line: #d3d7cd; --edge: #808b84;
  --accent: #1d6a47; --on-accent: #f6f8f3; --tint: #dfe9e1; --wood: #e2c896; --err: #a3341f;
  --r: 4px; --halo: var(--surface);
  --font: Archivo, "Helvetica Neue", Arial, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111512; --surface: #181e1a; --ink: #e8ece8; --muted: #9fa9a3; --line: #2b352f; --edge: #6f7b74;
    --accent: #62bd8f; --on-accent: #0c1a12; --tint: #1c2b23; --wood: #6b5a39; --err: #ff8f7a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--font); }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 1; padding: 8px 12px; background: var(--surface); }

/* type */
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 800 clamp(2.5rem, 6.4vw, 4.1rem)/.95 var(--font); font-stretch: 75%; letter-spacing: -.012em; }
h2 { font: 750 1.75rem/1.1 var(--font); font-stretch: 80%; letter-spacing: -.008em; }
h3 { font: 700 1.1rem/1.3 var(--font); }
.lede { max-width: 54ch; margin: 14px 0 0; color: var(--muted); font-size: 1.15rem; line-height: 1.5; }

/* header and footer */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 64px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font: 800 1.35rem/1 var(--font); font-stretch: 78%; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.mark { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: square; }
.bar nav { display: flex; gap: 22px; }
.bar nav a { color: var(--ink); font-weight: 600; font-size: .98rem; text-decoration: none; white-space: nowrap; }
.bar nav a:hover { color: var(--accent); text-decoration: underline; }
@media (max-width: 420px) { .bar nav { gap: 15px; } .brand { font-size: 1.2rem; } }

footer.site { margin-top: 88px; padding: 40px 0 48px; border-top: 1px solid var(--line); background: var(--surface); font-size: .95rem; }
.foot { display: grid; gap: 28px 32px; }
@media (min-width: 760px) { .foot { grid-template-columns: 1.6fr 1fr 1fr .7fr; } }
.foot .about p { max-width: 38ch; margin: 12px 0 0; color: var(--muted); }
.foot nav { display: grid; gap: 7px; align-content: start; justify-items: start; }
.foot h2 { margin-bottom: 4px; font: 700 .95rem/1.3 var(--font); letter-spacing: 0; }
.foot nav a { color: var(--muted); text-decoration: none; }
.foot nav a:hover { color: var(--accent); text-decoration: underline; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }
.btn {
  display: inline-block; padding: 12px 18px; border: 1.5px solid var(--accent); border-radius: var(--r);
  background: var(--accent); color: var(--on-accent); font-weight: 650; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease-out;
}
.btn.ghost { border-color: var(--edge); background: none; color: var(--ink); }
.btn:hover { text-decoration: underline; }
.btn:active { transform: translateY(1px); }

/* home: hero */
.photo { display: block; width: 100%; height: auto; border-radius: var(--r); object-fit: cover; background: var(--tint); }
.hero { display: grid; gap: 28px; align-items: center; padding: 36px 0 0; }
.hero .photo { aspect-ratio: 16 / 10; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; padding-top: 60px; }
  .hero .photo { aspect-ratio: 4 / 3; }
}

/* home: calculator tiles. Four tiles per group: a tall feature, two small, one wide. */
.tools { margin-top: 72px; scroll-margin-top: 16px; }
.tools h2 { margin-bottom: 18px; }
.bento { display: grid; gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s ease-out, transform .12s ease-out;
}
.tile:hover { border-color: var(--ink); }
.tile:hover h3 { color: var(--accent); text-decoration: underline 1.5px; text-underline-offset: 3px; }
.tile:active { transform: translateY(1px); }
.tile h3 { font: 750 1.3rem/1.15 var(--font); font-stretch: 80%; }
.tile p { margin: 4px 0 0; color: var(--muted); font-size: .97rem; line-height: 1.45; }
.tile .drawing { max-height: 130px; }
.tile.feature { --halo: var(--tint); background: var(--tint); border-color: transparent; }
.tile.feature .drawing { max-height: 240px; margin: auto 0; }
.tile.feature h3 { font-size: 1.6rem; }
@media (min-width: 600px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .tile.feature, .tile.wide { grid-column: span 2; }
  .tile.wide { flex-direction: row-reverse; align-items: center; }
  .tile.wide > * { flex: 1; min-width: 0; }
}
@media (min-width: 900px) {
  .bento.left { grid-template-columns: 1.3fr 1fr 1fr; }
  .bento.right { grid-template-columns: 1fr 1fr 1.3fr; }
  .tile.feature { grid-column: auto; grid-row: span 2; }
  .tile.feature .drawing { max-height: none; }
  .bento.right .feature { grid-column: 3; grid-row: 1 / span 2; }
}

/* home: proof */
.proof { display: grid; gap: 28px; align-items: center; margin-top: 88px; }
.proof .photo { aspect-ratio: 16 / 9; }
@media (min-width: 900px) { .proof { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; } .proof .photo { aspect-ratio: 3 / 2; } }
.facts { list-style: none; margin: 18px 0 0; padding: 0; }
.facts li { padding: 14px 0; color: var(--muted); }
.facts li + li { border-top: 1px solid var(--line); }
.facts strong { display: block; color: var(--ink); font-weight: 700; }

/* calculator page */
.crumb { margin: 26px 0 14px; font-size: .95rem; font-weight: 600; }
.tool { display: grid; gap: 18px; align-items: start; margin-top: 28px; }
@media (min-width: 900px) {
  .tool { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .results { position: sticky; top: 14px; }
}
.panel { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; padding: 20px; }
.group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
.group, .wide { grid-column: 1 / -1; }
@media (max-width: 440px) { .form, .group { grid-template-columns: 1fr; } }
.field { min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, legend { display: block; margin-bottom: 6px; padding: 0; font-weight: 600; font-size: .95rem; }
.input { display: flex; align-items: center; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); }
.input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.input input:focus-visible { outline: 0; }
input[type=number], select {
  width: 100%; min-width: 0; height: 46px; padding: 0 12px; border: 0; border-radius: var(--r); background: transparent;
  color: inherit; font: 600 1.1rem/1 var(--font); font-variant-numeric: tabular-nums;
}
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select { border: 1px solid var(--edge); background: var(--paper); font-size: 1rem; }
.unit { padding-right: 12px; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help { margin: 6px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.4; }
.segs { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--paper); }
.segs label { flex: 1; position: relative; }
.segs input { position: absolute; opacity: 0; }
.segs span { display: block; padding: 10px 8px; border-radius: 2px; font-weight: 600; font-size: .95rem; text-align: center; white-space: nowrap; cursor: pointer; }
.segs input:checked + span { background: var(--accent); color: var(--on-accent); }
.segs input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.segs span:active { transform: translateY(1px); }

/* results: one big answer, then a tally with dotted leaders like a price list */
.results dl { margin: 0; padding: 0 20px 10px; }
.row { display: flex; align-items: baseline; padding: 7px 0; }
.row dt { flex: 1; display: flex; align-items: baseline; min-width: 0; color: var(--muted); }
.row dt::after { content: ""; flex: 1; min-width: 12px; margin: 0 8px; border-bottom: 1.5px dotted var(--edge); opacity: .55; }
.row dd { max-width: 62%; margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.row.main { display: block; margin: 0 -20px 8px; padding: 18px 20px 20px; background: var(--tint); }
.row.main dt { display: block; color: var(--ink); font-weight: 600; font-size: .95rem; }
.row.main dt::after { display: none; }
.row.main dd { max-width: none; margin-top: 4px; color: var(--accent); font: 800 clamp(2.2rem, 7vw, 3.1rem)/1 var(--font); font-stretch: 75%; letter-spacing: -.01em; text-align: left; }
.error { margin: 0; padding: 14px 20px; color: var(--err); font-weight: 650; }

/* scale drawings */
.drawing { display: block; width: 100%; height: auto; }
.results .drawing { max-height: 330px; padding: 6px 8px 10px; border-top: 1px solid var(--line); }
.drawing .f { fill: var(--wood); stroke: var(--ink); stroke-width: 1.25; stroke-linejoin: round; }
.drawing .k { fill: var(--ink); }
.drawing .w { fill: var(--accent); stroke: var(--ink); stroke-width: 1.25; }
.drawing .o { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: square; stroke-linejoin: miter; }
.drawing .j { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.drawing .h { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 5 4; }
.drawing .d { fill: none; stroke: var(--muted); stroke-width: 1; }
.drawing .t { stroke: var(--muted); stroke-width: 1.75; }
.drawing text { font: 600 12.5px var(--font); font-stretch: 88%; fill: var(--ink); paint-order: stroke; stroke: var(--halo); stroke-width: 3px; font-variant-numeric: tabular-nums; }
.bare * { vector-effect: non-scaling-stroke; }
.bare text, .bare .d, .bare .t, .bare .h { display: none; }

/* article */
.prose { max-width: 66ch; margin-top: 8px; }
.prose > h1 { margin-top: 44px; }
.prose h2 { margin: 2.2em 0 .5em; }
.prose h3 { margin: 1.5em 0 .25em; }
.prose li { margin: .35em 0; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; white-space: nowrap; }
thead th { color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 1.5px solid var(--ink); }
tbody tr:nth-child(even) { background: var(--tint); }
td:first-child { font-weight: 650; }
.links { padding-left: 1.1em; }
