/* ============================================================================
   Element defaults: reset, canvas, focus, shared primitives.

   The primitives here (`.panel`, `.eyebrow`, `.mono`, `.dot`, `.tag`) are used
   across several component layers, so they live at the base level and the
   component files build on them rather than redefining them.
   ========================================================================== */

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; color-scheme: dark; scrollbar-color: var(--line-2) transparent; }
::selection { background: rgba(61,220,151,.28); color: #f4fffb; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3f4c; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(61,220,151,.22); border-radius: 8px; }
body {
  margin: 0;
  font-family: var(--ui);
  font-size: 15px; line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(61,220,151,.10), transparent 60%),
    radial-gradient(900px 600px at 5% 0%, rgba(99,113,255,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* film grain for depth */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }

.panel, .hero, .strip {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-2) 60%, #0e1014);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel { padding: 22px 26px; }
.panel-head { margin-bottom: 16px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.pos { background: var(--pos); } .dot.neu { background: var(--neu); } .dot.neg { background: var(--neg); }

.tag { font: 500 10.5px/1 var(--mono); letter-spacing: .04em; text-transform: lowercase; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--dim); white-space: nowrap; }
.tag.positive { color: var(--pos); border-color: rgba(56,207,143,.28); background: rgba(56,207,143,.07); }
.tag.negative { color: var(--neg); border-color: rgba(240,112,95,.28); background: rgba(240,112,95,.07); }
.tag.neutral { color: var(--neu); }
.tag.theme { color: var(--amber); border-color: rgba(227,164,74,.25); background: rgba(227,164,74,.06); }
a.tag-link { text-decoration: none; transition: border-color .14s, background .14s; }
a.tag-link:hover { border-color: rgba(227,164,74,.6); background: rgba(227,164,74,.14); color: var(--amber); }

.srcbadge { display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 6px; font: 700 10px/1 var(--mono); color: #0a0b0e; background: var(--c, #888); }
.srcpill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--dim); }
.srcpill b { color: var(--ink); font-variant-numeric: tabular-nums; }

.net-val.up { color: var(--pos); } .net-val.down { color: var(--neg); } .net-val.flat { color: var(--neu); }

/* A row-level volume sparkline: one <i> per bucket, height set inline. */
.spark { display: inline-flex; align-items: flex-end; gap: 1px; height: 20px; min-width: 52px; }
.spark i { flex: 1 1 0; min-height: 1px; background: linear-gradient(180deg, var(--accent-deep), var(--pos)); border-radius: 1px; opacity: .85; }
.spark-lg { height: 26px; width: 100%; gap: 2px; }

.c-v { color: var(--faint); }

/* ---- empty state --------------------------------------------------------- */
.empty { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; text-align: center; padding: 10vh 24px; }
.empty-mark { width: 56px; height: 56px; color: var(--accent); opacity: .8; margin-bottom: 18px; }
.empty h1 { font-family: var(--display); font-weight: 600; font-size: 30px; margin: 0 0 10px; }
.empty p { color: var(--dim); }
.empty code, main code { font-family: var(--mono); font-size: .86em; background: var(--bg-3); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; color: var(--accent); }

/* ---- motion -------------------------------------------------------------- */
.anim { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.22,.61,.36,1) forwards; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.stack { animation: grow .7s cubic-bezier(.22,.61,.36,1) backwards; animation-delay: calc(var(--d,0) * 12ms + 200ms); transform-origin: bottom; }
@keyframes grow { from { transform: scaleY(0); } }

@media (prefers-reduced-motion: reduce) {
  .anim, .stack { animation: none; opacity: 1; transform: none; }
  .live i { animation: none; }
  html { scroll-behavior: auto; }
}
