/*
==============================================================================
NILE CODES — P15 DESIGN TOKENS  (Delta Glow — art direction C, owner decision)
==============================================================================
Layering rule (enforced by P3 suite + docs/DESIGN-SYSTEM.md):
  1. FOUNDATION (--nc-f-*)  raw ramps: neutrals, brand hues, scale numbers. NEVER used by components.
  2. SEMANTIC  (--nc-*)      roles consumed everywhere. Component CSS = semantic only.
Hex/color literals outside this file are forbidden except documented structural
values (0, 100%, 1px–3px, transparent, black/white inside elevation).

DELTA GLOW (P15): owner-selected direction C. Deep ink canvas with layered dark
surfaces, electric-cyan primary + violet/magenta gradient accents, soft neon
glows on focus/card-hover, "delta" (Λ) motif reserved for hero seams. The
neutral foundation ramp is INVERTED vs. P3 (0 = deepest ink, 950 = brightest
text) so every existing semantic role resolves to a dark-theme value simply by
re-reading the same variable names. Previous azure brand names are retained as
aliases mapping to the new cyan steps. Arabic-first (D-14), RTL, WCAG-AA-derived
text values. No webfont dependencies (system stacks only).
==============================================================================
*/

:root {

  /* ==========================================================================
     FOUNDATION — COLOR
     ========================================================================== */
/* neutral ink ramp (INVERTED for dark canvas: 0 = deepest ink, 950 = brightest) */
  --nc-f-neutral-0:   #05070c;
  --nc-f-neutral-50:  #0a0e17;
  --nc-f-neutral-100: #101627;
  --nc-f-neutral-200: #182036;
  --nc-f-neutral-300: #232e47;
  --nc-f-neutral-400: #3a4763;
  --nc-f-neutral-500: #5b6884;
  --nc-f-neutral-600: #7e89a3;
  --nc-f-neutral-700: #a9b1c4;
  --nc-f-neutral-800: #dde3ee;
  --nc-f-neutral-900: #eef2f8;
  --nc-f-neutral-950: #ffffff;

  /* brand aurora (Delta Glow) — cyan primary, violet/magenta gradient partners.
     Legacy azure token names retained as aliases (P15, owner decision C). */
  --nc-f-brand-azure:        #00e5ff; /* neon cyan: graphics, fills, focus ring */
  --nc-f-brand-azure-050:    #0c2027; /* soft cyan wash on ink */
  --nc-f-brand-azure-100:    #12313a; /* soft cyan border/fill step */
  --nc-f-brand-azure-strong: #00c0d8; /* AA-safe cyan fill for primary buttons */
  --nc-f-brand-azure-text:   #5fd7ef; /* AA-safe cyan for text/links */
  --nc-f-brand-violet:       #8b5cf6; /* gradient partner (Delta apex) */
  --nc-f-brand-violet-deep:  #6d44e8; /* AA-safe violet for text */
  --nc-f-brand-magenta:      #e879f9; /* gradient far stop (rare accents) */
  --nc-f-brand-ink:          #0b1020; /* invest/inverse surfaces, deep bg blocks */
  --nc-f-brand-ink-raise:    #131c30; /* raised surfaces inside invest bands */

/* status ramps (dark-theme vocabulary) */
  --nc-f-red-50:  #371016;
  --nc-f-red-500: #f87171;
  --nc-f-red-700: #ef4444;
  --nc-f-green-50:  #0b2418;
  --nc-f-green-600: #34d399;
  --nc-f-green-700: #2fb079;
  --nc-f-amber-50:  #30240a;
  --nc-f-amber-600: #fbbf24;
  --nc-f-amber-800: #f59e0b;
  --nc-f-blue-50:  #0d2233;
  --nc-f-blue-600: #7dd3fc;

  /* ==========================================================================
     FOUNDATION — TYPOGRAPHY (Arabic-first; system stacks, no webfont loads)
     ========================================================================== */
  --nc-f-font-sans:    "Noto Sans Arabic", "Cairo", "Tajawal", "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
  --nc-f-font-display: var(--nc-f-font-sans);
  --nc-f-font-mono:    ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* raw steps (rem) — semantic clamp roles reference these */
  --nc-f-text-caption: 0.8125rem;
  --nc-f-text-sm:      0.875rem;
  --nc-f-text-base:    1rem;
  --nc-f-text-lg:      1.125rem;
  --nc-f-text-h4:      1.25rem;
  --nc-f-text-h3:      1.375rem;
  --nc-f-text-h2:      1.75rem;
  --nc-f-text-h1:      2.25rem;
  --nc-f-text-display: 3rem;

  --nc-f-weight-regular: 400;
  --nc-f-weight-semibold: 600;
  --nc-f-weight-bold:     700;
  --nc-f-weight-heavy:    800;

  --nc-f-leading-body:     1.85;   /* Arabic long-form reading comfort */
  --nc-f-leading-heading:  1.3;
  --nc-f-leading-compact:  1.4;
  --nc-f-leading-tight:    1.15;

  /* ==========================================================================
     FOUNDATION — SPACING / SIZING / RADII / BORDERS / ELEVATION / MOTION / Z / BP
     ========================================================================== */
  --nc-f-space-0:  0rem;
  --nc-f-space-1:  0.25rem;
  --nc-f-space-2:  0.5rem;
  --nc-f-space-3:  0.75rem;
  --nc-f-space-4:  1rem;
  --nc-f-space-5:  1.5rem;
  --nc-f-space-6:  2rem;
  --nc-f-space-7:  3rem;
  --nc-f-space-8:  4rem;
  --nc-f-space-9:  6rem;
  --nc-f-space-10: 8rem;

  --nc-f-size-control-h:     2.75rem;
  --nc-f-size-control-h-sm:  2.25rem;
  --nc-f-size-control-h-lg:  3.25rem;
  --nc-f-size-icon:          1.25rem;
  --nc-f-size-touch-target:  44px;

  --nc-f-container-sm: 42rem;
  --nc-f-container-md: 64rem;
  --nc-f-container-lg: 75rem;
  --nc-f-container-xl: 88rem;
  --nc-f-measure-reading: 68ch;

  --nc-f-radius-0:    0rem;
  --nc-f-radius-sm:   0.25rem;
  --nc-f-radius-md:   0.5rem;
  --nc-f-radius-lg:   0.875rem;
  --nc-f-radius-pill: 999rem;

  --nc-f-border-1: 1px;
  --nc-f-border-2: 2px;
  --nc-f-border-3: 3px;
  --nc-f-border-4: 4px;

/* elevation raw (glow shadows on ink — Delta Glow) */
  --nc-f-shadow-sm: 0 0 0 1px rgba(0, 229, 255, 0.06), 0 1px 0 rgba(255, 255, 255, 0.04);
  --nc-f-shadow-md: 0 0 22px rgba(0, 229, 255, 0.12), 0 0 0 1px rgba(120, 150, 255, 0.08);
  --nc-f-shadow-lg: 0 0 0 1px rgba(139, 92, 246, 0.22), 0 0 42px rgba(139, 92, 246, 0.28), 0 12px 60px rgba(0, 229, 255, 0.14);

  --nc-f-duration-fast: 120ms;
  --nc-f-duration-base: 200ms;
  --nc-f-duration-slow: 320ms;
  --nc-f-ease-standard: ease;
  --nc-f-ease-decel:    cubic-bezier(0.16, 1, 0.3, 1);

  --nc-f-z-index-sticky:  20;
  --nc-f-z-index-overlay: 60;
  --nc-f-z-index-alert:   80;
  --nc-f-z-index-modal:   120;

  /* breakpoints (media queries cannot read custom props — this table is law):
     sm = 40em (640px) · md = 64em (1024px) · lg = 90em (1440px)  [min-width, mobile-first] */

  /* ==========================================================================
     SEMANTIC — COLOR ROLES
     ========================================================================== */
  --nc-color-page-bg:       var(--nc-f-neutral-0);
  --nc-color-surface:       var(--nc-f-neutral-0);
  --nc-color-surface-sunken: var(--nc-f-neutral-50);
  --nc-color-surface-inset: var(--nc-f-neutral-100);

  --nc-color-text:          var(--nc-f-neutral-800);
  --nc-color-text-secondary: var(--nc-f-neutral-600);
  --nc-color-text-muted:    var(--nc-f-neutral-600);
  --nc-color-text-on-invested: var(--nc-f-neutral-0); /* white text on brand fills */

  --nc-color-border:        var(--nc-f-neutral-200);
  --nc-color-border-strong: var(--nc-f-neutral-400);

--nc-color-accent:        var(--nc-f-brand-azure-strong); /* AA-safe cyan */
  --nc-color-accent-hover:  #00d6ea; /* derived: brighter cyan step on hover */
  --nc-color-accent-active: #00a3bd;
  --nc-color-accent-soft:   var(--nc-f-brand-azure-050);
  --nc-color-accent-soft-border: var(--nc-f-brand-azure-100);

  --nc-color-link:          var(--nc-f-brand-azure-text);
  --nc-color-link-hover:    #7ee7ff;
  --nc-color-focus:         var(--nc-f-brand-azure);

  --nc-color-success:       var(--nc-f-green-700);
  --nc-color-success-bg:    var(--nc-f-green-50);
  --nc-color-warning:       var(--nc-f-amber-800);
  --nc-color-warning-bg:    var(--nc-f-amber-50);
  --nc-color-error:         var(--nc-f-red-700);
  --nc-color-error-bg:      var(--nc-f-red-50);
  --nc-color-information:   var(--nc-f-blue-600);
  --nc-color-information-bg: var(--nc-f-blue-50);

--nc-color-ghost-text:    var(--nc-f-neutral-600);
  --nc-color-disabled-text: var(--nc-f-neutral-400);
  --nc-color-disabled-bg:   var(--nc-f-neutral-100);

  /* P14.1.4 — INVEST (inverse/premium bands): hero, CTA, section seams.
     All values derive from the existing P3 ramps; azure-on-ink pair = 5.7:1 (AA). */
  --nc-color-invest-bg:          var(--nc-f-brand-ink);
  --nc-color-invest-raise:       var(--nc-f-brand-ink-raise);
  --nc-color-invest-text:        var(--nc-f-neutral-950);
  --nc-color-invest-text-muted:  var(--nc-f-neutral-600);
  --nc-color-invest-accent:      var(--nc-f-brand-azure);
  --nc-color-invest-accent-hover: var(--nc-f-brand-azure-strong);
  --nc-color-invest-accent-soft: rgba(0, 229, 255, 0.12); /* neon cyan wash on ink */
  --nc-gradient-nile: linear-gradient(90deg, var(--nc-f-brand-azure) 0%, var(--nc-f-brand-violet) 55%, var(--nc-f-brand-magenta) 100%);

  /* P15 Delta Glow additions — gradients + glow roles (semantic only) */
  --nc-gradient-aurora: radial-gradient(56rem 32rem at 82% -12%, rgba(139, 92, 246, 0.24), transparent 62%), radial-gradient(48rem 30rem at 14% 112%, rgba(0, 229, 255, 0.16), transparent 62%);
  --nc-gradient-delta:  linear-gradient(120deg, var(--nc-f-brand-azure) 0%, var(--nc-f-brand-violet) 55%, var(--nc-f-brand-magenta) 100%);

  --nc-glow-accent:     0 0 18px rgba(0, 229, 255, 0.35);
  --nc-glow-accent-soft: 0 0 12px rgba(0, 229, 255, 0.18);
  --nc-glow-violet:     0 0 22px rgba(139, 92, 246, 0.35);
  --nc-glow-card:       0 0 0 1px rgba(0, 229, 255, 0.12), 0 0 24px rgba(0, 229, 255, 0.08);
  --nc-glow-strong:     0 0 0 2px rgba(0, 229, 255, 0.5), 0 0 36px rgba(0, 229, 255, 0.5);
  --nc-glow-header:     0 1px 0 rgba(0, 229, 255, 0.14), 0 0 20px rgba(139, 92, 246, 0.1);

  --nc-ambient-aurora:  radial-gradient(1400px 600px at 50% -200px, rgba(139, 92, 246, 0.1), transparent 60%);
  --nc-color-panel-glow: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 45%);

  /* ==========================================================================
     SEMANTIC — TYPE ROLES (fluid where justified; clamp min = raw small step)
     ========================================================================== */
  --nc-font-body:       var(--nc-f-font-sans);
  --nc-font-heading:    var(--nc-f-font-display);
  --nc-font-code:       var(--nc-f-font-mono);

  --nc-text-display:    clamp(1.75rem, 1.1rem + 2.6vw, var(--nc-f-text-display)); /* 28→48 */
  --nc-text-h1:         clamp(1.625rem, 1.1rem + 1.8vw, var(--nc-f-text-h1));     /* 26→36 */
  --nc-text-h2:         clamp(1.375rem, 1.05rem + 1.1vw, var(--nc-f-text-h2));   /* 22→28 */
  --nc-text-h3:         clamp(1.25rem, 1.12rem + 0.5vw, var(--nc-f-text-h3));     /* 20→22 */
  --nc-text-h4:         var(--nc-f-text-h4);                                      /* 20 */
  --nc-text-body-lg:    var(--nc-f-text-lg);                                      /* 18 */
  --nc-text-body:       var(--nc-f-text-base);                                    /* 16 */
  --nc-text-body-sm:    var(--nc-f-text-sm);                                      /* 14 */
  --nc-text-label:      var(--nc-f-text-sm);
  --nc-text-caption:    var(--nc-f-text-caption);                                 /* 13 */

  --nc-leading-heading:  var(--nc-f-leading-heading);
  --nc-leading-body:     var(--nc-f-leading-body);
  --nc-leading-tight:    var(--nc-f-leading-tight);
  --nc-leading-compact:  var(--nc-f-leading-compact);

  --nc-weight-strong:    var(--nc-f-weight-semibold);
  --nc-weight-heading:   var(--nc-f-weight-heavy);

  /* ==========================================================================
     SEMANTIC — SPACE / SIZE / BORDER / RADIUS / ELEVATION / MOTION / Z
     ========================================================================== */
  --nc-gutter-page:    clamp(var(--nc-f-space-4), 4vw, var(--nc-f-space-6));
  --nc-space-section:  clamp(var(--nc-f-space-7), 8vw, var(--nc-f-space-9));
  --nc-space-block:    var(--nc-f-space-5);
  --nc-gap-stack-sm:   var(--nc-f-space-2);
  --nc-gap-stack:      var(--nc-f-space-4);
  --nc-gap-stack-lg:   var(--nc-f-space-6);
  --nc-gap-inline:     var(--nc-f-space-3);
  --nc-gap-inline-sm:  var(--nc-f-space-2);
  --nc-pad-inline:     var(--nc-f-space-4);
  --nc-pad-block:      var(--nc-f-space-3);
  --nc-pad-card:       var(--nc-f-space-5);

  --nc-container-width:      var(--nc-f-container-md);
  --nc-container-width-wide: var(--nc-f-container-lg);
  --nc-container-width-narrow: var(--nc-f-container-sm);
  --nc-measure-reading:      var(--nc-f-measure-reading);

  --nc-control-height:    var(--nc-f-size-control-h);
  --nc-control-height-sm: var(--nc-f-size-control-h-sm);
  --nc-control-height-lg: var(--nc-f-size-control-h-lg);
  --nc-icon-size:         var(--nc-f-size-icon);
  --nc-touch-target:      var(--nc-f-size-touch-target);

  --nc-radius-control: var(--nc-f-radius-sm);
  --nc-radius-card:    var(--nc-f-radius-lg);
  --nc-radius-pill:    var(--nc-f-radius-pill);
  --nc-radius-circle:  var(--nc-f-radius-pill);

  --nc-border-width:   var(--nc-f-border-1);
  --nc-border-width-strong: var(--nc-f-border-2);
  --nc-border-width-focus:  var(--nc-f-border-2);
  --nc-border-width-accent: var(--nc-f-border-4);

  --nc-elevation-0: none;
  --nc-elevation-1: var(--nc-f-shadow-sm);
  --nc-elevation-2: var(--nc-f-shadow-md);
  --nc-elevation-3: var(--nc-f-shadow-lg);

  --nc-motion-fast:  var(--nc-f-duration-fast);
  --nc-motion-base:  var(--nc-f-duration-base);
  --nc-motion-slow:  var(--nc-f-duration-slow);
  --nc-ease-standard: var(--nc-f-ease-standard);
  --nc-ease-out:      var(--nc-f-ease-decel);

  --nc-z-sticky:  var(--nc-f-z-index-sticky);
  --nc-z-overlay: var(--nc-f-z-index-overlay);
  --nc-z-alert:   var(--nc-f-z-index-alert);
  --nc-z-modal:   var(--nc-f-z-index-modal);

  /* structural exceptions (documented allowlist): unitless 0/1, 100%, transparent */
}
