/*
|--------------------------------------------------------------------------
| deapi theme for Nova
|--------------------------------------------------------------------------
|
| Ported from depin-landing/resources/css/v2/tokens.css, which is the single
| source of truth for the deapi brand. Values marked (derived) fill gaps the
| landing ramp does not cover — Nova needs a full 50..950 scale, the landing
| only defines the steps it actually paints with.
|
| Nova stores colors as bare "R, G, B" triples and consumes them through
| rgb(var(--colors-*) / <alpha>), so overriding the variables in :root
| re-skins every utility class at once. Registered via Nova::style('depin')
| in NovaServiceProvider; brand.colors in config/nova.php sets 400/500/600
| independently, so those three are kept identical in both places.
|
| Dark mode is a `dark` class on <html>, so `html:not(.dark)` below is a
| reliable light-mode-only guard and outranks Tailwind's single-class
| utilities regardless of stylesheet order.
*/

:root {
    /* Brand amber — depin-landing --amber-* ramp. */
    --colors-primary-50: 255, 248, 233; /* #FFF8E9  --amber-100 */
    --colors-primary-100: 255, 239, 196; /* #FFEFC4  (derived) */
    --colors-primary-200: 255, 224, 138; /* #FFE08A  (derived) */
    --colors-primary-300: 255, 208, 24; /* #FFD018  --amber-300 */
    --colors-primary-400: 254, 202, 0; /* #FECA00  --amber-400 */
    --colors-primary-500: 255, 186, 0; /* #FFBA00  --amber-500 PRIMARY */
    --colors-primary-600: 232, 170, 0; /* #E8AA00  --amber-600 */
    --colors-primary-700: 218, 133, 0; /* #DA8500  --amber-700 */
    --colors-primary-800: 166, 92, 0; /* #A65C00  (derived — first step readable on light surfaces) */
    --colors-primary-900: 122, 67, 0; /* #7A4300  (derived) */
    --colors-primary-950: 70, 25, 1; /* #461901  depin-client --color-accent-foreground */

    /*
     | Warm neutrals. Nova aliases gray to slate out of the box; the deapi look
     | comes from replacing that cold ramp with the landing's warm one.
     |
     | The dark end maps exactly onto how Nova paints dark mode:
     |   gray-900 -> page background   gray-800 -> cards
     |   gray-700 -> inputs / hover    gray-600 -> rings & borders
     | which is why --bg lands on 900 rather than on the numerically closer 950.
     */
    --colors-gray-50: 250, 249, 247; /* #FAF9F7  (derived — warm white; the landing's
                                        --neutral-100 #F7FCFF is cold and clashes here) */
    --colors-gray-100: 240, 240, 240; /* #F0F0F0  --neutral-150 */
    --colors-gray-200: 228, 228, 228; /* #E4E4E4  --neutral-200 / --border-on-light */
    --colors-gray-300: 217, 217, 217; /* #D9D9D9  --neutral-300 */
    --colors-gray-400: 188, 188, 188; /* #BCBCBC  --neutral-400 / --fg-muted */
    --colors-gray-500: 147, 131, 103; /* #938367  --neutral-600 / --fg-subtle */
    --colors-gray-600: 54, 48, 33; /* #363021  --neutral-700 / --border-on-dark-2 */
    --colors-gray-700: 38, 34, 23; /* #262217  --neutral-800 / --border-on-dark */
    --colors-gray-800: 26, 23, 16; /* #1A1710  --neutral-850 */
    --colors-gray-900: 14, 13, 11; /* #0E0D0B  --neutral-925 / --bg */
    --colors-gray-950: 9, 8, 6; /* #090806  --bg-card */
}

/*
| Light-mode corrections.
|
| The landing's palette is dark-only: --fg-subtle #938367 and --fg-muted #BCBCBC
| are drawn on #0E0D0B, where they give 5.2:1 and 12:1. Nova reuses one gray ramp
| for BOTH themes, so those same values land on white in light mode at 3.7:1 and
| 1.9:1 — below AA, and worse than the stock slate they replaced. Warmed-up but
| darkened equivalents restore the contrast without going back to cold gray.
|
| Dark mode keeps the literal tokens; only light mode is adjusted.
*/
html:not(.dark) {
    --colors-gray-400: 163, 155, 140; /* #A39B8C — 2.7:1, parity with Nova's stock slate-400 */
    --colors-gray-500: 122, 107, 82; /* #7A6B52 — 5.2:1, clears AA for body text */
}

/*
| Contrast repairs.
|
| Nova ships `bg-primary-500 text-white dark:text-gray-900`, written for its
| default sky-blue primary. Against #FFBA00 the white text lands around 1.4:1 —
| unreadable. Dark mode already flips to a dark ink and needs no help, so both
| fixes are scoped to light mode only.
*/
html:not(.dark) .bg-primary-400,
html:not(.dark) .bg-primary-500,
html:not(.dark) .bg-primary-600 {
    color: rgb(var(--colors-primary-950)); /* #461901 on #FFBA00 — 8.9:1 */
}

/*
| The mirror image: amber used as INK on a pale surface. Nova paints links, outline
| buttons and badges with text-primary-500/600, written for a sky blue that reads
| fine on white. Amber does not — #FFBA00 on white is ~1.9:1, #E8AA00 ~1.8:1.
| 800 is the first step in the ramp that clears AA there.
|
| Dark mode is untouched: amber ink on #0E0D0B is already ~10:1, and dimming it
| would throw away the brand accent exactly where it works.
*/
html:not(.dark) .text-primary-500,
html:not(.dark) .text-primary-600 {
    color: rgb(var(--colors-primary-800)); /* #A65C00 on white — 4.6:1 */
}
