:root {
  --bg: #f6f1e8;
  --panel: #fffdf8;
  --ink: #2b2420;
  --muted: #7a6e63;
  --line: #e2d8c9;
  --accent: #9a4a1f;
  --wood: #cdc7bc;
  --wood-grain: #c3bcb0;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 4px 14px rgba(60, 40, 20, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1916;
    --panel: #26211d;
    --ink: #eee6db;
    --muted: #a99b8c;
    --line: #3a322b;
    --accent: #e08a55;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
.top {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem;
  padding: 1rem max(1rem, calc((100% - 1100px) / 2));
  border-bottom: 1px solid var(--line);
}
.brand { font: 700 1.4rem/1 Georgia, "Times New Roman", serif; color: var(--ink); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current] { color: var(--ink); }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; border-top: 1px solid var(--line); }
h1 { font: 700 2rem/1.2 Georgia, "Times New Roman", serif; margin: .5rem 0 .75rem; }
h2 { font: 700 1.3rem/1.3 Georgia, "Times New Roman", serif; margin: 2rem 0 .75rem; }
h3 { margin: 1.25rem 0 .5rem; font-size: 1.05rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; color: inherit; text-decoration: none; box-shadow: var(--shadow);
}
.card img, .card .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #4c4945; }
.card .noimg { display: grid; place-items: center; color: #bbb; font-size: .9rem; }
.card .body { padding: .8rem 1rem 1rem; }
.card h3 { margin: 0 0 .3rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; }
.gallery img, .gallery .noimg { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: #4c4945; display: grid; place-items: center; color: #bbb; }
.gallery figcaption { font-size: .9rem; margin-top: .3rem; }
.gallery figcaption span { color: var(--muted); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts ul { margin: 0; padding-left: 1.1rem; }
ul.tips li { margin-bottom: .3rem; }
.note { background: var(--panel); border-left: 3px solid var(--accent); padding: .6rem 1rem; border-radius: 4px; }

/* paints: a plywood board with painted patches */
.board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem;
  padding: 1rem; border-radius: 10px;
  background: repeating-linear-gradient(92deg, var(--wood) 0 7px, var(--wood-grain) 7px 8px, var(--wood) 8px 19px);
}
.patch { background: rgba(255, 255, 255, .35); border-radius: 6px; padding: .5rem; color: #2b2420; }
.patch .swatch { height: 70px; border-radius: 3px; position: relative; overflow: hidden; }
.patch .swatch img { width: 100%; height: 100%; object-fit: cover; }
.patch .code { font-weight: 600; font-size: .85rem; margin-top: .35rem; }
.patch .name { font-size: .9rem; }
.badge { display: inline-block; font-size: .7rem; padding: 0 .4rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; position: absolute; right: 4px; bottom: 4px; }

/* engraving */
.strip { display: flex; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.strip > div { flex: 1; min-width: 0; min-height: 90px; padding: .4rem; display: flex; flex-direction: column; justify-content: flex-end; font-size: .78rem; }
.formula { font: 1.1rem/1.4 ui-monospace, Consolas, monospace; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; overflow-x: auto; }
.tryit { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 1rem 1.5rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.tryit label { display: grid; grid-template-columns: 5rem 1fr 4.5rem; gap: .75rem; align-items: center; margin: .4rem 0; }
.tryit input[type=range] { width: 100%; }
.tryit output { font-variant-numeric: tabular-nums; text-align: right; }
.result { height: 140px; border-radius: 8px; border: 1px solid var(--line); display: flex; align-items: flex-end; padding: .5rem; font-size: .85rem; }
.warn { color: #b3261e; font-size: .9rem; margin: .3rem 0 0; }
@media (prefers-color-scheme: dark) { .warn { color: #ff8a80; } }
.textures { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.textures figure { margin: 0; font-size: .8rem; }
.textures canvas { width: 100%; aspect-ratio: 1; border-radius: 6px; display: block; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; margin: .75rem 0; }
th, td { border-bottom: 1px solid var(--line); padding: .35rem .7rem; text-align: left; vertical-align: top; }
pre { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; overflow-x: auto; font-size: .85rem; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
blockquote { margin: 1rem 0; padding: .5rem 1rem; border-left: 3px solid var(--accent); background: var(--panel); }

@media (max-width: 640px) {
  h1 { font-size: 1.6rem; }
  .tryit { grid-template-columns: 1fr; }
  .tryit label { grid-template-columns: 4rem 1fr 4rem; }
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: .5rem; }
  .strip { display: grid; grid-template-columns: repeat(4, 1fr); }
  .strip > div { min-height: 70px; }
}
