/* =========================================================================
   Fuse themes — [data-theme] overrides of the Arc token set.
   Loaded AFTER arc-ui.css so these win. Only the two YourHealth themes ship;
   axis-dark is the default and is also what :root carries, so the CSS default
   and the boot script in index.html cannot drift apart.
   ========================================================================= */

/* ═════════════════════════════════════════════════════════════════════════
   Axis — the YourHealth palette, as handed over from Axis.Themes.FauxTheme.
   Two themes rather than one: Arc's convention is :root-is-dark with a
   [data-theme="light"] override, but Fuse names every theme explicitly so the
   rail can offer them side by side, and so a light choice survives a machine
   that prefers dark.

   Derived values are marked. FauxTheme sets a handful of slots and lets
   MudBlazor's defaults cover the rest; Arc has more surfaces than that, so the
   lifts and hovers are mixed from the base rather than invented.
   ═════════════════════════════════════════════════════════════════════════ */

:root, html[data-theme="axis-dark"] {
    --arc-bg-0: #181A1C;                                    /* BackgroundGray */
    --arc-bg-1: #1A1C1E;                                    /* Background / Surface */
    --arc-bg-2: color-mix(in srgb, #1A1C1E 94%, white);     /* card lift — derived */
    --arc-bg-3: color-mix(in srgb, #1A1C1E 88%, white);     /* hover — derived */
    --arc-bg-4: color-mix(in srgb, #1A1C1E 82%, white);     /* pressed — derived */

    --arc-border-1: #292838;                                /* Divider */
    --arc-border-2: #2F3235;                                /* LinesDefault / TableLines */
    --arc-border-3: color-mix(in srgb, #2F3235 80%, white); /* derived */
    --arc-border-focus: #5FC1FF;                            /* Primary */

    --arc-fg-1: #B2B0BF;                                    /* TextPrimary */
    --arc-fg-2: #92929F;                                    /* TextSecondary */
    --arc-fg-3: color-mix(in srgb, #92929F 90%, #1A1C1E);   /* derived — 4.75:1 on bg-1; 70% measured 3.42 */
    --arc-fg-4: #FFFFFF33;                                  /* TextDisabled */
    --arc-fg-on-accent: #110E2D;                            /* ink for the light-blue accent */

    --arc-accent: #5FC1FF;                                  /* Primary */
    --arc-accent-hi: color-mix(in srgb, #5FC1FF 85%, white);
    --arc-accent-lo: color-mix(in srgb, #5FC1FF 85%, black);
    --arc-accent-dim: color-mix(in srgb, #5FC1FF 14%, #181A1C);
    --arc-accent-soft: rgba(95, 193, 255, 0.14);
    --arc-accent-glow: 0 0 32px -4px rgba(95, 193, 255, 0.45);
    --arc-chart-bar-emphasis: #5FC1FF;

    --arc-info: #4A86FF;
    --arc-warn: #FFB545;
    --arc-danger: #FF3F5F;
    --arc-success: #3DCB6C;

    /* arc-ui.css hardcodes the mint ring in --arc-ring-focus, so a theme that
       changes the accent has to restate it or every focus ring stays green. */
    --arc-ring-focus: 0 0 0 1px var(--arc-bg-0), 0 0 0 3px rgba(95, 193, 255, 0.55);

    /* Mud's Secondary has no Arc slot (Arc is single-accent by design) — kept as
       a plain custom property for anything that wants it. */
    --axis-secondary: #54BCCA;

    /* LayoutProperties.DefaultBorderRadius: Mud applies one radius to buttons,
       inputs and cards alike. */
    --arc-radius-1: 8px;
    --arc-radius-2: 8px;
    --arc-radius-3: 8px;

    --fuse-font-sans: "Karla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* Karla's x-height is 0.482 of its size against Geist's 0.532 — at an identical font-size it
       renders about 9.6% smaller to the eye, measured: 6.22px vs 6.88px at 13px. Every size in this
       app was chosen against Geist, so swapping the face without this makes all of them optically
       smaller, which is the opposite of what the font change is for. font-size-adjust normalises to
       Geist's ratio: Karla comes back to a 6.91px x-height at 13px, and it is a no-op for Geist Mono,
       whose ratio is already 0.532. */
    font-size-adjust: 0.532;

    --fuse-rail-bg: #141618;
    /* Acuity stays semantic, retuned to this palette's reds and ambers. */
    --fuse-stat: #FF3F5F;
    --fuse-high: #FFB545;
    --fuse-normal: #4A86FF;
    --fuse-low: #5A5A66;
    --fuse-violet: #A07CFF;
    --fuse-done: #3DCB6C;
    color-scheme: dark;
}

html[data-theme="axis-light"] {
    --arc-bg-0: #F2F4F6;                                    /* one step under Background, so a card reads */
    --arc-bg-1: #FAFBFC;                                    /* Background / Surface */
    --arc-bg-2: #FFFFFF;                                    /* card lift — derived */
    --arc-bg-3: color-mix(in srgb, #FAFBFC 94%, black);     /* hover — derived */
    --arc-bg-4: color-mix(in srgb, #FAFBFC 88%, black);     /* pressed — derived */

    --arc-border-1: rgba(0, 0, 0, 0.06);
    --arc-border-2: rgba(0, 0, 0, 0.12);                    /* Mud's stock Divider */
    --arc-border-3: rgba(0, 0, 0, 0.24);
    --arc-border-focus: #00609C;                            /* Primary */

    --arc-fg-1: rgba(0, 0, 0, 0.87);                        /* Mud stock TextPrimary */
    --arc-fg-2: rgba(0, 0, 0, 0.60);                        /* Mud stock TextSecondary */
    --arc-fg-3: rgba(0, 0, 0, 0.55);                        /* 4.73:1 on bg-1; Mud's stock .38 is 3.2 */
    --arc-fg-4: rgba(0, 0, 0, 0.30);                        /* disabled/placeholder only — sub-AA by intent */
    --arc-fg-on-accent: #FFFFFF;

    --arc-accent: #00609C;                                  /* Primary */
    --arc-accent-hi: color-mix(in srgb, #00609C 85%, white);
    --arc-accent-lo: color-mix(in srgb, #00609C 85%, black);
    --arc-accent-dim: color-mix(in srgb, #00609C 12%, #FAFBFC);
    --arc-accent-soft: rgba(0, 96, 156, 0.10);
    --arc-accent-glow: 0 0 32px -4px rgba(0, 96, 156, 0.30);
    --arc-chart-bar-emphasis: #00609C;

    /* FauxTheme.LightPalette doesn't set these, and Material's stock values are meant for fills:
       as TEXT on this surface they measure 2.08:1 (warn), 2.68 (success), 3.02 (info), 3.55 (danger).
       Fuse colours pill *text* with them — "In progress" is --arc-warn — so they are deepened to
       clear 4.5:1, for contrast on light. */
    --arc-info: #0B66C3;                                    /* 5.47:1 — stock #2196F3 was 3.02 */
    --arc-warn: #8A5200;                                    /* 6.17:1 — stock #FF9800 was 2.08 */
    --arc-danger: #C62828;                                  /* 5.43:1 — stock #F44336 was 3.55 */
    --arc-success: #2E7D32;                                 /* 4.95:1 — stock #4CAF50 was 2.68 */

    --arc-ring-focus: 0 0 0 1px var(--arc-bg-0), 0 0 0 3px rgba(0, 96, 156, 0.40);
    --axis-secondary: #54BCCA;

    --arc-radius-1: 8px;
    --arc-radius-2: 8px;
    --arc-radius-3: 8px;

    --fuse-font-sans: "Karla", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* Karla's x-height is 0.482 of its size against Geist's 0.532 — at an identical font-size it
       renders about 9.6% smaller to the eye, measured: 6.22px vs 6.88px at 13px. Every size in this
       app was chosen against Geist, so swapping the face without this makes all of them optically
       smaller, which is the opposite of what the font change is for. font-size-adjust normalises to
       Geist's ratio: Karla comes back to a 6.91px x-height at 13px, and it is a no-op for Geist Mono,
       whose ratio is already 0.532. */
    font-size-adjust: 0.532;

    --fuse-rail-bg: #ECEFF2;
    /* Material's stock semantics are tuned for white surfaces at large sizes; an
       acuity dot is 8px, so these are the deepened variants. */
    --fuse-stat: #C62828;
    --fuse-high: #B26A00;
    --fuse-normal: #1565C0;
    --fuse-low: #5B6472;
    --fuse-violet: #6D28D9;
    --fuse-done: #2E7D32;
    color-scheme: light;
}
