/* Adaad design tokens: the one source of colour, shadow and surface for
   every screen. The phone app (mobile/index.html), the landing page
   (site/index.html) and the desktop dashboard (app/theme.py reads this
   file at start-up) all take their palette from here (style campaign,
   2026-10-31). Ink values are the ones the 2026-08-30 contrast audit set:
   every text colour clears 4.5:1 on every surface it sits on. Change a
   colour here, never in a page. */

/* ---------- THEME TOKENS (light is default) ---------- */
:root, :root[data-theme="light"] {
  --bg-base:     #faf6f1;   /* warm cream */
  --bg-elev:     #ffffff;   /* card surface */
  --bg-elev-2:   #f0eae2;   /* hover / highest elevation */
  --text-base:   #2a2521;   /* warm near-black */
  --text-muted:  #5f544d;   /* warm taupe */
  --text-dim:    #75685d;   /* de-emphasized captions — darkened for WCAG AA (4.5:1+) */
  --accent:      #8e612a;   /* Thmanyah bronze — darkened a step for AA small-text */
  --accent-dim:  #7d5523;
  --emerald:     #127353;   /* second accent: education / progress / confirmation */
  --emerald-dim: #0e5f44;
  --gold:        #87642a;
  --success:     #447542;
  --warn:        #87642a;
  --bad:         #b94234;
  --coral:       #d94531;
  --forest:      #3f6b3d;
  --smart:       #6e4d2f;
  --attn:        #955e00;
  --border-warm: rgba(58, 50, 44, 0.10);
  /* Two-level elevation system: level 1 = resting card (very soft warm),
     level 2 = hover/focus. No heavier material shadows anywhere. */
  --shadow-card: 0 1px 2px rgba(60, 40, 20, 0.05), 0 1px 1px rgba(60, 40, 20, 0.04);
  --shadow-card-hover: 0 4px 14px rgba(60, 40, 20, 0.08), 0 1px 2px rgba(60, 40, 20, 0.05);
  --shadow-sticky: 0 2px 10px rgba(60, 40, 20, 0.05);
  /* Production-vs-context temperature: 0%-weight context surfaces cool down
     to a desaturated slate/stone so temperature itself teaches what ranks. */
  --ctx-bg:     #eff0ee;
  --ctx-border: rgba(70, 78, 80, 0.17);
  --ctx-ink:    #555e62;
  --card-gradient: linear-gradient(180deg, #ffffff 0%, #fbf7f2 100%);
  --card-radial: radial-gradient(120% 80% at 0% 0%, rgba(156, 107, 46, 0.04) 0%, transparent 60%);
  --bg-inset:      #f6f0e8;
  --track:         #ece3d8;
  --border-warm-2: rgba(58, 50, 44, 0.18);
  --shadow-pop:    0 12px 40px rgba(58, 50, 44, 0.18);
  /* Score parts (palette A, chosen by the owner 2026-10-31; contrast- and
     colour-blind-checked with the dataviz validator, all pairs). A fill for
     bars and markers, and an ink for the part's name. Text values stay in
     the normal ink. */
  --c-quality:     #0e8a66;  --c-quality-ink:  #0b6e52;
  --c-value:       #8b4a8f;  --c-value-ink:    #6e3a72;
  --c-momentum:    #c9652a;  --c-momentum-ink: #9c4a1c;
  /* Areas of the app: headings and washes take the area's colour. */
  --area-learn:    #127353;
  --area-research: #8e612a;
  --area-sharia:   #1d7a72;
  --area-alerts:   #b94a3a;
  /* Sector tints for ticker badges and sector chips (always beside the
     sector's name, never colour alone). */
  --sec-technology:  #6b5ca5;
  --sec-industrials: #6d6a5e;
  --sec-healthcare:  #2f8a82;
  --sec-cyclical:    #b9553f;
  --sec-materials:   #94752f;
  --sec-defensive:   #6a8536;
  --sec-communication: #a84f78;
  --sec-energy:      #b9801c;
  --sec-realestate:  #85664d;
  --sec-utilities:   #4f7a9e;
  --sec-other:       #7a7068;
  /* The landing page's star pattern, as a mask shape (pattern-wash). */
  --pattern-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M32 6l7.4 18.6L58 32l-18.6 7.4L32 58l-7.4-18.6L6 32l18.6-7.4z'/%3E%3Crect x='17' y='17' width='30' height='30' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  --pattern-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M32 6l7.4 18.6L58 32l-18.6 7.4L32 58l-7.4-18.6L6 32l18.6-7.4z'/%3E%3Crect x='17' y='17' width='30' height='30' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
  --bg-base:     #1a1614;
  --bg-elev:     #25201d;
  --bg-elev-2:   #322c28;
  --text-base:   #f5ede4;
  --text-muted:  #b3a89e;
  --text-dim:    #9b928a;   /* lightened for WCAG AA on dark surfaces */
  --accent:      #c08a3e;
  --accent-dim:  #9c6b2e;
  --emerald:     #41a47e;
  --emerald-dim: #2e8563;
  --gold:        #c89c40;
  --success:     #6ba368;
  --warn:        #c89c40;
  --bad:         #d8796d;   /* brightened for AA small-text on elevated surfaces */
  --coral:       #e0654f;
  --forest:      #5a8a58;
  --smart:       #c4a079;
  --attn:        #d49a3a;
  --border-warm: rgba(245, 237, 228, 0.11);
  --border-warm-2: rgba(245, 237, 228, 0.20);
  --shadow-card: 0 1px 0 rgba(245, 237, 228, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 1px 0 rgba(245, 237, 228, 0.04) inset, 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-sticky: 0 2px 10px rgba(0, 0, 0, 0.35);
  --ctx-bg:     #222524;
  --ctx-border: rgba(206, 218, 219, 0.14);
  --ctx-ink:    #a9b3b0;
  --card-gradient: linear-gradient(180deg, #2a2521 0%, #221d1a 100%);
  --card-radial: radial-gradient(120% 80% at 0% 0%, rgba(156, 107, 46, 0.04) 0%, transparent 60%);
  --bg-inset:      #201b18;
  --track:         #322c28;
  --shadow-pop:    0 16px 48px rgba(0, 0, 0, 0.5);
  --c-quality:     #239b75;  --c-quality-ink:  #5fc9a1;
  --c-value:       #ad75b2;  --c-value-ink:    #d4a8d8;
  --c-momentum:    #d47838;  --c-momentum-ink: #eba06c;
  --area-learn:    #41a47e;
  --area-research: #c08a3e;
  --area-sharia:   #3fae9e;
  --area-alerts:   #e57a68;
  --sec-technology:  #9b8ee0;
  --sec-industrials: #a8a496;
  --sec-healthcare:  #57b8ad;
  --sec-cyclical:    #e58a72;
  --sec-materials:   #c9a55a;
  --sec-defensive:   #9cbb62;
  --sec-communication: #d987ad;
  --sec-energy:      #e0aa4a;
  --sec-realestate:  #b8977c;
  --sec-utilities:   #83abd0;
  --sec-other:       #a89c91;
}
