/* Palettes taken from omarchy.org's theme set, plus claude + ghostty */
:root { --bg:#faf4ed; --surface:#fffaf3; --line:#e1dbd5; --line-strong:#cecacd; --text:#575279; --text-2:#5e587d; --muted:#676284; --brand:#56949f; }
[data-theme="claude"]      { --bg:#1f1e1d; --surface:#262624; --line:#33322f; --line-strong:#4a4844; --text:#f0eee6; --text-2:#c2c0b6; --muted:#8f8d86; --brand:#d77757; }
[data-theme="ghostty"]     { --bg:#282c34; --surface:#2f343d; --line:#353b45; --line-strong:#4b5263; --text:#ffffff; --text-2:#d0d4dc; --muted:#9aa1ad; --brand:#61afef; }
[data-theme="tokyo-night"] { --bg:#1a1b26; --surface:#1f2230; --line:#24283b; --line-strong:#414868; --text:#c0caf5; --text-2:#a9b1d6; --muted:#8b93b8; --brand:#9ece6a; }
[data-theme="catppuccin"]  { --bg:#1e1e2e; --surface:#282839; --line:#313244; --line-strong:#585b70; --text:#cdd6f4; --text-2:#cdd6f4; --muted:#9399b2; --brand:#89b4fa; }
[data-theme="gruvbox"]     { --bg:#282828; --surface:#32302f; --line:#3c3836; --line-strong:#665c54; --text:#d4be98; --text-2:#d4be98; --muted:#a89984; --brand:#7daea3; }
[data-theme="everforest"]  { --bg:#2d353b; --surface:#303a40; --line:#343f44; --line-strong:#475258; --text:#d3c6aa; --text-2:#d3c6aa; --muted:#918f84; --brand:#7fbbb3; }
[data-theme="nord"]        { --bg:#2e3440; --surface:#343b49; --line:#3b4252; --line-strong:#4c566a; --text:#d8dee9; --text-2:#d8dee9; --muted:#9fa7b4; --brand:#81a1c1; }
[data-theme="kanagawa"]    { --bg:#1f1f28; --surface:#202838; --line:#223249; --line-strong:#54546d; --text:#dcd7ba; --text-2:#dcd7ba; --muted:#a7a492; --brand:#e6c384; }
[data-theme="matte-black"] { --bg:#121212; --surface:#181818; --line:#1e1e1e; --line-strong:#333;    --text:#eaeaea; --text-2:#bebebe; --muted:#8a8a8a; --brand:#e68e0d; }
[data-theme="hackerman"]   { --bg:#0b0c16; --surface:#10121f; --line:#151828; --line-strong:#2d3450; --text:#ddf7ff; --text-2:#ddf7ff; --muted:#a4b2ca; --brand:#82fb9c; }
[data-theme="osaka-jade"]  { --bg:#111c18; --surface:#1a2a22; --line:#23372b; --line-strong:#53685b; --text:#f7e8b2; --text-2:#c1c497; --muted:#969978; --brand:#509475; }
[data-theme="ristretto"]   { --bg:#2c2525; --surface:#342a28; --line:#3d2f2a; --line-strong:#72696a; --text:#e6d9db; --text-2:#e6d9db; --muted:#aca1a2; --brand:#f38d70; }
[data-theme="rose-pine"]   { --bg:#faf4ed; --surface:#fffaf3; --line:#e1dbd5; --line-strong:#cecacd; --text:#575279; --text-2:#5e587d; --muted:#676284; --brand:#56949f; }
[data-theme="catppuccin-latte"] { --bg:#eff1f5; --surface:#f8f9fb; --line:#d7d8dc; --line-strong:#acb0be; --text:#4c4f69; --text-2:#53556f; --muted:#5c5f77; --brand:#1e66f5; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  transition: background .2s, color .2s;
}

a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in srgb, var(--brand) 35%, transparent); }

/* Wallpaper behind the translucent window */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60vw 50vh at 15% 20%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
    radial-gradient(50vw 60vh at 90% 85%, color-mix(in srgb, var(--line-strong) 70%, transparent), transparent 70%),
    var(--bg);
}
.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 10%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* Waybar-ish top bar */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-2);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.workspaces { display: flex; gap: 2px; }
.workspaces button {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0 8px;
  height: 30px;
  cursor: pointer;
}
.workspaces button:hover { color: var(--text); }
.workspaces button.active { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.bar-right { display: flex; gap: 16px; align-items: center; }
.theme-btn {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.theme-btn:hover { color: var(--brand); }

/* The terminal window (Hyprland-style: gaps, border, blur) */
.window {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1100px, calc(100% - 32px));
  height: calc(100% - 30px - 24px);
  margin: 12px auto;
  border: 2px solid var(--brand);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.titlebar {
  display: flex;
  justify-content: space-between;
  padding: 4px 14px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
}

.buffer {
  flex: 1;
  overflow-y: auto;
  padding: 18px 0;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.prompt { padding: 0 20px 14px; color: var(--muted); }
.prompt b { color: var(--brand); font-weight: 500; }

/* Rows */
.row {
  display: grid;
  grid-template-columns: 2.5ch 1fr;
  padding: 6px 20px 6px 12px;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.row .marker { color: transparent; }
.row.sel {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  border-left-color: var(--brand);
}
.row.sel .marker { color: var(--brand); }
.row-head { display: flex; flex-wrap: wrap; gap: 0 1.5ch; align-items: baseline; }
.row-title { color: var(--text); font-weight: 700; }
.row-role { color: var(--text-2); }
.row-date { color: var(--muted); margin-left: auto; font-size: 12px; }
.row-desc { color: var(--muted); }
.row-link { color: var(--brand); font-size: 12px; }
.row-link::before { content: "↗ "; }
.row.sel .row-link { text-decoration: underline; text-underline-offset: 3px; }

/* neofetch block */
.fetch {
  display: flex;
  gap: 4ch;
  padding: 0 20px 18px;
  align-items: flex-start;
}
.fetch pre {
  color: var(--brand);
  font: inherit;
  line-height: 1.25;
  font-size: 12px;
}
.fetch-info .who { color: var(--brand); font-weight: 700; }
.fetch-info .rule { color: var(--line-strong); }
.fetch-info .k { color: var(--brand); display: inline-block; width: 8ch; }
.swatches { margin-top: 8px; display: flex; }
.swatches span { width: 3ch; height: 1.1em; }

.row.kv { grid-template-columns: 2.5ch 9ch 1fr; padding-top: 2px; padding-bottom: 2px; }
.row.kv .k { color: var(--brand); }

/* Welcome banner */
.welcome {
  margin: 0 20px 22px;
  padding: 10px 16px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  max-width: 68ch;
}
.welcome .star { color: var(--brand); }
.welcome b { color: var(--text); }
.welcome .dim { color: var(--muted); margin-top: 6px; }
.welcome .dim i { font-style: normal; color: var(--text-2); }

/* Chat turns */
.ask { padding: 0 20px 6px; color: var(--muted); }
.ask::before { content: "> "; }
.tool { padding: 0 20px 10px; color: var(--text); }
.tool b { color: var(--brand); font-weight: 400; }
.tool span { color: var(--muted); }

/* Bottom: spinner, output, input box, footer */
.spinner { padding: 6px 20px 4px; border-top: 1px solid var(--line); color: var(--brand); font-size: 13px; }
.spinner .dim { color: var(--muted); }
.msgline { padding: 0 20px 0 calc(20px + 3ch); text-indent: -3ch; min-height: 0; color: var(--text-2); font-size: 12px; white-space: pre-wrap; }
.msgline:not(:empty) { padding-top: 6px; padding-bottom: 6px; border-top: 1px solid var(--line); }
.msgline::before { content: "⎿  "; color: var(--muted); }
.msgline:empty::before { content: none; }
.msgline .err { color: #f7768e; }
.inputbox {
  display: flex;
  gap: 1ch;
  margin: 0 12px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
}
.inputbox.active { border-color: var(--brand); }
.caret { color: var(--muted); }
.placeholder { color: var(--muted); }
.footer {
  display: flex;
  gap: 1.5ch;
  padding: 4px 24px 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.mode { color: var(--text-2); }
.mode.cmd { color: var(--brand); }
.spacer { flex: 1; }
.cursor { display: inline-block; width: 1ch; background: var(--text); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Help popup */
.help {
  position: absolute;
  right: 20px;
  bottom: 56px;
  padding: 12px 16px;
  font-size: 12px;
  border: 1px solid var(--brand);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
}
.help-title { color: var(--brand); margin-bottom: 6px; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 2ch; }
.help dt { color: var(--text); }
.help dd { color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 13px; }
  .window { width: calc(100% - 16px); margin: 8px auto; height: calc(100% - 30px - 16px); }
  .keys, .hint, #clock { display: none; }
  .fetch pre { display: none; }
  .row-date { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* keep long text inside the window on narrow screens */
.row > div, .fetch-info { min-width: 0; }
.row-desc, .row-link, .row.kv a { overflow-wrap: anywhere; }
.inputbox, .footer { overflow: hidden; text-overflow: ellipsis; }
.welcome { overflow-wrap: anywhere; }
.bar { white-space: nowrap; }
@media (max-width: 640px) {
  .bar { padding: 0 4px; }
  .workspaces button { padding: 0 6px; }
  .theme-btn .name { display: none; }
}

/* single buffer: sections stacked */
.bar-name { color: var(--text-2); }
section + section { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
section { scroll-margin-top: 0; }

/* real input + permission prompt */
.inputbox { cursor: text; align-items: center; }
.inputbox input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--text);
  caret-color: var(--brand);
  background: none;
  border: 0;
  outline: none;
}
.inputbox input::placeholder { color: var(--muted); }
.perm {
  margin: 0 12px;
  padding: 8px 14px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
}
.perm-title { color: var(--brand); font-weight: 700; }
.perm-target { color: var(--text); padding: 2px 0 6px 2ch; }
.perm-opt { white-space: pre; cursor: pointer; color: var(--muted); }
.perm-opt.on { color: var(--brand); }
.perm-mode { color: var(--brand); }
.mode:empty, .perm-mode:empty { display: none; }

[hidden] { display: none !important; }

/* vim toggle in the top bar */
#vim-btn { display: inline-flex; align-items: center; gap: 0.6ch; }
.vim-dot { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }
#vim-btn.on { color: var(--brand); }
#vim-btn.on .vim-dot { background: var(--brand); border-color: var(--brand); }


/* contact links as a third column of the fastfetch block */
.fetch { flex-wrap: wrap; }
.fetch-links { margin-left: 2ch; min-width: 0; }
.fetch-links .who { color: var(--brand); font-weight: 700; }
.fetch-links .rule { color: var(--line-strong); }
.fetch-links .row.kv { padding: 1px 8px 1px 0; margin-left: -2.5ch; }
.fetch-links .row.kv.sel { border-left-color: transparent; }
@media (max-width: 760px) {
  .fetch-links { margin-left: 0; width: 100%; }
}

/* Claude Code-style start screen */
.banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  margin: 0 20px 22px;
  padding: 6px 0 12px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  max-width: 820px;
}
.banner legend { margin-left: 12px; padding: 0 6px; color: var(--brand); }
.banner .dim { color: var(--muted); }
.banner-left { text-align: center; padding: 8px 16px; display: flex; flex-direction: column; gap: 2px; justify-content: center; }
.banner-left .hello { color: var(--text); font-weight: 700; }
.banner-left .big-star { color: var(--brand); font-size: 44px; line-height: 1.2; margin: 4px 0; }
.banner-right { border-left: 1px solid var(--brand); padding: 8px 18px; color: var(--text-2); }
.banner-right .label { color: var(--brand); font-weight: 700; }
.banner-right i { font-style: normal; color: var(--text); }
.banner-right .rule { border-top: 1px solid var(--line-strong); margin: 8px 0; }
@media (max-width: 640px) {
  .banner { grid-template-columns: 1fr; }
  .banner-right { border-left: 0; border-top: 1px solid var(--brand); }
}

/* photo in place of the fastfetch ASCII logo (fastfetch can render images too) */
.fetch-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .fetch-photo { width: 96px; height: 96px; }
}
