/**
 * ProtonIQ Design Tokens
 * ----------------------
 * Single source of truth for color, type, radius, elevation and motion.
 *
 * Palettes are stored as space-separated RGB channels so they can be used
 * with or without alpha:  rgb(var(--gray-200))  /  rgb(var(--blue-600) / 0.2)
 *
 * The Tailwind config (js/theme/tailwind-config.js) maps Tailwind's palette
 * names onto these variables, so `bg-gray-50`, `text-blue-600`, etc. in JS
 * templates and hand-written CSS in styles.css/components.css all resolve to
 * the same values. Change a value here and the whole app follows.
 */

:root {
    /* Palette mirrors the Proton website (prmsolutions/proton-website,
       src/app/globals.css @theme) so the app and the site read as one brand.
       Website name → token: ink → gray-900, body → gray-600, muted → gray-500,
       faint → gray-400 (non-text only), hairline → gray-200, surface → gray-50,
       brand → blue, clay → red, lime → lime. */

    /* ---------- Neutral (Proton ink, warm surfaces) ---------- */
    --gray-0: 255 255 255;
    --gray-25: 252 252 251;
    --gray-50: 250 250 248;    /* surface */
    --gray-75: 247 246 243;    /* surface-warm */
    --gray-100: 243 242 247;
    --gray-150: 237 236 243;   /* hairline-soft */
    --gray-200: 232 231 239;   /* hairline */
    --gray-300: 211 209 223;
    --gray-400: 143 139 164;
    --gray-500: 111 107 133;   /* muted */
    --gray-600: 85 81 110;     /* body */
    --gray-700: 64 60 94;
    --gray-800: 46 42 82;      /* ink-muted */
    --gray-900: 13 7 69;       /* ink */
    --gray-950: 8 4 48;

    /* ---------- Ink chrome (navy app frame) ---------- */
    --ink: 13 7 69;
    --ink-soft: 26 20 96;
    --ink-frame: 34 27 102;
    --on-ink: 185 180 217;
    --on-ink-soft: 217 214 236;
    --on-ink-faint: 155 151 196;

    /* ---------- Accent (Proton blue) ---------- */
    --blue-50: 242 245 253;
    --blue-100: 233 240 251;
    --blue-200: 207 223 245;
    --blue-300: 169 198 238;
    --blue-400: 123 165 224;
    --blue-500: 82 133 214;
    --blue-600: 55 105 205;
    --blue-700: 45 84 164;
    --blue-800: 36 66 127;
    --blue-900: 24 44 88;
    --blue-950: 13 7 69;

    /* ---------- Signal (lime) ---------- */
    --lime-100: 244 250 210;
    --lime-300: 230 243 148;
    --lime-500: 214 236 76;
    --lime-700: 94 115 6;

    /* ---------- Success ---------- */
    --green-50: 243 249 238;
    --green-100: 230 244 217;  /* status-growing */
    --green-200: 205 233 180;
    --green-300: 169 216 134;
    --green-400: 127 193 85;
    --green-500: 90 163 50;
    --green-600: 63 138 31;
    --green-700: 47 109 22;
    --green-800: 37 85 18;
    --green-900: 28 64 15;
    --green-950: 16 40 8;

    /* ---------- Danger (clay) ---------- */
    --red-50: 254 243 238;
    --red-100: 253 226 214;    /* status-risk */
    --red-200: 251 198 176;
    --red-300: 246 162 131;
    --red-400: 238 127 89;     /* clay-400 */
    --red-500: 227 106 61;
    --red-600: 217 91 40;      /* clay-600 */
    --red-700: 178 67 29;      /* clay-700 */
    --red-800: 140 52 24;
    --red-900: 107 41 20;
    --red-950: 66 24 10;

    /* ---------- Warning ---------- */
    --amber-50: 255 249 232;
    --amber-100: 253 240 200;
    --amber-200: 251 224 150;
    --amber-300: 247 203 95;
    --amber-400: 240 178 50;
    --amber-500: 224 146 20;
    --amber-600: 189 112 6;
    --amber-700: 150 82 8;
    --amber-800: 118 63 12;
    --amber-900: 88 47 12;
    --amber-950: 54 27 4;

    /* ---------- Semantic surfaces ---------- */
    --bg-canvas: rgb(var(--gray-50));
    --bg-subtle: rgb(var(--gray-50));
    --bg-muted: rgb(var(--gray-100));
    --bg-surface: rgb(var(--gray-0));
    --bg-sidebar: rgb(var(--ink));
    --bg-hover: rgb(var(--gray-50));
    --bg-active: rgb(var(--gray-100));
    --bg-selected: rgb(var(--blue-50));
    --bg-inverse: rgb(var(--gray-900));
    --bg-overlay: rgb(var(--gray-950) / 0.32);

    --border-subtle: rgb(var(--gray-100));
    --border-default: rgb(var(--gray-200));
    --border-strong: rgb(var(--gray-300));
    --border-field: rgb(126 121 151);  /* field-edge: 3:1 input boundary */
    --border-focus: rgb(var(--blue-500));

    --text-primary: rgb(var(--gray-900));
    --text-body: rgb(var(--gray-600));
    --text-secondary: rgb(var(--gray-500));
    --text-tertiary: rgb(var(--gray-400));
    --text-inverse: rgb(var(--gray-0));
    --text-link: rgb(var(--blue-600));
    --text-link-hover: rgb(var(--blue-700));

    --accent: rgb(var(--blue-600));
    --accent-hover: rgb(var(--blue-700));
    --accent-subtle: rgb(var(--blue-50));
    --accent-text: rgb(var(--blue-700));
    --signal: rgb(var(--lime-500));

    /* Primary action = navy pill (website <Button variant="primary">) */
    --action-primary: rgb(var(--ink));
    --action-primary-hover: rgb(var(--ink-soft));

    /* ---------- Typography ---------- */
    --font-sans: 'Cabin', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
    --font-features: 'cv11', 'ss01';

    --text-2xs: 11px;
    --text-xs: 12px;
    --text-sm: 13px;
    --text-md: 14px;
    --text-lg: 16px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 28px;

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    --tracking-tight: 0;
    --tracking-tighter: -0.015em;

    /* ---------- Shape ---------- */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;   /* website --radius-tile */
    --radius-xl: 20px;   /* website --radius-card */
    --radius-full: 9999px;

    /* ---------- Elevation ---------- */
    --shadow-xs: 0 1px 2px rgb(var(--ink) / 0.04);
    --shadow-sm: 0 1px 2px rgb(var(--ink) / 0.04), 0 1px 3px rgb(var(--ink) / 0.06);   /* shadow-soft */
    --shadow-md: 0 4px 10px -4px rgb(var(--ink) / 0.12), 0 1px 2px rgb(var(--ink) / 0.06);
    --shadow-lg: 0 12px 24px -8px rgb(var(--ink) / 0.14), 0 4px 8px -4px rgb(var(--ink) / 0.06); /* shadow-lifted */
    --shadow-xl: 0 0 0 1px rgb(var(--ink) / 0.06), 0 12px 30px -16px rgb(var(--ink) / 0.35);  /* shadow-float */
    --shadow-2xl: 0 0 0 1px rgb(var(--ink) / 0.06), 0 32px 64px -36px rgb(var(--ink) / 0.4); /* shadow-mock */
    --shadow-button: 0 0 0 1px rgb(var(--gray-200));
    --shadow-button-primary: 0 1px 2px rgb(var(--ink) / 0.04), 0 1px 3px rgb(var(--ink) / 0.06);
    --ring-focus: 0 0 0 3px rgb(var(--blue-500) / 0.28);
    --ring-danger: 0 0 0 3px rgb(var(--red-500) / 0.24);

    /* ---------- Motion ---------- */
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --duration-fast: 120ms;
    --duration-base: 180ms;

    /* ---------- Layout ---------- */
    --sidebar-width: 220px;
    --sidebar-width-collapsed: 60px;
    --topbar-height: 56px;
    --page-padding-x: 32px;
    --page-padding-y: 24px;
    --page-max-width: 1280px;
}
