/*
 * Sharksbait — Base Design System
 * Design tokens, reset, typography, themes.
 * Shared across all pages.
 */

/* ─── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens (Dark theme default) ───────────────────── */
:root {
    /* Slate background scale */
    --bg-0:        #07090d;
    --bg-1:        #0d1117;
    --bg-2:        #131a24;
    --bg-3:        #1a2332;

    /* Borders */
    --border-1:    #1f2937;
    --border-2:    #2a3a4a;
    --border-3:    #374151;

    /* Text */
    --text-0:      #f8fafc;
    --text-1:      #e2e8f0;
    --text-2:      #94a3b8;
    --text-3:      #64748b;
    --text-4:      #475569;

    /* Brand accents — blue + amber */
    --accent:      #3b82f6;
    --accent-deep: #1e40af;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --cta:         #f59e0b;
    --cta-soft:    rgba(245, 158, 11, 0.12);

    /* Semantic */
    --good:        #22c55e;
    --good-soft:   rgba(34, 197, 94, 0.12);
    --warn:        #f59e0b;
    --warn-soft:   rgba(245, 158, 11, 0.12);
    --bad:         #ef4444;
    --bad-soft:    rgba(239, 68, 68, 0.12);

    /* Effects */
    --radius-sm:   6px;
    --radius:      10px;
    --radius-lg:   14px;
    --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
    --shadow:      0 4px 16px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.02) inset;
    --shadow-lg:   0 12px 32px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.03) inset;
    --ring:        0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent);

    /* Motion */
    --t-fast:      120ms cubic-bezier(0.4, 0, 0.2, 1);
    --t:           200ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow:      320ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index scale */
    --z-base: 1;
    --z-sticky: 10;
    --z-dropdown: 20;
    --z-overlay: 30;
    --z-modal: 50;

    /* Typography */
    --font-sans: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'Fira Code', ui-monospace, 'SF Mono', Monaco, Consolas, monospace;

    color-scheme: dark;
}

/* ─── Light theme overrides ────────────────────────────────── */
:root[data-theme="light"] {
    --bg-0:        #f8fafc;
    --bg-1:        #ffffff;
    --bg-2:        #f1f5f9;
    --bg-3:        #e2e8f0;

    --border-1:    #e2e8f0;
    --border-2:    #cbd5e1;
    --border-3:    #94a3b8;

    --text-0:      #0f172a;
    --text-1:      #1e293b;
    --text-2:      #475569;
    --text-3:      #64748b;
    --text-4:      #94a3b8;

    --accent:      #2563eb;
    --accent-deep: #1e40af;
    --accent-soft: rgba(37, 99, 235, 0.10);
    --cta:         #d97706;
    --cta-soft:    rgba(217, 119, 6, 0.10);

    --good:        #16a34a;
    --good-soft:   rgba(22, 163, 74, 0.10);
    --warn:        #d97706;
    --warn-soft:   rgba(217, 119, 6, 0.10);
    --bad:         #dc2626;
    --bad-soft:    rgba(220, 38, 38, 0.10);

    --shadow-sm:   0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow:      0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(15, 23, 42, 0.02) inset;
    --shadow-lg:   0 12px 32px rgba(15, 23, 42, 0.14), 0 1px 0 rgba(15, 23, 42, 0.03) inset;
    --ring:        0 0 0 2px var(--bg-1), 0 0 0 4px var(--accent);

    color-scheme: light;
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
body {
    font-family: var(--font-sans);
    font-weight: 400;
    background:
        radial-gradient(ellipse at top, rgba(30, 64, 175, 0.06), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(245, 158, 11, 0.04), transparent 50%),
        var(--bg-0);
    color: var(--text-1);
    min-height: 100vh;
    line-height: 1.5;
}

/* Light mode body gradient */
:root[data-theme="light"] body {
    background:
        radial-gradient(ellipse at top, rgba(37, 99, 235, 0.06), transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(217, 119, 6, 0.04), transparent 50%),
        var(--bg-0);
}

/* Tabular numerics for financial figures */
.val, .amt, .deposits, .num, .mono,
input[type="number"] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

/* Focus rings — keyboard only */
:focus { outline: none; }
:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 4px;
    border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }
:root[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border: 2px solid var(--bg-0);
}
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--border-3); }
