@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: #081018;
  --panel: #111d2a;
  --grid: rgba(153, 196, 110, 0.08);
  --border: #2b4359;
  --text: #d8e5f0;
  --muted: #97abc0;
  --link: #a8d279;
  --error: #ff9d9d;
  --ls-dir: #7ec9ff;
  --ls-src: #ffbf66;
  --ls-doc: #7ec97c;
  --ls-config: #f2cf7d;
  --ls-img: #df9eff;
  --ls-bin: #ff8a8a;
  --ls-file: #d8e5f0;
}

* {
  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:
    radial-gradient(circle at 86% 8%, rgba(35, 62, 80, 0.75), rgba(35, 62, 80, 0) 34%),
    repeating-linear-gradient(
      to bottom,
      var(--grid) 0,
      var(--grid) 1px,
      transparent 1px,
      transparent 25px
    ),
    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 {
  width: min(1060px, calc(100vw - 1.4rem));
  height: min(88vh, 900px);
  margin: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(17, 29, 42, 0.97), rgba(17, 29, 42, 0.92));
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.boot-header {
  min-height: 2.2rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
}

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

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

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

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

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

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

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

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

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

.line-project {
  margin: 0.45rem 0 0.7rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(43, 67, 89, 0.7);
  background: rgba(11, 21, 31, 0.45);
  border-radius: 4px;
}

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

.project-name {
  color: #cde6ff;
  font-weight: 600;
  text-decoration: none;
}

a.project-name:hover,
a.project-name:focus-visible {
  color: #f2ffb0;
  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 rgba(124, 157, 180, 0.42);
  border-radius: 999px;
  color: #b3cde0;
  font-size: 0.82em;
  line-height: 1.2;
}

.badge-source-uni {
  color: #9ad3ff;
}

.badge-source-solo {
  color: #d0e89f;
}

.badge-source-team {
  color: #cbb1ff;
}

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

.badge-wip {
  color: #ff9ba0;
}

.project-stack {
  color: #a8d279;
  margin-bottom: 0.12rem;
}

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

.line-ls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 0.05rem;
}

.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);
}

.prompt-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-top: 1px dashed var(--border);
}

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

.prompt-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  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 dashed 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(216, 229, 240, 0.01);
  caret-color: #cde6ff;
  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;
  border-top: 1px dashed var(--border);
  color: var(--muted);
}

.editor-cmd-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-top: 1px dashed 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 dashed var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(11, 21, 31, 0.55);
}

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

.editor-tree.is-focused {
  box-shadow: inset 0 0 0 1px rgba(129, 196, 255, 0.35);
}

.editor-tree-path {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px dashed var(--border);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-tree-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.35rem 0.5rem;
}

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

.tree-entry {
  display: grid;
  grid-template-columns: 1ch 2ch 1fr;
  gap: 0.45ch;
  align-items: baseline;
  padding: 0.11rem 0.2rem;
  border-radius: 2px;
  white-space: nowrap;
}

.tree-entry.is-selected {
  background: rgba(129, 196, 255, 0.2);
}

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

.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;
}

.editor-tree-hint {
  border-top: 1px dashed var(--border);
  padding: 0.4rem 0.6rem;
  color: var(--muted);
  font-size: 0.88em;
}

.completion-panel {
  max-height: 11rem;
  overflow: auto;
  padding: 0.3rem 1rem 0.7rem;
  background: linear-gradient(180deg, rgba(17, 29, 42, 0.88), rgba(17, 29, 42, 0.96));
}

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

.tok-comment {
  color: #5f7990;
}

.tok-string {
  color: #8ddf9e;
}

.tok-number {
  color: #f3c76e;
}

.tok-keyword {
  color: #ff9da0;
}

.tok-type {
  color: #89c1ff;
}

.tok-key {
  color: #c9dd8f;
}

.tok-tag {
  color: #ffb47a;
}

.tok-attr {
  color: #8bc5d6;
}

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

.tok-punct {
  color: #8fb0c7;
}

.tok-plain {
  color: #d8e5f0;
}

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

  .frame {
    width: calc(100vw - 0.3rem);
    height: 93vh;
    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;
  }

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

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