/* CareerFlora semantic design tokens. Components consume these roles rather
   than carrying their own light or dark palette. Theme values come from the
   shared assets/appearance/registry.json catalog through theme-previews.css. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --surface-raised: #ffffff;
  --text: #111111;
  --muted: #525252;
  --text-subtle: #70757a;
  --border: #d6d6d6;
  --border-strong: #b9c0c9;
  --primary: #d62828;
  --primary-hover: #a91f25;
  --primary-soft: color-mix(in srgb, var(--primary) 11%, var(--surface));
  --primary-contrast: #ffffff;
  --accent: #2457a6;
  --accent-contrast: #ffffff;
  --header-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --success: #166534;
  --warning: #854d0e;
  --danger: #b4232e;
  --focus: #005fcc;
  --focus-ring: var(--focus);
  --cta-bg: #172033;
  --cta-text: #ffffff;
  --overlay: rgb(15 23 42 / 56%);

  --cf-color-canvas: var(--bg);
  --cf-color-surface: var(--surface);
  --cf-color-surface-raised: var(--surface-raised);
  --cf-color-surface-muted: var(--surface-2);
  --cf-color-text: var(--text);
  --cf-color-text-muted: var(--muted);
  --cf-color-text-subtle: var(--text-subtle);
  --cf-color-primary: var(--primary);
  --cf-color-primary-hover: var(--primary-hover);
  --cf-color-primary-soft: var(--primary-soft);
  --cf-color-primary-contrast: var(--primary-contrast);
  --cf-color-accent: var(--accent);
  --cf-color-success: var(--success);
  --cf-color-warning: var(--warning);
  --cf-color-danger: var(--danger);
  --cf-color-border: var(--border);
  --cf-color-border-strong: var(--border-strong);
  --cf-focus-ring: var(--focus-ring);

  --cf-radius-xs: 4px;
  --cf-radius-sm: 8px;
  --cf-radius-md: 12px;
  --cf-radius-lg: 18px;
  --cf-radius-pill: 999px;
  --cf-shadow-sm: 0 1px 3px rgb(0 0 0 / 8%);
  --cf-shadow-md: 0 8px 24px rgb(0 0 0 / 10%);
  --cf-shadow-lg: 0 18px 48px rgb(0 0 0 / 16%);

  --cf-space-1: 4px;
  --cf-space-2: 8px;
  --cf-space-3: 12px;
  --cf-space-4: 16px;
  --cf-space-5: 20px;
  --cf-space-6: 24px;
  --cf-space-8: 32px;
  --cf-space-10: 40px;
  --cf-space-12: 48px;
  --cf-space-16: 64px;

  --cf-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cf-font-mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --cf-font-size-xs: 0.75rem;
  --cf-font-size-sm: 0.875rem;
  --cf-font-size-md: 1rem;
  --cf-font-size-lg: 1.125rem;
  --cf-font-size-xl: 1.25rem;
  --cf-font-size-2xl: 1.5rem;
  --cf-font-size-3xl: clamp(1.875rem, 4vw, 2.75rem);
  --cf-line-height-tight: 1.2;
  --cf-line-height-normal: 1.5;
  --cf-line-height-relaxed: 1.7;
  --cf-z-header: 100;
  --cf-z-dropdown: 200;
  --cf-z-overlay: 900;
  --cf-z-modal: 1000;
  --cf-z-toast: 1100;
}

html[data-theme-scheme="dark"] {
  color-scheme: dark;
  --bg: #101010;
  --surface: #191919;
  --surface-2: #252525;
  --surface-raised: #252525;
  --text: #f5f5f5;
  --muted: #d0d0d0;
  --text-subtle: #bdbdbd;
  --border: #454545;
  --border-strong: #626262;
  --primary: #ff777e;
  --primary-hover: #ff9da2;
  --primary-soft: #45282d;
  --primary-contrast: #101010;
  --accent: #9bbaff;
  --accent-contrast: #101010;
  --header-bg: #191919;
  --sidebar-bg: #191919;
  --success: #86efac;
  --warning: #fcd34d;
  --danger: #ff8a8f;
  --focus: #99c2ff;
  --cta-bg: #08090b;
  --cta-text: #f5f5f5;
  --overlay: rgb(0 0 0 / 68%);
  --cf-shadow-sm: 0 1px 3px rgb(0 0 0 / 24%);
  --cf-shadow-md: 0 8px 24px rgb(0 0 0 / 28%);
  --cf-shadow-lg: 0 18px 48px rgb(0 0 0 / 40%);
}

/* The shared registry emits a complete semantic palette for each theme. */
html[data-theme] {
  --cf-color-canvas: var(--bg);
  --cf-color-surface: var(--surface);
  --cf-color-surface-raised: var(--surface-raised, var(--surface));
  --cf-color-surface-muted: var(--surface-2);
  --cf-color-text: var(--text);
  --cf-color-text-muted: var(--muted);
  --cf-color-text-subtle: var(--text-subtle, var(--muted));
  --cf-color-primary: var(--primary);
  --cf-color-primary-hover: var(--primary-hover, var(--primary));
  --cf-color-primary-soft: var(--primary-soft, color-mix(in srgb, var(--primary) 12%, var(--surface)));
  --cf-color-primary-contrast: var(--primary-contrast);
  --cf-color-accent: var(--accent);
  --cf-color-success: var(--success);
  --cf-color-warning: var(--warning);
  --cf-color-danger: var(--danger);
  --cf-color-border: var(--border);
  --cf-color-border-strong: var(--border-strong, var(--border));
  --cf-focus-ring: var(--focus);

  /* Shared semantic aliases for legacy selectors in the main-site CSS. */
  --red: var(--primary);
  --red-dark: var(--primary-hover, var(--primary));
  --dark: var(--text);
  --dark2: var(--surface-2);
  --gray: var(--muted);
  --lgray: var(--text-subtle, var(--muted));
  --white: var(--surface);
  --shadow: var(--cf-shadow-md);
  --shadow2: var(--cf-shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
