/* style.css — Creative Note Solutions Design Tokens & Components */

/* ============================================
   FONTS
   DM Serif Display for headings, DM Sans for body
   ============================================ */

:root {
  --font-display: 'DM Serif Display', 'Georgia', serif;
  --font-body: 'DM Sans', '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(3rem,     0.5rem  + 7vw,    8rem);
}

/* ============================================
   SPACING (4px 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;
}

/* ============================================
   CNS BRAND PALETTE — LIGHT MODE
   Hunter green primary, gold accent, warm cream surfaces
   ============================================ */
:root, [data-theme="light"] {
  /* --- Surfaces (Warm Cream) --- */
  --color-bg:             #fdfbf7;
  --color-surface:        #faf7f0;
  --color-surface-2:      #f5f1e8;
  --color-surface-offset: #f0ece2;
  --color-surface-offset-2: #eae5d9;
  --color-surface-dynamic: #e2ddd0;
  --color-divider:        #d8d2c4;
  --color-border:         #cec7b8;

  /* --- Text --- */
  --color-text:           #1a2e1f;
  --color-text-muted:     #5e6b5e;
  --color-text-faint:     #9da697;
  --color-text-inverse:   #fdfbf7;

  /* --- Primary (Hunter Green) --- */
  --color-primary:        #2d5a3a;
  --color-primary-hover:  #1e4029;
  --color-primary-active: #14301d;
  --color-primary-highlight: #d4e0d6;

  /* --- Accent (Gold) --- */
  --color-accent:         #b8860b;
  --color-accent-hover:   #9a7009;
  --color-accent-active:  #7c5a07;
  --color-accent-highlight: #f0e5c8;
  --color-accent-text:    #8a6508;

  /* --- Semantic --- */
  --color-success:        #437a22;
  --color-success-highlight: #d4dfcc;
  --color-error:          #a13544;
  --color-error-highlight: #e0ced1;

  /* --- 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-tinted) --- */
  --shadow-sm: 0 1px 2px oklch(0.25 0.02 90 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.25 0.02 90 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.25 0.02 90 / 0.12);

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

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  --color-bg:             #121a14;
  --color-surface:        #182019;
  --color-surface-2:      #1e271f;
  --color-surface-offset: #1a221b;
  --color-surface-offset-2: #212a22;
  --color-surface-dynamic: #2b352c;
  --color-divider:        #2a332b;
  --color-border:         #374038;

  --color-text:           #d4ddd5;
  --color-text-muted:     #8a968b;
  --color-text-faint:     #566057;
  --color-text-inverse:   #121a14;

  --color-primary:        #5a9a6a;
  --color-primary-hover:  #4a8a5a;
  --color-primary-active: #3a7a4a;
  --color-primary-highlight: #253028;

  --color-accent:         #d4a832;
  --color-accent-hover:   #c09020;
  --color-accent-active:  #a87a18;
  --color-accent-highlight: #3a3020;
  --color-accent-text:    #e0b840;

  --color-success:        #6daa45;
  --color-success-highlight: #2a3525;
  --color-error:          #dd6974;
  --color-error-highlight: #3a2528;

  --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:             #121a14;
    --color-surface:        #182019;
    --color-surface-2:      #1e271f;
    --color-surface-offset: #1a221b;
    --color-surface-offset-2: #212a22;
    --color-surface-dynamic: #2b352c;
    --color-divider:        #2a332b;
    --color-border:         #374038;
    --color-text:           #d4ddd5;
    --color-text-muted:     #8a968b;
    --color-text-faint:     #566057;
    --color-text-inverse:   #121a14;
    --color-primary:        #5a9a6a;
    --color-primary-hover:  #4a8a5a;
    --color-primary-active: #3a7a4a;
    --color-primary-highlight: #253028;
    --color-accent:         #d4a832;
    --color-accent-hover:   #c09020;
    --color-accent-active:  #a87a18;
    --color-accent-highlight: #3a3020;
    --color-accent-text:    #e0b840;
    --color-success:        #6daa45;
    --color-success-highlight: #2a3525;
    --color-error:          #dd6974;
    --color-error-highlight: #3a2528;
    --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);
  }
}
