:root {
    --keyword-color: #4271ae;
    --type-color: #d7005f;
    --conditional-color: #8959a8;
    --builtin-color: #d7005f;
    --operator-color: #3e999f;
    --type-operator-color: var(--operator-color);
    --string-color: #5f00ff;
    --bool-literal-color: #b59000;
    --self-color: #d7005f;
    --literal-color: #d75f00;
    --attribute-color: #4271ae;
    --namespace-part-color: #e00505;
    --param-color: #870049;
    --comment-green: #006700;
    --constant-color: #d7005f;
    --error-red: #ad251b;
    --error-blue: #003f8e;
    --error-orange: #b69700;
    --error-green: #008700;
    --olive-green: #417116;

    --dim-filter: contrast(30%) saturate(50%)
}

@media (prefers-color-scheme: dark) {
    /*
        These .light and .rust classes are MDBook themes which is needed because
        we share the theme between the website and book
     */
    :root:not(.light, .rust) {
        --keyword-color: rgb(50%, 100%, 100%);
        --type-color: rgb(67%, 81%, 17%);
        --conditional-color: rgb(94%, 63%, 94%);
        --builtin-color: rgb(100%, 37%, 68%);
        --operator-color: rgb(88%, 65%, 10%);
        --type-operator-color: rgb(88%, 65%, 10%);
        --string-color: rgb(55%, 71%, 33%);
        --bool-literal-color: rgb(88%, 65%, 10%);
        --self-color: rgb(88%, 34%, 62%);
        --literal-color: rgb(88%, 34%, 62%);
        --attribute-color: rgb(100%, 55%, 100%);
        --namespace-part-color: #ff3537;
        --param-color: #df875f;
        --constant-color: rgb(88%, 34%, 62%);
        --comment-green: rgb(20%, 60%, 25%);
        --bg-color: rgb(0%,0%,0%);
        --error-red: rgb(100%,25%,25%);
        --error-blue: rgb(0%,55%,100%);
        --error-orange: rgb(72%,62%,03%);
        --error-green: rgb(55%,100%,0%);
        --olive-green: rgb(0%,60%,0%);

        --dim-filter: brightness(50%) saturate(20%)
    }
}

.z-dim {
    filter: var(--dim-filter);
}

.z-strike {
    text-decoration-line: line-through;
}

.z-type:not(.z-prose *) {
    color: var(--type-color)
}

.z-keyword:not(.z-prose *) {
    color: var(--keyword-color);
    font-weight: bold;
}
.z-type:not(.z-prose *) {
    color: var(--type-color)
}

.z-operator:not(.z-prose *) {
    color: var(--operator-color)
}

.z-literal:not(.z-prose *) {
    color: var(--literal-color)
}

.z-keyword.z-control {
    color: var(--conditional-color)
}

.z-comment {
    color: var(--comment-green);
    font-weight: bold;
}

.z-string {
    color: var(--string-color);
    font-weight: bold;
}


.z-bool-literal:not(.z-prose *) {
    color: var(--bool-literal-color);
    font-weight: bold;
}

.z-storage.z-modifier:not(.z-prose *) {
    color: var(--type-operator-color);
}
.z-storage.z-type.z-struct:not(.z-prose *) {
    color: var(--keyword-color);
}
.z-storage.z-type.z-enum:not(.z-prose *) {
    color: var(--keyword-color);
}
.z-storage.z-type.z-impl:not(.z-prose *) {
    color: var(--keyword-color);
}

.z-prose.z-red {
    color: var(--error-red)
}
.z-prose.z-green {
    color: var(--error-green)
}
.z-prose.z-blue {
    color: var(--error-blue)
}
