/* =====================================================================
   QdesignSkill — flavour: ORBIT  (editorial · product · command center)
   From Orbit: "Atelier" ivory paper with ink-indigo and brass, "Nebula" cosmic glass with
   violet → cyan light, Instrument Serif headlines with an italic gradient phrase, glass orbs.
   Load order: base.css → flavor-orbit.css → components.css
   Theme: <html data-theme="light|dark">. No attribute = light.
   Every ratio quoted is WCAG contrast, checked with scripts/contrast-check.mjs.
   ===================================================================== */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* ---- Canvas: warm paper, never pure white ---- */
  --bg: #f6f4ee;
  --bg-2: #efebe1;
  --aurora-1: rgba(168, 123, 50, 0.2);   /* top-left glow (brand-2) */
  --aurora-2: rgba(58, 51, 196, 0.13);   /* top-right glow (brand) */
  --grain: 0.07;                          /* film-grain overlay opacity */

  /* ---- Surfaces ---- */
  --surface: #ffffff;                     /* cards */
  --surface-2: #faf8f3;                   /* table heads, footers, quiet fills */
  --surface-3: #f1ede4;                   /* hover fills, segmented track, chips */
  --surface-solid: #ffffff;               /* popovers, sheets: always opaque */
  --glass: rgba(255, 255, 255, 0.74);     /* sticky bars, sidebars, floating labels */
  --glass-strong: rgba(255, 255, 255, 0.9);

  /* ---- Lines ---- */
  --line: #e4ded0;                        /* hairlines, card borders */
  --line-2: #d3cbb8;                      /* stronger decorative dividers */
  --field-line: #948c79;                  /* form controls only: 3.34:1 on white (WCAG 1.4.11) */

  /* ---- Ink ---- */
  --fg: #16161d;
  --fg-muted: #5f5f6b;                    /* 5.7:1 on canvas */
  --fg-faint: #6f6c78;                    /* 4.67:1 on canvas — the lightest text allowed */
  --fg-inverse: #ffffff;

  /* ---- BRAND (swap this block per product) ---- */
  --brand: #3a33c4;                       /* ink indigo: links, focus, active, icons */
  --brand-strong: #2c269e;
  --brand-2: #a87b32;                     /* brass: large text, icons, gradients only (3.4:1) */
  --brand-soft: rgba(58, 51, 196, 0.08);  /* selected rows, accent chips */
  --brand-glow: rgba(58, 51, 196, 0.14);  /* halos, spotlight, selection */
  --brand-ink: #ffffff;                   /* text on solid brand */
  --grad: linear-gradient(115deg, #3a33c4 0%, #6b46c9 46%, #a87b32 100%);
  --grad-cta: linear-gradient(115deg, #3a33c4 0%, #6b46c9 50%, #8a5a12 100%); /* darkened end keeps white text ≥ 5.9:1 */
  --grad-text: var(--grad);               /* headline phrases: every stop ≥ 3:1 (large text) on the canvas */
  --cta-glow: rgba(58, 51, 196, 0.34);
  --avatar-grad: linear-gradient(135deg, #8a5a12, #5b3bb5);

  /* ---- Section accents: decorative halos/chips/bars only, never text ---- */
  --accent-brand: #3a33c4;
  --accent-brass: #b8862f;
  --accent-cyan: #1f8fa8;
  --accent-good: #1b8a62;
  --accent-rose: #b5487d;

  /* ---- Status: text-safe ink, vivid fill (dots, bars, meters), soft wash ---- */
  --good: #0f7350;    --good-fill: #1f9e6e;    --good-soft: rgba(15, 115, 80, 0.1);
  --warn: #935700;    --warn-fill: #e0a020;    --warn-soft: rgba(147, 87, 0, 0.11);
  --serious: #a2451f; --serious-fill: #e0784f; --serious-soft: rgba(162, 69, 31, 0.1);
  --bad: #b02a40;     --bad-fill: #d03b3b;     --bad-soft: rgba(176, 42, 64, 0.1);
  --neutral: #5f5f6b; --neutral-fill: #9aa1ab; --neutral-soft: color-mix(in srgb, var(--fg) 6%, transparent);

  /* ---- Categories (stages, types, domains): text-safe on their 12% wash. Colour by category, never by name. ---- */
  --cat-neutral: #64616d; --cat-violet: #6b46c9; --cat-blue: #1f63b8; --cat-amber: #925600; --cat-magenta: #a3307f; --cat-green: #0f7350;

  /* ---- Data viz ---- */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --chart-grid: #e6e1d5;
  --chart-axis: #c9c2b2;
  --chart-label: #6f6c78;

  /* ---- Decorative orb palette (product / entity colours) ---- */
  --orb-1: #5b4fe0; --orb-2: #1f9e8f; --orb-3: #e0784f; --orb-4: #3f7fe0; --orb-5: #c99434; --orb-6: #c4527f;

  /* ---- Depth: hairline + long, soft, warm-tinted drop ---- */
  --elev-xs: 0 1px 2px rgba(22, 22, 29, 0.05);
  --elev-sm: 0 1px 2px rgba(22, 22, 29, 0.04), 0 4px 12px rgba(70, 52, 20, 0.06);
  --elev-md: 0 2px 6px rgba(22, 22, 29, 0.04), 0 12px 32px rgba(70, 52, 20, 0.1);
  --elev-lg: 0 1px 0 rgba(22, 22, 29, 0.04), 0 24px 60px -28px rgba(70, 52, 20, 0.35);
  --elev-xl: 0 2px 0 rgba(22, 22, 29, 0.03), 0 60px 120px -50px rgba(60, 44, 16, 0.45);

  /* ---- Interaction fills ---- */
  --row-hover: color-mix(in srgb, var(--fg) 3.5%, transparent);
  --row-selected: color-mix(in srgb, var(--brand) 7%, transparent);
  --skeleton: color-mix(in srgb, var(--fg) 6%, transparent);
  --ring: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent);
  --scrim: rgba(12, 12, 20, 0.45);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #07080f;
  --bg-2: #0b0d19;
  --aurora-1: rgba(147, 132, 255, 0.26);
  --aurora-2: rgba(59, 213, 240, 0.15);
  --grain: 0.05;

  /* Dark surfaces are translucent white over the canvas (glass), not grey paint. */
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.08);
  --surface-solid: #0e1022;
  --glass: rgba(13, 15, 30, 0.6);
  --glass-strong: rgba(13, 15, 30, 0.88);

  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --field-line: rgba(255, 255, 255, 0.36);

  --fg: #ecedf6;
  --fg-muted: #9095b2;
  --fg-faint: #7d82a3;
  --fg-inverse: #07080f;

  /* BRAND — dark twin: lighter, more luminous; gradient turns violet → cyan */
  --brand: #9384ff;
  --brand-strong: #b4a8ff;
  --brand-2: #3bd5f0;
  --brand-soft: rgba(147, 132, 255, 0.13);
  --brand-glow: rgba(147, 132, 255, 0.28);
  --brand-ink: #07080f;                   /* dark text on the light gradient: 6.6:1 */
  --grad: linear-gradient(115deg, #9384ff 0%, #6fa2ff 50%, #3bd5f0 100%);
  --grad-cta: var(--grad);
  --cta-glow: rgba(147, 132, 255, 0.45);
  --avatar-grad: linear-gradient(135deg, #6b5bff, #1f9fc0);

  --accent-brand: #9384ff;
  --accent-brass: #f5b84b;
  --accent-cyan: #3bd5f0;
  --accent-good: #3dd9a0;
  --accent-rose: #ff7ab6;

  --good: #3dd9a0;    --good-fill: #3dd9a0;    --good-soft: rgba(61, 217, 160, 0.12);
  --warn: #f5b84b;    --warn-fill: #f5b84b;    --warn-soft: rgba(245, 184, 75, 0.12);
  --serious: #ff9f7a; --serious-fill: #ff8a5b; --serious-soft: rgba(255, 138, 91, 0.13);
  --bad: #ff6b7a;     --bad-fill: #ff6b7a;     --bad-soft: rgba(255, 107, 122, 0.12);
  --neutral: #9095b2; --neutral-fill: #7d82a3; --neutral-soft: rgba(255, 255, 255, 0.06);

  --cat-neutral: #a0a5c2; --cat-violet: #b4a8ff; --cat-blue: #74b6ff; --cat-amber: #f5b84b; --cat-magenta: #ff92d2; --cat-green: #3dd9a0;

  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #2fa84f; --series-7: #9085e9; --series-8: #e66767;
  --chart-grid: rgba(255, 255, 255, 0.07);
  --chart-axis: rgba(255, 255, 255, 0.16);
  --chart-label: #8a8fae;

  --orb-1: #9384ff; --orb-2: #2ec4b6; --orb-3: #ff8a5b; --orb-4: #4d9bff; --orb-5: #f5b84b; --orb-6: #ff7ab6;

  /* Dark depth = a 1px inner light edge + a deep drop (+ a brand bloom on the biggest one). */
  --elev-xs: 0 0 0 1px rgba(255, 255, 255, 0.03);
  --elev-sm: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 4px 12px rgba(0, 0, 0, 0.35);
  --elev-md: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 12px 32px rgba(0, 0, 0, 0.45);
  --elev-lg: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  --elev-xl: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 80px 140px -50px rgba(0, 0, 0, 0.95), 0 0 120px -40px rgba(147, 132, 255, 0.35);

  --row-hover: rgba(255, 255, 255, 0.035);
  --row-selected: rgba(147, 132, 255, 0.1);
  --skeleton: rgba(255, 255, 255, 0.06);
  --scrim: rgba(2, 3, 8, 0.6);
}

/* ---------- Flavour scales ---------- */
:root {
  /* Editorial voice: a serif display face at 400 with an italic gradient flourish. */
  --type-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --type-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --type-mono: "Geist Mono", ui-monospace, "Cascadia Mono", "IBM Plex Sans Arabic", monospace;
  --type-ar: "IBM Plex Sans Arabic", "Geist", system-ui, sans-serif;
  --display-weight: 400;
  --display-tracking: -0.02em;
  --display-leading: 0.96;
  --grad-text-style: italic;

  --sidebar-w: 248px;
  --topbar-h: 64px;
  --page-max: 1400px;
}
