/* ============================================================
   QUANT_ARCH — Design tokens
   Dark-first. Single source of truth for colors and type.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ---------- COLOR ---------- */
  /* surfaces */
  --bg: #0A0A0A;            /* onyx — sole background */
  --bg-elevated: #111113;   /* rare; cards usually border-only */

  /* foreground scale */
  --fg-1: #E5E7EB;          /* primary text */
  --fg-2: #A3A3A3;          /* secondary text (neutral-400) */
  --fg-3: #737373;          /* tertiary, footer (neutral-500) */
  --fg-4: #525252;          /* disabled, faint chrome (neutral-600) */

  /* accents */
  --accent: #10B981;        /* emerald-500 — primary */
  --accent-soft: rgba(16,185,129,0.12);
  --accent-2: #22D3EE;      /* cyan-400 — Web3 / on-chain marker */
  --accent-2-soft: rgba(34,211,238,0.12);

  /* lane colors (hero canvas + occasional data viz) */
  --lane-trades: #10B981;   /* emerald — TRADES */
  --lane-quotes: #38BDF8;   /* sky-400 — QUOTES */
  --lane-orders: #F59E0B;   /* amber-500 — ORDERS */

  /* borders */
  --border: rgba(229,231,235,0.08);
  --border-strong: rgba(229,231,235,0.16);
  --border-hot: rgba(16,185,129,0.32);
  --border-cyan: rgba(34,211,238,0.32);

  /* glows / elevation */
  --glow-emerald: 0 0 24px -8px rgba(16,185,129,0.45), inset 0 0 0 1px rgba(16,185,129,0.55);
  --glow-cyan:    0 0 24px -8px rgba(34,211,238,0.45), inset 0 0 0 1px rgba(34,211,238,0.55);
  --hairline-bottom: 0 1px 0 rgba(229,231,235,0.06);

  /* ---------- TYPE ---------- */
  --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* type scale */
  --fs-display-xxl: 84px;
  --fs-display-xl:  56px;
  --fs-h2:          36px;
  --fs-h3:          22px;
  --fs-lead:        18px;
  --fs-body:        16px;
  --fs-mono:        13px;
  --fs-eyebrow:     11px;

  /* ---------- SPACING ---------- */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  24px;
  --sp-6:  32px;
  --sp-7:  48px;
  --sp-8:  64px;
  --sp-9:  96px;
  --sp-10:128px;

  /* ---------- RADII ---------- */
  --r-1: 2px;   /* chips, buttons */
  --r-2: 4px;   /* cards */
  --r-3: 8px;   /* large containers / terminals */

  /* ---------- MOTION ---------- */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-hover: 150ms;
  --dur-state: 200ms;
  --dur-entry: 600ms;

  /* ---------- LAYOUT ---------- */
  --maxw: 1200px;
  --maxw-hero: 1280px;
}

/* Hard-pin background to prevent any white flash between sections */
html, body, #root {
  background-color: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

/* ============================================================
   Semantic styles
   ============================================================ */

.qa-display-xxl {
  font-family: var(--font-sans);
  font-size: var(--fs-display-xxl);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg-1);
}

.qa-display-xl {
  font-family: var(--font-sans);
  font-size: var(--fs-display-xl);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--fg-1);
}

.qa-h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-h2);
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg-1);
}

.qa-h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-h3);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}

.qa-lead {
  font-family: var(--font-sans);
  font-size: var(--fs-lead);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--fg-2);
}

.qa-body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--fg-2);
}

.qa-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: 1.5;
  color: var(--fg-2);
}

.qa-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.qa-metric-value {
  font-family: var(--font-sans); /* explicitly NOT mono */
  font-size: 32px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg-1);
}

/* ============================================================
   Recurring HUD chrome
   ============================================================ */

.qa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-2);
  background: transparent;
}
.qa-chip--accent { color: var(--accent); border-color: var(--border-hot); }
.qa-chip--cyan   { color: var(--accent-2); border-color: var(--border-cyan); }

.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color var(--dur-hover) var(--ease),
    box-shadow   var(--dur-hover) var(--ease),
    transform    80ms var(--ease),
    filter       var(--dur-hover) var(--ease);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-1);
}
.qa-btn:hover { border-color: var(--border-hot); box-shadow: var(--glow-emerald); }
.qa-btn:active { transform: scale(0.98); }

.qa-btn--primary {
  background: var(--accent);
  color: #04140E;
  border-color: var(--accent);
  font-weight: 600;
}
.qa-btn--primary:hover { filter: brightness(1.06); box-shadow: var(--glow-emerald); }

.qa-card {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 24px;
  background: transparent;
  transition: border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease);
}
.qa-card:hover { border-color: var(--border-hot); box-shadow: var(--glow-emerald); }

/* Corner-bracket frame — apply to a positioned parent */
.qa-corners { position: relative; }
.qa-corners::before,
.qa-corners::after,
.qa-corners > .qa-corner-bl,
.qa-corners > .qa-corner-br {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--accent);
  pointer-events: none;
}
.qa-corners::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.qa-corners::after  { top: 0; right: 0; border-left: none; border-bottom: none; }
.qa-corners > .qa-corner-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.qa-corners > .qa-corner-br { bottom: 0; right: 0; border-left: none; border-top: none; }

/* Underline gradient under accent word in hero */
.qa-accent-underline {
  color: var(--accent);
  background-image: linear-gradient(90deg, var(--accent), rgba(16,185,129,0));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 2px;
  padding-bottom: 4px;
}

/* Live indicator dot */
.qa-live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: qa-pulse 1.6s var(--ease) infinite;
}
@keyframes qa-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .qa-live-dot { animation: none; }
}

/* Icon — mask-based tinting so an SVG (currentColor or black) renders in any QA color */
.qa-icon {
  display: inline-block;
  width: 24px; height: 24px;
  background-color: currentColor;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: contain;
          mask-size: contain;
}
.qa-icon--accent { color: var(--accent); }
.qa-icon--fg-2   { color: var(--fg-2); }
.qa-icon--sm     { width: 18px; height: 18px; }
.qa-icon--lg     { width: 28px; height: 28px; }
