/* C&T Wood Crafting. Colors come from the shop: raw pine, stain, a yellow tape
   measure and the green paint on old machinery. Light mode is a planed pine
   board. Dark mode is the same shop with the walnut stain on. */

:root {
  color-scheme: light;
  --board: #ecd5a6;
  --card: #f9eed6;
  --ink: #2a1a10;
  --ink-soft: #5a4230;
  --line: #a9844e;
  --green: #24463a;
  --green-ink: #fbf3e0;
  --flag: #7c2c1c;
  --flag-ink: #fff3de;
  --field: #fffaf0;
  --grain-opacity: 0.16;
  --walnut: #3a2415;
  --walnut-ink: #f4e2bf;
  --pine: #e9c98f;
  --tape: #e8b820;
  --display: "Shantell Sans", "Segoe Print", "Bradley Hand", "Trebuchet MS", sans-serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, "Trebuchet MS", sans-serif;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='300'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .28' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .1 0 0 0 0 .04 0 0 0 2.4 -1.05'/%3E%3C/filter%3E%3Crect width='900' height='300' filter='url(%23g)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --board: #21150d;
    --card: #2f1f14;
    --ink: #f4e2bf;
    --ink-soft: #cdb48d;
    --line: #6f5236;
    --green: #e9c98f;
    --green-ink: #21150d;
    --flag: #e7a489;
    --flag-ink: #21150d;
    --field: #1a100a;
    --grain-opacity: 0.2;
    --walnut: #17100a;
    --walnut-ink: #f4e2bf;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 118.75%; /* 19px base for older eyes */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--board);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  position: relative;
}

/* Grain sits behind everything at low strength so body text stays clean. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  background-size: 900px 300px;
  opacity: var(--grain-opacity);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 0.4em;
}

h1 {
  font-size: clamp(2.2rem, 7.5vw, 4.1rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--tape);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--ink);
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 16px;
}

.page {
  padding-block: 2rem 4rem;
}

.break {
  overflow-wrap: anywhere;
}

.nowrap {
  white-space: nowrap;
}

/* Top bar: a stained board in both modes. */
.top {
  background-color: var(--walnut);
  color: var(--walnut-ink);
  position: relative;
}

.top::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 900px 300px;
  opacity: 0.55;
  pointer-events: none;
}

.top-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.6rem;
}

.mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  text-decoration: none;
  color: var(--pine);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.nav {
  display: flex;
  gap: 0.25rem;
  margin-inline: -0.75rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  padding-inline: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.nav a:hover {
  text-decoration: underline;
}

.count {
  background: var(--tape);
  color: #21150d;
  border-radius: 999px;
  min-width: 1.6em;
  padding: 0 0.4em;
  text-align: center;
  font-size: 0.9em;
  line-height: 1.6;
}

/* The yellow tape measure under the header and between big sections. */
.tape {
  height: 26px;
  background-color: var(--tape);
  background-image:
    repeating-linear-gradient(90deg, #21150d 0 2px, transparent 2px 96px),
    repeating-linear-gradient(90deg, #21150d 0 2px, transparent 2px 48px),
    repeating-linear-gradient(90deg, #21150d 0 1px, transparent 1px 12px);
  background-size:
    100% 100%,
    100% 62%,
    100% 34%;
  background-repeat: no-repeat;
  border-bottom: 2px solid #21150d;
}

.page .tape {
  margin-bottom: 1.5rem;
  border: 2px solid #21150d;
  transform: rotate(-0.3deg);
}

/* Buttons and fields are big enough for a thumb on a phone. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.5rem 1.5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 7px 11px 8px 12px;
  background: var(--green);
  color: var(--green-ink);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
}

.btn:hover {
  transform: translateY(1px);
  box-shadow: 0 3px 0 var(--ink);
}

.btn:active {
  transform: translateY(4px);
  box-shadow: none;
}

.btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.btn-wide {
  width: 100%;
}

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  min-height: 48px;
  padding: 0 0.5rem;
  cursor: pointer;
}

label,
legend {
  font-weight: 700;
}

.field {
  margin-bottom: 1.25rem;
}

.field > label {
  display: block;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="tel"],
textarea,
select {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.4rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background-color: var(--field);
  border: 2px solid var(--ink);
  border-radius: 6px;
}

input[type="file"] {
  width: 100%;
  font: inherit;
}

textarea {
  min-height: 8rem;
  padding: 0.6rem 0.75rem;
  resize: vertical;
}

.hint {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 9px 13px 10px 14px;
  padding: 1.25rem;
}

.section {
  margin-top: 3.5rem;
}

/* Home */
.hello {
  max-width: 44rem;
  margin-bottom: 2rem;
}

.lead {
  font-size: 1.2rem;
}

.flag {
  display: inline-block;
  background: var(--flag);
  color: var(--flag-ink);
  font-family: var(--display);
  font-weight: 800;
  padding: 0.5rem 1rem;
  border-radius: 5px 9px 6px 10px;
  transform: rotate(-0.8deg);
  margin-bottom: 2rem;
}

.pieces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.piece {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 9px 13px 10px 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.piece:hover .piece-name {
  text-decoration: underline;
}

.piece-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.piece-name {
  font-size: 1.55rem;
  margin-bottom: 0.25rem;
}

.piece-size {
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.price {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.8rem;
  line-height: 1.2;
  margin: auto 0 0;
}

.closed-note {
  color: var(--flag);
  font-weight: 700;
  margin: 0.25rem 0 0;
}

/* The stand-in for a photo: pine cut-outs resting on a stained board. */
.plank {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #4a2d19;
  background-image: var(--grain), linear-gradient(180deg, #55341d, #41270f);
  background-size:
    900px 300px,
    100% 100%;
  border-bottom: 2px solid var(--line);
}

.plank::before {
  /* Board seams */
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, transparent 33%, rgb(0 0 0 / 0.45) 33% 33.6%, transparent 33.6% 66.4%, rgb(0 0 0 / 0.45) 66.4% 67%, transparent 67%);
}

.plank-note {
  position: absolute;
  right: 0.75rem;
  bottom: 0.5rem;
  color: #f4e2bf;
  font-size: 0.85rem;
  font-family: var(--display);
  font-weight: 600;
}

.cut {
  position: relative;
  display: block;
  filter: drop-shadow(3px 5px 3px rgb(0 0 0 / 0.55));
}

.cut i {
  display: none;
}

.cut-tree-decoration::before,
.cut-tree-shelf::before {
  content: "";
  display: block;
  height: 100%;
  background-color: #e9c98f;
  background-image: var(--grain);
  background-size: 300px 900px;
  clip-path: polygon(50% 0, 74% 30%, 62% 30%, 86% 60%, 70% 60%, 100% 90%, 57% 90%, 57% 100%, 43% 100%, 43% 90%, 0 90%, 30% 60%, 14% 60%, 38% 30%, 26% 30%);
}

.cut-tree-decoration {
  height: 62%;
  aspect-ratio: 10 / 15;
}

.cut-tree-shelf {
  height: 80%;
  aspect-ratio: 17 / 30;
}

/* Shelf boards across the tree */
.cut-tree-shelf::before {
  background-image:
    linear-gradient(180deg, transparent 29%, #8a5a2c 29% 31%, transparent 31% 59%, #8a5a2c 59% 61%, transparent 61% 88%, #8a5a2c 88% 90%, transparent 90%),
    var(--grain);
  background-size:
    100% 100%,
    300px 900px;
}

.cut-wagon {
  width: 62%;
  aspect-ratio: 20 / 12;
  margin-top: -4%;
}

.cut-wagon::before {
  /* Wagon bed with slats */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8%;
  height: 56%;
  background-color: #e9c98f;
  background-image: repeating-linear-gradient(180deg, transparent 0 30%, #8a5a2c 30% 33%);
  border-radius: 2px;
}

.cut-wagon::after {
  /* Pull handle */
  content: "";
  position: absolute;
  left: 97%;
  top: 44%;
  width: 34%;
  height: 7%;
  background: #e9c98f;
  border-radius: 3px;
  transform: rotate(-32deg);
  transform-origin: left center;
}

.cut-wagon i {
  display: block;
  position: absolute;
  bottom: 0;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #41270f 0 14%, #e9c98f 15% 58%, #8a5a2c 59% 66%, #e9c98f 67%);
}

.cut-wagon i:first-child {
  left: 7%;
}

.cut-wagon i:last-child {
  right: 7%;
}

.shot {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 2px solid var(--line);
}

/* Finish board */
.finishes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 9.5rem), 1fr));
  gap: 1rem;
  list-style: none;
  margin: 1.25rem 0 1rem;
  padding: 0;
}

.chip {
  display: block;
  height: 4.5rem;
  border: 2px solid var(--ink);
  border-radius: 4px 7px 5px 8px;
  background-color: var(--stain);
  background-image: var(--grain);
  background-size: 450px 150px;
  margin-bottom: 0.3rem;
}

.finish-name {
  font-weight: 700;
  line-height: 1.25;
  display: block;
}

/* Rough screen stand-ins for each stain. */
.fin-special-walnut { --stain: #5c3a21; }
.fin-dark-walnut { --stain: #38220f; }
.fin-drift-wood { --stain: #a0937f; }
.fin-colonial { --stain: #7a4a26; }
.fin-maple { --stain: #bd7f42; }
.fin-classic-grey { --stain: #84807a; }
.fin-gunstock { --stain: #9a5420; }
.fin-english-chestnut { --stain: #6e3418; }
.fin-golden-oak { --stain: #b77f2c; }
.fin-cherry { --stain: #7c2c1c; }
.fin-rustic-look { --stain: #6a4a2c; }

.fin-interior-paint .chip,
.fin-exterior-paint .chip {
  background-color: #f6f1e6;
  background-image: repeating-linear-gradient(92deg, rgb(0 0 0 / 0.05) 0 3px, transparent 3px 11px);
  background-size: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2a1a10;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Getting it home */
.how {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.25rem;
}

.how p:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.code-note {
  border-style: dashed;
  margin-top: 1.25rem;
}

.code-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2em;
  white-space: nowrap;
}

/* Piece page */
.piece-page {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.gallery {
  border: 2px solid var(--line);
  border-radius: 9px 13px 10px 14px;
  overflow: hidden;
}

.gallery .shot:last-child,
.gallery .plank {
  border-bottom: 0;
}

.detail .price {
  margin-bottom: 1rem;
}

.detail-name {
  font-size: clamp(2rem, 6vw, 3rem);
}

.buy {
  margin-top: 1.25rem;
}

.buy-note {
  margin-top: 1rem;
}

.noscript {
  margin: 1rem 0 0;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-bottom: 0.5rem;
}

@media (min-width: 52rem) {
  .piece-page {
    grid-template-columns: 1.15fr 1fr;
  }
}

/* Cart */
.cart-grid {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 58rem) {
  .cart-grid {
    grid-template-columns: 1.1fr 1fr;
  }
}

.cart-lines {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.cart-line {
  padding-block: 1rem;
  border-bottom: 2px solid var(--line);
}

.cart-line:first-child {
  padding-top: 0;
}

.cart-line-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
}

.cart-line-sub {
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}

.cart-line-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.cart-line-row label {
  font-weight: 400;
}

.cart-line-row select {
  width: 5rem;
}

.cart-line-money {
  margin-left: auto;
  font-weight: 700;
  font-size: 1.15rem;
}

.cart-line-problem {
  color: var(--flag);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.totals {
  margin: 0 0 0.5rem;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.15rem;
}

.totals dt,
.totals dd {
  margin: 0;
}

.totals dd {
  font-weight: 700;
}

fieldset {
  border: 0;
  margin: 0 0 1.25rem;
  padding: 0;
}

.choice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  margin-top: 0.5rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  font-weight: 400;
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--ink);
  background: var(--field);
}

.choice input {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  margin: 0.15rem 0 0;
  accent-color: var(--green);
}

.choice strong {
  display: block;
}

.error {
  border: 2px solid var(--flag);
  color: var(--flag);
  background: var(--field);
  font-weight: 700;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

/* Text pages */
.prose {
  max-width: 44rem;
}

.prose h2 {
  margin-top: 2rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

/* Footer */
.foot {
  background-color: var(--walnut);
  color: var(--walnut-ink);
  padding-block: 2rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem;
}

.foot h2 {
  font-size: 1.1rem;
  color: var(--pine);
  margin-bottom: 0.25rem;
}

.foot p {
  margin: 0;
}

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: transform 0.08s, box-shadow 0.08s;
  }
}
