/* VR design kit: tokens. Source of truth for colour, type, radius, shadow and motion.
   Light by default; dark via [data-theme="dark"], the .dark class (next-themes / shadcn),
   or the OS preference when no explicit theme is set ([data-theme="light"] opts out). */

:root {
  /* Type */
  --vr-font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --vr-font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --vr-text-xs: 0.75rem;     /* 12 */
  --vr-text-sm: 0.8125rem;   /* 13 */
  --vr-text-base: 0.9375rem; /* 15 */
  --vr-text-md: 1rem;        /* 16 */
  --vr-text-lg: 1.0625rem;   /* 17 */
  --vr-text-xl: 1.25rem;     /* 20 */
  --vr-text-2xl: 1.5rem;     /* 24 */
  --vr-text-display: clamp(1.75rem, 4.2vw, 2.75rem);
  --vr-leading: 1.55;
  --vr-tracking-tight: -0.015em;
  --vr-tracking-display: -0.03em;

  /* Radius (chatMLS --radius 0.625rem family, rounded up for the softer dashboard look) */
  --vr-radius-xs: 6px;
  --vr-radius-sm: 10px;
  --vr-radius: 14px;
  --vr-radius-lg: 22px;
  --vr-radius-full: 999px;

  /* Spacing scale (4px base) */
  --vr-space-1: 4px;
  --vr-space-2: 8px;
  --vr-space-3: 12px;
  --vr-space-4: 16px;
  --vr-space-5: 20px;
  --vr-space-6: 24px;
  --vr-space-8: 32px;
  --vr-space-10: 40px;
  --vr-space-12: 48px;
  --vr-space-16: 64px;
  --vr-container: 1120px;
  --vr-gutter: 24px;

  /* Motion (chatMLS easings) */
  --vr-ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --vr-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --vr-ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --vr-duration-fast: 150ms;
  --vr-duration: 220ms;
  --vr-duration-slow: 450ms;

  /* Brand (from the VR mark) */
  --vr-brand-green: #00f5a0;
  --vr-brand-cyan: #00e5ff;
  --vr-brand-pink: #ff0066;
  --vr-brand-magenta: #e5007a;
  --vr-brand-gradient: linear-gradient(100deg, var(--vr-brand-green), var(--vr-brand-cyan) 38%, var(--vr-brand-pink) 72%, var(--vr-brand-pink));

  /* Product tile colours */
  --vr-tool-idx: linear-gradient(135deg, #1f2937, #111827);
  --vr-tool-ihf: linear-gradient(135deg, #2563eb, #1e40af);
  --vr-tool-wp: linear-gradient(135deg, #21759b, #135e7e);
  --vr-tool-showcase: linear-gradient(135deg, #7c3aed, #5b21b6);
  --vr-tool-seen: linear-gradient(135deg, #0d9488, #0f766e);
  --vr-tool-neutral: linear-gradient(135deg, #52525b, #3f3f46);
  --vr-assistant-claude: #d97757;

  --vr-z-header: 20;
  --vr-z-overlay: 40;
  --vr-z-toast: 50;
}

@media (max-width: 640px) {
  :root { --vr-gutter: 16px; }
}

/* Light (default) */
:root,
[data-theme="light"] {
  color-scheme: light;
  --vr-background: oklch(0.985 0 0);
  --vr-foreground: oklch(0.16 0 0);
  --vr-card: oklch(1 0 0);
  --vr-card-foreground: oklch(0.16 0 0);
  --vr-popover: oklch(1 0 0);
  --vr-popover-foreground: oklch(0.16 0 0);
  --vr-primary: oklch(0.16 0 0);
  --vr-primary-foreground: oklch(0.985 0 0);
  --vr-secondary: oklch(0.965 0 0);
  --vr-secondary-foreground: oklch(0.24 0 0);
  --vr-muted: oklch(0.965 0 0);
  --vr-muted-foreground: oklch(0.48 0 0);
  --vr-subtle-foreground: oklch(0.36 0 0);
  --vr-accent: oklch(0.955 0 0);
  --vr-accent-foreground: oklch(0.16 0 0);
  --vr-border: oklch(0.91 0 0);
  --vr-border-subtle: oklch(0.95 0 0);
  --vr-border-strong: oklch(0.75 0 0);
  --vr-input: oklch(0.88 0 0);
  --vr-ring: oklch(0.16 0 0);
  --vr-overlay: oklch(0.16 0 0 / 0.36);

  --vr-success: oklch(0.62 0.15 155);
  --vr-success-foreground: oklch(0.45 0.11 155);
  --vr-success-soft: oklch(0.62 0.15 155 / 0.1);
  --vr-warning: oklch(0.74 0.15 75);
  --vr-warning-foreground: oklch(0.5 0.11 65);
  --vr-warning-soft: oklch(0.74 0.15 75 / 0.15);
  --vr-danger: oklch(0.58 0.2 25);
  --vr-destructive: oklch(0.55 0.2 25);
  --vr-danger-foreground: oklch(0.5 0.19 25);
  --vr-danger-soft: oklch(0.58 0.2 25 / 0.09);
  --vr-info: oklch(0.58 0.16 250);
  --vr-info-foreground: oklch(0.47 0.15 255);
  --vr-info-soft: oklch(0.58 0.16 250 / 0.09);

  --vr-shadow-card: 0 1px 3px oklch(0 0 0 / 0.05), 0 1px 1px oklch(0 0 0 / 0.03);
  --vr-shadow-float: 0 12px 32px -10px oklch(0 0 0 / 0.14), 0 2px 8px -2px oklch(0 0 0 / 0.05);
  --vr-shadow-overlay: 0 24px 64px -16px oklch(0 0 0 / 0.25), 0 4px 12px -4px oklch(0 0 0 / 0.08);
  --vr-shadow-composer-focus: 0 18px 50px -14px color-mix(in oklch, var(--vr-brand-pink) 28%, transparent);
  --vr-skeleton-shine: oklch(1 0 0 / 0.6);
}

/* Dark: explicit */
[data-theme="dark"],
.dark {
  color-scheme: dark;
  --vr-background: oklch(0.15 0 0);
  --vr-foreground: oklch(0.96 0 0);
  --vr-card: oklch(0.19 0 0);
  --vr-card-foreground: oklch(0.96 0 0);
  --vr-popover: oklch(0.21 0 0);
  --vr-popover-foreground: oklch(0.96 0 0);
  --vr-primary: oklch(0.96 0 0);
  --vr-primary-foreground: oklch(0.15 0 0);
  --vr-secondary: oklch(0.24 0 0);
  --vr-secondary-foreground: oklch(0.9 0 0);
  --vr-muted: oklch(0.23 0 0);
  --vr-muted-foreground: oklch(0.7 0 0);
  --vr-subtle-foreground: oklch(0.82 0 0);
  --vr-accent: oklch(0.25 0 0);
  --vr-accent-foreground: oklch(0.96 0 0);
  --vr-border: oklch(0.28 0 0);
  --vr-border-subtle: oklch(0.23 0 0);
  --vr-border-strong: oklch(0.45 0 0);
  --vr-input: oklch(0.32 0 0);
  --vr-ring: oklch(0.96 0 0);
  --vr-overlay: oklch(0 0 0 / 0.6);

  --vr-success-foreground: oklch(0.78 0.15 155);
  --vr-success-soft: oklch(0.62 0.15 155 / 0.18);
  --vr-warning-foreground: oklch(0.82 0.14 80);
  --vr-warning-soft: oklch(0.74 0.15 75 / 0.18);
  --vr-danger: oklch(0.65 0.2 25);
  --vr-danger-foreground: oklch(0.76 0.15 25);
  --vr-danger-soft: oklch(0.65 0.2 25 / 0.16);
  --vr-info-foreground: oklch(0.78 0.12 250);
  --vr-info-soft: oklch(0.58 0.16 250 / 0.2);

  --vr-shadow-card: 0 0 0 1px oklch(1 0 0 / 0.02);
  --vr-shadow-float: 0 16px 40px -12px oklch(0 0 0 / 0.6);
  --vr-shadow-overlay: 0 0 0 1px oklch(1 0 0 / 0.06), 0 24px 64px -12px oklch(0 0 0 / 0.7);
  --vr-skeleton-shine: oklch(1 0 0 / 0.06);
  --vr-tool-idx: linear-gradient(135deg, #4b5563, #374151);
}

/* Dark: OS preference when no explicit light theme is chosen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not(.light) {
    color-scheme: dark;
    --vr-background: oklch(0.15 0 0);
    --vr-foreground: oklch(0.96 0 0);
    --vr-card: oklch(0.19 0 0);
    --vr-card-foreground: oklch(0.96 0 0);
    --vr-popover: oklch(0.21 0 0);
    --vr-popover-foreground: oklch(0.96 0 0);
    --vr-primary: oklch(0.96 0 0);
    --vr-primary-foreground: oklch(0.15 0 0);
    --vr-secondary: oklch(0.24 0 0);
    --vr-secondary-foreground: oklch(0.9 0 0);
    --vr-muted: oklch(0.23 0 0);
    --vr-muted-foreground: oklch(0.7 0 0);
    --vr-subtle-foreground: oklch(0.82 0 0);
    --vr-accent: oklch(0.25 0 0);
    --vr-accent-foreground: oklch(0.96 0 0);
    --vr-border: oklch(0.28 0 0);
    --vr-border-subtle: oklch(0.23 0 0);
    --vr-border-strong: oklch(0.45 0 0);
    --vr-input: oklch(0.32 0 0);
    --vr-ring: oklch(0.96 0 0);
    --vr-overlay: oklch(0 0 0 / 0.6);
    --vr-success-foreground: oklch(0.78 0.15 155);
    --vr-success-soft: oklch(0.62 0.15 155 / 0.18);
    --vr-warning-foreground: oklch(0.82 0.14 80);
    --vr-warning-soft: oklch(0.74 0.15 75 / 0.18);
    --vr-danger: oklch(0.65 0.2 25);
    --vr-danger-foreground: oklch(0.76 0.15 25);
    --vr-danger-soft: oklch(0.65 0.2 25 / 0.16);
    --vr-info-foreground: oklch(0.78 0.12 250);
    --vr-info-soft: oklch(0.58 0.16 250 / 0.2);
    --vr-shadow-card: 0 0 0 1px oklch(1 0 0 / 0.02);
    --vr-shadow-float: 0 16px 40px -12px oklch(0 0 0 / 0.6);
    --vr-shadow-overlay: 0 0 0 1px oklch(1 0 0 / 0.06), 0 24px 64px -12px oklch(0 0 0 / 0.7);
    --vr-skeleton-shine: oklch(1 0 0 / 0.06);
    --vr-tool-idx: linear-gradient(135deg, #4b5563, #374151);
  }
}
