-- Motel for Neovim. Place on rtp and:
--   vim.cmd.colorscheme("motel")
-- or: lua require("motel")  if you copy this file to lua/motel.lua

vim.cmd("highlight clear")
if vim.fn.exists("syntax_on") == 1 then
  vim.cmd("syntax reset")
end
vim.g.colors_name = "motel"
vim.o.background = "dark"
vim.o.termguicolors = true

local c = {
  base = "#18110d",
  surface = "#211814",
  overlay = "#2c211d",
  muted = "#7d6c64",
  subtle = "#9f8c82",
  text = "#e2d3c1",
  rust = "#ba5152",
  brass = "#b99868",
  copper = "#b19080",
  moss = "#809378",
  dusk = "#7690a1",
  wine = "#a98081",
  hl_low = "#1d1511",
  hl_med = "#403029",
  hl_high = "#5c4840",
  nc = "#120b09",
}

local function hi(group, spec)
  vim.api.nvim_set_hl(0, group, spec)
end

hi("Normal", { fg = c.text, bg = c.base })
hi("NormalNC", { fg = c.text, bg = c.nc })
hi("Comment", { fg = c.muted, italic = true })
hi("Constant", { fg = c.copper })
hi("String", { fg = c.brass })
hi("Number", { fg = c.copper })
hi("Boolean", { fg = c.copper })
hi("Identifier", { fg = c.text })
hi("Function", { fg = c.text })
hi("Statement", { fg = c.rust })
hi("Keyword", { fg = c.rust })
hi("Operator", { fg = c.subtle })
hi("PreProc", { fg = c.rust })
hi("Type", { fg = c.dusk })
hi("Special", { fg = c.copper })
hi("Underlined", { fg = c.wine, underline = true })
hi("Error", { fg = c.rust })
hi("Todo", { fg = c.brass, bold = true })
hi("LineNr", { fg = c.muted })
hi("CursorLineNr", { fg = c.subtle })
hi("CursorLine", { bg = c.hl_low })
hi("ColorColumn", { bg = c.overlay })
hi("SignColumn", { bg = c.base })
hi("VertSplit", { fg = c.hl_high })
hi("WinSeparator", { fg = c.hl_high })
hi("StatusLine", { fg = c.text, bg = c.surface })
hi("StatusLineNC", { fg = c.muted, bg = c.nc })
hi("TabLine", { fg = c.muted, bg = c.base })
hi("TabLineSel", { fg = c.text, bg = c.surface })
hi("Pmenu", { fg = c.text, bg = c.overlay })
hi("PmenuSel", { fg = c.text, bg = c.hl_med })
hi("Visual", { bg = c.hl_med })
hi("Search", { bg = c.hl_med, fg = c.text })
hi("IncSearch", { bg = c.rust, fg = c.base })
hi("MatchParen", { fg = c.rust, bold = true })
hi("DiagnosticError", { fg = c.rust })
hi("DiagnosticWarn", { fg = c.brass })
hi("DiagnosticInfo", { fg = c.dusk })
hi("DiagnosticHint", { fg = c.wine })
hi("DiffAdd", { fg = c.dusk })
hi("DiffChange", { fg = c.copper })
hi("DiffDelete", { fg = c.rust })
hi("GitSignsAdd", { fg = c.dusk })
hi("GitSignsChange", { fg = c.copper })
hi("GitSignsDelete", { fg = c.rust })
