/* ============================================================
   NewKey — nk-tokens.css  —  ONE TRUTH (BRAND §22–23)
   Every colour, type step, spacing, radius, shadow, z-index and motion
   value for both sites lives here. Pages and components consume the
   variables; they never write their own px. Load FIRST on every page,
   before nk-typography.css and before any page stylesheet.

   Sections: 1 colours · 2 type (EN scale, HE scale, mobile) · 3 spacing
   · 4 radii · 5 shadows · 6 z-index · 7 motion · 8 legacy aliases (--kh-*)

   Type steps (pick a step, never a number):
     display  — hero numbers / one-line hero titles
     h1       — page title            h2 — section title
     h3       — sub-section / lead card title
     title    — card and tile headings (added: 20px was the most common
                literal in 14 files)
     body-lg  — lead paragraphs       body — running text
     small    — captions, meta        label — eyebrows (caps EN / plain HE)
     micro    — badges, counters (added: 12px in 19 files)
   Hebrew switches the scale through :lang(he) / [dir="rtl"] (§22):
   one step larger, looser leading, no letter-spacing, no caps.
   ============================================================ */

html:root {
  /* ---------- 1. colours (BRAND §3 — the five brand colours + text/line tones from the live CSS) ---------- */
  --nk-indigo:   #2f2963;   /* primary dark blue: headings, dark sections, text */
  --nk-blue:     #288eff;   /* accent: actions, links, hover, active state */
  --nk-sky:      #dbecff;   /* light blue surfaces, tags */
  --nk-sky-050:  #eef5ff;   /* lighter sky: panels */
  --nk-mist:     #e9e9f2;   /* dividers, borders, secondary buttons */
  --nk-white:    #ffffff;
  --nk-ink:      #020304;   /* near-black for overlays and photo shades */
  --nk-text:     #14151a;
  --nk-text-2:   #585857;
  --nk-text-3:   #8b90a0;
  --nk-line:     #e8e9ee;
  --nk-bg:       #f6f7f9;
  --nk-success:  #12a150;
  --nk-danger:   #e5484d;
  --nk-warn-bg:  #fff4e0;   /* "verify / demo" notes */
  --nk-warn-ink: #7a5600;
  --nk-blue-hover: #1f7fe8;
  --nk-sky-hover:  #cfe4fb;
  --nk-indigo-deep: #241f4e; /* gradient end for dark panels */
  --nk-shade: linear-gradient(180deg, rgba(2,3,4,0) 30%, rgba(2,3,4,.45) 65%, rgba(2,3,4,.82) 100%); /* text-on-photo gradient (BRAND §13) */
  --nk-glass: rgba(255,255,255,.94); /* icon buttons and badges over photos (BRAND §16) */

  /* ---------- 2. type ---------- */
  --nk-font: 'Rubik', 'Segoe UI', system-ui, Arial, Helvetica, sans-serif;
  --nk-fw-regular: 400; --nk-fw-medium: 500; --nk-fw-semibold: 600; --nk-fw-bold: 700;

  /* English scale (desktop) — BRAND §22 */
  --nk-fs-display: 50px;
  --nk-fs-h1:      42px;
  --nk-fs-h2:      32px;
  --nk-fs-h3:      24px;
  --nk-fs-title:   20px;
  --nk-fs-body-lg: 18px;
  --nk-fs-body:    16px;
  --nk-fs-small:   14px;
  --nk-fs-label:   13px;
  --nk-fs-micro:   12px;

  --nk-lh-display: 1.1;
  --nk-lh-tight:   1.2;    /* h1, h2 */
  --nk-lh-heading: 1.3;    /* h3, title */
  --nk-lh-body:    1.5;
  --nk-lh-small:   1.45;

  --nk-ls-label:  .06em;   /* eyebrows / badges */
  --nk-ls-tight: -.01em;   /* large headings */
  --nk-tt-label:  uppercase;
  --nk-fw-label:  var(--nk-fw-medium);
  --nk-fs-italic: italic;  /* captions; Hebrew has no italic → normal */

  /* ---------- 3. spacing (4px step) ---------- */
  --nk-sp-1: 4px;  --nk-sp-2: 8px;   --nk-sp-3: 12px; --nk-sp-4: 16px;
  --nk-sp-5: 20px; --nk-sp-6: 24px;  --nk-sp-8: 32px; --nk-sp-10: 40px;
  --nk-sp-12: 48px; --nk-sp-16: 64px; --nk-sp-24: 96px;

  --nk-section: var(--nk-sp-24);   /* padding-block of every section (BRAND §5: ~100px) */
  --nk-section-hero: 72px;         /* hero top only: it already sits under the fixed header */
  --nk-head: var(--nk-sp-8);       /* section head → its content */
  --nk-stack: var(--nk-sp-10);     /* sub-blocks inside a section */
  --nk-grid: var(--nk-sp-5);       /* gap between cards in a grid */
  --nk-cols: var(--nk-sp-16);      /* gap between the two columns of a split layout */
  --nk-card-pad: var(--nk-sp-6);   /* inner padding of cards and form cards */
  --nk-gutter: var(--nk-sp-6);     /* container side padding (= .kh-container) */
  --nk-container: 1200px;
  --nk-header-h: 62px;

  /* ---------- 4. radii ---------- */
  --nk-r-card:  24px;   /* cards, big panels */
  --nk-r-panel: 20px;   /* tiles, modals, bottom sheets */
  --nk-r-tile:  16px;   /* compact cards, list rows */
  --nk-r-field: 12px;   /* inputs, buttons, small tiles */
  --nk-r-sm:     8px;   /* thumbs, code, chips with corners */
  --nk-r-pill:  999px;
  --nk-r-round: 50%;
  --nk-card-ratio: 16 / 10;  /* ONE photo ratio for every card (BRAND §13) */

  /* ---------- 5. shadows & rings ---------- */
  --nk-sh-sm: 0 2px 8px rgba(47,41,99,.06);
  --nk-sh-md: 0 4px 16px rgba(47,41,99,.08);
  --nk-sh-lg: 0 16px 40px rgba(47,41,99,.14);
  --nk-sh-xl: 0 24px 48px rgba(47,41,99,.14);        /* modals, floating panels */
  --nk-sh-dark: 0 16px 40px rgba(2,3,4,.3);          /* on dark / photo backgrounds */
  --nk-glow:  0 8px 24px rgba(40,142,255,.35);       /* primary button hover */
  --nk-ring:  0 0 0 3px rgba(40,142,255,.25);        /* focus ring */
  --nk-ring-danger: 0 0 0 3px rgba(229,72,77,.16);

  /* ---------- 6. z-index (BRAND §15) ---------- */
  --z-content: 1; --z-sticky: 100; --z-pop: 1000; --z-modal: 2000; --z-preview: 9000;

  /* ---------- 7. motion (transform / opacity only) ---------- */
  --nk-ease: cubic-bezier(.22,.61,.36,1);
  --nk-ease-out: cubic-bezier(.16,1,.3,1);
  --nk-dur-fast: .18s; --nk-dur-base: .32s; --nk-dur-slow: .6s;
}

/* ---------- Hebrew scale (BRAND §22): switches by page language / direction ---------- */
:lang(he), [dir="rtl"] {
  --nk-fs-display: 52px;
  --nk-fs-h1:      44px;
  --nk-fs-h2:      34px;
  --nk-fs-h3:      26px;
  --nk-fs-title:   21px;
  --nk-fs-body-lg: 19px;
  --nk-fs-body:    17px;
  --nk-fs-small:   15px;
  --nk-fs-label:   14px;
  --nk-fs-micro:   13px;
  --nk-lh-tight:   1.25;
  --nk-lh-heading: 1.35;
  --nk-lh-body:    1.65;
  --nk-lh-small:   1.55;
  --nk-ls-label:   0;
  --nk-ls-tight:   0;
  --nk-tt-label:   none;
  --nk-fw-label:   var(--nk-fw-semibold);
  --nk-fs-italic:  normal;
}

/* ---------- mobile scale: headings step down, body never below 16px ---------- */
@media (max-width: 900px) {
  html:root { --nk-section: 72px; --nk-section-hero: 56px; --nk-stack: var(--nk-sp-8); --nk-cols: var(--nk-sp-10); }
}
@media (max-width: 767px) {
  html:root {
    --nk-section: 56px; --nk-section-hero: 40px; --nk-head: var(--nk-sp-6); --nk-stack: 28px; --nk-grid: var(--nk-sp-4); --nk-cols: var(--nk-sp-8); --nk-card-pad: var(--nk-sp-5); --nk-gutter: var(--nk-sp-4);
    --nk-fs-display: 36px; --nk-fs-h1: 32px; --nk-fs-h2: 26px; --nk-fs-h3: 21px; --nk-fs-title: 18px; --nk-fs-body-lg: 17px;
  }
  :lang(he), [dir="rtl"] { --nk-fs-display: 38px; --nk-fs-h1: 34px; --nk-fs-h2: 28px; --nk-fs-h3: 22px; --nk-fs-title: 19px; --nk-fs-body-lg: 18px; }
}

/* ---------- 8. legacy aliases: the --kh-* names every existing stylesheet uses.
   They now resolve to the tokens above; stage 2 deletes the :root block in
   knowledge-hub.css and the pages keep working unchanged. ---------- */
html:root {
  --kh-indigo: var(--nk-indigo); --kh-blue: var(--nk-blue); --kh-sky: var(--nk-sky); --kh-sky-050: var(--nk-sky-050);
  --kh-mist: var(--nk-mist); --kh-ink: var(--nk-ink); --kh-text: var(--nk-text); --kh-text-2: var(--nk-text-2); --kh-text-3: var(--nk-text-3);
  --kh-line: var(--nk-line); --kh-surface: var(--nk-white); --kh-bg: var(--nk-bg); --kh-success: var(--nk-success); --kh-danger: var(--nk-danger);
  --kh-font: var(--nk-font);
  --kh-r-card: var(--nk-r-card); --kh-r-field: var(--nk-r-field); --kh-r-pill: var(--nk-r-pill);
  --kh-sh-sm: var(--nk-sh-sm); --kh-sh-md: var(--nk-sh-md); --kh-sh-lg: var(--nk-sh-lg); --kh-glow: var(--nk-glow);
  --kh-ease: var(--nk-ease); --kh-ease-out: var(--nk-ease-out); --kh-dur-fast: var(--nk-dur-fast); --kh-dur-base: var(--nk-dur-base);
}
