/*
  lida.css — Li-Da's shared design system.
  ONE source of truth for the whole app's look. Every page links this file.

  Direction: "Serious Premium" — atmospheric slate, a restrained steel-blue accent,
  muted (never neon) market green/red, and a whisper of brass for confidence.
  Depth and composition over decoration. Trustworthy, not hype.
*/
:root {
  /* ---- canonical tokens ---- */
  --bg:          #0A0D12;
  --bg-2:        #070A0E;
  --surface:     #141A24;
  --surface-2:   #0E131B;
  --line:        rgba(255,255,255,0.07);
  --line-strong: rgba(255,255,255,0.12);
  --ink:         #EEF0F5;
  --ink-dim:     #C2C9D6;
  --muted:       #7A8497;
  --accent:      #8FB0D6;
  --accent-dim:  #B3C8E2;
  --accent-deep: #5E7FA8;
  --up:          #5FB58C;
  --down:        #D9706B;
  --warn:        #CBB081;
  --gold:        #CBB081;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 18px;

  /* aliases: keep existing page styles working, re-themed */
  --panel:       var(--surface);
  --panel2:      var(--surface-2);
  --paper:       var(--ink);
  --violet:      var(--accent);
  --violet-2:    var(--accent-dim);
  --violet-soft: var(--accent-dim);
  --brand:       var(--accent);
  --amber:       var(--warn);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

::selection { background: var(--accent); color: var(--bg); }

* { scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- tap-to-explain glossary (see glossary.js) ----
   Shared across pages: an accent-tinted dotted-underline term that reveals a calm
   tooltip on tap/click. Token-based only — no hardcoded colors. Deliberately
   minimal for now; this is the ONE component to restyle in the later theme pass. */
.gloss-term {
  border-bottom: 1px dotted var(--accent); /* accent tint = "this word is interactive" */
  cursor: help;
  -webkit-tap-highlight-color: transparent;
}
.gloss-term:hover { border-bottom-color: var(--accent-dim); }
.gloss-term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.gloss-tip {
  position: absolute;
  z-index: 60;
  max-width: 260px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 14px 36px -14px rgba(0,0,0,0.7);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.gloss-tip.show { opacity: 1; transform: none; }

/* one-time "tap any underlined term" hint (shown once per user, see glossary.js) */
.gloss-hint {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 12px);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 18px 44px -16px rgba(0,0,0,0.7);
  color: var(--ink-dim);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.gloss-hint.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.gloss-hint-eg { border-bottom: 1px dotted var(--accent); color: var(--ink); }
.gloss-hint-x {
  flex: none;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
}
.gloss-hint-x:hover { border-color: var(--accent); }

/* ---- Li·Da logo mark — "The Point" ----
   The dot in the wordmark, as a small diamond split two ways: steel-blue (the
   bull case, left) and brass-gold (the bear case, right). Same construct as the
   home page; em-sized so it scales crisply from the small nav to large headings.
   Usage:  LI<span class="lida-dot"><span class="d-r"></span><span class="d-l"></span></span>DA */
.lida-dot { position: relative; display: inline-block; width: 0.64em; height: 0.76em; margin: 0 0.08em; vertical-align: middle; }
.lida-dot span { position: absolute; inset: 0; }
.lida-dot .d-r { clip-path: polygon(50% 8%, 100% 50%, 50% 92%); background: var(--gold); }
.lida-dot .d-l { clip-path: polygon(50% 8%, 0 50%, 50% 92%); background: var(--accent); }

