/* style.css — Rate My Records Design Tokens */

/* ============================================
   FONTS
   Playfair Display (display) + DM Sans (body)
   ============================================ */
:root {
  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-body: 'DM Sans', 'Helvetica Neue', sans-serif;
}

/* ============================================
   TYPE SCALE — fluid 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(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;
}

/* ============================================
   VINYL/MUSIC PALETTE — LIGHT MODE
   ============================================ */
:root, [data-theme="light"] {
  /* Surfaces — warm off-white */
  --color-bg:             #faf8f5;
  --color-surface:        #fdfcfa;
  --color-surface-2:      #ffffff;
  --color-surface-offset: #f4f1ed;
  --color-surface-offset-2: #ede9e4;
  --color-surface-dynamic: #e6e2db;
  --color-divider:        #e0ddd8;
  --color-border:         #d4d0ca;

  /* Text — deep charcoal */
  --color-text:           #1a1a1a;
  --color-text-muted:     #6b6b6b;
  --color-text-faint:     #b0b0b0;
  --color-text-inverse:   #fdfcfa;

  /* Primary accent — warm amber/gold */
  --color-primary:        #c2841a;
  --color-primary-hover:  #9a6a15;
  --color-primary-active: #7a530f;
  --color-primary-highlight: #f0dfc0;

  /* Error/notification — muted burgundy */
  --color-error:          #8b2252;
  --color-error-hover:    #6e1a40;
  --color-error-active:   #521430;
  --color-error-highlight: #f0d5e3;

  /* Success — forest green */
  --color-success:        #2d6a4f;
  --color-success-hover:  #1f4e38;
  --color-success-active: #153625;
  --color-success-highlight: #c8e6d8;

  /* Warning — warm orange for mid-scores */
  --color-warning:        #c2591a;
  --color-warning-hover:  #a04515;
  --color-warning-active: #7e340f;
  --color-warning-highlight: #f0d5c0;

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

  /* Shadows — warm-toned */
  --shadow-sm: 0 1px 2px oklch(0.15 0.02 60 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.15 0.02 60 / 0.10);
  --shadow-lg: 0 12px 32px oklch(0.15 0.02 60 / 0.14);

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

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  /* Surfaces — near-black */
  --color-bg:             #111111;
  --color-surface:        #1a1a1a;
  --color-surface-2:      #222222;
  --color-surface-offset: #1e1e1e;
  --color-surface-offset-2: #252525;
  --color-surface-dynamic: #2e2e2e;
  --color-divider:        #2a2a2a;
  --color-border:         #383838;

  /* Text — warm white */
  --color-text:           #e8e6e2;
  --color-text-muted:     #8a8a8a;
  --color-text-faint:     #555555;
  --color-text-inverse:   #1a1a1a;

  /* Primary accent — brighter gold */
  --color-primary:        #e0a832;
  --color-primary-hover:  #c78e20;
  --color-primary-active: #a87318;
  --color-primary-highlight: #3d3018;

  /* Error */
  --color-error:          #d16090;
  --color-error-hover:    #b84878;
  --color-error-active:   #9a305f;
  --color-error-highlight: #3d2232;

  /* Success */
  --color-success:        #5aad80;
  --color-success-hover:  #3d8f64;
  --color-success-active: #27724a;
  --color-success-highlight: #1e3829;

  /* Warning */
  --color-warning:        #e07840;
  --color-warning-hover:  #c55f28;
  --color-warning-active: #a44818;
  --color-warning-highlight: #3d2818;

  /* Shadows */
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #111111;
    --color-surface:        #1a1a1a;
    --color-surface-2:      #222222;
    --color-surface-offset: #1e1e1e;
    --color-surface-offset-2: #252525;
    --color-surface-dynamic: #2e2e2e;
    --color-divider:        #2a2a2a;
    --color-border:         #383838;
    --color-text:           #e8e6e2;
    --color-text-muted:     #8a8a8a;
    --color-text-faint:     #555555;
    --color-text-inverse:   #1a1a1a;
    --color-primary:        #e0a832;
    --color-primary-hover:  #c78e20;
    --color-primary-active: #a87318;
    --color-primary-highlight: #3d3018;
    --color-error:          #d16090;
    --color-error-hover:    #b84878;
    --color-error-active:   #9a305f;
    --color-error-highlight: #3d2232;
    --color-success:        #5aad80;
    --color-success-hover:  #3d8f64;
    --color-success-active: #27724a;
    --color-success-highlight: #1e3829;
    --color-warning:        #e07840;
    --color-warning-hover:  #c55f28;
    --color-warning-active: #a44818;
    --color-warning-highlight: #3d2818;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
  }
}
