:root {
  --bg: #faf8f4;
  --bg-elev: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #5f5b54;
  --ink-faint: #9a9489;
  --black: #1f1f1f;
  --walnut: #8a5a36;
  --walnut-soft: #c9a47a;
  --border: #e5dfd2;
  --border-soft: #efeae0;
  --warn: #b8651b;
  --warn-bg: #fbf2e6;
  --info: #2a6e8a;
  --info-bg: #e8f1f5;
  --ok: #466e3b;
  --ok-bg: #ecf1e6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 6px;
  --max: 760px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; margin-top: 2.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }

p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }

code, kbd {
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 0.92em;
  background: var(--border-soft);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink);
}

dfn[title] {
  border-bottom: 1px dotted var(--ink-muted);
  cursor: help;
  font-style: normal;
  font-weight: 500;
}

/* Layout */

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

header.site {
  background: var(--black);
  color: #f3eee5;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}

header.site .brand {
  font-family: "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #f3eee5;
  text-decoration: none;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
header.site .brand::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  background: var(--walnut);
  border-radius: 2px;
  border-bottom: 3px solid #2c2c2c;
}

header.site nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
header.site nav a {
  color: #d4ccbf;
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius);
  transition: background 120ms, color 120ms;
}
header.site nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
header.site nav a[aria-current="page"] {
  background: var(--walnut);
  color: #fff;
}

main { padding: 2rem 0 4rem; }

/* Hero */

.hero {
  margin: 0 -1.25rem 2rem;
  position: relative;
  overflow: hidden;
}
.hero img {
  width: 100%;
  display: block;
  border-bottom: 1px solid var(--border);
}
.hero-caption {
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding: 0.5rem 1.25rem;
  text-align: center;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

/* Cards & grids */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}
.stat .value {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
}
.stat .sub { font-size: 0.8rem; color: var(--ink-faint); margin-top: 0.1rem; }

.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 2rem 0;
}
.cta-grid a {
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 150ms, box-shadow 150ms;
}
.cta-grid a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.cta-grid a .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--walnut);
}
.cta-grid a .title {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.15rem 0 0.25rem;
}
.cta-grid a .blurb {
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Callouts */

.callout {
  border-left: 3px solid var(--ink-muted);
  background: var(--bg-elev);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--ink-muted);
}
.callout.plain-english {
  border-left-color: var(--info);
  background: var(--info-bg);
}
.callout.plain-english .label { color: var(--info); }
.callout.gotcha {
  border-left-color: var(--warn);
  background: var(--warn-bg);
}
.callout.gotcha .label { color: var(--warn); }
.callout.tip {
  border-left-color: var(--ok);
  background: var(--ok-bg);
}
.callout.tip .label { color: var(--ok); }

/* Shopping list table */

.cost-summary {
  position: sticky;
  top: 60px;
  background: var(--black);
  color: #f3eee5;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  margin: 1rem 0 2rem;
  z-index: 5;
}
.cost-summary .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #c9c2b3;
}
.cost-summary .total {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin-top: 0.2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cost-summary .hint {
  font-size: 0.78rem;
  color: var(--walnut-soft);
  margin-top: 0.35rem;
}

.shop-section {
  margin: 1.5rem 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.shop-section h3 {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--border-soft);
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
  font-weight: 600;
}
.shop-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: start;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-soft);
}
.shop-item:last-child { border-bottom: none; }
.shop-item input[type="checkbox"] {
  margin-top: 0.3rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--walnut);
}
.shop-item label {
  cursor: pointer;
  user-select: none;
}
.shop-item .name {
  font-weight: 500;
  line-height: 1.4;
}
.shop-item .qty {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.1rem;
}
.shop-item .note {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-top: 0.25rem;
  line-height: 1.45;
}
.shop-item .cost {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  padding-top: 0.15rem;
}
.shop-item.unchecked {
  opacity: 0.5;
}
.shop-item.unchecked .cost {
  text-decoration: line-through;
  color: var(--ink-faint);
}

/* Image gallery + figure */

.gallery-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.gallery-2 figure { margin: 0; }
.gallery-2 img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.gallery-2 figcaption {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  line-height: 1.45;
  text-align: center;
}
@media (max-width: 540px) {
  .gallery-2 { grid-template-columns: 1fr; }
}

figure.full {
  margin: 1.5rem 0;
}
figure.full img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
figure.full figcaption {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  line-height: 1.45;
  font-style: italic;
}

/* Build guide steps */

.phase {
  margin: 2rem 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.phase h2 {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--black);
  color: #f3eee5;
  font-size: 1.15rem;
  font-family: "Iowan Old Style", Georgia, serif;
}
.phase .phase-image {
  position: relative;
  margin: 0;
  background: var(--black);
}
.phase .phase-image img {
  width: 100%;
  display: block;
  max-height: 280px;
  object-fit: cover;
  opacity: 0.93;
}
.phase h2 .duration {
  font-size: 0.85rem;
  font-weight: normal;
  color: var(--walnut-soft);
  font-family: inherit;
  margin-left: 0.5rem;
}
.phase .phase-body { padding: 1.25rem; }

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.step:last-child { border-bottom: none; }
.step input[type="checkbox"] {
  margin-top: 0.3rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--walnut);
}
.step .step-num {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 0.85rem;
  color: var(--walnut);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.step .step-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.step .step-body { font-size: 0.95rem; line-height: 1.55; }
.step.done .step-title,
.step.done .step-body { text-decoration: line-through; color: var(--ink-faint); }
.step.done .step-num { opacity: 0.5; }

.progress-bar {
  background: var(--border-soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-bar .fill {
  background: var(--walnut);
  height: 100%;
  width: 0%;
  transition: width 250ms;
}

.reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
}
.reset-btn:hover { background: var(--border-soft); color: var(--ink); }

/* Reference: dimensions table */

.dim-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 1rem 0;
}
.dim-table th, .dim-table td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.95rem;
}
.dim-table th {
  background: var(--border-soft);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}
.dim-table tr:last-child td { border-bottom: none; }
.dim-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* Glossary */

.glossary dt {
  font-weight: 600;
  color: var(--ink);
  margin-top: 1rem;
}
.glossary dd {
  margin: 0.2rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  padding-left: 0;
}

/* Footer */

footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 0 2rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
  text-align: center;
}

/* Mobile */

@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.2rem; }
  header.site .wrap { padding-top: 0.5rem; padding-bottom: 0.5rem; }
  header.site .brand { font-size: 0.95rem; }
  header.site nav a { font-size: 0.85rem; padding: 0.25rem 0.5rem; }
  .cost-summary { top: 50px; }
  .shop-item { grid-template-columns: auto 1fr; }
  .shop-item .cost { grid-column: 2; padding-top: 0; margin-top: 0.25rem; }
}

/* Print */

@media print {
  header.site, .cta-grid, .reset-btn, footer { display: none; }
  body { background: #fff; }
  .hero, .phase-image, .gallery-2, figure.full { display: none; }
  .cost-summary { position: static; background: #000; color: #fff; }
  .phase, .shop-section, .stat, .dim-table {
    box-shadow: none;
    border: 1px solid #999;
    page-break-inside: avoid;
  }
  .callout { page-break-inside: avoid; }
  a { color: #000; text-decoration: none; }
  main { padding: 0; }
}
