/* Market Weaver X - shared design tokens and primitives */
:root {
  --ink: #06080e;
  --ink-2: #0a0e17;
  --ink-3: #0f1420;
  --panel: rgba(16, 21, 33, 0.72);
  --panel-solid: #111726;
  --panel-hi: rgba(26, 33, 50, 0.8);
  --line: rgba(148, 163, 184, 0.11);
  --line-hi: rgba(148, 163, 184, 0.22);

  --text: #e9ecf4;
  --muted: #95a0b6;
  --dim: #5f6a82;

  --gold: #e8b64c;
  --gold-hi: #f6d98f;
  --gold-lo: #b9842a;
  --buy: #22d39a;
  --buy-lo: rgba(34, 211, 154, 0.14);
  --sell: #ff6b6b;
  --sell-lo: rgba(255, 107, 107, 0.14);
  --warn: #ffb547;
  --info: #7aa7ff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px -24px rgba(0, 0, 0, 0.7);

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

  color-scheme: dark;
}

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

/* `hidden` must win over any component display rule (grid, flex...) */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 13px;
}
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand span b { color: var(--gold); font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--line-hi);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(232, 182, 76, 0.5); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  color: #1b1405;
  border-color: transparent;
  box-shadow: 0 10px 30px -10px rgba(232, 182, 76, 0.6);
}
.btn-gold:hover { box-shadow: 0 14px 40px -10px rgba(232, 182, 76, 0.8); }
.btn svg { width: 16px; height: 16px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-hi);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.live { background: var(--buy); box-shadow: 0 0 0 0 rgba(34, 211, 154, 0.6); animation: pulse 2s infinite; }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--sell); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 154, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(34, 211, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 154, 0); }
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
