/* style.css — Xeer design tokens + component styles */
/* Custom palette: Dark-first, CryptoPunk-inspired */

/* ============================================
   FONT FAMILIES
   Space Mono (display/headings) + Inter (body)
   ============================================ */
:root {
  --font-display: 'Space Mono', 'Courier New', monospace;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
}

/* ============================================
   TYPE SCALE — fluid with clamp()
   ============================================ */
: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(4rem,     1rem    + 8vw,    9rem);
}

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

/* ============================================
   CUSTOM PALETTE — DARK FIRST (light mode)
   Monochrome + muted teal accent
   ============================================ */
:root, [data-theme="light"] {
  /* Surfaces — near-white for light mode */
  --color-bg:               #f0efec;
  --color-surface:          #e8e6e3;
  --color-surface-2:        #dddad6;
  --color-surface-offset:   #d4d1cb;
  --color-surface-offset-2: #c8c5be;
  --color-surface-dynamic:  #bfbbb3;
  --color-divider:          #c2bfb8;
  --color-border:           #b5b2aa;

  /* Text */
  --color-text:         #111110;
  --color-text-muted:   #5a5954;
  --color-text-faint:   #97958f;
  --color-text-inverse: #e8e6e3;

  /* Accent — muted teal */
  --color-primary:          #2a9d94;
  --color-primary-hover:    #1f7d76;
  --color-primary-active:   #165e58;
  --color-primary-highlight: #c5e8e6;

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

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

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0.15 0 0 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.15 0 0 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.15 0 0 / 0.12);

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

/* ============================================
   DARK MODE — the PRIMARY mode for this site
   ============================================ */
[data-theme="dark"] {
  /* Surfaces — near-black */
  --color-bg:               #0d0d0d;
  --color-surface:          #141414;
  --color-surface-2:        #1a1a1a;
  --color-surface-offset:   #1f1f1f;
  --color-surface-offset-2: #242424;
  --color-surface-dynamic:  #2a2a2a;
  --color-divider:          #222222;
  --color-border:           #2e2e2e;

  /* Text */
  --color-text:         #e8e6e3;
  --color-text-muted:   #7a7875;
  --color-text-faint:   #4a4845;
  --color-text-inverse: #111110;

  /* Accent — muted teal (#4ecdc4 range) */
  --color-primary:          #4ecdc4;
  --color-primary-hover:    #3bbab1;
  --color-primary-active:   #2aa09a;
  --color-primary-highlight: #1a3533;

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

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #0d0d0d;
    --color-surface:          #141414;
    --color-surface-2:        #1a1a1a;
    --color-surface-offset:   #1f1f1f;
    --color-surface-offset-2: #242424;
    --color-surface-dynamic:  #2a2a2a;
    --color-divider:          #222222;
    --color-border:           #2e2e2e;
    --color-text:             #e8e6e3;
    --color-text-muted:       #7a7875;
    --color-text-faint:       #4a4845;
    --color-text-inverse:     #111110;
    --color-primary:          #4ecdc4;
    --color-primary-hover:    #3bbab1;
    --color-primary-active:   #2aa09a;
    --color-primary-highlight: #1a3533;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
  }
}
