/* style.css — T. Pora CPA, PC — Design Tokens & Components */

/* ============================================
   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;  /*  4px */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */
}

/* ============================================
   CUSTOM PALETTE: CPA PROFESSIONAL
   Deep navy primary, warm cream surfaces, subtle gold accent.
   Trust, competence, calm professionalism.
   ============================================ */

:root, [data-theme="light"] {
  /* --- Surfaces (Warm Cream) --- */
  --color-bg:             #f8f6f1;  /* Warm cream base */
  --color-surface:        #faf9f5;  /* Raised card */
  --color-surface-2:      #fcfbf8;  /* Raised+1 */
  --color-surface-offset: #f1eee7;  /* Offset/alternate section bg */
  --color-surface-offset-2: #eae6de; /* Offset+1 */
  --color-surface-dynamic: #e2ded5;  /* Hover bg / dynamic */
  --color-divider:        #dbd7ce;  /* Dividers */
  --color-border:         #cfc9be;  /* Borders */

  /* --- Text (Charcoal) --- */
  --color-text:           #1e2a3a;  /* Deep charcoal-navy */
  --color-text-muted:     #5c6a7a;  /* Secondary text */
  --color-text-faint:     #9ca5b0;  /* Disabled / placeholder */
  --color-text-inverse:   #f8f6f1;  /* Text on dark bg */

  /* --- Primary Accent (Deep Navy) --- */
  --color-primary:        #1b3a5c;  /* Deep navy */
  --color-primary-hover:  #14293f;  /* Darker navy */
  --color-primary-active: #0d1c2d;  /* Darkest */
  --color-primary-highlight: #d4dce6; /* Light navy tint */

  /* --- Secondary Accent (Muted Gold) --- */
  --color-gold:           #9e7e38;  /* Warm gold accent */
  --color-gold-hover:     #856928;  /* Darker gold */
  --color-gold-active:    #6c551e;  /* Darkest gold */
  --color-gold-highlight: #ebe3d0;  /* Light gold tint */

  /* --- Semantic: Success (Forest Green) --- */
  --color-success:        #3a6b3a;
  --color-success-hover:  #2a5129;
  --color-success-active: #1d3a1d;
  --color-success-highlight: #d4e0d4;

  /* --- Semantic: Error (Muted Red) --- */
  --color-error:          #9b3a3a;
  --color-error-hover:    #7a2a2a;
  --color-error-active:   #5c1e1e;
  --color-error-highlight: #e6d4d4;

  /* --- Semantic: Warning (Terra) --- */
  --color-warning:        #8c5a1e;
  --color-warning-hover:  #704816;
  --color-warning-active: #553610;
  --color-warning-highlight: #e4d9c6;

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

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

  /* --- Font families --- */
  --font-display: 'Libre Baskerville', 'Georgia', serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  /* --- Surfaces (Deep Warm Charcoal) --- */
  --color-bg:             #141a22;
  --color-surface:        #1a2230;
  --color-surface-2:      #1f283a;
  --color-surface-offset: #181f2b;
  --color-surface-offset-2: #1d2536;
  --color-surface-dynamic: #283344;
  --color-divider:        #243042;
  --color-border:         #344158;

  /* --- Text --- */
  --color-text:           #d8dce4;
  --color-text-muted:     #8a95a7;
  --color-text-faint:     #566070;
  --color-text-inverse:   #1a2230;

  /* --- Primary Accent (Steel Blue) --- */
  --color-primary:        #5b8ab8;
  --color-primary-hover:  #4a78a5;
  --color-primary-active: #3a6892;
  --color-primary-highlight: #1e2f44;

  /* --- Secondary Accent (Gold — brighter in dark) --- */
  --color-gold:           #c9a34a;
  --color-gold-hover:     #d4b360;
  --color-gold-active:    #dfc478;
  --color-gold-highlight: #2c2618;

  /* --- Semantic: Success --- */
  --color-success:        #5ea85e;
  --color-success-hover:  #449044;
  --color-success-active: #307830;
  --color-success-highlight: #1e2e1e;

  /* --- Semantic: Error --- */
  --color-error:          #cf6060;
  --color-error-hover:    #b84848;
  --color-error-active:   #a03535;
  --color-error-highlight: #301a1a;

  /* --- Semantic: Warning --- */
  --color-warning:        #c08838;
  --color-warning-hover:  #d49848;
  --color-warning-active: #e0a858;
  --color-warning-highlight: #2a2010;

  /* --- 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:             #141a22;
    --color-surface:        #1a2230;
    --color-surface-2:      #1f283a;
    --color-surface-offset: #181f2b;
    --color-surface-offset-2: #1d2536;
    --color-surface-dynamic: #283344;
    --color-divider:        #243042;
    --color-border:         #344158;
    --color-text:           #d8dce4;
    --color-text-muted:     #8a95a7;
    --color-text-faint:     #566070;
    --color-text-inverse:   #1a2230;
    --color-primary:        #5b8ab8;
    --color-primary-hover:  #4a78a5;
    --color-primary-active: #3a6892;
    --color-primary-highlight: #1e2f44;
    --color-gold:           #c9a34a;
    --color-gold-hover:     #d4b360;
    --color-gold-active:    #dfc478;
    --color-gold-highlight: #2c2618;
    --color-success:        #5ea85e;
    --color-success-hover:  #449044;
    --color-success-active: #307830;
    --color-success-highlight: #1e2e1e;
    --color-error:          #cf6060;
    --color-error-hover:    #b84848;
    --color-error-active:   #a03535;
    --color-error-highlight: #301a1a;
    --color-warning:        #c08838;
    --color-warning-hover:  #d49848;
    --color-warning-active: #e0a858;
    --color-warning-highlight: #2a2010;
    --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);
  }
}
