/* ==========================================================================
   BKI Kalijaga — design tokens
   Every component reads these variables. Admin → Branding rewrites them from the
   database, which is why no colour is ever hardcoded in a component file.
   ========================================================================== */

:root {
  /* Structural scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --text-xs: 0.78rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 2.9rem;

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

  --leading-tight: 1.25;
  --leading-snug: 1.4;
  --leading-normal: 1.65;

  /* Focus ring — visible on every interactive element */
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.45);
  --transition-fast: 140ms ease;
  --transition-base: 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Dark mode is driven by [data-theme] on <html>, resolved in the layout so that
   "system" can be honoured before first paint. */
html[data-theme='dark'] {
  --bg-page: var(--bg-page-dark);
  --bg-surface: var(--bg-surface-dark);
  --ink-900: #f4f2ff;
  --ink-700: #d8d5ef;
  --ink-500: #a9a4c9;
  --ink-400: #8a85ad;
  --line-200: rgba(255, 255, 255, 0.1);
  --line-300: rgba(255, 255, 255, 0.14);
  --shadow-soft: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 18px 45px -20px rgba(0, 0, 0, 0.65);
}

/* Users who ask for less motion get none of it. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
  }
}

html[data-reduced-motion='true'] * {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
