/* ==========================================================================
   J.S. Enterprises & Solar Tech - Design System Tokens
   Derived from SKILL (1).md & DESIGN (2).md + WCAG 2.2 AA Contrast Standards
   ========================================================================== */

:root {
  /* Typography */
  --font-primary: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Poppins', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --font-size-xs: 12px;
  --font-size-sm: 12px;
  --font-size-md: 14px;
  --font-size-lg: 14px;
  --font-size-xl: 14px;
  --font-size-2xl: 14px;
  --font-size-3xl: 16px;
  --font-size-4xl: 16px;
  --font-size-base: 16px;
  --font-weight-base: 400;
  --font-line-height-base: 26.4px;

  /* Fluid Display Hierarchy */
  --text-h1: clamp(2.125rem, 4vw, 3.5rem);
  --text-h2: clamp(1.75rem, 3vw, 2.5rem);
  --text-h3: clamp(1.25rem, 1.55vw, 1.375rem);
  --text-lead: 1.125rem;

  /* Color Palette (Obsidian Dark Default - WCAG 2.2 AA Verified) */
  --color-text-primary: #eef2ff;
  --color-text-secondary: #98a3c0;
  --color-text-tertiary: #ffb52e;
  --color-text-inverse: #1a0a00;

  --color-surface-base: #060a13;
  --color-surface-alt: #0b1120;
  --color-surface-bezel: rgba(238, 242, 255, 0.04);
  --color-surface-card: #0f172a;
  --color-surface-card-elevated: #141f38;
  --color-surface-input: #0a101e;
  --color-surface-header: rgba(6, 10, 19, 0.84);

  /* Semantic Accents */
  --color-surface-strong: #ff7a18;
  --color-surface-strong-hover: #ff8f3a;
  --color-surface-raised: #25d366;
  --color-text-on-raised: #032210;
  --color-accent-cyan: #38bdf8;
  --color-accent-soft: rgba(255, 122, 24, 0.14);
  --color-amber-soft: rgba(255, 181, 46, 0.14);
  --color-green-soft: rgba(37, 211, 102, 0.14);

  /* Borders & Focus */
  --color-border-subtle: rgba(238, 242, 255, 0.09);
  --color-border-medium: rgba(238, 242, 255, 0.18);
  --color-border-strong: #ffffff;
  --color-border-accent: rgba(255, 122, 24, 0.45);
  --color-focus-ring: #ffb52e;

  /* Feedback States */
  --color-error-text: #fca5a5;
  --color-error-border: #ef4444;
  --color-error-surface: rgba(239, 68, 68, 0.12);
  --color-success-text: #86efac;
  --color-success-surface: rgba(37, 211, 102, 0.12);

  /* Spacing Scale (DESIGN (2).md base + macro rhythm) */
  --space-1: 2.55px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 7px;
  --space-5: 8px;
  --space-6: 10px;
  --space-7: 11px;
  --space-8: 12px;
  --space-12: 16px;
  --space-16: 24px;
  --space-20: 28px;
  --space-24: 36px;
  --space-32: 48px;
  --space-48: 72px;
  --section-py: clamp(4.75rem, 7.5vw, 7rem);

  /* Radii (Concentric Double-Bezel Geometry: outer 24px - 6px pad = 18px inner) */
  --radius-xs: 6px;
  --radius-sm: 12px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-1: 0 10px 30px -8px rgba(255, 122, 24, 0.52);
  --shadow-2: 0 14px 36px -10px rgba(2, 6, 18, 0.72);
  --shadow-3: 0 0 40px 0 rgba(255, 122, 24, 0.28);
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.12);

  /* Motion */
  --motion-duration-instant: 300ms;
  --motion-duration-fast: 350ms;
  --motion-duration-normal: 400ms;
  --motion-duration-slow: 1000ms;
  --ease-fluid: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);

  /* Layout & Z-Index Scale */
  --container-max: 1280px;
  --header-height: 76px;
  --z-base: 1;
  --z-sticky: 30;
  --z-header: 40;
  --z-grain: 45;
  --z-fab: 50;
  --z-modal: 60;
  --z-skip: 70;
}

/* Optional Accessible Light Mode (triggered via Theme Toggle) */
[data-theme="light"] {
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-tertiary: #b45309;
  --color-text-inverse: #1a0a00;

  --color-surface-base: #f4f7fb;
  --color-surface-alt: #eaf0f8;
  --color-surface-bezel: rgba(15, 23, 42, 0.045);
  --color-surface-card: #ffffff;
  --color-surface-card-elevated: #f8fafc;
  --color-surface-input: #ffffff;
  --color-surface-header: rgba(244, 247, 251, 0.88);

  --color-surface-strong: #ff7a18;
  --color-surface-strong-hover: #f97316;
  --color-surface-raised: #25d366;
  --color-text-on-raised: #032210;
  --color-accent-cyan: #0369a1;
  --color-accent-soft: rgba(255, 122, 24, 0.12);
  --color-amber-soft: rgba(217, 119, 6, 0.12);
  --color-green-soft: rgba(22, 163, 74, 0.12);

  --color-border-subtle: rgba(15, 23, 42, 0.10);
  --color-border-medium: rgba(15, 23, 42, 0.18);
  --color-border-strong: #0f172a;
  --color-border-accent: rgba(234, 88, 12, 0.42);
  --color-focus-ring: #c2410c;

  --color-error-text: #b91c1c;
  --color-error-border: #dc2626;
  --color-error-surface: rgba(220, 38, 38, 0.08);
  --color-success-text: #15803d;
  --color-success-surface: rgba(22, 163, 74, 0.1);

  --shadow-1: 0 12px 28px -8px rgba(234, 88, 12, 0.35);
  --shadow-2: 0 14px 34px -10px rgba(15, 23, 42, 0.10);
  --shadow-3: 0 0 32px 0 rgba(255, 122, 24, 0.18);
  --shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
