:root {
  color-scheme: dark;
  --bg: #000000;
  --fg: #d8dee9;
  --bright: #f3f4f5;
  --muted: #9ca3af;
  --green: #7ee787;
  --blue: #79c0ff;
  --error: #ff7b72;
  --selection: rgba(125, 211, 252, 0.28);
  --font: "JetBrains Mono", "Fira Code", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: var(--fg);
  font-family: var(--font);
  font-size: clamp(13px, 1.55vw, 16px);
  line-height: 1.45;
  overflow: hidden;
}

::selection { background: var(--selection); color: var(--bright); }

.terminal {
  width: 100vw;
  height: 100dvh;
  padding: clamp(12px, 2.4vw, 24px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #000;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-color: #333 #000;
  scrollbar-width: thin;
}

.terminal::-webkit-scrollbar { width: 10px; }
.terminal::-webkit-scrollbar-track { background: #000; }
.terminal::-webkit-scrollbar-thumb { background: #2a2a2a; border: 2px solid #000; }

.terminal-output, .input-line { width: 100%; }
.line { min-height: 1.45em; }
.prompt { white-space: nowrap; }
.user { color: var(--green); font-weight: 600; }
.dir { color: var(--blue); font-weight: 600; }
.punct, .command-buffer { color: var(--fg); }
.error { color: var(--error); }
.dim { color: var(--muted); }

.input-line {
  position: relative;
  display: flex;
  align-items: baseline;
  min-height: 1.45em;
}

.command-buffer { min-width: 0; }
.cursor {
  display: inline-block;
  width: 0.62em;
  height: 1.12em;
  margin-left: 1px;
  transform: translateY(0.17em);
  background: var(--fg);
  color: transparent;
  animation: blink 1.05s steps(1, end) infinite;
}

.terminal:focus-within .cursor { background: var(--bright); }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.terminal-input {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  resize: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  body { font-size: clamp(12px, 3.45vw, 15px); }
  .terminal { padding: 12px 10px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
