/*
 * FoodPlan design tokens (docs/SPEC.md "Visuelles Design").
 * The ONLY place with literal color values. Components use var(--…) exclusively.
 * Light/Dark via light-dark() and color-scheme (system, or forced by [data-theme]).
 */
:root {
  color-scheme: light dark;

  /* Palette */
  --color-primary:          light-dark(#A8DDB5, #8FCFA0);
  --color-primary-strong:   light-dark(#2E7D4F, #B5E8C3);
  --color-primary-soft:     light-dark(#E8F6EC, #1E3326);
  --color-on-primary:       light-dark(#12301E, #0E2116);
  --color-bg:               light-dark(#F2F4F1, #000000);
  --color-surface:          light-dark(#FFFFFF, #1C1F1D);
  --color-surface-raised:   light-dark(#FFFFFF, #262A27);
  --color-text:             light-dark(#1A1F1B, #F2F5F3);
  --color-text-secondary:   light-dark(#69716B, #9AA39C);  /* SPEC #6B736D, darkened for AA on --color-bg */
  --color-danger:           light-dark(#E8857A, #F09C92);
  --color-danger-strong:    light-dark(#A93A2E, #F09C92);  /* text/icons (contrast ≥ 4.5:1) */
  --color-warning:          light-dark(#F3C98B, #F5D3A0);
  --color-warning-strong:   light-dark(#7A4E0E, #F5D3A0);  /* text/icons (contrast ≥ 4.5:1) */
  --color-separator:        light-dark(rgb(26 31 27 / 0.12), rgb(242 245 243 / 0.14));
  --color-fill:             light-dark(rgb(26 31 27 / 0.06), rgb(242 245 243 / 0.10));
  --color-overlay:          light-dark(rgb(26 31 27 / 0.32), rgb(0 0 0 / 0.55));

  /* Category pastels (shopping categories, tags, avatars) */
  --cat-mint:      light-dark(#CDEFD6, #2B4A35);
  --cat-sky:       light-dark(#CFE6F7, #24405A);
  --cat-lavender:  light-dark(#E2DAF5, #3A3456);
  --cat-peach:     light-dark(#FAD9C4, #553A2B);
  --cat-lemon:     light-dark(#F7EDB0, #4D4626);
  --cat-rose:      light-dark(#F6D3DC, #4E2E38);

  /* Liquid glass */
  --glass-bg:      light-dark(rgb(255 255 255 / 0.66), rgb(38 42 39 / 0.62));
  --glass-border:  light-dark(rgb(255 255 255 / 0.85), rgb(255 255 255 / 0.12));
  --glass-shadow:  light-dark(0 8px 32px rgb(26 31 27 / 0.12), none);
  --glass-blur:    blur(24px) saturate(180%);
  --shadow-card:   light-dark(0 1px 3px rgb(26 31 27 / 0.06), none);

  /* Typography (system font only, no font files) */
  --font-sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --text-large-title: 2.125rem;  /* 34 pt */
  --text-title: 1.375rem;        /* 22 pt */
  --text-headline: 1.0625rem;    /* 17 pt semibold */
  --text-body: 1.0625rem;        /* 17 pt */
  --text-subhead: 0.9375rem;     /* 15 pt */
  --text-footnote: 0.8125rem;    /* 13 pt */
  --text-caption: 0.75rem;       /* 12 pt */

  /* Shapes & spacing (8 pt grid) */
  --radius-card: 12px;
  --radius-sheet: 20px;
  --radius-control: 10px;
  --radius-full: 999px;
  --space-half: 4px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --touch: 44px;

  /* Layout */
  --tabbar-height: 64px;
  --navbar-height: 44px;
  --content-max: 680px;
  --content-max-wide: 960px;     /* admin area (desktop) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* Motion (transform/opacity only) */
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 200ms;
  --dur: 280ms;
  --dur-slow: 350ms;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; }
}
