/* Offcut Bin — birch ply, carpenter graphite, chalk-line blue */

:root {
  --birch: #DCC08F;
  --edge: #A8773F;
  --graphite: #2B2A28;
  --chalk: #2C62C9;
  --sawdust: #F1E6CF;
  --graphite-soft: rgba(43, 42, 40, 0.74);

  --display: "Anybody", "Arial Narrow", sans-serif;
  --text: "Piazzolla", Georgia, serif;
  --hand: "Kalam", "Segoe Print", cursive;

  --gutter: clamp(1rem, 4vw, 3.25rem);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.0025 0.11' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.27 0 0 0 0 0.1 0 0 0 0.9 -0.28'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--birch);
  background-image: var(--grain);
  color: var(--graphite);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { color: var(--chalk); }

:focus-visible { outline: 3px solid var(--chalk); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--graphite);
  color: var(--sawdust);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus { top: 0.75rem; }

/* ---------- bench top (header) ---------- */

.bench-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter) 0;
}

.tape {
  display: inline-block;
  padding: 0.15rem 1.2rem 0.25rem;
  background: rgba(241, 230, 207, 0.92);
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.3;
  text-decoration: none;
  transform: rotate(-2.4deg);
  clip-path: polygon(0 8%, 3% 0, 6% 10%, 9% 2%, 91% 3%, 94% 0, 97% 9%, 100% 4%, 100% 92%, 97% 100%, 94% 90%, 91% 98%, 9% 97%, 6% 100%, 3% 91%, 0 96%);
  box-shadow: 0 1px 0 rgba(43, 42, 40, 0.08);
}
.tape:hover { color: var(--graphite); }

.bench-nav {
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 2rem);
  font-family: var(--display);
  font-variation-settings: "wdth" 72;
  font-weight: 650;
  font-size: 1rem;
}
.bench-nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.bench-nav a[aria-current="page"] { border-bottom-color: var(--chalk); }

/* ---------- hero: the week sheet ---------- */

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1rem;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3.5rem, 8vw, 6.5rem) var(--gutter);
}

.sheet-fig {
  grid-column: 3 / -1;
  grid-row: 1;
  margin: 0;
}
.sheet-fig svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 22px 26px rgba(43, 42, 40, 0.2));
}
.sheet-fig figcaption {
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--graphite-soft);
  max-width: 24ch;
  margin-left: auto;
  padding: 0.35rem var(--gutter) 0 0;
  text-align: right;
  line-height: 1.3;
}

.ply-face { fill: #E4CD9F; }
.ply-grain { opacity: 0.55; }
.sheet-edge { fill: none; stroke: var(--graphite); stroke-width: 2.5; }

.kerf line {
  stroke: var(--graphite);
  stroke-width: 2.2;
  stroke-linecap: square;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: cut 0.55s cubic-bezier(0.55, 0.05, 0.35, 1) var(--d, 0s) forwards;
}
@keyframes cut { to { stroke-dashoffset: 0; } }

.lbl {
  font-family: var(--display);
  font-variation-settings: "wdth" 62;
  font-weight: 750;
  font-size: 23px;
  letter-spacing: 0.02em;
  fill: var(--graphite);
}
.hrs { font-family: var(--hand); font-size: 20px; fill: var(--graphite-soft); }
.lbl-sm {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 16px;
  fill: var(--graphite);
  paint-order: stroke;
  stroke: #E4CD9F;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.dim { stroke: var(--graphite-soft); stroke-width: 1.2; fill: none; }
.dim-txt { font-family: var(--hand); font-size: 19px; fill: var(--graphite-soft); }

.piece .off { fill: url(#hatch); transition: fill-opacity 0.2s; }
.piece .tag { fill: var(--sawdust); stroke: var(--graphite); stroke-width: 1.5; transition: fill 0.2s, stroke 0.2s; }
.piece .tag-txt { font-family: var(--display); font-weight: 800; font-size: 15px; fill: var(--graphite); text-anchor: middle; }
.piece:hover .tag,
.piece:focus-visible .tag { fill: var(--chalk); stroke: var(--chalk); }
.piece:hover .tag-txt,
.piece:focus-visible .tag-txt { fill: var(--sawdust); }
.piece:focus-visible { outline: none; }
.piece:focus-visible .off { stroke: var(--chalk); stroke-width: 4; }

.hero__copy {
  grid-column: 1 / 9;
  grid-row: 2;
  margin-top: clamp(-10rem, -11vw, -2.5rem);
  padding-right: var(--gutter);
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 150;
  font-weight: 820;
  font-size: clamp(2.7rem, 8.4vw, 8.2rem);
  line-height: 0.88;
  letter-spacing: -0.012em;
  margin: 0;
}

.hero__lede {
  font-size: clamp(1.12rem, 1.55vw, 1.36rem);
  line-height: 1.5;
  max-width: 36ch;
  margin: 1.6rem 0 0 clamp(0rem, 8vw, 7rem);
}

/* ---------- cut list ---------- */

.cutlist {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1rem;
  padding: 0 var(--gutter) clamp(4rem, 9vw, 7rem);
}

.cutlist__head { grid-column: 1 / 4; align-self: start; position: sticky; top: 1.5rem; }
.cutlist__head h2 {
  font-family: var(--display);
  font-variation-settings: "wdth" 50;
  font-weight: 900;
  font-size: clamp(3.4rem, 8vw, 7rem);
  line-height: 0.82;
  text-transform: uppercase;
  margin: 0 0 0.9rem;
}
.cutlist__head p { margin: 0; max-width: 22ch; color: var(--graphite-soft); }

.cutsheet {
  grid-column: 4 / -1;
  background: var(--sawdust);
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.75rem);
  box-shadow: 0 1px 0 var(--edge), 0 16px 30px -18px rgba(43, 42, 40, 0.45);
  background-image: linear-gradient(90deg, transparent 4.2rem, rgba(44, 98, 201, 0.35) 4.2rem, rgba(44, 98, 201, 0.35) calc(4.2rem + 1px), transparent calc(4.2rem + 1px));
}

.cuttable { width: 100%; border-collapse: collapse; }
.cuttable th {
  font-family: var(--display);
  font-variation-settings: "wdth" 70;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--graphite-soft);
  padding: 0 0.75rem 0.75rem;
  border-bottom: 2px solid var(--graphite);
}
.cuttable td { padding: 1.4rem 0.75rem; vertical-align: top; border-bottom: 1px solid rgba(43, 42, 40, 0.28); }
.cuttable tr:last-child td { border-bottom: 0; }

.row__part {
  width: 4.2rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 150;
  font-weight: 900;
  font-size: 2.3rem;
  line-height: 1;
}
.row__fit {
  width: 11rem;
  font-family: var(--hand);
  font-size: 1.12rem;
  line-height: 1.3;
  color: var(--graphite-soft);
}
.row__note a {
  font-family: var(--display);
  font-variation-settings: "wdth" 100;
  font-weight: 700;
  font-size: clamp(1.2rem, 1.9vw, 1.55rem);
  line-height: 1.15;
  text-decoration: none;
  background-image: linear-gradient(var(--chalk), var(--chalk));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.35s ease;
}
.row__note a:hover,
.row__note a:focus-visible { background-size: 100% 2px; }
.row__note p { margin: 0.45rem 0 0; max-width: 54ch; }
.row__shape { width: 5.5rem; text-align: right; }
.row__shape svg { width: 4.5rem; height: auto; }
.row__shape rect, .row__shape path { fill: url(#hatch-sm); stroke: var(--graphite); stroke-width: 1.5; }

/* hover a piece on the sheet ⇄ highlight its row, and back */
body:has(.piece[data-part="a"]:hover) .row[data-part="a"],
body:has(.piece[data-part="b"]:hover) .row[data-part="b"],
body:has(.piece[data-part="c"]:hover) .row[data-part="c"] { background: rgba(44, 98, 201, 0.1); }
body:has(.row[data-part="a"]:hover) .piece[data-part="a"] .tag,
body:has(.row[data-part="b"]:hover) .piece[data-part="b"] .tag,
body:has(.row[data-part="c"]:hover) .piece[data-part="c"] .tag { fill: var(--chalk); stroke: var(--chalk); }
body:has(.row[data-part="a"]:hover) .piece[data-part="a"] .tag-txt,
body:has(.row[data-part="b"]:hover) .piece[data-part="b"] .tag-txt,
body:has(.row[data-part="c"]:hover) .piece[data-part="c"] .tag-txt { fill: var(--sawdust); }
.row { transition: background-color 0.2s; }

/* ---------- bench notes ---------- */

.bench {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1rem;
  padding: 0 var(--gutter) clamp(2.5rem, 6vw, 4rem);
}
.bench h2 {
  grid-column: 5 / -1;
  font-family: var(--display);
  font-variation-settings: "wdth" 115;
  font-weight: 780;
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1;
  margin: 0 0 2rem;
}
.bench__row { grid-column: 2 / 12; display: grid; grid-template-columns: 3fr 7fr; column-gap: 2.5rem; margin-bottom: 1.4rem; }
.bench__margin {
  font-family: var(--hand);
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--chalk);
  text-align: right;
  margin: 0.2rem 0 0;
  transform: rotate(-2deg);
}
.bench__row > p:last-child { margin: 0; max-width: 62ch; }
.bench__row--lead > p:last-child { font-size: 1.28rem; line-height: 1.5; }

/* ---------- chalk line ---------- */

.chalkline { padding: 0 var(--gutter); margin: 1rem 0 clamp(3rem, 7vw, 5rem); }
.chalkline svg { display: block; width: 100%; height: 24px; overflow: visible; transform-origin: 50% 50%; }
.chalkline path { fill: none; stroke: var(--chalk); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 1.2 5 0.8 9 1.5; opacity: 0.85; }
.js .chalkline:not(.is-snapped) svg { transform: scaleY(9); opacity: 0.35; }
.chalkline.is-snapped svg { animation: snap 0.75s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes snap {
  0% { transform: scaleY(9); opacity: 0.35; }
  30% { transform: scaleY(-4); opacity: 1; }
  55% { transform: scaleY(2); }
  78% { transform: scaleY(-0.6); }
  100% { transform: scaleY(1); opacity: 1; }
}

/* ---------- questions from the bench ---------- */

.questions { padding: 0 var(--gutter) clamp(4rem, 9vw, 7rem); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 1rem; }
.questions h2 {
  grid-column: 1 / 5;
  font-family: var(--display);
  font-variation-settings: "wdth" 58;
  font-weight: 880;
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  line-height: 0.9;
  text-transform: uppercase;
  margin: 0 0 2rem;
}
.qa { grid-column: 3 / -1; columns: 2 20rem; column-gap: 3.5rem; margin: 0; }
.qa__item { break-inside: avoid; margin: 0 0 2rem; }
.qa__item:nth-child(2) { padding-top: 3rem; }
.qa dt {
  font-family: var(--display);
  font-variation-settings: "wdth" 88;
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.qa dd { margin: 0; max-width: 46ch; }

/* ---------- ply edge footer ---------- */

.plyedge {
  height: 30px;
  background: repeating-linear-gradient(to bottom,
    var(--edge) 0 3px, #C9A36A 3px 5px, var(--graphite) 5px 6px);
}
.foot { background: var(--graphite); color: var(--sawdust); padding: 2.25rem var(--gutter) 2.75rem; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem 2.5rem; align-items: baseline; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-family: var(--display); font-variation-settings: "wdth" 75; font-weight: 600; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { color: #9DB9EE; }
.foot p { margin: 0; font-size: 0.92rem; opacity: 0.86; max-width: 60ch; }
.foot__brand { font-family: var(--hand); font-size: 1.3rem; opacity: 1 !important; }

/* ---------- shop sheet (legal pages, articles, 404) ---------- */

.sheet-wrap { padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(4rem, 9vw, 7rem); }

.sheet {
  position: relative;
  max-width: 50rem;
  margin-left: clamp(0rem, 11vw, 11rem);
  background: var(--sawdust);
  padding: clamp(2.25rem, 5vw, 4rem) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 5vw, 3.5rem);
  clip-path: polygon(0 0, calc(100% - 4.5rem) 0, 100% 4.5rem, 100% 100%, 0 100%);
  box-shadow: 0 16px 30px -18px rgba(43, 42, 40, 0.45);
}

.sheet__tape {
  display: inline-block;
  margin: 0 0 1.2rem -0.4rem;
  padding: 0.05rem 0.9rem 0.15rem;
  background: var(--birch);
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.1rem;
  transform: rotate(-2deg);
}

.sheet h1 {
  font-family: var(--display);
  font-variation-settings: "wdth" 125;
  font-weight: 800;
  font-size: clamp(2.1rem, 5.2vw, 3.7rem);
  line-height: 0.96;
  letter-spacing: -0.01em;
  margin: 0 0 0.9rem;
  max-width: 18ch;
}
.sheet__meta { font-family: var(--hand); color: var(--graphite-soft); margin: 0 0 2rem; }
.sheet__fit {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  margin: 0 0 2rem;
  padding: 0.7rem 0;
  border-top: 2px solid var(--graphite);
  border-bottom: 1px solid rgba(43, 42, 40, 0.3);
  font-family: var(--hand);
  font-size: 1.1rem;
}
.sheet__fit strong { font-family: var(--display); font-variation-settings: "wdth" 150; font-weight: 900; font-size: 1.5rem; }

.sheet h2 {
  font-family: var(--display);
  font-variation-settings: "wdth" 95;
  font-weight: 720;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 2.2rem 0 0.6rem;
}
.sheet p, .sheet li { max-width: 64ch; }
.sheet ul { padding-left: 1.2rem; }
.sheet li { margin-bottom: 0.35rem; }
.sheet li::marker { color: var(--edge); }
.sheet .aside {
  font-family: var(--hand);
  font-size: 1.12rem;
  color: var(--chalk);
  border-left: 2px solid var(--chalk);
  padding-left: 1rem;
  margin: 1.8rem 0;
}
.sheet__back { margin-top: 2.5rem; font-family: var(--display); font-variation-settings: "wdth" 80; font-weight: 650; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .sheet-fig { grid-column: 1 / -1; }
  .hero__copy { grid-column: 1 / -1; margin-top: 1.25rem; }
  .row__fit { width: 8rem; }
  .hero__lede { margin-left: 0; }
  .cutlist__head { grid-column: 1 / -1; position: static; margin-bottom: 1.5rem; }
  .cutsheet { grid-column: 1 / -1; background-image: none; }
  .bench h2, .bench__row { grid-column: 1 / -1; }
  .questions h2, .qa { grid-column: 1 / -1; }
  .qa__item:nth-child(2) { padding-top: 0; }
}

@media (max-width: 640px) {
  .cuttable thead { display: none; }
  .cuttable, .cuttable tbody, .cuttable tr, .cuttable td { display: block; width: auto; }
  .cuttable tr { display: grid; grid-template-columns: 3rem 1fr; column-gap: 0.75rem; padding: 1.2rem 0; border-bottom: 1px solid rgba(43, 42, 40, 0.28); }
  .cuttable tr:last-child { border-bottom: 0; }
  .cuttable td { padding: 0; border: 0; }
  .row__part { grid-row: span 2; }
  .row__fit { width: auto; }
  .row__note { grid-column: 2; margin-top: 0.3rem; }
  .row__shape { display: none !important; }
  .bench__row { grid-template-columns: 1fr; }
  .bench__margin { text-align: left; margin-bottom: 0.4rem; }
  .sheet { margin-left: 0; clip-path: polygon(0 0, calc(100% - 2.5rem) 0, 100% 2.5rem, 100% 100%, 0 100%); }
  .bench-top { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .kerf line { stroke-dashoffset: 0; }
  .js .chalkline:not(.is-snapped) svg { transform: none; opacity: 1; }
}
