/* ═══════════════════════════════════════════════════════════════
   مفضلاتي — الطبقة 1: التوكنز
   القيم الخام ← التوكنز الدلالية ← الثيم الداكن ← المقاييس
   لا يُكتب هنا أي مُحدِّد (selector): هذا الملف بيانات لا أنماط.
   يجب أن يُحمَّل أولاً: هو من يعلن ترتيب الطبقات.
   ═══════════════════════════════════════════════════════════════ */

@layer tokens, base, layout, components, utilities;

:root {
    color-scheme: light;

    /* ── الأسطح ───────────────────────────────────────────────── */
    --bg: #f5f4f1;
    --surface: #fffefc;
    --surface-sunken: #edebe6;
    --surface-hover: #faf9f6;

    /* ── الحدود ───────────────────────────────────────────────── */
    --border: #e3e0d9;
    --border-strong: #cbc6bc;

    /* ── النص ─────────────────────────────────────────────────── */
    --text: #1a1917;
    --text-mute: #66615a;
    --text-faint: #8f8a81;

    /* ── التفاعل: الأزرق للتركيز والروابط فقط ─────────────────── */
    --accent: #2f5fe0;
    --accent-hover: #2449b4;
    --accent-soft: rgba(47, 95, 224, 0.09);
    --accent-ink: #1b3a8f;

    /* ── الحبر: الزر الأساسي ──────────────────────────────────── */
    --solid: #1a1917;
    --solid-hover: #000000;
    --on-solid: #fffefc;

    /* ── الدلالات ─────────────────────────────────────────────── */
    --danger: #c02626;
    --danger-soft: rgba(192, 38, 38, 0.09);
    --success: #10794f;
    --success-soft: rgba(16, 121, 79, 0.1);
    --warning: #9a5b06;
    --warning-soft: rgba(154, 91, 6, 0.1);

    /* ── الظلال ───────────────────────────────────────────────── */
    --sh-1: 0 1px 2px rgba(26, 25, 23, 0.05);
    --sh-2: 0 2px 4px -1px rgba(26, 25, 23, 0.06), 0 8px 20px -8px rgba(26, 25, 23, 0.14);
    --sh-3: 0 24px 56px -16px rgba(26, 25, 23, 0.28);

    /* ── المسافات (مقياس 4px) ─────────────────────────────────── */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.5rem;
    --s-6: 2rem;
    --s-7: 3rem;

    /* ── الاستدارة ────────────────────────────────────────────── */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-full: 999px;

    /* ── الحركة ───────────────────────────────────────────────── */
    --d-1: 110ms;
    --d-2: 190ms;
    --d-3: 320ms;
    --ease: cubic-bezier(0.2, 0.7, 0.3, 1);

    /* ── الطباعة ──────────────────────────────────────────────── */
    --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
    --fs-xs: 0.75rem;
    --fs-sm: 0.8125rem;
    --fs-base: 0.9375rem;
    --fs-md: 1.0625rem;
    --fs-lg: 1.375rem;
    --fs-xl: 1.75rem;
    --lh-body: 1.75;
    --lh-tight: 1.35;

    /* ── القياسات ─────────────────────────────────────────────── */
    --shell: 1180px;
    --rail: 236px;
}

/* ── الثيم الداكن: انعكاس كامل، لا مجرد تعتيم ─────────────────── */
html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #121114;
    --surface: #1a191d;
    --surface-sunken: #0d0c0f;
    --surface-hover: #212027;

    --border: #2b2930;
    --border-strong: #3d3a44;

    --text: #ece9e4;
    --text-mute: #a49e96;
    --text-faint: #7a756e;

    --accent: #7f9cff;
    --accent-hover: #9db2ff;
    --accent-soft: rgba(127, 156, 255, 0.13);
    --accent-ink: #b8c7ff;

    --solid: #ece9e4;
    --solid-hover: #ffffff;
    --on-solid: #121114;

    --danger: #ff8b8b;
    --danger-soft: rgba(255, 139, 139, 0.12);
    --success: #5fd3a0;
    --success-soft: rgba(95, 211, 160, 0.12);
    --warning: #f0b866;
    --warning-soft: rgba(240, 184, 102, 0.12);

    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --sh-2: 0 2px 6px -1px rgba(0, 0, 0, 0.5), 0 12px 28px -12px rgba(0, 0, 0, 0.6);
    --sh-3: 0 28px 64px -20px rgba(0, 0, 0, 0.8);
}
