/* ========================================================================
   Cepha.Material — Geo-Topology Design Tokens
   ------------------------------------------------------------------------
   الطبولوجيا ≡ طبقات الأرض. عمق الموثوقيّة = حرارة اللون.
   Topology ≡ Earth layers. Depth of authority = color temperature.

   ثبات (stability): هذه الجواهر لا تتبدّل بين المنصّات.
   فقط الـripple والخطّ ونصف القطر يتكيّفان عبر flavors/*.
   ======================================================================== */

:root {
  /* === طبقة القشرة · Crust — Browser topology (cool, surface) === */
  --ceph-crust-50:  #E6F7F4;
  --ceph-crust-100: #B8E6DC;
  --ceph-crust-300: #5EC9B5;
  --ceph-crust-500: #2EC4B6;   /* primary */
  --ceph-crust-700: #1E5F74;
  --ceph-crust-900: #0A2E3A;
  --ceph-crust-on:  #FFFFFF;   /* foreground over 500 */

  /* === طبقة الوشاح · Mantle — Hybrid topology (flowing, bridges) === */
  --ceph-mantle-50:  #FDF1E3;
  --ceph-mantle-100: #F8DAB0;
  --ceph-mantle-300: #F4A261;
  --ceph-mantle-500: #E08A3C;  /* primary */
  --ceph-mantle-700: #C97B3C;
  --ceph-mantle-900: #6A3A14;
  --ceph-mantle-on:  #1A0E04;

  /* === طبقة اللبّ · Core — Server topology (deep, authoritative) === */
  --ceph-core-50:  #FBE7E9;
  --ceph-core-100: #F2B8BE;
  --ceph-core-300: #D85A4A;
  --ceph-core-500: #C84B31;    /* primary */
  --ceph-core-700: #8E2A22;
  --ceph-core-900: #3E0E0A;
  --ceph-core-on:  #FFFFFF;

  /* === محايد · Neutral (surface, ink) === */
  --ceph-bg:        #F7F5F0;   /* parchment, geological-map-like */
  --ceph-surface:   #FFFFFF;
  --ceph-surface-2: #FAF7F0;
  --ceph-ink:       #1A1814;
  --ceph-ink-soft:  #5C544A;
  --ceph-line:      #DDD6C7;

  /* === ارتفاع · Elevation (shadow stacks per layer) === */
  --ceph-elev-crust:  0 1px 2px rgba(30,95,116,.12),
                      0 1px 1px rgba(30,95,116,.06);
  --ceph-elev-mantle: 0 4px 10px rgba(201,123,60,.22),
                      0 2px 4px rgba(201,123,60,.14),
                      inset 0 0 0 1px rgba(244,162,97,.20);
  --ceph-elev-core:   0 12px 28px rgba(110,31,47,.32),
                      0 6px 10px rgba(110,31,47,.18),
                      inset 0 0 24px rgba(200,75,49,.10);

  /* === حركة · Motion (per layer authority) === */
  --ceph-motion-crust:  150ms cubic-bezier(.2,0,0,1);   /* surface response */
  --ceph-motion-mantle: 250ms cubic-bezier(.3,0,.1,1);  /* flowing */
  --ceph-motion-core:   350ms cubic-bezier(.4,0,.2,1);  /* deliberate */

  /* === شكل · Shape — base (flavor overrides this) === */
  --ceph-radius-sm: 8px;
  --ceph-radius-md: 14px;
  --ceph-radius-lg: 20px;
  --ceph-radius-btn: 12px;

  /* === خطّ · Type — base (flavor overrides) === */
  --ceph-font: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Naskh Arabic", sans-serif;
  --ceph-font-mono: "JetBrains Mono", "Cascadia Code", ui-monospace, monospace;

  /* === طبقة · Z (logical depth, matches geology) === */
  --ceph-z-crust:  1;
  --ceph-z-mantle: 5;
  --ceph-z-core:   10;
  --ceph-z-overlay: 100;
}

/* ===== الوضع الداكن · Dark mode (parchment → basalt) ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --ceph-bg:        #14110D;
    --ceph-surface:   #1F1B15;
    --ceph-surface-2: #28231B;
    --ceph-ink:       #F2EEE3;
    --ceph-ink-soft:  #B5AC9B;
    --ceph-line:      #3A332A;

    /* اللب أكثر إشعاعاً في الظلام */
    --ceph-elev-core: 0 16px 36px rgba(216,90,74,.40),
                      0 8px 14px rgba(216,90,74,.22),
                      inset 0 0 30px rgba(244,162,97,.14);
  }
}

/* ===== توافر · Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --ceph-motion-crust:  0ms;
    --ceph-motion-mantle: 0ms;
    --ceph-motion-core:   0ms;
  }
}
