/* ============================================================================
   Nitreum — Design Tokens  ·  "Annual Report"
   A light, printed-report system: field green and earth beige, serif-led,
   tabular figures, ruled tables, chapter numbers and footnotes.
   Brand colours come from the fixed logo (logo/LOGO_RESEARCH.md):
     hexagon green #17613A · granule amber #E9A62A · wordmark ink #123D26.
   Every custom property referenced by the site (CSS and inline styles) is
   defined here; legacy names are kept and re-pointed at the new palette.
   ========================================================================== */

:root {
  color-scheme: light;

  /* ---- Core palette (named) ---- */
  --paper:       #e9ece4;   /* pale field-grey stock; earth beige is carried by the chapter bands */
  --paper-sheet: #f9f8f2;   /* a bound-in sheet: tables, exhibits */
  --paper-band:  #e1dcc6;   /* tinted band for alternate chapters */
  --field:       #17613a;   /* logo hexagon green: the reporting colour */
  --field-deep:  #0f3d25;   /* cover and back-cover green */
  --field-tint:  #d9e6d6;   /* green wash for highlighted rows */
  --ink:         #17211a;   /* body ink, green-black */
  --soil:        #7a4f22;   /* earth brown: second data series */
  --granule:     #e9a62a;   /* logo granule amber: graphics only, never text on paper */
  --rule:        #cdc2a8;   /* hairline rules */
  --rule-strong: #17211a;   /* heavy table rules */

  /* ---- Legacy surface names, re-pointed ---- */
  --bg-base:   var(--paper);
  --bg-900:    var(--paper);
  --bg-800:    var(--paper);
  --surface-1: var(--paper-sheet);
  --surface-2: #e2e6db;
  --surface-3: var(--paper-band);
  --canvas:    #f5f4ec;

  /* ---- Text ---- */
  --text-primary:   var(--ink);
  --text-secondary: #3b4237;
  --text-muted:     #5c5a4b;
  --text-faint:     #6e6a58;
  --text-on-accent: #ffffff;
  --text-on-deep:   #eef1e6;
  --text-on-deep-muted: #b9c8b5;

  /* ---- Borders ---- */
  --border-subtle:  #ddd3bd;
  --border-default: var(--rule);
  --border-strong:  #8f8670;
  --grid-line:      #e3dac6;
  --ring:           #0f3d25;

  /* ---- Brand ---- */
  --brand-hex:     var(--field);
  --brand-granule: var(--granule);

  /* ---- Accent ---- */
  --accent:       var(--field);
  --accent-hover: #11502f;
  --accent-press: var(--field-deep);
  --accent-soft:  var(--field-tint);

  /* ---- Status (always paired with glyph + text label) ---- */
  --st-queued:  #5c5a4b;  --st-queued-soft:  #ebe4d3;
  --st-running: #17613a;  --st-running-soft: #dce8da;
  --st-waiting: #1f5f7a;  --st-waiting-soft: #dbe6ea;
  --st-approve: #8a5a0c;  --st-approve-soft: #f4e5c4;
  --st-success: #1d6b45;  --st-success-soft: #dcead9;
  --st-failed:  #a3242f;  --st-failed-soft:  #f2dcd7;
  --st-blocked: #8c2a44;  --st-blocked-soft: #efdbdf;

  /* ---- Product marks (from products_raw/*/logo-brief.md) ---- */
  --prod-synthex:   #1d4ed8;
  --prod-granulex:  #b45309;
  --prod-granvis:   #0d9488;
  --prod-blendex:   #6d28d9;
  --prod-nitrotwin: #059669;

  /* ---- Diagram nodes / edges ---- */
  --node-bg:     var(--paper-sheet);
  --node-border: #a59b82;
  --node-active: var(--field);
  --edge:        #a59b82;
  --edge-active: var(--field);
  --edge-wrap:   var(--soil);
  --run-done:    #8fb59b;

  /* ---- Generic semantic ---- */
  --good: var(--st-success);
  --warn: var(--st-approve);
  --bad:  var(--st-failed);
  --info: var(--st-waiting);

  /* ---- Type ----
     Source Serif 4 leads: headings, body, and the big report figures (its
     optical-size axis lets the same family run from footnote to cover).
     Archivo (semi-condensed) sets tables, labels and interface text with
     tabular figures. IBM Plex Mono is reserved for code and agent logs. */
  --font-serif:   "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-sans:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-serif);
  --font-body:    var(--font-serif);
  --font-mono:    "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Scale: a 1.25 (major third) ladder from a 17px serif body */
  --fs-figure:  clamp(3.5rem, 2rem + 6vw, 7.5rem);   /* report headline figures */
  --fs-display: clamp(2.5rem, 1.6rem + 3.4vw, 4.25rem);
  --fs-h1:      clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  --fs-h2:      clamp(1.75rem, 1.35rem + 1.6vw, 2.625rem);
  --fs-h3:      clamp(1.25rem, 1.12rem + 0.6vw, 1.5rem);
  --fs-h4:      1.0625rem;
  --fs-lead:    clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  --fs-body:    1.0625rem;
  --fs-body-lg: 1.125rem;
  --fs-small:   0.9375rem;
  --fs-mono:    0.8125rem;
  --fs-micro:   0.8125rem;
  --fs-metric:  clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  --fs-price:   clamp(2.25rem, 1.8rem + 2vw, 3.25rem);

  /* ---- Spacing: 4-pt base ---- */
  --space-0: 0;     --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;  --space-8: 32px;
  --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-20: 80px;
  --space-24: 96px; --space-28: 112px;--space-32: 128px;--space-40: 160px;

  /* ---- Radii: print is square. Only the pill survives, for status. ---- */
  --radius-sm: 0; --radius-md: 2px; --radius-lg: 2px; --radius-xl: 2px;
  --radius-pill: 999px;

  /* ---- Containers ---- */
  --container-sm: 680px;  --container-md: 840px;  --container-lg: 1080px;
  --container-xl: 1200px; --container-2xl: 1400px;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 66ch;

  /* ---- Section rhythm: chapters breathe, notes are tight ---- */
  --section-y:    clamp(56px, 6vw, 96px);
  --section-y-lg: clamp(80px, 9vw, 144px);
  --nav-h: 68px;

  /* ---- Density ---- */
  --panel-gap:  clamp(16px, 1.6vw, 24px);
  --panel-pad:  clamp(18px, 2vw, 28px);
  --log-line-y: 3px;
  --node-pad:   var(--space-3) var(--space-4);
  --step-gap:   var(--space-5);
  --stack:      clamp(12px, 1.4vw, 20px);

  /* ---- Motion ---- */
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 420ms; --dur-run: 600ms;
  --ease-out: cubic-bezier(0.2, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --pulse: 1.8s;

  /* ---- Elevation: paper is flat. Depth comes from rules and tint. ---- */
  --hairline: 1px solid var(--rule);
  --shadow-1: none;
  --shadow-2: 0 1px 0 var(--rule);
  --shadow-3: 0 18px 40px -24px rgba(23, 33, 26, 0.35);
  --scrim:    rgba(23, 33, 26, 0.55);

  --grid-cols: 12;
  --grid-gap: var(--panel-gap);
}
