:root {
  --paper: #fafaf7;
  --paper-dim: #f1f0ea;
  --ink: #14151a;
  --ink-soft: #52555c;
  --line: #dad8ce;
  --cyan: #00aeef;
  --magenta: #ec0c8c;
  --yellow: #ffd400;
  --radius: 3px;
  --focus: 3px solid #14151a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131316;
    --paper-dim: #1b1c20;
    --ink: #f3f2ee;
    --ink-soft: #a7a8ad;
    --line: #35363b;
    --focus: 3px solid #f3f2ee;
  }
}
:root[data-theme="dark"] {
  --paper: #131316;
  --paper-dim: #1b1c20;
  --ink: #f3f2ee;
  --ink-soft: #a7a8ad;
  --line: #35363b;
  --focus: 3px solid #f3f2ee;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding: 28px 20px 60px;
  position: relative;
  min-height: 100vh;
}

.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }

:focus-visible { outline: var(--focus); outline-offset: 2px; }

/* registration marks — real print crop-mark crosses, framing the page */
.reg {
  position: fixed;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0.55;
  z-index: 5;
}
.reg::before, .reg::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.reg::before { width: 100%; height: 1px; top: 50%; left: 0; }
.reg::after  { width: 1px; height: 100%; left: 50%; top: 0; }
.reg-tl { top: 14px; left: 14px; }
.reg-tr { top: 14px; right: 14px; }
.reg-bl { bottom: 14px; left: 14px; }
.reg-br { bottom: 14px; right: 14px; }
@media (max-width: 720px) { .reg { display: none; } }

.masthead {
  max-width: 920px;
  margin: 10px auto 36px;
  padding: 0 24px;
}
.wordmark {
  font-family: "Big Shoulders Display", sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 9vw, 76px);
  letter-spacing: 0.01em;
  line-height: 0.92;
  margin: 0 0 10px;
  background: linear-gradient(100deg, var(--ink) 55%, var(--magenta) 72%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline {
  margin: 0;
  max-width: 50ch;
  color: var(--ink-soft);
  font-size: 17px;
}

.deck {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
@media (max-width: 860px) {
  .deck { grid-template-columns: 1fr; }
}

.panel {
  background: var(--paper);
  padding: 28px 24px;
}

.dropzone {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--ink); }
.dropzone.dragover { border-color: var(--cyan); background: var(--paper-dim); }
.dropzone.filled { border-style: solid; }
.dz-body { display: flex; flex-direction: column; gap: 3px; }
.dz-label { font-weight: 600; }
.dz-hint { color: var(--ink-soft); font-size: 13.5px; }
.dz-filename { font-size: 13.5px; color: var(--magenta); font-family: "IBM Plex Mono", monospace; word-break: break-all; min-height: 1.3em; }

.controls { margin-top: 22px; display: flex; flex-direction: column; gap: 20px; }
.controls[hidden], .specs[hidden] { display: none; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.field-note { margin: 0; font-size: 13px; color: var(--ink-soft); }
.readout { font-weight: 400; color: var(--ink-soft); font-size: 13px; }

.checkbox-field { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--magenta); }

.choice-row { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.choice {
  flex: 1;
  background: var(--paper);
  border: none;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  padding: 9px 10px;
  cursor: pointer;
}
.choice.active { background: var(--ink); color: var(--paper); }

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: var(--ink); cursor: pointer;
}

.dpi-input {
  width: 90px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  padding: 7px 9px;
  border-radius: var(--radius);
}

.btn-primary {
  margin-top: 4px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 18px;
  cursor: pointer;
  border-radius: var(--radius);
}
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary:not(:disabled):hover { background: var(--magenta); }

.panel-proof { display: flex; flex-direction: column; }
.proof-frame {
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, var(--paper-dim) 25%, transparent 25%) -8px 0,
    linear-gradient(-45deg, var(--paper-dim) 25%, transparent 25%) -8px 0,
    linear-gradient(45deg, transparent 75%, var(--paper-dim) 75%),
    linear-gradient(-45deg, transparent 75%, var(--paper-dim) 75%);
  background-size: 16px 16px;
  background-color: var(--paper);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 12px;
}
.proof-canvas img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  box-shadow: 0 0 0 1px var(--ink);
}
.proof-empty {
  color: var(--ink-soft);
  font-size: 14.5px;
  max-width: 28ch;
  text-align: center;
}

.specs {
  margin: 16px 0 0;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.specs div { display: flex; flex-direction: column; gap: 2px; }
.specs dt { margin: 0; font-size: 11.5px; color: var(--ink-soft); font-family: "IBM Plex Sans", sans-serif; }
.specs dd { margin: 0; font-size: 14px; }

.legend { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 2px; }

.status {
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 0 24px;
  font-size: 13.5px;
  color: var(--magenta);
  min-height: 1.4em;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
