/* Shed World — painted-shed green, tape-measure yellow, gravel grey on pale lichen paper */
:root {
  --paper: #eceee4;      /* lichen-pale paper */
  --paper-2: #e1e4d6;    /* shaded paper */
  --green: #1f4436;      /* painted shed green */
  --green-2: #2d5c4a;
  --ink: #22282a;        /* roofing-felt charcoal */
  --ink-2: #4c5553;
  --gravel: #8f938a;
  --tape: #f2c230;       /* tape-measure yellow */
  --tape-dark: #c99a12;
  --rule: #c6cabb;
  --white: #fafbf6;

  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Literata", Georgia, 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, 6.2vw, 5.25rem);

  --measure: 66ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --max: 1240px;
}

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

h1, h2, h3, h4 {
  font-family: var(--display);
  font-stretch: 75%;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-stretch: 85%; font-weight: 700; line-height: 1.2; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--tape); padding: .5rem 1rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { border-bottom: 2px solid var(--ink); background: var(--paper); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand span { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 1.6rem; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: clamp(.75rem, 2.5vw, 2rem); font-family: var(--display); font-stretch: 90%; font-weight: 600; }
.nav a { text-decoration: none; color: var(--ink); padding: .4rem 0; border-bottom: 3px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--tape); }
.nav a:hover { border-bottom-color: var(--green); }
.nav .btn { border-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--display); font-stretch: 90%; font-weight: 700; font-size: 1.05rem;
  padding: .8rem 1.3rem; border-radius: 3px; border: 2px solid var(--ink);
  background: var(--tape); color: var(--ink); text-decoration: none; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.small { padding: .45rem .9rem; font-size: .95rem; box-shadow: 2px 2px 0 var(--ink); }
.btn.quiet { background: transparent; box-shadow: none; }
.btn.quiet:hover { background: var(--white); }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 0; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: end; }
.hero h1 { max-width: 13ch; }
.hero .lede { font-size: var(--step-1); line-height: 1.5; max-width: 34ch; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.6rem; }
.hero-art { width: 100%; }
.hero-art svg { width: 100%; height: auto; }

/* Tape measure: the signature element */
.tape { margin-top: clamp(1.5rem, 4vw, 3rem); position: relative; }
.tape-track { overflow: hidden; }
.tape svg { width: 100%; height: auto; }
.tape-caption { font-size: var(--step--1); color: var(--ink-2); margin-top: .6rem; }
.tape-sizes { list-style: none; position: relative; height: 3.6rem; margin: .1rem 0 0; padding: 0; }
.tape-sizes li {
  position: absolute; top: 0; right: calc(100% - var(--at)); width: 11.5rem; max-width: 14.5%;
  text-align: right; font-family: var(--display); font-stretch: 90%; font-size: .95rem; line-height: 1.25; color: var(--ink-2);
}
.tape-sizes b { display: block; color: var(--ink); font-stretch: 75%; font-weight: 800; font-size: 1.15rem; }
.chart-table { margin-top: 1rem; }
.chart-table summary { cursor: pointer; font-family: var(--display); font-stretch: 90%; font-weight: 600; color: var(--green); }
@media (max-width: 760px) {
  .tape-sizes { height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; margin-top: .75rem; }
  .tape-sizes li { position: static; width: auto; max-width: none; text-align: left; border-left: 4px solid var(--green); padding-left: .6rem; }
}

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-head { display: grid; grid-template-columns: 1fr 1.3fr; gap: 2rem; align-items: end; margin-bottom: 2.5rem; }
.section-head p { color: var(--ink-2); max-width: 46ch; margin: 0; }

/* Topics: a ledger, not cards */
.topics { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.topics li { border-bottom: 1px solid var(--rule); }
.topics a {
  display: grid; grid-template-columns: 56px 1fr 1.4fr auto; gap: 1.5rem; align-items: center;
  padding: 1.25rem .5rem; text-decoration: none; color: var(--ink);
}
.topics a:hover { background: var(--paper-2); }
.topics svg { width: 48px; height: 48px; }
.topics h3 { margin: 0; font-size: var(--step-2); font-stretch: 75%; font-weight: 800; }
.topics p { margin: 0; color: var(--ink-2); }
.topics .count { font-family: var(--display); font-stretch: 85%; font-weight: 600; color: var(--green); white-space: nowrap; }

/* Cost chart (home) */
.chart-block { background: var(--white); border: 2px solid var(--ink); border-radius: 4px; padding: clamp(1.25rem, 3vw, 2.25rem); }
.chart-block h2 { font-size: var(--step-2); }
.chart-note { font-size: var(--step--1); color: var(--ink-2); margin: .75rem 0 0; max-width: 70ch; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .axis-text { font-family: var(--display); font-stretch: 90%; font-size: 13px; fill: var(--ink-2); }
.chart .cat-text { font-family: var(--display); font-stretch: 85%; font-weight: 700; font-size: 15px; fill: var(--ink); }
.chart .val-text { font-family: var(--display); font-stretch: 90%; font-weight: 600; font-size: 14px; fill: var(--ink); }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .bar { fill: var(--green-2); transform-box: fill-box; transform-origin: left center; }
.chart .bar.key { fill: var(--tape-dark); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + .bar, .chart g:hover .bar { filter: brightness(1.12); }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--white);
  font-family: var(--display); font-stretch: 90%; font-size: .9rem; padding: .4rem .6rem; border-radius: 3px;
  opacity: 0; transition: opacity .12s; white-space: nowrap; z-index: 5;
}
.chart { position: relative; }

/* Guide band */
.guide-band { background: var(--green); color: var(--white); }
.guide-band h2, .guide-band h3 { color: var(--white); }
.guide-band .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.guide-band p { color: #d7e2da; }
.guide-band a { color: var(--tape); }

/* Booklet illustration */
.booklet svg { width: min(100%, 420px); height: auto; margin: 0 auto; }

/* Sign-up form */
.signup { display: grid; gap: 1rem; max-width: 460px; }
.field label { display: block; font-family: var(--display); font-stretch: 90%; font-weight: 600; margin-bottom: .3rem; }
.field input {
  width: 100%; font: inherit; font-size: 1rem; padding: .75rem .85rem;
  border: 2px solid var(--ink); border-radius: 3px; background: var(--white); color: var(--ink);
}
.field input:focus-visible { outline-offset: 1px; }
.field .error { color: #8a2a1b; font-size: var(--step--1); margin: .3rem 0 0; min-height: 0; }
.guide-band .field .error { color: #ffd9cf; }
.guide-band .field input { border-color: var(--ink); }
.form-small { font-size: var(--step--1); margin: 0; }
.form-done { background: var(--tape); color: var(--ink); border: 2px solid var(--ink); border-radius: 3px; padding: 1rem 1.2rem; }
.form-done p { color: var(--ink); margin: 0; }
.form-done strong { font-family: var(--display); font-stretch: 85%; font-size: 1.2rem; display: block; margin-bottom: .2rem; }

/* Article lists */
.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { border-top: 1px solid var(--rule); }
.article-list li:last-child { border-bottom: 1px solid var(--rule); }
.article-list a { display: grid; grid-template-columns: 9rem 1fr auto; gap: 1.5rem; padding: 1.1rem 0; text-decoration: none; color: var(--ink); align-items: baseline; }
.article-list a:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.article-list .topic { font-family: var(--display); font-stretch: 85%; font-weight: 600; color: var(--green); }
.article-list h3 { margin: 0 0 .2rem; font-size: var(--step-1); }
.article-list p { margin: 0; color: var(--ink-2); font-size: .98rem; max-width: 60ch; }
.article-list .time { font-size: var(--step--1); color: var(--ink-2); white-space: nowrap; }
.tag-new { display: inline-block; background: var(--tape); border: 1px solid var(--ink); border-radius: 2px; font-family: var(--display); font-size: .78rem; font-weight: 700; padding: 0 .35rem; margin-left: .4rem; vertical-align: middle; }

/* Articles page */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); border-bottom: 2px solid var(--ink); }
.page-head p { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: 46ch; margin: 0; }
.topic-jump { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.75rem; padding: 0; list-style: none; }
.topic-jump a { display: inline-block; padding: .4rem .85rem; border: 2px solid var(--ink); border-radius: 999px; text-decoration: none; color: var(--ink); font-family: var(--display); font-stretch: 90%; font-weight: 600; background: var(--white); }
.topic-jump a:hover { background: var(--tape); }
.topic-section { display: grid; grid-template-columns: 16rem 1fr; gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(2.5rem, 5vw, 4rem) 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 1rem; }
.topic-section:last-of-type { border-bottom: 0; }
.topic-section aside svg { width: 56px; height: 56px; margin-bottom: .75rem; }
.topic-section aside p { color: var(--ink-2); font-size: .98rem; }
.topic-section .article-list a { grid-template-columns: 1fr auto; }

/* ---------- Article ---------- */
.article-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; }
.crumbs { font-family: var(--display); font-stretch: 90%; font-size: .95rem; margin-bottom: 1.25rem; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
.article-head h1 { max-width: 16ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-family: var(--display); font-stretch: 90%; color: var(--ink-2); margin-top: 1rem; }
.article-meta dt { font-weight: 600; color: var(--ink); }
.article-meta div { display: flex; gap: .4rem; }
.article-meta dd { margin: 0; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(2rem, 5vw, 5rem); padding-bottom: 4rem; }
.prose { max-width: var(--measure); font-size: 1.1rem; line-height: 1.72; }
.prose h2 { font-size: var(--step-3); margin-top: 2.2em; scroll-margin-top: 1rem; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.answer { font-size: 1.2rem; line-height: 1.6; border-left: 6px solid var(--tape); padding: .25rem 0 .25rem 1.25rem; margin: 0 0 2rem; }
.figure { margin: 2rem 0; }
.figure svg { width: 100%; height: auto; }
.figure figcaption { font-size: var(--step--1); color: var(--ink-2); margin-top: .5rem; }

.steps { list-style: none; padding: 0; margin: 1.5rem 0; counter-reset: step; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 3.25rem 1fr; gap: 1rem; padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.steps > li::before {
  content: counter(step);
  font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 2.4rem; line-height: 1;
  width: 3rem; height: 3rem; display: grid; place-items: center;
  background: var(--tape); border: 2px solid var(--ink); border-radius: 3px;
}
.steps h3 { margin: .2rem 0 .4rem; font-size: 1.35rem; }
.steps p { margin: 0 0 .5rem; }
.tip { font-size: .98rem; background: var(--paper-2); padding: .7rem .9rem; border-radius: 3px; margin-top: .5rem; }

.materials { list-style: none; padding: 0; margin: 1rem 0 2rem; border-top: 2px solid var(--ink); }
.materials li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.materials li span:last-child { color: var(--ink-2); text-align: right; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 1rem; }
caption { text-align: left; font-family: var(--display); font-stretch: 85%; font-weight: 700; font-size: 1.1rem; padding-bottom: .5rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-family: var(--display); font-stretch: 90%; border-bottom: 2px solid var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.table-scroll { overflow-x: auto; }

.pick { border: 2px solid var(--ink); border-radius: 4px; padding: 1.25rem; background: var(--white); margin: 2rem 0; }
.pick .sample { display: inline-block; font-family: var(--display); font-stretch: 90%; font-weight: 700; font-size: .85rem; background: var(--paper-2); border: 1px dashed var(--ink-2); padding: .1rem .5rem; border-radius: 2px; margin-bottom: .6rem; }
.pick h3 { margin: 0 0 .4rem; }
.pick p { font-size: 1rem; }

.faq details { border-top: 1px solid var(--rule); padding: .9rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { font-family: var(--display); font-stretch: 85%; font-weight: 700; font-size: 1.2rem; 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-size: 1.5rem; line-height: 1; color: var(--green); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: .6rem 0 0; }

.sidebar { position: relative; }
.sidebar-inner { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; }
.toc { border-top: 2px solid var(--ink); padding-top: .8rem; }
.toc h2 { font-size: 1.2rem; font-stretch: 85%; margin-bottom: .5rem; }
.toc ol { margin: 0; padding-left: 1.2rem; font-family: var(--display); font-stretch: 90%; }
.toc li { margin: .3rem 0; }
.side-guide { background: var(--green); color: var(--white); padding: 1.25rem; border-radius: 4px; }
.side-guide h2 { color: var(--white); font-size: 1.5rem; }
.side-guide p { color: #d7e2da; font-size: .98rem; }

/* ---------- Guide page ---------- */
.guide-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.guide-hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.signup-card { background: var(--white); border: 2px solid var(--ink); border-radius: 4px; padding: clamp(1.25rem, 3vw, 2rem); box-shadow: 6px 6px 0 var(--green); }
.signup-card h2 { font-size: var(--step-2); }
.contents { list-style: none; padding: 0; margin: 0; counter-reset: ch; border-top: 2px solid var(--ink); }
.contents li { counter-increment: ch; display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.contents li::before { content: "Ch. " counter(ch); font-family: var(--display); font-stretch: 85%; font-weight: 700; color: var(--green); padding-top: .2rem; }
.contents h3 { margin: 0 0 .3rem; font-size: 1.35rem; }
.contents p { margin: 0; color: var(--ink-2); }
.checklist-preview { background: var(--white); border: 2px solid var(--ink); border-radius: 4px; padding: 1.5rem; }
.checklist-preview ul { list-style: none; padding: 0; margin: 0; }
.checklist-preview li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--rule); }
.checklist-preview li::before { content: ""; width: 1.1rem; height: 1.1rem; border: 2px solid var(--ink); border-radius: 2px; margin-top: .3rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cfd4cc; padding: 3rem 0 2.5rem; font-size: .95rem; }
.site-footer a { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.6fr; gap: 2rem; }
.site-footer h2 { color: var(--white); font-size: 1.2rem; font-stretch: 85%; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .3rem 0; }
.disclosure { border-left: 4px solid var(--tape); padding-left: 1rem; }
.fine { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #3c4446; font-size: .85rem; color: #9ea59c; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .guide-band .wrap, .guide-hero .wrap, .section-head, .footer-grid, .article-layout, .topic-section { grid-template-columns: 1fr; }
  .hero-art { max-width: 520px; }
  .sidebar-inner { position: static; }
  .topics a { grid-template-columns: 48px 1fr; gap: .4rem 1rem; }
  .topics a p { grid-column: 2; }
  .topics a .count { grid-column: 2; }
  .article-list a { grid-template-columns: 1fr; gap: .2rem; }
}
@media (max-width: 520px) {
  .site-header .wrap { padding-top: .6rem; padding-bottom: .6rem; }
  .nav { width: 100%; justify-content: space-between; }
  .nav .btn { padding: .4rem .7rem; }
  .steps > li { grid-template-columns: 2.6rem 1fr; }
  .steps > li::before { width: 2.4rem; height: 2.4rem; font-size: 1.8rem; }
  .materials li { flex-direction: column; gap: 0; }
  .materials li span:last-child { text-align: left; }
  .contents li { grid-template-columns: 1fr; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
