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

/* ============================================
   CUSTOM PALETTE: Creative Note Solutions
   Hunter green + warm gold on warm white
   ============================================ */

:root {
  /* --- Type Scale (Fluid) --- */
  --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 --- */
  --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;

  /* --- Font Families --- */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM 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
   ============================================ */
:root, [data-theme="light"] {
  /* --- Surfaces --- */
  --color-bg:               #fefcf8;
  --color-surface:          #ffffff;
  --color-surface-2:        #faf8f3;
  --color-surface-offset:   #f3f0e8;
  --color-surface-offset-2: #eae5db;
  --color-surface-dynamic:  #e2ddd2;
  --color-divider:          #d5cfbf;
  --color-border:           #ccc5b5;

  /* --- Text --- */
  --color-text:           #2c2c2c;
  --color-text-muted:     #6b6560;
  --color-text-faint:     #a09a90;
  --color-text-inverse:   #fefcf8;

  /* --- Primary Accent (Hunter Green) --- */
  --color-primary:        #2d5a3a;
  --color-primary-hover:  #234a2f;
  --color-primary-active: #1a3a24;
  --color-primary-highlight: #d4e0d6;

  /* --- Secondary Accent (Warm Gold) --- */
  --color-gold:           #b8860b;
  --color-gold-hover:     #9a7009;
  --color-gold-active:    #7d5b07;
  --color-gold-highlight: #ede0c4;

  /* --- Semantic: Error --- */
  --color-error:          #a13544;
  --color-error-hover:    #862c39;
  --color-error-highlight: #f0d8dc;

  /* --- Semantic: Success --- */
  --color-success:        #2d5a3a;
  --color-success-highlight: #d4e0d6;

  /* --- Footer --- */
  --color-footer-bg:      #1a3a24;
  --color-footer-text:    #c8d5cc;

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

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  /* --- Surfaces --- */
  --color-bg:               #171614;
  --color-surface:          #1e1d1a;
  --color-surface-2:        #252420;
  --color-surface-offset:   #1c1b18;
  --color-surface-offset-2: #232220;
  --color-surface-dynamic:  #2e2d2a;
  --color-divider:          #2e2d2a;
  --color-border:           #3a3936;

  /* --- Text --- */
  --color-text:           #d8d5ce;
  --color-text-muted:     #8a8680;
  --color-text-faint:     #5e5b56;
  --color-text-inverse:   #1a1918;

  /* --- Primary Accent (Hunter Green — Dark) --- */
  --color-primary:        #5a9a6a;
  --color-primary-hover:  #4a8a5a;
  --color-primary-active: #3a7a4a;
  --color-primary-highlight: #2a3a2e;

  /* --- Secondary Accent (Warm Gold — Dark) --- */
  --color-gold:           #d4a020;
  --color-gold-hover:     #e0b030;
  --color-gold-active:    #c89010;
  --color-gold-highlight: #3a3428;

  /* --- Semantic: Error --- */
  --color-error:          #dd6974;
  --color-error-hover:    #c24a59;
  --color-error-highlight: #3a2a2c;

  /* --- Semantic: Success --- */
  --color-success:        #5a9a6a;
  --color-success-highlight: #2a3a2e;

  /* --- Footer --- */
  --color-footer-bg:      #0e1e12;
  --color-footer-text:    #8a9a8e;

  /* --- 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:               #171614;
    --color-surface:          #1e1d1a;
    --color-surface-2:        #252420;
    --color-surface-offset:   #1c1b18;
    --color-surface-offset-2: #232220;
    --color-surface-dynamic:  #2e2d2a;
    --color-divider:          #2e2d2a;
    --color-border:           #3a3936;
    --color-text:           #d8d5ce;
    --color-text-muted:     #8a8680;
    --color-text-faint:     #5e5b56;
    --color-text-inverse:   #1a1918;
    --color-primary:        #5a9a6a;
    --color-primary-hover:  #4a8a5a;
    --color-primary-active: #3a7a4a;
    --color-primary-highlight: #2a3a2e;
    --color-gold:           #d4a020;
    --color-gold-hover:     #e0b030;
    --color-gold-active:    #c89010;
    --color-gold-highlight: #3a3428;
    --color-error:          #dd6974;
    --color-error-hover:    #c24a59;
    --color-error-highlight: #3a2a2c;
    --color-success:        #5a9a6a;
    --color-success-highlight: #2a3a2e;
    --color-footer-bg:      #0e1e12;
    --color-footer-text:    #8a9a8e;
    --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);
  }
}
