/* ========================================
   PAPiKOPI — Design Tokens
   Brand colors, typography, spacing, shadows
   per HANDBOOK.md §6
   ======================================== */

:root {
  /* Brand Colors */
  --color-papikopi-blue: #4BC5D9;
  --color-papikopi-orange: #F7943A;
  --color-dark-slate: #485C69;
  --color-papikopi-brown: #5B3A29;
  --color-cream: #F7F4EF;
  --color-papi-dark-brown: #3D2318;
  --color-papi-warm-tan: #C99A4A;

  /* Semantic Colors */
  --color-bg-primary: var(--color-cream);
  --color-bg-secondary: #FFFFFF;
  --color-bg-tertiary: #F0ECE5;
  --color-text-primary: var(--color-papi-dark-brown);
  --color-text-secondary: var(--color-dark-slate);
  --color-text-muted: #8B7D6B;
  --color-text-on-primary: #FFFFFF;
  --color-text-on-orange: #FFFFFF;
  --color-border: #E8E2D9;
  --color-border-strong: #D4CBBF;

  /* Status Colors */
  --color-success: #2E7D32;
  --color-success-bg: #E8F5E9;
  --color-warning: #F57F17;
  --color-warning-bg: #FFF8E1;
  --color-error: #C62828;
  --color-error-bg: #FFEBEE;
  --color-info: var(--color-papikopi-blue);
  --color-info-bg: #E0F7FA;

  /* Typography */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-extrabold: 800;

  /* --- Responsive Typography Tokens (clamp-based) --- */
  /* Page / Major Title: 2.25rem tablet/desktop -> 1.5rem small phone */
  --text-page-title: clamp(1.5rem, 4.5vw, 2.25rem);
  /* Section Title: 1.5rem -> 1.125rem */
  --text-section-title: clamp(1.125rem, 3.2vw, 1.5rem);
  /* Card Title / Product Name: 1.125rem -> 0.9375rem */
  --text-card-title: clamp(0.9375rem, 2.5vw, 1.125rem);
  /* Body: 1rem -> 0.875rem */
  --text-body: clamp(0.875rem, 2.2vw, 1rem);
  /* Meta / Supporting: 0.8125rem -> 0.75rem */
  --text-meta: clamp(0.75rem, 1.8vw, 0.8125rem);
  /* Small Label: 0.75rem -> 0.6875rem */
  --text-label: clamp(0.6875rem, 1.6vw, 0.75rem);
  /* Tiny / Micro: 0.6875rem -> 0.625rem */
  --text-tiny: clamp(0.625rem, 1.4vw, 0.6875rem);

  /* --- Static Fallbacks (for non-clamp contexts) --- */
  --font-size-xs: 0.7rem;
  --font-size-sm: 0.8125rem;
  --font-size-base: 0.9375rem;
  --font-size-lg: 1.0625rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

  --line-height-tight: 1.1;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;

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

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(61, 35, 24, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(61, 35, 24, 0.1), 0 2px 4px -2px rgba(61, 35, 24, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(61, 35, 24, 0.1), 0 4px 6px -4px rgba(61, 35, 24, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(61, 35, 24, 0.1), 0 8px 10px -6px rgba(61, 35, 24, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;

  /* Layout */
  --header-height: 56px;
  --nav-height: 72px;
  --max-width: 480px;
  --container-padding: var(--space-4);

  /* Safe Area */
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
}

/* Dark mode (future-proofing) */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg-primary: #1A1612;
    --color-bg-secondary: #231D17;
    --color-bg-tertiary: #2D251D;
    --color-text-primary: #F7F4EF;
    --color-text-secondary: #C9B8A3;
    --color-text-muted: #8B7D6B;
    --color-border: #3D3228;
    --color-border-strong: #4D3F32;
  }
}