/* ============================================
   FlinUI Design Tokens
   Based on flin.dev design system
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    /* ========== Colors - Dark Theme (Default) ========== */

    /* Background */
    --bg-deep: #0a0a0f;
    --bg-surface: #12121a;
    --bg-elevated: #1a1a25;
    --bg-hover: #22222f;

    /* Text */
    --text-primary: #f5f5f7;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    /* Accent Colors */
    --accent-gold: #d4a853;
    --accent-gold-dim: #b8923d;
    --accent-violet: #8b5cf6;
    --accent-violet-dim: #6d44c4;
    --accent-cyan: #22d3ee;
    --accent-emerald: #34d399;
    --accent-rose: #f472b6;
    --accent-amber: #f59e0b;

    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #d4a853 0%, #f5d78e 50%, #d4a853 100%);
    --gradient-violet: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    --gradient-mesh:
        radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(212, 168, 83, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(34, 211, 238, 0.08) 0px, transparent 50%);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 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.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow-gold: 0 0 60px rgba(212, 168, 83, 0.2);
    --shadow-glow-violet: 0 0 60px rgba(139, 92, 246, 0.2);

    /* ========== Typography ========== */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Font Sizes */
    --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-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    --text-7xl: 4.5rem;      /* 72px */

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* ========== Spacing ========== */
    --space-0: 0;
    --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-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-16: 4rem;        /* 64px */
    --space-20: 5rem;        /* 80px */
    --space-24: 6rem;        /* 96px */

    /* ========== Layout ========== */
    --sidebar-width: 280px;
    --header-height: 64px;
    --max-width: 1400px;
    --max-width-prose: 65ch;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* ========== Transitions ========== */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;

    /* ========== Z-Index ========== */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
}

/* ========== Light Theme ========== */
[data-theme="light"] {
    /* Background */
    --bg-deep: #ffffff;
    --bg-surface: #f8fafc;
    --bg-elevated: #f1f5f9;
    --bg-hover: #e2e8f0;

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Borders */
    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.15);

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

    /* Gradients */
    --gradient-mesh:
        radial-gradient(at 40% 20%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(212, 168, 83, 0.06) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(34, 211, 238, 0.05) 0px, transparent 50%);
}

/* ========== Base Styles ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: var(--bg-deep);
}

/* Gradient text utility */
.gradient-text {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-violet {
    background: var(--gradient-violet);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Code syntax highlighting */
.code-keyword { color: var(--accent-violet); }
.code-type { color: var(--accent-cyan); }
.code-string { color: var(--accent-emerald); }
.code-comment { color: var(--text-muted); font-style: italic; }
.code-function { color: var(--accent-gold); }
.code-operator { color: var(--accent-rose); }
.code-number { color: var(--accent-rose); }
