// tokens.jsx — SaveHor design tokens
// Three palette options exposed via Tweaks; default is "sage".
// Type pairings exposed via Tweaks.

const PALETTES = {
  sage: {
    name: 'Sage',
    bg:        '#FAF8F3',  // warm off-white
    surface:   '#FFFFFF',
    surfaceAlt:'#F2EEE5',  // faint warm grey card
    primary:   '#2E6B4A',  // deep sage — primary actions
    primaryDk: '#23533A',
    primarySoft:'#E5EFE5',
    nav:       '#2E6B4A',
    navInactive:'#9AA29C',
    accent:    '#E0A24E',  // honey amber — "I did it" / celebratory contrast
    accentSoft:'#FaefD9',
    sand:      '#E8DCC4',
    sandDk:    '#A8946C',
    sky:       '#7A9CB8',  // water heater category
    skySoft:   '#E2ECF3',
    text:      '#1F2A24',
    textMuted: '#5C6660',
    textLight: '#8A938E',
    border:    '#E5E2D9',
    borderSoft:'#EFEAE0',
    danger:    '#B85C4A',
    dangerSoft:'#FBE8E2',
    warn:      '#C99A3E',
    warnSoft:  '#FAEFD8',
    good:      '#4A8964',
    goodSoft:  '#E2EFE6',
  },
  eucalyptus: {
    name: 'Eucalyptus',
    bg:        '#F7F6F1',
    surface:   '#FFFFFF',
    surfaceAlt:'#EEEEE6',
    primary:   '#3F7A6A',  // cooler teal-green
    primaryDk: '#2F5E51',
    primarySoft:'#E2EDE9',
    nav:       '#3F7A6A',
    navInactive:'#9AA29C',
    accent:    '#D89A4A',
    accentSoft:'#F7EBD4',
    sand:      '#E1D7BF',
    sandDk:    '#A38D5F',
    sky:       '#6E94B0',
    skySoft:   '#DFE9F0',
    text:      '#1B2925',
    textMuted: '#566561',
    textLight: '#8A938E',
    border:    '#E2DFD6',
    borderSoft:'#EBE6DC',
    danger:    '#B05848',
    dangerSoft:'#F8E5DE',
    warn:      '#C2913A',
    warnSoft:  '#F6EAD0',
    good:      '#4F8A70',
    goodSoft:  '#DFEDE5',
  },
  tea: {
    name: 'Tea Green',
    bg:        '#F8F6EE',
    surface:   '#FFFFFF',
    surfaceAlt:'#EEEBDF',
    primary:   '#5A7C4D',  // softer matcha
    primaryDk: '#43603A',
    primarySoft:'#E5EAD9',
    nav:       '#5A7C4D',
    navInactive:'#9FA597',
    accent:    '#E0A352',
    accentSoft:'#FaeED6',
    sand:      '#EAE0C2',
    sandDk:    '#AD9866',
    sky:       '#8298A5',
    skySoft:   '#E1E7EC',
    text:      '#202821',
    textMuted: '#5A6356',
    textLight: '#8A8E84',
    border:    '#E5E1D2',
    borderSoft:'#EEE9D8',
    danger:    '#B86650',
    dangerSoft:'#F8E6DD',
    warn:      '#C49642',
    warnSoft:  '#F4ECD3',
    good:      '#5C8A60',
    goodSoft:  '#E0EAD8',
  },
};

const TYPE_PAIRS = {
  dmsans:  { name: 'DM Sans',           ui: '"DM Sans", system-ui, sans-serif', num: '"DM Sans", system-ui, sans-serif', stack: 'DM+Sans:wght@400;500;600;700' },
  jakarta: { name: 'Plus Jakarta Sans', ui: '"Plus Jakarta Sans", system-ui, sans-serif', num: '"Plus Jakarta Sans", system-ui, sans-serif', stack: 'Plus+Jakarta+Sans:wght@400;500;600;700' },
  manrope: { name: 'Manrope',           ui: '"Manrope", system-ui, sans-serif', num: '"Manrope", system-ui, sans-serif', stack: 'Manrope:wght@400;500;600;700' },
};

// Type ramp — relative sizes; consumers compose with vars.
const TYPE = {
  display: { size: 32, line: 38, weight: 700, letter: -0.5 },
  h1:      { size: 26, line: 32, weight: 700, letter: -0.3 },
  h2:      { size: 20, line: 26, weight: 600, letter: -0.2 },
  h3:      { size: 17, line: 22, weight: 600, letter: -0.1 },
  bodyL:   { size: 16, line: 24, weight: 500, letter: -0.05 },
  body:    { size: 15, line: 22, weight: 400, letter: 0 },
  caption: { size: 13, line: 18, weight: 500, letter: 0 },
  micro:   { size: 11, line: 14, weight: 600, letter: 0.4 },
};

const RADII = { sm: 8, md: 12, lg: 16, xl: 20, xxl: 28, pill: 999 };
const SPACE = { xs: 4, sm: 8, md: 12, lg: 16, xl: 20, xxl: 24, xxxl: 32, huge: 40 };
const SHADOWS = {
  none: 'none',
  sm:   '0 1px 2px rgba(20,30,25,0.04), 0 1px 1px rgba(20,30,25,0.03)',
  md:   '0 2px 4px rgba(20,30,25,0.04), 0 6px 16px rgba(20,30,25,0.06)',
  lg:   '0 6px 16px rgba(20,30,25,0.07), 0 18px 40px rgba(20,30,25,0.08)',
  card: '0 1px 0 rgba(20,30,25,0.04), 0 6px 18px rgba(20,30,25,0.05)',
};

Object.assign(window, { PALETTES, TYPE_PAIRS, TYPE, RADII, SPACE, SHADOWS });
