/* Colour tokens (DSYS-001, DSYS-002).
 *
 * The brief's table plus the canvas tokens it leaves out (accent-ink,
 * accent-hover, accent-line, cover-ink, interop, interop-wash and the t-*
 * syntax colours), with the values from Main.dc.html, Content.dc.html and
 * Chapter.dc.html.
 * The boot snippet sets data-theme before first paint; with no data-theme at
 * all (scripts off), the light block applies and the media query switches to
 * the dark one when the system asks for it. The magenta --ghost tokens mark
 * unapproved placeholders on the canvas and are not defined here.
 */

:root[data-theme="light"],
:root:not([data-theme]) {
  color-scheme: light;
  --bg: #F8F7F3;
  --surface: #FFFFFF;
  --sunken: #EFEEE8;
  --rule: #DEDCD3;
  --rule-strong: #ABA89C;
  --ink: #17171C;
  --ink-2: #46464F;
  --ink-3: #66666F;
  --accent: #3E3A9E;
  --accent-wash: #E9E8F7;
  --garden: #0A6B4E;
  --garden-wash: #E1EFE8;
  --caution: #8F5300;
  --caution-wash: #F9EDD6;
  --notice-bg: #F9EDD6;
  --notice-ink: #5C3700;
  --notice-rule: #E3C48A;
  --prev-cover: #77748A;
  --prev-ink: #F4F3F8;
  --danger: #B42318;
  --danger-wash: #FBE8E6;
  --cover: #2E2B7A;
  --prov-spec: #17171C;
  --prov-ref: #1F5FA8;
  --prov-crates: #A3401A;
  --prov-otc: #8B2F6B;
  --accent-ink: #FFFFFF;
  --accent-hover: #2F2B85;
  --accent-line: #C9C6EC;
  --cover-ink: #F1F0FF;
  --interop: #8B2F6B;
  --interop-wash: #F5E8F0;
  --t-plain: #3B3B44;
  --t-punct: #66666F;
  --t-key: #2349B8;
  --t-str: #9A3D12;
  --t-num: #7A3BB8;
  --t-type: #3E3A9E;
  --t-nsid: #0A6B4E;
  --t-did: #0E7A73;
  --t-com: #66666F;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121318;
  --surface: #191A20;
  --sunken: #20212A;
  --rule: #2E2F39;
  --rule-strong: #4A4B57;
  --ink: #E8E8EC;
  --ink-2: #B6B6C0;
  --ink-3: #8E8E99;
  --accent: #A9A6FF;
  --accent-wash: #25234A;
  --garden: #52C99D;
  --garden-wash: #123128;
  --caution: #E9A84B;
  --caution-wash: #33260F;
  --notice-bg: #33260F;
  --notice-ink: #F3D29B;
  --notice-rule: #5A431A;
  --prev-cover: #3A3946;
  --prev-ink: #D9D8E2;
  --danger: #F2857A;
  --danger-wash: #3A1B18;
  --cover: #2A2866;
  --prov-spec: #E8E8EC;
  --prov-ref: #8DB4F0;
  --prov-crates: #F2946A;
  --prov-otc: #E58BC6;
  --accent-ink: #121318;
  --accent-hover: #C4C2FF;
  --accent-line: #3A3770;
  --cover-ink: #ECEBFF;
  --interop: #E58BC6;
  --interop-wash: #36192B;
  --t-plain: #CBCBD3;
  --t-punct: #8E8E99;
  --t-key: #8DB0FF;
  --t-str: #F2A070;
  --t-num: #C9A0F4;
  --t-type: #B7B4FF;
  --t-nsid: #52C99D;
  --t-did: #5FCFC5;
  --t-com: #8E8E99;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #121318;
    --surface: #191A20;
    --sunken: #20212A;
    --rule: #2E2F39;
    --rule-strong: #4A4B57;
    --ink: #E8E8EC;
    --ink-2: #B6B6C0;
    --ink-3: #8E8E99;
    --accent: #A9A6FF;
    --accent-wash: #25234A;
    --garden: #52C99D;
    --garden-wash: #123128;
    --caution: #E9A84B;
    --caution-wash: #33260F;
    --notice-bg: #33260F;
    --notice-ink: #F3D29B;
    --notice-rule: #5A431A;
    --prev-cover: #3A3946;
    --prev-ink: #D9D8E2;
    --danger: #F2857A;
    --danger-wash: #3A1B18;
    --cover: #2A2866;
    --prov-spec: #E8E8EC;
    --prov-ref: #8DB4F0;
    --prov-crates: #F2946A;
    --prov-otc: #E58BC6;
    --accent-ink: #121318;
    --accent-hover: #C4C2FF;
    --accent-line: #3A3770;
    --cover-ink: #ECEBFF;
    --interop: #E58BC6;
    --interop-wash: #36192B;
    --t-plain: #CBCBD3;
    --t-punct: #8E8E99;
    --t-key: #8DB0FF;
    --t-str: #F2A070;
    --t-num: #C9A0F4;
    --t-type: #B7B4FF;
    --t-nsid: #52C99D;
    --t-did: #5FCFC5;
    --t-com: #8E8E99;
  }
}
