/* style.css — Design Tokens & Component Styles for Dr Phong Ho */

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

/* ============================================
   FONT FAMILIES
   ============================================ */
:root {
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

/* ============================================
   CUSTOM PALETTE — Medical Teal + Clean White
   Light Mode
   ============================================ */
:root, [data-theme="light"] {
  /* Surfaces — clean white + cool gray */
  --color-bg:             #ffffff;
  --color-surface:        #f8fafb;
  --color-surface-2:      #f0f4f6;
  --color-surface-offset: #e8eef1;
  --color-surface-offset-2: #dfe7eb;
  --color-surface-dynamic: #d5dfe4;
  --color-divider:        #dce4e9;
  --color-border:         #cdd7de;

  /* Text — dark navy */
  --color-text:           #1a2332;
  --color-text-muted:     #5a6b7d;
  --color-text-faint:     #94a3b5;
  --color-text-inverse:   #ffffff;

  /* Primary Accent — Medical Teal */
  --color-primary:        #0d7377;
  --color-primary-hover:  #0a5c5f;
  --color-primary-active: #084849;
  --color-primary-highlight: #d4eaeb;

  /* Error */
  --color-error:          #b91c1c;
  --color-error-hover:    #991b1b;
  --color-error-highlight: #fee2e2;

  /* Success */
  --color-success:        #15803d;
  --color-success-hover:  #166534;
  --color-success-highlight: #dcfce7;

  /* Warning */
  --color-warning:        #a16207;
  --color-warning-hover:  #854d0e;
  --color-warning-highlight: #fef9c3;

  /* 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 (cool-toned to match palette) */
  --shadow-sm: 0 1px 2px oklch(0.25 0.01 230 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.25 0.01 230 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.25 0.01 230 / 0.12);

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

/* ============================================
   DARK MODE — Dark Navy + Lighter Teal
   ============================================ */
[data-theme="dark"] {
  --color-bg:             #0f1720;
  --color-surface:        #141e29;
  --color-surface-2:      #1a2636;
  --color-surface-offset: #1e2d3d;
  --color-surface-offset-2: #243544;
  --color-surface-dynamic: #2c3e4e;
  --color-divider:        #253444;
  --color-border:         #324556;

  --color-text:           #dce4ea;
  --color-text-muted:     #8a9bae;
  --color-text-faint:     #5b6d80;
  --color-text-inverse:   #0f1720;

  --color-primary:        #3fb5b9;
  --color-primary-hover:  #2d9ea2;
  --color-primary-active: #1f8488;
  --color-primary-highlight: #1a3a3d;

  --color-error:          #f87171;
  --color-error-hover:    #ef4444;
  --color-error-highlight: #3a1c1c;

  --color-success:        #4ade80;
  --color-success-hover:  #22c55e;
  --color-success-highlight: #1a3a24;

  --color-warning:        #facc15;
  --color-warning-hover:  #eab308;
  --color-warning-highlight: #3a3518;

  --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:             #0f1720;
    --color-surface:        #141e29;
    --color-surface-2:      #1a2636;
    --color-surface-offset: #1e2d3d;
    --color-surface-offset-2: #243544;
    --color-surface-dynamic: #2c3e4e;
    --color-divider:        #253444;
    --color-border:         #324556;

    --color-text:           #dce4ea;
    --color-text-muted:     #8a9bae;
    --color-text-faint:     #5b6d80;
    --color-text-inverse:   #0f1720;

    --color-primary:        #3fb5b9;
    --color-primary-hover:  #2d9ea2;
    --color-primary-active: #1f8488;
    --color-primary-highlight: #1a3a3d;

    --color-error:          #f87171;
    --color-error-hover:    #ef4444;
    --color-error-highlight: #3a1c1c;

    --color-success:        #4ade80;
    --color-success-hover:  #22c55e;
    --color-success-highlight: #1a3a24;

    --color-warning:        #facc15;
    --color-warning-hover:  #eab308;
    --color-warning-highlight: #3a3518;

    --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);
  }
}
