/* =========================================================
   KDEC | Kingdom Business Leaders: the shared brand layer.
   Loaded FIRST by every surface (students portal, assessments, skills test, admin, public pages);
   each surface's own stylesheet maps its variables to these tokens. Printed by kdec_head_links().

   Palette, measured from the logo (brand/logo.png):
     navy  #003052 (the K and "KDEC")          gold  #e4b94c -> #d09b2f -> #aa700a (the rising bars)
   Rules of use:
     - Navy carries structure and primary actions. Gold is the accent: one highlight per view
       (the key call to action, the active marker, a hairline), never a page-wide fill.
     - Surfaces are cool paper white, text is navy-tinted ink. No cream, no warm greys.
     - Shape: straight and architectural like the mark. Controls 10px, cards 14px, large panels 20px.
       Buttons are 10px, not pills.
     - Motion: transform and opacity only, 140-260ms, --k-ease (ease-out). Nothing under reduced motion.
   ========================================================= */
:root {
    /* navy */
    --k-navy-950: #00172b;
    --k-navy-900: #00223d;
    --k-navy: #003052;
    --k-navy-700: #0a4270;
    --k-navy-600: #1b5b8f;
    --k-navy-300: #8fb0cd;
    --k-navy-100: #dbe7f2;
    --k-navy-50: #eef4f9;
    /* gold */
    --k-gold-hi: #f3d47c;
    --k-gold-light: #e4b94c;
    --k-gold: #c9952b;
    --k-gold-deep: #aa700a;
    --k-gold-ink: #7b5407;      /* gold as TEXT on white (6.7:1) */
    --k-gold-50: #fbf3df;
    --k-gold-grad: linear-gradient(170deg, #e9c257 0%, #d09b2f 48%, #aa700a 100%);
    --k-on-gold: #00172b;       /* text on a gold fill */
    /* surfaces and ink */
    --k-bg: #f2f5f9;
    --k-surface: #ffffff;
    --k-surface-2: #f8fafc;
    --k-ink: #0b1d2e;
    --k-ink-2: #33485c;
    --k-muted: #5a6b7c;
    --k-line: #dfe6ee;
    --k-line-strong: #c4cfdb;
    /* on navy */
    --k-on-navy: #f4f8fc;
    --k-on-navy-2: rgb(244 248 252 / .72);
    --k-on-navy-line: rgb(255 255 255 / .12);
    /* status */
    --k-ok: #1c7a4b;
    --k-ok-bg: #e5f4ec;
    --k-danger: #b3261e;
    --k-danger-bg: #fbeae8;
    --k-warn: #8a5a00;
    --k-warn-bg: #fdf3dc;
    --k-info: #1b5b8f;
    --k-info-bg: #e6f0f9;
    /* shape */
    --k-r-sm: 8px;
    --k-r: 10px;
    --k-r-lg: 14px;
    --k-r-xl: 20px;
    /* depth: shadows tinted navy, never pure black */
    --k-shadow-sm: 0 1px 2px rgb(0 34 61 / .07);
    --k-shadow: 0 1px 2px rgb(0 34 61 / .06), 0 10px 24px -16px rgb(0 34 61 / .28);
    --k-shadow-lift: 0 2px 4px rgb(0 34 61 / .07), 0 22px 40px -22px rgb(0 34 61 / .4);
    --k-ring: 0 0 0 4px rgb(201 149 43 / .22);
    /* motion */
    --k-ease: cubic-bezier(.23, 1, .32, 1);
    --k-ease-inout: cubic-bezier(.77, 0, .175, 1);
    /* type */
    --k-font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
    --k-font-display: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
}

/* ---------- the backdrop: paper (or navy) with the logo's rising bars ----------
   <div class="k-backdrop" aria-hidden="true"></div>           light pages
   <div class="k-backdrop is-dark" aria-hidden="true"></div>   navy pages
   Fixed behind the page. The bars sit in the bottom corner on the inline-start side. */
.k-backdrop {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(70% 55% at 100% 0%, rgb(219 231 242 / .9), transparent 70%),
        linear-gradient(180deg, #f6f8fb 0%, var(--k-bg) 100%);
}
.k-backdrop::after {
    content: ""; position: absolute; inset-inline-end: -2vw; bottom: 0;
    width: min(62vw, 760px); aspect-ratio: 600 / 420;
    background: url(bars-navy.svg) no-repeat bottom / contain;
}
.k-backdrop.is-dark {
    background:
        radial-gradient(60% 50% at 85% 0%, rgb(27 91 143 / .55), transparent 70%),
        radial-gradient(50% 40% at 0% 100%, rgb(170 112 10 / .16), transparent 70%),
        linear-gradient(180deg, var(--k-navy) 0%, var(--k-navy-900) 55%, var(--k-navy-950) 100%);
}
.k-backdrop.is-dark::after { background-image: url(bars-light.svg); }
@media (max-width: 720px) {
    .k-backdrop::after { width: 110vw; inset-inline-end: -18vw; opacity: .8; }
}

/* ---------- small brand pieces ---------- */
/* the logo's tagline line:  — FAITH · LEADERSHIP · IMPACT —  */
.k-tagline {
    display: inline-flex; align-items: center; gap: .8em;
    font: 600 .75rem/1 var(--k-font-display); letter-spacing: .22em; text-transform: uppercase;
    color: var(--k-navy); direction: ltr;
}
.k-tagline::before, .k-tagline::after { content: ""; width: 2.2em; height: 2px; background: var(--k-gold); }
.k-tagline i { width: .42em; height: .42em; border-radius: 50%; background: var(--k-gold); }
.is-dark .k-tagline, .k-tagline.is-light { color: var(--k-on-navy); }

/* a short gold bar under a heading (the mark's bar, lying down) */
.k-rule { display: block; width: 44px; height: 3px; border: 0; margin: .7rem 0 0; background: var(--k-gold-grad); }

/* three rising bars, drawn in CSS: a tiny mark for loaders, bullets and empty states */
.k-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 1em; }
.k-bars i { width: .22em; background: var(--k-gold-grad); clip-path: polygon(0 28%, 100% 0, 100% 100%, 0 100%); }
.k-bars i:nth-child(1) { height: 55%; background: var(--k-navy); }
.k-bars i:nth-child(2) { height: 78%; }
.k-bars i:nth-child(3) { height: 100%; }
.k-bars.is-light i:nth-child(1) { background: #fff; }   /* on navy surfaces */
