@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;700&display=swap');

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

:root {
  --white: #ffffff;
  --gray: #888888;
  --dark: #444444;
  --bg: #000000;
  --scanline: rgba(255, 255, 255, 0.03);
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  color: var(--white);
  overflow: hidden;
}

/* CRT scanlines */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scanline) 2px,
    var(--scanline) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 60%,
    rgba(0, 0, 0, 0.5) 100%
  );
  pointer-events: none;
  z-index: 999;
}

.terminal {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
  animation: flicker 0.15s ease-out;
}

.terminal-header {
  border-bottom: 1px solid var(--dark);
  padding-bottom: 10px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terminal-title {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 2px;
}

.star-link {
  font-size: 12px;
  color: var(--dark);
  text-decoration: none;
  transition: color 0.2s;
}

.star-link:hover {
  color: var(--gray);
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.terminal-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--dark);
}

.output {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--dark) var(--bg);
}

.output::-webkit-scrollbar {
  width: 6px;
}

.output::-webkit-scrollbar-track {
  background: var(--bg);
}

.output::-webkit-scrollbar-thumb {
  background: var(--dark);
}

.line {
  margin-bottom: 8px;
  line-height: 1.6;
  animation: fadeIn 0.1s ease-out;
}

.ascii-art {
  white-space: pre;
  font-size: 11px;
  line-height: 1.2;
  margin: 20px 0;
}

.man-preview {
  white-space: pre;
  line-height: 1.4;
  margin: 10px 0;
}

.bold {
  font-weight: 700;
}

.dim {
  color: var(--gray);
}

.dark {
  color: var(--dark);
}

.error {
  color: var(--white);
  font-weight: 700;
}

.input-line {
  display: flex;
  align-items: center;
  margin-top: 10px;
  padding: 15px 0;
  border-top: 1px solid #222;
}

.input-prompt {
  margin-right: 8px;
  white-space: nowrap;
}

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--white);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  caret-color: var(--white);
}

#command-input::placeholder {
  color: var(--dark);
}

.man-section {
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 5px;
}

.man-content {
  padding-left: 20px;
  color: var(--gray);
  white-space: pre-wrap;
}

.link {
  color: var(--white);
  text-decoration: underline;
  cursor: pointer;
}

.link:hover {
  color: var(--gray);
}

.loading::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
  100% { content: ''; }
}

@keyframes flicker {
  0% { opacity: 0.1; }
  20% { opacity: 0.5; }
  40% { opacity: 0.3; }
  60% { opacity: 0.8; }
  80% { opacity: 0.6; }
  100% { opacity: 1; }
}

@media (max-width: 600px) {
  .ascii-art {
    font-size: 7px;
  }
  .terminal {
    padding: 10px;
  }
}
