:root {
  color: #171713;
  background: #ebe8df;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

main {
  position: relative;
  width: min(100% - 40px, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 40px;
}

header {
  position: absolute;
  z-index: 1;
  top: 28px;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 400;
  letter-spacing: -0.06em;
}

.actions {
  display: flex;
  gap: 8px;
}

#image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #aaa69c;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.button:hover {
  border-color: #171713;
}

.button-primary {
  border-color: #171713;
  color: #f6f3eb;
  background: #171713;
}

.workspace {
  display: grid;
  grid-template-columns: 220px minmax(280px, 750px) 220px;
  gap: 28px;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 68px);
}

.canvas-shell {
  position: relative;
  grid-column: 2;
  width: 100%;
  overflow: hidden;
  border: 1px solid #d3d0c7;
  background: #f7f5ef;
}

.canvas-shell.dragging::after {
  position: absolute;
  inset: 12px;
  border: 1px dashed #171713;
  content: "";
  pointer-events: none;
}

#artwork {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.drop-message {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-size: 1rem;
  pointer-events: none;
}

.canvas-shell.dragging .drop-message {
  display: grid;
}

aside {
  display: grid;
  grid-column: 3;
  gap: 24px;
}

.control {
  display: grid;
  gap: 10px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

output {
  color: #77746c;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 1px;
  margin: 5px 0;
  appearance: none;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: #aaa69c;
}

input[type="range"]::-webkit-slider-thumb {
  width: 13px;
  height: 13px;
  appearance: none;
  border: 1px solid #171713;
  border-radius: 50%;
  background: #ebe8df;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 1px solid #171713;
  border-radius: 50%;
  background: #ebe8df;
  cursor: pointer;
}

.reset {
  width: fit-content;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: #77746c;
  background: none;
  cursor: pointer;
}

.reset:hover {
  color: #171713;
}

.reset.is-hidden {
  visibility: hidden;
}

@media (max-width: 720px) {
  main {
    width: min(100% - 24px, 620px);
    min-height: auto;
    padding-top: 18px;
  }

  header {
    position: static;
    align-items: flex-start;
    margin-bottom: 24px;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.8rem;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .canvas-shell,
  aside {
    grid-column: 1;
  }

  aside {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reset {
    align-self: end;
  }
}
