local M = {}

function M.setup()
	require("base16-colorscheme").setup({
		-- Background tones
		base00 = "#18120b", -- Default Background
		base01 = "#2a241c", -- Lighter Background (status bars)
		base02 = "#352e26", -- Selection Background
		base03 = "#ab9e8e", -- Comments, Invisibles
		-- Foreground tones
		base04 = "#d3c4b4", -- Dark Foreground (status bars)
		base05 = "#fff3e6", -- Default Foreground
		base06 = "#fff3e6", -- Light Foreground
		base07 = "#ede1d4", -- Lightest Foreground
		-- Accent colors
		base08 = "#ffb4ab", -- Variables, XML Tags, Errors
		base09 = "#b7cea2", -- Integers, Constants
		base0A = "#ddc2a1", -- Classes, Search Background
		base0B = "#f3bd6e", -- Strings, Diff Inserted
		base0C = "#b7cea2", -- Regex, Escape Chars
		base0D = "#f3bd6e", -- Functions, Methods
		base0E = "#ddc2a1", -- Keywords, Storage
		base0F = "#da342e", -- Deprecated, Embedded Tags
	})
end

-- Register a signal handler for SIGUSR1 (matugen updates)
local signal = vim.uv.new_signal()
signal:start(
	"sigusr1",
	vim.schedule_wrap(function()
		package.loaded["matugen"] = nil
		require("matugen").setup()
	end)
)

return M
