/* Korerct -- the page is a proof sheet: paper on a light-table board,
   registration marks at the corners, hairlines, and process inks used only
   ever to mean "ink we are about to remove". Every action is black on paper. */

:root {
  --paper: #ffffff;
  --board: #dcdcd9;
  --ink: #000000;
  --ink-60: #5c5c5a;
  --ink-35: #9a9a97;
  --rule: #c9c9c5;
  --cyan: #0091d2;
  --magenta: #e5007d;
  --yellow: #9c7a00;  /* process yellow is illegible on paper; this keeps 3:1 */
  --sheet-max: 68rem;
  --gap: clamp(1.5rem, 4vw, 3.25rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  padding: clamp(0.75rem, 3vw, 2.5rem);
}

.sheet {
  position: relative;
  max-width: var(--sheet-max);
  margin: 0 auto;
  background: var(--paper);
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 5vw, 4rem) clamp(2rem, 5vw, 3rem);
}

/* Registration marks, one per corner of the sheet. */
.reg { position: absolute; width: 22px; height: 22px; opacity: 0.55; }
.reg--tl { top: 14px; left: 14px; }
.reg--tr { top: 14px; right: 14px; }
.reg--bl { bottom: 14px; left: 14px; }
.reg--br { bottom: 14px; right: 14px; }

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
}

.wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}

.domain {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--ink-60);
}

h1 {
  font-size: clamp(2.1rem, 6.2vw, 3.6rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
  max-width: 17ch;
  margin: var(--gap) 0 0.9rem;
}

.standfirst {
  max-width: 54ch;
  margin: 0 0 var(--gap);
  color: var(--ink-60);
  font-size: 1.05rem;
}

/* --- separation readout -------------------------------------------------- */
.sep {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  display: grid;
  gap: 0.55rem;
}

.sep-row {
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  align-items: baseline;
  gap: 1rem;
}

.sep-label {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--ink-35);
}

.plates {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.9rem, 3vw, 2.1rem);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.05rem, 3.4vw, 1.5rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.plate { display: inline-flex; align-items: baseline; gap: 0.45rem; }
.plate span:first-child { font-size: 0.72em; font-weight: 400; color: var(--ink-35); }
.plate--c { color: var(--cyan); }
.plate--m { color: var(--magenta); }
.plate--y { color: var(--yellow); }
.plate--k { color: var(--ink); }
.plate--off { color: var(--ink-35); }

/* --- stage: everything from dropzone to download lives here -------------- */
.stage { margin-top: var(--gap); }

.drop {
  width: 100%;
  display: block;
  background: var(--paper);
  border: 1px dashed var(--ink-35);
  color: var(--ink);
  font: inherit;
  text-align: center;
  padding: clamp(2.5rem, 9vw, 4.5rem) 1.5rem;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.drop:hover, .drop:focus-visible { border-color: var(--ink); }
.drop.is-over { border-color: var(--ink); background: #f4f4f2; }
.drop strong { display: block; font-size: 1.2rem; font-weight: 600; }
.drop em { font-style: normal; color: var(--ink-60); font-size: 0.92rem; }

.limits {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--ink-35);
  margin-top: 0.7rem;
}

.progress { border-top: 1px solid var(--rule); padding-top: 1rem; }
.progress-bar { height: 6px; background: #ececea; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.4s ease; }

/* Waiting in the queue: no percentage exists yet, so show movement instead of
   a bar parked at some arbitrary number. */
.progress-bar.is-waiting i { width: 28%; transition: none; animation: waiting 1.8s ease-in-out infinite; }
@keyframes waiting {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(360%); }
}
.progress-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.6rem;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--ink-60);
}

/* --- result -------------------------------------------------------------- */
.ticket {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border-top: 1px solid var(--rule);
}

.ticket div {
  padding: 1rem 1rem 1rem 0;
  border-bottom: 1px solid var(--rule);
}

.ticket dt, .ticket .k {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: var(--ink-35);
  display: block;
  margin-bottom: 0.3rem;
}

.ticket .v {
  font-size: 1.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.proofs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.75rem; }
.proofs figure { margin: 0; }
.proofs img { width: 100%; display: block; border: 1px solid var(--rule); background: var(--paper); }
.proofs figcaption {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: var(--ink-60);
  margin-top: 0.5rem;
}

/* --- payment ------------------------------------------------------------- */
.buy { margin-top: 1.9rem; border-top: 1px solid var(--rule); padding-top: 1.4rem; }
.buy h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.25rem; }
.buy p { margin: 0 0 1.1rem; color: var(--ink-60); max-width: 56ch; }

.options { display: flex; flex-wrap: wrap; gap: 0.6rem; }

button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

button:hover, .btn:hover { background: #f1f1ef; }
button[disabled] { opacity: 0.45; cursor: default; }
.btn--fill, button.btn--fill { background: var(--ink); color: var(--paper); }
.btn--fill:hover, button.btn--fill:hover { background: #2a2a28; }
.btn small { font-weight: 400; color: var(--ink-60); }
.btn--fill small { color: #c9c9c5; }

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

.redeem { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.redeem input {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  width: 12.5rem;
  text-transform: uppercase;
}
.redeem input:focus { border-color: var(--ink); }

.code-slab {
  border: 1px solid var(--ink);
  padding: 1.1rem 1.25rem;
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.code-slab b {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}
.code-slab p { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--ink-60); max-width: 40ch; }

.note { font-size: 0.9rem; color: var(--ink-60); margin-top: 1rem; }
.error { border-left: 3px solid var(--magenta); padding-left: 0.9rem; margin-top: 1.25rem; }
.error strong { display: block; }

/* --- footer -------------------------------------------------------------- */
.colophon {
  margin-top: var(--gap);
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem 2rem;
  font-size: 0.92rem;
  color: var(--ink-60);
}
.colophon h2 { font-size: 0.95rem; font-weight: 600; color: var(--ink); margin: 0 0 0.3rem; }
.colophon p { margin: 0; max-width: 42ch; }
.colophon a { color: var(--ink); }

@media (max-width: 40rem) {
  .sep-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .proofs { grid-template-columns: 1fr; }
  .reg { display: none; }
}

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

/* --- terms and privacy --------------------------------------------------- */
.wordmark a { color: inherit; text-decoration: none; }
.doc h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); max-width: 20ch; }
.doc h2 { font-size: 1.05rem; font-weight: 600; margin: 2.1rem 0 0.45rem; }
.doc p { max-width: 68ch; margin: 0 0 0.9rem; }
.doc a { color: var(--ink); }
.doc .colophon p { max-width: none; }

table.data { border-collapse: collapse; width: 100%; margin: 1.1rem 0 1.6rem; }
table.data td {
  border-top: 1px solid var(--rule);
  padding: 0.75rem 1.25rem 0.75rem 0;
  vertical-align: top;
  font-size: 0.95rem;
}
table.data td:last-child { color: var(--ink-60); width: 38%; padding-right: 0; }
@media (max-width: 40rem) {
  table.data td, table.data td:last-child { display: block; width: auto; }
  table.data td:last-child { border-top: 0; padding-top: 0; }
}
