:root {
  --paper: #f8f5ef;
  --ink: #30352e;
  --muted: #7c8076;
  --line: #deded3;
  --accent: #803d48;
  --tint: #f0e5e3;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
button,
input {
  font: inherit;
}
button,
a,
label.upload {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  color: var(--ink);
  font:
    32px Georgia,
    serif;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  font: 38px Georgia;
  color: var(--accent);
}
.small {
  font: 9px sans-serif;
  letter-spacing: 2px;
  margin: 10px 0 0 8px;
}
.edition {
  color: var(--muted);
  font:
    italic 15px Georgia,
    serif;
}
.quiet {
  background: none;
  border: 0;
  font-size: 12px;
  padding: 7px;
  color: var(--muted);
}
.quiet:hover {
  color: var(--accent);
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(400px, 0.85fr);
  max-width: 1600px;
  margin: auto;
}
.stage {
  position: sticky;
  top: 0;
  height: calc(100vh - 88px);
  min-height: 650px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 70%, #e5e4d8 0, transparent 57%), #eeeee5;
  border-right: 1px solid var(--line);
}
.intro {
  position: absolute;
  left: 7%;
  top: 5%;
  z-index: 2;
  pointer-events: none;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
}
h1 {
  font:
    clamp(32px, 3.6vw, 56px) / 1.04 Georgia,
    serif;
  font-weight: 400;
  margin: 18px 0;
}
h2 {
  font:
    28px/1.2 Georgia,
    serif;
  font-weight: 400;
  margin: 12px 0 22px;
}
.intro p {
  color: var(--muted);
  font-size: 13px;
}
.canvas-wrap {
  position: absolute;
  inset: 20% 0 6%;
}
canvas {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}
canvas:active {
  cursor: grabbing;
}
.ground {
  position: absolute;
  width: 46%;
  height: 6%;
  left: 27%;
  bottom: 9%;
  border-radius: 50%;
  background: #72796c20;
  filter: blur(12px);
}
.view-tools {
  position: absolute;
  right: 5%;
  top: 5%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  z-index: 3;
}
#render-status {
  font-size: 10px;
  color: var(--muted);
  max-width: 140px;
  text-align: right;
}
.stage-foot {
  position: absolute;
  bottom: 3%;
  left: 7%;
  right: 7%;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
#dimensions {
  font-variant-numeric: tabular-nums;
}
aside {
  padding: 32px 7% 24px;
  background: var(--paper);
}
.panel-head h2 {
  margin-bottom: 18px;
}
.tabs {
  display: flex;
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 7px;
  margin-bottom: 24px;
}
.tabs button {
  width: 50%;
  border: 0;
  background: none;
  padding: 8px;
  border-radius: 4px;
  font-size: 12px;
}
.tabs .selected {
  background: white;
  box-shadow: 0 1px 4px #00000012;
  color: var(--accent);
}
.control {
  margin-bottom: 24px;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.section-label b {
  font-size: 10px;
  color: #a4a798;
  font-weight: 400;
}
.section-label h3 {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}
.section-label > span,
.section-label > .quiet {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  padding: 0;
}
.shapes {
  display: flex;
  gap: 8px;
}
.shapes button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  width: 33.3%;
  padding: 7px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.shapes svg {
  width: 26px;
  height: 35px;
  fill: none;
  stroke: #858a7d;
  stroke-width: 1.7;
}
.shapes .selected {
  border-color: var(--accent);
  background: var(--tint);
  color: var(--accent);
}
.shapes .selected svg {
  stroke: var(--accent);
}
.search {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 10px;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
}
.search input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12px;
  padding: 4px;
}
.patterns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  max-height: 158px;
  overflow: auto;
  padding: 2px 4px 2px 0;
  scrollbar-width: thin;
}
.patterns button {
  border: 1px solid var(--line);
  border-radius: 5px;
  aspect-ratio: 1;
  background: #fffdf9;
  padding: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.patterns button.selected {
  border: 2px solid var(--accent);
  background: var(--tint);
  padding: 8px;
}
.patterns svg {
  width: 100%;
  height: 100%;
  opacity: 0.7;
}
.patterns button:hover {
  border-color: var(--accent);
}
.pattern-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 9px;
  font-size: 10px;
  gap: 8px;
}
.upload {
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.upload input {
  display: none;
}
.hint {
  font-size: 10px;
  color: var(--muted);
  margin: 7px 0;
}
.repeat-row {
  display: flex;
  gap: 15px;
  margin-top: 13px;
}
.repeat-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  flex: 1;
}
.repeat-row input {
  width: 50%;
  min-width: 20px;
  accent-color: var(--accent);
}
.color-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
.color-row > label {
  display: grid;
  grid-template-columns: 35px 1fr;
  column-gap: 9px;
  align-items: center;
  font-size: 11px;
}
.color-row small {
  font-size: 9px;
  color: var(--muted);
  grid-column: 2;
}
.color-row input[type='color'] {
  grid-row: 1/3;
  width: 35px;
  height: 35px;
  border: 1px solid #0001;
  padding: 0;
  background: none;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
}
.color-row input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-row input::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}
.pairings {
  display: flex;
  gap: 5px;
  margin-left: auto;
}
.pairings button {
  width: 19px;
  height: 19px;
  border: 2px solid white;
  outline: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(90deg, var(--a) 50%, var(--b) 50%);
  padding: 0;
}
.size > label {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 11px;
  margin: 11px 0;
}
.size input {
  flex: 1;
  width: 50px;
  accent-color: var(--accent);
  height: 3px;
}
.size output {
  width: 53px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.print-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 6px;
  background: #eaece3;
  margin-top: 12px;
}
.print-icon {
  font-size: 24px;
  color: #76816b;
}
.print-card strong,
.print-card div > span {
  display: block;
  font-size: 10px;
  font-weight: 500;
}
.print-card div > span {
  font-size: 9px;
  color: var(--muted);
  margin-top: 3px;
}
.tag {
  font-size: 8px;
  letter-spacing: 1px;
  margin-left: auto;
  color: #77806b;
}
.export {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 6px;
  margin-top: 14px;
  padding: 16px;
  font-size: 12px;
}
.export span {
  font-size: 10px;
  opacity: 0.75;
}
.export:hover {
  background: #6d303c;
}
.export:disabled {
  opacity: 0.5;
  cursor: wait;
}
.export-note {
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  margin: 9px 0 0;
}
.recipe {
  display: inline-block;
  padding: 8px 8px 0;
  font-size: 10px;
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 16px 4vw;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 35px;
  max-width: 570px;
  width: 92%;
  color: var(--ink);
  font-size: 13px;
}
dialog::backdrop {
  background: #252d2566;
  backdrop-filter: blur(4px);
}
dialog li {
  margin: 10px 0;
}
dialog a {
  color: var(--accent);
}
.close {
  float: right;
}
button:focus-visible,
a:focus-visible,
label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 800px) {
  header {
    height: 68px;
    padding: 0 5%;
  }
  .brand {
    font-size: 27px;
  }
  .small,
  .edition {
    display: none;
  }
  main {
    display: flex;
    flex-direction: column;
  }
  .stage {
    position: relative;
    min-height: 520px;
    height: 65vh;
    border-right: 0;
  }
  .intro {
    top: 5%;
  }
  h1 {
    font-size: 36px;
  }
  .canvas-wrap {
    inset: 19% 0 6%;
  }
  aside {
    padding: 30px 6%;
  }
  .patterns {
    grid-template-columns: repeat(8, 1fr);
    max-height: 170px;
  }
  footer {
    gap: 20px;
    font-size: 9px;
  }
  .repeat-row input {
    width: 60%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
.art-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  font-size: 10px;
  color: var(--muted);
}
.art-controls label {
  display: flex;
  gap: 8px;
  align-items: center;
}
.art-controls input[type='range'] {
  width: 90px;
  height: 3px;
  accent-color: var(--accent);
}
.art-controls input[type='checkbox'] {
  accent-color: var(--accent);
}
.nozzle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  margin: 14px 0 4px;
}
.nozzle-row select {
  border: 1px solid var(--line);
  background: transparent;
  padding: 5px 9px;
  border-radius: 5px;
  color: var(--ink);
  font-size: 11px;
}
