/* Cherrystone Business Services — brand tokens v1 (10 October 2026). Cherrystone IP.
   One file, imported by the corporate site, the Ipso marketing site and the Ipso runtime.
   Two surfaces share one identity: PAPER (the company speaks) and INSTRUMENT (the product works).
   Data colours carry meaning and never change per surface. Cherry is the brand and the primary action — never a severity. */

:root {
  /* type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --t-display: clamp(34px, 4.6vw, 56px);   /* H1, weight 700, line-height 1.05, letter-spacing -.02em */
  --t-h2: clamp(26px, 3vw, 38px);          /* weight 700, line-height 1.1 */
  --t-h3: 20px;                            /* weight 600 */
  --t-body: 16px;                          /* weight 400, line-height 1.5 */
  --t-lead: 17px;                          /* weight 400, colour --fg2 */
  --t-small: 13.5px;
  --t-label: 12px;                         /* uppercase, weight 600, letter-spacing .08em */
  --t-mono-num: tabular-nums;              /* every figure: font-variant-numeric */

  /* paper — light */
  --bg: #F7F4EE;  --bg2: #EFEAE1;  --fg: #1F1E1C;  --fg2: #524F4A;  --mu: #8A847B;  --line: #E1DBD0;  --line2: #CFC7B9;
  --cherry: #B8243C;  --cherry2: #D8445A;

  /* instrument — the product's surface, identical on both themes of paper */
  --ink0: #0E0D11;  --ink: #15141A;  --ink2: #1E1D24;  --inkfg: #F3F1EC;  --inkfg2: #C9C5BE;  --inkmu: #9C98A4;
  --inkline: rgba(255,255,255,.10);  --inkline2: rgba(255,255,255,.20);

  /* data semantics (Layer-1 palette) — meaning is fixed */
  --ok: #26A98D;      /* headroom, within tolerance, strong */
  --crit: #E5534B;    /* the binding stage, critical (≥ 0.60) */
  --warn: #F2B14A;    /* waiting work, watch */
  --info: #3BC9DB;    /* flow, movement, the hotel wave */
  --origin: #F3872F;  /* the origin of a cascade, the thing being changed */
  --by: #9B7FD4;      /* placements, passive income, "by" streams */
  --acc: #8FD8E8;     /* active income; links on the instrument */
  --tier-critical: 0.60;  --tier-strong: 0.30;   /* threshold tiering, never rank-based */

  /* geometry */
  --r: 18px;  --rs: 12px;  --pill: 999px;
  --gutter: 24px;  --measure: 62ch;  --wrap: 1180px;  --top: 60px;

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);        /* settle, no bounce */
  --d-ui: 160ms;        /* direct feedback: hover, press, focus */
  --d-small: 250ms;     /* small transitions: chips, switches, underline */
  --d-change: 560ms;    /* a recalculation: bars, pipes, numbers (the runtime's causality morph uses the same value) */
  --d-chapter: 800ms;   /* a chapter or scene transformation */
}

/* paper — dark (system preference, overridable by data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141317;  --bg2: #1B1A20;  --fg: #F3F1EC;  --fg2: #C9C5BE;  --mu: #8E8A93;  --line: #2A2830;  --line2: #3A3742;
    --cherry: #E0526A;  --cherry2: #F06B7E;  --ink0: #09090C;  --ink: #0D0C10;  --ink2: #15141A;  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141317;  --bg2: #1B1A20;  --fg: #F3F1EC;  --fg2: #C9C5BE;  --mu: #8E8A93;  --line: #2A2830;  --line2: #3A3742;
  --cherry: #E0526A;  --cherry2: #F06B7E;  --ink0: #09090C;  --ink: #0D0C10;  --ink2: #15141A;  color-scheme: dark;
}

/* a region that is the instrument: remap the paper tokens so components need no second stylesheet */
.dark, .instrument {
  --bg: var(--ink0);  --bg2: var(--ink);  --fg: var(--inkfg);  --fg2: var(--inkfg2);  --mu: var(--inkmu);  --line: var(--inkline);  --line2: var(--inkline2);
  background: var(--bg);  color: var(--fg);
}

/* reduced motion: recalculations resolve instantly; nothing essential waits for an animation */
@media (prefers-reduced-motion: reduce) {
  :root { --d-ui: 0ms; --d-small: 0ms; --d-change: 0ms; --d-chapter: 0ms; }
}
