/* ============================================================
   Cadence Design System — tokens.css · v1.0
   Semantic token layer. Components reference roles, never hex.
   Light is :root; dark is any [data-theme="dark"] scope, so a
   single element (or the whole page) can flip themes.
   Source of truth: tokens.json
   ============================================================ */

:root{
  /* Surfaces */
  --bg:#F7F4ED;            /* page background */
  --bg-card:#FFFFFF;       /* cards, tables, inputs */
  --bg-tint:#F1EDE3;       /* hover fill, tracks, wells */

  /* Ink */
  --ink-1:#1A1612;         /* primary text, primary buttons */
  --ink-2:#46413A;         /* body text */
  --ink-3:#6B655C;         /* secondary, meta */
  --ink-4:#B8B1A2;         /* placeholders, disabled text */

  /* Lines */
  --line:#E6E1D4;          /* card borders, dividers */
  --line-2:#EFEAE0;        /* inner dividers */

  /* Brand — jade. Commits, live, focus. One per surface. */
  --brand:#2F8F68;
  --brand-hover:#267655;
  --brand-text:#267655;    /* jade as text on soft */
  --brand-soft:#E0F1EA;
  --brand-soft-border:#BFE0D2;

  /* AI — the agent's color. If it's purple, Cadence did it. */
  --ai:#6B4FE0;
  --ai-dark:#4A2FB0;       /* agent text / pressed */
  --ai-soft:#EEE9FB;
  --ai-border:#D8CCF5;

  /* Semantic — categorical, never decorative */
  --info:#2C5BB0;          /* informational, internal staff */
  --info-soft:#E5EBF5;
  --warn:#9A6717;          /* warning, drift */
  --warn-soft:#F4EEDC;
  --danger:#B0392A;        /* urgent, unfilled, destructive */
  --danger-soft:#F4E4DF;
  --plum:#5B3F7A;          /* premium, EOR */
  --plum-soft:#EFE9F5;

  /* On-fills */
  --on-ink:#F7F4ED;        /* text on ink-1 fills (cream, not white) */
  --on-brand:#FFFFFF;
  --row-hover:#FBFAF4;

  /* Type — three voices, strict jobs */
  --serif:'Fraunces',Georgia,serif;        /* headlines, metrics, italic brand moments. Never body. */
  --sans:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;  /* everything readable */
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace; /* times, money, counts, eyebrows, tags */

  --fs-display:56px;  --fw-display:400;   /* Fraunces */
  --fs-h1:34px;       --fw-h1:500;        /* Fraunces */
  --fs-h2:24px;       --fw-h2:500;        /* Fraunces */
  --fs-body:15px;     --lh-body:1.6;      /* Inter 400 */
  --fs-eyebrow:11px;                       /* Mono 500 caps, ls .14em */

  /* Space — 8-pt grid, finer steps for tight typography */
  --s-1:4px; --s-2:8px; --s-3:12px; --s-4:16px; --s-5:24px; --s-6:32px; --s-7:48px; --s-8:64px;

  /* Radius */
  --r-control:8px;   /* buttons, chips, inputs */
  --r-card:14px;
  --r-large:20px;
  --r-pill:999px;

  /* Shadow */
  --shadow-1:0 1px 2px rgba(26,22,18,.04);   /* cards */
  --shadow-2:0 8px 24px rgba(26,22,18,.10);  /* drawers, popovers */
  --shadow-3:0 20px 48px rgba(26,22,18,.16); /* modals */

  /* Motion — nothing moves unless it means something */
  --t-hover:140ms ease-out;    /* hover, press, chip changes */
  --t-toggle:180ms ease-out;   /* toggles, segmented control */
  --t-enter:240ms ease-out;    /* drawer, popover, modal enter */
  --t-pulse:2s;                /* live dots only (jade or purple) */
  --t-sweep:1.4s;              /* indeterminate progress */

  /* Layout */
  --content-max:1160px;
  --gutter:40px;
  --shell-h:52px;
  color-scheme:light;
}

/* ---- Dark — same system, lights off. Warm brown-black, never blue-black. ---- */
[data-theme="dark"]{
  --bg:#16130F;
  --bg-card:#1E1A15;
  --bg-tint:#28231B;

  --ink-1:#F3EFE6;
  --ink-2:#B8B1A2;
  --ink-3:#8B857A;
  --ink-4:#6B655C;

  --line:#2E2921;
  --line-2:#3A342B;

  --brand:#48B389;         /* jade lifts on dark */
  --brand-hover:#5FC49B;
  --brand-text:#7FD4AE;
  --brand-soft:#1E4534;
  --brand-soft-border:#2E5F47;

  --ai:#9B85F2;            /* purple lifts on dark */
  --ai-dark:#C9BBF7;
  --ai-soft:#2B2347;
  --ai-border:#453A6E;

  --info:#7FA8E8;
  --info-soft:#1C2740;
  --warn:#D9A96A;
  --warn-soft:#3A2D14;
  --danger:#F2917F;
  --danger-soft:#47201B;
  --plum:#B79BD6;
  --plum-soft:#322244;

  --on-ink:#1A1612;        /* primary buttons go cream — ink text on cream fill */
  --on-brand:#16130F;
  --row-hover:#221D17;

  --shadow-1:0 1px 2px rgba(0,0,0,.2);
  --shadow-2:0 8px 24px rgba(0,0,0,.4);
  --shadow-3:0 20px 48px rgba(0,0,0,.55);
  color-scheme:dark;
}

/* Reduced motion: drop all loops. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
