:root {
  --paper: #efe6d6;
  --ink: #171411;
  --muted: #6e6458;
  --rule: #c9bba8;
  --press: #b8431f;
  --press_ink: #fff7f0;
  --console: #231e1a;
  --console_paper: #f4eadc;
  --focus: #1c6b8a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
  line-height: 1.45;
}

.page_frame {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

.site_header {
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
}

.kicker {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.lede {
  max-width: 36rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
}

.status_message {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ink);
  background: #f3d7c8;
}

[hidden] {
  display: none !important;
}

.drop_stage {
  position: relative;
  min-height: 22rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 18px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 0 / 1px 18px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 18px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / 1px 18px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 18px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 1px 18px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / 18px 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / 1px 18px no-repeat,
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      rgba(23, 20, 17, 0.04) 10px,
      rgba(23, 20, 17, 0.04) 11px
    );
  cursor: pointer;
}

.drop_stage.is_dragging {
  background-color: #e6d8c0;
}

.drop_stage_copy {
  text-align: center;
  padding: 1.5rem;
}

.drop_stage_title {
  margin: 0;
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-size: 1.85rem;
}

.drop_stage_hint {
  margin: 0.45rem 0 1.2rem;
  color: var(--muted);
}

.file_input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.choose_file_button {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.25rem;
  align-items: start;
}

.preview_pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.preview_frame {
  margin: 0;
}

.preview_frame figcaption {
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview_surface {
  display: grid;
  place-items: center;
  min-height: 18rem;
  border: 1px solid var(--ink);
  background: #d8cbb8;
  overflow: hidden;
}

.preview_surface img {
  display: block;
  max-width: 100%;
  max-height: 28rem;
}

.checkerboard {
  background-color: #d8cbb8;
  background-image:
    linear-gradient(45deg, #c9bba8 25%, transparent 25%),
    linear-gradient(-45deg, #c9bba8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c9bba8 75%),
    linear-gradient(-45deg, transparent 75%, #c9bba8 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.file_strip {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  overflow-x: auto;
}

.file_strip button {
  min-width: 4.5rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 0.75rem;
}

.file_strip button.is_active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.press_console {
  background: var(--console);
  color: var(--console_paper);
  padding: 1.15rem 1.05rem 1.25rem;
}

.field + .field,
.readout {
  margin-top: 1.15rem;
}

.field_header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.field_label,
.readout dt {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #cbbba6;
}

.field_value {
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
}

.field_note {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: #b3a394;
}

.color_row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.45rem;
}

.color_row input[type="color"] {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid #cbbba6;
  background: transparent;
  cursor: pointer;
}

#quality_slider {
  width: 100%;
  margin: 0.7rem 0 0;
  accent-color: var(--press);
}

.readout {
  display: grid;
  gap: 0.7rem;
  border-top: 1px solid #3a322c;
  padding-top: 1rem;
}

.readout div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.readout dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.action_row {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.primary_button,
.secondary_button,
.ghost_button {
  font: inherit;
  cursor: pointer;
  padding: 0.7rem 0.85rem;
}

.primary_button {
  border: 0;
  background: var(--press);
  color: var(--press_ink);
}

.secondary_button,
.ghost_button {
  border: 1px solid #cbbba6;
  background: transparent;
  color: var(--console_paper);
}

.primary_button:disabled,
.secondary_button:disabled {
  opacity: 0.45;
  cursor: wait;
}

.primary_button:focus-visible,
.secondary_button:focus-visible,
.ghost_button:focus-visible,
.choose_file_button:focus-visible,
#quality_slider:focus-visible,
#background_color_input:focus-visible,
.file_input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .workspace,
  .preview_pair {
    grid-template-columns: 1fr;
  }

  .preview_surface {
    min-height: 12rem;
  }

  .preview_surface img {
    max-height: 18rem;
  }
}
