/* ==========================================================================
   Design tokens: Driving Zone
   Colour (sampled from the UI designs): brand violet #6425F3 for buttons,
   links, icons and the selected state; deep purple #190448 for the top bar,
   footer and drawer; #290779 for the dark band; lavender #F8F5FF tints; white
   and light-grey pages with neutral text. Type: Outfit (headings) and Inter
   (body) in English, IBM Plex Sans Arabic in Arabic, one size scale. Every
   colour, size, space, radius, shadow and motion value in the public CSS
   should come from here. Loaded before site.css, and by the self-contained
   error pages.
   ========================================================================== */

/* Web fonts load with display=swap. Until they arrive, text uses these local
   fonts, scaled and given the web font's vertical metrics so that lines wrap
   the same and the swap barely moves anything (it caused the home page's
   layout shift, CLS 0.19). Values measured from the actual font files
   against Arial / Georgia Bold (fontTools, same method as next/font). */
/* IBM Plex Sans (English) against Arial and Arial Bold: average advance of a
   sample sentence, and the font's hhea metrics (the Latin faces of Plex Sans
   Arabic, so its taller Arabic line metrics). */
@font-face {
    font-family: 'IBM Plex Sans Fallback';
    src: local('Arial'), local('ArialMT');
    font-weight: 100 599;
    size-adjust: 101.44%;
    ascent-override: 106.96%;
    descent-override: 40.91%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'IBM Plex Sans Fallback';
    src: local('Arial Bold'), local('Arial-BoldMT');
    font-weight: 600 900;
    size-adjust: 98.67%;
    ascent-override: 109.97%;
    descent-override: 42.06%;
    line-gap-override: 0%;
}

/* Arabic glyphs only: IBM Plex Sans Arabic 400 against Arial's Arabic
   (average advance of a sample sentence; Plex's hhea metrics). */
@font-face {
    font-family: 'IBM Plex Sans Arabic Fallback';
    src: local('Arial'), local('ArialMT');
    size-adjust: 115.57%;
    ascent-override: 93.88%;
    descent-override: 35.91%;
    line-gap-override: 0%;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF;
}

/* IBM Plex Sans, the English font: the Latin faces of the self-hosted IBM
   Plex Sans Arabic (fonts-ar.css uses the same files for Latin text on Arabic
   pages), so both languages share one type family. Weight ranges: every
   requested weight lands on a real face (400, 600 or 700). */
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 100 500;
    font-display: swap;
    src: url('../../global/fonts/ibm-plex-arabic/ibm-plex-sans-arabic-latin-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-200B, U+200F-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 501 649;
    font-display: swap;
    src: url('../../global/fonts/ibm-plex-arabic/ibm-plex-sans-arabic-latin-600.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-200B, U+200F-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 650 900;
    font-display: swap;
    src: url('../../global/fonts/ibm-plex-arabic/ibm-plex-sans-arabic-latin-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-200B, U+200F-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Outfit (headings) and Inter (body): self-hosted variable fonts, Latin only.
   Arabic text uses IBM Plex Sans Arabic (fonts-ar.css). */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../../global/fonts/dz/outfit-latin-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../../global/fonts/dz/inter-latin-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* ---- Colour: palette ------------------------------------------------ */

    /* Brand scale: #6425F3 is step 600 (the design's primary); 950 is the deep
       purple of the top bar and footer, 900 the dark band. White text: 6.1:1
       on 600, 8.6:1 on 700. */
    --violet-50: #f8f5ff;
    --violet-100: #efe8ff;
    --violet-200: #e0d3fc;
    --violet-300: #d4c4fc;
    --violet-400: #a98bf9;
    --violet-500: #8450f6;
    --violet-600: #6425f3;
    --violet-700: #5316d0;
    --violet-800: #3d0fa0;
    --violet-900: #290779;
    --violet-950: #190448;

    /* Dark brand surfaces: 900 = deep purple (top bar, footer, drawer, dark
       pages), 800 = the dark band, 700 = the brand violet. */
    --night-900: var(--violet-950);
    --night-800: var(--violet-900);
    --night-700: var(--violet-600);

    /* Neutrals */
    --ink: #140a33;
    --ink-muted: #4b5563;
    --ink-subtle: #6b7280;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --surface-muted: #f3f4f6;
    --ui-line: #e5e7eb;
    --media-bg: #000;          /* video letterbox (.yt-facade) */
    --mask-opaque: #000;       /* the opaque stop of mask gradients (only alpha counts) */

    /* Accent (sparingly: highlights, badges) */
    --gold-500: #f5a524;
    --gold-100: #fef3d9;

    /* Status */
    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;
    --info: #1d4ed8;
    --whatsapp: #1a9e4b;       /* floating WhatsApp button: 3.5:1 with white, 3.2:1 on --surface-soft */
    --danger-soft: #fdecec;    /* status tints (user area, auth) */
    --success-soft: #e7f6ec;
    --info-soft: #e6eefc;

    /* ---- Colour: roles (Design system > Colour roles) -------------------- */
    /* Action: buttons, links, selected state, active nav. White text on it. */
    --action: var(--violet-600);
    --action-hover: var(--violet-700);
    --on-action: #ffffff;
    /* Tint: icon chips and notes (replaces cyan). */
    --tint: var(--violet-50);
    --tint-strong: var(--violet-100);
    /* Night: hero, at most one band, footer. */
    --on-night: #ffffff;
    /* Light text, icons and lines on the brand colour (6:1). */
    --on-night-muted: var(--violet-100);
    /* Accent: hairlines and numerals on night only, never on white. */
    --accent: var(--gold-500);
    /* Focus ring: 2px, violet-700 on light surfaces, violet-100 on the brand colour. */
    --focus-color: var(--violet-700);
    --focus-color-on-dark: var(--violet-100);
    --focus-width: 2px;
    --focus-offset: 2px;

    /* Semantic (current site) */
    --footer-bg: var(--night-900);
    /* the final call-to-action card: white text keeps 4.5:1 across it */
    --gradient-brand: linear-gradient(135deg, var(--violet-700) 0%, var(--violet-600) 100%);
    --focus-ring: 0 0 0 3px color-mix(in srgb, var(--violet-500) 45%, transparent);

    /* ---- Type ------------------------------------------------------------ */
    --font-body: 'Inter', 'IBM Plex Sans', 'IBM Plex Sans Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', var(--font-body);
    --font-arabic: 'IBM Plex Sans Arabic', 'IBM Plex Sans Arabic Fallback', system-ui, sans-serif;
    --fs-xs: .8125rem;
    --fs-sm: .875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;

    /* Type scale (English; Arabic values below under :lang(ar)) */
    --fs-display: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
    --fs-h1: clamp(1.875rem, 1.4rem + 2vw, 3rem);
    --fs-h2: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
    /* Every card and item title (services, steps, boards, articles...) */
    --fs-h3: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
    --fs-lead: 1.125rem;
    --fs-body: 1rem;
    --fs-article: 1.125rem;
    --fs-meta: .875rem;
    --fs-kicker: .8125rem;
    --fs-stat: clamp(2rem, 1.6rem + 1.5vw, 2.75rem);
    --lh-display: 1.15;
    --lh-h1: 1.2;
    --lh-h2: 1.25;
    --lh-h3: 1.4;
    --lh-lead: 1.6;
    --lh-body: 1.65;
    --lh-article: 1.7;
    --lh-meta: 1.5;
    --fw-display: 700;
    --fw-h3: 600;
    --fw-kicker: 600;

    /* Letter-spacing. All 0 on Arabic (see :lang(ar) below). */
    --tracking-tight: -.01em;
    --tracking-wide: .04em;
    --tracking-kicker: .08em;

    /* ---- Space: 4px scale ------------------------------------------------ */
    --sp-1: .25rem;   /*  4px */
    --sp-2: .5rem;    /*  8px */
    --sp-3: .75rem;   /* 12px */
    --sp-4: 1rem;     /* 16px */
    --sp-5: 1.25rem;  /* 20px */
    --sp-6: 1.5rem;   /* 24px */
    --sp-8: 2rem;     /* 32px */
    --sp-10: 2.5rem;  /* 40px */
    --sp-12: 3rem;    /* 48px */
    --sp-16: 4rem;    /* 64px */
    --sp-20: 5rem;    /* 80px */
    --sp-24: 6rem;    /* 96px */
    --section-y: clamp(3rem, 2rem + 4vw, 6rem);

    /* ---- Layout ---------------------------------------------------------- */
    --container: 1200px;
    --reading: 720px;
    --gutter: 16px;
    --header-h: 80px;
    --tap-min: 44px;
    --control-h: 48px;

    /* ---- Shape ----------------------------------------------------------- */
    --radius-xs: 4px;     /* tags */
    --radius-sm: 8px;     /* inputs */
    --radius-md: 12px;    /* images, chips */
    --radius-lg: 18px;    /* cards */
    --radius-xl: 24px;    /* feature panels, portrait frame */
    --radius-btn: 10px;   /* buttons */
    --radius-pill: 999px; /* chips, badges */

    /* ---- Depth: e0 (border) to e3 --------------------------------------- */
    --shadow-sm: 0 1px 2px rgba(28, 22, 49, .06), 0 1px 3px rgba(28, 22, 49, .08);
    --shadow-md: 0 10px 24px -12px rgba(46, 16, 101, .28);
    --shadow-card: 0 18px 40px -18px rgba(46, 16, 101, .38);
    --border-e0: 1px solid var(--ui-line);  /* default card */
    --shadow-e1: var(--shadow-sm);           /* hover, scrolled header */
    --shadow-e2: var(--shadow-md);           /* dropdowns, action bar */
    --shadow-e3: var(--shadow-card);         /* modals, featured and form cards */

    /* ---- Motion: opacity and transform only ------------------------------ */
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --dur-fast: 150ms;
    --dur: 220ms;
    --dur-slow: 400ms;
    --reveal-rise: 12px;
    --reveal-stagger: 60ms;

    /* ---- Stacking (matches Bootstrap 5's z-index scale) ------------------ */
    --z-raised: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-header: 1030;
    --z-action-bar: 1035;
    --z-offcanvas-backdrop: 1040;
    --z-offcanvas: 1045;
    --z-modal-backdrop: 1050;
    --z-modal: 1055;
    --z-toast: 1090;
}

@media (min-width: 992px) {
    :root {
        --gutter: 24px;
    }
}

@media (max-width: 575.98px) {
    :root {
        --header-h: 68px;
    }
}

/* Arabic pages: IBM Plex Sans Arabic for both roles, Latin letters and
   digits included (fonts-ar.css). */
:root:lang(ar) {
    --font-body: 'IBM Plex Sans Arabic', 'IBM Plex Sans Arabic Fallback', 'IBM Plex Sans Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: var(--font-body);

    --fs-display: clamp(1.875rem, 1.4rem + 2vw, 3rem);
    --fs-h1: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);
    --fs-body: 1.0625rem;
    --fs-kicker: .875rem;
    --lh-display: 1.35;
    --lh-h1: 1.4;
    --lh-h2: 1.45;
    --lh-h3: 1.5;
    --lh-lead: 1.8;
    --lh-body: 1.8;
    --lh-article: 1.9;
    --lh-meta: 1.6;
    --fw-display: 700;
    --fw-h3: 600;
    --fw-kicker: 600;
}

/* Arabic script is never letter-spaced (it breaks letter joining). */
:lang(ar) {
    --tracking-tight: 0;
    --tracking-wide: 0;
    --tracking-kicker: 0;
}
