/* Shed World — tokens */
:root {
  --shed: #26443a;        /* painted shed green */
  --shed-deep: #1a3029;
  --felt: #22272a;        /* roofing felt */
  --gravel: #c8c6bb;      /* pea gravel */
  --ground: #eef0ea;      /* overcast-sky page */
  --paper: #f8f9f5;
  --tape: #f4c22b;        /* tape-measure yellow */
  --timber: #b07a45;      /* treated timber */
  --ink: #22272a;
  --ink-2: #4a524f;
  --ink-3: #6b7370;
  --rule: #c9cdc4;

  --display: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: 2.375rem;
  --step-4: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);

  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--shed); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; box-shadow: 0 0 0 5px var(--felt); border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; }
p { margin: 0 0 1em; max-width: 66ch; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--tape); color: var(--felt); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- Header ---------- */
.site-header { background: var(--shed); color: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .9rem; padding-bottom: .9rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--paper); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; }
.brand svg { width: 34px; height: 30px; }
.nav { display: flex; gap: .25rem 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--paper); text-decoration: none; padding: .35rem 0; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: rgba(244,194,43,.5); }
.nav a[aria-current="page"] { border-bottom-color: var(--tape); }
.nav .nav-guide { background: var(--tape); color: var(--felt); padding: .35rem .8rem; border-radius: 3px; border: 0; font-weight: 700; }
.nav .nav-guide[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--felt); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-block; font: 700 1rem/1 var(--body); padding: .95rem 1.4rem; border-radius: 3px; border: 2px solid var(--felt); background: var(--tape); color: var(--felt); text-decoration: none; cursor: pointer; }
.btn:hover { background: #ffd34d; }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn--ghost:hover { background: rgba(255,255,255,.08); }

.signup { display: grid; gap: .9rem; }
.signup label { display: block; font-weight: 700; margin-bottom: .3rem; font-size: var(--step--1); }
.signup input { width: 100%; font: inherit; padding: .8rem .9rem; border: 2px solid var(--felt); border-radius: 3px; background: var(--paper); color: var(--ink); }
.signup input:focus-visible { box-shadow: none; outline-offset: 0; }
.signup .fine { font-size: var(--step--1); color: inherit; opacity: .85; margin: 0; }
.signup .done { font-weight: 700; margin: 0; }
.signup [aria-invalid="true"] { border-color: #b3261e; }
.err { color: #8f1d17; font-size: var(--step--1); margin: .3rem 0 0; font-weight: 700; }
.on-dark .err { color: #ffb4a9; }

/* ---------- Home hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 5vw, 4rem); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { max-width: 14ch; }
.hero .lede { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: 34ch; }
.hero .actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero .btn--ghost { color: var(--shed); }
.hero-drawing { position: relative; }
.hero-drawing figcaption { font-size: var(--step--1); color: var(--ink-3); margin-top: .5rem; }

.drawing .line { fill: none; stroke: var(--felt); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.drawing .thin { stroke-width: 1.2; }
.drawing .board { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.drawing .dim { fill: none; stroke: var(--shed); stroke-width: 1.4; }
.drawing .dim-label { font: 700 15px var(--body); fill: var(--shed); }
.drawing .tape-bg { fill: var(--tape); }
.drawing .ground { fill: var(--gravel); }
.drawing .stone { fill: #a9a79c; }

/* ---------- Questions strip ---------- */
.questions { background: var(--felt); color: var(--paper); padding: clamp(2.5rem, 5vw, 4rem) 0; }
.questions h2 { color: var(--paper); }
.questions .intro { color: #c9cec9; max-width: 52ch; }
.q-list { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); border-top: 1px solid #454c4f; }
.q-list li { border-bottom: 1px solid #454c4f; }
.q-list a { display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; align-items: start; padding: 1.4rem 1rem 1.4rem 0; color: var(--paper); text-decoration: none; }
.q-list a:hover .q { text-decoration: underline; text-decoration-color: var(--tape); }
.q-list svg { width: 2.5rem; height: 2.5rem; stroke: var(--tape); fill: none; stroke-width: 1.6; }
.q-list .q { font-family: var(--display); font-size: var(--step-1); font-weight: 700; display: block; line-height: 1.25; }
.q-list .a { display: block; color: #b8bfba; font-size: var(--step--1); margin-top: .3rem; }

/* ---------- Guide band ---------- */
.guide-band { background: var(--shed); color: var(--paper); padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.guide-band .wrap { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.guide-band h2 { color: var(--paper); }
.guide-band p { color: #d7e0db; }
.guide-band .fine { color: #c3cec8; }
.guide-band--two .wrap { grid-template-columns: 1fr 1fr; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.booklet { width: 100%; max-width: 15rem; margin: 0 auto; }

/* ---------- Latest ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }
.latest { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.feature { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.feature .art { display: block; background: var(--gravel); }
.feature .art svg { width: 100%; height: auto; }
.feature .body { padding: 1.4rem 1.5rem 1.6rem; }
.feature h3 { font-size: var(--step-2); }
.feature h3 a { color: var(--ink); text-decoration: none; }
.feature h3 a:hover { text-decoration: underline; }
.meta { font-size: var(--step--1); color: var(--ink-3); margin: 0 0 .4rem; }
.topic-tag { display: inline-block; font-size: var(--step--1); font-weight: 700; color: var(--shed); margin-bottom: .3rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.list li:first-child { padding-top: 0; }
.list h3 { margin: 0 0 .25rem; }
.list h3 a { color: var(--ink); text-decoration: none; }
.list h3 a:hover { text-decoration: underline; }
.list p { margin: 0; color: var(--ink-2); font-size: var(--step--1); }

/* ---------- Articles page ---------- */
.page-head { padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem; }
.page-head p { font-size: var(--step-1); color: var(--ink-2); max-width: 46ch; }
.topic-jump { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.topic-jump a { display: inline-block; padding: .45rem .9rem; border: 1.5px solid var(--shed); border-radius: 999px; text-decoration: none; font-weight: 700; font-size: var(--step--1); }
.topic-jump a:hover { background: var(--shed); color: var(--paper); }
.topic { display: grid; grid-template-columns: 16rem 1fr; gap: clamp(1rem, 4vw, 3rem); padding: 2.5rem 0; border-top: 2px solid var(--felt); scroll-margin-top: 1rem; }
.topic h2 { font-size: var(--step-2); }
.topic .topic-intro { color: var(--ink-2); font-size: var(--step--1); }
.topic .list li:first-child { padding-top: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; background: var(--tape); color: var(--felt); padding: .1rem .45rem; border-radius: 2px; margin-left: .4rem; vertical-align: middle; }

/* ---------- Article ---------- */
.article-head { padding: clamp(2.5rem, 5vw, 4rem) 0 2rem; }
.crumbs { font-size: var(--step--1); margin-bottom: 1rem; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); }
.article-head h1 { max-width: 18ch; }
.article-head .standfirst { font-size: var(--step-1); color: var(--ink-2); max-width: 44ch; }
.byline { font-size: var(--step--1); color: var(--ink-3); }
.article-hero { background: var(--gravel); border-radius: 4px; overflow: hidden; margin-top: 1.5rem; }
.article-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); padding-bottom: 4rem; }
.toc { position: sticky; top: 1.5rem; align-self: start; font-size: var(--step--1); }
.toc h2 { font-family: var(--body); font-size: var(--step--1); font-weight: 700; color: var(--ink-3); margin-bottom: .6rem; letter-spacing: 0; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin-bottom: .4rem; }
.prose { max-width: 42rem; min-width: 0; }
.prose h2 { font-size: var(--step-2); margin-top: 2.5rem; scroll-margin-top: 1rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.callout { background: var(--paper); border-left: 5px solid var(--tape); padding: 1rem 1.2rem; margin: 1.5rem 0; border-radius: 0 4px 4px 0; }
.callout p:last-child { margin-bottom: 0; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.75rem 3.75rem; border-left: 2px dashed var(--rule); margin-left: 1.2rem; }
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before { content: counter(step); position: absolute; left: -1.25rem; top: -.15rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--shed); color: var(--paper); font: 700 1.2rem/2.5rem var(--display); text-align: center; }
.steps h3 { margin: 0 0 .35rem; padding-top: .2rem; }
.steps p { margin-bottom: .5rem; }

.materials { list-style: none; padding: 0; margin: 1rem 0; border-top: 1px solid var(--rule); }
.materials li { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.materials .qty { color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }

.pick { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; border: 2px solid var(--felt); border-radius: 4px; padding: 1.1rem 1.2rem; margin: 1.5rem 0; background: var(--paper); }
.pick svg { width: 3rem; height: 3rem; }
.pick h3 { margin: 0 0 .25rem; }
.pick p { font-size: var(--step--1); margin-bottom: .6rem; }
.pick .btn { padding: .7rem 1rem; font-size: .95rem; }
.sample-label { font-size: .8rem; font-weight: 700; color: var(--ink-3); display: block; margin-bottom: .2rem; }

/* cost table with inline bars */
.cost-table { width: 100%; border-collapse: collapse; margin: 1rem 0 .5rem; font-variant-numeric: tabular-nums; }
.cost-table caption { text-align: left; font-size: var(--step--1); color: var(--ink-3); caption-side: bottom; padding-top: .6rem; }
.cost-table th, .cost-table td { text-align: left; padding: .65rem .5rem .65rem 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.cost-table thead th { font-size: var(--step--1); color: var(--ink-3); border-bottom: 2px solid var(--felt); }
.cost-table .num { text-align: right; white-space: nowrap; padding-right: 0; }
.cost-table .bar-cell { width: 38%; padding-left: 1rem; }
.cost-table tfoot td, .cost-table tfoot th { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--felt); }
.bar-svg { width: 100%; height: 14px; display: block; overflow: visible; }
.bar-svg rect.track { fill: #dfe2db; }
.bar-svg rect.fill { fill: var(--shed); }

/* range chart */
.chart { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 1.25rem 1.25rem 1rem; margin: 1.5rem 0; position: relative; }
.chart h3 { margin: 0 0 .2rem; }
.chart .sub { font-size: var(--step--1); color: var(--ink-3); margin-bottom: .8rem; }
.chart svg { width: 100%; max-width: 30rem; height: auto; overflow: visible; }
.chart .axis text, .chart .cat { font: 14px var(--body); fill: var(--ink-2); }
.chart .cat { font-weight: 700; fill: var(--ink); }
.chart .grid line { stroke: #e2e5de; }
.chart .range { fill: var(--timber); }
.chart .range.is-gravel { fill: var(--shed); }
.chart .val { font: 700 14px var(--body); fill: var(--ink); }
.chart .hit { fill: transparent; cursor: default; }
.tip { position: absolute; pointer-events: none; background: var(--felt); color: var(--paper); font-size: var(--step--1); padding: .4rem .6rem; border-radius: 3px; opacity: 0; transition: opacity .12s; white-space: nowrap; }
.tip.on { opacity: 1; }

.faq details { border-bottom: 1px solid var(--rule); padding: .9rem 0; }
.faq summary { font-family: var(--display); font-weight: 700; font-size: var(--step-1); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--body); color: var(--shed); font-size: 1.5rem; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: .6rem 0 0; }

.inline-signup { background: var(--shed); color: var(--paper); border-radius: 4px; padding: 1.5rem; margin: 2.5rem 0; }
.inline-signup h2 { color: var(--paper); margin-top: 0; font-size: var(--step-2); }
.inline-signup p { color: #d7e0db; }
.inline-signup .signup { grid-template-columns: 1fr 1fr auto; align-items: end; }
.inline-signup .signup .fine { grid-column: 1 / -1; }

/* ---------- Guide page ---------- */
.guide-hero { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.guide-hero .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.form-panel { background: var(--shed); color: var(--paper); padding: clamp(1.5rem, 3vw, 2rem); border-radius: 4px; }
.form-panel h2 { color: var(--paper); font-size: var(--step-2); }
.contents { list-style: none; margin: 1.5rem 0 0; padding: 0; counter-reset: ch; }
.contents li { counter-increment: ch; display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.contents li::before { content: counter(ch); font: 700 var(--step-3)/1 var(--display); color: var(--timber); }
.contents h3 { margin: 0 0 .2rem; }
.contents p { margin: 0; color: var(--ink-2); font-size: var(--step--1); }
.guide-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 0; margin: 1rem 0 0; list-style: none; font-size: var(--step--1); color: var(--ink-2); }

/* ---------- Footer ---------- */
.site-footer { background: var(--felt); color: #c9cec9; padding: 3rem 0 2rem; font-size: var(--step--1); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer a { color: var(--paper); }
.site-footer h2 { font-size: var(--step-1); color: var(--paper); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.disclosure { border-left: 3px solid var(--tape); padding-left: .9rem; }
.copyright { grid-column: 1 / -1; max-width: none; border-top: 1px solid #454c4f; padding-top: 1.2rem; margin: 0; }

/* ---------- Motion initial states (only when JS + motion allowed) ---------- */
.js-motion [data-hero-item] { opacity: 0; }
.js-motion .reveal-item { opacity: 0; }
.bar-svg .fill, .chart .range, [data-dim] { transform-box: fill-box; transform-origin: left center; }
[data-dim] { transform-origin: center; }
.form-panel { position: sticky; top: 1.5rem; }
@media (max-width: 760px) { .form-panel { position: static; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .guide-band .wrap { grid-template-columns: 1fr 1fr; }
  .guide-band .booklet { display: none; }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; background: var(--paper); border: 1px solid var(--rule); padding: 1rem 1.2rem; border-radius: 4px; }
}
@media (max-width: 760px) {
  .hero .wrap, .latest, .guide-band .wrap, .guide-hero .wrap, .topic, .site-footer .wrap { grid-template-columns: 1fr; }
  .hero-drawing { order: -1; }
  .inline-signup .signup { grid-template-columns: 1fr; }
  .cost-table .bar-cell { width: 28%; padding-left: .6rem; }
  .cost-table th, .cost-table td { font-size: var(--step--1); }
  .steps > li { padding-left: 2.6rem; }
  .chart { padding: 1rem .9rem .8rem; }
  .chart .axis text, .chart .cat, .chart .val { font-size: 17px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
