/* Design tokens. Every colour, size and duration in the app comes from here; change a value once and it changes everywhere.
   Colours come from the Monna brand palette: Midnight Purple #292B42, Warm Champagne #D5C5A9, Soft Ivory #F5F2EC, Muted Lavender #A7A1C3,
   Deep Ink #222331, plus Sage #47705A / Clay #9E5440 for status. Text colours are checked to WCAG AA (4.5:1) on both --bg and --surface; graphic colours to 3:1. */
:root {
  color-scheme: light dark;

  /* surfaces and text */
  --bg: #F5F2EC;
  --surface: #FBFAF7;
  --surface-2: #EFEBE3;
  --fill: rgba(41, 43, 66, 0.07);
  --label: #222331;
  --label-2: #55566B;
  --label-3: #585970;
  --separator: rgba(41, 43, 66, 0.14);
  --scrim-rgb: 34 35 49;
  --scrim-max: 0.4;
  --bar-bg: rgba(245, 242, 236, 0.84);

  /* glass: a translucent layer over soft palette colour behind it. Bright top edge = light catching the material; the sheen is a faint highlight */
  --glass-bg: rgba(251, 250, 247, 0.58);
  --glass-sheet-bg: rgba(245, 242, 236, 0.8);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --glass-rim: rgba(41, 43, 66, 0.1);
  --glass-sheen: rgba(255, 255, 255, 0.45);
  --glass-shadow: 0 6px 20px rgba(41, 43, 66, 0.12);
  --glow-lavender: rgba(167, 161, 195, 0.42);
  --glow-champagne: rgba(213, 197, 169, 0.55);

  /* meaning: accent is for things you can tap, positive/negative only ever mean money */
  --accent: #292B42;
  --accent-fill: #292B42;
  --on-accent: #F5F2EC; /* text and icons that sit on --accent-fill */
  --accent-soft: rgba(41, 43, 66, 0.08);
  --toast-action: #D5C5A9; /* the toast is dark in light mode, so its button is champagne */
  --positive: #47705A;
  --positive-text: #3B6049;
  --positive-soft: rgba(71, 112, 90, 0.13);
  --negative: #9E5440;
  --negative-text: #94503C;
  --negative-soft: rgba(158, 84, 64, 0.11);
  --warning: #7A6020;
  --warning-text: #7A6020;
  --warning-soft: rgba(122, 96, 32, 0.12);

  /* categories: tones of the brand's lavender, champagne and midnight, never sage or clay (those mean good/bad). The names are stored
     with each category, so they stay even though the hues changed. */
  --c-blue: #4F5486;
  --c-teal: #7A6F96;
  --c-violet: #6A5F9E;
  --c-pink: #8B5F78;
  --c-orange: #8A7440;
  --c-gold: #6B6558;
  --c-cyan: #5F7096;
  --c-indigo: #3B3E63;
  --c-slate: #5A5C73;
  --c-group: #8A84AD;

  /* shape and space (8pt grid) */
  --radius-card: 18px;
  --radius-control: 12px;
  --radius-pill: 999px;
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.25rem; --s6: 1.5rem; --s8: 2rem; --s12: 3rem; /* rem: spacing grows with the user's text size */

  /* type: system fonts only (no downloads, nothing leaves the device) */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-large-title: 2rem;
  --fs-title: 1.375rem;
  --fs-headline: 1.0625rem;
  --fs-body: 1.0625rem;
  --fs-footnote: 0.8125rem;
  --fs-caption: 0.75rem;
  --fs-hero: min(clamp(2.5rem, 9vw, 3.5rem), 14vw); /* the 14vw cap keeps a huge number on-screen at huge text sizes; normal sizes are unaffected */

  /* motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 250ms;

  /* layout */
  --sidebar-w: 16rem;
  --rail-w: 4.75rem;
  --tabbar-h: 3.5rem;
  --topbar-h: 3.25rem;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* an explicit choice in Account > Appearance wins over the device setting */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
