:root {
  --bg: #1f2225;          /* workshop at dusk */
  --panel: #292d31;
  --text: #ebe6dd;        /* sawdust */
  --muted: #a9a49b;
  --rule: #3b4045;
  --pencil: #f4c430;      /* carpenter's pencil: the one accent */
  --paper: #f2f4f1;       /* drafting paper for the configurator */
  --grid: #d9e0e3;
  --ink: #24292e;
  --walnut: #6b4630;
  --demo-bg: #f4c430;
  --demo-fg: #1f2225;
  --demo-link: #1f2225;
  --side: 15.5rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Archivo", system-ui, sans-serif; font-size: 1.0625rem; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
h1, h2 { font-family: "Big Shoulders", "Archivo", sans-serif; font-weight: 800; letter-spacing: .005em; line-height: .95; }
h2 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); }
h3 { font-stretch: 112%; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 3.1rem; padding: 0 1.5rem; background: var(--pencil); color: var(--ink); border: 2px solid var(--pencil); border-radius: 3px; font: inherit; font-weight: 750; font-stretch: 110%; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #ffd84d; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: #e3e7e4; }

/* ---- Sidebar layout --------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2.5rem; padding: 2rem 1.75rem; border-right: 1px solid var(--rule); }
.logo { display: flex; align-items: center; gap: .75rem; text-decoration: none; font-weight: 820; font-stretch: 120%; font-size: 1.2rem; line-height: 1.1; }
.logo svg { width: 2.6rem; height: 2.6rem; flex: none; }
.logo rect { fill: var(--pencil); }
.logo path { stroke: var(--bg); stroke-width: 3.5; fill: none; stroke-linecap: round; }
.menu-toggle { display: none; }
.side-nav { display: flex; flex-direction: column; gap: .25rem; }
.side-nav a { text-decoration: none; font-weight: 650; font-size: 1.1rem; padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.side-nav a:not(.nav-cta):hover { color: var(--pencil); }
.side-nav .nav-cta { margin-top: 1.25rem; border: 2px solid var(--pencil); color: var(--pencil); text-align: center; padding: .65rem; border-radius: 3px; }
.side-nav .nav-cta:hover { background: var(--pencil); color: var(--ink); }
.side-contact { margin-top: auto; font-size: .95rem; color: var(--muted); }
.side-contact a { display: block; color: var(--text); font-weight: 750; font-size: 1.15rem; font-variant-numeric: tabular-nums; margin-bottom: .75rem; text-decoration-color: var(--pencil); text-underline-offset: 5px; }
.side-contact p { margin-bottom: .5rem; }

.content { min-width: 0; padding: 0 clamp(1.25rem, 4vw, 4rem); }

/* ---- Hero -------------------------------------------------------------- */
.hero { padding-block: clamp(3rem, 8vw, 6rem) 2.5rem; }
.measure { width: fit-content; max-width: 100%; }
.hero h1 { font-size: clamp(3.8rem, 10.5vw, 9.5rem); font-weight: 850; line-height: .88; max-width: 13ch; }
.dim { display: flex; align-items: center; gap: .6rem; margin: 1.75rem 0 2rem; width: var(--line-w, 100%); max-width: 100%; color: var(--pencil); }
.dim-line { flex: 1; height: 2px; background: currentColor; position: relative; animation: draw .9s cubic-bezier(.2, .7, .2, 1) .2s both; }
.dim-line:first-child::before, .dim-line:last-child::after { content: ""; position: absolute; top: -9px; width: 2px; height: 20px; background: currentColor; }
.dim-line:first-child::before { left: 0; }
.dim-line:last-child::after { right: 0; }
.dim-label { font-weight: 700; font-stretch: 90%; font-size: .95rem; font-variant-numeric: tabular-nums; animation: fade .4s ease .9s both; }
@keyframes draw { from { transform: scaleX(0); } }
@keyframes fade { from { opacity: 0; } }
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; }
.lead { font-size: 1.2rem; max-width: 36rem; color: #cfc9be; margin: 0; }

.strip { margin: 0 0 5rem; position: relative; }
.strip img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; filter: saturate(.9); }
.strip figcaption { position: absolute; left: 0; bottom: 0; background: var(--bg); padding: .6rem 1rem .6rem 0; font-size: .9rem; color: var(--muted); }

/* ---- Projects: horizontal track ----------------------------------------- */
.projects { margin-bottom: 5.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.75rem; }
.scroll-btns { display: flex; gap: .5rem; }
.scroll-btns button { width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid var(--rule); background: transparent; color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.scroll-btns button:hover { border-color: var(--pencil); color: var(--pencil); }
.project-track { list-style: none; margin: 0; padding: 0 0 1rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(17rem, 30%); gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-color: var(--rule) transparent; }
.project { scroll-snap-align: start; }
.project img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 3px; }
.project h3 { font-size: 1.25rem; font-weight: 720; margin: 1rem 0 .6rem; }
.sheet { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); }
.sheet div { padding: .5rem .5rem .5rem 0; }
.sheet div + div { padding-left: .6rem; border-left: 1px solid var(--rule); }
.sheet dt { font-size: .8rem; color: var(--muted); }
.sheet dd { margin: 0; font-weight: 650; font-size: .98rem; }

/* ---- Process as a measured timeline ---------------------------------------- */
.steps { margin-bottom: 5.5rem; }
.steps h2 { margin-bottom: 2.25rem; }
.timeline { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: 46rem; }
.timeline li { counter-increment: step; position: relative; display: grid; grid-template-columns: 3rem 1fr; column-gap: 1.5rem; padding-bottom: 2rem; }
.timeline li::before { content: counter(step); grid-row: 1 / span 2; text-align: center; font-family: "Big Shoulders", sans-serif; font-size: 2.8rem; font-weight: 300; line-height: 1; color: var(--pencil); }
.timeline li::after { content: ""; position: absolute; left: 1.5rem; top: 3.3rem; bottom: .6rem; width: 1px; background: repeating-linear-gradient(to bottom, var(--muted) 0 6px, transparent 6px 12px); }
.timeline li:last-child::after { display: none; }
.timeline h3 { font-size: 1.3rem; margin-bottom: .4rem; grid-column: 2; }
.timeline p { grid-column: 2; color: var(--muted); margin: 0; }

.workshop { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; margin-bottom: 5.5rem; padding: clamp(1.5rem, 3vw, 2.5rem); background: var(--panel); border-radius: 4px; }
.workshop img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; }
.workshop h2 { margin-bottom: 1rem; }
.workshop p { color: #cfc9be; }

/* ---- Configurator on drafting paper ---------------------------------------- */
.request { margin-bottom: 4rem; }
.request-intro { color: var(--muted); margin: .75rem 0 2rem; }
.configurator { color: var(--ink); border-radius: 4px; padding: clamp(1.25rem, 3vw, 2.25rem);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px; }
.progress { list-style: none; display: flex; gap: .5rem; margin: 0 0 1.75rem; padding: 0; counter-reset: p; }
.progress li { counter-increment: p; flex: 1; font-size: .9rem; font-weight: 650; color: #6a7076; padding-top: .55rem; border-top: 4px solid #cfd6d9; }
.progress li::before { content: counter(p) " "; }
.progress li.is-active, .progress li.is-done { color: var(--ink); border-top-color: var(--pencil); }
.config-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: start; }
.pane { display: none; border: 0; margin: 0; padding: 0; min-width: 0; }
.pane.is-active { display: block; }
legend, .pane-done h3 { font-size: 1.45rem; font-weight: 760; font-stretch: 112%; margin-bottom: 1.25rem; padding: 0; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; }
.choice, .wood { position: relative; display: flex; align-items: center; gap: .7rem; min-height: 3.25rem; padding: .6rem .9rem; border: 2px solid #c3cbcf; border-radius: 3px; background: #fff; cursor: pointer; font-weight: 600; }
.choice input, .wood input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice:has(input:checked), .wood:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fff8d6; }
.choice:has(input:focus-visible), .wood:has(input:focus-visible) { outline: 3px solid var(--pencil); outline-offset: 2px; }
.wood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .6rem; }
.swatch { width: 1.9rem; height: 1.9rem; border-radius: 3px; background: var(--wood); border: 1px solid rgba(0, 0, 0, .18); flex: none; background-image: repeating-linear-gradient(100deg, rgba(0, 0, 0, .07) 0 2px, transparent 2px 7px); }
.swatch-oak { --wood: #c49a62; }
.swatch-walnut { --wood: #6b4630; }
.swatch-ash { --wood: #e3d2b0; }
.swatch-white { --wood: #f3f3f0; }
.swatch-unsure { background: repeating-linear-gradient(45deg, #ddd 0 6px, #fff 6px 12px); }
.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.configurator label { font-weight: 650; font-size: .95rem; }
.unit-input { display: flex; align-items: center; margin-top: .35rem; border: 2px solid #c3cbcf; border-radius: 3px; background: #fff; }
.unit-input:focus-within { border-color: var(--ink); }
.unit-input input { width: 100%; min-width: 0; border: 0; padding: .7rem .6rem; font: inherit; font-size: 1.15rem; font-variant-numeric: tabular-nums; background: transparent; }
.unit-input input:focus { outline: none; }
.unit-input span { padding-right: .7rem; color: #6a7076; }
.hint { color: #5c6166; margin-top: 1rem; font-size: .95rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.fields .full { grid-column: 1 / -1; }
.fields input, .fields textarea { display: block; width: 100%; margin-top: .35rem; padding: .75rem; font: inherit; font-weight: 400; border: 2px solid #c3cbcf; border-radius: 3px; background: #fff; }
.fields input:focus, .fields textarea:focus { outline: none; border-color: var(--ink); }
.fields input[aria-invalid="true"] { border-color: #b3261e; }
.optional { font-weight: 400; color: #6a7076; }
.form-error { color: #b3261e; font-weight: 650; margin-top: 1rem; }
.pane-done:focus { outline: none; }
.summary { font-weight: 650; }
.demo-note { background: #fff8d6; border-left: 4px solid var(--pencil); padding: .8rem 1rem; color: #3a3f44; }
.sketch { margin: 0; background: rgba(255, 255, 255, .75); border: 1px solid #c3cbcf; border-radius: 3px; padding: 1rem; }
.sketch svg { width: 100%; height: auto; display: block; }
.sketch figcaption { font-size: .9rem; color: #5c6166; margin-top: .5rem; text-align: center; }
.sketch .body { transition: fill .3s; }
.sketch .dimtext { font: 650 13px "Archivo", sans-serif; font-variant-numeric: tabular-nums; fill: var(--walnut); }
.sketch .dimline { stroke: var(--walnut); stroke-width: 1.5; }
.config-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid #c3cbcf; }
.config-nav #next { margin-left: auto; background: var(--ink); border-color: var(--ink); color: #fff; }
.config-nav #next:hover { background: #000; }
.pane-done .btn-ghost { margin-top: .5rem; }

.site-footer { border-top: 1px solid var(--rule); padding-block: 2rem 3rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 3rem; color: var(--muted); font-size: .95rem; }
.site-footer .demo-footer-note { max-width: 32rem; }

/* ---- Small screens: sidebar becomes a top bar ------------------------------ */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0; padding: .75rem 1.25rem; background: var(--bg); border-right: 0; border-bottom: 1px solid var(--rule); }
  .logo { font-size: 1rem; }
  .logo svg { width: 2.1rem; height: 2.1rem; }
  .logo br { display: none; }
  .menu-toggle { display: block; font: inherit; font-weight: 700; color: var(--text); background: none; border: 2px solid var(--rule); border-radius: 3px; padding: .45rem .9rem; cursor: pointer; }
  .side-nav { display: none; width: 100%; padding: 1rem 0 .5rem; }
  .side-nav.is-open { display: flex; }
  .side-contact { display: none; }
  .project-track { grid-auto-columns: minmax(15rem, 70%); }
  .workshop, .config-body { grid-template-columns: 1fr; }
  .sketch { order: -1; }
  .strip img { aspect-ratio: 16 / 9; }
}
@media (max-width: 560px) {
  .scroll-btns { display: none; }
  .fields { grid-template-columns: 1fr; }
  .dims { gap: .5rem; }
  .unit-input input { font-size: 1rem; padding: .6rem .4rem; }
  .timeline li { column-gap: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dim-line, .dim-label { animation: none; }
}
