/**
 * WvdS "Night" color scheme (one of three brand accents: Riviera/Night/
 * White - see css/schemes/riviera.css, css/schemes/white.css)
 *
 * Scheme mechanics (styles contract v2): a :root override file, linked by
 * main.php AFTER the css.php bundle when the admin option 'colorscheme'
 * selects it, so it wins the cascade without touching any component CSS -
 * same mechanism as riviera.css/white.css. Like riviera.css (and unlike a
 * lightweight accent-only retint), this scheme overrides the full neutral
 * base token set (ink/paper/surface/text/border), not just the accent
 * family, because it is a genuine full-canvas dark scheme, not a tinted
 * variant of a light one.
 *
 * Palette source: visually derived from the "MED NAMI - Night" social
 * media letterhead template (D:\med-nami\media\Night.png, outside this
 * repository) - a solid dark navy canvas with gold typography and a gold
 * frame, no red hairline. Values below are an approximation of that
 * reference, NOT pixel-measured against the source PNG.
 *
 * Derivation approach: base navy/gold primitives reuse the same brand hues
 * as riviera.css (--wk-navy #0B2238, --wk-gold #B08A42) so the three
 * schemes stay one recognizable family; every other token is a lightened
 * or darkened derivative chosen for legibility on a dark canvas, ANNOTATED
 * as derived below.
 *
 * CONTRAST AUDIT (WCAG 2.2 AA, standard relative-luminance contrast
 * formula, replacing the rough estimate this scheme originally shipped
 * with): --wk-text/-text-alt/--wk-ink/--wk-link on --wk-paper all measure
 * 6.35:1 or better - comfortably past the 4.5:1 body-text floor. The one
 * failure was white --wk-btn-primary-text (the sitewide default, tokens.css)
 * on this scheme's own --wk-btn-primary (#6FA4C6, deliberately LIGHT so it
 * reads on the dark canvas as text/links) - 2.69:1, well under even the
 * 3:1 large-text floor. A light fill needs dark text, not a lighter fill,
 * so --wk-btn-primary-text is overridden below to --wk-navy (6.00:1) for
 * this scheme only, rather than darkening --wk-btn-primary itself, which
 * would undo the reason this scheme lightened it in the first place.
 *
 * --wk-brand-hairline is consumed by css/brand-accent.css (hairline
 * motif at the site header/menu seam and the wiki topbar) - not part of
 * the cross-template styles contract, only meaningful together with that
 * component. Night has no hairline (the reference template shows none),
 * hence 'transparent'. (The page-shell top rule that component also draws
 * is a fixed red, --wk-error, not scheme-dependent - see that file.)
 *
 * License: GPLv3 (see template LICENSE.md)
 */
/* THE NEUTRAL HALF, ON `html` - see css/tokens.css for the full reasoning, and
   riviera.css for the short one. These ten are the ramp and the skin/scheme
   axes own it while `wkfluentui` is installed; at `:root` this file would win
   on source order (it is linked after the bundle) and the axes would be dead.
   The `bizway` skin's DARK world was derived from these very values, mapped by
   ROLE rather than by token name - this file uses four surface steps where the
   ramp has three, and reads --wk-surface as the raised card while the house
   reads it as the ground. The remapping moves three tokens by 1.06:1 to 1.11:1,
   all below the threshold at which a reader sees a difference; the per-token
   numbers are in the skin's own docblock. */
html {
    /* ---- neutral base tokens: dark canvas ---- */
    --wk-ink: #F2EFE8;           /* derived: soft warm-white, used for headings/emphasis */
    --wk-ink-soft: #E7E2D4;      /* derived: slightly dimmer than --wk-ink */
    --wk-paper: #0B2238;         /* the page canvas itself - same navy as the Riviera/Night frame color */

    --wk-surface: #102A44;       /* derived: lightened navy, so cards/panels read as distinct from the page canvas */
    --wk-surface-alt: #0D2540;   /* derived: between --wk-paper and --wk-surface */
    --wk-surface-muted: #16324F; /* derived: for muted table stripes etc. */

    --wk-text: #C9CDD6;          /* derived: light cool gray, ~9:1 contrast on #0B2238 */
    --wk-text-alt: #9AA3B2;      /* derived: dimmer secondary text */
    --wk-border: #24405C;        /* derived: navy-family border, visible against --wk-paper/-surface */
    --wk-border-light: #2E4C6B;  /* derived, lighter tint of the above */

    /* Two more neutrals that were in the brand half at first; the probe caught
       both as declared in html AND :root, which means one of the two never
       applied. A hover tint and a control edge are ramp business. */
    --wk-sidebar-hover: rgba(255, 255, 255, 0.05); /* derived: neutral light tint, reads on any dark surface */

    /* Confirmed bug fix - tokens.css hardwired --wk-admin-btn-neutral-border to
       Riviera's beige #D9D2C0 and neither white.css nor night.css ever
       overrode it, even though night.css already adapts its own generic
       --wk-border (#24405C) for this exact reason ("visible against
       --wk-paper/-surface"). Neutral buttons (the most common of the three
       action-color groups, --wk-admin-btn-neutral-bg itself is just
       var(--wk-surface), i.e. the border is the ONLY thing that visually
       separates the button from its background) showed a light Riviera-beige
       edge against the dark navy surface. #557AA3 is WCAG 1.4.11 non-text-
       contrast-checked (~3.27:1 against --wk-surface #102A44 - the mandatory
       floor for a UI-component boundary that is the sole distinguishing
       signal), distinct from both --wk-border (#24405C) and
       --wk-admin-accent-light (#9CC3DC, already the hover state) so rest and
       hover stay distinguishable from each other too. */
    --wk-admin-btn-neutral-border: #557AA3;
}

/* THE BRAND HALF, on `:root` on purpose. Night is the one scheme whose accent
   decision is genuinely its own - gold links rather than blue - so it is also
   the clearest case for keeping this half out of the handover. */
:root {
    /* ---- brand primitives (reused from Riviera for family consistency) ---- */
    --wk-navy: #0B2238;
    --wk-gold: #C19C66;

    /* ---- accent family (lightened steel-azure - the riviera.css base
       value #3B7EA8 would read too dark/low-contrast on this canvas) ---- */
    --wk-accent: #6FA4C6;        /* derived: riviera.css's --wk-accent-light, promoted to base accent here */
    --wk-accent-dark: #3B7EA8;   /* derived: riviera.css's base accent, used as the "pressed/dark" step here */
    --wk-accent-light: #9CC3DC;  /* derived: further lightened for hover states */

    /* ---- gold family (primary link/typography accent on this scheme,
       per the reference template's "gold typography" look) ----
       This is a DARK world: its --wk-surface is #102A44, so the slot that has
       to stay legible against the surface is the brand gold itself (5.72:1),
       not a bronze - the bronze the light schemes use would sit at 1.3:1 here.
       That is the whole point of naming the slot after its ground; see
       wkfluentui/style.css, which owns the contract. */
    --wk-gold-on-surface: var(--wk-gold);
    --wk-gold-light: #E0C48C;    /* derived: lightened for hover/emphasis */

    --wk-link: #C7A768;          /* derived: lightened gold - Night is the only scheme with gold (not blue) links */
    --wk-link-hover: #E0C48C;

    --wk-highlight: rgba(199, 167, 104, 0.14); /* derived: gold tint on dark navy */

    --wk-admin-accent: #6FA4C6;
    --wk-admin-accent-light: #9CC3DC;

    /* MOVED to this file's `html` block, with the full note - it is a control
       edge, which is ramp business and not a brand decision.
       Kept here as a pointer because the note explains a confirmed defect and
       the next reader of the brand half should not have to find it by luck.
       Original note, abridged: #557AA3 is WCAG 1.4.11
       non-text-contrast-checked (~3.27:1 against --wk-surface #102A44,
       computed via the standard relative-luminance formula - the
       mandatory floor for a UI-component boundary that is the sole
       distinguishing signal), distinct from both --wk-border (#24405C)
       and --wk-admin-accent-light (#9CC3DC, already used for the hover
       state per --wk-admin-btn-neutral-hover-border below) so rest and
       hover stay visually distinguishable from each other too. */

    --wk-focus: #6FA4C6;
    /* Derived rather than restated - see white.css. Night's share is 35% and
       not 25%: a glow has to carry against a dark canvas, and that difference
       is a scheme decision, which is why it stays stated here. */
    --wk-focus-shadow: color-mix(in srgb, var(--wk-focus) 35%, transparent);

    --wk-btn-primary: #6FA4C6;
    --wk-btn-primary-hover: #9CC3DC;
    /* Overrides tokens.css's sitewide white default - see this file's own
       CONTRAST AUDIT note above. --wk-navy, not a new literal: already
       declared above, and dark enough for both the rest (#6FA4C6, 6.00:1)
       and hover (#9CC3DC, lighter still, so only more contrast) fills. */
    --wk-btn-primary-text: var(--wk-navy);

    /* ---- brand accent motif (css/brand-accent.css) ----
       No hairline (the Night reference template shows no red line). */
    --wk-brand-hairline: transparent;
}

/* ---- "Night" body canvas ----
   Consumed by css/base.css: body { background: var(--wk-body-bg, ...) }.
   A solid dark canvas with a subtle radial vignette at the corners for depth -
   unlike riviera.css's two-tone ivory/gold gradient, the Night reference
   template is a uniform dark navy field, so no color transition is introduced
   here.

   Guarded by the scheme it was drawn for, same as riviera.css: which scheme
   FILE is linked and which scheme AXIS is active are two decisions, and this
   vignette belongs to the dark one. The base colour is the ramp's ground rather
   than a repeated #0B2238, so the two overlays darken whatever the dark world
   currently is. */
html[data-wk-scheme="dark"] {
    --wk-body-bg:
        radial-gradient(circle at 15% 8%, rgba(0, 0, 0, 0.25) 0 20rem, transparent 40rem),
        radial-gradient(circle at 85% 92%, rgba(0, 0, 0, 0.3) 0 22rem, transparent 42rem),
        var(--wk-surface, #0B2238);
}
