/* ─────────────────────────────────────────────────────────────
   Midnight vault with gilded ledger lines.
   Token source: DESIGN.md (Refero Styles → Slash)
   ───────────────────────────────────────────────────────────── */

/* Self-hosted (OFL). A page that asks for signatures makes no third-party requests. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/playfair-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display'; font-style: italic; font-weight: 400 900; font-display: swap;
  src: url('/assets/fonts/playfair-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --obsidian: #08080a;
  --onyx: #040406;
  --carbon: #121317;
  --graphite: #1c1d22;
  --slate: #2e3038;
  --smoke: #464853;
  --ash: #5e616e;
  --steel: #777a88;
  --fog: #9194a1;
  --mist: #acafb9;
  --silver: #c7c9d1;
  --bone: #e2e3e9;
  --paper: #ffffff;
  --copper: #cc9166;
  --sage: #7f9b7f;
  --rust: #b56a5a;

  --gilded: linear-gradient(103deg, rgb(174, 147, 87), rgb(255, 240, 204) 40%, rgb(174, 147, 87) 70%, rgba(189, 157, 79, 0));
  --gilded-solid: linear-gradient(103deg, #ae9357, #fff0cc 45%, #ae9357);

  --serif: 'Playfair Display', 'Ivy Presto', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;

  --page: 1216px;
  --r-card: 10px;
  --r-full: 9999px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ledger grain: a barely-there vertical rule pattern, like ruled paper in a vault */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.014) 0 1px, transparent 1px 96px);
  z-index: 0;
}

/* The surfaces the browser draws for us still belong to the system. */
::selection { background: rgba(204, 145, 102, .35); color: var(--paper); }
input, textarea { caret-color: var(--copper); }
html { scrollbar-color: var(--slate) var(--obsidian); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--obsidian); }
::-webkit-scrollbar-thumb { background: var(--slate); border-radius: var(--r-full); border: 2px solid var(--obsidian); }
::-webkit-scrollbar-thumb:hover { background: var(--smoke); }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: .01em; margin: 0; }

a { color: var(--copper); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: -.02em;
  color: var(--copper); text-transform: none; margin: 0 0 20px;
}
.eyebrow.muted { color: var(--fog); }

/* ── header ─────────────────────────────────────────────── */
header.top {
  border-bottom: 1px solid var(--graphite);
  position: sticky; top: 0; z-index: 20;
  background: rgba(8,8,10,.86);
  backdrop-filter: blur(12px);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: baseline; gap: 9px; }
.brand .mark { font-family: var(--serif); font-size: 22px; color: var(--paper); letter-spacing: .01em; }
.brand .chain { font-size: 12px; color: var(--steel); letter-spacing: -.01em; }
.top nav { display: flex; align-items: center; gap: 8px; position: relative; }

/* wallet chooser — only appears when the browser announces more than one */
.walletpick {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 240px;
  background: var(--carbon); border: 1px solid var(--graphite); border-radius: var(--r-card);
  padding: 8px; z-index: 30;
}
.walletpick[hidden] { display: none; }
.walletpick .wp-title { font-size: 12px; color: var(--fog); padding: 6px 10px 8px; letter-spacing: -.01em; }
.walletpick .wp-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--bone); font: inherit; font-size: 14px;
  padding: 10px; border-radius: 6px; cursor: pointer;
}
.walletpick .wp-item:hover, .walletpick .wp-item:focus-visible { background: var(--graphite); outline: none; }
.walletpick .wp-item img { border-radius: 4px; flex: 0 0 auto; }
.walletpick .wp-cancel {
  display: block; width: 100%; margin-top: 4px; background: transparent; border: 0;
  color: var(--steel); font: inherit; font-size: 12px; padding: 8px 10px; text-align: left; cursor: pointer;
}
.walletpick .wp-cancel:hover { color: var(--paper); }

/* ── buttons ────────────────────────────────────────────── */
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  border-radius: var(--r-full); padding: 10px 20px;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
  white-space: nowrap; flex: 0 0 auto;
}
.btn-primary { background: var(--paper); color: #000; border-color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: #ece9e2; border-color: #ece9e2; }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--paper); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.06); }
.btn-quiet { background: transparent; color: var(--mist); border-color: var(--steel); font-size: 13px; padding: 6px 12px; }
.btn-quiet:hover:not(:disabled) { color: var(--paper); border-color: var(--fog); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── hero ───────────────────────────────────────────────── */
.hero { padding: 96px 0 72px; }
.hero h1 {
  font-size: clamp(40px, 7.2vw, 88px); line-height: 1.02; color: var(--paper);
  max-width: 15ch; margin-bottom: 24px;
}
.hero h1 em { font-style: italic; color: var(--copper); }
.hero .lede {
  font-size: 20px; line-height: 1.38; letter-spacing: -.02em;
  color: var(--fog); max-width: 54ch; margin: 0 0 40px;
}

.scanbar { display: flex; gap: 8px; max-width: 620px; align-items: center; }
.scanbar input {
  flex: 1 1 auto; min-width: 0;
  background: transparent; border: 1px solid var(--paper); border-radius: var(--r-full);
  color: var(--bone); font-family: var(--mono); font-size: 14px;
  padding: 11px 10px 11px 20px; outline: none;
}
.scanbar input::placeholder { color: var(--steel); font-family: var(--sans); }
.scanbar input:focus { border-color: var(--copper); }
.btn:focus-visible, .scanbar input:focus-visible, .altline button:focus-visible,
table.ledger input:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.scanbar input.bad { border-color: var(--rust); }

/* status must sit where the eye already is: directly under the button that started it */
.scanstatus {
  min-height: 20px; margin-top: 14px; font-size: 13px; color: var(--fog);
  letter-spacing: -.01em; display: flex; align-items: center; gap: 10px;
}
.scanstatus .dot {
  width: 6px; height: 6px; border-radius: var(--r-full); background: var(--copper);
  animation: pulse 1.1s ease-in-out infinite; flex: 0 0 auto;
}
.scanstatus.err { color: var(--rust); }
@keyframes pulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.altline { margin-top: 18px; font-size: 13px; color: var(--steel); }
.altline button { background: none; border: 0; color: var(--mist); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.altline button:hover { color: var(--paper); }

/* ── the reveal ─────────────────────────────────────────── */
.reveal { padding: 8px 0 40px; display: none; }
.reveal.on { display: block; }
/* a result from the previous address, while the next one loads */
.reveal.updating { opacity: .35; pointer-events: none; transition: opacity .2s ease; }

.headline-figure { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.headline-figure .amount {
  font-family: var(--serif); font-size: clamp(52px, 8.5vw, 96px); line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: .01em;
  background: var(--gilded-solid); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.headline-figure .unit { font-family: var(--serif); font-size: 28px; color: var(--steel); }
.figure-sub { font-size: 20px; letter-spacing: -.02em; color: var(--fog); margin-bottom: 36px; }
.figure-sub strong { color: var(--bone); font-weight: 500; }
.sharebtn { margin: -22px 0 36px; }
.sharebtn[hidden] { display: none; }
.grid[hidden] { display: none; }

/* slivers → one bar */
.slivers { height: 56px; display: flex; align-items: flex-end; gap: 2px; margin: 0 0 10px; }
.sliver {
  background: var(--graphite);
  height: 56px; min-width: 2px; border-radius: 1px;
  transform: scaleY(.39); transform-origin: bottom;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), background-color .5s ease;
}
.sliver.keep { background: #3a3325; }
.slivers.merged .sliver { transform: scaleY(1); background: #ae9357; }
.slivers.merged .sliver.drop { transform: scaleY(.11); background: var(--graphite); }
.sliverlabel { font-size: 12px; color: var(--steel); letter-spacing: -.01em; margin-bottom: 44px; }

/* ── panels ─────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  /* On one column the ledger can run thousands of pixels; the total and the
     action belong where the eye is, not underneath it. */
  .grid > .rail { order: -1; position: static; }
}

.card { background: var(--onyx); border-radius: var(--r-card); padding: 24px; }
.card.flat { background: transparent; padding: 0; }

.card h2 { font-size: 28px; color: var(--paper); margin-bottom: 4px; }
.card .note { font-size: 14px; color: var(--fog); margin: 0 0 20px; letter-spacing: -.01em; }

/* ledger table */
table.ledger { width: 100%; border-collapse: collapse; }
table.ledger th {
  text-align: left; font-size: 13px; font-weight: 500; color: var(--fog);
  padding: 0 0 10px; border-bottom: 1px solid var(--graphite); letter-spacing: -.01em;
}
table.ledger th.num, table.ledger td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.ledger td {
  padding: 11px 0; border-bottom: 1px solid var(--graphite);
  font-size: 15px; color: var(--bone); letter-spacing: -.01em;
}
table.ledger tr:last-child td { border-bottom: 0; }
table.ledger td.sym { font-weight: 500; }
table.ledger td .co { display: block; font-size: 12px; color: var(--steel); font-weight: 400; margin-top: 1px; }
table.ledger td.why { color: var(--fog); font-size: 13px; }
table.ledger .chk { width: 26px; }
table.ledger input[type=checkbox] { accent-color: var(--copper); width: 14px; height: 14px; cursor: pointer; }
tr.dim td { color: var(--ash); }
tr.dim td.sym { color: var(--fog); }

.rowstate { font-size: 12px; color: var(--steel); }
.rowstate.ok { color: var(--sage); }
.rowstate.ok a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(127,155,127,.5); }
.rowstate.fail { color: var(--rust); }
.rowstate.busy { color: var(--copper); }

/* summary rail */
.rail { position: sticky; top: 86px; }
.sumrow { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; font-size: 15px; }
.sumrow + .sumrow { border-top: 1px solid var(--graphite); }
.sumrow .k { color: var(--fog); letter-spacing: -.01em; font-size: 14px; }
.sumrow .v { font-variant-numeric: tabular-nums; color: var(--bone); }
.sumrow.total { border-top: 1px solid var(--slate); margin-top: 6px; padding-top: 14px; }
.sumrow.total .k { color: var(--bone); font-size: 15px; }
.sumrow.total .v { font-family: var(--serif); font-size: 32px; color: var(--paper); letter-spacing: .01em; }

.sweepbtn { width: 100%; margin-top: 20px; padding: 13px 20px; font-size: 15px; }
/* progress belongs next to the control that started it, never below a long list */
.sweepstatus { min-height: 18px; margin-top: 12px; font-size: 13px; color: var(--fog); text-align: center; letter-spacing: -.01em; }
.sweepstatus.warn { color: var(--copper); }
.sweepstatus.err { color: var(--rust); }
.sweepstatus.done { color: var(--sage); }

.fineprint { font-size: 12px; line-height: 1.5; color: var(--fog); margin-top: 16px; }

/* section rhythm */
section.band { padding: 104px 0 0; }
section.band > .wrap > h2 { font-size: clamp(30px, 4vw, 44px); color: var(--paper); max-width: 20ch; margin-bottom: 14px; }
section.band p.body { font-size: 18px; line-height: 1.5; color: var(--mist); max-width: 62ch; letter-spacing: -.02em; }

.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 32px; margin-top: 44px; }
@media (max-width: 800px) { .three { grid-template-columns: 1fr; } }
.three h3 { font-size: 20px; font-family: var(--sans); font-weight: 500; color: var(--paper); letter-spacing: -.02em; margin-bottom: 8px; }
.three p { font-size: 15px; color: var(--fog); margin: 0; letter-spacing: -.01em; }

footer.bottom { margin-top: 120px; border-top: 1px solid var(--graphite); padding: 32px 0 56px; }
footer.bottom .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer.bottom p { font-size: 12px; color: var(--fog); margin: 0; max-width: 60ch; line-height: 1.6; }
footer.bottom a { color: var(--mist); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Narrow header: the network tag and the quiet nav item give way to the two
   controls that matter. */
@media (max-width: 640px) {
  .brand .chain { display: none; }
  .top nav .btn-quiet { display: none; }
}

/* Fingers, not cursors. */
@media (pointer: coarse) {
  .btn, .scanbar input { min-height: 44px; }
  .altline button { display: inline-block; padding: 12px 0; }
  table.ledger input[type=checkbox] { width: 20px; height: 20px; }
  table.ledger .chk { width: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
