/* ==========================================================================
   InfyPress V2 — Design Tokens
   Light + Dark mode via CSS custom properties

   Breakpoints (reference — cannot be used as var() in @media queries):
       --bp-sm:  480px
       --bp-md:  768px
       --bp-lg: 1024px
       --bp-xl: 1200px
   ========================================================================== */

:root {
    /* --- Color Palette (raw values) --- */
    --white: #ffffff;
    --black: #000000;

    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eaeaea;
    --gray-300: #d0d0d0;
    --gray-400: #999999;
    --gray-500: #888888;
    --gray-600: #666666;
    --gray-700: #444444;
    --gray-800: #333333;
    --gray-900: #222222;
    --gray-950: #111111;

    /* --- Semantic Colors (Light Mode) --- */
    --bg-base: #ffffff;
    --bg-surface: #fafafa;
    --bg-surface-hover: #f1f1f1;
    --bg-elevated: #f5f5f5;
    --bg-inverse: #111111;

    --border-light: #eaeaea;
    --border-medium: #d0d0d0;
    --border-strong: #999999;

    --text-primary: #111111;
    --text-secondary: #666666;
    --text-tertiary: #888888;
    --text-inverse: #ffffff;

    --accent: #000000;
    --accent-hover: #333333;
    --accent-fg: #ffffff;

    /* --- Brand / Status Colors --- */
    --wp-blue: #2563eb;
    --wp-blue-bg: rgba(37, 99, 235, 0.05);
    --wp-blue-border: rgba(37, 99, 235, 0.2);

    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.05);
    --success-border: rgba(5, 150, 105, 0.2);

    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.05);
    --warning-border: rgba(217, 119, 6, 0.2);

    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.05);
    --danger-border: rgba(220, 38, 38, 0.2);

    --info: #6366f1;
    --info-bg: rgba(99, 102, 241, 0.05);
    --info-border: rgba(99, 102, 241, 0.2);

    /* --- Navbar --- */
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --navbar-border: var(--border-light);

    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);

    /* --- Body Grid Pattern --- */
    --grid-line: rgba(0, 0, 0, 0.025);

    /* --- Gradients --- */
    --gradient-text: linear-gradient(180deg, #111 0%, #666 100%);
    --gradient-accent: linear-gradient(135deg, #059669, #2563eb);
    --gradient-border: linear-gradient(90deg, #f9fafb, #e5e7eb, #f9fafb);

    /* --- Typography --- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --text-2xs: 0.625rem;   /* 10px */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-2-5xl: 1.75rem;  /* 28px */
    --text-3xl: 2rem;       /* 32px */
    --text-4xl: 2.5rem;     /* 40px */
    --text-5xl: 3rem;       /* 48px */
    --text-6xl: 4rem;       /* 64px */
    --text-7xl: 4.5rem;     /* 72px */

    --leading-none: 1;
    --leading-tight: 1.2;
    --leading-snug: 1.4;
    --leading-normal: 1.6;
    --leading-relaxed: 1.7;
    --leading-loose: 1.8;

    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.05em;
    --tracking-wider: 0.08em;

    /* --- Spacing (rem-based; 1rem = 16px) --- */
    --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-7: 1.75rem;     /* 28px */
    --space-8: 2rem;        /* 32px */
    --space-9: 2.25rem;     /* 36px */
    --space-10: 2.5rem;     /* 40px */
    --space-11: 2.75rem;    /* 44px */
    --space-12: 3rem;       /* 48px */
    --space-14: 3.5rem;     /* 56px */
    --space-16: 4rem;       /* 64px */
    --space-20: 5rem;       /* 80px */
    --space-24: 6rem;       /* 96px */
    --space-25: 6.25rem;    /* 100px */
    --space-28: 7rem;       /* 112px */
    --space-30: 7.5rem;     /* 120px */
    --space-32: 8rem;       /* 128px */

    /* --- Component Sizes (intrinsic dimensions; distinct from spacing) --- */
    --size-2: 0.5rem;       /* 8px */
    --size-4: 1rem;         /* 16px */
    --size-5: 1.25rem;      /* 20px */
    --size-6: 1.5rem;       /* 24px */
    --size-10: 2.5rem;      /* 40px */
    --size-11: 2.75rem;     /* 44px - iOS HIG touch target min */
    --size-12: 3rem;        /* 48px */
    --size-14: 3.5rem;      /* 56px */

    /* --- Icon Sizes (rem; tracks root, decoupled from --text-*) --- */
    --icon-2xs: 0.625rem;   /* 10px */
    --icon-xs: 0.75rem;     /* 12px */
    --icon-sm: 0.875rem;    /* 14px */
    --icon-md: 1rem;        /* 16px */
    --icon-lg: 1.125rem;    /* 18px */
    --icon-xl: 1.25rem;     /* 20px */
    --icon-2xl: 1.5rem;     /* 24px */
    --icon-3xl: 2rem;       /* 32px */
    --icon-4xl: 3rem;       /* 48px */

    /* --- Border Radius (rem so corners scale with font; full stays px) --- */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-full: 9999px;

    /* --- Border Widths --- */
    --border-hairline: 1px;
    --border-thick: 2px;

    /* --- Layout (rem; container widths scale with root font) --- */
    --container-xs: 20rem;          /* 320px */
    --container-form: 26.25rem;     /* 420px - auth wrappers, modal forms, narrow cards */
    --container-prose-narrow: 30rem;/* 480px */
    --container-hero-lead: 35rem;   /* 560px - hero leads, search bars, newsletter */
    --container-prose: 40rem;       /* 640px - optimal reading measure ~65ch */
    --container-md: 45rem;          /* 720px */
    --container-sm: 50rem;          /* 800px */
    --container-lg: 60rem;          /* 960px */
    --container-max: 75rem;         /* 1200px */
    --container-padding: var(--space-6);

    /* --- Z-index Scale --- */
    --z-base: 1;
    --z-raised: 2;
    --z-sticky: 90;
    --z-header: 100;
    --z-dropdown: 150;
    --z-drawer: 200;
    --z-overlay: 300;
    --z-modal: 1000;
    --z-toast: 2000;
    --z-tooltip: 3000;

    /* --- Shadows (extended) --- */
    --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);

    /* --- Focus Rings --- */
    --focus-ring: 0 0 0 3px var(--wp-blue-bg);
    --focus-ring-success: 0 0 0 3px var(--success-bg);
    --focus-ring-danger: 0 0 0 3px var(--danger-bg);
    --focus-ring-warning: 0 0 0 3px var(--warning-bg);
    --focus-ring-outline: 2px solid var(--wp-blue);

    /* --- Backdrop Blur --- */
    --blur-sm: 4px;
    --blur-md: 12px;
    --blur-lg: 24px;

    /* --- Opacity Scale --- */
    --opacity-disabled: 0.5;
    --opacity-hover: 0.9;
    --opacity-muted: 0.7;
    --opacity-subtle: 0.3;
    --opacity-faint: 0.2;

    /* --- Duration Primitives ---
       New code should compose: var(--duration-*) var(--ease-*).
       Existing --transition-* composites stay byte-identical for back-compat. */
    --duration-instant: 100ms;
    --duration-fast: 150ms;
    --duration-base: 200ms;
    --duration-slow: 300ms;
    --duration-slower: 500ms;
    --duration-drawer: 400ms;
    --duration-gradient: 8s;
    --duration-spin: 0.8s;

    /* --- Easing Primitives --- */
    --ease-default: ease;
    --ease-linear: linear;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);

    /* --- Transitions (legacy composites; preserved byte-identical) --- */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-drawer: 0.3s ease;
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

[data-theme="dark"] {
    --bg-base: #0a0a0a;
    --bg-surface: #0f0f0f;
    --bg-surface-hover: #1c1c1c;
    --bg-elevated: #1a1a1a;
    --bg-inverse: #ffffff;

    --border-light: #1e1e1e;
    --border-medium: #2e2e2e;
    --border-strong: #555555;

    --text-primary: #ededed;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --text-inverse: #111111;

    --accent: #ffffff;
    --accent-hover: #d4d4d4;
    --accent-fg: #000000;

    /* Status colors stay the same hue, adjust bg opacity for dark */
    --wp-blue-bg: rgba(37, 99, 235, 0.1);
    --wp-blue-border: rgba(37, 99, 235, 0.3);

    --success-bg: rgba(5, 150, 105, 0.1);
    --success-border: rgba(5, 150, 105, 0.3);

    --warning-bg: rgba(217, 119, 6, 0.1);
    --warning-border: rgba(217, 119, 6, 0.3);

    --danger-bg: rgba(220, 38, 38, 0.1);
    --danger-border: rgba(220, 38, 38, 0.3);

    --info-bg: rgba(99, 102, 241, 0.1);
    --info-border: rgba(99, 102, 241, 0.3);

    /* Navbar */
    --navbar-bg: rgba(10, 10, 10, 0.85);
    --navbar-border: var(--border-light);

    /* Shadows — subtle glow in dark mode */
    --shadow-xs: 0 1px 1px rgba(0, 0, 0, 0.25);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.3);

    /* Grid pattern */
    --grid-line: rgba(255, 255, 255, 0.025);

    /* Gradient text for dark */
    --gradient-text: linear-gradient(180deg, #ededed 0%, #888 100%);

    /* Gradient border — muted green/blue for dark */
    --gradient-border: linear-gradient(90deg, #034930, #0f3460, #034930);
}
