@font-face {
  font-family: "wowvain-nerd";
  src: url("./fonts/IosevkaTermNerdFont-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "wowvain-nerd";
  src: url("./fonts/IosevkaTermNerdFont-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "wowvain-nerd";
  src: url("./fonts/IosevkaTermNerdFont-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "wowvain-nerd-mono";
  src: url("./fonts/IosevkaTermNerdFontMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "wowvain-nerd-mono";
  src: url("./fonts/IosevkaTermNerdFontMono-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --panel: #0a0a0a;
  --border: #444444;
  --border-active: #00aa00;
  --text: #aaaaaa;
  --muted: #808080;
  --green: #00aa00;
  --green-bright: #55ff55;
  --link: #00aaaa;
  --link-hover: #55ffff;
  --error: #ff5555;
  --status-bg: #00aa00;
  --status-fg: #000000;
  --status-active-bg: #005f00;
  --status-active-fg: #ffffff;
  --ls-dir: #5555ff;
  --ls-src: #00aaaa;
  --ls-doc: #aaaaaa;
  --ls-config: #aa5500;
  --ls-img: #aa00aa;
  --ls-bin: #55ff55;
  --ls-file: #aaaaaa;
  --ls-private: #aa0000;
  --selection: #2d2d2d;
  --scroll-track: #0a0a0a;
  --scroll-thumb: #585858;
  --scroll-thumb-hover: #808080;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.52 "wowvain-nerd-mono",
    "wowvain-nerd",
    "IosevkaTerm Nerd Font",
    "JetBrainsMono Nerd Font",
    "CaskaydiaCove Nerd Font",
    "Iosevka",
    "JetBrains Mono",
    "Fira Code",
    monospace;
}

.frame {
  position: relative;
  width: min(1220px, calc(100vw - 1.4rem));
  height: min(58svh, 900px);
  zoom: 1.5;
  margin: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}

.font-loader {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: var(--bg);
}

.font-loader-spinner {
  width: 0.9ch;
  height: 1.1em;
  background: var(--green);
  animation: term-blink 1s steps(1, end) infinite;
}

.font-loader-text {
  color: var(--muted);
  font-size: 0.9em;
}

@keyframes term-blink {
  0%,
  50% {
    opacity: 1;
  }

  50.01%,
  100% {
    opacity: 0;
  }
}

.frame,
.terminal-output,
.completion-panel,
.editor-tree-list,
.editor-highlight,
.editor-area {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.frame ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.frame ::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

.frame ::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
}

.frame ::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

.boot-header {
  min-height: 2.2rem;
  padding: 0.8rem 1rem;
  background: var(--status-bg);
  color: var(--status-fg);
}

.hint {
  color: var(--status-fg);
}

.cursor {
  display: inline-block;
  width: 0.8ch;
}

.terminal-output {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.05rem;
  text-align: center;
  scroll-behavior: auto;
}

.line {
  margin: 0.18rem 0;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}

.line-command {
  color: var(--muted);
}

.line-output {
  color: var(--text);
}

.line-social-output {
  display: inline-flex;
  margin: 0.18rem 0.65rem;
}

.line-output-link {
  color: var(--link);
  text-decoration: none;
}

.line-output-link:hover,
.line-output-link:focus-visible {
  color: var(--link-hover);
  text-decoration: underline;
}

.line-output-link.social-link-github {
  color: #cccccc;
}

.line-output-link.social-link-github:hover,
.line-output-link.social-link-github:focus-visible {
  color: #ffffff;
}

.line-output-link.social-link-gitlab {
  color: #aa5500;
}

.line-output-link.social-link-gitlab:hover,
.line-output-link.social-link-gitlab:focus-visible {
  color: #ffff55;
}

.line-output-link.social-link-twitter {
  color: #5555ff;
}

.line-output-link.social-link-twitter:hover,
.line-output-link.social-link-twitter:focus-visible {
  color: #8a8aff;
}

.line-output-link.social-link-instagram {
  color: #aa00aa;
}

.line-output-link.social-link-instagram:hover,
.line-output-link.social-link-instagram:focus-visible {
  color: #ff55ff;
}

.line-output-link.social-link-youtube {
  color: #aa0000;
}

.line-output-link.social-link-youtube:hover,
.line-output-link.social-link-youtube:focus-visible {
  color: #ff5555;
}

.line-output-link.social-link-twitch {
  color: #ff55ff;
}

.line-output-link.social-link-twitch:hover,
.line-output-link.social-link-twitch:focus-visible {
  color: #ff99ff;
}

.line-identity {
  --identity-label-color: #808080;
  --identity-value-color: #aaaaaa;
  color: var(--identity-value-color);
}

.identity-label {
  color: var(--identity-label-color);
}

.identity-value {
  color: var(--identity-value-color);
}

.line-identity.identity-tone-1 {
  --identity-label-color: #5555ff;
  --identity-value-color: #aaaaaa;
}

.line-identity.identity-tone-2 {
  --identity-label-color: #00aaaa;
  --identity-value-color: #aaaaaa;
}

.line-identity.identity-tone-3 {
  --identity-label-color: #aa00aa;
  --identity-value-color: #aaaaaa;
}

.line-identity.identity-tone-4 {
  --identity-label-color: #00aa00;
  --identity-value-color: #aaaaaa;
}

.line-identity.identity-tone-5 {
  --identity-label-color: #aa5500;
  --identity-value-color: #aaaaaa;
}

.line-identity.identity-tone-6 {
  --identity-label-color: #55ff55;
  --identity-value-color: #aaaaaa;
}

.line-identity.identity-tone-default {
  --identity-label-color: #808080;
  --identity-value-color: #aaaaaa;
}

.line-error {
  color: var(--error);
}

.line-section {
  margin-top: 0.9rem;
  color: var(--green);
}

.line-section-divider {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.85rem 0 0.6rem;
  color: var(--muted);
}

.line-section-divider::before,
.line-section-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.line-section-divider > span {
  font-size: 0.9em;
  letter-spacing: 0.02em;
}

.line-muted {
  color: var(--muted);
}

.line-project {
  margin: 0.45rem 0 0.7rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg);
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.22rem;
}

.project-name {
  color: var(--ls-dir);
  font-weight: 600;
  text-decoration: none;
}

a.project-name:hover,
a.project-name:focus-visible {
  color: #8a8aff;
  text-decoration: underline;
}

.project-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.project-badge {
  display: inline-block;
  padding: 0.06rem 0.35rem;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82em;
  line-height: 1.2;
}

.badge-team-solo {
  color: #55ff55;
}

.badge-team-team {
  color: #aa00aa;
}

.badge-context-personal {
  color: #00aaaa;
}

.badge-context-uni {
  color: #5555ff;
}

.badge-context-professional {
  color: #aa5500;
}

.badge-era-legacy {
  color: #808080;
}

.line-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.16rem 0;
}

.legend-label {
  color: var(--muted);
  min-width: 10ch;
}

.line-filter-row {
  margin: 0.2rem 0 0.45rem;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.filters-label {
  color: var(--muted);
  margin-right: 0.1rem;
}

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0 0.1rem;
}

.filter-sep {
  width: 1px;
  height: 1.05rem;
  margin: 0 0.1rem;
  background: var(--border);
}

.filter-chip {
  padding: 0.08rem 0.45rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.82em;
  line-height: 1.25;
  cursor: pointer;
}

.filter-chip.badge-team-solo {
  color: #55ff55;
}

.filter-chip.badge-team-team {
  color: #aa00aa;
}

.filter-chip.badge-context-personal {
  color: #00aaaa;
}

.filter-chip.badge-context-uni {
  color: #5555ff;
}

.filter-chip.badge-context-professional {
  color: #aa5500;
}

.filter-chip.badge-era-legacy {
  color: #808080;
}

.filter-chip:hover {
  border-color: var(--muted);
}

.filter-chip.is-active {
  border-color: var(--green);
  background: var(--panel);
}

.filter-chip:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 0;
}

.project-stack {
  color: var(--green);
  margin-bottom: 0.12rem;
}

.project-last-push {
  color: var(--muted);
  font-size: 0.9em;
  margin-bottom: 0.18rem;
}

.project-description {
  color: var(--text);
}

.line-ls-list {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.line-ls-row {
  display: flex;
  align-items: center;
  min-height: 1.2em;
}

.ls-entry {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55ch;
  color: var(--ls-file);
}

.ls-icon {
  width: 2ch;
  text-align: center;
  font-family:
    "wowvain-nerd-mono",
    "wowvain-nerd",
    "Symbols Nerd Font Mono",
    "JetBrainsMono Nerd Font",
    "IosevkaTerm Nerd Font",
    monospace;
}

.ls-name {
  white-space: nowrap;
}

.ls-dir {
  color: var(--ls-dir);
  font-weight: 600;
}

.ls-src {
  color: var(--ls-src);
}

.ls-doc {
  color: var(--ls-doc);
}

.ls-config {
  color: var(--ls-config);
}

.ls-img {
  color: var(--ls-img);
}

.ls-bin {
  color: var(--ls-bin);
}

.ls-file {
  color: var(--ls-file);
}

.ls-private-repo {
  color: var(--ls-private);
  font-weight: 600;
}

.prompt-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 11;
}

.prompt-focus {
  position: relative;
}

.prompt-focus.is-active {
  z-index: 10;
}

.prompt-focus.is-active .prompt-row {
  border-top-color: var(--green);
  background: var(--bg);
}

.prompt-spotlight-msg {
  position: absolute;
  right: 1rem;
  bottom: calc(100% + 0.45rem);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: min(40ch, calc(100% - 1.5rem));
  padding: 0.38rem 0.5rem 0.38rem 0.68rem;
  border: 1px solid var(--green);
  background: var(--bg);
  color: var(--text);
  font-size: 0.94em;
  opacity: 0;
  pointer-events: none;
}

.prompt-spotlight-close {
  width: 1.35rem;
  height: 1.35rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0;
}

.prompt-spotlight-close::before,
.prompt-spotlight-close::after {
  content: "";
  position: absolute;
  width: 0.62rem;
  height: 1px;
  background: var(--text);
}

.prompt-spotlight-close::before {
  transform: rotate(45deg);
}

.prompt-spotlight-close::after {
  transform: rotate(-45deg);
}

.prompt-spotlight-close:hover {
  border-color: var(--green);
}

.prompt-spotlight-close:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 0;
}

.prompt-focus.is-active .prompt-spotlight-msg {
  opacity: 1;
  pointer-events: auto;
}

.prompt-label {
  color: var(--green);
  white-space: nowrap;
}

.prompt-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  caret-color: var(--text);
  font: inherit;
}

.prompt-input:disabled {
  opacity: 0.65;
}

.editor-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.editor-header {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.editor-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.editor-main.tree-open {
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
}

.editor-main.browse-only {
  grid-template-columns: minmax(0, 1fr);
}

.editor-buffer {
  position: relative;
  min-width: 0;
  min-height: 0;
  --editor-gutter-width: 4ch;
  --editor-gutter-gap: 0.75rem;
}

.editor-gutter {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--editor-gutter-width) + var(--editor-gutter-gap));
  margin: 0;
  padding: 1rem var(--editor-gutter-gap) 1rem 0.3rem;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  text-align: right;
  color: var(--muted);
  opacity: 0.85;
  font: inherit;
  white-space: pre;
  line-height: 1.48;
}

.editor-highlight {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1rem 1rem 1rem calc(1rem + var(--editor-gutter-width) + var(--editor-gutter-gap));
  overflow: auto;
  pointer-events: none;
  white-space: pre;
  font: inherit;
  line-height: 1.48;
  tab-size: 4;
}

.hl-line {
  min-height: 1.48em;
}

.editor-area {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: rgba(170, 170, 170, 0.01);
  caret-color: var(--text);
  font: inherit;
  line-height: 1.48;
  padding: 1rem 1rem 1rem calc(1rem + var(--editor-gutter-width) + var(--editor-gutter-gap));
  tab-size: 4;
  overflow: auto;
}

.editor-status {
  display: grid;
  grid-template-columns: auto auto auto auto auto 1fr;
  gap: 0.9rem;
  align-items: center;
  padding: 0.45rem 1rem;
  background: var(--status-bg);
  color: var(--status-fg);
}

.editor-status span:nth-child(4) {
  background: var(--status-active-bg);
  color: var(--status-active-fg);
  padding: 0 0.6ch;
}

.editor-cmd-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-top: 1px solid var(--border);
}

.editor-cmd-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.editor-tree {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.editor-tree.is-full {
  border-right: 0;
}

.editor-tree.is-focused {
  box-shadow: inset 0 0 0 1px var(--border-active);
}

.editor-tree-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.editor-tree-path-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-tree-help-trigger {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 0.83em;
  padding: 0.1rem 0.36rem;
  cursor: pointer;
}

.editor-tree-help-trigger:hover {
  border-color: var(--green);
  color: var(--text);
}

.editor-tree-help-trigger:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 0;
}

.editor-tree-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0.35rem 0.5rem;
}

.editor-tree-list:focus {
  outline: none;
}

.tree-entry {
  display: grid;
  grid-template-columns: 1ch 1ch 2ch 1fr;
  gap: 0.35ch;
  align-items: baseline;
  padding: 0.11rem 0.2rem;
  white-space: nowrap;
  cursor: pointer;
}

.tree-fold {
  color: var(--muted);
}

.tree-entry.is-selected {
  background: var(--selection);
}

.tree-cursor {
  color: var(--green);
}

.tree-icon {
  text-align: center;
  font-family:
    "wowvain-nerd-mono",
    "wowvain-nerd",
    "Symbols Nerd Font Mono",
    "JetBrainsMono Nerd Font",
    "IosevkaTerm Nerd Font",
    monospace;
}

.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-private-repo .tree-name,
.tree-private-repo .tree-icon {
  color: var(--ls-private);
}

.completion-panel {
  max-height: 11rem;
  overflow: auto;
  padding: 0.3rem 1rem 0.7rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.center-popup-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.7);
}

.center-popup-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.center-popup-card {
  position: relative;
  width: min(560px, calc(100% - 1rem));
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0.8rem 0.9rem;
}

.center-popup-title {
  color: var(--text);
  font-size: 0.95em;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.center-popup-body {
  color: var(--muted);
  line-height: 1.45;
}

.center-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.4rem;
  height: 1.4rem;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
}

.center-popup-close::before,
.center-popup-close::after {
  content: "";
  position: absolute;
  width: 0.65rem;
  height: 1px;
  left: 50%;
  top: 50%;
  background: var(--text);
}

.center-popup-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.center-popup-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.center-popup-close:hover {
  border-color: var(--green);
}

.center-popup-close:focus-visible {
  outline: 1px solid var(--green);
  outline-offset: 0;
}

.keybind-groups {
  display: grid;
  gap: 0.6rem;
}

.keybind-group {
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
  color: var(--text);
}

.keybind-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.keybind-group-label {
  color: var(--green);
  margin-bottom: 0.25rem;
}

.completion-panel .line {
  margin: 0.12rem 0;
}

.tok-comment {
  color: #6c6c6c;
}

.tok-string {
  color: #00aa00;
}

.tok-number {
  color: #aa5500;
}

.tok-keyword {
  color: #aa00aa;
}

.tok-type {
  color: #00aaaa;
}

.tok-key {
  color: #5555ff;
}

.tok-tag {
  color: #ff5555;
}

.tok-attr {
  color: #aa5500;
}

.tok-heading {
  color: #55ff55;
  font-weight: 600;
}

.tok-punct {
  color: #808080;
}

.tok-plain {
  color: #aaaaaa;
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
    padding: 0.35rem;
  }

  .frame {
    width: calc(100vw - 0.3rem);
    height: 58svh;
    margin: 0;
  }

  .boot-header,
  .terminal-output,
  .prompt-row,
  .completion-panel {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .editor-header,
  .editor-status,
  .editor-cmd-row {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .editor-buffer {
    --editor-gutter-gap: 0.6rem;
  }

  .editor-highlight,
  .editor-area,
  .editor-gutter {
    padding-left: calc(0.75rem + var(--editor-gutter-width) + var(--editor-gutter-gap));
    padding-right: 0.75rem;
  }

  .editor-gutter {
    padding-left: 0.25rem;
    padding-right: var(--editor-gutter-gap);
  }

  .editor-main {
    display: block;
  }

  .prompt-spotlight-msg {
    right: 0.75rem;
    bottom: calc(100% + 0.35rem);
  }

  .editor-tree {
    max-height: 34vh;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .editor-status {
    grid-template-columns: auto auto auto;
    gap: 0.35rem 0.8rem;
  }
}
