/* PALLET & PLANE layout + components. Consumes tokens.css only.
   Order: base > shared roles > shopbar > toolwall > bench (the mechanic) >
   stations > rack > boards > shopway > toolchest > jig form > footer > offcut. */

/* ---------- base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-grot);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-slab);
  line-height: var(--lh-heading);
  font-weight: 640;
  margin: 0 0 var(--s-4);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p { margin: 0 0 var(--s-4); }
img, svg { max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

::selection { background: var(--accent); color: var(--bg); }

/* anchored stations clear the sticky shopbar */
section[id] { scroll-margin-top: 5rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 0.05em 0.4em;
}

.skip-link {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  z-index: var(--z-skip);
  background: var(--walnut);
  color: var(--pine);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-1);
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- shared roles ---------- */
.floor {
  width: min(100% - var(--edge) * 2, var(--max-w));
  margin-inline: auto;
}

.shopnote {
  font-family: var(--font-grot);
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: var(--track-note);
  text-transform: uppercase;
  color: var(--muted);
}
.shopnote--accent { color: var(--accent); }

.notes {
  max-width: var(--measure);
  color: var(--fg);
}
.notes--muted { color: var(--muted); }

.dims {
  font-variant-numeric: tabular-nums;
  font-size: var(--t-small);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.peg {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-grot);
  font-size: var(--t-small);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--fg);
  border-radius: var(--r-1);
  padding: 0.85em 1.6em;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-settle), color var(--dur-1) var(--ease-settle);
}
.peg:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="walnut"] .peg:hover { color: var(--walnut); }
.peg--ghost { background: transparent; color: var(--fg); }
.peg--ghost:hover { background: var(--fg); color: var(--bg); }

.shopchip {
  display: inline-block;
  font-family: var(--font-grot);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: var(--r-tag);
  padding: 0.15em 0.7em;
  vertical-align: middle;
}

.grain-line {
  font-size: var(--t-small);
  color: var(--muted);
  border-left: 3px solid var(--accent);
  padding-left: var(--s-3);
  margin: var(--s-3) 0 0;
}
.grain-line strong {
  color: var(--fg);
  font-weight: 700;
}

.kerf { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* drawing palette: SVG stock and rule classes. Presentation attributes cannot
   resolve custom properties, so every fill and stroke in a drawing is a class. */
.stock-ash { fill: var(--wood-ash); }
.stock-oak { fill: var(--wood-oak); }
.stock-cherry { fill: var(--wood-cherry); }
.stock-walnut { fill: var(--wood-walnut); }
.stock-maple { fill: var(--wood-maple); }
.stock-steel { fill: #8a8d92; }
.stock-ink { fill: var(--walnut); }
.grain-hair { fill: none; stroke: rgba(49, 38, 26, 0.3); stroke-width: 1.2; }
.edge-shade { fill: rgba(49, 38, 26, 0.16); }
.cut-line { stroke: var(--fg); }
.cut-line--only { fill: none; stroke: var(--fg); }
.rule-hair { fill: none; stroke: var(--line-strong); }
.dim-line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.dim-text { fill: var(--accent); font-family: var(--font-grot); font-size: 13px; font-weight: 700; }
.note-text { fill: var(--muted); font-family: var(--font-grot); font-size: 12px; }
.shaving { fill: none; stroke-width: 6; stroke-linecap: round; }
.shaving--oak { stroke: var(--wood-oak); }
.shaving--ash { stroke: var(--wood-ash); }

/* ---------- shopbar (header) ---------- */
.shopbar {
  position: sticky;
  top: 0;
  z-index: var(--z-shopbar);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.shopbar-row {
  width: min(100% - var(--edge) * 2, var(--max-w));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-3) 0;
}
.shopbar-brand {
  font-family: var(--font-slab);
  font-weight: 760;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.shopbar-brand svg { width: 26px; height: 26px; flex: none; }
.shopbar-nav {
  display: flex;
  gap: var(--s-5);
  margin-left: auto;
}
.shopbar-nav a {
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: none;
  color: var(--muted);
}
.shopbar-nav a:hover,
.shopbar-nav a[aria-current="true"] { color: var(--fg); }
.shopbar .peg { padding: 0.6em 1.2em; }
.toolwall-btn {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--fg);
  font: inherit;
  font-size: var(--t-small);
  font-weight: 700;
  padding: 0.5em 1em;
  cursor: pointer;
  margin-left: auto;
}
@media (max-width: 760px) {
  .shopbar-nav, .shopbar .peg { display: none; }
  .toolwall-btn { display: inline-block; }
}

/* ---------- toolwall (menu overlay) ---------- */
.toolwall {
  position: fixed;
  inset: 0;
  z-index: var(--z-toolwall);
  background: var(--bg);
  color: var(--fg);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--s-6) + env(safe-area-inset-top)) var(--edge) var(--s-7);
}
.toolwall.is-open { display: flex; }
.toolwall nav {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin-top: var(--s-7);
}
.toolwall nav a {
  font-family: var(--font-slab);
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 680;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--s-3);
}
.toolwall nav a .shopnote { margin-right: var(--s-3); }
.toolwall-close {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  padding: 0.5em 1.2em;
  cursor: pointer;
}

/* ---------- the bench (hero mechanic) ---------- */
.bench { padding-top: clamp(2.5rem, 6vh, 4.5rem); }
.bench-head { margin-bottom: var(--s-6); }
.bench-head h1 {
  font-size: var(--t-display);
  font-weight: 760;
  max-width: 21ch;
  margin-bottom: var(--s-4);
}
.bench-head .notes { font-size: var(--t-lead); }
.bench-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-5);
}

.bench-scene {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  /* the benchtop: pine boards laid lengthwise */
  background:
    repeating-linear-gradient(90deg,
      rgba(49, 38, 26, 0) 0 118px,
      rgba(49, 38, 26, 0.16) 118px 120px),
    repeating-linear-gradient(88deg,
      rgba(49, 38, 26, 0.045) 0 7px,
      rgba(49, 38, 26, 0) 7px 23px),
    linear-gradient(90deg, var(--pine-2), var(--pine-3));
}
.bench-scene::after {
  /* raking window light across the benchtop */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 250, 235, 0.35), rgba(49, 38, 26, 0.12) 78%);
}

.bench-piece {
  position: absolute;
  display: block;
  text-decoration: none;
  transition: filter var(--dur-1) var(--ease-settle);
  will-change: transform;
}
.bench-piece svg { display: block; width: 100%; height: auto; }
.bench-piece:hover, .bench-piece:focus-visible { filter: brightness(1.06); }
.bench-piece:hover .piece-tag, .bench-piece:focus-visible .piece-tag {
  background: var(--accent);
  color: #fff;
}
.piece-shape { filter: drop-shadow(0 6px 9px rgba(49, 38, 26, 0.28)); }
.piece-tag {
  position: absolute;
  left: 50%;
  bottom: -0.5em;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--pine);
  color: var(--walnut);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2em 0.65em;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(49, 38, 26, 0.2);
  transition: background var(--dur-1), color var(--dur-1);
}

.bench-tool { position: absolute; pointer-events: none; }
.bench-tool svg { display: block; width: 100%; height: auto; }

/* piece placement, desktop bench */
.bench-piece--stool   { left: 6%;  top: 14%; width: 21%; }
.bench-piece--board   { left: 33%; top: 46%; width: 26%; }
.bench-piece--box     { left: 66%; top: 12%; width: 17%; }
.bench-piece--shelf   { left: 62%; top: 56%; width: 30%; }
.bench-piece--lowbench{ left: 9%;  top: 60%; width: 20%; }
.bench-tool--plane    { left: 44%; top: 10%; width: 15%; }
.bench-tool--square   { left: 28%; top: 15%; width: 9%; }
.bench-tool--pencil   { left: 51%; top: 82%; width: 12%; }
.bench-tool--shaving  { left: 88%; top: 40%; width: 7%; }
.bench-tool--shaving2 { left: 2%;  top: 44%; width: 6%; }

@media (max-width: 760px) {
  .bench-scene { aspect-ratio: 3 / 4; }
  .bench-piece--stool   { left: 6%;  top: 4%;  width: 42%; }
  .bench-piece--board   { left: 52%; top: 8%;  width: 44%; }
  .bench-piece--box     { left: 58%; top: 40%; width: 34%; }
  .bench-piece--shelf   { left: 4%;  top: 66%; width: 58%; }
  .bench-piece--lowbench{ left: 8%;  top: 34%; width: 38%; }
  .bench-tool--plane    { left: 66%; top: 74%; width: 28%; }
  .bench-tool--square, .bench-tool--pencil { display: none; }
  .bench-tool--shaving  { left: 44%; top: 52%; width: 12%; }
  .bench-tool--shaving2 { display: none; }
}

.bench-hint {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-top: var(--s-3);
}

/* ---------- buildcard (piece dialog) ---------- */
.buildcard-scrim {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-buildcard) - 1);
  background: rgba(49, 38, 26, 0.55);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.buildcard-scrim[hidden] { display: none; }

.buildcard {
  position: fixed;
  z-index: var(--z-buildcard);
  inset: auto var(--s-4) var(--s-4);
  margin-inline: auto;
  max-width: 26rem;
  max-height: min(80vh, 34rem);
  overflow: auto;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-card);
  padding: var(--s-5);
}
.buildcard[hidden] { display: none; }
@media (min-width: 761px) {
  .buildcard { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(92vw, 26rem); }
}
.buildcard-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-3);
}
.buildcard-head h3 { margin: 0; font-size: var(--t-h3); }
.buildcard-close {
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  color: var(--fg);
  font: inherit;
  font-size: var(--t-note);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4em 0.9em;
  cursor: pointer;
  flex: none;
}
.buildcard .dims { display: block; margin-bottom: var(--s-3); }
.buildcard-price {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-slab);
  font-weight: 700;
  font-size: 1.15rem;
  margin: var(--s-4) 0;
}
.buildcard-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-4); }

/* ---------- stations (section contract) ---------- */
.station { padding-block: var(--station-pad); }
.station--flush { padding-block: 0; }
.station--kerf { border-top: 1px solid var(--line); }
.station[data-theme="walnut"] { background: var(--bg); color: var(--fg); }
.station-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-3) var(--s-5);
  margin-bottom: var(--s-7);
}
.station-head h2 { font-size: var(--t-h2); margin: 0; }
.station-head .shopnote { flex: none; }

/* ---------- the rack (catalog list) ---------- */
.rack { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.rack-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) auto;
  gap: var(--s-3) var(--s-6);
  align-items: start;
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--line);
}
.rack-row h3 { margin-bottom: var(--s-2); font-size: var(--t-h3); }
.rack-row h3 a { text-decoration: none; }
.rack-row h3 a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.rack-desc { font-size: var(--t-small); color: var(--muted); max-width: 34rem; }
.rack-price {
  text-align: right;
  font-family: var(--font-slab);
  font-weight: 700;
  white-space: nowrap;
}
.rack-price .shopchip { margin-left: var(--s-2); }
.rack-order {
  display: block;
  font-size: var(--t-small);
  font-weight: 700;
  color: var(--accent);
  margin-top: var(--s-2);
}
@media (max-width: 760px) {
  .rack-row { grid-template-columns: 1fr; }
  .rack-price { text-align: left; }
}

/* ---------- boards (materials story) ---------- */
.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--s-6);
}
.board-swatch {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--bg-2);
}
.board-swatch-face { height: 7rem; }
.board-swatch-body { padding: var(--s-4) var(--s-5) var(--s-5); }
.board-swatch h3 { font-size: 1.1rem; margin-bottom: var(--s-2); }
.board-swatch p { font-size: var(--t-small); color: var(--muted); margin: 0; }

/* ---------- shopway (process) ---------- */
.shopway { list-style: none; margin: 0; padding: 0; counter-reset: waypoint; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s-6); }
.waypoint {
  counter-increment: waypoint;
  border-top: 3px solid var(--line-strong);
  padding-top: var(--s-4);
}
.waypoint::before {
  content: "Pass 0" counter(waypoint);
  display: block;
  font-size: var(--t-note);
  font-weight: 800;
  letter-spacing: var(--track-note);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.waypoint h3 { font-size: var(--t-h3); }
.waypoint p { font-size: var(--t-small); color: var(--muted); }
.waypoint .dims { display: block; margin-top: var(--s-3); color: var(--fg); }

/* ---------- toolchest (Q&A drawers) ---------- */
.toolchest { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.drawer { border-bottom: 1px solid var(--line); }
.drawer h3 { margin: 0; }
.drawer-pull {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  background: none;
  border: 0;
  color: var(--fg);
  font-family: var(--font-slab);
  font-size: var(--t-h3);
  font-weight: 640;
  text-align: left;
  padding: var(--s-5) 0;
  cursor: pointer;
}
.drawer-pull .shopnote--accent { flex: none; }
.drawer-pull .drawer-title { flex: 1; }
.drawer-slot {
  flex: none;
  width: 1.6rem;
  height: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-tag);
  position: relative;
  transition: background var(--dur-2) var(--ease-settle);
}
.drawer-pull[aria-expanded="true"] .drawer-slot { background: var(--accent); border-color: var(--accent); }
.drawer-bed { overflow: hidden; }
.drawer-bed-inner { padding: 0 0 var(--s-5); max-width: var(--measure); color: var(--muted); }

/* ---------- jig (commission form) ---------- */
.jig-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--s-8);
  align-items: start;
}
@media (max-width: 900px) { .jig-grid { grid-template-columns: 1fr; } }

.jig-field { margin-bottom: var(--s-5); }
.jig-field label {
  display: block;
  font-size: var(--t-note);
  font-weight: 800;
  letter-spacing: var(--track-note);
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}
.jig-field input,
.jig-field select,
.jig-field textarea {
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  font: inherit;
  padding: 0.7em 0.9em;
}
.jig-field textarea { min-height: 9rem; resize: vertical; }
.jig-field.is-invalid input,
.jig-field.is-invalid textarea { border-color: #8c3222; }
.jig-hint { font-size: var(--t-small); color: var(--muted); margin: var(--s-2) 0 0; }
.jig-error { font-size: var(--t-small); font-weight: 700; color: #8c3222; margin: var(--s-2) 0 0; }
[data-theme="walnut"] .jig-field.is-invalid input,
[data-theme="walnut"] .jig-field.is-invalid textarea { border-color: #e08a70; }
[data-theme="walnut"] .jig-error { color: #e08a70; }

/* the sure path when no script runs: shown only while html has no .js class */
.jig-nojs { display: none; }
html:not(.js) .jig-nojs {
  display: block;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
  font-size: var(--t-small);
}
html:not(.js) .jig-nojs a { color: var(--fg); text-underline-offset: 3px; }

.jig-errors {
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--r-1);
  padding: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
}
.jig-errors p { margin-bottom: var(--s-2); }
.jig-errors ul { margin: 0; padding-left: 1.2em; }
.jig-errors a { color: var(--fg); }

.zvq-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.jig-status { min-height: 1.5em; font-weight: 600; }
.jig-fallback {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-1);
  padding: var(--s-4);
  margin-bottom: var(--s-5);
}
.jig-fallback textarea {
  width: 100%;
  font: inherit;
  font-size: var(--t-small);
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: var(--s-3);
  margin: var(--s-3) 0;
}
.jig-fallback-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); }

.jig-aside .dims { display: block; margin-bottom: var(--s-4); }
.jig-aside ol {
  list-style: none;
  margin: 0 0 var(--s-6);
  padding: 0;
}
.jig-aside ol li {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-small);
}
.jig-aside ol .shopnote--accent { flex: none; }

/* ---------- footer ---------- */
.shopfloor {
  border-top: 1px solid var(--line);
  padding: var(--s-8) 0 var(--s-6);
}
.shopfloor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--s-6);
  margin-bottom: var(--s-7);
}
.shopfloor h3 {
  font-family: var(--font-grot);
  font-size: var(--t-note);
  font-weight: 800;
  letter-spacing: var(--track-note);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-3);
}
.shopfloor ul { list-style: none; margin: 0; padding: 0; }
.shopfloor ul li { margin-bottom: var(--s-2); }
.shopfloor a { text-decoration: none; font-size: var(--t-small); }
.shopfloor a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.shopfloor .notes { font-size: var(--t-small); color: var(--muted); }
.shopfloor-weights {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  font-size: var(--t-note);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: var(--s-4);
  margin-bottom: var(--s-4);
}
.shopfloor-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3) var(--s-5);
  font-size: var(--t-small);
  color: var(--muted);
}
.shopfloor-legal a { color: inherit; }

/* ---------- banner (interior pages) ---------- */
.banner { padding: var(--s-8) 0 var(--s-6); border-bottom: 1px solid var(--line); }
.banner nav { font-size: var(--t-small); color: var(--muted); margin-bottom: var(--s-4); }
.banner nav a { color: inherit; }
.banner h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); margin: 0; }

/* ---------- piece page ---------- */
.drawing-frame {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--bg-2);
  padding: var(--s-5);
  margin-bottom: var(--s-6);
}
.drawing-frame figcaption { font-size: var(--t-small); color: var(--muted); margin-top: var(--s-3); }
.cutlist { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.cutlist caption {
  text-align: left;
  font-family: var(--font-slab);
  font-weight: 700;
  font-size: 1.05rem;
  padding-bottom: var(--s-3);
}
.cutlist th, .cutlist td {
  text-align: left;
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  border-bottom: 1px solid var(--line);
}
.cutlist th {
  font-size: var(--t-note);
  letter-spacing: var(--track-note);
  text-transform: uppercase;
  color: var(--muted);
}
.cutlist td:last-child { font-variant-numeric: tabular-nums; }
.piece-cols {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--s-8);
  align-items: start;
}
@media (max-width: 900px) { .piece-cols { grid-template-columns: 1fr; } }
.piece-order {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: var(--s-5);
  background: var(--bg-2);
  position: sticky;
  top: 5rem;
}
.piece-order .buildcard-price { margin-top: 0; }

/* ---------- offcut (404) ---------- */
.offcut-bin {
  min-height: 70vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: var(--s-8) var(--edge);
}
.offcut-bin h1 { font-size: clamp(2.4rem, 7vw, 5rem); }
.offcut-bin .peg { justify-self: center; }
.offcut-acts { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: center; margin-top: var(--s-5); }
.offcut-mark { margin: 0 auto var(--s-5); width: clamp(7rem, 20vw, 11rem); }

/* ---------- styleguide ---------- */
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--s-4); }
.sg-swatch { border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.sg-swatch-face { height: 5rem; }
.sg-swatch dl { margin: 0; padding: var(--s-3) var(--s-4); font-size: var(--t-small); }
.sg-swatch dt { font-weight: 700; }
.sg-swatch dd { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.sg-block { margin-bottom: var(--s-8); }
.sg-degrade { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.sg-degrade th, .sg-degrade td {
  text-align: left;
  vertical-align: top;
  padding: var(--s-3) var(--s-4) var(--s-3) 0;
  border-bottom: 1px solid var(--line);
}
.sg-degrade th { font-size: var(--t-note); letter-spacing: var(--track-note); text-transform: uppercase; color: var(--muted); }

/* ---------- settle reveals (motion) ---------- */
html.js .settle {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-3) var(--ease-settle), transform var(--dur-3) var(--ease-settle);
}
html.js .settle[data-delay="1"] { transition-delay: 90ms; }
html.js .settle[data-delay="2"] { transition-delay: 180ms; }
html.js .settle[data-delay="3"] { transition-delay: 270ms; }
html.js .settle.is-inview { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .settle {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .peg, .drawer-slot, .piece-tag, .bench-piece { transition: none; }
}
