/*
 * Magiq brand tokens: the --magiq-* CSS variables and the self-hosted Space Grotesk faces.
 * Single source for every Magiq web host: magiq-theme/scripts/deploy.mjs copies this file to
 * App/Magiq.Blazor.Server/wwwroot/css and My/Magiq.My/wwwroot/css (fonts in ../fonts/space-grotesk next to it).
 * Brand reference: docs/spec/05-ui-marque-dashboard.md. SCSS counterpart: magiq-theme/src/_tokens.scss.
 * Do not edit the deployed copies: edit magiq-theme/static/magiq-tokens.css, then run "npm run deploy".
 */

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
    /* Brand */
    --magiq-yellow: #FFD700;
    --magiq-yellow-light: #FFEC80;
    --magiq-yellow-lighter: #FFF3B0;
    --magiq-yellow-dark: #CCB000;
    --magiq-ink: #0A0A0A;
    --magiq-ink-light: #1A1A1A;
    --magiq-white: #FFFFFF;

    /* Neutrals */
    --magiq-gray-50: #FAFAFA;
    --magiq-gray-100: #F5F5F5;
    --magiq-gray-200: #E5E5E5;
    --magiq-gray-300: #D4D4D4;
    --magiq-gray-400: #A3A3A3;
    --magiq-gray-500: #737373;
    --magiq-gray-600: #525252;
    --magiq-gray-700: #404040;
    --magiq-gray-800: #262626;
    --magiq-gray-900: #171717;

    /* States: base color, AA text color, tinted background */
    --magiq-success: #16A34A;
    --magiq-success-strong: #15803D;
    --magiq-success-text: #166534;
    --magiq-success-bg: #DCFCE7;
    --magiq-danger: #DC2626;
    --magiq-danger-light: #F87171;
    --magiq-danger-text: #991B1B;
    --magiq-danger-bg: #FEE2E2;
    --magiq-warning: #F59E0B;
    --magiq-warning-text: #92400E;
    --magiq-warning-bg: #FEF3C7;
    --magiq-info: #2563EB;
    --magiq-info-text: #1E40AF;
    --magiq-info-bg: #DBEAFE;

    /* P7 WP-B (D-185): soft background + ink-dark text pairs of the status badges and amount colors (AA >= 7:1) */
    --magiq-success-soft: #DCFCE7;
    --magiq-on-success-soft: #14532D;
    --magiq-warning-soft: #FEF3C7;
    --magiq-on-warning-soft: #78350F;
    --magiq-danger-soft: #FEE2E2;
    --magiq-on-danger-soft: #7F1D1D;
    --magiq-loss-soft: #FECACA;
    --magiq-on-loss-soft: #450A0A;
    --magiq-info-soft: #DBEAFE;
    --magiq-on-info-soft: #1E3A8A;
    --magiq-muted-soft: #F5F5F5;
    --magiq-on-muted-soft: #404040;
    --magiq-overdue-text: #B91C1C;  /* 5.9:1 on white, always with the "Overdue" status */

    /* P7 WP-B (§4.4): messages (toasts) */
    --magiq-toast-success: #15803D; /* white text 5.0:1 */
    --magiq-toast-danger: #B91C1C;  /* white text 6.5:1 */

    /* Semantic roles */
    --magiq-surface: var(--magiq-white);
    --magiq-surface-muted: var(--magiq-gray-50);
    --magiq-surface-sunken: var(--magiq-gray-100);
    --magiq-text: var(--magiq-ink);
    --magiq-text-muted: var(--magiq-gray-600);  /* 7.8:1 on white */
    --magiq-text-subtle: var(--magiq-gray-500); /* 4.7:1 on white */
    --magiq-text-inverse: var(--magiq-white);
    --magiq-border-subtle: rgb(0 0 0 / 5%);
    --magiq-border: var(--magiq-gray-200);
    --magiq-border-strong: var(--magiq-gray-300);
    --magiq-hover-overlay: rgb(0 0 0 / 5%);
    --magiq-accent: var(--magiq-yellow);
    --magiq-accent-soft: var(--magiq-yellow-lighter);
    --magiq-on-accent: var(--magiq-ink);
    --magiq-action: var(--magiq-ink);
    --magiq-action-hover: var(--magiq-gray-800);
    --magiq-action-pressed: var(--magiq-gray-700);
    --magiq-on-action: var(--magiq-yellow);
    --magiq-focus-ring: rgb(255 215 0 / 60%);
    --magiq-backdrop: rgb(10 10 10 / 40%);
    /* Review P7 (D-193): the icons (ink strokes, D-183) in the caption color of a primary action (white on the ink pill), the
       faded icon of a disabled primary action, and the edge of the yellow chart bars on the white card (4.8:1, WCAG 1.4.11). */
    --magiq-on-action-icon-filter: brightness(0) invert(1);
    --magiq-icon-filter-subtle: none;
    --magiq-chart-bar-edge: #8A7400;

    /* Typography */
    --magiq-font-family: "Space Grotesk Variable", "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --magiq-font-weight-regular: 400;
    --magiq-font-weight-medium: 500;
    --magiq-font-weight-semibold: 600;
    --magiq-font-weight-bold: 700;
    --magiq-letter-spacing-tight: -0.02em;
    --magiq-letter-spacing-logo: -0.03em;

    /* Shapes */
    --magiq-radius-xs: 0.375rem;
    --magiq-radius-sm: 0.5rem;
    --magiq-radius-input: 0.625rem;
    --magiq-radius-md: 0.75rem;
    --magiq-radius-lg: 1rem;    /* rounded-2xl */
    --magiq-radius-xl: 1.5rem;  /* rounded-3xl */
    --magiq-radius-pill: 9999px;

    /* Shadows */
    --magiq-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 5%);
    --magiq-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 8%), 0 1px 2px -1px rgb(0 0 0 / 6%);
    --magiq-shadow: 0 8px 25px -5px rgb(0 0 0 / 10%);
    --magiq-shadow-lg: 0 20px 40px -12px rgb(0 0 0 / 18%);

    /* Motion */
    --magiq-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --magiq-duration: 200ms;

    /* Layout */
    --magiq-header-height: 3.5rem;
    --magiq-touch-target: 2.75rem;
    --magiq-toolbar-button: 2.25rem; /* P7 WP-B: toolbar and secondary buttons on a desktop (44 px on a touch screen) */
    --magiq-nav-icon: 1.25rem;
    --magiq-gap: 1rem;
}

/* ==========================================================================
   2. Fonts (Space Grotesk Variable, self-hosted; relative URLs work under a PathBase)
   ========================================================================== */

@font-face {
    font-family: "Space Grotesk Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url("../fonts/space-grotesk/space-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Space Grotesk Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url("../fonts/space-grotesk/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
