:root {
  --bg-primary: #0a0e27;
  --bg-terminal: #0f1419;
  --bg-header: #1a1f2e;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --color-cyan: #22d3ee;
  --color-orange: #fb923c;
  --color-green: #4ade80;
  --color-red: #ef4444;
  --shadow-glow: 0 0 20px rgba(34, 211, 238, 0.3);
  --shadow-glow-orange: 0 0 20px rgba(251, 146, 60, 0.3);
}

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

body {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(34, 211, 238, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(251, 146, 60, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.terminal-container {
  position: relative;
  z-index: 1;
  width: 95vw;
  max-width: 1200px;
  height: 90vh;
  animation: fadeIn 0.5s ease-out;
}

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

.terminal-window {
  background: var(--bg-terminal);
  border-radius: 12px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    var(--shadow-glow);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-header {
  background: var(--bg-header);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.terminal-buttons span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.btn-close {
  background: var(--color-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.btn-minimize {
  background: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

.btn-maximize {
  background: var(--color-green);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

.terminal-title {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.terminal-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  font-size: 16px;
  line-height: 1.6;
  position: relative;
  display: flex;
  flex-direction: column;
}

.terminal-body::-webkit-scrollbar {
  width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.3);
  border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.5);
}

.boot-sequence {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: auto;
}

.boot-line {
  font-size: 15px;
  color: var(--text-secondary);
  animation: bootFadeIn 0.3s ease-out;
}

@keyframes bootFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.terminal-content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.welcome-message {
  margin-bottom: 48px;
}

.ascii-art {
  color: var(--color-cyan);
  font-size: 11px;
  line-height: 1.2;
  margin-bottom: 24px;
  text-shadow: var(--shadow-glow);
}

.glitch-text {
  font-size: 56px;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
  animation: glitchPulse 3s infinite;
  letter-spacing: 2px;
}

@keyframes glitchPulse {
  0%, 90%, 100% {
    text-shadow:
      2px 2px 0 var(--color-cyan),
      -2px -2px 0 var(--color-orange);
  }
  95% {
    text-shadow:
      -2px -2px 0 var(--color-cyan),
      2px 2px 0 var(--color-orange);
  }
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.glitch-text::before {
  color: var(--color-cyan);
  animation: glitchBefore 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-text::after {
  color: var(--color-orange);
  animation: glitchAfter 2.5s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitchBefore {
  0%, 95%, 100% {
    transform: translateX(0);
  }
  96% {
    transform: translateX(-5px);
  }
  98% {
    transform: translateX(5px);
  }
}

@keyframes glitchAfter {
  0%, 95%, 100% {
    transform: translateX(0);
  }
  96% {
    transform: translateX(5px);
  }
  98% {
    transform: translateX(-5px);
  }
}

.subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.terminal-prompt-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.text-cyan {
  color: var(--color-cyan);
  text-shadow: var(--shadow-glow);
}

.text-orange {
  color: var(--color-orange);
  text-shadow: var(--shadow-glow-orange);
}

.text-green {
  color: var(--color-green);
}

.text-gray {
  color: var(--text-secondary);
}

.glow-text {
  animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 10px currentColor;
  }
  50% {
    text-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
  }
}

.history-item {
  margin-bottom: 32px;
}

.command-line {
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.prompt {
  color: var(--color-cyan);
  font-weight: 600;
  flex-shrink: 0;
}

.command-text {
  color: var(--text-primary);
}

.output {
  padding-left: 20px;
  border-left: 2px solid rgba(34, 211, 238, 0.2);
  margin-left: 8px;
}

.help-output,
.output-section {
  line-height: 2;
}

.output-section h3 {
  margin-bottom: 16px;
}

.command-item,
.experience-item,
.project-item,
.skill-category {
  margin-bottom: 16px;
}

.command-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
}

.experience-item,
.project-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.experience-item:last-child,
.project-item:last-child {
  border-bottom: none;
}

.skills-grid {
  display: grid;
  gap: 20px;
}

.skill-category {
  padding: 16px;
  background: rgba(34, 211, 238, 0.05);
  border-left: 3px solid var(--color-cyan);
  border-radius: 4px;
}

.error-output {
  color: var(--color-red);
}

.secret-output {
  text-align: center;
  padding: 32px;
  background: rgba(34, 211, 238, 0.05);
  border-radius: 8px;
  border: 2px solid var(--color-cyan);
  box-shadow: var(--shadow-glow);
}

.matrix-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
}

#matrix-canvas {
  width: 100%;
  height: 100%;
}

.input-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 32px;
  position: relative;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.terminal-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  caret-color: transparent;
  z-index: 2;
}

.cursor {
  position: absolute;
  left: 0;
  color: var(--color-cyan);
  animation: blink 1s step-end infinite;
  font-size: 18px;
  pointer-events: none;
  z-index: 1;
  visibility: hidden;
  transition: left 0.1s ease-out;
}

.terminal-input:focus + .cursor {
  visibility: visible;
}

/* Dynamic cursor positioning based on input length */
.input-wrapper {
  --cursor-offset: 0ch;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .terminal-container {
    width: 100vw;
    height: 100vh;
  }

  .terminal-window {
    border-radius: 0;
  }

  .terminal-body {
    padding: 24px 16px;
    font-size: 14px;
  }

  .glitch-text {
    font-size: 36px;
    letter-spacing: 1px;
  }

  .ascii-art {
    font-size: 8px;
  }

  .subtitle {
    font-size: 16px;
  }

  .terminal-prompt-text {
    font-size: 14px;
  }

  .command-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .output {
    padding-left: 12px;
    margin-left: 0;
  }

  .input-line {
    gap: 8px;
  }

  .terminal-input {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}