/* torenaOS v1.0 canonical tokens. Components consume semantic tokens only. */
:root,
[data-to-theme="light"] {
  color-scheme: light;

  --to-color-brand-50: #edf8ec;
  --to-color-brand-100: #d8efd5;
  --to-color-brand-500: #1a8313;
  --to-color-brand-600: #146b0f;
  --to-color-brand-700: #10550d;
  --to-color-blue-500: #2768d8;
  --to-color-amber-500: #a85d00;
  --to-color-red-500: #b43a32;
  --to-color-purple-500: #7446b8;
  --to-color-gray-500: #68716b;

  --to-bg-canvas: #f5f7f5;
  --to-bg-surface: #ffffff;
  --to-bg-subtle: #eef2ef;
  --to-bg-interactive: #f8faf8;
  --to-bg-selected: #edf8ec;
  --to-bg-elevated: #ffffff;
  --to-text-primary: #171a18;
  --to-text-secondary: #545f57;
  --to-text-disabled: #7d877f;
  --to-border-default: #d4dcd6;
  --to-border-subtle: #e4e9e5;
  --to-border-strong: #aeb9b1;
  --to-action-primary: #146b0f;
  --to-action-primary-hover: #10550d;
  --to-action-on-primary: #ffffff;
  --to-action-secondary: #2768d8;
  --to-focus-ring: #1765cf;
  --to-overlay: rgb(13 20 15 / 48%);

  --to-state-new-bg: #e3f5e4;
  --to-state-new-text: #105f24;
  --to-state-attention-bg: #fff0cc;
  --to-state-attention-text: #754100;
  --to-state-critical-bg: #fde9e7;
  --to-state-critical-text: #952c25;
  --to-state-info-bg: #e7effd;
  --to-state-info-text: #2456a5;
  --to-state-ai-bg: #f1eafa;
  --to-state-ai-text: #63359f;
  --to-state-neutral-bg: #ebefec;
  --to-state-neutral-text: #4e5851;

  --to-shadow-raised: 0 1px 2px rgb(17 25 19 / 8%), 0 8px 24px rgb(17 25 19 / 7%);
  --to-shadow-control: 0 1px 2px rgb(17 25 19 / 7%);
  --to-shadow-overlay: 0 24px 64px rgb(13 20 15 / 22%);
}

[data-to-theme="dark"] {
  color-scheme: dark;
  --to-bg-canvas: #121512;
  --to-bg-surface: #191d1a;
  --to-bg-subtle: #222723;
  --to-bg-interactive: #1d221e;
  --to-bg-selected: #1b321c;
  --to-bg-elevated: #202521;
  --to-text-primary: #f3f6f3;
  --to-text-secondary: #b8c1ba;
  --to-text-disabled: #838d85;
  --to-border-default: #343c36;
  --to-border-subtle: #29302b;
  --to-border-strong: #566159;
  --to-action-primary: #55b84c;
  --to-action-primary-hover: #69c961;
  --to-action-on-primary: #0b2409;
  --to-action-secondary: #76a8ff;
  --to-focus-ring: #78adff;
  --to-overlay: rgb(0 0 0 / 68%);

  --to-state-new-bg: #173c20;
  --to-state-new-text: #91e39b;
  --to-state-attention-bg: #46320e;
  --to-state-attention-text: #ffd27a;
  --to-state-critical-bg: #48211f;
  --to-state-critical-text: #ffaaa3;
  --to-state-info-bg: #1c3154;
  --to-state-info-text: #a8c8ff;
  --to-state-ai-bg: #34234c;
  --to-state-ai-text: #d2b2ff;
  --to-state-neutral-bg: #2a302b;
  --to-state-neutral-text: #c4ccc6;

  --to-shadow-raised: 0 1px 2px rgb(0 0 0 / 35%), 0 8px 24px rgb(0 0 0 / 24%);
  --to-shadow-control: 0 1px 2px rgb(0 0 0 / 32%);
  --to-shadow-overlay: 0 24px 64px rgb(0 0 0 / 48%);
}

:root {
  --to-font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --to-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --to-font-size-xs: 0.75rem;
  --to-font-size-sm: 0.875rem;
  --to-font-size-md: 1rem;
  --to-font-size-lg: 1.125rem;
  --to-font-size-xl: 1.375rem;
  --to-font-size-2xl: 1.75rem;
  --to-line-tight: 1.2;
  --to-line-body: 1.5;
  --to-weight-regular: 400;
  --to-weight-medium: 550;
  --to-weight-semibold: 650;

  --to-space-0: 0;
  --to-space-1: 0.25rem;
  --to-space-2: 0.5rem;
  --to-space-3: 0.75rem;
  --to-space-4: 1rem;
  --to-space-5: 1.25rem;
  --to-space-6: 1.5rem;
  --to-space-8: 2rem;
  --to-space-10: 2.5rem;
  --to-space-12: 3rem;

  --to-radius-sm: 0.375rem;
  --to-radius-md: 0.625rem;
  --to-radius-lg: 0.875rem;
  --to-radius-xl: 1.25rem;
  --to-radius-full: 999px;

  --to-icon-sm: 1rem;
  --to-icon-md: 1.25rem;
  --to-icon-lg: 1.5rem;
  --to-control-sm: 2.25rem;
  --to-control-md: 2.75rem;
  --to-control-lg: 3rem;
  --to-touch-target: 2.75rem;

  --to-layout-max: 100rem;
  --to-layout-gutter: clamp(1rem, 2.5vw, 2.5rem);
  --to-drawer-width: 25rem;
  --to-help-drawer-width: 30rem;

  --to-duration-fast: 120ms;
  --to-duration-base: 180ms;
  --to-duration-slow: 260ms;
  --to-ease-standard: cubic-bezier(0.2, 0, 0, 1);

  --to-z-base: 0;
  --to-z-dropdown: 20;
  --to-z-sticky: 30;
  --to-z-overlay: 40;
  --to-z-drawer: 50;
  --to-z-toast: 60;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --to-duration-fast: 1ms;
    --to-duration-base: 1ms;
    --to-duration-slow: 1ms;
  }
}
