/* style.css — Design tokens + component styles for Kroll Québec Study Guide */

/* ========================================
   DESIGN TOKENS
   ======================================== */

:root {
  /* Font */
  --font-body: 'Lexend', system-ui, sans-serif;
  --font-display: 'Lexend', system-ui, sans-serif;

  /* Type Scale — fluid with clamp() */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.8125rem);
  --text-sm:   clamp(0.8125rem, 0.78rem + 0.2vw, 0.875rem);
  --text-base: clamp(0.9375rem, 0.88rem + 0.3vw, 1rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.6vw, 1.375rem);
  --text-xl:   clamp(1.5rem,   1.1rem  + 1.2vw,  2rem);
  --text-2xl:  clamp(1.875rem, 1.2rem  + 2vw,    2.75rem);

  /* 4px Spacing System */
  --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;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* ========================================
   LIGHT MODE (default)
   ======================================== */
:root, [data-theme="light"] {
  /* Surfaces — pure white, clean medical look */
  --color-bg:             #ffffff;
  --color-surface:        #fafafa;
  --color-surface-2:      #f5f5f5;
  --color-surface-offset: #f0f0f0;
  --color-divider:        #e5e5e5;
  --color-border:         #d9d9d9;

  /* Text */
  --color-text:           #1a1a1a;
  --color-text-muted:     #6b6b6b;
  --color-text-faint:     #a3a3a3;
  --color-text-inverse:   #ffffff;

  /* Primary Accent — Gold (#d4af37) used sparingly */
  --color-primary:        #d4af37;
  --color-primary-hover:  #c09a28;
  --color-primary-active: #a8841c;
  --color-primary-highlight: rgba(212, 175, 55, 0.1);

  /* Success */
  --color-success:        #2d8a4e;
  --color-success-highlight: rgba(45, 138, 78, 0.1);

  /* Error */
  --color-error:          #c53030;
  --color-error-highlight: rgba(197, 48, 48, 0.1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10);
}

/* ========================================
   DARK MODE
   ======================================== */
[data-theme="dark"] {
  --color-bg:             #111111;
  --color-surface:        #1a1a1a;
  --color-surface-2:      #222222;
  --color-surface-offset: #2a2a2a;
  --color-divider:        #333333;
  --color-border:         #444444;

  --color-text:           #e5e5e5;
  --color-text-muted:     #999999;
  --color-text-faint:     #666666;
  --color-text-inverse:   #111111;

  --color-primary:        #e4c552;
  --color-primary-hover:  #d4af37;
  --color-primary-active: #c09a28;
  --color-primary-highlight: rgba(228, 197, 82, 0.12);

  --color-success:        #4ade80;
  --color-success-highlight: rgba(74, 222, 128, 0.12);

  --color-error:          #f87171;
  --color-error-highlight: rgba(248, 113, 113, 0.12);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #111111;
    --color-surface:        #1a1a1a;
    --color-surface-2:      #222222;
    --color-surface-offset: #2a2a2a;
    --color-divider:        #333333;
    --color-border:         #444444;
    --color-text:           #e5e5e5;
    --color-text-muted:     #999999;
    --color-text-faint:     #666666;
    --color-text-inverse:   #111111;
    --color-primary:        #e4c552;
    --color-primary-hover:  #d4af37;
    --color-primary-active: #c09a28;
    --color-primary-highlight: rgba(228, 197, 82, 0.12);
    --color-success:        #4ade80;
    --color-success-highlight: rgba(74, 222, 128, 0.12);
    --color-error:          #f87171;
    --color-error-highlight: rgba(248, 113, 113, 0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
  }
}
