// theme.jsx — Chrono design tokens, theme system, motion primitives const ChronoTokens = { // Spacing (4pt grid) s: { 4: 4, 8: 8, 12: 12, 16: 16, 20: 20, 24: 24, 32: 32, 40: 40, 48: 48, 64: 64 }, // Radii r: { sm: 8, card: 12, sheet: 16, modal: 24, pill: 9999 }, // Type stacks font: { ui: '"Geist", "Inter", -apple-system, system-ui, sans-serif', display: '"Geist", "Inter Tight", -apple-system, system-ui, sans-serif', mono: '"JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace', }, // Event palette (calibrated for dark glow) events: { blue: { base: '#5B8DEF', glow: '#3D7BFF' }, red: { base: '#FF5C7A', glow: '#FF3859' }, green: { base: '#3DDC97', glow: '#1FCB85' }, yellow: { base: '#F5C24A', glow: '#F0B22D' }, purple: { base: '#A78BFA', glow: '#8B5CF6' }, pink: { base: '#F472B6', glow: '#EC4899' }, orange: { base: '#FB923C', glow: '#F97316' }, // Neutral fallback for uncategorized events (no matching category). grey: { base: '#8A93A6', glow: '#6B7280' }, }, // Accent options accents: { indigo: '#6366F1', purple: '#8B5CF6', pink: '#EC4899', orange: '#F97316', blue: '#3B82F6', green: '#10B981', red: '#EF4444', }, }; // Build a full palette for a given mode + bg theme + accent function buildPalette({ mode = 'dark', bg = 'default', accent = 'indigo', futurism = 'off' }) { // Futurism shifts accent to a higher-chroma electric indigo/cyan blend const accents = { ...ChronoTokens.accents }; if (futurism !== 'off') { accents.indigo = '#5B7CFF'; accents.purple = '#7B5BFF'; accents.blue = '#3DA8FF'; } const a = accents[accent] || accents.indigo; const isDark = mode === 'dark'; const signal = futurism !== 'off' ? '#3DECFF' : (isDark ? '#A78BFA' : '#8B5CF6'); let bg0, bg1, bg2, bg3, hairline, text, textDim, textFaint, glassBg, glassBorder, ambient; if (isDark) { if (bg === 'true-black') { bg0 = '#000000'; bg1 = '#0A0A0A'; bg2 = '#141414'; bg3 = '#1C1C1C'; } else if (bg === 'midnight') { bg0 = '#070A14'; bg1 = '#0C1020'; bg2 = '#141A2E'; bg3 = '#1C2340'; } else if (bg === 'gradient') { bg0 = '#0B0D17'; bg1 = '#11131F'; bg2 = '#191C2C'; bg3 = '#222637'; } else { // default bg0 = '#0A0B10'; bg1 = '#10121A'; bg2 = '#181B26'; bg3 = '#222633'; } hairline = 'rgba(255,255,255,0.06)'; text = '#F2F3F8'; textDim = '#A8ADBC'; textFaint = '#5A6075'; glassBg = 'rgba(22, 24, 34, 0.72)'; glassBorder = 'rgba(255,255,255,0.08)'; ambient = `radial-gradient(80% 50% at 50% 0%, ${a}22 0%, transparent 70%)`; } else { bg0 = '#F6F6F9'; bg1 = '#FFFFFF'; bg2 = '#FAFAFC'; bg3 = '#F0F1F5'; hairline = 'rgba(10,12,20,0.08)'; text = '#0E1018'; textDim = '#5A6075'; textFaint = '#9AA0B0'; glassBg = 'rgba(255,255,255,0.78)'; glassBorder = 'rgba(10,12,20,0.06)'; ambient = `radial-gradient(80% 50% at 50% 0%, ${a}14 0%, transparent 70%)`; } return { mode, bg, accent, accentColor: a, futurism, signal, bg0, bg1, bg2, bg3, hairline, text, textDim, textFaint, glassBg, glassBorder, ambient, // Computed accent variants accentSoft: `${a}22`, accentSofter: `${a}14`, accentGlow: isDark ? `0 0 24px ${a}66, 0 0 48px ${a}22` : `0 0 16px ${a}44`, isDark, tokens: ChronoTokens, }; } // Spring-y animation helper — returns CSS transition value const Spring = { // Standard std: 'cubic-bezier(0.34, 1.56, 0.64, 1)', // Smooth (no overshoot) smooth: 'cubic-bezier(0.4, 0.0, 0.2, 1)', // Snappy snap: 'cubic-bezier(0.22, 1, 0.36, 1)', }; // Theme context const ThemeCtx = React.createContext(null); function useTheme() { return React.useContext(ThemeCtx); } // Inject global font + base styles (once) function ChronoGlobalStyles() { return ( ); } // Futuristic overlay — grid lattice, scan beam, corner brackets, mono telemetry HUD. // Render INSIDE a positioned container; it absolutely fills. function FuturisticLayer({ theme, intensity = 'subtle', telemetry, showScan = true }) { if (!theme.futurism || theme.futurism === 'off') return null; const full = intensity === 'full' || theme.futurism === 'full'; const sig = theme.signal; return (