/* adia:semantic/color — categorical data-visualization palette.
   The 10 --a-data-0..9 series colors + their @property tuning knobs.
   Split out of semantics.css (v0.6.48 reorg, ADR-0035). The @property
   registrations are global, so relocating them here is cascade-inert. */

/* ─── Data palette parameterization ───
   All 10 slots live in an analogous arc centered on --a-accent-hue,
   fanning out in alternating cool/warm pairs with a uniform step
   (--a-data-delta). Slot 0 is the anchor (accent hue). Slots 1-8 are
   symmetric pairs at ±1, ±2, ±3, ±4 × delta; slot 9 extends one more
   step on the warm side (+5 × delta).

   Offsets from --a-accent-hue:
     0: 0     1: −1Δ   2: +1Δ   3: −2Δ   4: +2Δ
     5: −3Δ   6: +3Δ   7: −4Δ   8: +4Δ   9: +5Δ

   Two axes of differentiation — hue (via delta) AND lightness (via a
   3-phase rotation keyed on N mod 3). Under CVD (deuteranopia/protanopia)
   the red-green axis collapses and same-L neighbors in the green-teal
   zone would converge; the L rotation rescues them by ensuring any three
   consecutive slots have three different L values.

   Tuning knobs:
     --a-data-delta     : hue step between consecutive pairs (default 22)
     --a-data-l-spread  : ±L offset for phases 1 and 2 (default 0.07)
     --a-data-l-light   : base L for phase-0 slots in light mode
     --a-data-l-dark    : base L for phase-0 slots in dark mode
     --a-data-c         : uniform chroma across all slots
     --a-data-N-hue     : pin an individual slot's hue absolutely

   At default accent=225, delta=22: slot 7 lands at 137 (8° from success
   hue 145) and slot 2 at 247 (3° from info hue 250). The L rotation
   places slot 2 in phase 2 (deeper) and slot 7 in phase 1 (lighter),
   so neither reads as its respective status token. */
@property --a-data-l-light  { syntax: "<number>"; inherits: true; initial-value: 0.55; }
@property --a-data-l-dark   { syntax: "<number>"; inherits: true; initial-value: 0.72; }
@property --a-data-l-spread { syntax: "<number>"; inherits: true; initial-value: 0.10; }
@property --a-data-c        { syntax: "<number>"; inherits: true; initial-value: 0.16; }
@property --a-data-delta    { syntax: "<number>"; inherits: true; initial-value: 22;   }
@property --a-data-0-hue    { syntax: "<number>"; inherits: true; initial-value: 225; }
@property --a-data-1-hue    { syntax: "<number>"; inherits: true; initial-value: 203; }
@property --a-data-2-hue    { syntax: "<number>"; inherits: true; initial-value: 247; }
@property --a-data-3-hue    { syntax: "<number>"; inherits: true; initial-value: 181; }
@property --a-data-4-hue    { syntax: "<number>"; inherits: true; initial-value: 269; }
@property --a-data-5-hue    { syntax: "<number>"; inherits: true; initial-value: 159; }
@property --a-data-6-hue    { syntax: "<number>"; inherits: true; initial-value: 291; }
@property --a-data-7-hue    { syntax: "<number>"; inherits: true; initial-value: 137; }
@property --a-data-8-hue    { syntax: "<number>"; inherits: true; initial-value: 313; }
@property --a-data-9-hue    { syntax: "<number>"; inherits: true; initial-value: 335; }

:root, theme-ui, [data-theme] {
  /* ══════════════════════════════════════════════════════════════
     DATA PALETTE — 10 categorical series colors for charts

     All 10 slots are computed as offsets from --a-accent-hue via a
     single --a-data-delta step, so retuning accent or delta shifts the
     whole palette coherently. Slot 0 is the anchor (accent hue); slots
     1-8 alternate cool/warm at ±1..±4 × delta; slot 9 extends to +5Δ.

     Override --a-data-l-light / --a-data-l-dark / --a-data-c to retune
     the palette's tone, --a-data-delta to squeeze or spread the arc,
     or any --a-data-N-hue to pin an individual slot.
     ══════════════════════════════════════════════════════════════ */

  --a-data-0-hue: var(--a-accent-hue);
  --a-data-1-hue: calc(var(--a-accent-hue) - var(--a-data-delta) * 1);
  --a-data-2-hue: calc(var(--a-accent-hue) + var(--a-data-delta) * 1);
  --a-data-3-hue: calc(var(--a-accent-hue) - var(--a-data-delta) * 2);
  --a-data-4-hue: calc(var(--a-accent-hue) + var(--a-data-delta) * 2);
  --a-data-5-hue: calc(var(--a-accent-hue) - var(--a-data-delta) * 3);
  --a-data-6-hue: calc(var(--a-accent-hue) + var(--a-data-delta) * 3);
  --a-data-7-hue: calc(var(--a-accent-hue) - var(--a-data-delta) * 4);
  --a-data-8-hue: calc(var(--a-accent-hue) + var(--a-data-delta) * 4);
  --a-data-9-hue: calc(var(--a-accent-hue) + var(--a-data-delta) * 5);

  /* Three L phases — each slot's phase is (N mod 3). Two consecutive
     slots always differ in both hue AND lightness, and any three
     consecutive slots span all three L values, so no CVD-collapse
     pocket of same-L slots exists in the green-teal confusion zone. */
  --_data-l-light-0: var(--a-data-l-light);
  --_data-l-light-1: calc(var(--a-data-l-light) + var(--a-data-l-spread));
  --_data-l-light-2: calc(var(--a-data-l-light) - var(--a-data-l-spread));
  --_data-l-dark-0:  var(--a-data-l-dark);
  --_data-l-dark-1:  calc(var(--a-data-l-dark) + var(--a-data-l-spread));
  --_data-l-dark-2:  calc(var(--a-data-l-dark) - var(--a-data-l-spread));

  /* slot N uses L-phase (N mod 3): 0/3/6/9 → phase 0; 1/4/7 → phase 1; 2/5/8 → phase 2 */
  --a-data-0: light-dark(
    oklch(var(--_data-l-light-0) var(--a-data-c) var(--a-data-0-hue)),
    oklch(var(--_data-l-dark-0)  var(--a-data-c) var(--a-data-0-hue))
  );
  --a-data-1: light-dark(
    oklch(var(--_data-l-light-1) var(--a-data-c) var(--a-data-1-hue)),
    oklch(var(--_data-l-dark-1)  var(--a-data-c) var(--a-data-1-hue))
  );
  --a-data-2: light-dark(
    oklch(var(--_data-l-light-2) var(--a-data-c) var(--a-data-2-hue)),
    oklch(var(--_data-l-dark-2)  var(--a-data-c) var(--a-data-2-hue))
  );
  --a-data-3: light-dark(
    oklch(var(--_data-l-light-0) var(--a-data-c) var(--a-data-3-hue)),
    oklch(var(--_data-l-dark-0)  var(--a-data-c) var(--a-data-3-hue))
  );
  --a-data-4: light-dark(
    oklch(var(--_data-l-light-1) var(--a-data-c) var(--a-data-4-hue)),
    oklch(var(--_data-l-dark-1)  var(--a-data-c) var(--a-data-4-hue))
  );
  --a-data-5: light-dark(
    oklch(var(--_data-l-light-2) var(--a-data-c) var(--a-data-5-hue)),
    oklch(var(--_data-l-dark-2)  var(--a-data-c) var(--a-data-5-hue))
  );
  --a-data-6: light-dark(
    oklch(var(--_data-l-light-0) var(--a-data-c) var(--a-data-6-hue)),
    oklch(var(--_data-l-dark-0)  var(--a-data-c) var(--a-data-6-hue))
  );
  --a-data-7: light-dark(
    oklch(var(--_data-l-light-1) var(--a-data-c) var(--a-data-7-hue)),
    oklch(var(--_data-l-dark-1)  var(--a-data-c) var(--a-data-7-hue))
  );
  --a-data-8: light-dark(
    oklch(var(--_data-l-light-2) var(--a-data-c) var(--a-data-8-hue)),
    oklch(var(--_data-l-dark-2)  var(--a-data-c) var(--a-data-8-hue))
  );
  --a-data-9: light-dark(
    oklch(var(--_data-l-light-0) var(--a-data-c) var(--a-data-9-hue)),
    oklch(var(--_data-l-dark-0)  var(--a-data-c) var(--a-data-9-hue))
  );

}
