/* ============================================================
   Corpus — app-owned tokens

   Load AFTER tokens.css (canonical) and BEFORE app.css.

   tokens.css is the shared personal-design-system platform and is
   byte-identical across Corpus, exposure_calculator and
   behavioral-informatics — never edit it here. Anything that only means
   something to Corpus lives in this file instead.

   ---- Chart series, keyed to measurement source ----
   These are DATA, not decoration. Sources disagree by a few percent (BIA vs
   tape vs DEXA), so each keeps a fixed, distinguishable hue — a body-fat line
   must never blend methods. That is why they are aliases to the platform's
   categorical hues rather than free choices, and why they are named for the
   SOURCE rather than the color.

   RENPHO is the hero source, so it gets copper. The copper and teal aliases
   automatically brighten in dark mode, because the platform hues they point at
   already do — which is why there is no dark-theme block in this file.
   ============================================================ */

:root {
  --ds-series-manual: var(--ds-series-slate);   /* hand-entered */
  --ds-series-renpho: var(--ds-series-copper);  /* RENPHO / BIA scale — brand hero */
  --ds-series-navy: var(--ds-series-teal);      /* tape / US-Navy estimate */
  --ds-series-dexa: var(--ds-series-red);       /* DEXA ground truth — stands out */
  --ds-series-apple: var(--ds-series-pink);     /* Apple Health */
  --ds-series-google: var(--ds-series-violet);  /* Google Fit */
  /* --ds-series-target is a platform token; targets are a generic concept. */

  /* ---- CGM chart ----
     Glucose reuses the copper hero line; insulin + meals reuse distinct series
     hues so the three overlays never blend. The in-range band is a translucent
     green shade behind the curve — a functional target zone, not decoration, so
     it is its own low-alpha token rather than an alias. */
  --ds-cgm-glucose: var(--ds-series-copper);
  --ds-cgm-insulin: var(--ds-series-teal);
  --ds-cgm-meal: var(--ds-series-violet);
  --ds-cgm-range: rgba(46, 160, 67, 0.12);      /* 70–180 in-range band */

  /* ---- Logging-consistency heatmap ----
     A SEQUENTIAL ramp: one hue, four steps, so the cells read as "more / less"
     rather than as four categories. It is green because the quantity encoded is
     adherence and green is already this app's success semantic -- but it is a
     DATA ramp, not the --ds-success token, which is why it lives here as a
     domain colour rather than in the platform file. Level 0 is the empty-day
     track, so it stays a neutral surface: an unlogged day and a barely-logged
     day have to be distinguishable at a glance.

     Literal hex is permitted in THIS file, and only for domain ramps like this
     one (see the guardrail in STANDARDS.md). The dark values are lifted rather
     than darkened so the ramp keeps four separable steps against --ds-surface
     (#1e293b); scaled-down light values would collapse into the background. */
  --ds-heat-0: var(--ds-surface-alt);
  --ds-heat-1: #bbf7d0;
  --ds-heat-2: #4ade80;
  --ds-heat-3: #16a34a;
}

:root[data-theme="dark"] {
  --ds-heat-1: #14532d;
  --ds-heat-2: #15803d;
  --ds-heat-3: #22c55e;
}

/* Byte-identical to the block above, for the same reason tokens.css duplicates
   its dark block: `prefers-color-scheme` is what applies when the user has not
   chosen a theme, `[data-theme]` is what applies once they have. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ds-heat-1: #14532d;
    --ds-heat-2: #15803d;
    --ds-heat-3: #22c55e;
  }
}
