/* ==========================================================================
   Challan — design tokens
   One source of truth for colour, type, spacing, radii, elevation, motion.
   ========================================================================== */

@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/caveat-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  /* Neutrals (from the brief) */
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --ink: #111827;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98A2B3;
  --border: #E5E7EB;
  --border-strong: #D0D5DD;
  --workspace: #ECEEF1;

  /* Brand — "Ledger", a deep emerald ink. Trustworthy, not default SaaS blue. */
  --brand: #4338CA;
  --brand-hover: #3730A3;
  --brand-press: #312E81;
  --brand-tint: #EEF0FF;
  --brand-tint-2: #E0E3FF;
  --on-brand: #FFFFFF;

  /* Status — always paired with an icon + text, never colour alone */
  --ok: #067647;      --ok-tint: #ECFDF3;
  --warn: #B54708;    --warn-tint: #FFFAEB;
  --err: #B42318;     --err-tint: #FEF3F2;
  --info: #175CD3;    --info-tint: #EFF8FF;

  /* Type */
  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Arabic", sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, "Noto Serif", serif;
  --font-grotesk: "Space Grotesk", var(--font-ui);
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-script: "Caveat", "Segoe Script", "Bradley Hand", cursive;

  /* Type scale (UI) — 1.2 ratio anchored at 14px */
  --t-xs: 11.5px;
  --t-sm: 12.5px;
  --t-md: 14px;
  --t-lg: 16px;
  --t-xl: 20px;
  --t-2xl: 28px;
  --t-3xl: 40px;
  --t-4xl: clamp(40px, 6.2vw, 76px);

  /* Spacing — 8px base, 4px half-steps */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px;

  /* Radii — hierarchy, not one radius everywhere */
  --r-xs: 6px;    /* chips, tags */
  --r-sm: 8px;    /* small buttons */
  --r-field: 10px;/* inputs */
  --r-md: 12px;   /* popovers, panels */
  --r-lg: 16px;   /* modals */
  --r-pill: 999px;

  /* Elevation — restrained */
  --e-1: 0 1px 2px rgba(16, 24, 40, .06);
  --e-2: 0 4px 12px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --e-3: 0 20px 40px -12px rgba(16, 24, 40, .18), 0 4px 10px -4px rgba(16, 24, 40, .06);
  --e-sheet: 0 1px 1px rgba(16, 24, 40, .04), 0 12px 32px -18px rgba(16, 24, 40, .22);

  /* Focus */
  --focus: 0 0 0 3px rgba(67, 56, 202, .22);
  --focus-ring: 2px solid #4338CA;

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --d-fast: 120ms;
  --d-med: 220ms;

  /* Icons */
  --i-sm: 14px; --i-md: 16px; --i-lg: 20px;

  /* Layout */
  --topbar-h: 56px;
  --left-w: 360px;
  --right-w: 300px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --d-fast: 0ms; --d-med: 0ms; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
