/* Caldrin — colour.
   Three layers, and they never trade jobs.

   1. CANVAS + INK. A cream page, black ink, a hairline. Every text colour lives here.
   2. THE MARK. One highlighter yellow. It marks a primary action, an active tab or
      chip, the subject series in a chart, the client row, and the highlight behind
      cited text in a verbatim excerpt. Five jobs. It is always a fill, never type —
      which is the brand device (a citation is a highlight) and the reason it cannot
      fail contrast.
   3. CONTAINERS. Six hues, each with a tint and a solid. They colour figure frames,
      panel grounds behind a screenshot or render, and quote cards. They are never
      actions, never type, and — the rule that keeps the numbers honest —
      A CONTAINER HUE MAY NEVER APPEAR INSIDE A CHART. Series are ink values
      plus the mark. Colour identifies containers; value identifies data. */
:root{
  /* ── canvas + ink ── */
  --canvas:#FEFDFB;
  --surface:#F4F3F0;
  --white:#FFFFFF;
  --ink:#0F0E0C;
  --ink-2:#55534E;
  /* Clears WCAG AA at label size on every light container tint as well as the
     canvas. Keep this as the quietest text step; lighter values are decorative
     only, never copy. */
  --ink-3:#68645D;
  --hairline:#D9D5CE;
  --night:#141311;

  /* ── the mark ── */
  --mark:#F2E651;
  --mark-deep:#DCCB1A;
  --mark-soft:#FBF7C9;

  /* ── containers: tint (panel grounds, figure frames) ── */
  --tint-lime:#EDF9C4;
  --tint-blue:#DDEAFF;
  --tint-coral:#FFE0D2;
  --tint-violet:#E6DEFF;
  --tint-cyan:#D5F1F6;
  --tint-pink:#FFDCED;

  /* ── containers: solid (quote cards, frame rails, badges) ── */
  --solid-lime:#C3E534;
  --solid-blue:#2F6BEF;
  --solid-coral:#F2622A;
  --solid-violet:#7C5CF0;
  --solid-cyan:#2FAFC4;
  --solid-pink:#EC5AA0;

  /* ── section bands: the palest step, for partitioning a long scroll ── */
  --band-sand:#F7F2E7;
  --band-blue:#EEF3FF;
  --band-blush:#FFF1EC;
  --band-mint:#EAF6EF;

  /* ── semantic: surface ── */
  --surface-page:var(--canvas);
  --surface-raised:var(--white);
  --surface-sunken:var(--surface);
  --surface-band:var(--band-sand);
  --surface-night:var(--night);

  /* ── semantic: text ── */
  --fg-title:var(--ink);
  --fg-body:var(--ink-2);
  --fg-muted:var(--ink-3);
  /* --fg-muted is calibrated on the canvas. On a tint, band or sunken ground it
     drops below AA, so source lines and notes on those grounds use this step. */
  --fg-muted-on-tint:rgba(15,14,12,.70);
  /* LITERAL and theme-invariant, for the same reason as the on-solid pairs below:
     the mark is a highlighter and stays yellow in both modes, so the ink that
     sits on it must not follow --ink into night. */
  --fg-on-mark:#0F0E0C;
  --fg-on-ink:var(--canvas);
  --fg-on-solid:#FFFFFF;
  /* white fails on four of the six solids; ink clears them. One pair per hue,
     so a consumer picking any container hue gets a legal text colour. */
  /* LITERAL, and never redefined in a theme scope: the container solids are
     theme-invariant, so the text that sits on them must be too. An alias of
     --ink or --white would flip in night mode and invert the pairing. */
  --fg-on-lime:#0F0E0C;
  --fg-on-coral:#0F0E0C;
  --fg-on-cyan:#0F0E0C;
  --fg-on-pink:#0F0E0C;
  --fg-on-blue:#FFFFFF;
  --fg-on-violet:#FFFFFF;
  /* There is no quiet step on a saturated solid — it has no headroom at label
     sizes. Secondary text on a solid runs at full strength and takes its
     hierarchy from size, weight and letterspacing. */
  --fg-on-night:#F2F0EA;
  --fg-on-night-2:rgba(242,240,234,.72);
  --fg-on-night-3:rgba(242,240,234,.54);

  /* ── semantic: border. Edges are hairline insets; no drop shadows exist. ── */
  --border-hair:var(--hairline);
  --border-strong:var(--ink);
  --border-night:rgba(242,240,234,.18);

  /* ── semantic: the mark's five permitted jobs ── */
  --action-primary-bg:var(--mark);
  --action-primary-bg-hover:var(--mark-deep);
  --action-ink-bg:var(--ink);
  --action-ink-bg-hover:#282C35;
  --tab-active-bg:var(--mark);
  --chip-active-bg:var(--mark);
  --row-client-bg:var(--mark-soft);
  --highlight-bg:var(--mark);
  --focus-ring:var(--ink);

  /* ── semantic: data. Ink values plus the mark. No container hues. ── */
  --data-measured:var(--ink);
  --data-sample:var(--ink-2);
  --data-subject:var(--mark-deep);
  --data-peer-1:rgba(15,14,12,.62);
  --data-peer-2:rgba(15,14,12,.46);
  --data-peer-3:rgba(15,14,12,.32);
  --data-peer-4:rgba(15,14,12,.22);
  --data-rest:rgba(15,14,12,.12);
  --data-gridline:rgba(15,14,12,.10);
  --data-axis:var(--ink);
  /* the borrowed voice — a competitor's unsourced headline figure */
  --data-borrowed:rgba(15,14,12,.48);
}
/* Night register. Not an inversion: the canvas goes warm-black, the mark holds
   (a highlighter is bright by definition), container solids stay, tints darken,
   and the ink ladder lifts because a light veil reads weaker on a dark ground. */
[data-theme="dark"]{
  --canvas:#141311;
  --surface:#1D1B18;
  --white:#1A1815;
  --ink:#F2F0EA;
  --ink-2:#B4AFA5;
  --ink-3:#8F8A7E;
  --hairline:#2E2B26;
  --mark:#E4D63C;
  --mark-deep:#C9BB1E;
  --mark-soft:#3A3616;
  --fg-muted-on-tint:rgba(242,240,234,.72);
  --tint-lime:#20260F;
  --tint-blue:#151C2B;
  --tint-coral:#2A1810;
  --tint-violet:#1D172F;
  --tint-cyan:#122327;
  --tint-pink:#2A1420;
  --band-sand:#1B1913;
  --band-blue:#161A22;
  --band-blush:#221913;
  --band-mint:#161F19;
  --fg-on-ink:#141311;
  --action-ink-bg:#F2F0EA;
  --action-ink-bg-hover:#D8D5CC;
  --focus-ring:var(--mark);
  --data-peer-1:rgba(242,240,234,.66);
  --data-peer-2:rgba(242,240,234,.50);
  --data-peer-3:rgba(242,240,234,.36);
  --data-peer-4:rgba(242,240,234,.26);
  --data-rest:rgba(242,240,234,.16);
  --data-gridline:rgba(242,240,234,.13);
  --data-borrowed:rgba(242,240,234,.52);
}

/* Muted copy already clears AA on every standard light container. These scopes
   retain the slightly stronger tint-specific step so sources and notes keep
   their intended hierarchy if a new container colour is introduced. */
.cal-band,.cal-panel--sunken,.cal-table thead,.cal-byline,.cal-figure__body,.cal-table tr[data-client="true"],.cal-matrix td.cal-matrix__featured{--fg-muted:var(--fg-muted-on-tint)}
