@font-face {
  font-family: "Anton";
  src: url("fonts/Anton-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Titan One";
  src: url("fonts/TitanOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bangers";
  src: url("fonts/Bangers-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #e6e0d4;
  color: #1c1916;
  font-family: Inter, "Noto Sans", "Liberation Sans", sans-serif;
  font-synthesis: none;
}

main {
  display: grid;
  grid-template-columns: minmax(300px, 440px) minmax(280px, 1fr);
  gap: 36px;
  align-items: start;
  min-height: 100vh;
  padding: 32px 40px 48px;
}

.mark {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #5e574e;
}

h1 {
  margin: 0;
  font-family: "Noto Serif", "Liberation Serif", Georgia, serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
}

.lede {
  margin: 12px 0 18px;
  max-width: 38em;
  font-size: 16px;
  line-height: 1.45;
  color: #3f3a34;
}

.drop, .section, fieldset.section {
  display: grid;
  gap: 10px;
}

.drop {
  padding: 16px;
  border: 1px dashed #c9c0b2;
  border-radius: 6px;
  background: #fffcf7;
}

.drop.over {
  border-style: solid;
  border-color: #1c1916;
}

.drop-title, .group, legend {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #3f3a34;
}

.group {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5e574e;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

legend {
  padding: 0;
}

fieldset:disabled {
  opacity: 0.5;
}

label, .slider {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #3f3a34;
}

.slider-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

input, select {
  width: 100%;
  border: 1px solid #c9c0b2;
  border-radius: 6px;
  background: #fffcf7;
  color: #1c1916;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
}

input[type="range"] {
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: #1c1916;
  height: 24px;
}

input[type="color"] {
  padding: 4px;
  height: 42px;
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hint, .fine, #size {
  margin: 0;
  max-width: 46em;
  font-size: 13px;
  line-height: 1.4;
  color: #5e574e;
}

.fine {
  margin-top: 2px;
}

.actions, .choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button, .file-button {
  border: 1px solid #1c1916;
  border-radius: 6px;
  background: transparent;
  color: #1c1916;
  font: inherit;
  font-size: 15px;
  padding: 8px 12px;
  cursor: pointer;
}

.file-button {
  position: relative;
  display: inline-flex;
}

.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.file-button input:focus {
  outline: none;
}

.file-button:focus-within,
:focus-visible {
  outline: 2px solid #1c1916;
  outline-offset: 2px;
}

button:hover:not(:disabled):not([aria-pressed="true"]),
.file-button:hover {
  background: #f3ece1;
}

button[aria-pressed="true"] {
  background: #1c1916;
  color: #fffcf7;
}

button[aria-pressed="true"]:hover:not(:disabled) {
  background: #1c1916;
  color: #fffcf7;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

.hint.error, #status.error {
  color: #8a2e24;
}

#status {
  min-height: 1.2em;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.captions {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.caption {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid #c9c0b2;
  border-radius: 6px;
  background: transparent;
}

.caption.selected {
  background: #1c1916;
  border-color: #1c1916;
  color: #fffcf7;
}

.caption.selected input {
  background: #1c1916;
  color: #fffcf7;
  border-color: #8a8175;
}

.caption.selected button {
  color: #fffcf7;
  border-color: #fffcf7;
}

.caption.selected button:hover:not(:disabled) {
  background: #34302b;
}

.caption.selected :focus-visible {
  outline-color: #fffcf7;
}

.stage {
  display: flex;
  justify-content: center;
}

.sheet {
  width: min(100%, 860px);
  padding: 22px 22px 18px;
  background: #fffcf7;
  box-shadow: 0 12px 32px rgba(48, 38, 22, 0.12);
}

.sheet-label {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a6258;
}

#size {
  margin-bottom: 12px;
}

.frame {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
}

canvas {
  display: block;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 0 0 1px #c9c0b2;
  touch-action: none;
  cursor: default;
}

.sheet .hint {
  margin-top: 12px;
}

noscript {
  display: block;
  padding: 16px 20px;
  background: #fff4e8;
}

@media (min-width: 861px) {
  .stage {
    position: sticky;
    top: 24px;
  }
}

@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
    padding: 24px 18px 40px;
  }

  .pair {
    grid-template-columns: 1fr;
  }
}
