/*
 * Mamore UI v2 — DARK theme.
 *
 * A command-centre aesthetic, NOT an inversion and NOT #000.
 *
 * Depth is built from FOUR distinct surface luminance levels plus illuminated
 * borders, because a drop shadow is nearly invisible on a dark surface. The
 * background is a deep navy-black (#070E1B) that keeps the brand hue present
 * instead of flattening to neutral grey-black.
 *
 * Gold is dimmed here (#E0A21F). Full-strength #FEAA03 vibrates against navy
 * and fails contrast as a text colour; the dimmed value keeps the identity
 * without the shimmer.
 *
 * The selector is `[data-theme="dark"]` and deliberately NOT a bare `:root`.
 * See the note in themes/light.css: a bare `:root` in both theme files would
 * make load order decide the theme instead of the user's preference.
 */

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

  /* ------------------------------------------------------------ surfaces */
  --bg-app: #070E1B;              /* deep navy-black, deliberately not #000 */
  --surface-1: #0C1526;           /* panels */
  --surface-2: #111C31;           /* cards, tables */
  --surface-3: #17253E;           /* raised, hovered, active rows */
  --surface-raised: #141F35;      /* popovers, dropdowns, drawers */
  --surface-sunken: #0A1220;      /* wells, skeletons */
  --surface-nav: #0A1424;         /* sidebar */
  --surface-nav-2: #101C31;       /* active nav well */
  --surface-topbar: #0C1526;

  /* ---------------------------------------------------------------- text */
  --text-primary: #EAF0FA;
  --text-secondary: #A9BAD6;
  --text-muted: #7186A8;
  /*
   * --text-inverse means "text sitting on a saturated brand fill". Those fills
   * are dark in BOTH themes -- the light-mode sidebar is navy #012F6C and the
   * dark-mode sidebar is #0A1424 -- so inverse text must stay light in both.
   * Defining it as dark ink here was a real bug: it made sidebar text
   * invisible in dark mode (1.06:1, caught by tests/contrast-test.php).
   */
  --text-inverse: #EAF0FA;
  --text-on-accent: #0B1A2E;
  --text-link: #8FB6F0;

  /* -------------------------------------------------------------- borders */
  /* "Illuminated": a faint cool tint rather than grey, so borders read as
     light catching an edge instead of as an absence of light. */
  --border-subtle: rgba(148, 180, 230, 0.08);
  --border-default: rgba(148, 180, 230, 0.14);
  --border-strong: rgba(148, 180, 230, 0.26);
  /* A border that IDENTIFY an interactive control must clear WCAG 1.4.11 at
     3:1 against the surface it sits on. Measured over --surface-1 (#111C31):
     0.34 -> 2.08, 0.50 -> 3.01, 0.58 -> 3.59. 0.58 is used so the boundary
     clears the bar with a little headroom rather than landing on it. */
  --border-control: rgba(148, 180, 230, 0.58);
  --border-focus: #6FA0F0;
  --border-nav: rgba(148, 180, 230, 0.10);
  --border-nav-strong: rgba(148, 180, 230, 0.55);

  /* ------------------------------------------------------------- shadows */
  /* On dark surfaces elevation comes primarily from surface luminance, so the
     shadows stay deep and tight rather than soft and grey. */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.46);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.54);
  --shadow-overlay: 0 28px 70px rgba(0, 0, 0, 0.66);

  /* ----------------------------------------------------- status (dark) */
  --tone-success: #4ADE9B;
  --tone-warning: #F5B942;
  --tone-danger: #FF8078;
  --tone-info: #6FA8F5;
  --tone-neutral: #8FA3C0;
  --tone-success-bg: rgba(74, 222, 155, 0.12);
  --tone-warning-bg: rgba(245, 185, 66, 0.12);
  --tone-danger-bg: rgba(255, 128, 120, 0.12);
  --tone-info-bg: rgba(111, 168, 245, 0.12);
  --tone-neutral-bg: rgba(143, 163, 192, 0.12);

  /* ---------------------------------------------------- brand adjustments */
  /* The dimmed gold keeps the identity without shimmering against navy. */
  --brand-accent: #E0A21F;
  --brand-accent-hover: #F0B233;
  --brand-accent-soft: rgba(224, 162, 31, 0.14);
  --brand-gold-ring: rgba(224, 162, 31, 0.40);
  --brand-gold-text: #F0B233;
  --brand-navy-ring: rgba(143, 182, 240, 0.18);
  --brand-navy-veil: rgba(143, 182, 240, 0.06);

  /* --------------------------------------------------- charts (dark) */
  /* Rich presentation: lighter, more saturated series than the light theme so
     they separate clearly from a dark grid. */
  --chart-1: #4F8DEE;
  --chart-2: #E0A21F;
  --chart-3: #6FA8F5;
  --chart-4: #8FA3C0;
  --chart-5: #4ADE9B;
  --chart-6: #FF8078;
  --chart-grid: rgba(148, 180, 230, 0.10);
  --chart-axis: #7186A8;

  /* ------------------------------------------------------------ skeleton */
  --skeleton-base: #131F33;
  --skeleton-sheen: #1C2B45;
}
