/* ==========================================================================
   Kedmark colour tokens
   Nine colours. Two grounds, two secondary inks, two hairlines, two metals,
   one aged metal. No tint ramps, no state colours, no decorative values.

   Governing law: every brand colour is removable. No colour in this file
   carries information on its own. Delete all nine and the system still reads
   at one bit on a thermal printer.
   ========================================================================== */

:root {
  /* --- The nine ------------------------------------------------------- */
  --km-ink:            #0B1418; /* ground on dark, primary text on light, the one colour at 1 bit */
  --km-paper:          #F6F2EA; /* ground on light, primary text on dark, card and sticker stock */
  --km-brass:          #8A5A12; /* the brand colour, paper side only. Text and rules on light. */
  --km-brass-bright:   #E3A544; /* the brand colour, ink side. Text on dark, plate fill, cut vinyl. */
  --km-verdigris:      #0E4A45; /* credential ground. Sticker, card reverse, seal. Never body text. */
  --km-slate:          #4C575B; /* secondary text, light ground only */
  --km-mist:           #A2B4B9; /* secondary text, dark ground only */
  --km-rule:           #DCD6C9; /* hairline, light ground only. Never text. */
  --km-rule-dark:      #22323A; /* hairline, dark ground only. Never text. */

  /* --- Semantic, light theme ------------------------------------------ */
  --km-bg:             var(--km-paper);
  --km-surface:        #FFFFFF;
  --km-text:           var(--km-ink);          /* 16.68:1 on paper, 18.63:1 on white */
  --km-text-secondary: var(--km-slate);        /*  6.67:1 on paper,  7.44:1 on white */
  --km-hairline:       var(--km-rule);
  --km-accent:         var(--km-brass);        /*  5.30:1 on paper,  5.91:1 on white */
  --km-accent-contrast:var(--km-paper);        /*  5.30:1 on brass */

  /* --- Semantic, the Powered by block --------------------------------- */
  --km-footer-words:   var(--km-slate);        /*  7.44:1 on white */
  --km-footer-name:    var(--km-ink);          /* 18.63:1 on white */
  --km-footer-rule:    var(--km-brass);

  /* --- Semantic, credential surfaces ---------------------------------- */
  --km-seal-ground:    var(--km-verdigris);
  --km-seal-metal:     var(--km-brass-bright); /*  4.67:1 on verdigris */
  --km-seal-name:      var(--km-paper);        /*  9.02:1 on verdigris */

  /* --- Website v4 additions (B2-STY-01, D-TOKENS), light ----------------- */
  --molten-12:         #F1EBE3;                /* 12% brass over white, opaque */
  --mist-line:         rgba(76,87,91,.28);     /* slate at 28%, hairline only, never text */
  --pulse:             rgba(138,90,18,.40);    /* brass at 40%, focus and pulse ring only */
}

/* --- Dark theme ------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --km-bg:             var(--km-ink);
    --km-surface:        #101C21;
    --km-text:           var(--km-paper);        /* 16.68:1 on ink */
    --km-text-secondary: var(--km-mist);         /*  8.66:1 on ink */
    --km-hairline:       var(--km-rule-dark);
    --km-accent:         var(--km-brass-bright); /*  8.63:1 on ink */
    --km-accent-contrast:var(--km-ink);          /*  8.63:1 on brass-bright */

    --km-footer-words:   var(--km-mist);         /*  8.66:1 on ink */
    --km-footer-name:    var(--km-paper);        /* 16.68:1 on ink */
    --km-footer-rule:    var(--km-brass-bright);

    --molten-12:         #292C25;                /* 12% brass-bright over surface #101C21, opaque */
    --mist-line:         rgba(162,180,185,.28);  /* mist at 28%, hairline only, never text */
    --pulse:             rgba(227,165,68,.45);   /* brass-bright at 45%, focus and pulse ring only */
  }
}

:root[data-theme="dark"] {
  --km-bg:             var(--km-ink);
  --km-surface:        #101C21;
  --km-text:           var(--km-paper);
  --km-text-secondary: var(--km-mist);
  --km-hairline:       var(--km-rule-dark);
  --km-accent:         var(--km-brass-bright);
  --km-accent-contrast:var(--km-ink);

  --km-footer-words:   var(--km-mist);
  --km-footer-name:    var(--km-paper);
  --km-footer-rule:    var(--km-brass-bright);

  --molten-12:         #292C25;
  --mist-line:         rgba(162,180,185,.28);
  --pulse:             rgba(227,165,68,.45);

}

/* --- Forbidden, stated so it is not rediscovered ----------------------
   --km-brass        on --km-ink          =  3.15:1  never text on dark
   --km-brass-bright on --km-paper        =  1.93:1  never text on light
   --km-mist         on --km-paper        =  1.93:1  never text on light
   --km-slate        on --km-ink          =  2.50:1  never text on dark
   --km-rule / --km-rule-dark             never text on any ground
   --km-verdigris                          ground only, never a text colour
   -------------------------------------------------------------------- */
