/* =============================================================================
   Aamal Aljoud — Redesign Design Tokens
   -----------------------------------------------------------------------------
   Single source of truth for the site AND the dashboard.
   Values were measured from the approved home page design (the master
   visual reference) and then normalised into a coherent ramp.

   Scope: both. The dashboard loads this same file and then maps these
   values onto its own chrome in dashboard-assets/css/dashboard.css, so the
   two halves of the product cannot drift apart: a colour changed here
   changes in both.
   Load order: this file must come AFTER all legacy stylesheets.
   ========================================================================== */

:root {
    /* ---------------------------------------------------------------- color */

    /* Accent — measured dominant UI hue (~195deg, 12.8k px of chrome in the
       master reference: header CTA, hero CTA, project CTA, active nav). */
    --aj-accent: #4a758c;
    --aj-accent-hover: #3b6072;
    --aj-accent-active: #31505f;
    --aj-accent-soft: #eaf0f4;
    --aj-accent-border: #cddbe4;

    /* Charcoal / deep neutral — measured text cluster (#232528 / #1e232b). */
    --aj-charcoal: #20242b;
    --aj-charcoal-soft: #2c313a;

    /* Surfaces */
    --aj-page: #fdfdfd;
    --aj-surface: #ffffff;
    --aj-surface-muted: #f4f6f7;
    --aj-surface-band: #edf0f2;

    /* Text — every value below is AA on --aj-surface */
    --aj-text: #20242b; /* 15.6:1 */
    --aj-text-secondary: #5b6672; /*  5.7:1 */
    --aj-text-muted: #6b7681; /*  4.6:1 */
    --aj-text-inverse: #ffffff;

    /* Borders & dividers */
    --aj-border: #e4e9ec;
    --aj-border-strong: #d2dade;
    --aj-divider: #edf0f2;

    /* Functional — used only where a form or state genuinely needs it */
    --aj-success: #2f7d63;
    --aj-error: #b3453c;
    --aj-focus-ring: rgba(74, 117, 140, 0.35);

    /* --------------------------------------------------------------- spacing */
    --aj-space-1: 0.25rem; /*  4 */
    --aj-space-2: 0.5rem; /*  8 */
    --aj-space-3: 0.75rem; /* 12 */
    --aj-space-4: 1rem; /* 16 */
    --aj-space-5: 1.25rem; /* 20 */
    --aj-space-6: 1.5rem; /* 24 */
    --aj-space-8: 2rem; /* 32 */
    --aj-space-10: 2.5rem; /* 40 */
    --aj-space-12: 3rem; /* 48 */
    --aj-space-16: 4rem; /* 64 */
    --aj-space-20: 5rem; /* 80 */
    --aj-space-24: 6rem; /* 96 */

    /* Vertical rhythm for full-width sections */
    --aj-section-y: clamp(3rem, 2rem + 4vw, 5.5rem);

    /* ------------------------------------------------------------- container */
    --aj-container-max: 1280px;
    --aj-container-narrow: 900px;
    --aj-container-pad: clamp(1rem, 0.5rem + 2vw, 2.5rem);

    /* ------------------------------------------------------------ typography */
    --aj-font: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;

    --aj-fw-regular: 400;
    --aj-fw-medium: 500;
    --aj-fw-bold: 700;

    /* Fluid type scale — Arabic-first, generous leading */
    --aj-fs-display: clamp(2.25rem, 1.60rem + 2.6vw, 3.5rem); /* 36 -> 56 */
    --aj-fs-h1: clamp(1.875rem, 1.40rem + 1.9vw, 2.75rem); /* 30 -> 44 */
    --aj-fs-h2: clamp(1.5rem, 1.22rem + 1.2vw, 2.125rem); /* 24 -> 34 */
    --aj-fs-h3: clamp(1.25rem, 1.13rem + 0.5vw, 1.5rem); /* 20 -> 24 */
    --aj-fs-h4: 1.125rem; /* 18 */
    --aj-fs-body-lg: 1.0625rem; /* 17 */
    --aj-fs-body: 1rem; /* 16 */
    --aj-fs-sm: 0.9375rem; /* 15 */
    --aj-fs-caption: 0.8125rem; /* 13 */

    --aj-lh-tight: 1.25;
    --aj-lh-snug: 1.45;
    --aj-lh-normal: 1.75;
    --aj-lh-relaxed: 1.95;

    --aj-ls-tight: -0.01em;
    --aj-ls-normal: 0;

    /* ---------------------------------------------------------------- radius */
    --aj-radius-sm: 6px;
    --aj-radius-md: 10px;
    --aj-radius-lg: 14px;
    --aj-radius-xl: 20px;
    --aj-radius-pill: 999px;

    /* --------------------------------------------------------------- shadows */
    /* Deliberately near-invisible: the reference separates surfaces with
       borders, not with elevation. */
    --aj-shadow-xs: 0 1px 2px rgba(32, 36, 43, 0.04);
    --aj-shadow-sm: 0 2px 8px rgba(32, 36, 43, 0.05);
    --aj-shadow-md: 0 6px 20px rgba(32, 36, 43, 0.07);
    --aj-shadow-header: 0 1px 0 var(--aj-border);

    /* ------------------------------------------------------------ icon sizes */
    --aj-icon-xs: 14px;
    --aj-icon-sm: 16px;
    --aj-icon-md: 20px;
    --aj-icon-lg: 24px;
    --aj-icon-xl: 32px;
    --aj-icon-stroke: 1.75;

    /* ----------------------------------------------------------- transitions */
    --aj-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --aj-duration-fast: 140ms;
    --aj-duration: 220ms;
    --aj-duration-slow: 340ms;
    --aj-transition: all var(--aj-duration) var(--aj-ease);

    /* -------------------------------------------------------------- z-layers */
    --aj-z-base: 1;
    --aj-z-sticky: 100;
    --aj-z-header: 200;
    --aj-z-drawer: 300;
    --aj-z-overlay: 400;
    --aj-z-modal: 500;

    /* --------------------------------------------------------------- header */
    --aj-header-h: 76px;
    --aj-header-h-sm: 64px;
}

/* Breakpoints (documented here; media queries below are the single set used)
   sm   480px   small phone -> large phone
   md   768px   tablet portrait
   lg  1024px   tablet landscape / small laptop
   xl  1280px   laptop / desktop
   2xl 1536px   large desktop                                                */

@media (max-width: 1024px) {
    :root {
        --aj-header-h: 68px;
    }
}

@media (max-width: 768px) {
    :root {
        --aj-header-h: var(--aj-header-h-sm);
        --aj-section-y: clamp(2.25rem, 1.5rem + 4vw, 3.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --aj-duration-fast: 1ms;
        --aj-duration: 1ms;
        --aj-duration-slow: 1ms;
    }
}
