/* style.css — Design Tokens & Theme (White / Silver / Black palette) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Type Scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

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

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

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 300ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 500ms cubic-bezier(0.16, 1, 0.3, 1);

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

/* ─── Light Theme (Default) ─── */
:root, [data-theme="light"] {
  --color-bg:             #ffffff;
  --color-surface:        #f5f5f5;
  --color-surface-2:      #fafafa;
  --color-surface-offset: #f0f0f0;
  --color-border:         #e0e0e0;
  --color-divider:        #ebebeb;

  --color-text:           #1a1a1a;
  --color-text-muted:     #6b6b6b;
  --color-text-faint:     #a0a0a0;

  --color-accent:         #1a1a1a;
  --color-accent-hover:   #333333;
  --color-accent-text:    #ffffff;

  --color-bubble-user:    #f0f0f0;
  --color-bubble-ai:      #ffffff;
  --color-bubble-ai-border: #e8e8e8;

  --color-input-bg:       #ffffff;
  --color-input-border:   #d8d8d8;
  --color-input-focus:    #1a1a1a;

  --color-chip-bg:        #f5f5f5;
  --color-chip-hover:     #ebebeb;
  --color-chip-border:    #e0e0e0;

  --color-modal-overlay:  rgba(0, 0, 0, 0.4);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
  --shadow-input: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-input-focus: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ─── Dark Theme ─── */
[data-theme="dark"] {
  --color-bg:             #141414;
  --color-surface:        #1c1c1c;
  --color-surface-2:      #222222;
  --color-surface-offset: #1a1a1a;
  --color-border:         #333333;
  --color-divider:        #2a2a2a;

  --color-text:           #e0e0e0;
  --color-text-muted:     #8a8a8a;
  --color-text-faint:     #555555;

  --color-accent:         #e0e0e0;
  --color-accent-hover:   #cccccc;
  --color-accent-text:    #141414;

  --color-bubble-user:    #2a2a2a;
  --color-bubble-ai:      #1c1c1c;
  --color-bubble-ai-border: #333333;

  --color-input-bg:       #1c1c1c;
  --color-input-border:   #333333;
  --color-input-focus:    #e0e0e0;

  --color-chip-bg:        #1c1c1c;
  --color-chip-hover:     #2a2a2a;
  --color-chip-border:    #333333;

  --color-modal-overlay:  rgba(0, 0, 0, 0.6);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-input: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-input-focus: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #141414;
    --color-surface:        #1c1c1c;
    --color-surface-2:      #222222;
    --color-surface-offset: #1a1a1a;
    --color-border:         #333333;
    --color-divider:        #2a2a2a;
    --color-text:           #e0e0e0;
    --color-text-muted:     #8a8a8a;
    --color-text-faint:     #555555;
    --color-accent:         #e0e0e0;
    --color-accent-hover:   #cccccc;
    --color-accent-text:    #141414;
    --color-bubble-user:    #2a2a2a;
    --color-bubble-ai:      #1c1c1c;
    --color-bubble-ai-border: #333333;
    --color-input-bg:       #1c1c1c;
    --color-input-border:   #333333;
    --color-input-focus:    #e0e0e0;
    --color-chip-bg:        #1c1c1c;
    --color-chip-hover:     #2a2a2a;
    --color-chip-border:    #333333;
    --color-modal-overlay:  rgba(0, 0, 0, 0.6);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
    --shadow-input: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-input-focus: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}
