/* comped — on the house. bone canvas, ink type, one felt-green accent, the chip as the only ornament. */
:root {
  --canvas: #f5f3ee;       /* bone: the page */
  --surface: #ffffff;      /* cards, inputs */
  --raised: #fbfaf7;       /* quiet fills inside cards */
  --border: #dedad1;
  --border-strong: #c4bfb3;
  --text: #141414;
  --text-2: #57544c;       /* 7.0:1 on canvas */
  --text-3: #6b675e;       /* 5.3:1 on canvas, 5.8:1 on white */
  --accent: #0a6847;       /* felt green, 6.7:1 on white */
  --accent-hover: #08553a;
  --accent-tint: #e4efe9;
  --focus: #0a6847;
  --success: #0a6847;
  --warning: #8a5a00;
  --error: #b42318;        /* 6.5:1 on white */
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  /* spacing, 4px base */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --radius: 10px; --radius-s: 6px;
  --page: 760px;
  --gutter: clamp(16px, 5vw, 32px);
  --section: clamp(56px, 9vw, 96px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; scroll-padding-top: 80px; }
body {
  background: var(--canvas); color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ── page frame ── */
.receipt { width: min(var(--page), 100%); margin: 0 auto; padding: 0 var(--gutter) var(--s8); }

/* ── top bar ── */
.store {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); flex-wrap: wrap;
  margin: 0 calc(var(--gutter) * -1); padding: var(--s3) var(--gutter);
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; }
.logo img { width: 32px; height: 32px; display: block; }
.logo b { font-weight: 800; font-size: 24px; letter-spacing: -.04em; line-height: 1; transform: translateY(-1px); }
.store .addr { font: 500 13px var(--mono); color: var(--accent); background: var(--accent-tint); padding: 2px var(--s2); border-radius: 999px; margin-right: auto; }
nav { display: flex; flex-wrap: wrap; gap: 0 var(--s4); font-size: 14px; font-weight: 500; }
nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--text-2); }
nav a:hover, nav a.on { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }

/* section breaks */
.cut { border: 0; border-top: 1px solid var(--border); margin: var(--section) 0 var(--s7); }

/* ── hero ── */
.hero { position: relative; padding-top: clamp(48px, 10vw, 112px); }
.status { display: inline-flex; align-items: center; gap: var(--s2); font: 500 13px var(--mono); color: var(--text-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; }
.status.pulse { color: var(--accent); }
.status.pulse::before { background: var(--accent); animation: blink 2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
h1 {
  position: relative; z-index: 1;
  margin-top: var(--s4); max-width: 11ch;
  font: 900 clamp(52px, 11vw, 104px)/.9 var(--sans); letter-spacing: -.055em; text-wrap: balance;
}
h1 em { font-style: normal; color: var(--accent); }
.lede { position: relative; z-index: 1; margin-top: var(--s5); max-width: 44ch; color: var(--text-2); font-size: 18px; text-wrap: pretty; }
.actions { position: relative; z-index: 1; margin-top: var(--s6); display: flex; flex-wrap: wrap; gap: var(--s3); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 var(--s5);
  background: var(--accent); color: #fff; text-decoration: none; border: 1px solid var(--accent); border-radius: var(--radius-s);
  font: 600 15px var(--sans); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { border-color: var(--text); }
.btn[disabled] { opacity: .55; cursor: wait; }

/* the chip: the one loud moment */
.stamp-wrap { position: absolute; right: 0; bottom: 0; width: 190px; pointer-events: none; }
.stamp { display: block; width: 100%; height: auto; filter: drop-shadow(0 22px 28px rgba(10, 60, 40, .22)); animation: toss .9s var(--ease) .25s both; }
@keyframes toss { from { transform: translateY(-40px) rotate(-120deg); opacity: 0; } to { transform: rotate(-12deg); opacity: 1; } }

/* ── sections ── */
.sec-title { font: 800 clamp(30px, 5vw, 40px)/1.05 var(--sans); letter-spacing: -.035em; }
.sec-sub { margin-top: var(--s2); color: var(--text-2); font-size: 15px; }
h3.sec-sub { font-weight: 600; color: var(--text); font-size: 15px; }
.note { margin-top: var(--s4); color: var(--text-2); font-size: 15px; max-width: 64ch; }

/* stats ledger */
.items { list-style: none; margin-top: var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.item { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s4) var(--s5); border-top: 1px solid var(--border); }
.item:first-child { border-top: 0; }
.item .k { color: var(--text-2); white-space: nowrap; }
.item .lead { flex: 1; }
.item .v { white-space: nowrap; font: 600 16px var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.item .v small { font-weight: 500; color: var(--text-3); margin-left: var(--s1); }
.item.big { padding-block: var(--s5); }
.item.big .k { color: var(--text); font-weight: 700; font-size: 18px; }
.item.big .v { font: 800 36px/1 var(--sans); letter-spacing: -.03em; color: var(--accent); }
.item.big .v small { font: 600 16px var(--mono); letter-spacing: 0; }
.ca { margin-top: var(--s5); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); padding: var(--s3) var(--s4); background: var(--accent-tint); border-radius: var(--radius-s); }
.ca span { word-break: break-all; font: 500 14px var(--mono); }
.ca button { min-height: 40px; padding: 0 var(--s3); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-s); cursor: pointer; font-size: 14px; font-weight: 600; }
.ca button:hover { border-color: var(--text); }

/* ── how it works ── */
.steps { list-style: none; margin-top: var(--s5); counter-reset: step; display: grid; gap: var(--s5); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: var(--s4); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent); font: 700 15px var(--mono);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.steps h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: 36px; }
.steps p { color: var(--text-2); max-width: 60ch; }
.meter { margin-top: var(--s6); padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.meter-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s1) var(--s3); font: 500 13px var(--mono); color: var(--text-2); margin-bottom: var(--s3); }
.cells { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; }
.cells i { height: 16px; border-radius: 2px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--border); }
.cells i.f { background: var(--accent); box-shadow: none; }

/* ── claim panel ── */
.panel { margin-top: var(--s5); display: grid; gap: var(--s6); padding: var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step > p { color: var(--text-2); max-width: 62ch; }
.step > p.hint { margin-top: var(--s4); font-size: 14px; color: var(--text-3); }
.step .btn { margin-top: var(--s4); }
.msg { margin-top: var(--s3); min-height: 1.2em; font-size: 14px; }
.msg.err { color: var(--error); }
.kv { display: grid; }
.kv div { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.kv div:first-child { border-top: 0; }
.kv span { white-space: nowrap; color: var(--text-2); }
.kv i { flex: 1; }
.kv b { text-align: right; word-break: break-all; font: 600 15px var(--mono); }
.fields { margin-top: var(--s4); display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.fields label { display: grid; gap: var(--s2); font-size: 14px; font-weight: 600; }
.fields label.wide { grid-column: 1 / -1; }
.fields input, .fields select {
  min-height: 48px; padding: var(--s3); width: 100%; font-size: 16px; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-s);
}
.fields input:hover, .fields select:hover { border-color: var(--text-3); }
.fields input:focus, .fields select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.fields input[type=file] { padding: var(--s2); }
.step h3 { font-size: 15px; font-weight: 700; margin-bottom: var(--s2); }

/* ── payouts ── */
.history, .returns { list-style: none; display: grid; }
.history li, .returns li {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4);
  padding: var(--s4) 0; border-bottom: 1px solid var(--border); font-size: 15px;
}
.returns { margin-top: var(--s5); border-top: 1px solid var(--border); }
.returns li span:nth-child(2) { font-family: var(--mono); font-size: 14px; }
.returns li.empty, .history li.empty { color: var(--text-3); justify-content: flex-start; }
.returns a, .history a { font-size: 14px; font-weight: 600; color: var(--accent); }
.tag-paid { color: var(--accent); font-weight: 700; font-size: 13px; background: var(--accent-tint); padding: 2px var(--s2); border-radius: 999px; }
.tag-rejected { color: var(--error); }
.tag-s { color: var(--text-2); }

/* ── rules (native disclosure) ── */
.rules { margin-top: var(--s5); border-top: 1px solid var(--border); }
.rules details { border-bottom: 1px solid var(--border); }
.rules summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s4); min-height: 56px; padding: var(--s3) 0; font-weight: 700; font-size: 17px; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: "+"; font: 400 22px var(--mono); color: var(--text-2); }
.rules details[open] summary::after { content: "−"; }
.rules details p { padding-bottom: var(--s5); color: var(--text-2); max-width: 64ch; }

/* ── footer ── */
.foot { display: grid; gap: var(--s3); justify-items: start; }
.barcode { width: 40px; height: 40px; background: url(logo.svg) center / contain no-repeat; }
.foot p { color: var(--text-2); font: 500 13px var(--mono); }
.foot .thanks { font: 800 28px/1 var(--sans); letter-spacing: -.035em; color: var(--text); }
.foot nav { margin-left: calc(var(--s1) * -1); }

.reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 720px) {
  .store { justify-content: center; }
  nav { justify-content: center; gap: 0 var(--s3); font-size: 13px; }
  .stamp-wrap { display: none; }
  .item, .item.big { padding-inline: var(--s4); }
  .item.big .v { font-size: 28px; }
  .panel { padding: var(--s4); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .stamp { transform: rotate(-12deg); }
  .reveal { opacity: 1; transform: none; }
}
