/*
 * @chaveztech/tokens · base.css
 * Scales and state colors that do not depend on the brand. Same names and values as the :root
 * block of apps/web/src/styles.css, so the staff app can import this file later without renames.
 * Theme: light on :root; dark on :root[data-theme='dark'], and also when the device asks for dark
 * and nothing was chosen (:root:not([data-theme]), the no-JavaScript case).
 * Keep the two dark blocks identical: test/tokens.test.mjs fails if they drift.
 */
:root {
  /* Spacing, 4-point scale. 7 to 9 are for page sections. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* Type scale. Body copy is 16px (17px on wide screens) and set by each surface. */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 22px;
  --text-2xl: 26px;
  --text-display-sm: clamp(1.625rem, 2.4vw + 1rem, 2.5rem);
  --text-display: clamp(2.125rem, 4.2vw + 1rem, 3.5rem);

  /* Shape and touch target. */
  --radius: 12px;
  --radius-sm: 8px;
  --touch: 44px;

  /* Motion: change of state only. Surfaces turn it off with prefers-reduced-motion (below). */
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* State colors. Meaning always comes with text; never use them as the brand color. */
  --success: #0f7b57;
  --success-bg: #e5f5ee;
  --warn: #a35a06;
  --warn-bg: #fdf1e1;
  --danger: #c0352d;
  --danger-bg: #fdecea;
  --info: #2a62c9;
  --info-bg: #e8effc;

  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.04);
  --shadow-lg: 0 12px 40px rgb(16 24 40 / 0.18);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --success: #3fc28f;
  --success-bg: #10291f;
  --warn: #f0a44b;
  --warn-bg: #2d2010;
  --danger: #f2756b;
  --danger-bg: #301614;
  --info: #79a6f2;
  --info-bg: #142039;
  --shadow-sm: none;
  --shadow-lg: 0 16px 48px rgb(0 0 0 / 0.55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --success: #3fc28f;
    --success-bg: #10291f;
    --warn: #f0a44b;
    --warn-bg: #2d2010;
    --danger: #f2756b;
    --danger-bg: #301614;
    --info: #79a6f2;
    --info-bg: #142039;
    --shadow-sm: none;
    --shadow-lg: 0 16px 48px rgb(0 0 0 / 0.55);
    color-scheme: dark;
  }
}

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