/* ==========================================================================
   RCS DESIGN SYSTEM — TOKENS
   The single source of truth for colour, type, space, radii and shadow.
   Nothing else in the CSS should contain a raw colour or pixel value that
   belongs here. Reference tokens instead.
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------------
     1. PALETTE  (raw brand values — taken from the RCS logo)
     --------------------------------------------------------------------- */
  --palette-red-500: #f40000;  /* brand red: highlights, rules, large figures */
  --palette-red-600: #e00000;  /* CTA fill — white label reaches 5.0:1 (AA)  */
  --palette-red-700: #c00000;  /* hover + small accent text on white (6.4:1) */
  --palette-red-800: #9b0000;  /* pressed                                     */
  --palette-red-050: #fff2f2;  /* faintest red wash                           */

  --palette-ink-900: #1f2328;  /* brand charcoal: headings + body text */
  --palette-ink-800: #262b31;
  --palette-ink-700: #343a42;
  --palette-ink-600: #4a525c;
  --palette-ink-500: #5f6873;  /* muted text on white — 6.1:1 (AA)     */
  --palette-ink-300: #9aa3af;

  --palette-grey-100: #f4f5f7; /* brand light grey: alternating sections */
  --palette-grey-200: #e9ebef;
  --palette-grey-300: #dcdfe5;
  --palette-grey-400: #c7ccd4;

  --palette-white: #ffffff;

  /* ---------------------------------------------------------------------
     2. SEMANTIC COLOUR
     --------------------------------------------------------------------- */
  --color-text:            var(--palette-ink-900);
  --color-text-muted:      var(--palette-ink-500);
  --color-text-inverse:    var(--palette-white);
  --color-text-inverse-muted: rgb(255 255 255 / 0.72);
  --color-text-faint:      var(--palette-ink-300);  /* placeholder plates only */

  --color-surface:         var(--palette-white);
  --color-surface-subtle:  var(--palette-grey-100);
  --color-surface-inverse: var(--palette-ink-900);
  --color-surface-accent:  var(--palette-red-500);
  --color-surface-inverse-soft: var(--palette-ink-800); /* raised panel on charcoal */

  --color-accent:          var(--palette-red-500);
  --color-accent-text:     var(--palette-red-700);
  --color-accent-fill:     var(--palette-red-600);
  --color-accent-fill-hover: var(--palette-red-700);
  --color-accent-fill-active: var(--palette-red-800);

  --color-border:          var(--palette-grey-300);
  --color-border-strong:   var(--palette-grey-400);
  --color-border-inverse:  rgb(255 255 255 / 0.16);

  --color-focus-ring:      var(--palette-red-700);
  --color-overlay-ink:     rgb(31 35 40 / 0.78);
  --color-overlay-ink-soft: rgb(31 35 40 / 0.45);

  /* ---------------------------------------------------------------------
     3. TYPOGRAPHY
     Headings: Poppins (bold, clean geometric sans)
     Body:     Inter
     Both fall back to Noto Sans Sinhala / Tamil so Sinhala and Tamil
     copy renders correctly without a second stylesheet.
     --------------------------------------------------------------------- */
  --font-heading: "Poppins", "Noto Sans Sinhala", "Noto Sans Tamil",
                  system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    "Inter", "Noto Sans Sinhala", "Noto Sans Tamil",
                  system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-2xs:  0.75rem;                              /* 12px */
  --text-xs:   0.8125rem;                            /* 13px */
  --text-sm:   0.875rem;                             /* 14px */
  --text-base: 1rem;                                 /* 16px */
  --text-md:   1.0625rem;                            /* 17px */
  --text-lg:   clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  --text-xl:   clamp(1.1875rem, 0.6vw + 1rem, 1.375rem);
  --text-2xl:  clamp(1.375rem, 1vw + 1.1rem, 1.75rem);
  --text-3xl:  clamp(1.625rem, 1.6vw + 1.2rem, 2.25rem);
  --text-4xl:  clamp(1.875rem, 2.4vw + 1.25rem, 2.875rem);
  --text-5xl:  clamp(2.25rem, 3.6vw + 1.25rem, 3.75rem);
  --text-stat: clamp(2.25rem, 2.8vw + 1.4rem, 3.25rem);

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

  --leading-tight:   1.1;
  --leading-snug:    1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0;
  --tracking-wide:   0.08em;
  --tracking-widest: 0.14em;

  --measure-prose: 62ch;
  --measure-lead:  54ch;

  /* ---------------------------------------------------------------------
     4. SPACE  (4px base scale)
     --------------------------------------------------------------------- */
  --space-0:  0;
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* fluid vertical rhythm for full-width sections */
  --section-y:       clamp(3.5rem, 6vw, 6.5rem);
  --section-y-tight: clamp(2.5rem, 4vw, 4rem);
  --section-y-loose: clamp(4.5rem, 8vw, 8rem);

  /* ---------------------------------------------------------------------
     5. LAYOUT
     --------------------------------------------------------------------- */
  --container-max:   1200px;
  --container-wide:  1440px;
  --container-pad:   clamp(1.25rem, 4vw, 2.5rem);
  --grid-gap:        clamp(1.25rem, 2.2vw, 2rem);
  --header-height:   84px;
  --header-height-sm: 68px;

  /* ---------------------------------------------------------------------
     6. RADII  (small, corporate)
     --------------------------------------------------------------------- */
  --radius-xs:   2px;
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   10px;
  --radius-pill: 999px;

  /* ---------------------------------------------------------------------
     7. SHADOW  (soft, low-contrast)
     --------------------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgb(31 35 40 / 0.06);
  --shadow-sm: 0 1px 3px rgb(31 35 40 / 0.07), 0 1px 2px rgb(31 35 40 / 0.04);
  --shadow-md: 0 4px 12px rgb(31 35 40 / 0.08), 0 1px 3px rgb(31 35 40 / 0.05);
  --shadow-lg: 0 12px 28px rgb(31 35 40 / 0.11), 0 4px 8px rgb(31 35 40 / 0.05);
  --shadow-xl: 0 24px 56px rgb(31 35 40 / 0.16), 0 8px 16px rgb(31 35 40 / 0.06);
  --shadow-accent: 0 8px 20px rgb(244 0 0 / 0.26);

  /* ---------------------------------------------------------------------
     8. MOTION
     --------------------------------------------------------------------- */
  --ease-out:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 140ms;
  --duration-base: 240ms;
  --duration-slow: 420ms;
  --duration-reveal: 700ms;

  /* ---------------------------------------------------------------------
     9. ELEVATION ORDER
     --------------------------------------------------------------------- */
  --z-base:    1;
  --z-raised:  10;
  --z-sticky:  100;
  --z-header:  200;
  --z-drawer:  300;
  --z-float:   400;
}
