/* Art direction: Continuous Improvement Intelligence platform → Scandinavian minimal, premium enterprise SaaS
   Palette: Custom KAIROS teal/navy — warm off-white light, deep navy dark. Teal primary accent.
   Typography: Instrument Serif (display) + Inter (body) — editorial serif warmth meets clean Swiss precision
   Density: Spacious — generous whitespace, editorial landing page */

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

:root {
  /* 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);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* 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.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%;

  /* Font families */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
}

/* ========================================
   KAIROS LIGHT MODE (default)
   ======================================== */
:root, [data-theme="light"] {
  /* Surfaces */
  --color-bg:             #FCFAF6;
  --color-surface:        #F3F3EE;
  --color-surface-2:      #EBE9E4;
  --color-surface-offset: #F3F3EE;
  --color-surface-offset-2: #E8E6E1;
  --color-surface-dynamic: #DDD9D3;
  --color-divider:        #D4D0C9;
  --color-border:         #C8C4BC;

  /* Text */
  --color-text:           #13343B;
  --color-text-muted:     #2E565D;
  --color-text-faint:     #8896a8;
  --color-text-inverse:   #FCFAF6;

  /* Primary Accent — KAIROS Teal */
  --color-primary:        #20808D;
  --color-primary-hover:  #1A6A75;
  --color-primary-active: #115058;
  --color-primary-highlight: #D6F5FA;

  /* Warm accents (rare use) */
  --color-terra:          #A84B2F;
  --color-gold:           #D4A017;

  /* Semantic */
  --color-warning:        #A84B2F;
  --color-warning-hover:  #8A3C26;
  --color-warning-active: #6B2E1D;
  --color-warning-highlight: #F5E6E0;

  --color-error:          #9B2C3C;
  --color-error-hover:    #7D2030;
  --color-error-active:   #5E1624;
  --color-error-highlight: #F5E0E3;

  --color-success:        #2D7A3A;
  --color-success-hover:  #1F5F2A;
  --color-success-active: #14451C;
  --color-success-highlight: #E0F0E3;

  /* Shadows (warm-tinted) */
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
}

/* ========================================
   KAIROS DARK MODE
   ======================================== */
[data-theme="dark"] {
  /* Surfaces */
  --color-bg:             #091717;
  --color-surface:        #13343B;
  --color-surface-2:      #1A424A;
  --color-surface-offset: #0E2527;
  --color-surface-offset-2: #1A424A;
  --color-surface-dynamic: #1F4D56;
  --color-divider:        #1F4D56;
  --color-border:         #2E565D;

  /* Text */
  --color-text:           #FCFAF6;
  --color-text-muted:     #8896a8;
  --color-text-faint:     #5A6B7A;
  --color-text-inverse:   #091717;

  /* Primary Accent — brighter teal for dark mode */
  --color-primary:        #3AAFBC;
  --color-primary-hover:  #20808D;
  --color-primary-active: #1A6A75;
  --color-primary-highlight: #1A424A;

  /* Warm accents */
  --color-terra:          #D47050;
  --color-gold:           #E8B830;

  /* Semantic */
  --color-warning:        #D47050;
  --color-warning-hover:  #C05A3A;
  --color-warning-active: #A84B2F;
  --color-warning-highlight: #2A1F1A;

  --color-error:          #D45060;
  --color-error-hover:    #B83A4A;
  --color-error-active:   #9B2C3C;
  --color-error-highlight: #2A1A1C;

  --color-success:        #5AAF60;
  --color-success-hover:  #3D8F44;
  --color-success-active: #2D7A3A;
  --color-success-highlight: #1A2A1C;

  /* Shadows (dark mode) */
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #091717;
    --color-surface:        #13343B;
    --color-surface-2:      #1A424A;
    --color-surface-offset: #0E2527;
    --color-surface-offset-2: #1A424A;
    --color-surface-dynamic: #1F4D56;
    --color-divider:        #1F4D56;
    --color-border:         #2E565D;
    --color-text:           #FCFAF6;
    --color-text-muted:     #8896a8;
    --color-text-faint:     #5A6B7A;
    --color-text-inverse:   #091717;
    --color-primary:        #3AAFBC;
    --color-primary-hover:  #20808D;
    --color-primary-active: #1A6A75;
    --color-primary-highlight: #1A424A;
    --color-terra:          #D47050;
    --color-gold:           #E8B830;
    --color-warning:        #D47050;
    --color-error:          #D45060;
    --color-success:        #5AAF60;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }
}
