/* ============================================================
 * APEX SALES OS · BASE RESET + TYPOGRAPHY + ANIMATIONS
 *
 * Owner: Worker W1 (foundation-css lane).
 * Loaded after 00-tokens.css; everything visual inherits the
 * tokens defined there. Page-local sheets MUST NOT redefine
 * the resets, scrollbar styling, or keyframes below.
 *
 * Stripe-tier baseline: Inter Tight body, JetBrains Mono for
 * .mono utility, subtle scrollbar, purple-tint selection, and
 * the canonical animation keyframes (tickPulse / livePulse /
 * dotPulse / shimmer / spin) referenced from primitives.
 * ============================================================ */

/* fonts (loaded from Google Fonts) */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;450;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ------------------------------------------------------------
 * reset
 * ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-warm);
  color: var(--text);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  /* hard rule: NO horizontal scroll on dashboard pages */
  overflow-x: hidden;
}

/* ------------------------------------------------------------
 * selection
 * ------------------------------------------------------------ */
::selection { background: rgba(99, 91, 255, 0.20); }

/* ------------------------------------------------------------
 * scrollbar (subtle)
 * ------------------------------------------------------------ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 2px solid var(--bg-warm);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ------------------------------------------------------------
 * utility families
 * ------------------------------------------------------------ */
.mono  { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.num   { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.soft  { color: var(--text-soft); }

/* gradient text helper (purple gradient on big hero numbers) */
.gnum {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ------------------------------------------------------------
 * keyframes (animations)
 * ------------------------------------------------------------ */

/* tick animation (live numbers blip on update) */
@keyframes tickPulse {
  0%, 100% { transform: scale(1); }
  20%      { transform: scale(1.04); }
}
.tick { display: inline-block; animation: tickPulse 250ms ease-out; }

/* live pulse (recording / live data indicators) — purple, NEVER red */
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.16); }
  50%      { box-shadow: 0 0 0 6px rgba(99, 91, 255, 0.06); }
}

/* dot pulse (trailing point on sparklines) */
@keyframes dotPulse {
  0%, 100% { r: 2.6; opacity: 1; }
  50%      { r: 4;   opacity: 0.5; }
}

/* shimmer (loading skeleton sweep) */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* spin (loading spinner) */
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------
 * default app root + boot fade-in
 * ------------------------------------------------------------ */
#app-root { min-height: 100vh; }

/* hide while booting to avoid flash of unstyled content */
html.app-booting #app-root { opacity: 0; }
html:not(.app-booting) #app-root {
  opacity: 1;
  transition: opacity 200ms ease;
}

/* ------------------------------------------------------------
 * form element baseline
 * ------------------------------------------------------------ */
button {
  cursor: pointer;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
}

input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  font: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.12);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

/* ------------------------------------------------------------
 * link reset
 * ------------------------------------------------------------ */
a { color: inherit; text-decoration: none; }
a.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
a.link:hover { text-decoration: underline; }

/* ------------------------------------------------------------
 * keyboard hint chip
 * ------------------------------------------------------------ */
.kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ------------------------------------------------------------
 * viewport guard (Apex Sales OS is desktop-only · 1280px+)
 * paired with the inline width-check script in index.html
 * ------------------------------------------------------------ */
html.viewport-too-small body > *:not(.viewport-warning) { display: none !important; }
html.viewport-too-small body::before {
  content: 'Apex Sales OS is desktop-only. Please open at 1280px+ width.';
  display: block;
  padding: 80px 40px;
  font-size: 18px;
  color: var(--text-muted);
  text-align: center;
}
