/* ============================================================================
   PRIOR MOVES — Design tokens · v1 canon (July 2026 extension)
   Dark-native, light-capable. Drop-in CSS custom properties.
   The v2 "Fold" experiment is RETIRED: it traded the terminal identity for an
   editorial one and broke mono-numeral alignment in dense tables. v1 is canon:
   navy #0a0f1c, ONE blue->cyan accent gradient, Inter + JetBrains Mono tabular.

   THE ONE RULE: solid = disclosed record · ghost/dashed = predicted reflection.
   Cyan (--pm-predicted) is reserved for predictions ONLY. Blue (--pm-action)
   is interactive ONLY. The accent gradient is reserved for primary actions,
   score fills, and the logo mark. Every figure in mono, tabular.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* ---- Canvas & surfaces ---------------------------------------------- */
  --pm-bg: #0a0f1c; /* page — ink navy, flat. No glow, no gradient. */
  --pm-surface-1: #111a2e; /* card */
  --pm-surface-2: #16223b; /* raised / nested */
  --pm-surface-3: #1b2942; /* hover surface */
  --pm-border: #243149; /* hairline */
  --pm-border-strong: #33507e; /* hover / selected border */
  --pm-divider: rgba(151, 163, 184, 0.14);
  --pm-fold: #243149; /* the fold line between record and forecast */

  /* ---- Foreground ------------------------------------------------------ */
  --pm-fg-1: #e9eef8;
  --pm-fg-2: #93a4be;
  --pm-fg-3: #64748b;

  /* ---- Action (interactive ONLY — buttons, links, focus) --------------- */
  --pm-action: #3b82f6;
  --pm-action-hover: #60a5fa;
  --pm-action-ink: #0a0f1c; /* text on action fills */
  --pm-link: #bcd4ff;
  --pm-focus-ring: 0 0 0 2px #0a0f1c, 0 0 0 4px #33507e;

  /* ---- Predicted (the reflection — predictions ONLY) ------------------- */
  --pm-predicted: #22d3ee;
  --pm-predicted-ink: #a9e6f0;
  --pm-predicted-soft: rgba(34, 211, 238, 0.07);
  --pm-predicted-border: rgba(34, 211, 238, 0.45); /* always dashed */

  /* ---- Semantics (colorblind-safe; never pure red/green) --------------- */
  --pm-up: #34d399;
  --pm-up-soft: rgba(52, 211, 153, 0.14);
  --pm-down: #f0a35e;
  --pm-down-soft: rgba(240, 163, 94, 0.14);
  --pm-gold: #f4b740; /* conviction stars only */
  --pm-gold-soft: rgba(244, 183, 64, 0.12);
  --pm-error: #f87171; /* hard errors / destructive only */

  /* ---- Data marks ------------------------------------------------------ */
  --pm-series-actual: #c6d0e0; /* disclosed / realized lines: solid neutral */
  --pm-series-benchmark: #64748b; /* benchmark: thin, dotted */
  --pm-ci-fill: rgba(198, 208, 224, 0.1); /* confidence band */
  --pm-score-track: rgba(151, 163, 184, 0.16);
  --pm-score-fill: linear-gradient(90deg, #3b82f6, #22d3ee);

  /* ---- Elevation -------------------------------------------------------- */
  --pm-shadow-rest: none; /* structure = borders, not shadow */
  --pm-shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.28);
  --pm-shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] {
  color-scheme: light;

  --pm-bg: #f7f5f0; /* warm paper */
  --pm-surface-1: #ffffff;
  --pm-surface-2: #fbfaf6;
  --pm-surface-3: #f0ede5;
  --pm-border: #e3dfd4;
  --pm-border-strong: #aeb9cf;
  --pm-divider: rgba(22, 28, 42, 0.1);
  --pm-fold: #ddd8ca;

  --pm-fg-1: #161c2a;
  --pm-fg-2: #525c70;
  --pm-fg-3: #848da0;

  --pm-action: #2d5fd0;
  --pm-action-hover: #2450b4;
  --pm-action-ink: #ffffff;
  --pm-link: #2d5fd0;
  --pm-focus-ring: 0 0 0 2px #f7f5f0, 0 0 0 4px #2d5fd0;

  --pm-predicted: #0c93a8;
  --pm-predicted-ink: #086d7d;
  --pm-predicted-soft: rgba(12, 147, 168, 0.08);
  --pm-predicted-border: rgba(12, 147, 168, 0.5);

  --pm-up: #17805a;
  --pm-up-soft: rgba(23, 128, 90, 0.1);
  --pm-down: #ad5d1e;
  --pm-down-soft: rgba(173, 93, 30, 0.1);
  --pm-gold: #96701b;
  --pm-gold-soft: rgba(150, 112, 27, 0.12);
  --pm-error: #bd3a31;

  --pm-series-actual: #39424f;
  --pm-series-benchmark: #848da0;
  --pm-ci-fill: rgba(22, 28, 42, 0.06);
  --pm-score-track: rgba(22, 28, 42, 0.1);
  --pm-score-fill: #2d5fd0;

  --pm-shadow-rest: 0 1px 2px rgba(22, 28, 42, 0.05);
  --pm-shadow-hover: 0 6px 20px rgba(22, 28, 42, 0.1);
  --pm-shadow-pop: 0 16px 44px rgba(22, 28, 42, 0.16);
}

:root {
  /* ---- Type families ----------------------------------------------------
     Display serif = publisher credibility. Franklin = newspaper-heritage UI.
     Plex Mono = every figure, tabular. Inter is retired. */
  --pm-font-display: var(--pm-font-sans);
  --pm-font-sans:
    "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pm-font-mono:
    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- Type scale (px). One voice: Inter. Display 800 tight, headings 700,
          every figure JetBrains Mono tabular. ------------------------------- */
  --pm-text-micro: 11px;
  --pm-text-caption: 12px;
  --pm-text-small: 13px;
  --pm-text-body: 14.5px;
  --pm-text-body-lg: 16.5px;
  --pm-text-h3: 19px; /* Inter 700, -.01em */
  --pm-text-h2: 24px; /* Inter 700, -.018em */
  --pm-text-h1: 31px; /* Inter 800, -.025em, lh 1.1 */
  --pm-text-display: 42px; /* Inter 800, -.025em, lh 1.08 */
  --pm-text-display-xl: 56px; /* Inter 800, -.025em, lh 1.06 */
  --pm-text-eyebrow: 11.5px; /* Inter 600, uppercase, .12em, --pm-fg-2 */

  /* ---- Spacing (4px base) ---------------------------------------------- */
  --pm-space-1: 4px;
  --pm-space-2: 8px;
  --pm-space-3: 12px;
  --pm-space-4: 16px;
  --pm-space-5: 20px;
  --pm-space-6: 24px;
  --pm-space-8: 32px;
  --pm-space-10: 40px;
  --pm-space-12: 48px;
  --pm-space-16: 64px;
  --pm-space-24: 96px;

  /* ---- Radii (v1: chips 999px, controls 10px, cards 14px) --------------- */
  --pm-radius-chip: 999px;
  --pm-radius-control: 10px; /* buttons, inputs */
  --pm-radius-card: 14px;
  --pm-radius-tile: 22%; /* logo tile */

  /* ---- Motion ------------------------------------------------------------
     Count-ups, 150ms hover, tab underline slide. No bounce, no parallax,
     no infinite loops. Honor prefers-reduced-motion. */
  --pm-ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --pm-dur: 0.15s;
  --pm-dur-slow: 0.3s;

  /* ---- Layout ------------------------------------------------------------ */
  --pm-measure: 66ch; /* max prose width */
  --pm-content: 1080px; /* app column */
  --pm-content-wide: 1180px; /* marketing column */
}

/* ---- Figure defaults: apply to ANY numeric value ------------------------ */
.pm-num {
  font-family: var(--pm-font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings:
    "tnum" 1,
    "zero" 1;
  letter-spacing: -0.01em;
}
.pm-ticker {
  font-family: var(--pm-font-mono);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---- The ghost treatment: predicted anything --------------------------- */
.pm-ghost {
  border: 1px dashed var(--pm-predicted-border);
  background: var(--pm-predicted-soft);
  color: var(--pm-predicted-ink);
  border-radius: var(--pm-radius-control);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
