/*
 * Fonts and color themes, matched to explorer.espresso.network.
 * The theme picker in base.html sets data-theme on <html>.
 */

@font-face {
    font-family: 'Neue Montreal';
    src: url('fonts/PPNeueMontreal-Book.woff2') format('woff2');
    font-weight: 200 400;
    font-display: fallback;
}

@font-face {
    font-family: 'Neue Montreal';
    src: url('fonts/PPNeueMontreal-Regular.woff2') format('woff2');
    font-weight: 500 900;
    font-display: fallback;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('fonts/IBMPlexMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: fallback;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('fonts/IBMPlexMono-Medium.woff2') format('woff2');
    font-weight: 500 700;
    font-display: fallback;
}

:root {
    --font-sans: 'Neue Montreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    --border-faint: color-mix(in srgb, var(--line) 12%, transparent);
    --border: color-mix(in srgb, var(--line) 22%, transparent);
    --border-strong: color-mix(in srgb, var(--line) 34%, transparent);
}

/*
 * Espresso Light: a cream page with darker boxes. Tables and charts are tan
 * with a brown header band; the nav and summary cards use the espressosys.com
 * hero look, cream on cookie brown (darkened for legible text).
 */
:root,
[data-theme="light"] {
    color-scheme: light;
    --bg: #fff7ef;
    --bg-image: none;
    --surface: #f1d6bb;
    --surface-raised: #e6c5a5;
    --row: #f1d6bb;
    --row-alt: #e9cbad;
    --row-hover: #dfbd9b;
    --head-bg: #a05f2b;
    --head-text: #fff7ef;
    --head-rule: #8a5124;
    --frame: #d9ae86;
    --text: #451f17;
    --text-strong: #270903;
    --text-muted: #6b3d1c;
    --link: #451f17;
    --link-hover: #8a4f22;
    --accent: #bb7247;
    --on-accent: #fff7ef;
    --focus: #0c81b4;
    --line: #b67237;
    --shadow: rgba(69, 31, 23, 0.14);
    --ok: #166534;
    --warn: #92400e;
    --bad: #b91c1c;
    --info: #075985;
    --alert: #9a3412;
    --ok-fill: rgba(22, 163, 74, 0.14);
    --warn-fill: rgba(245, 158, 11, 0.16);
    --bad-fill: rgba(220, 38, 38, 0.13);
    --info-fill: #e0f2fe;
    --alert-fill: #ffedd5;
    --ok-bar: #16a34a;
    --warn-bar: #f59e0b;
    --bad-bar: #dc2626;
    --ok-edge: #14532d;
    --warn-edge: #92400e;
    --bad-edge: #7f1d1d;
    --chart-1: #8a4f22;
    --chart-2: #035a86;
    --chart-3: #451f17;
    --chart-4: #605812;
    --chart-5: #b67237;
    --chart-6: #270903;
}

[data-theme="light"] nav,
[data-theme="light"] .card {
    --surface: #a05f2b;
    --surface-raised: #8a5124;
    --text: #fff7ef;
    --text-strong: #fff7ef;
    --text-muted: #fff7ef;
    --link: #fff7ef;
    --link-hover: #270903;
    --line: #fff7ef;
    --ok: #15803d;
    --warn: #b45309;
    --bad: #b91c1c;
    --ok-fill: #dcfce7;
    --warn-fill: #fef3c7;
    --bad-fill: #fee2e2;
    --border-faint: color-mix(in srgb, var(--line) 14%, transparent);
    --border: color-mix(in srgb, var(--line) 26%, transparent);
    --border-strong: color-mix(in srgb, var(--line) 40%, transparent);
}

/* Espresso Dark: the explorer's dark scheme */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #270903;
    --bg-image: none;
    --surface: #451f17;
    --surface-raised: #57291f;
    --row: #451f17;
    --row-alt: #4b231a;
    --row-hover: #5a2c21;
    --head-bg: transparent;
    --head-text: #fff7ef;
    --head-rule: #bb7247;
    --frame: color-mix(in srgb, #b67237 22%, transparent);
    --text: #fcebde;
    --text-strong: #fff7ef;
    --text-muted: #cfae97;
    --link: #de9e67;
    --link-hover: #fcebde;
    --accent: #bb7247;
    --on-accent: #fff7ef;
    --focus: #de9e67;
    --line: #b67237;
    --shadow: rgba(19, 4, 1, 0.5);
    --ok: #34d399;
    --warn: #f5c542;
    --bad: #fd8a9b;
    --info: #1eb6f8;
    --alert: #ff792e;
    --ok-fill: rgba(52, 211, 153, 0.16);
    --warn-fill: rgba(251, 191, 36, 0.16);
    --bad-fill: rgba(251, 113, 133, 0.18);
    --info-fill: rgba(30, 182, 248, 0.16);
    --alert-fill: rgba(255, 121, 46, 0.16);
    --ok-bar: #22c55e;
    --warn-bar: #fbbf24;
    --bad-bar: #ef4444;
    --ok-edge: transparent;
    --warn-edge: transparent;
    --bad-edge: transparent;
    --chart-1: #de9e67;
    --chart-2: #1eb6f8;
    --chart-3: #4092be;
    --chart-4: #b9ad3e;
    --chart-5: #b67237;
    --chart-6: #fcebde;
}
