/**
 * DirectionZ™ Theme & Design System Tokens
 * Supports Dark Studio (Carbon & Electric Accent) & Light Paper (Warm Swiss Minimal)
 */

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition-fast: 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-base: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-smooth: 0.35s cubic-bezier(0.65, 0, 0.35, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Iconography Design Tokens */
    --icon-xs: 0.75rem;    /* 12px */
    --icon-sm: 0.875rem;   /* 14px */
    --icon-md: 1rem;       /* 16px */
    --icon-lg: 1.25rem;    /* 20px */
    --icon-xl: 1.5rem;     /* 24px */
    --icon-2xl: 2rem;      /* 32px */
    --icon-3xl: 2.75rem;   /* 44px */
}

/* Dark Studio Mode (Default) */
[data-theme="dark"], :root {
    --bg-primary: #0b0c0e;
    --bg-secondary: #131519;
    --bg-tertiary: #1b1e24;
    --bg-elevated: #222630;
    --bg-card: #14161c;
    --bg-card-hover: #1a1d25;
    --bg-overlay: rgba(11, 12, 14, 0.85);
    --bg-glass: rgba(19, 21, 25, 0.75);
    --bg-glass-border: rgba(255, 255, 255, 0.08);

    --text-primary: #f4f4f6;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;

    --border-subtle: #242731;
    --border-light: #2e3340;
    --border-highlight: rgba(255, 255, 255, 0.15);

    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-surface: rgba(99, 102, 241, 0.12);

    --accent-secondary: #ec4899;
    --accent-warning: #f59e0b;
    --accent-success: #10b981;
    --accent-danger: #ef4444;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.8);

    --color-scheme: dark;
}

/* Light Paper Mode */
[data-theme="light"] {
    --bg-primary: #f8f8f6;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f1ed;
    --bg-elevated: #e8e8e4;
    --bg-card: #ffffff;
    --bg-card-hover: #fafaf8;
    --bg-overlay: rgba(248, 248, 246, 0.88);
    --bg-glass: rgba(255, 255, 255, 0.82);
    --bg-glass-border: rgba(0, 0, 0, 0.08);

    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-tertiary: #71717a;
    --text-muted: #a1a1aa;

    --border-subtle: #e4e4e7;
    --border-light: #d4d4d8;
    --border-highlight: rgba(0, 0, 0, 0.12);

    --accent-primary: #4f46e5;
    --accent-hover: #4338ca;
    --accent-glow: rgba(79, 70, 229, 0.2);
    --accent-surface: rgba(79, 70, 229, 0.08);

    --accent-secondary: #db2777;
    --accent-warning: #d97706;
    --accent-success: #059669;
    --accent-danger: #dc2626;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);

    --color-scheme: light;
}

/* Anti-FOUC & Anti-Blink Engine: Disables all transitions during page load & refresh */
.theme-preload,
.theme-preload *,
.theme-preload *::before,
.theme-preload *::after {
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-transition: none !important;
    -ms-transition: none !important;
    transition: none !important;
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    color-scheme: var(--color-scheme);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}
