/* ─────────────────────────────────────────────────────────────────────────
   BACK-COMPAT ALIAS SHIM — do not add anything here.

   This file used to be the single flat token file. It is now a thin alias
   layer so the ~250 existing call sites keep resolving while they are
   migrated to the tiered tokens in tokens/. Every name below is deprecated:
   write var(--color-*) / var(--space-*) / var(--text-*) / var(--radius-*)
   in new code, and delete the alias once its last caller is gone.

   New tokens go in tokens/primitives.css, tokens/semantic.css or
   tokens/components.css. See docs/dev/web/design-system.md §3.
   ───────────────────────────────────────────────────────────────────────── */

@layer tokens {
  :root {
    /* Base palette → tier 2 */
    --bg:           var(--color-bg);
    --surface:      var(--color-surface);
    --surface-alt:  var(--color-surface-2);
    --border:       var(--color-border);
    --border-light: var(--color-border-light);
    --text:         var(--color-text);
    --text-muted:   var(--color-text-muted);
    --text-light:   var(--color-text-faint);

    /* Brand → tier 1 */
    --dark-green: var(--green-900);
    --orange:     var(--orange-500);

    /* Type / spacing / shape → tier 1 scales */
    --mono:     var(--font-mono);
    --radius:   var(--radius-sm);
    --space-xs: var(--space-1);
    --space-sm: var(--space-2);
    --space-md: var(--space-4);
    --space-lg: var(--space-8);
    --space-xl: var(--space-16);

    /* Status → tier 2 */
    --danger:        var(--color-danger);
    --danger-dark:   var(--color-danger-strong);
    --danger-bg:     var(--color-danger-bg);
    --danger-border: var(--color-danger-border);
    --success-color:  var(--color-success);
    --success-bg:     var(--color-success-bg);
    --success-border: var(--color-success-border);
    --warning-color:  var(--color-warning);
    --warning-bg:     var(--color-warning-bg);
    --warning-btn:       var(--btn-warning-bg);
    --warning-btn-hover: var(--btn-warning-hover);

    /* Component tokens that kept their old names → tier 3.
       --ext-banner-*, --holon-*, --journey-*, --note-comment-*,
       --interest-*, --nav-env-*, --published-*, --overdue-*, --today-*
       are all defined in tokens/components.css and need no alias. */
    --overdue-color:     var(--overdue-fg);
    --today-color:       var(--today-fg);
    --published-color:   var(--published-fg);
    --tag-success-color: var(--tag-success-fg);
    --tag-fail-color:    var(--tag-fail-fg);
  }

  /* Accent aliases re-resolve per element, like the tokens they alias —
     see tokens/semantic.css. On :root they would freeze to the platform
     olive and every legacy var(--accent) call site would ignore the theme. */
  *,
  ::before,
  ::after {
    --accent:       var(--color-accent);
    --accent-hover: var(--color-accent-hover);
    --accent-ring:  var(--color-accent-ring);
    /* --font aliases --font-ui, which an app may swap; on :root it would
       freeze to the platform face and body { font-family: var(--font) }
       would ignore the theme. --mono stays on :root — never themeable. */
    --font:         var(--font-ui);
  }
}
