/* ==========================================================================
   KhataInsight design tokens — single source of truth.
   Documented in docs/05-design/design-system.md. Engineers import or port this.
   Light theme only (dark mode is out of scope).
   ========================================================================== */

:root {
  /* ---- Brand colours (client-supplied, binding) ---- */
  --ki-navy: #0B2A4A;        /* Deep Navy  — primary, headings, navy bands, navy button */
  --ki-green: #2FA65A;       /* Emerald    — accent only; never body text */
  --ki-off-white: #F7F9FA;   /* Off White  — page and alternate section background */
  --ki-charcoal: #25313B;    /* Charcoal   — body text */
  --ki-soft-grey: #E8EDF0;   /* Soft Grey  — hairlines, dividers, quiet fills */
  --ki-white: #FFFFFF;

  /* ---- Derived neutrals and states (agency extensions, all contrast-checked) ---- */
  --ki-navy-700: #123A63;    /* navy button hover, raised surface on navy */
  --ki-navy-900: #08213B;    /* pressed navy */
  --ki-slate: #52606B;       /* secondary text: 6.5:1 on white, 6.1:1 on off-white */
  --ki-grey-500: #7D8B97;    /* form-field borders: 3.5:1 on white (UI contrast) */
  --ki-grey-300: #D3DBE0;    /* stronger hairline, chart baseline */
  --ki-green-400: #3DB86B;   /* green button hover (navy text 5.7:1) */
  --ki-green-tint: #EAF6EE;  /* quiet green wash for chips and highlights */
  --ki-danger: #B42318;      /* form errors: 6.6:1 on white */
  --ki-danger-tint: #FEF3F2;

  /* ---- Semantic roles ---- */
  --color-bg: var(--ki-off-white);
  --color-surface: var(--ki-white);
  --color-surface-alt: var(--ki-off-white);
  --color-heading: var(--ki-navy);
  --color-text: var(--ki-charcoal);
  --color-text-muted: var(--ki-slate);
  --color-line: var(--ki-soft-grey);
  --color-line-strong: var(--ki-grey-300);
  --color-accent: var(--ki-green);
  --color-link: var(--ki-navy);
  --color-focus: var(--ki-navy);

  /* on navy */
  --on-navy: #FFFFFF;                       /* 14.5:1 */
  --on-navy-muted: #C5D0DA;                 /* 9.3:1 */
  --on-navy-subtle: #9FB0BF;                /* 6.5:1, captions only */
  --on-navy-line: rgba(255, 255, 255, 0.14);
  --on-navy-line-strong: rgba(255, 255, 255, 0.28);

  /* ---- Typography ---- */
  --font-heading: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --fs-display: clamp(2.25rem, 1.55rem + 3vw, 4rem);        /* 36 → 64  H1 */
  --fs-h2: clamp(1.75rem, 1.22rem + 2.25vw, 3rem);          /* 28 → 48 */
  --fs-h3: clamp(1.25rem, 1.14rem + 0.45vw, 1.5rem);        /* 20 → 24 */
  --fs-h4: 1.125rem;                                        /* 18 */
  --fs-statement: clamp(1.25rem, 1.03rem + 0.95vw, 1.75rem);/* 20 → 28 large editorial text */
  --fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);       /* 17 → 20 */
  --fs-body: 1rem;                                          /* 16 */
  --fs-small: 0.875rem;                                     /* 14 */
  --fs-caption: 0.8125rem;                                  /* 13 */
  --fs-eyebrow: 0.75rem;                                    /* 12, uppercase, tracked */

  --lh-display: 1.04;
  --lh-heading: 1.12;
  --lh-snug: 1.3;
  --lh-body: 1.65;

  --ls-display: -0.035em;
  --ls-heading: -0.025em;
  --ls-eyebrow: 0.14em;

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

  /* ---- Spacing (4 px base; use only these steps) ---- */
  --space-1: 0.25rem;  /* 4 */
  --space-2: 0.5rem;   /* 8 */
  --space-3: 0.75rem;  /* 12 */
  --space-4: 1rem;     /* 16 */
  --space-5: 1.5rem;   /* 24 */
  --space-6: 2rem;     /* 32 */
  --space-7: 2.5rem;   /* 40 */
  --space-8: 3rem;     /* 48 */
  --space-9: 4rem;     /* 64 */
  --space-10: 5rem;    /* 80 */
  --space-11: 6rem;    /* 96 */
  --space-12: 8rem;    /* 128 */

  --section-y: clamp(4rem, 2.6rem + 6vw, 8rem);        /* 64 → 128 section padding */
  --section-head-gap: clamp(2.5rem, 1.8rem + 3vw, 4.5rem); /* heading → content */
  --gutter: clamp(1.25rem, 0.55rem + 3vw, 3rem);       /* 20 → 48 page side padding */
  --grid-gap: clamp(1.25rem, 0.9rem + 1.5vw, 2rem);    /* 20 → 32 */

  /* ---- Layout ---- */
  --container: 77.5rem;        /* 1240 content width */
  --container-narrow: 48rem;   /* 768 long-form text (articles, legal) */
  --header-h: 4.5rem;          /* 72 mobile */
  --measure: 62ch;

  /* ---- Radii ---- */
  --radius-xs: 4px;    /* chips, bars */
  --radius-sm: 8px;    /* buttons, inputs */
  --radius-md: 14px;   /* cards, tiles */
  --radius-lg: 20px;   /* panels, dashboard, media */
  --radius-pill: 999px;

  /* ---- Shadows (navy-tinted, soft) ---- */
  --shadow-xs: 0 1px 2px rgba(11, 42, 74, 0.06);
  --shadow-sm: 0 1px 2px rgba(11, 42, 74, 0.05), 0 4px 12px rgba(11, 42, 74, 0.05);
  --shadow-md: 0 2px 4px rgba(11, 42, 74, 0.04), 0 12px 32px rgba(11, 42, 74, 0.08);
  --shadow-lg: 0 4px 8px rgba(11, 42, 74, 0.04), 0 32px 72px rgba(11, 42, 74, 0.14);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-fast: 150ms;
  --dur-base: 240ms;
  --dur-reveal: 640ms;

  /* ---- Layers ---- */
  --z-header: 100;
  --z-menu: 90;
  --z-float: 80;
}

@media (min-width: 64em) {
  :root { --header-h: 5.25rem; } /* 84 desktop */
}

/* Breakpoints (reference; custom properties cannot be used in media queries)
   sm 30em (480) · md 48em (768) · lg 64em (1024) · xl 80em (1280) · 2xl 90em (1440) */
