/**
 * PJA → Terrain Token Bridge
 *
 * PJA legacy tokens (--ink, --one..--four, --paper-*, --shade, --muted) are
 * the source of truth here — they come from `css/pja-themes.css` via the
 * [data-theme="…"] attribute on <html>. This file derives tetra's semantic
 * aliases (--bg-primary, --accent-primary, --success, ...) from them so
 * terrain modules that read tetra aliases render correctly.
 *
 * Load order:
 *   css/pja-fonts.css
 *   css/pja-themes.css         (defines --ink/--one/...)
 *   terrain/css/pja-bridge.css (derives tetra aliases — THIS FILE)
 *   terrain/css/core.css + component CSS
 *
 * The <html> element should carry a `data-theme` attribute (e.g. "lava",
 * "tv", "cyber") so pja-themes.css has a selector to match.
 */

:root {
    /* Backgrounds — PJA paper → Terrain bg */
    --bg-primary:   var(--paper-dark);
    --bg-secondary: var(--paper-mid);
    --bg-tertiary:  var(--paper-light);
    --bg-hover:     var(--paper-light);

    /* Text — PJA ink → Terrain text */
    --text-primary:   var(--ink);
    --text-secondary: var(--ink);
    --text-muted:     var(--muted, var(--four));
    --text-code:      var(--three);

    /* Accents — PJA one/two → Terrain accent */
    --accent-primary:   var(--one);
    --accent-secondary: var(--two);
    --success: var(--four);
    --error:   var(--two);
    --warning: var(--one);

    /* Borders */
    --border:         var(--shade);
    --border-visible: var(--paper-light);
    --border-active:  var(--one);

    /* Palette slots — legacy terrain modules that read raw p/s/t get PJA values */
    --p1: var(--shade);
    --p2: var(--paper-dark);
    --p3: var(--paper-mid);
    --p4: var(--paper-light);
    --p5: var(--ink);
    --p6: var(--two);
    --p7: var(--four);
    --p8: var(--three);

    --s1: var(--one);
    --s2: var(--two);
    --s3: var(--three);
    --s4: var(--four);
    --s5: var(--one);
    --s6: var(--four);
    --s7: var(--one);
    --s8: var(--three);

    --t1: var(--shade);
    --t2: var(--shade);
    --t3: var(--paper-light);
    --t4: var(--muted, var(--four));
    --t5: var(--ink);
    --t6: var(--ink);
    --t7: var(--ink);
    --t8: var(--ink);
}
