/* Approved Relay Orbit palette. Blazor and Bootstrap share semantic pairs
   through the existing data-bs-theme preference; no second theme state. */
/* Inter 4.1 is bundled under the SIL Open Font License; only chat prose uses it.
   Keep the normal portal stack native and avoid a third-party font request. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/InterVariable-v4.1.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --portal-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --portal-font-heading: var(--portal-font);
    --portal-font-chat: "Inter", var(--portal-font);
    --portal-chat-text: #343448;
    --portal-chat-emphasis: #202135;
    --portal-bg: #f5f5fc;
    --portal-background-veil: color-mix(in srgb, var(--portal-bg) 86%, transparent);
    --portal-surface: #ffffff;
    --portal-surface-raised: #fcfcff;
    --portal-surface-soft: #f0eff9;
    --portal-input-bg: #fcfcff;
    --portal-sidebar: #fcfcff;
    --portal-selection: #eeebf8;
    --portal-lavender: #71618f;
    --portal-ink: #17182c;
    --portal-heading: #17182c;
    --portal-muted: #62657f;
    --portal-faint: #676b84;
    --portal-border: #deddeb;
    --portal-primary: #ff6065;
    --portal-primary-hover: #ff7d81;
    --portal-on-primary: #251529;
    --portal-link: #5d4b83;
    --portal-primary-soft: #eeebf8;
    --portal-accent: #ff6065;
    --portal-accent-text: #bd3246;
    --portal-chart-primary: #71618f;
    --portal-chart-secondary: #bd3246;
    --portal-accent-soft: #fff0f1;
    --portal-focus: #5d4b83;
    --portal-success-text: #006b5c;
    --portal-success-bg: #edf8f6;
    --portal-success-border: #a7d2c8;
    --portal-warning-text: #805000;
    --portal-warning-bg: #fff7e8;
    --portal-warning-border: #e5b65a;
    --portal-danger-text: #9e0005;
    --portal-danger-bg: #fdf0f1;
    --portal-danger-border: #efb9bc;
    --portal-code-bg: #f0eff9;
    --portal-code-text: #8c2857;
    --portal-toast-bg: #17182c;
    --portal-toast-text: #ffffff;
    --portal-overlay: rgba(7, 7, 25, 0.58);
    --portal-radius: 0.6875rem;
    --portal-radius-lg: 1.125rem;
    --portal-shadow: 0 8px 22px rgba(53, 48, 71, 0.04);
    --portal-shadow-lg: 0 16px 40px rgba(53, 48, 71, 0.12);
}

html[data-bs-theme="dark"] {
    color-scheme: dark;
    --portal-bg: #0a0a1c;
    --portal-background-veil: color-mix(in srgb, var(--portal-bg) 90%, transparent);
    --portal-surface: #14152f;
    --portal-surface-raised: #1b1b37;
    --portal-surface-soft: #1b1b37;
    --portal-input-bg: #14152f;
    --portal-sidebar: #101024;
    --portal-selection: #282641;
    --portal-lavender: #c9baff;
    --portal-ink: #f6f5ff;
    --portal-heading: #f6f5ff;
    --portal-muted: #b1b3ce;
    --portal-faint: #8589a8;
    --portal-chat-text: #d7d8e7;
    --portal-chat-emphasis: #f0eff8;
    --portal-border: #32314d;
    --portal-link: #c9baff;
    --portal-primary-soft: #282641;
    --portal-accent-text: #ff8589;
    --portal-chart-primary: #c9baff;
    --portal-chart-secondary: #ff8589;
    --portal-accent-soft: #301b2b;
    --portal-focus: #ff9296;
    --portal-success-text: #8cddc7;
    --portal-success-bg: #0e2928;
    --portal-success-border: #28635a;
    --portal-warning-text: #ffd28a;
    --portal-warning-bg: #2a2214;
    --portal-warning-border: #715c35;
    --portal-danger-text: #ffb4b8;
    --portal-danger-bg: #2d161e;
    --portal-danger-border: #783a49;
    --portal-code-bg: #1b1b37;
    --portal-code-text: #ffc2db;
    --portal-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
    --portal-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.32);
}

/* Match Bootstrap's theme selector specificity, including first paint. */
:root,
html[data-bs-theme="light"],
html[data-bs-theme="dark"] {
    --bs-body-font-family: var(--portal-font);
    --bs-body-bg: var(--portal-bg);
    --bs-body-color: var(--portal-ink);
    --bs-heading-color: var(--portal-heading);
    --bs-emphasis-color: var(--portal-ink);
    --bs-secondary-color: var(--portal-muted);
    --bs-secondary-bg: var(--portal-surface-soft);
    --bs-tertiary-bg: var(--portal-surface-soft);
    --bs-border-color: var(--portal-border);
    --bs-link-color: var(--portal-link);
    --bs-link-hover-color: var(--portal-link);
    --bs-primary: var(--portal-primary);
    --bs-primary-rgb: 255, 96, 101;
    --bs-primary-text-emphasis: var(--portal-link);
    --bs-primary-bg-subtle: var(--portal-primary-soft);
    --bs-primary-border-subtle: var(--portal-border);
    --bs-success-text-emphasis: var(--portal-success-text);
    --bs-success-bg-subtle: var(--portal-success-bg);
    --bs-success-border-subtle: var(--portal-success-border);
    --bs-warning-text-emphasis: var(--portal-warning-text);
    --bs-warning-bg-subtle: var(--portal-warning-bg);
    --bs-warning-border-subtle: var(--portal-warning-border);
    --bs-danger-text-emphasis: var(--portal-danger-text);
    --bs-danger-bg-subtle: var(--portal-danger-bg);
    --bs-danger-border-subtle: var(--portal-danger-border);
    --bs-info-text-emphasis: var(--portal-link);
    --bs-info-bg-subtle: var(--portal-primary-soft);
    --bs-info-border-subtle: var(--portal-border);
    --bs-border-radius: var(--portal-radius);
    --bs-border-radius-lg: var(--portal-radius-lg);
    --bs-focus-ring-color: color-mix(in srgb, var(--portal-focus) 28%, transparent);
    --bs-code-color: var(--portal-code-text);
}
