File size: 20,085 Bytes
0ed2558
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9ebc7bb
 
 
0ed2558
 
 
 
 
 
 
 
 
 
 
 
 
29b4e79
 
 
 
0ed2558
29b4e79
 
 
 
0ed2558
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
import { useState, useEffect, useRef } from 'react'
import { motion, AnimatePresence } from 'framer-motion'
import { FiTerminal, FiX, FiMinus, FiMaximize2 } from 'react-icons/fi'
import resumePDF from '../assets/Resume.pdf'

const PROFILE = {
  name: 'Parthib Karak',
  title: 'Software & AI Engineer',
  location: 'West Bengal, India',
  college: 'IEM Kolkata (B.Tech CSE)',
  cgpa: '8.9',
  email: 'parthibkarak2004@gmail.com',
  github: 'https://github.com/babaiii07',
  linkedin: 'https://www.linkedin.com/in/parthib-karak',
  leetcode: 'https://leetcode.com/u/Parthib_007',
}

const COMMANDS = {
  help: {
    desc: 'Show all available commands',
    run: () => [
      { type: 'title', text: 'πŸ“‹  Available Commands' },
      { type: 'divider' },
      { type: 'cmd', text: 'whoami       β†’ Who is Parthib?' },
      { type: 'cmd', text: 'skills       β†’ Technical skill stack' },
      { type: 'cmd', text: 'projects     β†’ Featured AI projects' },
      { type: 'cmd', text: 'experience   β†’ Work experience' },
      { type: 'cmd', text: 'education    β†’ Academic background' },
      { type: 'cmd', text: 'contact      β†’ Get in touch' },
      { type: 'cmd', text: 'resume       β†’ Download resume' },
      { type: 'cmd', text: 'leetcode     β†’ DSA stats' },
      { type: 'cmd', text: 'hire         β†’ Why hire Parthib?' },
      { type: 'cmd', text: 'clear        β†’ Clear terminal' },
      { type: 'cmd', text: 'help         β†’ Show this menu' },
      { type: 'divider' },
      { type: 'info', text: 'πŸ’‘  Tip: Use ↑ ↓ arrow keys for command history' },
    ],
  },
  whoami: {
    desc: 'Who is Parthib?',
    run: () => [
      { type: 'title', text: 'πŸ‘€  Parthib Karak' },
      { type: 'divider' },
      { type: 'kv', key: 'Role    ', value: 'Software & AI Engineer' },
      { type: 'kv', key: 'Location', value: 'West Bengal, India' },
      { type: 'kv', key: 'College ', value: 'IEM Kolkata β€” B.Tech CSE' },
      { type: 'kv', key: 'CGPA    ', value: '8.9 / 10.0' },
      { type: 'kv', key: 'Status  ', value: '🟒 Open to Opportunities' },
      { type: 'divider' },
      { type: 'text', text: 'Building production-grade AI systems that don\'t break in the' },
      { type: 'text', text: 'real world. Specialising in RAG, multi-agent systems, and LLM' },
      { type: 'text', text: 'engineering with LangChain, LangGraph, and Groq.' },
    ],
  },
  skills: {
    desc: 'Technical skill stack',
    run: () => [
      { type: 'title', text: 'πŸ› οΈ  Technical Skills' },
      { type: 'divider' },
      { type: 'category', text: 'AI / ML / LLMs' },
      { type: 'tags', items: ['LangChain', 'LangGraph', 'Groq', 'RAG', 'AutoGen', 'HuggingFace', 'Transformers'] },
      { type: 'category', text: 'Backend' },
      { type: 'tags', items: ['FastAPI', 'Django', 'Go / Gin', 'REST APIs', 'WebSockets'] },
      { type: 'category', text: 'Databases & Vector Stores' },
      { type: 'tags', items: ['MongoDB', 'MySQL', 'FAISS', 'ChromaDB', 'Pinecone'] },
      { type: 'category', text: 'Languages' },
      { type: 'tags', items: ['Python', 'JavaScript', 'TypeScript', 'Go', 'C++'] },
      { type: 'category', text: 'Tools & DevOps' },
      { type: 'tags', items: ['Docker', 'Git', 'GitHub', 'Postman', 'VS Code'] },
    ],
  },
  projects: {
    desc: 'Featured AI projects',
    run: () => [
      { type: 'title', text: 'πŸš€  Featured Projects' },
      { type: 'divider' },
      { type: 'proj', num: '01', name: 'Healthcare Chatbot', tech: 'RAG Β· Pinecone Β· LangChain Β· Groq', url: 'https://parthib07-multiagent-healthcare-chatbot.hf.space' },
      { type: 'proj', num: '02', name: 'AI Virtual Dev POD', tech: 'Multi-Agent Β· LangGraph Β· ChromaDB', url: 'https://agnik28-ai-virtual-pod.hf.space/' },
      { type: 'proj', num: '03', name: 'Virtual Research Assistant', tech: 'AutoGen Β· Groq Β· MySQL', url: 'https://parthib07-virtual-research-paper-assistant.hf.space/' },
      { type: 'proj', num: '04', name: 'OwnGPT', tech: 'FastAPI Β· LangGraph Β· MongoDB Β· Google Auth', url: 'https://parthib07-owngpt-v2.hf.space' },
      { type: 'proj', num: '05', name: 'CodeFusion', tech: 'DeepSeek AI Β· FastAPI Β· React', url: 'https://codefusion-v2-parthib.onrender.com' },
      { type: 'proj', num: '06', name: 'AnySITE', tech: 'FastAPI Β· React Β· AI Models', url: 'https://anysite-vibecoding-parthib.onrender.com' },
      { type: 'divider' },
      { type: 'info', text: 'πŸ”—  Run "contact" to connect or visit GitHub for source code' },
    ],
  },
  experience: {
    desc: 'Work experience',
    run: () => [
      { type: 'title', text: 'πŸ’Ό  Work Experience' },
      { type: 'divider' },
      { type: 'kv', key: 'Company ', value: 'BAAR Technologies' },
      { type: 'kv', key: 'Role    ', value: 'Jr. Automation Engineer' },
      { type: 'kv', key: 'Type    ', value: 'Full-time' },
      { type: 'kv', key: 'Period  ', value: 'Feb 2026 – Mar 2026 Β· 2 mos' },
      { type: 'kv', key: 'Location', value: 'Kolkata, West Bengal Β· On-site' },
      { type: 'text', text: '' },
      { type: 'text', text: 'β†’  Built automation-driven backend systems using Python & Django' },
      { type: 'text', text: 'β†’  Managed high-performance databases with Microsoft SQL Server' },
      { type: 'text', text: 'β†’  Developed scalable APIs and optimised SQL queries & procedures' },
      { type: 'text', text: 'β†’  Collaborated cross-functionally to deliver reliable automation solutions' },
    ],
  },
  education: {
    desc: 'Academic background',
    run: () => [
      { type: 'title', text: 'πŸŽ“  Education' },
      { type: 'divider' },
      { type: 'kv', key: 'Degree  ', value: 'B.Tech β€” Computer Science & Engineering' },
      { type: 'kv', key: 'College ', value: 'Institute of Engineering & Management, Kolkata' },
      { type: 'kv', key: 'CGPA    ', value: '8.9 / 10.0' },
      { type: 'kv', key: 'Year    ', value: '2021 – 2025' },
      { type: 'divider' },
      { type: 'kv', key: 'Class XII', value: '93.6% β€” Kapsit High School (2021)' },
      { type: 'kv', key: 'Class X  ', value: '84.5% β€” Kamarpukur RKM School (2019)' },
    ],
  },
  contact: {
    desc: 'Get in touch',
    run: () => [
      { type: 'title', text: 'πŸ“¬  Contact Parthib' },
      { type: 'divider' },
      { type: 'link', label: 'Email   ', value: 'parthibkarak2004@gmail.com', href: 'mailto:parthibkarak2004@gmail.com' },
      { type: 'link', label: 'LinkedIn', value: 'linkedin.com/in/parthib-karak', href: 'https://www.linkedin.com/in/parthib-karak' },
      { type: 'link', label: 'GitHub  ', value: 'github.com/babaiii07', href: 'https://github.com/babaiii07' },
      { type: 'link', label: 'LeetCode', value: 'leetcode.com/u/Parthib_007', href: 'https://leetcode.com/u/Parthib_007' },
      { type: 'divider' },
      { type: 'info', text: 'πŸ’Œ  Available for freelance, internship & full-time roles' },
    ],
  },
  resume: {
    desc: 'Download resume',
    run: () => {
      setTimeout(() => { window.open(resumePDF, '_blank') }, 300)
      return [
        { type: 'title', text: 'πŸ“„  Resume' },
        { type: 'divider' },
        { type: 'success', text: 'βœ…  Opening resume in a new tab...' },
        { type: 'info', text: 'πŸ“₯  Download will start automatically' },
      ]
    },
  },
  leetcode: {
    desc: 'DSA stats',
    run: () => [
      { type: 'title', text: '⚑  LeetCode Stats' },
      { type: 'divider' },
      { type: 'kv', key: 'Profile ', value: 'leetcode.com/u/Parthib_007' },
      { type: 'kv', key: 'Solved  ', value: '500+ Problems' },
      { type: 'kv', key: 'Strength', value: 'Arrays Β· DP Β· Graphs Β· Trees Β· Strings' },
      { type: 'divider' },
      { type: 'text', text: 'β†’  Strong DSA foundation for system design & optimization' },
      { type: 'text', text: 'β†’  Active in competitive programming contests' },
    ],
  },
  hire: {
    desc: 'Why hire Parthib?',
    run: () => [
      { type: 'title', text: '🌟  Why Hire Parthib?' },
      { type: 'divider' },
      { type: 'text', text: '✦  Builds production-ready AI β€” not just demos' },
      { type: 'text', text: '✦  Specialised in RAG, Agents, LangChain & LangGraph' },
      { type: 'text', text: '✦  500+ LeetCode β€” strong algorithmic foundations' },
      { type: 'text', text: '✦  CGPA 8.9 β€” academic excellence under real workload' },
      { type: 'text', text: '✦  End-to-end: from LLM to Docker to production deploy' },
      { type: 'text', text: '✦  Fast learner, self-driven, ships things that work' },
      { type: 'divider' },
      { type: 'success', text: 'πŸš€  Ready to contribute from day one β€” run "contact" to connect!' },
    ],
  },
  clear: {
    desc: 'Clear terminal',
    run: () => null,
  },
}

function renderLine(line, i) {
  const base = { fontSize: '0.78rem', lineHeight: 1.7, fontFamily: 'var(--font-mono)' }

  switch (line.type) {
    case 'title':
      return <div key={i} style={{ ...base, color: '#a78bfa', fontWeight: 700, marginTop: 4 }}>{line.text}</div>
    case 'divider':
      return <div key={i} style={{ ...base, color: 'rgba(99,102,241,0.3)', margin: '2px 0' }}>{'─'.repeat(44)}</div>
    case 'kv':
      return (
        <div key={i} style={{ ...base, display: 'flex', gap: 8 }}>
          <span style={{ color: '#64748b', minWidth: 80 }}>{line.key}</span>
          <span style={{ color: '#e2e8f0' }}>{line.value}</span>
        </div>
      )
    case 'text':
      return <div key={i} style={{ ...base, color: '#94a3b8' }}>{line.text || '\u00A0'}</div>
    case 'info':
      return <div key={i} style={{ ...base, color: '#38bdf8' }}>{line.text}</div>
    case 'success':
      return <div key={i} style={{ ...base, color: '#4ade80', fontWeight: 600 }}>{line.text}</div>
    case 'cmd':
      return <div key={i} style={{ ...base, color: '#94a3b8' }}>{line.text}</div>
    case 'category':
      return <div key={i} style={{ ...base, color: '#06b6d4', fontWeight: 600, marginTop: 6 }}>{line.text}</div>
    case 'tags':
      return (
        <div key={i} style={{ display: 'flex', flexWrap: 'wrap', gap: 4, marginBottom: 4 }}>
          {line.items.map((t, j) => (
            <span key={j} style={{
              fontSize: '0.68rem', fontFamily: 'var(--font-mono)',
              background: 'rgba(99,102,241,0.12)', border: '1px solid rgba(99,102,241,0.2)',
              color: '#a78bfa', borderRadius: 4, padding: '1px 7px',
            }}>{t}</span>
          ))}
        </div>
      )
    case 'proj':
      return (
        <div key={i} style={{ ...base, display: 'flex', gap: 8, alignItems: 'baseline' }}>
          <span style={{ color: '#6366f1', minWidth: 24 }}>{line.num}</span>
          <span style={{ color: '#f0f4ff', fontWeight: 600, minWidth: 160 }}>{line.name}</span>
          <span style={{ color: '#64748b', fontSize: '0.68rem' }}>{line.tech}</span>
          {line.url && (
            <a href={line.url} target="_blank" rel="noopener noreferrer"
              style={{ color: '#38bdf8', fontSize: '0.68rem', textDecoration: 'none', marginLeft: 4 }}>β†— live</a>
          )}
        </div>
      )
    case 'link':
      return (
        <div key={i} style={{ ...base, display: 'flex', gap: 8 }}>
          <span style={{ color: '#64748b', minWidth: 80 }}>{line.label}</span>
          <a href={line.href} target="_blank" rel="noopener noreferrer"
            style={{ color: '#38bdf8', textDecoration: 'none' }}
            onMouseEnter={e => e.target.style.textDecoration = 'underline'}
            onMouseLeave={e => e.target.style.textDecoration = 'none'}>
            {line.value}
          </a>
        </div>
      )
    default:
      return null
  }
}

export default function Terminal() {
  const [open, setOpen] = useState(false)
  const [input, setInput] = useState('')
  const [history, setHistory] = useState([])
  const [cmdHistory, setCmdHistory] = useState([])
  const [histIdx, setHistIdx] = useState(-1)
  const inputRef = useRef(null)
  const bottomRef = useRef(null)

  // Welcome message on first open
  useEffect(() => {
    if (open && history.length === 0) {
      setHistory([{
        type: 'welcome',
        lines: [
          { type: 'title', text: '⚑  Parthib\'s Portfolio Terminal' },
          { type: 'divider' },
          { type: 'text', text: 'Welcome, recruiter! Type "help" to see all commands.' },
          { type: 'text', text: 'Explore my profile interactively below.' },
          { type: 'divider' },
          { type: 'info', text: 'β†’  Try: whoami Β· skills Β· projects Β· hire Β· resume' },
        ],
      }])
    }
  }, [open])

  useEffect(() => {
    if (open) {
      setTimeout(() => inputRef.current?.focus(), 80)
    }
  }, [open])

  useEffect(() => {
    bottomRef.current?.scrollIntoView({ behavior: 'smooth' })
  }, [history])

  const runCommand = (raw) => {
    const cmd = raw.trim().toLowerCase()
    if (!cmd) return

    setCmdHistory(prev => [cmd, ...prev])
    setHistIdx(-1)

    if (cmd === 'clear') {
      setHistory([])
      return
    }

    const def = COMMANDS[cmd]
    const outputLines = def ? def.run() : [
      { type: 'text', text: `bash: ${cmd}: command not found` },
      { type: 'info', text: 'Type "help" to see available commands.' },
    ]

    setHistory(prev => [
      ...prev,
      { type: 'entry', cmd, lines: outputLines || [] },
    ])
  }

  const handleKey = (e) => {
    if (e.key === 'Enter') {
      runCommand(input)
      setInput('')
    } else if (e.key === 'ArrowUp') {
      e.preventDefault()
      const next = Math.min(histIdx + 1, cmdHistory.length - 1)
      setHistIdx(next)
      setInput(cmdHistory[next] ?? '')
    } else if (e.key === 'ArrowDown') {
      e.preventDefault()
      const next = Math.max(histIdx - 1, -1)
      setHistIdx(next)
      setInput(next === -1 ? '' : cmdHistory[next] ?? '')
    }
  }

  return (
    <>
      {/* Floating Toggle Button */}
      <motion.button
        onClick={() => setOpen(v => !v)}
        style={{
          position: 'fixed', bottom: 28, right: 28, zIndex: 9998,
          width: 52, height: 52, borderRadius: '50%',
          background: 'linear-gradient(135deg, #6366f1, #06b6d4)',
          border: 'none', cursor: 'pointer',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          color: '#fff', fontSize: '1.25rem',
          boxShadow: '0 8px 32px rgba(99,102,241,0.55), 0 2px 8px rgba(0,0,0,0.4)',
        }}
        whileHover={{ scale: 1.1, boxShadow: '0 12px 40px rgba(99,102,241,0.7)' }}
        whileTap={{ scale: 0.95 }}
        title="Open Portfolio Terminal"
        aria-label="Open terminal"
      >
        <motion.span
          animate={{ rotate: open ? 90 : 0 }}
          transition={{ duration: 0.25 }}
          style={{ display: 'flex' }}
        >
          {open ? <FiX size={22} /> : <FiTerminal size={22} />}
        </motion.span>
      </motion.button>

      {/* Terminal Window */}
      <AnimatePresence>
        {open && (
          <motion.div
            initial={{ opacity: 0, y: 40, scale: 0.95 }}
            animate={{ opacity: 1, y: 0, scale: 1 }}
            exit={{ opacity: 0, y: 40, scale: 0.95 }}
            transition={{ duration: 0.3, ease: [0.22, 1, 0.36, 1] }}
            style={{
              position: 'fixed', bottom: 90, right: 28, zIndex: 9997,
              width: 'min(600px, calc(100vw - 32px))',
              height: 'min(480px, 60vh)',
              background: 'rgba(8,10,26,0.97)',
              backdropFilter: 'blur(24px)',
              borderRadius: 16,
              border: '1px solid rgba(99,102,241,0.3)',
              boxShadow: '0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(99,102,241,0.1)',
              display: 'flex', flexDirection: 'column',
              overflow: 'hidden',
            }}
            onClick={() => inputRef.current?.focus()}
          >
            {/* Title Bar */}
            <div style={{
              display: 'flex', alignItems: 'center', gap: 8,
              padding: '10px 16px',
              background: 'rgba(99,102,241,0.06)',
              borderBottom: '1px solid rgba(99,102,241,0.15)',
              flexShrink: 0,
            }}>
              <div style={{ display: 'flex', gap: 6 }}>
                {['#f43f5e', '#f59e0b', '#4ade80'].map((c, i) => (
                  <div key={i} style={{ width: 11, height: 11, borderRadius: '50%', background: c, opacity: 0.85, cursor: i === 0 ? 'pointer' : 'default' }}
                    onClick={i === 0 ? () => setOpen(false) : undefined} />
                ))}
              </div>
              <div style={{
                flex: 1, textAlign: 'center',
                fontSize: '0.72rem', fontFamily: 'var(--font-mono)',
                color: '#475569', letterSpacing: '0.05em',
              }}>
                <FiTerminal size={11} style={{ display: 'inline', marginRight: 5, verticalAlign: 'middle' }} />
                parthib@portfolio ~ zsh
              </div>
              <button onClick={() => setOpen(false)} style={{ background: 'none', border: 'none', cursor: 'pointer', color: '#475569', display: 'flex' }}>
                <FiX size={14} />
              </button>
            </div>

            {/* Output Area */}
            <div style={{
              flex: 1, overflowY: 'auto', padding: '12px 16px',
              scrollbarWidth: 'thin', scrollbarColor: 'rgba(99,102,241,0.3) transparent',
            }}>
              {history.map((entry, ei) => (
                <div key={ei} style={{ marginBottom: 10 }}>
                  {entry.type === 'entry' && (
                    <div style={{
                      display: 'flex', gap: 6, alignItems: 'baseline',
                      fontSize: '0.78rem', fontFamily: 'var(--font-mono)',
                      marginBottom: 4,
                    }}>
                      <span style={{ color: '#4ade80' }}>parthib</span>
                      <span style={{ color: '#475569' }}>@portfolio</span>
                      <span style={{ color: '#38bdf8' }}>~</span>
                      <span style={{ color: '#64748b' }}>$</span>
                      <span style={{ color: '#e2e8f0' }}>{entry.cmd}</span>
                    </div>
                  )}
                  {entry.lines?.map((line, li) => renderLine(line, li))}
                </div>
              ))}
              <div ref={bottomRef} />
            </div>

            {/* Input Row */}
            <div style={{
              display: 'flex', alignItems: 'center', gap: 8,
              padding: '10px 16px',
              borderTop: '1px solid rgba(99,102,241,0.12)',
              background: 'rgba(0,0,0,0.2)',
              flexShrink: 0,
            }}>
              <span style={{ fontSize: '0.78rem', fontFamily: 'var(--font-mono)', color: '#4ade80', flexShrink: 0 }}>parthib</span>
              <span style={{ fontSize: '0.78rem', fontFamily: 'var(--font-mono)', color: '#475569', flexShrink: 0 }}>@portfolio</span>
              <span style={{ fontSize: '0.78rem', fontFamily: 'var(--font-mono)', color: '#38bdf8', flexShrink: 0 }}>~</span>
              <span style={{ fontSize: '0.78rem', fontFamily: 'var(--font-mono)', color: '#64748b', flexShrink: 0 }}>$</span>
              <input
                ref={inputRef}
                value={input}
                onChange={e => setInput(e.target.value)}
                onKeyDown={handleKey}
                placeholder="type a command..."
                autoComplete="off"
                spellCheck={false}
                style={{
                  flex: 1, background: 'none', border: 'none', outline: 'none',
                  fontFamily: 'var(--font-mono)', fontSize: '0.78rem',
                  color: '#e2e8f0', caretColor: '#a78bfa',
                }}
              />
              <span style={{
                width: 8, height: 15, background: '#6366f1', borderRadius: 1,
                animation: 'blink-cursor 0.8s step-end infinite', flexShrink: 0,
              }} />
            </div>
          </motion.div>
        )}
      </AnimatePresence>
    </>
  )
}