/* Art direction: B2B SaaS for independent restaurant owners → trustworthy, warm, authoritative
   Palette: Warm navy (#1B2A4A) primary + amber/gold (#D4A841) accent — authoritative yet approachable
   Typography: Erode (display, serif authority) + General Sans (body, clean readability) — editorial authority + modern clarity
   Density: Spacious / editorial — generous section padding, breathing room */

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

  /* ============================================================
     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;

  /* ============================================================
     FONTS
     ============================================================ */
  --font-display: 'Erode', 'Georgia', serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;

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

/* ============================================================
   LIGHT MODE (default)
   ============================================================ */
:root, [data-theme="light"] {
  /* Surfaces — warm whites */
  --color-bg:               #F8F7F4;
  --color-surface:          #FFFFFF;
  --color-surface-2:        #F3F2EE;
  --color-surface-offset:   #EBE9E3;
  --color-surface-offset-2: #E3E1DA;
  --color-surface-dynamic:  #D9D7D0;
  --color-divider:          #D1CFCA;
  --color-border:           #C5C3BD;

  /* Text */
  --color-text:             #1B2A4A;
  --color-text-muted:       #5C6778;
  --color-text-faint:       #9AA2B0;
  --color-text-inverse:     #FFFFFF;

  /* Primary — deep navy */
  --color-primary:          #1B2A4A;
  --color-primary-hover:    #152240;
  --color-primary-active:   #0F1A33;
  --color-primary-highlight: #D6DAE2;

  /* Accent — warm amber/gold for CTAs */
  --color-accent:           #D4A841;
  --color-accent-hover:     #C49A35;
  --color-accent-active:    #B08B2A;
  --color-accent-highlight: #F5EDD4;

  /* Success */
  --color-success:          #2E7D32;
  --color-success-hover:    #1B5E20;
  --color-success-active:   #0F4012;
  --color-success-highlight:#D4E9D5;

  /* Error */
  --color-error:            #C62828;
  --color-error-hover:      #A01E1E;
  --color-error-active:     #7A1616;
  --color-error-highlight:  #F2D5D5;

  /* Warning */
  --color-warning:          #E65100;
  --color-warning-hover:    #BF4200;
  --color-warning-active:   #993500;
  --color-warning-highlight:#F7DCC8;

  /* Shadows (warm-toned) */
  --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);
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  /* Surfaces — warm dark */
  --color-bg:               #121820;
  --color-surface:          #1A2233;
  --color-surface-2:        #1F293B;
  --color-surface-offset:   #1C2536;
  --color-surface-offset-2: #232D3F;
  --color-surface-dynamic:  #2A3448;
  --color-divider:          #2A3448;
  --color-border:           #354054;

  /* Text */
  --color-text:             #E4E5E8;
  --color-text-muted:       #9AA2B0;
  --color-text-faint:       #5C6778;
  --color-text-inverse:     #1B2A4A;

  /* Primary — lighter navy for dark backgrounds */
  --color-primary:          #6B8CC4;
  --color-primary-hover:    #5A7AB5;
  --color-primary-active:   #4A6AA0;
  --color-primary-highlight:#2A3448;

  /* Accent — amber/gold stays warm */
  --color-accent:           #E0B94E;
  --color-accent-hover:     #D4A841;
  --color-accent-active:    #C49A35;
  --color-accent-highlight: #332D1E;

  /* Success */
  --color-success:          #66BB6A;
  --color-success-hover:    #4CAF50;
  --color-success-active:   #388E3C;
  --color-success-highlight:#1E2E1F;

  /* Error */
  --color-error:            #EF5350;
  --color-error-hover:      #E53935;
  --color-error-active:     #C62828;
  --color-error-highlight:  #2E1B1B;

  /* Warning */
  --color-warning:          #FF9800;
  --color-warning-hover:    #F57C00;
  --color-warning-active:   #E65100;
  --color-warning-highlight:#2E241A;

  /* Shadows */
  --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:               #121820;
    --color-surface:          #1A2233;
    --color-surface-2:        #1F293B;
    --color-surface-offset:   #1C2536;
    --color-surface-offset-2: #232D3F;
    --color-surface-dynamic:  #2A3448;
    --color-divider:          #2A3448;
    --color-border:           #354054;
    --color-text:             #E4E5E8;
    --color-text-muted:       #9AA2B0;
    --color-text-faint:       #5C6778;
    --color-text-inverse:     #1B2A4A;
    --color-primary:          #6B8CC4;
    --color-primary-hover:    #5A7AB5;
    --color-primary-active:   #4A6AA0;
    --color-primary-highlight:#2A3448;
    --color-accent:           #E0B94E;
    --color-accent-hover:     #D4A841;
    --color-accent-active:    #C49A35;
    --color-accent-highlight: #332D1E;
    --color-success:          #66BB6A;
    --color-success-hover:    #4CAF50;
    --color-success-active:   #388E3C;
    --color-success-highlight:#1E2E1F;
    --color-error:            #EF5350;
    --color-error-hover:      #E53935;
    --color-error-active:     #C62828;
    --color-error-highlight:  #2E1B1B;
    --color-warning:          #FF9800;
    --color-warning-hover:    #F57C00;
    --color-warning-active:   #E65100;
    --color-warning-highlight:#2E241A;
    --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);
  }
}
