/* style.css — Upkeepe Design System */
/* Custom palette: deep teal-blue + cool off-white + navy-charcoal */

/* TYPOGRAPHY — fonts loaded via <link> in HTML */

/* ============================================
   TYPE SCALE — Fluid
   ============================================ */
: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);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);
}

/* ============================================
   4PX SPACING SYSTEM
   ============================================ */
:root {
  --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;
}

/* ============================================
   UPKEEPE COLOR PALETTE — Light Mode
   ============================================ */
:root, [data-theme="light"] {
  /* Surfaces — cool off-white with subtle blue-gray tint */
  --color-bg:              #f8f9fb;
  --color-surface:         #ffffff;
  --color-surface-2:       #f1f3f7;
  --color-surface-offset:  #edf0f5;
  --color-surface-offset-2:#e5e9f0;
  --color-surface-dynamic: #dce2ec;
  --color-divider:         #dce1ea;
  --color-border:          #c8cfd9;

  /* Text — deep navy-charcoal */
  --color-text:            #1a2332;
  --color-text-muted:      #5a6578;
  --color-text-faint:      #a3adb8;
  --color-text-inverse:    #f8f9fb;

  /* Primary — deep teal */
  --color-primary:         #1a7a8a;
  --color-primary-hover:   #136874;
  --color-primary-active:  #0d525c;
  --color-primary-highlight: #e0f2f5;

  /* Semantic — tuned to complement blue-gray palette */
  --color-success:         #2e7d4f;
  --color-success-hover:   #1f6040;
  --color-success-active:  #154530;
  --color-success-highlight: #d4eddd;

  --color-warning:         #996600;
  --color-warning-hover:   #7a5200;
  --color-warning-active:  #5c3d00;
  --color-warning-highlight: #fef3cc;

  --color-error:           #c0392b;
  --color-error-hover:     #a32c21;
  --color-error-active:    #8b2418;
  --color-error-highlight: #fde8e6;

  /* 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-enter:       300ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows — blue-gray tinted */
  --shadow-sm: 0 1px 2px oklch(0.25 0.03 240 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.25 0.03 240 / 0.08), 0 1px 3px oklch(0.25 0.03 240 / 0.05);
  --shadow-lg: 0 12px 32px oklch(0.25 0.03 240 / 0.12), 0 4px 8px oklch(0.25 0.03 240 / 0.06);
  --shadow-xl: 0 24px 64px oklch(0.25 0.03 240 / 0.16), 0 8px 16px oklch(0.25 0.03 240 / 0.08);

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

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

/* ============================================
   UPKEEPE COLOR PALETTE — Dark Mode
   ============================================ */
[data-theme="dark"] {
  /* Surfaces — deep navy-charcoal */
  --color-bg:              #0f1520;
  --color-surface:         #161d2a;
  --color-surface-2:       #1c2433;
  --color-surface-offset:  #1a2230;
  --color-surface-offset-2:#202a3a;
  --color-surface-dynamic: #2a3447;
  --color-divider:         #252e3e;
  --color-border:          #2f3a4d;

  /* Text — light cool tones */
  --color-text:            #d4dae5;
  --color-text-muted:      #7a869a;
  --color-text-faint:      #4a5568;
  --color-text-inverse:    #0f1520;

  /* Primary — lighter teal for dark */
  --color-primary:         #3db8cc;
  --color-primary-hover:   #2da0b3;
  --color-primary-active:  #1e8999;
  --color-primary-highlight: #1a3a42;

  /* Semantic — dark mode */
  --color-success:         #4ead75;
  --color-success-hover:   #3a9463;
  --color-success-active:  #2a7a52;
  --color-success-highlight: #1a3328;

  --color-warning:         #e8b73a;
  --color-warning-hover:   #d09e24;
  --color-warning-active:  #b88810;
  --color-warning-highlight: #3a2f10;

  --color-error:           #e85757;
  --color-error-hover:     #d44040;
  --color-error-active:    #c02c2c;
  --color-error-highlight: #3a1a1a;

  /* Shadows — for dark surfaces */
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35), 0 1px 3px oklch(0 0 0 / 0.2);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45), 0 4px 8px oklch(0 0 0 / 0.25);
  --shadow-xl: 0 24px 64px oklch(0 0 0 / 0.55), 0 8px 16px oklch(0 0 0 / 0.3);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:              #0f1520;
    --color-surface:         #161d2a;
    --color-surface-2:       #1c2433;
    --color-surface-offset:  #1a2230;
    --color-surface-offset-2:#202a3a;
    --color-surface-dynamic: #2a3447;
    --color-divider:         #252e3e;
    --color-border:          #2f3a4d;
    --color-text:            #d4dae5;
    --color-text-muted:      #7a869a;
    --color-text-faint:      #4a5568;
    --color-text-inverse:    #0f1520;
    --color-primary:         #3db8cc;
    --color-primary-hover:   #2da0b3;
    --color-primary-active:  #1e8999;
    --color-primary-highlight: #1a3a42;
    --color-success:         #4ead75;
    --color-success-hover:   #3a9463;
    --color-success-active:  #2a7a52;
    --color-success-highlight: #1a3328;
    --color-warning:         #e8b73a;
    --color-warning-hover:   #d09e24;
    --color-warning-active:  #b88810;
    --color-warning-highlight: #3a2f10;
    --color-error:           #e85757;
    --color-error-hover:     #d44040;
    --color-error-active:    #c02c2c;
    --color-error-highlight: #3a1a1a;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35), 0 1px 3px oklch(0 0 0 / 0.2);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45), 0 4px 8px oklch(0 0 0 / 0.25);
    --shadow-xl: 0 24px 64px oklch(0 0 0 / 0.55), 0 8px 16px oklch(0 0 0 / 0.3);
  }
}
