/* I'll Pay You to Fight Me: shared print system */
@font-face {
  font-family: "Archivo Display";
  src: url("/fonts/archivo-display.woff2") format("woff2");
  font-weight: 900;
  font-display: block;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/fonts/courier-prime-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Archivo Text";
  src: url("/fonts/archivo-text.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --paper: #F5F2E9;
  --ink: #11110E;
  --muted: #82817B;
  --light: #D8D6CF;
  --muted-text: #5E5D58; /* muted on the ink-paper axis, dark enough for 4.5:1 body text */
  --wash: #ECE9DF;       /* row hover in the dashboard */
  --display: "Archivo Display", "Arial Narrow", sans-serif;
  --text: "Archivo Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --gutter: 16px;
  --col: min(100vw - 2 * var(--gutter), 460px);
  --rule-thick: 4px;
  --rule-thin: 1.5px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
p, h1, h2, h3, figure { margin: 0; }

.display {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.022em;
  word-spacing: 0.06em;
  line-height: 0.86;
  text-align: center;
  font-kerning: normal;
}

/* ---------- Landing: one sheet, one screen ---------- */
.sheet {
  width: var(--col);
  margin-inline: auto;
}
.landing {
  /* the whole poster must sit inside the visible viewport */
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.headline {
  /* widest line "TO FIGHT ME." is 4.875em at -0.03em tracking */
  font-size: min(calc(var(--col) / 5.25), 10.6svh);
  white-space: nowrap;
  line-height: 0.75;
  margin-bottom: min(10px, 1.4svh);
}

.portrait {
  position: relative;
  flex: 1 1 auto;
  min-height: 120px;
  /* never taller than the photograph itself */
  max-height: calc(var(--col) * 0.893);
  border: 2px solid var(--ink);
  background: var(--ink);
  overflow: hidden;
}
.portrait picture, .portrait img {
  display: block;
  width: 100%;
  height: 100%;
}
.portrait img {
  object-fit: cover;
  object-position: 50% 5%;
}
.stats {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
  padding: 0.45em 0.75em 0.4em;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  font-family: var(--text);
  font-weight: 700;
  font-size: clamp(12px, calc(var(--col) / 26), 17px);
  line-height: 1.1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.stats .gap { display: inline-block; width: 0.5em; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.claim {
  /* 13.2em wide at -0.03em tracking */
  font-size: min(calc(var(--col) / 14.2), 4svh);
  white-space: nowrap;
  margin-top: min(10px, 1.4svh);
}
.serious {
  font-size: min(calc(var(--col) / 7.4), 6svh);
  margin-top: 0.08em;
}

.fine {
  margin-top: min(10px, 1.4svh);
  padding-top: min(8px, 1.1svh);
  border-top: var(--rule-thin) solid var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
}

.actions {
  display: grid;
  gap: 8px;
  margin-top: min(10px, 1.4svh);
  padding-top: min(10px, 1.4svh);
  border-top: var(--rule-thick) solid var(--ink);
}

/* ---------- Slips: the two answer buttons ---------- */
.slip {
  display: grid;
  place-items: center;
  min-height: clamp(48px, 8svh, 60px);
  padding: 6px 14px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  word-spacing: 0.08em;
  font-size: clamp(22px, 3.6svh, 28px);
  line-height: 1;
  text-decoration: none;
  touch-action: manipulation;
}
.slip--primary { background: var(--ink); color: var(--paper); }
/* press feedback only; the two slips never trade styles */
.slip:active { opacity: 0.78; }

/* very short screens (landscape phones, iPhone SE with toolbars) */
@media (max-height: 600px) {
  .portrait img { object-position: 50% 30%; }
  .fine { font-size: 10px; }
}

/* ---------- Documents: footage statement, errors ---------- */
.doc {
  padding: max(28px, env(safe-area-inset-top)) 0 48px;
  max-width: min(100vw - 2 * var(--gutter), 34rem);
}
.doc > p + p { margin-top: 1em; }
.doc__title {
  text-align: left;
  font-size: clamp(40px, 13vw, 64px);
  border-top: var(--rule-thick) solid var(--ink);
  padding: 14px 0 16px;
  margin-bottom: 18px;
  border-bottom: var(--rule-thin) solid var(--ink);
}
.doc__back { margin-top: 2em !important; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: 14px; }

/* ---------- Reference slip (confirmation) ---------- */
.ref-slip {
  margin-top: 28px !important;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  border: 3px solid var(--ink);
}
.ref-slip__label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ref-slip__no {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

/* ---------- Forms: printed application ---------- */
.form-lede { font-size: 14px; }
.form { margin-top: 18px; }
.block {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.block__title {
  display: block;
  width: 100%;
  padding: 0 0 6px;
  margin-bottom: 14px;
  border-bottom: var(--rule-thin) solid var(--ink);
  font-family: var(--display);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.field { margin-bottom: 16px; min-width: 0; }
.field > label, .field > .label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.opt { font-weight: 400; letter-spacing: 0.02em; text-transform: none; }
.field input, .field textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 11px 12px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.35 var(--text);
  appearance: none;
  -webkit-appearance: none;
  caret-color: var(--ink);
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.field [aria-invalid="true"] { border-width: 3px; padding: 10px 11px; }
.field--short input { max-width: 7.5em; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.unit-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.unit { position: relative; display: block; }
.unit > span {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.unit input { padding-right: 38px; }
.field__error, .check .field__error {
  margin-top: 6px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}
.field__error::before { content: "\2014\00a0"; }

.check {
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--light);
}
.check:first-of-type { border-top: 0; padding-top: 0; }
.check > input {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper) no-repeat center / 18px 18px;
  cursor: pointer;
}
.check > input:checked {
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M3 9.5l4 4 8-9' fill='none' stroke='%23F5F2E9' stroke-width='2.6' stroke-linecap='square'/%3E%3C/svg%3E");
}
.check > input[aria-invalid="true"] { border-width: 3px; }
.check > label { font-size: 15px; line-height: 1.4; padding-top: 3px; cursor: pointer; }
.check > .statement, .check > .field__error { grid-column: 2; }
.statement { margin-top: 8px; font-size: 14px; }
.statement summary {
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  list-style: none;
}
.statement summary::-webkit-details-marker { display: none; }
.statement p { margin-top: 8px; padding: 10px 12px; border: 1.5px solid var(--ink); background: var(--paper); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.submit { margin-top: 8px; padding-top: 14px; border-top: var(--rule-thick) solid var(--ink); }
.submit .slip { width: 100%; cursor: pointer; }
.submit .slip:disabled { opacity: 0.6; cursor: progress; }
.form-status {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  font-weight: 700;
  font-size: 15px;
}
#turnstile:not(:empty) { margin-top: 12px; }

/* ---------- Recorder ---------- */
.rec-doc .step > * + * { margin-top: 14px; }
.prompt {
  padding: 14px 16px;
  border: 3px solid var(--ink);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.35;
}
.prompt--small { font-size: 15px; padding: 10px 12px; border-width: 2px; }
.choices { display: grid; gap: 8px; }
.choices .slip, .step > .slip { width: 100%; cursor: pointer; }
.aside { font-size: 14px; }
.notice { font-weight: 700; font-size: 16px; padding: 12px 14px; border: 3px solid var(--ink); }
.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
  cursor: pointer;
}

.stage {
  position: relative;
  display: grid;
  border: 2px solid var(--ink);
  background: var(--paper);
  min-height: 150px;
  overflow: hidden;
}
.stage--video { background: var(--ink); aspect-ratio: 3 / 4; max-height: 58svh; }
.stage__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror the live preview only; the recording is not mirrored */
}
.stage__count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 900;
  font-size: 120px;
  line-height: 1;
  color: var(--ink);
}
.stage--video .stage__count { color: var(--paper); }
.stage__meter {
  position: relative;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  border-top: 2px solid var(--ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stage:not(.stage--video) .stage__meter { border-top: 0; align-self: center; justify-content: center; flex-wrap: wrap; padding: 28px 12px; }
.stage__time { margin-left: auto; font-family: var(--mono); font-size: 17px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.stage:not(.stage--video) .stage__time { margin-left: 0; flex-basis: 100%; text-align: center; font-size: 40px; order: -1; }
.rec-dot { width: 12px; height: 12px; background: var(--ink); animation: rec-blink 1s steps(1, end) infinite; }
@keyframes rec-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }

.upload { padding: 12px 14px; border: 2px solid var(--ink); margin-bottom: 18px; }
.upload__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.upload__label { font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.upload__pct { font-family: var(--mono); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.upload__bar { height: 12px; border: 2px solid var(--ink); }
.upload__fill { height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease-out; }
.upload .linkish { margin-top: 10px; font-size: 14px; }

/* ---------- Central axis on every page (long prose excepted) ---------- */
.doc__title { text-align: center; }
.doc__back { text-align: center; }
.form-lede, .block__title { text-align: center; }
.received p, .rec-doc .prompt, .rec-doc .aside, .rec-doc .notice { text-align: center; }
.ref-slip { flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.stage__meter { justify-content: center; }
.stage__time { margin-left: 0; }
.stage--video .stage__meter .stage__time { margin-left: 8px; }

/* ---------- Player: our own playback controls ---------- */
.player { border: 2px solid var(--ink); }
.player__screen {
  position: relative;
  background: var(--ink);
  aspect-ratio: 3 / 4;
  max-height: 56svh;
  margin-inline: auto;
  cursor: pointer;
}
.player__screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.player__face { display: grid; place-items: center; padding: 26px 12px 18px; }
.player__big { font-family: var(--mono); font-weight: 700; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.player__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
}
.player--video .player__bar { border-top: 2px solid var(--ink); }
.player__btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  touch-action: manipulation;
}
.player__btn svg { width: 20px; height: 20px; }
.player__btn:active { opacity: 0.78; }
.player__track {
  flex: 1;
  position: relative;
  height: 16px;
  border: 2px solid var(--ink);
  cursor: pointer;
  touch-action: none;
}
.player__track::before { content: ""; position: absolute; inset: -14px 0; } /* bigger touch target */
.player__fill { height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.player__time { flex: none; font-family: var(--mono); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
