/* ==========================================================================
   FORUS Master Design System v1.1 · forus-tokens.css
   Design tokens for every FORUS experience.
   Load this first. Nothing in a FORUS product should use a colour, size,
   radius or shadow that does not trace back to a token in this file.

   Modes:  <html data-mode="public">   marketing, editorial, campaigns (default)
           <html data-mode="product">  dashboards, consoles, portals, admin
   ========================================================================== */

:root {
  /* ------------------------------------------------------------------
     1. BRAND COLOUR (authoritative, from FORUS Brand Guidelines V1.1)
     ------------------------------------------------------------------ */
  --forus-night-blue:  #1E254A;   /* the anchor: dark surfaces, headings, body text */
  --forus-deep-blue:   #0844AF;   /* structural accent, links, primary product action */
  --forus-medium-blue: #027DB8;   /* eyebrows, secondary emphasis, focus rings in product */
  --forus-light-blue:  #81CAC9;   /* soft accent, eyebrows on dark, offset blocks */
  --forus-white:       #FFFFFF;
  --forus-light-grey:  #EEEEEE;
  --forus-dark-grey:   #858585;   /* muted metadata only */
  --forus-black:       #000000;

  /* Division accents. One per composition. All eight together only in the mark and pattern. */
  --forus-red:    #DD062B;
  --forus-orange: #F5971B;        /* the primary public call-to-action colour */
  --forus-yellow: #FBBA00;
  --forus-green:  #8DBF2E;
  --forus-purple: #692482;

  /* Short aliases (used throughout the starter and reference) */
  --night:  var(--forus-night-blue);
  --deep:   var(--forus-deep-blue);
  --medium: var(--forus-medium-blue);
  --light:  var(--forus-light-blue);
  --orange: var(--forus-orange);
  --green:  var(--forus-green);
  --yellow: var(--forus-yellow);
  --red:    var(--forus-red);
  --purple: var(--forus-purple);
  --white:  var(--forus-white);
  --grey:   var(--forus-light-grey);

  /* ------------------------------------------------------------------
     2. NEUTRAL TINTS (derived, established on forus.coop and in product)
     ------------------------------------------------------------------ */
  --sand:  #F6F3EE;   /* warm section band (public) */
  --mist:  #EAF5F5;   /* cool section band (public), info surfaces */
  --canvas: #F4F6FA;  /* product application ground (Media Console) */
  --surface: #FFFFFF;    /* panels and cards */
  --surface-2: #F3F7FB;  /* blue tint 50: table headers, inset rows, modal footers */
  --tint-50:  #F3F7FB;   /* blue tint 50 */
  --tint-100: #E5EDF6;   /* blue tint 100: icon wells, progress tracks, code chips */
  --tint-200: #C9DCEC;   /* blue tint 200: borders on tinted surfaces */
  --night-2: #2B3363; /* Night Blue tint: sidebar dividers and hover */
  --night-3: #3E477C; /* lighter Night Blue tint: sidebar secondary */
  --night-0: #161C3A; /* deeper navy for footers */
  --nav-text: #AFBAD4; /* sidebar navigation text at rest */

  /* Ink: Night Blue at graded opacity, never grey text */
  --ink:       var(--night);
  --ink-soft:  rgba(30, 37, 74, .74);
  --ink-mute:  rgba(30, 37, 74, .56);
  --ink-faint: rgba(30, 37, 74, .38);
  --on-dark:       #FFFFFF;
  --on-dark-soft:  rgba(255, 255, 255, .78);
  --on-dark-mute:  rgba(255, 255, 255, .62);

  /* Lines and borders */
  --line:         rgba(30, 37, 74, .12);
  --line-strong:  rgba(30, 37, 74, .22);
  --line-on-dark: rgba(255, 255, 255, .16);

  /* Interaction tints */
  --tint-deep:   rgba(8, 68, 175, .08);
  --tint-medium: rgba(2, 125, 184, .10);
  --tint-light:  rgba(129, 202, 201, .28);
  --tint-orange: rgba(245, 151, 27, .14);
  --tint-night:  rgba(30, 37, 74, .06);

  /* ------------------------------------------------------------------
     3. STATUS (functional colours, derived from the division palette)
     ------------------------------------------------------------------ */
  --status-success:      var(--green);
  --status-success-ink:  #5E8018;
  --status-success-bg:   #EEF6DD;   /* green at 16% on white */
  --status-warning:      var(--orange);
  --status-warning-ink:  #A9640A;
  --status-warning-bg:   #FFF1DE;
  --status-danger:       var(--red);
  --status-danger-ink:   #B60423;
  --status-danger-bg:    #FCE6EA;
  --status-info:         var(--medium);
  --status-info-ink:     #01638F;
  --status-info-bg:      #E6F3F9;
  --status-neutral:      var(--forus-dark-grey);
  --status-neutral-ink:  #6B6B6B;
  --status-neutral-bg:   var(--forus-light-grey);
  /* Readiness (public reference and product catalogues): Ready = success, Pilot = warning, Planned = neutral outline */
  --status-ready:        var(--status-success);
  --status-pilot:        var(--status-warning);
  --status-planned:      var(--status-neutral);

  /* ------------------------------------------------------------------
     4. TYPOGRAPHY
     ------------------------------------------------------------------ */
  --font: 'Montserrat', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; /* code and IDs only */

  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;

  /* Fluid public scale (forus.coop) */
  --fs-display: clamp(2.5rem, 1.5rem + 4.3vw, 4.6rem);   /* 40 to 74px, homepage hero */
  --fs-h1:      clamp(2.5rem, 1.6rem + 4.6vw, 5rem);     /* 40 to 80px */
  --fs-h1-inner:clamp(2.25rem, 1.4rem + 3.6vw, 4.25rem); /* 36 to 68px, inner page heroes */
  --fs-h2:      clamp(1.9rem, 1.3rem + 2.6vw, 3.3rem);   /* 30 to 53px */
  --fs-h3:      clamp(1.25rem, 1.1rem + .6vw, 1.5rem);   /* 20 to 24px */
  --fs-lead:    clamp(1.125rem, 1.05rem + .45vw, 1.375rem); /* 18 to 22px */
  --fs-body:    clamp(1rem, .96rem + .2vw, 1.0625rem);   /* 16 to 17px */
  --fs-small:   .9375rem;  /* 15px */
  --fs-caption: .875rem;   /* 14px */
  --fs-eyebrow: .75rem;    /* 12px */

  /* Fixed product scale (Media Console conventions; Product Mode overrides below) */
  --fs-ui-title:   1.5rem;    /* 24px page title, weight 800 */
  --fs-ui-section: 1rem;      /* 16px section, modal and form-section titles, 700 */
  --fs-ui-card:    .875rem;   /* 14px card and panel titles, 700 */
  --fs-ui-body:    .8125rem;  /* 13px interface text and table cells */
  --fs-ui-label:   .8125rem;  /* 13px sentence-case field labels */
  --fs-ui-caption: .6875rem;  /* 11px tracked uppercase caption: KPI labels, table headers, keys */
  --fs-ui-meta:    .75rem;    /* 12px metadata, subtitles, hints */
  --fs-ui-badge:   .625rem;   /* 10px tracked uppercase status badge */
  --fs-ui-kpi:     1.5rem;    /* 24px dashboard figure, 700, tabular */
  --fs-ui-kpi-lg:  2rem;      /* 32px hero figure on a NOC or finance screen */
  --ls-caption: .12em;        /* tracking for uppercase captions */
  --ls-id: .055em;            /* tracking for identifiers set in Montserrat (the brand has no monospace) */

  --lh-tight: 1.05;
  --lh-heading: 1.1;
  --lh-sub: 1.2;
  --lh-body: 1.65;
  --lh-ui: 1.45;

  --ls-heading: -.022em;
  --ls-sub: -.012em;
  --ls-eyebrow: .18em;
  --ls-label: .14em;

  --measure: 62ch;
  --measure-narrow: 46ch;
  --measure-heading: 20ch;

  /* ------------------------------------------------------------------
     5. SPACE (8px mini-unit)
     ------------------------------------------------------------------ */
  --space-0-5: 4px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;

  --section: clamp(80px, 6vw + 40px, 136px);   /* public section padding */
  --section-tight: calc(var(--section) * .7);
  --gutter: clamp(20px, 4vw, 48px);
  --container: 1200px;
  --container-wide: 1440px;
  --container-narrow: 820px;

  /* ------------------------------------------------------------------
     6. RADIUS
     ------------------------------------------------------------------ */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --radius: var(--radius-xl);        /* public cards, panels, photographs */
  --radius-card: var(--radius);
  --radius-control: var(--radius-md);/* inputs, selects, small chips */
  --radius-button: var(--radius-pill);

  /* ------------------------------------------------------------------
     7. ELEVATION (Night Blue tinted, never grey or black)
     ------------------------------------------------------------------ */
  --shadow-xs: 0 1px 2px rgba(30, 37, 74, .06);
  --shadow-sm: 0 4px 12px rgba(30, 37, 74, .08);
  --shadow-md: 0 12px 32px rgba(30, 37, 74, .12);
  --shadow-lg: 0 24px 60px rgba(30, 37, 74, .14);
  --shadow-cta: 0 10px 28px rgba(245, 151, 27, .30);
  --shadow-cta-hover: 0 14px 32px rgba(245, 151, 27, .38);
  --focus-ring: 0 0 0 3px rgba(2, 125, 184, .28);

  /* ------------------------------------------------------------------
     8. MOTION
     ------------------------------------------------------------------ */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-standard: ease;
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 350ms;
  --dur-reveal: 800ms;
  --reveal-travel: 28px;

  /* ------------------------------------------------------------------
     9. LAYERS
     ------------------------------------------------------------------ */
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 20;
  --z-header: 50;
  --z-drawer: 60;
  --z-overlay: 70;
  --z-modal: 80;
  --z-toast: 90;
  --z-tooltip: 100;

  /* ------------------------------------------------------------------
     10. SHELL (Product Mode geometry)
     ------------------------------------------------------------------ */
  --header-h: 88px;          /* public header */
  --sidebar-w: 248px;        /* product sidebar (Media Console ships at 244; 248 sits on the 8px grid) */
  --sidebar-w-collapsed: 72px;
  --pagehead-h: 88px;        /* product page-head band: breadcrumb, title, subtitle, actions */
  --topbar-h: 48px;          /* optional slim utility bar above the page head (search, context, notifications) */
  --control-h: 36px;         /* default button, input and select height in product (Media Console) */
  --control-h-sm: 32px;
  --control-h-lg: 44px;
  --row-h: 48px;             /* table row (13px cell padding) */
  --row-h-dense: 40px;
  --row-h-comfortable: 56px;
  --panel-pad: 20px;         /* card and panel horizontal padding */
  --panel-pad-y: 16px;

  /* ------------------------------------------------------------------
     11. BREAKPOINTS (reference values; CSS cannot read these in media
         queries, so the same numbers are repeated in forus-base.css)
     ------------------------------------------------------------------ */
  --bp-sm: 600px;
  --bp-md: 900px;
  --bp-lg: 1100px;
  --bp-xl: 1440px;
}

/* ==========================================================================
   PRODUCT MODE overrides · <html data-mode="product">
   Same DNA, tighter geometry. Fixed type, compact radii, quiet shadows.
   ========================================================================== */
[data-mode="product"] {
  --fs-body: var(--fs-ui-body);   /* 13px interface text */
  --fs-lead: .875rem;
  --fs-h1: var(--fs-ui-title);
  --fs-h2: var(--fs-ui-section);
  --fs-h3: var(--fs-ui-card);
  --fs-small: .8125rem;
  --fs-caption: .75rem;
  --lh-body: var(--lh-ui);
  --ls-heading: -.013em;          /* 24px title tracks -.3px */

  --radius: var(--radius-lg);     /* 16px cards and panels (Media Console, Manus kit) */
  --radius-card: var(--radius-lg);
  --radius-control: var(--radius-sm);   /* 8px inputs, buttons, nav items, tabs, inset rows */
  --radius-button: var(--radius-sm);
  --radius-badge: 5px;                  /* status labels */

  /* Neutrals on the product ground are solid Media Console values, not alpha derivations */
  --line: #DEE4EE;                /* card and divider strokes */
  --line-strong: #C9DCEC;         /* input borders, borders on tinted surfaces */
  --ink-mute: #5A6480;            /* subtitles, captions, table headers */
  --ink-faint: #858585;           /* placeholders, identifiers */
  --tint-night: #F3F7FB;          /* row hover */

  --section: 24px;
  --gutter: 32px;
  --container: none;

  --shadow-lg: var(--shadow-md);
  --dur-base: 150ms;
  --reveal-travel: 8px;
}

/* Dark product theme · <html data-mode="product" data-theme="dark">
   Night Blue base, translucent white panels, Medium Blue glow. Never near-black. */
[data-theme="dark"] {
  --canvas: var(--night);
  --tint-50: rgba(255,255,255,.05); --tint-100: rgba(255,255,255,.08); --tint-200: rgba(255,255,255,.14);
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .08);
  --ink: var(--white);
  --ink-soft: rgba(255, 255, 255, .78);
  --ink-mute: rgba(255, 255, 255, .62);
  --ink-faint: rgba(255, 255, 255, .4);
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --tint-night: rgba(255, 255, 255, .06);
  --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  --glow: radial-gradient(60% 50% at 80% -10%, rgba(2, 125, 184, .42), transparent 60%);
}

/* Density inside Product Mode. Default is the Media Console density.
   <div data-density="dense">        finance, logistics, settlement grids
   <div data-density="comfortable">  member portals, onboarding, touch-first screens */
[data-density="dense"] {
  --fs-body: .75rem;
  --control-h: var(--control-h-sm);
  --row-h: var(--row-h-dense);
  --panel-pad: 16px;
  --panel-pad-y: 12px;
}
[data-density="comfortable"] {
  --fs-body: .875rem;
  --control-h: 40px;
  --row-h: var(--row-h-comfortable);
  --panel-pad: 24px;
  --panel-pad-y: 20px;
}
