:root {
  --bg: #0b0f10;
  --bg-elev: #0f1416;
  --fg: #b8ffb3;
  --fg-dim: #7aff70;
  --accent: #33ff66;
  --muted: #2a2f31;
  --danger: #ff5f56;
  --warn: #ffbd2e;
  --ok: #27c93f;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.terminal {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .terminal { height: 100dvh; }
}

/* Remove header and traffic lights */
.terminal-header, .traffic, .dot, .window-title { display: none; }

.terminal-screen {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 16px;
}

.active-line {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 8px;
}

/* Prompt text is injected via data-prefix */
.prompt::before {
  content: attr(data-prefix);
  color: var(--accent);
  white-space: pre;
}

.active-input {
  min-height: 1.25em;
  outline: none;
  border: none;
  background: transparent;
  color: var(--fg);
  caret-color: var(--accent);
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Old bottom form not used anymore */
.terminal-form { display: none; }

.cursor {
  width: 10px;
  height: 18px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

.line {
  white-space: pre-wrap;
}

.line .cmd {
  color: var(--fg-dim);
}

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

.line .link:hover {
  text-decoration: underline;
}

.kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--muted);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--fg);
  font-size: 12px;
}

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

.ascii {
  color: var(--accent);
  opacity: 0.85;
}

/* Modal popup */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}
.modal.open { display: block; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}
.modal-content {
  position: relative;
  max-width: 960px;
  width: calc(100% - 32px);
  margin: 48px auto;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--muted);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 96px);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--muted);
}
.modal-title { color: var(--fg-dim); }
.modal-close {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-body {
  margin: 0;
  padding: 16px;
  overflow: auto;
  white-space: normal;
  word-break: break-word;
}

/* Tree view */
.tree { font-family: inherit; color: var(--fg); }
.tree ul { list-style: none; padding-left: 20px; margin: 0; }
.tree li { position: relative; padding-left: 16px; }
.tree li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9em;
  width: 12px;
  height: 0;
  border-top: 1px solid var(--fg-dim);
}
.tree li::after {
  content: "";
  position: absolute;
  left: 0;
  top: -0.4em;
  width: 0;
  height: 1.4em;
  border-left: 1px solid var(--fg-dim);
}
.tree li:last-child::after { height: 0.9em; }
.tree .dir { color: var(--accent); }
.tree .file { color: var(--fg); }

@media (max-width: 720px) {
  .modal-content {
    margin: 24px auto;
    max-height: calc(100vh - 48px);
  }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .terminal-screen { max-height: none; min-height: 0; }
  .active-input { font-size: 16px; }
} 