/* ============================================================
   $PENNY — a financial broadsheet that keeps cutting to a terminal
   Newsprint = the permanent record. Phosphor = the live feed.
   ============================================================ */

@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/Newsreader-var.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-var.woff2') format('woff2-variations');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  /* ---- FT SALMON ground: the permanent record ----
     Taken from the moodboard: the Financial Times' pink stock is THE financial-print
     colour and virtually no crypto site uses it. This is the register in one value. */
  --paper:        #FBE6DC;
  --paper-deep:   #F6DACE;
  --paper-edge:   #EFC9B9;
  --ink:          #1A140D;   /* warm black. real press ink is never #000 */
  --ink-soft:     #574B3C;
  --ink-faint:    #6B5B45;   /* 4.94:1 on --paper-deep. was #8A7A66 = 3.13, failed AA */
  --rule:         #D3A491;
  --rule-hair:    #E6BFAF;

  /* ---- phosphor ground: the live feed ---- */
  --crt:          #0B0B08;
  --crt-raised:   #131310;
  --amber:        #FFB000;
  --amber-dim:    #A87708;   /* 4.98:1 on --crt. was #9A6C08 = 4.24, failed AA */
  --amber-ghost:  #3A2A05;

  /* ---- signal ---- */
  --oxblood:      #7B1E22;
  --gain:         #1F5C33;
  --brass:        #A8823C;

  /* ---- spacing: monotonic, checked ---- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;

  --measure: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', 'Times New Roman', Times, serif;
  font-variation-settings: 'opsz' 16;
  font-size: 17px;
  line-height: 1.5;
  /* paper tooth — flat colour reads as a swatch, not a stock */
  background-image:
    repeating-linear-gradient(0deg, rgba(26,20,13,.020) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(26,20,13,.014) 0 1px, transparent 1px 4px);
}

/* numerals ALWAYS mono — tnum+zero verified on the binary */
.num, td.num, .fig {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'zero' 1;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 var(--s5); }

/* ============================================================
   THE CRAWL — phosphor strip, the live feed
   ============================================================ */
.crawl {
  background: var(--crt);
  color: var(--amber);
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
}
.crawl::after {
  /* scanlines */
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.34) 0 1px, transparent 1px 2px);
  pointer-events: none;
}
.crawl__track {
  display: flex;
  gap: var(--s7);
  white-space: nowrap;
  padding-left: 8%;
  animation: crawl 64s linear infinite;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
@keyframes crawl { to { transform: translateX(-100%); } }
.crawl__item { display: inline-flex; gap: var(--s2); align-items: baseline; }
.crawl__k { color: var(--amber-dim); }
.crawl b { font-weight: 700; color: #FFD066; }

@media (prefers-reduced-motion: reduce) {
  .crawl__track { animation: none; padding-left: var(--s5); }
}

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead { padding: var(--s5) 0 var(--s3); text-align: center; }
.masthead__rule-top,
.masthead__rule-bot { border: 0; border-top: 3px solid var(--ink); margin: 0; }
.masthead__rule-bot { border-top-width: 1px; margin-top: var(--s3); }

.nameplate {
  font-variation-settings: 'opsz' 72, 'wght' 800;
  font-size: clamp(38px, 12.2vw, 148px);
  line-height: .9;
  letter-spacing: -.02em;
  margin: var(--s4) 0 var(--s3);
  text-transform: uppercase;
}
/* Narrow screens: stack the nameplate on two lines the way a real
   broadsheet does, instead of letting it run off the page. */
@media (max-width: 560px) {
  .nameplate { font-size: 19vw; line-height: .84; }
  .nameplate .cent { display: block; }
}
.nameplate .cent { color: var(--oxblood); }

.dateline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s2) var(--s4);
  padding: var(--s2) 0;
}
.dateline span { white-space: nowrap; position: relative; }
.dateline span + span::before {
  content: '·'; position: absolute; left: calc(var(--s2) * -1.4);
  color: var(--rule);
}

.standfirst {
  font-variation-settings: 'opsz' 28, 'wght' 400;
  font-size: clamp(19px, 2.4vw, 27px);
  line-height: 1.32;
  max-width: 46ch;
  margin: var(--s4) auto var(--s5);
  text-align: center;
  text-wrap: balance;
}
.standfirst em { font-style: italic; color: var(--oxblood); }
.deck {
  columns: 2; column-gap: var(--s6); column-rule: 1px solid var(--rule-hair);
  max-width: 68ch; margin: var(--s4) auto var(--s5);
  font-variation-settings: 'opsz' 12; font-size: 15.5px; line-height: 1.48;
  text-align: left; color: var(--ink-soft);
}
.deck p { margin: 0 0 var(--s3); }
@media (max-width: 720px) { .deck { columns: 1; } }

/* ============================================================
   SECTION FURNITURE
   ============================================================ */
.sec { padding: var(--s6) 0; border-top: 1px solid var(--rule); }
.sec--tight { padding: var(--s6) 0; }

.kicker {
  margin-top: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.kicker::after {
  content: ''; flex: 1; height: 1px; background: var(--rule-hair);
}
.kicker b { color: var(--oxblood); font-weight: 700; }

.hed {
  font-variation-settings: 'opsz' 48, 'wght' 700;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -.015em;
  margin: 0 0 var(--s4);
}

/* ============================================================
   THE ACTIVE POSITION — the lead story
   ============================================================ */
.lead {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0;
  border: 2px solid var(--ink);
  background: var(--paper-deep);
}
@media (max-width: 900px) { .lead { grid-template-columns: 1fr; } }

.lead__main { padding: var(--s5) var(--s6); border-right: 1px solid var(--ink); display: flex; flex-direction: column; }
.lead__main .statgrid { margin-top: var(--s6); }
@media (max-width: 900px) { .lead__main { border-right: 0; border-bottom: 1px solid var(--ink); } }

.lead__ticker {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(44px, 8vw, 86px);
  line-height: 1;
  letter-spacing: -.03em;
}
.lead__ticker.pending {
  font-style: normal;
  color: var(--ink-faint);
  font-weight: 300;
  letter-spacing: .06em;
  font-size: clamp(30px, 5vw, 52px);
}
.lead__co {
  font-variation-settings: 'opsz' 20;
  font-size: 18px;
  color: var(--ink-soft);
  margin: var(--s2) 0 var(--s5);
}

/* the fill gauge — how much of the float we hold */
.gauge { margin: var(--s6) 0 var(--s3); }
.gauge__track {
  height: 30px;
  background: var(--paper);
  border: 1px solid var(--ink);
  position: relative;
}
.gauge__track > .gauge__fill { overflow: hidden; }
.gauge__fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: var(--oxblood);
  background-image: repeating-linear-gradient(
    45deg, rgba(255,255,255,.10) 0 6px, transparent 6px 12px);
  transition: width .8s cubic-bezier(.16,1,.3,1);
}
.gauge__cap {
  position: absolute; top: -3px; bottom: -3px;
  width: 2px; background: var(--ink);
}
.gauge__cap::after {
  content: 'CAP 9.9%';
  position: absolute; top: -15px; right: 0;
  transform: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: .1em;
  color: var(--ink); white-space: nowrap;
}
.gauge__legend {
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-soft);
  margin-top: var(--s2);
}

.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  border-top: 1px solid var(--rule);
  margin-top: var(--s5);
}
.stat { padding: var(--s4) var(--s4) var(--s4) 0; }
.stat__k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: var(--s1);
}
.stat__v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 21px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* phosphor side panel — the live wallet */
.lead__crt {
  background: var(--crt);
  color: var(--amber);
  padding: var(--s6);
  position: relative;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
}
.lead__crt::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.30) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.crt__hd {
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--amber-dim); border-bottom: 1px solid var(--amber-ghost);
  padding-bottom: var(--s2); margin-bottom: var(--s4);
  display: flex; justify-content: space-between; align-items: center;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber); display: inline-block;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.crt__row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--s3); padding: var(--s3) 0;
  border-bottom: 1px dotted var(--amber-ghost);
  font-size: 13px;
}
.crt__row:last-child { border-bottom: 0; }
.crt__k { color: var(--amber-dim); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.crt__v { font-weight: 700; font-variant-numeric: tabular-nums; }
.crt__big {
  font-size: clamp(26px, 4vw, 38px); font-weight: 700;
  letter-spacing: -.02em; line-height: 1.1;
  margin: var(--s3) 0; color: #FFD066;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   THE LIST — the agate table. The centrepiece texture.
   ============================================================ */
.tablewrap { overflow-x: auto; border: 1px solid var(--ink); background: var(--paper-deep); }

table.agate {
  width: 100%;
  border-collapse: collapse;
  font-variation-settings: 'opsz' 7;   /* TRUE agate — this is why Newsreader */
  font-size: 13.5px;
  min-width: 720px;
}
table.agate thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  text-align: left;
  padding: var(--s3) var(--s3);
  border-bottom: 2px solid var(--ink);
  background: var(--paper-edge);
  position: sticky; top: 0; z-index: 2;
  white-space: nowrap;
}
table.agate th.r, table.agate td.r { text-align: right; }
table.agate tbody td {
  padding: 7px var(--s3);
  border-bottom: 1px solid var(--rule-hair);
  white-space: nowrap;
}
table.agate tbody tr:nth-child(even) { background: rgba(26,20,13,.032); }
table.agate tbody tr:hover { background: rgba(123,30,34,.085); }

td.tick {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; letter-spacing: .02em;
}
td.co { color: var(--ink-soft); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
td.idx { color: var(--ink-faint); font-family: 'JetBrains Mono', monospace; font-size: 10px; }

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  padding: 2px 7px; border: 1px solid currentColor; white-space: nowrap;
}
.tag--active { color: var(--oxblood); font-weight: 700; }
.tag--closed { color: var(--gain); }
.tag--queued { color: var(--ink-faint); }

/* mini float-held bar inside a table cell */
.minibar {
  display: inline-block; vertical-align: middle;
  width: 54px; height: 7px; background: var(--paper-edge);
  border: 1px solid var(--rule); position: relative; margin-right: var(--s2);
}
.minibar i { position: absolute; inset: 0 auto 0 0; background: var(--oxblood); }

/* ============================================================
   THE PROOF — two ledgers that must agree
   ============================================================ */
.proof { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; align-items: stretch; }
@media (max-width: 860px) { .proof { grid-template-columns: 1fr; } }

.ledger { border: 2px solid var(--ink); padding: var(--s6); background: var(--paper-deep); }
.ledger--chain { background: var(--crt); color: var(--amber); border-color: var(--ink); }
.ledger__hd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  margin-bottom: var(--s4); padding-bottom: var(--s3);
  border-bottom: 1px solid currentColor; opacity: .72;
}
.ledger__big {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(24px, 3.4vw, 34px); font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.ledger__note { font-variation-settings: 'opsz' 14; font-size: 14px; margin-top: var(--s3); opacity: .82; }

.equals {
  display: grid; place-items: center; padding: 0 var(--s5);
  font-family: 'JetBrains Mono', monospace; font-size: 30px; color: var(--ink);
}
@media (max-width: 860px) { .equals { padding: var(--s4) 0; } }

a.stamp {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: inherit; text-decoration: none;
  border: 1px solid currentColor; padding: var(--s2) var(--s3);
  margin-top: var(--s4); transition: background .18s, color .18s;
}
a.stamp:hover { background: var(--ink); color: var(--paper); }
.ledger--chain a.stamp:hover { background: var(--amber); color: var(--crt); }

/* ============================================================
   THE RULES
   ============================================================ */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 0; }
.rule-card {
  padding: var(--s4) var(--s5); border-left: 1px solid var(--rule);
}
.rule-card:first-child { border-left: 0; padding-left: 0; }
.rule-card__n {
  font-family: 'Newsreader', serif;
  font-variation-settings: 'opsz' 20, 'wght' 600;
  font-size: 15px; letter-spacing: .02em; color: var(--oxblood);
  margin-bottom: var(--s3);
}
.rule-card__t {
  font-variation-settings: 'opsz' 24, 'wght' 700;
  font-size: 20px; margin-bottom: var(--s2); line-height: 1.15;
}
.rule-card__b { font-size: 15px; color: var(--ink-soft); font-variation-settings: 'opsz' 14; }

/* ============================================================
   FOOTER / COLOPHON
   ============================================================ */
.colophon {
  border-top: 3px solid var(--ink);
  padding: var(--s6) 0 var(--s8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-soft);
  line-height: 1.7;
}
.colophon a { color: var(--ink); }
.disclaim {
  border: 1px solid var(--rule); padding: var(--s4);
  margin-top: var(--s5); max-width: 74ch;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  line-height: 1.65; color: var(--ink-soft);
}

/* pending state — never a fabricated number */
.pending { color: var(--ink-faint); font-style: italic; font-family: 'Newsreader', serif; }
.crt .pending, .lead__crt .pending, .ledger--chain .pending { color: var(--amber-dim); }

:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 2px; }

/* ============================================================
   THE VERIFIER — holder-side proof, run in their browser
   ============================================================ */
.verifier { border: 2px solid var(--ink); background: var(--crt); padding: var(--s5); }
.v-label {
  display: block; font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--amber-dim); margin-bottom: var(--s3);
}
.v-input {
  width: 100%; background: #060604; color: var(--amber);
  border: 1px solid var(--amber-ghost); padding: var(--s3);
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.6;
  resize: vertical;
}
.v-input:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.v-btn {
  margin-top: var(--s3); cursor: pointer;
  background: var(--amber); color: var(--crt); border: 0;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  padding: var(--s3) var(--s5);
}
.v-btn:hover { background: #FFD066; }
.v-out { margin-top: var(--s4); color: var(--amber); font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.v-out--bad { color: #FF8A6B; }
.v-row {
  display: flex; flex-direction: column; gap: 3px;
  padding: var(--s3) 0; border-bottom: 1px dotted var(--amber-ghost);
}
.v-row span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-dim); }
.v-row b { word-break: break-all; color: #FFD066; font-weight: 700; }
.v-note { margin-top: var(--s4); line-height: 1.65; color: var(--amber-dim); }
.v-caveat {
  margin-top: var(--s4); max-width: 68ch;
  font-variation-settings: 'opsz' 13; font-size: 14.5px;
  color: var(--ink-soft); border-left: 2px solid var(--rule); padding-left: var(--s4);
}

/* ============================================================
   THE VAULT — closed positions, treated as engraved certificates
   ============================================================ */
.vault { display: grid; grid-template-columns: repeat(auto-fit, minmax(292px, 420px)); gap: var(--s4); }
.cert {
  border: 2px solid var(--ink); background: var(--paper-deep);
  padding: var(--s5); position: relative; overflow: hidden;
}
.cert::before {
  content: ''; position: absolute; inset: 5px;
  border: 1px solid var(--brass); pointer-events: none;
}
.cert__tick {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 34px; letter-spacing: -.02em; line-height: 1;
}
.cert__co { font-variation-settings: 'opsz' 15; font-size: 14.5px; color: var(--ink-soft); margin: var(--s2) 0 var(--s4); }
.cert__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s4); border-top: 1px solid var(--rule); padding-top: var(--s3); }
.cert__k { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.cert__v { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cert__seal {
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule);
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--oxblood); font-weight: 700;
}
td.hashcell {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--ink-faint); max-width: 190px; overflow: hidden; text-overflow: ellipsis;
}
.edition-mark { color: var(--oxblood); font-weight: 700; }

/* last purchase strip — fills the lead panel and is genuinely the thing you want to see */
.lastbuy {
  margin-top: var(--s5); padding-top: var(--s4);
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6);
  font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  color: var(--ink-soft);
}
.lastbuy b { color: var(--ink); font-weight: 700; }
.lastbuy .k { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); display: block; }

/* ============================================================
   CONTRACT ADDRESS BAR
   ============================================================ */
.cabar {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: var(--s3);
  background: var(--crt); color: var(--amber);
  border: 2px solid var(--ink);
  padding: var(--s3) var(--s4);
  margin: var(--s5) auto var(--s4); max-width: 760px;
}
.cabar__k {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: .2em; text-transform: uppercase; color: var(--amber-dim);
}
.cabar__v {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  font-weight: 700; color: #FFD066; word-break: break-all;
}
.cabar__btn {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  background: var(--amber); color: var(--crt); border: 0;
  padding: 6px 12px; cursor: pointer;
}
.cabar__btn:hover { background: #FFD066; }
.cabar--pending .cabar__v { color: var(--amber-dim); font-weight: 400; }

.emptystate {
  font-variation-settings: 'opsz' 16; font-size: 16px;
  color: var(--ink-soft); max-width: 52ch;
  border-left: 2px solid var(--rule); padding-left: var(--s4); margin: 0;
}
