:root {
  --paper: #f5f7f4;
  --sheet: #ffffff;
  --ink: #10253f;
  --muted: #657282;
  --line: #cbd3da;
  --orange: #ff5b2e;
  --orange-dark: #db3c13;
  --mint: #bdebd8;
  --display: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 37, 63, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.masthead {
  width: min(1180px, calc(100% - 40px));
  height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}

.brand {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 31px;
  height: 31px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  background: var(--ink);
}

.brand-mark i { display: block; background: var(--sheet); }
.brand-mark i:nth-child(3) { grid-column: 2; }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #c6a54a; }
.status.ready .status-dot { background: #2d9b68; box-shadow: 0 0 0 3px rgba(45,155,104,.12); }
.status.unavailable .status-dot { background: var(--orange); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.intro {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 385px);
  align-items: end;
  gap: 48px;
  padding: 68px 0 54px;
}

.kicker {
  grid-column: 1 / -1;
  margin: 0 0 -20px;
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(50px, 6.6vw, 88px);
  line-height: .91;
  letter-spacing: -.045em;
  text-transform: uppercase;
}

h1 em { color: var(--orange); font-style: normal; }

.lede {
  margin: 0 0 3px;
  font-size: 17px;
  line-height: 1.65;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(390px, 1.06fr);
  min-height: 590px;
  border: 1px solid var(--ink);
  background: var(--sheet);
  box-shadow: 10px 10px 0 var(--mint);
}

.ticket { padding: 36px; border-right: 1px dashed var(--ink); }

.ticket-heading, .proof-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 35px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.ticket-id, #proof-size { color: var(--muted); }

label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
}

label span { color: var(--muted); font-weight: 400; }

textarea, input, select {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: #fbfcfb;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

textarea { min-height: 137px; padding: 15px; resize: vertical; line-height: 1.5; }
input, select { height: 48px; padding: 0 13px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }

textarea:focus, input:focus, select:focus {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--mint);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.field-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; margin-top: 27px; }

#generate-button {
  width: 100%;
  height: 56px;
  margin-top: 30px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  border: 1px solid var(--orange-dark);
  background: var(--orange);
  cursor: pointer;
  font-weight: 800;
  transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

#generate-button:hover { background: var(--orange-dark); box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
#generate-button:disabled { opacity: .62; cursor: wait; transform: none; box-shadow: none; }
#generate-button:focus-visible, .secondary-button:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }

.form-message { min-height: 20px; margin: 12px 0 0; color: #a43118; font-size: 13px; }
.form-message.success { color: #20744d; }

.proof { padding: 36px; background: #eef2f2; }

.proof-stage {
  min-height: 376px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.proof-stage img { display: block; width: min(78%, 342px); aspect-ratio: 1; object-fit: contain; }

.qr-placeholder {
  width: 174px;
  height: 174px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  padding: 18px;
  opacity: .24;
  background: repeating-linear-gradient(45deg, transparent 0 8px, var(--ink) 8px 9px);
}

.qr-placeholder span { border: 9px solid var(--ink); box-shadow: inset 0 0 0 5px white; background: var(--ink); }
.qr-placeholder span:nth-child(3) { grid-column: 1; }
.qr-placeholder b { position: absolute; inset: auto -30px -42px; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

.proof.has-result .proof-stage { animation: proof-in 350ms ease-out; }

.result { margin-top: 23px; }
.result-label { margin: 0 0 6px; color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.result-key { margin: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; }
.result-actions { display: flex; gap: 10px; margin-top: 16px; }

.secondary-button {
  flex: 1;
  min-height: 43px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.secondary-button:hover { color: white; background: var(--ink); }
.result-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }

footer {
  width: min(1180px, calc(100% - 40px));
  margin: 55px auto 0;
  padding: 22px 0 34px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

[hidden] { display: none !important; }

@keyframes proof-in {
  from { opacity: .4; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 820px) {
  .intro { grid-template-columns: 1fr; gap: 26px; padding-top: 52px; }
  .kicker { margin-bottom: -6px; }
  .workbench { grid-template-columns: 1fr; }
  .ticket { border-right: 0; border-bottom: 1px dashed var(--ink); }
  .proof-stage { min-height: 360px; }
}

@media (max-width: 540px) {
  .masthead, main, footer { width: min(100% - 24px, 1180px); }
  .masthead { height: 70px; }
  .status span:last-child { display: none; }
  .intro { padding: 42px 0 36px; }
  h1 { font-size: clamp(42px, 13vw, 62px); }
  .lede { font-size: 15px; }
  .workbench { box-shadow: 6px 6px 0 var(--mint); }
  .ticket, .proof { padding: 25px 20px; }
  .field-grid { grid-template-columns: 1fr; }
  .proof-stage { min-height: 290px; }
  .result-actions { flex-direction: column; }
  footer { gap: 20px; }
  footer span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

