/* === DESIGN TOKENS — Fortacin Navy/Teal Palette === */

/* Type Scale */
:root {
  --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.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing (4px 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.375rem;
  --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);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
}

/* === LIGHT MODE (default) === */
:root, [data-theme="light"] {
  /* Surfaces */
  --color-bg:               #f8fafc;
  --color-surface:          #ffffff;
  --color-surface-2:        #f1f5f9;
  --color-surface-offset:   #e2e8f0;
  --color-surface-offset-2: #cbd5e1;
  --color-surface-dynamic:  #e8ecf1;
  --color-divider:          #e2e8f0;
  --color-border:           #cbd5e1;

  /* Text */
  --color-text:         #0f172a;
  --color-text-muted:   #64748b;
  --color-text-faint:   #94a3b8;
  --color-text-inverse: #f8fafc;

  /* Primary — Deep Navy */
  --color-primary:        #1a365d;
  --color-primary-hover:  #1e3a5f;
  --color-primary-active: #0f2440;
  --color-primary-highlight: #dbeafe;

  /* Accent — Teal */
  --color-accent:         #0891b2;
  --color-accent-hover:   #0e7490;
  --color-accent-active:  #155e75;
  --color-accent-highlight: #cffafe;

  /* Semantic */
  --color-success:        #059669;
  --color-success-highlight: #d1fae5;
  --color-warning:        #d97706;
  --color-warning-highlight: #fef3c7;
  --color-error:          #dc2626;
  --color-error-highlight: #fee2e2;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 20px 50px rgba(15, 23, 42, 0.16);
}

/* === DARK MODE === */
[data-theme="dark"] {
  --color-bg:               #0b1222;
  --color-surface:          #111b2e;
  --color-surface-2:        #162236;
  --color-surface-offset:   #1a2740;
  --color-surface-offset-2: #1e2d4a;
  --color-surface-dynamic:  #233554;
  --color-divider:          #1e3050;
  --color-border:           #2a3f60;

  --color-text:         #e2e8f0;
  --color-text-muted:   #94a3b8;
  --color-text-faint:   #64748b;
  --color-text-inverse: #0f172a;

  --color-primary:        #60a5fa;
  --color-primary-hover:  #93bbfd;
  --color-primary-active: #3b82f6;
  --color-primary-highlight: #1e3a5f;

  --color-accent:         #22d3ee;
  --color-accent-hover:   #67e8f9;
  --color-accent-active:  #06b6d4;
  --color-accent-highlight: #164e63;

  --color-success:        #34d399;
  --color-success-highlight: #064e3b;
  --color-warning:        #fbbf24;
  --color-warning-highlight: #78350f;
  --color-error:          #f87171;
  --color-error-highlight: #7f1d1d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #0b1222;
    --color-surface:          #111b2e;
    --color-surface-2:        #162236;
    --color-surface-offset:   #1a2740;
    --color-surface-offset-2: #1e2d4a;
    --color-surface-dynamic:  #233554;
    --color-divider:          #1e3050;
    --color-border:           #2a3f60;
    --color-text:         #e2e8f0;
    --color-text-muted:   #94a3b8;
    --color-text-faint:   #64748b;
    --color-text-inverse: #0f172a;
    --color-primary:        #60a5fa;
    --color-primary-hover:  #93bbfd;
    --color-primary-active: #3b82f6;
    --color-primary-highlight: #1e3a5f;
    --color-accent:         #22d3ee;
    --color-accent-hover:   #67e8f9;
    --color-accent-active:  #06b6d4;
    --color-accent-highlight: #164e63;
    --color-success:        #34d399;
    --color-success-highlight: #064e3b;
    --color-warning:        #fbbf24;
    --color-warning-highlight: #78350f;
    --color-error:          #f87171;
    --color-error-highlight: #7f1d1d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
  }
}
