/* Veil Revenue (veilit.xyz/dashboard). Layout: a lit hero where four revenue sources stream into one rolling total,
   then a two-column working area (chart, live chain activity) and a short "how it's counted" band. Veil's own
   identity, dark only, like the rest of veilit.xyz. */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #05040b; --ink-2: #0c0a18; --ink-3: #131026; --ink-4: #1c1734;
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.14);
  --fg: #f6f4ff; --fg-2: rgba(246, 244, 255, 0.66); --fg-3: rgba(246, 244, 255, 0.42);
  --veil: #a08bff; --veil-hi: #ddd3ff; --veil-deep: #6b4ff0; --veil-wash: rgba(160, 139, 255, 0.1);
  --ok: #7ee2b8; --warn: #ffb547;
  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r-2: 14px; --r-3: 22px; --wrap: 1180px; --ease: cubic-bezier(.22, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--ink); color: var(--fg);
  font-family: var(--f-sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(1200px 620px at 50% -180px, rgba(107, 79, 240, 0.22), transparent 70%);
  background-repeat: no-repeat;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--ink); }
a { color: var(--veil-hi); }
:focus-visible { outline: 2px solid var(--veil); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--veil-deep); color: #fff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar: /top-nav.css (shared with /burn) ---- */
.btn { display: inline-flex; align-items: center; gap: .45em; padding: .6em 1.05em; border-radius: 999px; background: var(--fg); color: #0b0918; font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; transition: background-color .2s, box-shadow .2s; }
.btn:hover { background: var(--veil-hi); box-shadow: 0 0 0 4px rgba(160, 139, 255, 0.18); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 72px; }

/* ---- hero ---- */
.hero { position: relative; padding-block: clamp(32px, 6vw, 72px) clamp(28px, 5vw, 56px); text-align: center; isolation: isolate; }
.flow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-in { display: grid; justify-items: center; gap: 18px; }

.total { margin: 0; font-weight: 600; letter-spacing: 0; line-height: 1; font-size: var(--fit, clamp(2.6rem, 10vw, 8.2rem)); font-variant-numeric: tabular-nums;
  color: var(--fg); filter: drop-shadow(0 18px 60px rgba(107, 79, 240, 0.35)); }
/* every glyph carries the same top-to-bottom light, so rolling digits keep it */
.odo .g { background: linear-gradient(180deg, #ffffff 12%, var(--veil-hi) 58%, var(--veil) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.odo { display: inline-flex; align-items: flex-start; gap: 0.015em; letter-spacing: 0; white-space: nowrap; }
/* every digit sits in its own fixed column, so neighbours can never overlap while they roll */
.odo .d, .odo .ch { flex: none; text-align: center; }
.odo .d > span > span { display: block; text-align: center; }
.odo .ch { padding-inline: 0.02em; }
.odo .ch { display: inline-block; }
.odo .cents { display: inline-flex; gap: 0.015em; font-size: .42em; margin-top: .14em; margin-left: .08em; opacity: .78; }
.odo .d { display: inline-block; height: 1em; overflow: hidden; vertical-align: top; }
.odo .d > span { display: flex; flex-direction: column; transition: transform 1.1s var(--ease); }
.odo .d > span > span { height: 1em; line-height: 1; }
.odo .bump { animation: bump .9s var(--ease); }
@keyframes bump { 0% { filter: brightness(1.8); } 100% { filter: none; } }
/* the odometer sits at the top of its line, so a placeholder and the digits take exactly the same height */
.odo { vertical-align: top; }

/* ---- before the indexer's first answer: calm placeholders the size of the live figures (never a number) ---- */
.ph { display: inline-block; vertical-align: middle; width: var(--w, 4em); height: .8em; border-radius: .2em;
  background: linear-gradient(100deg, rgba(160, 139, 255, .07) 0 38%, rgba(221, 211, 255, .16) 50%, rgba(160, 139, 255, .07) 62% 100%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.odo .ph-total { --w: 4.6em; height: .78em; margin-block: .11em; border-radius: .12em; }
.ph-vol { --w: 3.3em; }
.ph-since { --w: 31ch; height: 1em; }
/* the first answer goes in while hidden for one frame (nothing visibly moves), then fades in */
.swap { visibility: hidden; }
.fade-in { animation: fade-in .2s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }
/* "Updated 12s ago": a fixed width, so the ticking line never re-centres its neighbours */
#updated { min-width: 16ch; text-align: left; }
#updated:empty { display: none; }

.meta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 12px; border-radius: 999px; border: 1px solid rgba(160, 139, 255, 0.42);
  background: linear-gradient(180deg, rgba(160, 139, 255, 0.16), rgba(160, 139, 255, 0.06)); font-size: .92rem; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--veil); box-shadow: 0 0 12px var(--veil); }
.pill-k { color: var(--fg-2); }
.pill-v { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg); }
.meta { font-family: var(--f-mono); font-size: .74rem; color: var(--fg-3); letter-spacing: .02em; }

.sources { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sources li { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(19, 16, 38, 0.72);
  font-size: .9rem; color: var(--fg); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.js .sources li { opacity: 0; transform: translateY(10px); }
.js .sources li.in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.sources li.lit { border-color: rgba(160, 139, 255, 0.6); box-shadow: 0 0 0 4px rgba(160, 139, 255, 0.1); }
.lede { margin: 6px 0 0; max-width: 62ch; color: var(--fg-2); font-size: 1rem; text-wrap: pretty; }
.preview { margin: 0; font-family: var(--f-mono); font-size: .72rem; color: var(--warn); border: 1px dashed rgba(255, 181, 71, .45); border-radius: 999px; padding: 6px 12px; }

/* glyphs: small line icons drawn as masks, so they take the text color */
.glyph { width: 18px; height: 18px; flex: none; background: var(--veil); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.g-shield { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 3 4.5 6v5.5c0 4.6 3.1 8.3 7.5 9.5 4.4-1.2 7.5-4.9 7.5-9.5V6L12 3Z'/%3E%3Cpath d='m8.8 12.2 2.2 2.2 4.3-4.6'/%3E%3C/svg%3E"); }
.g-coin { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M14.8 9.2c-.5-.9-1.6-1.4-2.8-1.4-1.6 0-2.8.8-2.8 2.1 0 2.9 5.8 1.5 5.8 4.3 0 1.3-1.3 2.1-3 2.1-1.3 0-2.4-.5-2.9-1.5M12 6.5v1.3M12 16.3v1.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.g-lock { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8'%3E%3Crect x='5' y='10.5' width='14' height='9.5' rx='2.5'/%3E%3Cpath d='M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5M12 14.3v2.2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.g-wave { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 16.5 8 11l3.5 3.5L20.5 6M15 6h5.5v5.5'/%3E%3C/svg%3E"); }

/* ---- panels ---- */
.grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--r-3); background: linear-gradient(180deg, rgba(28, 23, 52, 0.62), rgba(12, 10, 24, 0.7)); padding: 22px; }
.panel-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.panel-sub { margin: 4px 0 0; color: var(--fg-3); font-size: .84rem; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; border: 1px solid var(--line-2); background: rgba(5, 4, 11, 0.5); flex: none; }
.seg button { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 8px; font-size: .82rem; font-weight: 500; color: var(--fg-2); transition: background-color .2s, color .2s; }
.seg button[aria-selected="true"] { background: rgba(160, 139, 255, 0.18); color: var(--fg); }
.seg button:focus-visible { outline: 2px solid var(--veil); outline-offset: 2px; }
.seg button:focus:not(:focus-visible) { outline: none; }

.chart-panel { display: flex; flex-direction: column; }
.chart { position: relative; height: 300px; flex: 1 1 auto; min-height: 300px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid-l { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.chart .ax { fill: var(--fg-3); font-family: var(--f-mono); font-size: 10.5px; }
.chart .ln { fill: none; stroke: var(--veil); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { stroke: none; }
.chart .end { fill: var(--veil-hi); }
.chart .end-ring { fill: none; stroke: var(--veil); stroke-width: 1.5; animation: ring 2.4s var(--ease) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
.chart .xh { stroke: rgba(221, 211, 255, 0.35); stroke-dasharray: 3 4; }
.chart .dot { fill: var(--ink); stroke: var(--veil-hi); stroke-width: 2; }
.tip { position: absolute; top: 0; transform: translate(-50%, -110%); pointer-events: none; padding: 8px 11px; border-radius: 10px; background: var(--ink-4); border: 1px solid var(--line-2);
  display: grid; gap: 2px; white-space: nowrap; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.tip b { font-variant-numeric: tabular-nums; font-size: .92rem; }
.tip span { font-family: var(--f-mono); font-size: .7rem; color: var(--fg-3); }
/* why the chart starts where it does: one line per toggle, both in the same cell so switching never moves the layout */
.chart-note { display: grid; place-items: center; width: 100%; max-width: 560px; margin: 14px auto 0; visibility: hidden; }
/* a card wide enough for it (desktop): the note stays on one line; narrower, it wraps */
.chart-panel { container-type: inline-size; }
@container (min-width: 660px) { .chart-note { max-width: 100%; } .note-x { white-space: nowrap; } }
.chart-note.ready { visibility: visible; }
.note-x { grid-area: 1 / 1; margin: 0; display: flex; align-items: flex-start; gap: 8px; padding: 7px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  color: var(--fg-3); font-size: .8rem; line-height: 1.45; text-align: left; opacity: 0; transition: opacity .25s var(--ease); }
.note-x.on { opacity: 1; }
.note-x svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.chart-panel[aria-busy="true"] .chart > * { visibility: hidden; }
.chart-panel[aria-busy="true"] .chart::before { content: ""; position: absolute; inset: 14px 14px 26px 64px; border-radius: 12px;
  background: linear-gradient(100deg, rgba(160, 139, 255, .03) 0 38%, rgba(160, 139, 255, .08) 50%, rgba(160, 139, 255, .03) 62% 100%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.chart-empty { position: absolute; inset: auto 0 44% 0; margin: 0; text-align: center; color: var(--fg-3); font-size: .9rem; padding: 0 12px; }

.beat { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; flex: none; margin-top: 4px; }
.beat i { width: 3px; border-radius: 2px; background: var(--veil); animation: beat 1.2s ease-in-out infinite; }
.beat i:nth-child(2) { animation-delay: .2s; } .beat i:nth-child(3) { animation-delay: .4s; }
@keyframes beat { 0%, 100% { height: 4px; opacity: .5; } 50% { height: 16px; opacity: 1; } }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.feed li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; }
.feed li + li { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.feed li.new { animation: arrive 1.4s var(--ease); }
@keyframes arrive { 0% { background: rgba(160, 139, 255, 0.2); transform: translateY(-6px); opacity: 0; } 40% { opacity: 1; transform: none; } 100% { background: transparent; } }
.feed .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--veil-wash); border: 1px solid rgba(160, 139, 255, 0.24); }
.feed .ic .glyph { width: 15px; height: 15px; }
.feed .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.feed .what em { font-style: normal; color: var(--fg-3); }
.feed time { font-family: var(--f-mono); font-size: .72rem; color: var(--fg-3); }
.feed-empty { margin: 8px 0 0; color: var(--fg-3); font-size: .88rem; }

/* ---- how it's counted ---- */
.how { margin-top: 56px; }
.how > h2 { margin: 0 0 18px; font-size: .74rem; font-family: var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); font-weight: 500; }
.how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.how-item { min-width: 0; display: grid; gap: 8px; align-content: start; }
.how-item h3 { margin: 6px 0 0; font-size: 1rem; font-weight: 600; }
.how-item p { margin: 0; color: var(--fg-2); font-size: .92rem; max-width: 46ch; }

.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; color: var(--fg-3); font-size: .82rem; }

@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .how-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 560px) {
  .chart { height: 240px; }
  .panel { padding: 18px 14px; }
  .sources li { font-size: .84rem; padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .sources li { opacity: 1; transform: none; }
  .ph { background: rgba(160, 139, 255, .1); }
}
