/* GRIFT burn tracker — dressed in the grift.world homepage palette (css/city-switchboard.css):
   a near-black olive ground, cream ink, a warm gold accent, tan mono labels, and one sand section.
     cream  --ink     every figure
     tan    --amb     every label, rule and wire
     gold   --burn    the burn figures and their marks (the homepage accent)
   (--amb and --burn keep their names from the first layout; they now carry these colours.)
   Type follows the site too: pixel face for headings and figures, mono for labels, sans for sentences. */

:root {
  color-scheme: dark;
  --void: #0c0d0c;
  --panel: #151712;
  --panel-2: #1c1e18;
  --edge: #2e2f27;
  --edge-2: #35332d;
  --edge-3: #484833;
  --ink: #e8dfcf;
  --ink-2: #cfc6b3;
  --ink-3: #a6a295;
  --ink-4: #6f6c60;
  --amb: #b59b7d;
  --amb-a: rgba(195, 173, 123, .08);
  --amb-b: #b18b5c;
  --accent-rgb: 210, 163, 105;
  --accent: rgb(var(--accent-rgb));
  --accent-a: rgba(var(--accent-rgb), .12);
  --burn: var(--accent);
  --burn-a: rgba(var(--accent-rgb), .16);
  --hi: #e7c899;
  --paid: #5d5a4c;
  --danger: #c76b54;
  --sand: #b4a078;
  --f: 'Pixelify Sans', 'Arial Narrow', sans-serif;
  --s: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --m: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--void); color: var(--ink); }
body { font-family: var(--s); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100dvh; padding-bottom: calc(46px + env(safe-area-inset-bottom)); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--amb-b); text-underline-offset: 3px; }
h1, h2, p { margin: 0; }
.mono { font-family: var(--m); }
.lab { font-family: var(--m); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--amb); }
.sub { font-size: 12px; color: var(--ink-3); }

/* ---- the ground: dark olive, warmed from above like the homepage ---- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(195, 148, 98, .10), transparent 72%),
    radial-gradient(50% 50% at 50% 55%, rgba(84, 70, 48, .14), transparent 75%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .5) 100%),
    var(--void); }
.bg::after { content: ''; position: absolute; inset: 0; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>"); }

/* ---- header bar ---- */
.ctx { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 64px; padding: 0 4vw; border-bottom: 1px solid var(--edge-2); background: rgba(12, 13, 12, .8); backdrop-filter: blur(6px);
  font-family: var(--m); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: #a69d8e; }
.ctx-loc { display: flex; gap: 12px; align-items: baseline; }
.ctx-brand { font-family: var(--f); font-size: 22px; letter-spacing: .02em; text-transform: none; color: var(--ink); }
.ctx-links { display: flex; gap: 26px; }
.ctx-links a:hover { color: var(--ink); text-decoration: none; }

.page { position: relative; z-index: 2; padding: 18px 4vw 28px; max-width: 1800px; margin: 0 auto; }

/* ---- every source of burn, one tile each ---- */
.src { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding-bottom: 18px; }
.sr { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 9px 12px 8px; border: 1px solid var(--edge-2); border-radius: 3px; background: var(--panel); }
.sr:hover, .sr:focus-visible { border-color: var(--amb-b); outline: none; text-decoration: none; }
.srl { font-family: var(--m); font-size: 9.5px; letter-spacing: .13em; color: var(--amb); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srn { font-family: var(--f); font-weight: 700; font-size: 18px; line-height: 1.05; color: var(--burn); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr24 { font-family: var(--m); font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr24 i { font-style: normal; font-size: 9px; letter-spacing: .13em; color: var(--ink-4); margin-left: 4px; }
.sr.quiet .sr24 { color: var(--ink-4); }

/* ---- the top: brand, the burn, the dead address ---- */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 24px; padding: 10px 0 26px; }
.brand { display: flex; flex-direction: column; gap: 8px; align-self: start; }
.mark { display: flex; align-items: baseline; gap: 14px; }
.mark span { font-family: var(--f); font-weight: 700; font-size: 20px; color: var(--ink); }
.mark h1 { font-family: var(--f); font-weight: 400; font-size: 20px; color: var(--hi); }
.live { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; font-family: var(--m); font-size: 10px; letter-spacing: .13em; color: var(--ink-4); }
.live b { font-weight: 400; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-a); animation: breathe 2.6s ease-in-out infinite; }
.dot.off { background: var(--ink-4); box-shadow: none; animation: none; }
.dot.bad { background: var(--danger); box-shadow: none; animation: none; }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px rgba(var(--accent-rgb), .05); opacity: .7 } }

.burn { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.hero3d { position: relative; width: 300px; height: 300px; max-width: 100%; margin: -40px 0 -30px; opacity: 0; transition: opacity .8s ease; }
.hero3d.ready { opacity: 1; }
.hero3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.burnnum { display: block; font-family: var(--f); font-weight: 700; font-size: clamp(30px, 6.6vw, 112px); line-height: .9; letter-spacing: -.03em; color: var(--burn);
  font-variant-numeric: tabular-nums; text-shadow: 0 0 60px rgba(var(--accent-rgb), .22); }
.burnnum.hit { animation: hit .9s ease-out; }
@keyframes hit { 0% { transform: scale(1.035); color: var(--hi); text-shadow: 0 0 90px rgba(var(--accent-rgb), .6) } 100% { transform: none } }
.bsplit { display: flex; gap: 24px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.bs { font-family: var(--m); font-size: 10px; letter-spacing: .13em; color: var(--ink-4); }
.bs b { margin-left: 7px; font-family: var(--f); font-size: 14px; letter-spacing: .02em; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.dead { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; align-self: start; text-align: right; }
.pk { font-family: var(--f); font-weight: 700; font-size: clamp(26px, 2.7vw, 44px); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.pk small { font-family: var(--m); font-weight: 400; font-size: 10px; letter-spacing: .13em; margin-left: 8px; color: var(--amb); }

.error { border: 1px solid var(--danger); color: var(--danger); background: var(--panel); padding: 10px 14px; margin-bottom: 14px; border-radius: 3px; font-family: var(--m); font-size: 11px; letter-spacing: .1em; }

/* ---- the floor: panels ---- */
.floor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.term { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 14px;
  background: var(--panel); border: 1px solid var(--edge-2); border-radius: 3px; }
.term.wide { grid-column: 1 / -1; }
.ch { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ch h2 { margin-top: 6px; font-family: var(--f); font-weight: 400; font-size: clamp(20px, 1.7vw, 28px); line-height: 1.1; color: var(--ink); }
.st { flex: none; font-family: var(--m); font-size: 9.5px; letter-spacing: .13em; padding: 6px 10px; border-radius: 2px; border: 1px solid var(--edge-3); color: var(--ink-3); }
.seg { display: inline-flex; gap: 6px; }
.seg button { border: 1px solid var(--edge-3); border-radius: 2px; background: transparent; color: var(--ink-3); padding: 7px 11px; font-family: var(--m); font-size: 9.5px; letter-spacing: .14em; cursor: pointer; }
.seg button:hover { border-color: var(--amb-b); color: var(--hi); }
.seg button.on { border-color: var(--amb-b); background: var(--accent-a); color: var(--hi); }
.legend { display: flex; gap: 16px; font-family: var(--m); font-size: 10px; letter-spacing: .13em; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; }

/* ---- the sand section, after the homepage's "one connected economy" block ---- */
.term.sand {
  --ink: #20251b; --ink-2: #2f3626; --ink-3: #454c37; --ink-4: #5d6249;
  --edge: rgba(32, 37, 27, .18); --edge-2: rgba(32, 37, 27, .22); --edge-3: rgba(32, 37, 27, .4);
  --amb: #454c37; --amb-b: #20251b; --burn: #20251b; --hi: #20251b; --accent-a: rgba(32, 37, 27, .1);
  background: var(--sand); border-color: transparent; padding: 34px 4vw 26px; margin: 10px calc(-4vw - 1px); border-radius: 0;
}
.term.sand .ch h2 { font-size: clamp(28px, 3vw, 46px); }
.term.sand .sub { font-size: 13px; max-width: 560px; }

/* ---- charts ---- */
.chart { position: relative; width: 100%; min-height: 220px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .empty { display: grid; place-items: center; min-height: 220px; color: var(--ink-4); text-align: center; padding: 0 20px; font-family: var(--m); font-size: 11px; letter-spacing: .1em; line-height: 1.8; }
.axis text { fill: var(--ink-4); font-family: var(--m); font-size: 10px; letter-spacing: .04em; }
.gridline { stroke: var(--edge); stroke-width: 1; }
.lbl { fill: var(--ink-2); font-family: var(--m); font-size: 10.5px; letter-spacing: .1em; }
.val { fill: var(--ink); font-family: var(--f); font-size: 12px; font-variant-numeric: tabular-nums; }
.hit { fill: transparent; }
.row:hover .mark { opacity: .8; }
.cross { stroke: var(--amb-b); stroke-width: 1; stroke-dasharray: 3 3; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { font-family: var(--m); font-weight: 400; font-size: 9.5px; letter-spacing: .13em; color: var(--amb); text-align: left; padding: 0 12px 9px 0; white-space: nowrap; }
td { padding: 9px 12px 9px 0; border-top: 1px solid var(--edge); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
td.r, th.r { text-align: right; }
td.amt { font-family: var(--f); font-size: 15px; color: var(--burn); }
td.name { font-family: var(--f); font-size: 14px; color: var(--ink); }
td.hash { font-family: var(--m); font-size: 11px; color: var(--ink-3); }
td time { color: var(--ink-4); font-family: var(--m); font-size: 11px; }
tbody tr:hover td { background: rgba(195, 173, 123, .04); }
tr.in td { animation: slide .8s ease-out; }
@keyframes slide { from { background: var(--accent-a); } }
.tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 2px; border: 1px solid var(--edge-3); font-family: var(--m); font-size: 9px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.up { color: var(--burn); }

/* ---- the tape ---- */
.tape { position: fixed; left: 0; right: 0; bottom: 0; height: calc(46px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); z-index: 4; display: flex; align-items: center; border-top: 1px solid var(--edge-2); background: rgba(12, 13, 12, .95); overflow: hidden; }
.tapelab { flex: none; height: 100%; display: flex; align-items: center; padding: 0 16px 0 4vw; border-right: 1px solid var(--edge-2); font-family: var(--m); font-size: 10px; letter-spacing: .13em; color: var(--amb); background: #0c0d0c; z-index: 1; }
.tapewin { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.tapein { display: inline-flex; white-space: nowrap; animation: tape var(--tape-s, 120s) linear infinite; }
.tapewin:hover .tapein { animation-play-state: paused; }
@keyframes tape { to { transform: translateX(-50%); } }
.tk { display: inline-flex; align-items: baseline; gap: 8px; padding: 0 22px; border-right: 1px solid var(--edge); font-size: 12px; color: var(--ink-3); }
.tk em { font-style: normal; font-family: var(--m); font-size: 9.5px; letter-spacing: .13em; color: var(--amb); }
.tk b { font-family: var(--f); font-weight: 400; font-size: 14px; color: var(--ink); }
.tk.burnt b { color: var(--burn); }
.tk .mono { font-size: 10.5px; color: var(--ink-4); }

/* ---- tooltip ---- */
.tooltip { position: fixed; z-index: 20; pointer-events: none; min-width: 150px; max-width: 280px;
  background: var(--panel-2); color: var(--ink-3); border: 1px solid var(--edge-3); border-radius: 3px;
  padding: 9px 11px; font-size: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
.tooltip .lab { display: block; margin-bottom: 4px; }
.tooltip b { display: block; font-family: var(--f); font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tooltip b.red { color: var(--burn); }
.tooltip .row2 { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tooltip .row2 span:last-child { color: var(--ink); font-family: var(--f); }
.tooltip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

@media (max-width: 1100px) {
  .src { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .burn { grid-column: 1 / -1; grid-row: 1; padding-bottom: 8px; }
}
@media (max-width: 760px) {
  .floor { grid-template-columns: minmax(0, 1fr); }
  .ctx-links { gap: 14px; }
  .top { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .dead { align-items: flex-start; text-align: left; }
}
@media (max-width: 480px) {
  .src { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ctx { min-height: 54px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
  .ctx-brand { font-size: 19px; }
  .term { padding: 16px 14px 12px; }
  .term.sand { padding: 28px 4vw 22px; }
  .hero3d { width: 250px; height: 250px; margin: -30px 0 -22px; }
  .burnnum { font-size: clamp(30px, 10.5vw, 64px); }
  .bsplit { gap: 10px 18px; }
  .tk { padding: 0 16px; }
}
@media (max-width: 400px) {
  .ctx-links { gap: 10px; font-size: 9px; }
  .src { gap: 5px; }
  .sr { padding: 8px 9px 7px; }
  .srn { font-size: 16px; }
  .hero3d { width: 220px; height: 220px; }
  .seg button { padding: 7px 8px; }
}
@media (min-width: 2000px) {
  html { font-size: 112%; }
  .page { max-width: 2100px; }
}
/* touch screens: let a vertical swipe over the particle mark scroll the page;
   OrbitControls sets touch-action inline, hence !important */
@media (pointer: coarse) {
  .hero3d canvas { touch-action: pan-y !important; }
  .seg button, .st { min-height: 34px; }
}

/* ---- credit footer ---- */
.credit { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap;
  margin-top: 22px; padding: 18px 0 6px; border-top: 1px solid var(--edge-2);
  font-family: var(--m); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-4); }
.credit b { font-family: var(--f); font-size: 15px; font-weight: 700; letter-spacing: .02em; text-transform: none; color: var(--hi); margin-left: 4px; }
.credit a { color: var(--ink-3); }
@media (max-width: 760px) { .credit { flex-direction: column; align-items: flex-start; } }
