/* =====================================================================
   manav.id — design tokens: the canonical --manav-* set, and the alias
   layer that maps the legacy names onto it (QUAL-15, ADR-014,
   __md_info/DESIGN_OVERRIDES.md).

   This is the one file allowed to hold colour literals
   (tools/lint-css.py). New CSS reads --manav-* only. The values are the
   "ledger" light theme of css/theme.css; the site is light-only.

   Loading: manav-fonts.css imports this file first, so every page that
   has the fonts has the tokens, ahead of every other sheet (the .min
   builds inline it: tokens -> fonts -> type-system -> the page's theme).

   Precedence: everything here sits in the cascade layer `manav-tokens`,
   declared before type-system.css's layers, so it is the weakest author
   CSS on the page. A page or theme that sets a legacy name itself
   (theme.css's --ink, a lab's own --tx or green --accent) keeps its
   value; the alias only fills a name nobody set. Migrate a page by
   deleting its own palette and reading --manav-*.
   ===================================================================== */
@layer manav-tokens {
  :root {
    /* Brand: the one violet. #4B3BE0 is 6.6:1 on --manav-bg and 7.0:1 on white. */
    --manav-violet:      #4B3BE0;
    --manav-violet-hi:   #6D5FF0;   /* lighter step: gradients, focus glow */
    --manav-violet-lo:   #3827C2;   /* darker step */
    --manav-violet-hover: var(--manav-violet-lo);    /* hover / pressed on a light ground */
    --manav-violet-active: var(--manav-violet-lo);
    --manav-violet-light: #9D93FF;  /* violet on a dark panel (code, terminals), pale marks */
    --manav-violet-deep: #2E2496;   /* shadow tint; violet ink on a violet wash */
    --manav-violet-soft: #F0EEFE;   /* tinted fill */
    --manav-violet-line: #D6D1FB;   /* tinted border */
    --manav-violet-glow: rgba(75, 59, 224, .16);

    /* Surfaces: cool paper ground, white raised surfaces, hairline structure */
    --manav-bg:          #F7F8FA;
    --manav-bg-warm:     #F2F4F7;
    --manav-surface:     #FFFFFF;
    --manav-surface-2:   #F1F3F6;   /* inset: inline code, table heads */
    --manav-surface-3:   #E8EBF0;
    --manav-border:      #DCE0E7;
    --manav-border-soft: #E7EAEF;

    /* Ink (contrast on --manav-bg) */
    --manav-ink:         #0A0D14;   /* 18.6:1 */
    --manav-ink-hover:   #1C2130;
    --manav-ink-2:       #3D4350;   /* 9.6:1 */
    --manav-ink-3:       #4B5160;   /* 7.5:1: muted that still clears the small-text floor */
    --manav-ink-inverse: #FBFCFD;
    --manav-ink-pure:    #000000;

    /* Semantic, used sparingly */
    --manav-ok:          #0B7A48;
    --manav-ok-soft:     #EAF6EF;
    --manav-ok-line:     #BFE3CE;
    --manav-labs-accent: #2D6A4F;   /* warm-paper continuity labs accent (DESIGN_OVERRIDES.md) */
    --manav-warn:        #8C5200;
    --manav-warn-soft:   #FDF4E3;
    --manav-warn-line:   #F0D9AE;
    --manav-crit:        #B4232A;
    --manav-crit-soft:   #FDEEEE;
    --manav-crit-line:   #F3C8CB;

    /* Terminal / dark callout cards */
    --manav-term-border: #3A4152;
    --manav-term-muted:  #D2D6DE;
    --manav-term-subtle: #C9CED8;
    --manav-term-dim:    #AEB4C0;
    --manav-term-ink:    #E6E8EC;
    --manav-term-hover:  #ECEEF2;
    --manav-term-violet: #B4ABFF;
    --manav-term-violet-soft: #C8C1FF;
    --manav-term-ok:     #7FE0A8;
    --manav-term-warn:   #FFD58A;
    --manav-term-crit:   #FFB3B8;
    --manav-term-crit-hi:#FF8A91;
    --manav-term-pink:   #D63B6B;

    /* Type: the pinned font set (DESIGN_OVERRIDES.md) and the three weights */
    --manav-font-sans:   'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --manav-font-mono:   'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --manav-font-serif:  'Newsreader', Charter, Georgia, 'Times New Roman', serif;   /* editorial headings only */
    --manav-weight-regular:  400;
    --manav-weight-medium:   500;
    --manav-weight-semibold: 600;   /* the heaviest weight that exists */

    /* ---- Legacy names -> canonical (defaults only; see Precedence) ---- */
    /* ink: --tx* (labs, blog/theme.css), --ink* (css/theme.css), --twc-* (the /manav/ app) */
    --tx:            var(--manav-ink);
    --tx2:           var(--manav-ink-2);
    --tx3:           var(--manav-ink-3);
    --tx-inv:        var(--manav-ink-inverse);
    --ink:           var(--manav-ink);
    --ink-2:         var(--manav-ink-2);
    --ink-3:         var(--manav-ink-3);
    --ink-inv:       var(--manav-ink-inverse);
    --twc-text:      var(--manav-ink);
    --twc-text-secondary: var(--manav-ink-2);
    --twc-text-inverse:   var(--manav-ink-inverse);

    /* violet: --ac* (theme.css), --accent* (brand.css, labs), --violet, --twc-accent */
    --ac:            var(--manav-violet);
    --ac2:           var(--manav-violet);
    --ac-hi:         var(--manav-violet-hi);
    --ac-lo:         var(--manav-violet-lo);
    --ac-soft:       var(--manav-violet-soft);
    --ac-line:       var(--manav-violet-line);
    --ac-glow:       var(--manav-violet-glow);
    --accent:        var(--manav-violet);
    --accent-hover:  var(--manav-violet-hover);
    --accent-soft:   var(--manav-violet-soft);
    --violet:        var(--manav-violet);
    --twc-accent:    var(--manav-violet);
    --twc-accent-hover: var(--manav-violet-hover);
    --twc-accent-light: var(--manav-violet-soft);

    /* surfaces */
    --bg:            var(--manav-bg);
    --bg-warm:       var(--manav-bg-warm);
    --s1:            var(--manav-surface);
    --s2:            var(--manav-surface-2);
    --s3:            var(--manav-surface-3);
    --bdr:           var(--manav-border);
    --bdr-soft:      var(--manav-border-soft);
    --twc-bg:        var(--manav-bg);
    --twc-surface:   var(--manav-surface);

    /* semantic */
    --ok:            var(--manav-ok);
    --warn:          var(--manav-warn);
    --crit:          var(--manav-crit);

    /* type: the 14 family-token spellings in use come down to these three */
    --font:          var(--manav-font-sans);
    --sans:          var(--manav-font-sans);
    --mono:          var(--manav-font-mono);
    --serif:         var(--manav-font-serif);
    --font-serif:    var(--manav-font-serif);
  }
}
