/* ============================================================================
   دليل عُمان — Daleel Oman
   tokens.css — THE SINGLE SOURCE OF TRUTH  ·  v2 "MERIDIAN" (redesign)
   ----------------------------------------------------------------------------
   Concept: a precision instrument for finding talent. Cool near-black slate,
   the owner-chosen indigo (#4F46E5) → cyan (#22D3EE) accent used SPARINGLY as a
   signal, not a glow. Hairline rules, a faint coordinate grid, technical mono
   numerals. Gender-neutral, confident, editorial-tech.
   ----------------------------------------------------------------------------
   Palette hues are LOCKED by the owner (indigo → cyan). Shades were refined
   ≤10% vs. the previous "Midnight Steel" set; no new hue families.
   Every text pair below is WCAG-AA verified (see brand-guide.md §Contrast).
   Rule for all agents: use ONLY these tokens. Do not invent colors/type/motion.
   NOTE: historical names --violet-* / --coral-* are KEPT so downstream CSS need
   not change; they carry indigo (violet-*) and cyan (coral-*) values.
   ============================================================================ */

:root {
  /* ------------------------------------------------------------------ */
  /* 1. CORE BRAND HUES (raw, not for direct body-text use)              */
  /* ------------------------------------------------------------------ */
  --violet-500: #818CF8; /* indigo bright — accent text / hover      (AA 6.3:1) */
  --violet-600: #4F46E5; /* indigo solid  — primary button fill (white 6.3:1)   */
  --violet-700: #4338CA; /* indigo pressed                                       */
  --coral-400:  #22D3EE; /* cyan — signal accent / links       (AA 10.6:1 canvas)*/
  --coral-300:  #67E8F9; /* soft cyan — highlights / hairline accents            */

  /* NEW convenience aliases (semantic reading of the same hues) */
  --indigo:      var(--violet-600);
  --indigo-soft: var(--violet-500);
  --cyan:        var(--coral-400);
  --cyan-soft:   var(--coral-300);

  /* ------------------------------------------------------------------ */
  /* 2. SURFACES (cool slate ladder)                                     */
  /* ------------------------------------------------------------------ */
  --color-canvas:      #0C0E13; /* page background (cool near-black)      */
  --color-card:        #14181F; /* default card / row                     */
  --color-surface:     #1A1F29; /* NEW: mid raise — sticky rails, inputs  */
  --color-elevated:    #222834; /* modals, popovers, active hover         */
  --color-canvas-deep: #080A0E; /* footer / deepest wells                 */
  --color-inset:       #0A0C11; /* NEW: recessed wells (grid panels, code)*/

  /* Glass (used only for the mobile sticky social bar now — NOT the header) */
  --glass-fill:   rgba(20, 24, 31, 0.72);
  --glass-stroke: rgba(255, 255, 255, 0.08);
  --glass-blur:   14px;

  /* ------------------------------------------------------------------ */
  /* 3. BORDERS & HAIRLINES (the signature of this concept)              */
  /* ------------------------------------------------------------------ */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-focus:  var(--coral-400);
  --hairline:      rgba(255, 255, 255, 0.09); /* NEW: 1px structural rule */
  --hairline-accent: rgba(34, 211, 238, 0.35); /* NEW: cyan hairline tick */

  /* Coordinate grid — decorative, aria-hidden, never behind body text */
  --grid-line:     rgba(129, 140, 248, 0.06); /* NEW: indigo-tinted grid  */
  --grid-line-2:   rgba(255, 255, 255, 0.035);/* NEW: neutral fine grid   */
  --grid-size:     40px;                        /* NEW: coordinate module  */

  /* ------------------------------------------------------------------ */
  /* 4. TEXT HIERARCHY                                                   */
  /* ------------------------------------------------------------------ */
  --text-heading:   #F3F5F9; /* 16.9:1 on canvas */
  --text-body:      #C4CAD6; /* 11.1:1 on canvas */
  --text-muted:     #8E97AB; /*  5.5:1 on canvas */
  --text-faint:     #6B7385; /* NEW: grid labels / index ticks (3.3:1 — UI/large only) */
  --text-on-accent: #06121A; /* dark text on cyan/light fills (9.5:1) */
  --text-on-primary:#FFFFFF; /* white text on solid indigo button (6.3:1) */
  --text-link:      var(--coral-400); /* cyan */

  /* ------------------------------------------------------------------ */
  /* 5. PRIMARY + GRADIENTS (gradient is a rare focal accent, not chrome)*/
  /* ------------------------------------------------------------------ */
  --color-primary:         var(--violet-600);
  --color-primary-hover:   var(--violet-500);
  --color-primary-pressed: var(--violet-700);
  --color-accent:          var(--coral-400);

  --gradient-start: #6366F1; /* indigo-500 */
  --gradient-end:   #22D3EE; /* cyan-400   */
  --gradient-brand: linear-gradient(120deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  --gradient-brand-soft: linear-gradient(120deg,
                          rgba(99, 102, 241, 0.16) 0%,
                          rgba(34, 211, 238, 0.16) 100%);
  /* Text-clip headings — reserved for ONE focal heading per page.
     Both visible stops stay luminous so display text remains AA on canvas. */
  --gradient-text: linear-gradient(135deg, #818CF8 0%, #22D3EE 55%, #67E8F9 100%);
  /* NEW: hairline / rule gradient — for the 2px accent kicker rule under eyebrows */
  --gradient-rule: linear-gradient(90deg, var(--coral-400) 0%, rgba(34,211,238,0) 100%);

  /* ------------------------------------------------------------------ */
  /* 6. SEMANTIC                                                         */
  /* ------------------------------------------------------------------ */
  --color-success: #34D399; /* 10.1:1 on canvas */
  --color-warning: #FBBF24; /* 11.6:1 on canvas */
  --color-danger:  #F87171; /*  7.0:1 on canvas */
  --color-info:    #60A5FA; /*  7.6:1 on canvas */
  --color-success-bg: rgba(52, 211, 153, 0.12);
  --color-warning-bg: rgba(251, 191, 36, 0.12);
  --color-danger-bg:  rgba(248, 113, 113, 0.12);
  --color-info-bg:    rgba(96, 165, 250, 0.12);

  /* ------------------------------------------------------------------ */
  /* 7. SHADOWS & FOCUS (flatter than v1 — depth via hairlines, not glow)*/
  /* ------------------------------------------------------------------ */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-md:  0 8px 24px rgba(0, 0, 0, 0.40);
  --shadow-lg:  0 20px 50px rgba(0, 0, 0, 0.50);
  --shadow-xl:  0 32px 80px rgba(0, 0, 0, 0.55);
  /* "glow" tokens retained by name; retuned to restrained cyan/indigo edges */
  --glow-violet: 0 0 0 1px rgba(99, 102, 241, 0.45), 0 10px 30px rgba(79, 70, 229, 0.18);
  --glow-coral:  0 0 0 1px rgba(34, 211, 238, 0.45), 0 10px 30px rgba(34, 211, 238, 0.14);
  --glow-focus:  0 0 0 3px rgba(34, 211, 238, 0.55);
  /* NEW: soft ring for cards on hover — a hairline, not a halo */
  --ring-accent: inset 0 0 0 1px var(--hairline-accent);

  /* ------------------------------------------------------------------ */
  /* 8. TYPOGRAPHY                                                       */
  /* Display + Body: IBM Plex Sans Arabic — corporate-grade Arabic with  */
  /* superb structure at both poster and paragraph sizes.                */
  /* Mono: IBM Plex Mono — Latin numerals, index ticks, stat figures.    */
  /* ------------------------------------------------------------------ */
  --font-display: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-body:    "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace; /* NEW */

  /* Weights (IBM Plex Sans Arabic ships 100–700; 700 is the display max) */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600; /* NEW */
  --fw-bold:    700;
  --fw-black:   700; /* alias kept: this family tops out at 700 */

  /* Modular scale — tightened for editorial restraint (less poster, more precise) */
  --fs-display: clamp(2.5rem, 5.5vw + 1rem, 4.5rem);   /* hero headline */
  --fs-h1:      clamp(2rem, 3.5vw + 0.5rem, 3rem);
  --fs-h2:      clamp(1.625rem, 2vw + 0.5rem, 2.25rem);
  --fs-h3:      1.375rem;   /* 22px */
  --fs-body-lg: 1.1875rem;  /* 19px — intros, bios */
  --fs-body:    1.0625rem;  /* 17px — Arabic reads better slightly larger */
  --fs-small:   0.9375rem;  /* 15px */
  --fs-caption: 0.8125rem;  /* 13px */
  --fs-eyebrow: 0.75rem;    /* NEW: 12px — mono/label eyebrows */
  --fs-stat:    clamp(2.5rem, 4vw + 1rem, 3.75rem); /* NEW: big numerals */

  /* Line-heights — Arabic needs air, especially at display sizes */
  --lh-display: 1.14;
  --lh-heading: 1.28;
  --lh-body:    1.85;
  --lh-tight:   1.4;

  /* Tracking (Latin/UI labels only — never on Arabic word text; breaks joins) */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide:  0.14em;  /* mono eyebrows / index ticks (Latin) */

  /* Reading measures */
  --measure: 66ch;      /* bio / prose */
  --measure-narrow: 54ch; /* NEW: lede / captions */

  /* ------------------------------------------------------------------ */
  /* 9. SPACING (8px base)                                               */
  /* ------------------------------------------------------------------ */
  --space-2xs: 0.25rem;  /* 4  */
  --space-xs:  0.5rem;   /* 8  */
  --space-sm:  0.75rem;  /* 12 */
  --space-md:  1rem;     /* 16 */
  --space-lg:  1.5rem;   /* 24 */
  --space-xl:  2.5rem;   /* 40 */
  --space-2xl: 4rem;     /* 64 */
  --space-3xl: 6rem;     /* 96 */
  --space-4xl: 8.5rem;   /* NEW: 136 — big editorial section breaks */

  --container-max:    1160px;
  --container-narrow: 720px;  /* NEW: prose / form column */
  --container-wide:   1320px; /* NEW: full-bleed editorial rows */
  --container-pad:    clamp(1rem, 4vw, 2.5rem);
  --tap-min: 44px; /* minimum tap target */

  /* Section vertical rhythm */
  --section-y: clamp(3.5rem, 6vw, 6rem); /* NEW */

  /* ------------------------------------------------------------------ */
  /* 10. RADII (sharper than v1 — precision instrument, not soft app)    */
  /* ------------------------------------------------------------------ */
  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  22px;
  --radius-pill: 999px;

  /* ------------------------------------------------------------------ */
  /* 11. MOTION (finite, restrained — entrance/reveal only)              */
  /* ------------------------------------------------------------------ */
  --dur-instant: 90ms;
  --dur-fast:    170ms;
  --dur-base:    280ms;
  --dur-slow:    480ms;
  --dur-slower:  720ms;

  --ease-out-expo:  cubic-bezier(0.16, 1, 0.30, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.50, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring:    cubic-bezier(0.34, 1.4, 0.64, 1); /* gentler overshoot */

  --stagger: 70ms; /* base delay unit between staggered items */

  /* Z-index scale */
  --z-base: 1;
  --z-header: 100;
  --z-progress: 110;
  --z-backtotop: 120;
  --z-overlay: 500;
  --z-lightbox: 600;
}

/* ============================================================================
   REDUCED MOTION — global collapse. Builder still adds per-component fallbacks,
   but these tokens neutralize durations so any transition using them is instant.
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-instant: 0ms;
    --dur-fast:    0ms;
    --dur-base:    0ms;
    --dur-slow:    0ms;
    --dur-slower:  0ms;
    --stagger:     0ms;
  }
}
