/**
 * Arabi Intelligence - design tokens.
 *
 * Palette, type scale, space and radius follow Master Development Specification
 * §§39–48. Text roles that fail WCAG 2.2 AA are darkened; fills stay as specified.
 *
 * Reference: docs/01-architecture/design-system.md
 */

:root {
  color-scheme: light;

  /* Brand fills (spec Blue600 / Blue700). White on #086AF5 ≈ 4.56:1 — AA large
   * text. Buttons use 16px+ semibold so they qualify as large. */
  --ai-brand:        #086AF5;
  --ai-brand-text:   #005BE8; /* Blue700 on white ≈ 5.1:1 AA for body links */
  --ai-brand-hover:  #005BE8;
  --ai-navy:         #060C46; /* Navy950. heading. ~18:1 on white */

  --ai-urgent:       #D42645; /* spec Breaking. white on fill ≈ 5.1:1 AA */
  --ai-urgent-text:  #B01E38; /* darkened for body-size labels on white */

  --ai-gold:         #886329;
  --ai-success:      #16865C;
  --ai-warning:      #B76E00;

  --ai-bg:           #FFFFFF;
  --ai-bg-raised:    #F8FAFC; /* Neutral050 */
  --ai-bg-sunken:    #F2F4F7; /* Neutral100 */
  --ai-bg-brand-soft:#F3F7FF; /* Blue050 */
  --ai-card:         #FFFFFF;
  --ai-nav-bg:       #060C46;

  --ai-text:         #101322; /* Neutral950 */
  --ai-text-strong:  #181B2A; /* Neutral900 */
  --ai-text-body:    #344054; /* Neutral700 */
  --ai-text-muted:   #475467; /* Neutral600. 7.5:1 on white */

  --ai-nav-text:     rgba(255, 255, 255, 0.72);
  --ai-nav-text-on:  #FFFFFF;
  --ai-on-brand:     #FFFFFF;
  /* Text on Navy950. Body and gold tokens above are for white paper and
   * disappear on this fill (body ≈ 1.7:1, gold ≈ 3.3:1). */
  --ai-on-navy:       #FFFFFF;
  --ai-on-navy-muted: #D0D5DD; /* Neutral300. ≈ 12:1 on #060C46 */
  --ai-on-navy-link:  #9CC4FF; /* ≈ 9:1 on #060C46 */
  --ai-gold-on-navy:  #E6C98A; /* ≈ 11:1 on #060C46 */

  --ai-border:       #E4E7EC; /* Neutral200 */
  --ai-border-soft:  #F2F4F7;
  --ai-hairline:     #D0D5DD; /* Neutral300 — decoration only */
  --ai-border-strong:#D0D5DD;

  --ai-focus:        #086AF5;
  --ai-focus-ring:   0 0 0 2px var(--ai-bg), 0 0 0 4px var(--ai-focus);

  --ai-font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --ai-font-display: 'DIN Next LT Arabic', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --ai-font-num: 'IBM Plex Sans Arabic', ui-monospace, 'Cascadia Mono', monospace;

  /* Spec §§43–44. Floor remains 13px for Arabic dots. */
  --ai-fs-2xs:   0.8125rem;  /* 13px labels */
  --ai-fs-xs:    0.875rem;   /* 14px meta */
  --ai-fs-sm:    1rem;       /* 16px UI */
  --ai-fs-md:    1rem;
  --ai-fs-base:  1.375rem;   /* 22px article body desktop */
  --ai-fs-lg:    1.5rem;     /* 24px lead / card large */
  --ai-fs-xl:    1.75rem;    /* 28px H3 */
  --ai-fs-2xl:   2.25rem;    /* 36px H2 */
  --ai-fs-3xl:   3rem;       /* 48px H1 */
  --ai-fs-4xl:   3.25rem;    /* 52px display L */
  --ai-fs-5xl:   4rem;       /* 64px display XL */

  --ai-fw-normal:   400;
  --ai-fw-medium:   500;
  --ai-fw-semibold: 600;
  --ai-fw-bold:     700;
  --ai-fw-black:    800;

  --ai-lh-tight:   1.15;
  --ai-lh-heading: 1.35;
  --ai-lh-body:    1.77; /* 22/39 */
  --ai-lh-ui:      1.7;

  --ai-space-1:  0.25rem;
  --ai-space-2:  0.5rem;
  --ai-space-3:  0.75rem;
  --ai-space-4:  1rem;
  --ai-space-5:  1.25rem;
  --ai-space-6:  1.5rem;
  --ai-space-7:  2rem;
  --ai-space-8:  2.5rem;
  --ai-space-9:  3rem;
  --ai-space-10: 4rem;
  --ai-space-11: 5rem;
  --ai-space-12: 6rem;
  --ai-space-section: 5rem;

  --ai-radius-sm:   4px;
  --ai-radius:      8px;
  --ai-radius-md:   12px;
  --ai-radius-lg:   16px;
  --ai-radius-xl:   24px;
  --ai-radius-pill: 999px;
  --ai-container:   1280px;

  --ai-shadow-sm: 0 2px 8px rgba(16, 24, 40, 0.06);
  --ai-shadow-md: 0 8px 24px rgba(16, 24, 40, 0.10);
  --ai-shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.14);

  --ai-z-sticky:  100;
  --ai-z-overlay: 400;
  --ai-z-modal:   500;
  --ai-z-toast:   600;

  --ai-duration-fast: 120ms;
  --ai-duration:      200ms;
  --ai-duration-slow: 320ms;
  --ai-transition:    200ms ease-out;

  --ai-btn-lg: 3.25rem; /* 52px §56 */
  --ai-btn:    3rem;    /* 48px */
  --ai-btn-sm: 2.25rem; /* 36px */
  --ai-input:  3rem;    /* 48px §57 */
  --ai-header-h: 4.75rem; /* 76px */
  --ai-header-h-sticky: 4rem;
  --ai-logo-h: 2.75rem; /* 44px */
  --ai-logo-w: 11.25rem; /* 180px */
  --ai-prose-max: 760px;

  /* -----------------------------------------------------------------
   *  Briefing layer — the "situation room" homepage (daily brief,
   *  watchlist, regional radar, dossiers, spotlight, data point).
   *  Navy bands for synthesis alternate with paper reading zones;
   *  hairline rules and prominent gold numerals carry the hierarchy.
   * ----------------------------------------------------------------- */
  --ai-band-navy:   #060C46; /* panel fill, same ink family as the masthead */
  --ai-band-navy-2: #0A1250; /* gradient end for a subtle depth on bands */
  --ai-rule:        rgb(255 255 255 / 14%); /* hairline on navy */
  --ai-rule-paper:  var(--ai-border);       /* hairline on paper, adapts to dark */
  --ai-pulse:       #2DB7FF; /* live / developing indicator, ≈ 7:1 on navy */
  --ai-spark:       #086AF5; /* sparkline stroke on paper */
  --ai-num-strong:  #E6C98A; /* big gold numerals on navy, ≈ 11:1 */
  --ai-kicker-fs:   0.75rem; /* 12px label */
  --ai-kicker-ls:   0.08em;  /* kicker letter-spacing */
  --ai-fs-brief:    2.25rem; /* brief lead headline */
}

@media (max-width: 767px) {
  :root {
    --ai-fs-base: 1.25rem;  /* 20px */
    --ai-fs-lg:   1.3125rem;
    --ai-fs-xl:   1.5rem;
    --ai-fs-2xl:  1.75rem;
    --ai-fs-3xl:  2.125rem; /* 34px H1 */
    --ai-fs-4xl:  2.125rem;
    --ai-fs-5xl:  2.125rem;
    --ai-fs-brief: 1.625rem; /* brief lead headline on phones */
    --ai-space-section: 3rem;
    --ai-header-h: 3.75rem;
    --ai-logo-h: 2.25rem; /* 36px */
  }
}

[data-theme='dark'] {
  color-scheme: dark;

  --ai-bg:           #101322;
  --ai-bg-raised:    #181B2A;
  --ai-bg-sunken:    #15246C;
  --ai-bg-brand-soft:#18233F; /* brand tint on raised — was light Blue050 */
  --ai-card:         #181B2A;
  --ai-nav-bg:       #060C46;

  --ai-text:         #F8FAFC;
  --ai-text-strong:  #F2F4F7;
  --ai-text-body:    #D0D5DD;
  --ai-text-muted:   #98A2B3;

  --ai-brand-text:   #78AFFF; /* Blue300. AA on dark card */
  --ai-brand-hover:  #2682FF;
  --ai-urgent-text:  #F97080;
  --ai-gold:         #a98243;

  --ai-border:       #344054;
  --ai-border-soft:  #1E2740;
  --ai-hairline:     #475467;
  --ai-border-strong:#475467;

  --ai-focus:        #2682FF;

  --ai-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --ai-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --ai-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --ai-bg:           #101322;
    --ai-bg-raised:    #181B2A;
    --ai-bg-sunken:    #15246C;
    --ai-bg-brand-soft:#18233F;
    --ai-card:         #181B2A;
    --ai-nav-bg:       #060C46;

    --ai-text:         #F8FAFC;
    --ai-text-strong:  #F2F4F7;
    --ai-text-body:    #D0D5DD;
    --ai-text-muted:   #98A2B3;

    --ai-brand-text:   #78AFFF;
    --ai-brand-hover:  #2682FF;
    --ai-urgent-text:  #F97080;
    --ai-gold:         #a98243;

    --ai-border:       #344054;
    --ai-border-soft:  #1E2740;
    --ai-hairline:     #475467;
    --ai-border-strong:#475467;

    --ai-focus:        #2682FF;

    --ai-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --ai-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --ai-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ai-transition: 0s;
    --ai-duration-fast: 0s;
    --ai-duration: 0s;
    --ai-duration-slow: 0s;
  }
}
