/* ========================================
   CREATOR TOOLKIT — PREMIUM TECH DESIGN SYSTEM
   ======================================== */

/* ── Design Tokens ── */
:root {
    --z-base: 1;
    --z-header: 1000;
    --z-mobile-menu: 1100;
    --z-dropdown: 1200;
    --z-modal: 2000;
    --z-toast: 3000;
    /* Dark background system */
    --color-bg-primary: #070A12;
    --color-bg-secondary: #0B1020;
    --color-surface: #101624;
    --color-surface-elevated: #151D2E;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.16);

    /* Text */
    --color-text-primary: #F8FAFC;
    --color-text-secondary: #94A3B8;
    --color-text-muted: #64748B;

    /* Accents */
    --color-accent-blue: #3B82F6;
    --color-accent-cyan: #22D3EE;
    --color-accent-purple: #8B5CF6;
    --color-accent-orange: #F59E0B;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #3B82F6, #8B5CF6);
    --gradient-cyan-blue: linear-gradient(135deg, #22D3EE, #3B82F6);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 20px -6px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 60px -12px rgba(0, 0, 0, 0.8);
    --shadow-glow-blue: 0 0 40px -12px rgba(59, 130, 246, 0.15);
    --shadow-glow-purple: 0 0 40px -12px rgba(139, 92, 246, 0.15);

    /* 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;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", "Consolas", monospace;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Container */
    --container-max: 1120px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    background: var(--color-bg-primary);
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ── Ambient Background ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34, 211, 238, 0.03) 0%, transparent 60%);
    animation: ambientPulse 20s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ── Subtle Grid Texture ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
}

/* ── Base Elements ── */
img { max-width: 100%; display: block; }

a {
    color: var(--color-accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--color-accent-cyan);
}

/* ── Container ── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
    position: relative;
    z-index: 1;
}

/* ── Typography ── */
h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--color-text-primary);
}
h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}
h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
}
h4 {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

small {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.micro {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* ── Text Accent Utilities ── */
.text-blue { color: var(--color-accent-blue); }
.text-cyan { color: var(--color-accent-cyan); }
.text-purple { color: var(--color-accent-purple); }
.text-muted { color: var(--color-text-muted); }

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Responsive Typography ── */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.1rem; }
    p { font-size: 0.95rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
}

/* ── Utility Classes ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.glow-blue { box-shadow: var(--shadow-glow-blue); }
.glow-purple { box-shadow: var(--shadow-glow-purple); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--color-surface-elevated); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-border-hover); }

/* ── Selection ── */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--color-text-primary);
}
