/*
 * Global design tokens: the raw scales (spacing, typography, radius, z-index,
 * shadows) used by all other CSS files. This file must be loaded after
 * color-palette.css (the .dark-theme shadows use palette colors) and before
 * app.css. Semantic color tokens live in app.css and ui-components.css.
 */
@layer base {
    :root {
        /* spacing scale based on 4px increments; prefer these tokens over
           hardcoded values for margin/padding/gap */
        --spacing-1: 0.25rem; /* 4px */
        --spacing-2: 0.5rem; /* 8px */
        --spacing-3: 0.75rem; /* 12px */
        --spacing-4: 1rem; /* 16px */
        --spacing-5: 1.25rem; /* 20px */
        --spacing-6: 1.5rem; /* 24px */
        --spacing-8: 2rem; /* 32px */
        --spacing-10: 2.5rem; /* 40px */
        --spacing-12: 3rem; /* 48px */
        --spacing-16: 4rem; /* 64px */

        --font-family-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
        --font-family-monospace: 'JetBrains Mono', ui-monospace, 'Roboto Mono', SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
        --font-family-base: var(--font-family-system);

        --font-size-xs: 0.75rem; /* 12px */
        --font-size-sm: 0.875rem; /* 14px */
        --font-size-md: 1rem; /* 16px */
        --font-size-lg: 1.125rem; /* 18px */
        --font-size-xl: 1.25rem; /* 20px */
        --font-size-2xl: 1.5rem; /* 24px */
        --font-size-3xl: 1.875rem; /* 30px */
        --font-size-4xl: 2.25rem; /* 36px */

        --line-height-xs: 1.25;
        --line-height-sm: 1.4;

        --font-weight-light: 300;
        --font-weight-normal: 400;
        --font-weight-medium: 500;
        --font-weight-semibold: 600;
        --font-weight-bold: 700;

        --radius-xs: 0.125rem; /* 2px */
        --radius-sm: 0.1875rem; /* 3px */
        --radius-md: 0.375rem; /* 6px */
        --radius-lg: 0.75rem; /* 12px */
        --radius-xl: 1rem; /* 16px */
        --radius-2xl: 1.25rem; /* 20px */
        --radius-full: 9999px; /* pill shape */
        --radius-circle: 50%;

        --prose-max-width: 800px;

        /* z-index scale; the 1000-1090 tiers match Bootstrap 5.3 so that our
           overlays stack correctly with Bootstrap's offcanvas/modal/tooltip */
        --z-below: -1;
        --z-base: 0;
        --z-dropdown: 1000;
        --z-sticky: 1020;
        --z-fixed: 1030;
        --z-offcanvas-backdrop: 1040;
        --z-offcanvas: 1045;
        --z-modal-backdrop: 1050;
        --z-modal: 1055;
        --z-popover: 1070;
        --z-tooltip: 1080;
        --z-toast: 1090;
        --z-max: 9999;

        --shadow-sm: 0 1px 2px 0 rgba(156, 163, 175, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(156, 163, 175, 0.3), 0 2px 4px -2px rgba(156, 163, 175, 0.4);
        --shadow-lg: 0 10px 15px -3px rgba(156, 163, 175, 0.3), 0 4px 6px -4px rgba(156, 163, 175, 0.4);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    }

    /* shadows change more than just a color per theme, so they can't use light-dark() */
    .dark-theme {
        --shadow-sm: 0 1px 2px 0 var(--gray-900);
        --shadow-md: 0 4px 6px -1px var(--gray-900), 0 2px 4px -2px var(--gray-900);
        --shadow-lg: 0 10px 15px -3px var(--gray-900), 0 4px 6px -4px var(--gray-900);
        --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 8px 10px -6px rgba(0, 0, 0, 0.8);
    }
}
