/* Munshi design tokens: "Hisaab, drawn to scale".
   Ink on paper. Colour carries meaning, never decoration, and never alone (every coloured mark also has a word, glyph or pattern):
     in    money coming in (green, and green means nothing else)
     out   money going out (a neutral blue)
     owed  money owed to the shop (terracotta; older debt is drawn denser, not redder)
     alert something needs attention (amber)
   Actions are ink. Themes: light by default, dark from the system or from data-theme on <html>. */

@font-face {
  font-family: "Source Sans 3";
  src: url("/common/fonts/sourcesans3.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("/common/fonts/notonastaliqurdu.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Noto Naskh Arabic";
  src: url("/common/fonts/notonaskharabic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  color-scheme: light;

  /* Latin first so digits and "Rs" always come from Source Sans, even inside Urdu text. */
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* Urdu is set in Nastaliq throughout; Naskh is only a fallback if the Nastaliq file fails to load. */
  --font-urdu: "Noto Nastaliq Urdu", "Source Sans 3", "Noto Naskh Arabic", "Segoe UI", serif;
  --font-urdu-read: var(--font-urdu);
  /* Small and dense Urdu (table cells, stamps, captions) reads better in Naskh, which is shorter and more compact. */
  --font-urdu-compact: "Noto Naskh Arabic", "Source Sans 3", "Segoe UI", Tahoma, sans-serif;

  /* Paper and ink */
  --paper: #f8f9f7;
  --sunken: #eef1ee;
  --surface: #ffffff;
  --ink: #14202b;
  --ink-hover: #2a3946;
  --ink-2: #4b5866;
  --ink-3: #5f6b77;
  --rule: #dde3e3;
  --rule-strong: #c3ccd0;
  --on-ink: #f8f9f7;

  /* Actions are ink; the soft tint marks selection and focus halos. */
  --action: var(--ink);
  --action-hover: var(--ink-hover);
  --action-ink: #14202b;
  --action-soft: #e2e8ec;
  --on-action: var(--on-ink);

  /* Meanings */
  --in: #1d6b50;
  --in-soft: #e2efe8;
  --out: #2d4f86;
  --out-soft: #e4eaf5;
  --owed: #b0432a;
  --owed-soft: #f7e5df;
  --alert: #845600;
  --alert-soft: #f5ead2;

  --scrim: rgb(20 32 43 / 0.4);
  --shadow-pop: 0 1px 2px rgb(20 32 43 / 0.06), 0 12px 32px -12px rgb(20 32 43 / 0.24);
  --shadow-sheet: 0 -8px 40px -12px rgb(20 32 43 / 0.28);

  /* Type scale: fixed rem steps, ratio ~1.17. */
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.375rem;

  /* Space: 4px base. */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Motion. Strong ease-out for entrances, drawer curve for sheets. Nothing above 300ms. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 120ms;
  --dur-fast: 160ms;
  --dur: 220ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0e1318;
    --sunken: #0a0e12;
    --surface: #151c23;
    --ink: #e7ebee;
    --ink-hover: #c9d0d6;
    --ink-2: #aab4bd;
    --ink-3: #8a959f;
    --rule: #26303a;
    --rule-strong: #384552;
    --on-ink: #0e1318;
    --action-ink: #e7ebee;
    --action-soft: #223040;
    --in: #5cc29b;
    --in-soft: #15291f;
    --out: #93b2ea;
    --out-soft: #172235;
    --owed: #ef8b6d;
    --owed-soft: #2e1a14;
    --alert: #e3b24f;
    --alert-soft: #2a2110;
    --scrim: rgb(0 0 0 / 0.55);
    --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.6);
    --shadow-sheet: 0 -8px 40px -12px rgb(0 0 0 / 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e1318;
  --sunken: #0a0e12;
  --surface: #151c23;
  --ink: #e7ebee;
  --ink-hover: #c9d0d6;
  --ink-2: #aab4bd;
  --ink-3: #8a959f;
  --rule: #26303a;
  --rule-strong: #384552;
  --on-ink: #0e1318;
  --action-ink: #e7ebee;
  --action-soft: #223040;
  --in: #5cc29b;
  --in-soft: #15291f;
  --out: #93b2ea;
  --out-soft: #172235;
  --owed: #ef8b6d;
  --owed-soft: #2e1a14;
  --alert: #e3b24f;
  --alert-soft: #2a2110;
  --scrim: rgb(0 0 0 / 0.55);
  --shadow-pop: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.6);
  --shadow-sheet: 0 -8px 40px -12px rgb(0 0 0 / 0.6);
}
