/**
 * NTK IronCRM — Marketing site design tokens (Plan 086 / 108).
 * Brand purple from matrix-brand-splash.json — intentional, not generic slop.
 */

:root,
html[data-theme="light"] {
  color-scheme: light;

  /* Brand — matrix splash */
  --brand-purple-primary: #9333ea;
  --brand-purple-deep: #7c3aed;
  --brand-purple-glow: #a855f7;
  --brand-purple-muted: #6d28d9;
  --brand-bg-deep: #0b0614;
  --brand-bg-alt: #12081f;

  /* Semantic surfaces */
  --color-bg: #fafafc;
  --color-bg-elevated: #ffffff;
  --color-bg-subtle: #f3f0f9;
  --color-bg-inverse: var(--brand-bg-deep);
  --color-surface: #ffffff;
  --color-surface-hover: #f8f6fc;
  --color-border: #e4e0ec;
  --color-border-strong: #cfc6de;

  /* Text — WCAG AA on light surfaces */
  --color-text: #1a1523;
  --color-text-muted: #5c5368;
  --color-text-subtle: #7a7089;
  --color-text-inverse: #f5f0ff;
  --color-text-on-brand: #ffffff;

  /* Actions */
  --color-primary: var(--brand-purple-deep);
  --color-primary-hover: var(--brand-purple-primary);
  --color-primary-active: var(--brand-purple-muted);
  --color-primary-subtle: #ede5fb;
  --color-focus-ring: var(--brand-purple-glow);
  --color-success: #15803d;
  --color-warning: #b45309;
  --color-danger: #b91c1c;

  /* Typography — IRANSans self-hosted (project-laws.mdc) */
  --font-sans: IRANSans, Tahoma, Arial, sans-serif;
  --font-mono: Consolas, "Courier New", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-hero: clamp(1.75rem, 4vw, 2.75rem);

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --leading-tight: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout */
  --shell-max: 72rem;
  --shell-narrow: 42rem;
  --header-height: 4rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-pill: 9999px;

  /* Elevation — restrained (anti-slop: no blur on everything) */
  --shadow-sm: 0 1px 2px rgb(26 21 35 / 0.06);
  --shadow-md: 0 4px 16px rgb(26 21 35 / 0.08);
  --shadow-lg: 0 12px 32px rgb(26 21 35 / 0.12);
  --shadow-brand: 0 8px 28px rgb(124 58 237 / 0.22);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 120ms;
  --duration-normal: 220ms;

  /* Z-index */
  --z-header: 100;
  --z-nav-overlay: 200;
  --z-skip: 300;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: var(--brand-bg-deep);
  --color-bg-elevated: var(--brand-bg-alt);
  --color-bg-subtle: #1a0f2e;
  --color-bg-inverse: #fafafc;
  --color-surface: #160d26;
  --color-surface-hover: #1f1235;
  --color-border: #2d1f45;
  --color-border-strong: #3f2d5c;

  --color-text: #f0e8ff;
  --color-text-muted: #c4b5d9;
  --color-text-subtle: #9b8ab8;
  --color-text-inverse: #1a1523;
  --color-text-on-brand: #ffffff;

  --color-primary: var(--brand-purple-glow);
  --color-primary-hover: #c084fc;
  --color-primary-active: var(--brand-purple-primary);
  --color-primary-subtle: #2a1847;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.5);
  --shadow-brand: 0 8px 28px rgb(147 51 234 / 0.35);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;

    --color-bg: var(--brand-bg-deep);
    --color-bg-elevated: var(--brand-bg-alt);
    --color-bg-subtle: #1a0f2e;
    --color-bg-inverse: #fafafc;
    --color-surface: #160d26;
    --color-surface-hover: #1f1235;
    --color-border: #2d1f45;
    --color-border-strong: #3f2d5c;

    --color-text: #f0e8ff;
    --color-text-muted: #c4b5d9;
    --color-text-subtle: #9b8ab8;
    --color-text-inverse: #1a1523;
    --color-text-on-brand: #ffffff;

    --color-primary: var(--brand-purple-glow);
    --color-primary-hover: #c084fc;
    --color-primary-active: var(--brand-purple-primary);
    --color-primary-subtle: #2a1847;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
    --shadow-md: 0 4px 16px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 0.5);
    --shadow-brand: 0 8px 28px rgb(147 51 234 / 0.35);
  }
}
