/* =========================================================================
   Pocaproof - design system
   One webfont (JetBrains Mono, weight 500) for code/strings; system sans for
   prose. Warm paper palette, a single rationed rose accent.
   ========================================================================= */

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: optional; /* preloaded + tiny: render with it or the fallback, never a swap (no FOUT, no CLS) */
}

:root {
  /* Neutral palette - warm paper stock */
  --bg: #fef7f2;
  --surface: #ffffff;
  --surface-2: #faf4ef;
  --ink-1: #16161a;
  --ink-2: #54555e;
  --ink-3: #696a72; /* AA: ~5:1 on --bg for small text */
  --hairline: #ece4dc;
  --hairline-2: #e0d6cb;

  /* Single accent - warm rose */
  --accent: #f43f5e;       /* rose-500: dots, fills, fingerprint hits */
  --accent-ink: #be123c;   /* rose-700: accent text (AA on warm bg + white) */
  --accent-weak: #fff1f2;  /* rose-50: badge / selected fill */
  --accent-line: #fecdd3;  /* rose-200: badge / selected border */

  /* Error state */
  --danger: #b42318;
  --danger-weak: #fdf3f2;

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Spacing scale (8px base) */
  --s-4: 4px;  --s-8: 8px;  --s-12: 12px; --s-16: 16px; --s-20: 20px;
  --s-24: 24px; --s-32: 32px; --s-40: 40px; --s-56: 56px; --s-64: 64px;

  /* Radii */
  --r-card: 16px;
  --r-note: 12px;
  --r-ctl: 10px;
  --r-pill: 999px;

  /* Elevation - the receipt is the sole lifted object */
  --shadow-card: 0 1px 2px rgba(20, 20, 26, 0.05), 0 8px 24px -8px rgba(20, 20, 26, 0.1);
  --shadow-cta: 0 1px 2px rgba(244, 63, 94, 0.18);

  --gutter: 20px;
  --col: 600px;       /* readable text column */
  --hero-col: 1040px; /* wider hero band */
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  overflow-x: clip;
}

.skip {
  position: absolute; top: 8px; left: 8px; z-index: 30;
  padding: 8px 14px; border-radius: 8px;
  background: var(--ink-1); color: var(--surface); font-size: 14px;
  clip-path: inset(50%);
}
.skip:focus { clip-path: none; }
h1, h2 { color: var(--ink-1); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- Layout primitives --------------------------------------------------- */
.wrap { width: 100%; max-width: var(--col); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--s-56); }
.section + .section { padding-top: 0; }
main { padding-bottom: var(--s-24); }

.note-line { font-size: 14px; color: var(--ink-3); margin-top: var(--s-20); }
.section__h { font-size: 20px; margin-bottom: var(--s-16); }

/* ---- Status bar ---------------------------------------------------------- */
.statusbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.statusbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; max-width: var(--hero-col);
}
.statusbar__mark {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.04em; color: var(--ink-1);
}
.statusbar__by {
  font-size: 14px; color: var(--ink-2); text-decoration: none;
}
.statusbar__by:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); flex: none; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { padding-block: var(--s-40) var(--s-56); }
.hero__inner {
  width: 100%; max-width: var(--hero-col); margin-inline: auto; padding-inline: var(--gutter);
  display: grid; gap: var(--s-40);
}
.hero__title {
  font-size: clamp(28px, 7vw, 40px); line-height: 1.1; max-width: 14ch;
  margin-bottom: var(--s-20);
}
.hero__sub { font-size: 17px; line-height: 1.5; color: var(--ink-2); max-width: 42ch; }
.hero__sub + .hero__sub { margin-top: var(--s-12); }

.textlink {
  display: inline-flex; align-items: baseline; gap: 6px; margin-top: var(--s-24);
  font-size: 15px; font-weight: 500; color: var(--accent-ink);
  text-decoration: none;
}
.textlink__arrow, .btn__arrow { font-family: var(--mono); }
.textlink:hover { text-decoration: underline; text-underline-offset: 3px; }

.inlink { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

.hero__demo { display: flex; flex-direction: column; align-items: center; }
.demo__h { align-self: flex-start; font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: var(--s-12); }

@media (min-width: 768px) {
  .hero__inner { grid-template-columns: 1fr minmax(320px, 360px); align-items: center; gap: var(--s-56); }
  .hero__demo { align-items: stretch; }
}

/* ---- Definition list (what you get) -------------------------------------- */
.deflist { display: grid; gap: 0; }
.deflist__row { display: grid; gap: 4px; padding-block: var(--s-16); border-top: 1px solid var(--hairline); }
.deflist__row:first-child { border-top: 0; }
.deflist dt {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}
.deflist dd { font-size: 15px; color: var(--ink-1); }

/* ---- Disclaimer (verbatim) ----------------------------------------------- */
.disclaimer {
  background: var(--surface); border: 1px solid var(--hairline-2);
  border-radius: var(--r-note); padding: var(--s-20);
}
.disclaimer p { font-size: 14px; line-height: 1.6; color: var(--ink-2); }

/* ---- Steps / how it works ------------------------------------------------ */
.steps { position: relative; list-style: none; padding: 0; }
.steps::before {
  content: ""; position: absolute; left: 6px; top: 10px; bottom: 14px;
  width: 1px; background: var(--hairline-2);
}
.step { position: relative; display: flex; gap: var(--s-12); padding-left: 28px; padding-bottom: var(--s-20); }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 0; top: 4px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--ink-2); box-shadow: 0 0 0 4px var(--bg);
}
.step--last::before { background: var(--accent); }
.step__n { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink-3); flex: none; }
.step__text { font-size: 14px; line-height: 1.5; color: var(--ink-2); }

/* ---- The receipt --------------------------------------------------------- */
.receipt {
  position: relative; width: 100%; max-width: 360px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--hairline-2);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
}

.receipt__band {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding-inline: var(--s-20);
  background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  border-radius: var(--r-card) var(--r-card) 0 0;
}
.receipt__kind {
  display: inline-flex; align-items: center; gap: var(--s-8);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
}
.receipt__kind .dot { background: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px;
  padding-inline: 9px; border-radius: var(--r-pill);
  background: var(--accent-weak); border: 1px solid var(--accent-line);
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.badge__text {
  font-family: var(--mono); font-size: 10px; line-height: 1; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink);
  white-space: nowrap;
}

.receipt__hero { padding: var(--s-24) var(--s-20) var(--s-20); }
.receipt__label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s-12);
}
.receipt__hero .receipt__label { margin-bottom: var(--s-8); }
.receipt__code { display: flex; align-items: center; gap: var(--s-12); }
.code {
  font-family: var(--mono); font-size: 34px; line-height: 1.06; font-weight: 500;
  letter-spacing: 0.02em; color: var(--ink-1); font-variant-numeric: tabular-nums;
}
.code .hy { color: var(--ink-3); }
.copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid var(--hairline); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink-3); cursor: pointer; flex: none;
  transition: color 120ms ease, border-color 120ms ease;
}
.copy:hover { color: var(--ink-1); border-color: var(--hairline-2); }
.copy.is-copied { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-weak); }
.receipt__label.is-copied { color: var(--accent-ink); }

/* Die-cut perforation: page colour bitten into both card edges, dashed line
   passing between the notches; the card's shadow continues unbroken. */
.receipt__perf { position: relative; height: 0; margin-block: var(--s-4); border-top: 1px dashed var(--hairline-2); }
.receipt__perf::before, .receipt__perf::after {
  content: ""; position: absolute; top: 0; width: 14px; height: 14px;
  border-radius: 50%; background: var(--bg); transform: translateY(-50%);
}
.receipt__perf::before { left: -8px; box-shadow: inset -1px 0 0 var(--hairline-2); }
.receipt__perf::after { right: -8px; box-shadow: inset 1px 0 0 var(--hairline-2); }

.receipt__rows { padding-inline: var(--s-20); }
.receipt__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-16);
  height: 44px; border-top: 1px solid var(--hairline);
}
.receipt__row:first-child { border-top: 0; }
.receipt__row dt {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.receipt__row dd { font-family: var(--mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.v-strong { color: var(--ink-1); }
.v-status { color: var(--accent-ink); font-weight: 500; }
.v-hash { color: var(--ink-2); font-size: 12px; }
.v-mock { opacity: 0.5; } /* this receipt is a UI mock; placeholder values are faded */

.receipt__fp { padding: var(--s-20); border-top: 1px solid var(--hairline); }
.fp { width: 100%; height: 20px; }
.fp .b { fill: var(--ink-2); }
.fp .a { fill: var(--accent); }
.fp__cap { font-family: var(--mono); font-size: 9px; letter-spacing: 0.02em; color: var(--ink-3); margin-top: var(--s-8); }

.receipt__seal {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-12);
  min-height: 32px; padding: var(--s-8) var(--s-20);
  background: var(--surface-2); border-top: 1px solid var(--hairline);
  border-radius: 0 0 var(--r-card) var(--r-card);
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
}
.receipt__verify { text-align: right; }

.receipt-caption {
  margin-top: var(--s-16); text-align: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; color: var(--ink-3);
}

/* ---- Brand line ---------------------------------------------------------- */
.brandline { font-size: 14px; color: var(--ink-2); }

/* ---- Recent receipts (hidden until real ones exist) ---------------------- */
.recent__grid { display: grid; gap: var(--s-12); }
.rcard {
  display: grid; gap: 4px; padding: var(--s-16);
  background: var(--surface); border: 1px solid var(--hairline-2); border-radius: var(--r-note);
  text-decoration: none; color: var(--ink-2);
}
.rcard:hover { border-color: var(--accent-line); }
.rcard__handle { font-family: var(--mono); font-size: 13px; color: var(--ink-1); }
.rcard__card { font-size: 14px; color: var(--ink-1); }
.rcard__date { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.rcard__verify { font-size: 13px; color: var(--accent-ink); }
@media (min-width: 768px) {
  .recent__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Slots --------------------------------------------------------------- */
.slots { margin-bottom: var(--s-8); }
.slots__cells { display: inline-flex; gap: 6px; }
.slot { width: 10px; height: 10px; border-radius: 2px; }
.slot--open { background: var(--accent); }
.slot--taken { background: transparent; border: 1px solid var(--hairline-2); }
.slots__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; color: var(--ink-3); margin-bottom: var(--s-24); }

/* ---- Form ---------------------------------------------------------------- */
.form { display: grid; gap: var(--s-24); }
.field { display: grid; gap: var(--s-8); border: 0; padding: 0; min-width: 0; }
.field > label, .field legend {
  font-size: 14px; font-weight: 500; color: var(--ink-1); padding: 0;
}
.field .hint { margin-top: -2px; }

.field input[type="text"] {
  width: 100%; height: 48px; padding-inline: var(--s-16);
  font-family: var(--sans); font-size: 16px; color: var(--ink-1);
  background: var(--surface); border: 1px solid var(--hairline-2); border-radius: var(--r-ctl);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.field input::placeholder { color: var(--ink-3); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-weak); }

.hint { font-size: 12px; color: var(--ink-3); }
.error { font-size: 13px; color: var(--danger); }

/* Platform segmented control */
.field--platform { display: grid; gap: var(--s-8); }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-8); }
.seg__opt { position: relative; display: block; }
.seg__opt input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.seg__opt span {
  display: flex; align-items: center; justify-content: center; height: 44px;
  font-size: 14px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--hairline-2); border-radius: var(--r-ctl);
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}
.seg__opt input:hover + span { border-color: var(--hairline-2); color: var(--ink-1); }
.seg__opt input:checked + span { border-color: var(--accent); background: var(--accent-weak); color: var(--accent-ink); font-weight: 500; }
.seg__opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-8);
  width: 100%; height: 52px; margin-top: var(--s-4);
  font-size: 15px; font-weight: 600; color: var(--surface);
  background: var(--ink-1); border: 0; border-radius: var(--r-note); cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-cta); }
.btn[aria-busy="true"] { opacity: 0.72; cursor: progress; }
.btn[disabled] { cursor: not-allowed; }

.form__status { font-size: 13px; color: var(--danger); min-height: 1px; }
.form__status:empty { display: none; }

.success {
  display: grid; gap: var(--s-8);
  background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--r-note);
  padding: var(--s-24);
}
.success__mark { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--accent-ink); }
.success__text { font-size: 15px; color: var(--ink-2); }

/* ---- Footer -------------------------------------------------------------- */
.footer { border-top: 1px solid var(--hairline); padding-block: var(--s-32); margin-top: var(--s-24); }
.footer__mark { font-size: 13px; color: var(--ink-2); margin-bottom: var(--s-8); }
.footer__legal { font-size: 11px; color: var(--ink-3); }

/* ---- Wider viewports ----------------------------------------------------- */
@media (min-width: 768px) {
  :root { --gutter: 24px; }
  .section, .hero { padding-block: var(--s-64); }
  .hero { padding-top: var(--s-56); }
  .seg { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Motion preferences -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
