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

:root {
  --bg: #0a0e14;
  --terminal-bg: #0d1117;
  --header-bg: #161b22;
  --border: #30363d;
  --green: #39d353;
  --green-dim: #238636;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --orange: #f0883e;
  --yellow: #e3b341;
  --red: #f85149;
  --text: #c9d1d9;
  --text-dim: #6e7681;
  --cyan: #56d4dd;
}

body {
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

/* Scan line effect */
#scan-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(57, 211, 83, 0.08), transparent);
  animation: scanDown 8s linear infinite;
  pointer-events: none;
  z-index: 100;
}

@keyframes scanDown {
  0% { top: -3px; }
  100% { top: 100vh; }
}

/* Terminal window */
.terminal {
  width: 100%;
  max-width: 700px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(57, 211, 83, 0.05),
    0 16px 48px rgba(0, 0, 0, 0.4);
}

.terminal-header {
  background: var(--header-bg);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.terminal-title {
  margin-left: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.terminal-body {
  background: var(--terminal-bg);
  padding: 1.5rem;
  min-height: 350px;
  display: flex;
  flex-direction: column;
}

/* Output lines */
.output {
  flex: 1;
  margin-bottom: 1rem;
}

.line {
  margin-bottom: 0.35rem;
  line-height: 1.6;
  font-size: 0.9rem;
  opacity: 0;
  animation: lineIn 0.3s ease forwards;
}

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

.line .cmd-text { color: var(--green); }
.line .comment { color: var(--text-dim); }
.line .string { color: var(--orange); }
.line .keyword { color: var(--purple); }
.line .value { color: var(--cyan); }
.line .link { color: var(--blue); text-decoration: none; }
.line .link:hover { text-decoration: underline; }
.line .error { color: var(--red); }
.line .success { color: var(--green); }
.line .ascii { color: var(--green); opacity: 0.9; }
.line .separator { color: var(--border); }

/* Input line */
.input-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

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

.cursor {
  color: var(--green);
  animation: cursorBlink 1s step-end infinite;
}

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

/* Hint */
.hint {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

.hint .cmd {
  color: var(--green);
  background: rgba(57, 211, 83, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Project cards (rendered by JS) */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.3rem 0;
}

.project-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  padding: 0.2rem 0;
}

.project-row .proj-icon { font-size: 0.85rem; }
.project-row .proj-name { color: var(--blue); }
.project-row .proj-sep { color: var(--text-dim); }
.project-row .proj-desc { color: var(--text-dim); font-size: 0.8rem; }

.project-row a {
  color: var(--blue);
  text-decoration: none;
}

.project-row a:hover {
  text-decoration: underline;
}

/* Status bar */
.status-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin: 0.2rem 0;
}

.status-item {
  font-size: 0.85rem;
}

.status-item .label { color: var(--text-dim); }
.status-item .val { color: var(--cyan); }
.status-item .val.up { color: var(--green); }

/* Responsive */
@media (max-width: 600px) {
  body { padding: 1rem; }

  .terminal-body {
    padding: 1rem;
    min-height: 300px;
  }

  .line, .input-line { font-size: 0.78rem; }

  .prompt { font-size: 0.75rem; }
}
