/* ========================================================================
   vc-aliases.css — LEGACY VARIABLE BACK-COMPAT LAYER
   RetirePlusPlus Investor Module ($30M Series B)

   Maps the three+ legacy token namespaces onto the new semantic tokens in
   vc-tokens.css so existing page CSS keeps working UNCHANGED:
     --vc-*          (vc-base.css)
     --primary / --secondary / --accent / --light / --white / --gray-*
                     (invest-landing.css)
     --rpp-*         (pitch-deck.css, app.css / investor-portal)

   LOAD ORDER: AFTER vc-tokens.css, BEFORE vc-base / vc-components / page CSS.
   Rationale (design §1.1): aliases resolve to the token layer, but any page
   that still ships its OWN :root / [data-theme] block keeps overriding these
   by normal cascade — so Phase-0 is purely ADDITIVE and NON-BREAKING. As each
   page agent (Phase 1) deletes its local :root/dark block, these aliases take
   over with identical values. Zero markup churn, zero drift.

   Aliases are authored in BOTH :root (light) and [data-theme="dark"] so that
   theme-sensitive legacy names (the neutral ramp, --white, --light) invert on
   dark exactly as the old per-page dark blocks did — via the semantic tokens.
   ======================================================================== */

/* ========================================================================
   1. --vc-* namespace (vc-base.css)  ->  semantic tokens
   ======================================================================== */
:root {
  /* Brand */
  --vc-primary:       var(--accent-primary);
  --vc-primary-light: var(--accent-primary-hover);
  --vc-accent:        var(--accent-secondary);
  --vc-accent-light:  var(--green-400);
  --vc-accent-dark:   var(--green-700);
  --vc-gold:          var(--accent-tertiary); /* legacy "gold" was violet #7C3AED */
  --vc-gold-light:    var(--violet-500);

  /* Status */
  --vc-success: var(--status-success);
  --vc-warning: var(--status-warning);
  --vc-error:   var(--status-error);
  --vc-info:    var(--status-info);

  /* Neutral ramp — light context maps light->dark text scale.
     These follow the semantic neutrals so they invert correctly on dark. */
  --vc-white:    var(--bg-surface);
  --vc-gray-50:  var(--bg-canvas);
  --vc-gray-100: var(--bg-surface-2);
  --vc-gray-200: var(--border-subtle);
  --vc-gray-300: var(--border-strong);
  --vc-gray-400: var(--slate-400);
  --vc-gray-500: var(--text-muted);
  --vc-gray-600: var(--text-secondary);
  --vc-gray-700: var(--slate-700);
  --vc-gray-800: var(--text-primary);
  --vc-gray-900: var(--text-primary);

  /* Typography (legacy names used by vc-base.css) */
  --font-heading: var(--font-display);
  --font-body:    var(--font-ui);
  /* --font-data / --font-mono already defined in vc-tokens.css */

  /* Type scale (legacy --text-* names) */
  --text-xs:   var(--fs-xs);
  --text-sm:   var(--fs-sm);
  --text-base: var(--fs-base);
  --text-lg:   var(--fs-lg);
  --text-xl:   var(--fs-xl);
  --text-2xl:  var(--fs-2xl);
  --text-3xl:  var(--fs-3xl);
  --text-4xl:  var(--fs-4xl);
  --text-5xl:  var(--fs-5xl);
  --text-6xl:  var(--fs-6xl);

  /* Layout (legacy names) */
  --max-width-narrow: var(--max-width-prose);
  --sidebar-width:    17.5rem;
  /* --max-width / --header-height already in vc-tokens.css */

  /* Borders (legacy radius names) */
  --radius-full: var(--radius-pill);
  /* --radius-sm / -md / -lg / -xl already in vc-tokens.css */

  /* Transitions (legacy names) */
  --transition-fast: var(--dur-fast) var(--ease-standard);
  --transition-base: var(--dur-base) var(--ease-standard);
  --transition-slow: var(--dur-slow) var(--ease-standard);
}

/* ========================================================================
   2. --primary / --secondary / --accent / neutrals  (invest-landing.css)
      -> semantic tokens
   ======================================================================== */
:root {
  --primary:         var(--accent-primary);
  --primary-light:   var(--blue-500);
  --primary-dark:    var(--blue-900);
  --secondary:       var(--accent-secondary);
  --secondary-light: var(--green-400);
  --accent:          var(--accent-tertiary);
  --accent-light:    var(--violet-400);
  --success:         var(--status-success);

  /* Theme-sensitive neutrals (the page's dark block inverted these) */
  --light:    var(--bg-surface-2);
  --white:    var(--bg-surface);
  --gray-50:  var(--bg-canvas);
  --gray-100: var(--bg-surface-2);
  --gray-200: var(--border-subtle);
  --gray-500: var(--text-muted);
  --gray-700: var(--text-secondary);
  --gray-800: var(--text-primary);
  --gray-900: var(--text-primary);
}

/* ========================================================================
   3. --rpp-* namespace (pitch-deck.css, app.css / investor-portal)
      -> semantic tokens
   ======================================================================== */
:root {
  --rpp-primary:        var(--accent-primary);
  --rpp-primary-light:  var(--accent-primary-hover);
  --rpp-primary-dark:   var(--blue-900);
  --rpp-secondary:      var(--accent-secondary);
  --rpp-secondary-light: var(--green-400);
  --rpp-accent:         var(--accent-tertiary);
  --rpp-accent-light:   var(--violet-500);
  --rpp-gold:           var(--accent-partner);
  --rpp-gold-light:     var(--amber-400);
  --rpp-purple:         var(--accent-tertiary);
  --rpp-purple-light:   var(--violet-400);
}

/* ========================================================================
   4. DARK-CONTEXT OVERRIDES
   The legacy per-page dark blocks redefined the neutral ramp, --white and
   --light to inverted values. Because our aliases point at semantic tokens
   that ALREADY invert under [data-theme="dark"], the neutral aliases above
   invert automatically — no per-name dark override is needed for them.

   We re-point only the *brand* aliases here so legacy names that the old
   code did NOT theme (e.g. link/brand accents) pick up the dark, AA-correct
   accent values (e.g. --accent-primary becomes the lighter --blue-400 on
   dark). The semantic tokens drive the actual values; these lines exist so
   a page reading `var(--primary)` or `var(--vc-primary)` on dark gets the
   AA-safe lightened accent rather than the dark #1E40AF.
   ======================================================================== */
[data-theme="dark"] {
  /* --vc-* brand */
  --vc-primary:       var(--accent-primary);
  --vc-primary-light: var(--accent-primary-hover);
  --vc-accent:        var(--accent-secondary);
  --vc-accent-light:  var(--green-300);
  --vc-gold:          var(--accent-tertiary);
  --vc-gold-light:    var(--violet-400);

  /* --primary / --accent (invest-landing) */
  --primary:         var(--accent-primary);
  --primary-light:   var(--blue-300);
  --secondary:       var(--accent-secondary);
  --secondary-light: var(--green-300);
  --accent:          var(--accent-tertiary);
  --accent-light:    var(--violet-300);

  /* --rpp-* (pitch-deck / portal) */
  --rpp-primary:       var(--accent-primary);
  --rpp-primary-light: var(--accent-primary-hover);
  --rpp-secondary:     var(--accent-secondary);
  --rpp-accent:        var(--accent-tertiary);
  --rpp-gold:          var(--accent-partner);
  --rpp-purple:        var(--accent-tertiary);
}
