# Terminal: NEXUS-7 Command Shell

## Machine Fiction

NEXUS-7 is a retro-futuristic command terminal from an alternate 1987 where computing never abandoned the command line. It runs on the "NEURAL/386" architecture—a hybrid analog-digital system that processes both data and "essence traces." The system booted in 1987 and has been running continuously, accumulating files, logs, and mysteries.

### Core Concept
- **Era**: Retro-futuristic (1980s vision of future computing)
- **Aesthetic**: Amber phosphor CRT, scanlines, subtle phosphor glow, mechanical keyboard sounds
- **Atmosphere**: The machine feels lived-in—there are user files, logs, remnants of previous operators
- **Mystery Layer**: Scattered anomalies hint at something deeper in the system

## Command Grammar

Commands follow `verb [target] [--flag]` structure:

| Command | Description |
|---------|-------------|
| `help [command]` | Display help for command or general overview |
| `ls [path]` | List directory contents |
| `cd [path]` | Change directory |
| `cat [file]` | Display file contents |
| `mkdir [name]` | Create directory |
| `rm [target]` | Remove file or directory |
| `clear` | Clear terminal screen |
| `scan [target]` | Deep scan of file/directory (shows "essence" metadata) |
| `logs [type]` | View system logs (access, error, anomalous) |
| `connect [node]` | Connect to remote nodes in the network |
| `decrypt [file]` | Decrypt encrypted files (requires key fragments) |
| `run [program]` | Execute program files |
| `trace [id]` | Trace anomaly signatures |
| `status` | Display system status and uptime |
| `who` | Display current and previous operators |
| `history` | Show command history |
| `exit` | Logout (returns to login prompt)

## Filesystem Structure

```
/
├── bin/           - System programs
├── etc/           - Configuration files
├── home/
│   ├── guest/     - Guest user directory
│   └── operator/  - Previous operator's files (locked)
├── log/           - System logs
├── net/           - Network nodes (virtual)
├── vault/         - Encrypted files
└── README.txt     - Welcome message
```

## Interaction Model

### Input
- Keyboard-first with full command parsing
- Tab completion for commands and paths
- Command history (up/down arrows)
- Cursor always visible, blinking

### Output
- Typewriter-style text rendering (optional)
- Color-coded output:
  - Amber: Normal output
  - Cyan: Success/Info
  - Red: Errors
  - Green: Files/commands
  - Magenta: Anomalies/mysteries
- ASCII art headers for major sections

### UI Elements
- Header bar: System name, uptime, current user
- Prompt: `[user@nexus7:path]$`
- Scanlines overlay (CSS)
- Subtle phosphor glow effect (text-shadow)
- Occasional screen flicker (rare, CSS animation)

## Visual Direction

### Colors
- Background: Near-black (#1a1a1a)
- Primary text: Amber/orange (#ffb000)
- Secondary: Dark amber (#cc8800)
- Success: Cyan (#00cccc)
- Error: Soft red (#ff4444)
- File highlights: Light amber (#ffcc66)

### Typography
- Monospace throughout
- Font: 'Courier New' or system monospace
- Line height: 1.4
- Letter spacing: slight for readability

### Effects
- CRT scanlines (CSS gradient overlay)
- Phosphor glow (text-shadow)
- Subtle noise texture (optional, CSS)
- Cursor blink (animation)
- Rare screen flicker (CSS keyframes)

## State Persistence

Use localStorage for:
- Command history
- Created files/directories
- Decrypted file contents
- Discovered anomalies
- User preferences

## Mystery Layer

Scattered throughout the system are anomalies:
- Files that appear/disappear
- Logs referencing "Subject Zero"
- Encrypted messages about "The Event"
- Network nodes that respond strangely
- Previous operator's files with warnings

These should intrigue but not obstruct functionality.

## Mobile Adaptation

- Touch-friendly command buttons for common actions
- Swipe gestures for history navigation
- Larger tap targets without breaking the fiction
- Virtual keyboard awareness (preserve viewport)

## Success Criteria

- [x] Single HTML file, no external dependencies
- [x] 15+ meaningful commands with real state changes
- [x] Believable filesystem with file operations
- [x] Command history and tab completion
- [x] Retro-futuristic visual theme
- [x] Mystery/anomaly layer for exploration
- [x] Mobile-friendly without destroying fiction
- [x] State persistence across sessions
