/* Two inks only. Every in-between tone is a dither pattern, never a grey. */
:root {
  --ink: #fff;
  --paper: #000;
  --d50: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='2' height='2' fill='%23fff'/%3E%3Crect x='2' y='2' width='2' height='2' fill='%23fff'/%3E%3C/svg%3E");
  --d25: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' fill='%23fff'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23fff'/%3E%3C/svg%3E");
  --px: 4px; /* the page's pixel */
  --text: 'Geist', system-ui, sans-serif;
  --display: 'Jersey 20', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font: 400 18px/1.5 var(--text);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 clamp(16px, 4vw, 48px);
}
a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
:focus-visible { outline: var(--px) solid var(--ink); outline-offset: var(--px); }

header, footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; flex-wrap: wrap; }
header .brand span { display: inline-block; margin-left: 12px; padding: 0 8px; background: var(--ink); color: var(--paper); font-weight: 600; }
header .meta { display: flex; align-items: center; gap: 16px; }
#live { width: 12px; height: 12px; background: var(--d50); }
#live.on { background: var(--ink); }

main { display: grid; gap: 40px; align-content: start; }

.hero { min-height: min(52vh, 560px); display: grid; align-items: center; }
.figure { text-align: center; }
.total {
  margin: 0;
  font: 400 clamp(64px, 14vw, 224px)/0.9 var(--display);
  font-variant-numeric: tabular-nums;
}
.under { margin: 12px 0 0; display: flex; justify-content: center; min-height: 27px; }
#rate:empty { display: none; }

/* claimed vs claimable */
.split { max-width: 880px; width: 100%; margin: 0 auto; }
.bar { height: 20px; border: var(--px) solid var(--ink); padding: 2px; background: var(--paper); background-image: var(--d25); background-origin: content-box; background-clip: content-box; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 700ms cubic-bezier(.2,.8,.2,1); }
.legend { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; }
.legend div { display: grid; gap: 2px; }
.legend div:last-child { text-align: right; }
.legend b { font: 400 40px/1 var(--display); }

/* live log */
.log { max-width: 880px; width: 100%; margin: 0 auto 24px; }
#feed { list-style: none; margin: 0; padding: 0; display: grid; }
.row { display: grid; grid-template-columns: 9ch 7ch 1fr; gap: 16px; padding: 6px 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.row .amt { justify-self: end; font-weight: 600; }
.row.new { background: var(--ink); color: var(--paper); }
.row.sweep { border-left: var(--px) solid var(--ink); }
.row.claim { background: var(--d50); }
.row.claim .kind, .row.claim time, .row.claim .amt { background: var(--paper); padding: 0 4px; }

footer a { border-bottom: 2px solid var(--ink); }

/* the fly flies over everything and never blocks a click */
#fly { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 10; image-rendering: pixelated; image-rendering: crisp-edges; }

body:not(.ready) .split, body:not(.ready) .log { visibility: hidden; }
.total:empty::before { content: 'R$'; background: var(--d50); color: transparent; -webkit-background-clip: text; background-clip: text; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { min-height: 44vh; }
  .total { font-size: 12.5vw; }
  .legend b { font-size: 30px; }
  .row { grid-template-columns: 8ch 6ch 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar i { transition: none; }
}
