* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --border-color: #30363d;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --accent-purple: #7c3aed;
  --accent-blue: #58a6ff;
  --accent-green: #7ee787;
  --accent-cyan: #79c0ff;
  --accent-yellow: #a5d6ff;
  --accent-red: #ff7b72;
  --transition: all 0.3s ease;
}

body {
  font-family: "Fira Code", monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: var(--transition);
}

.terminal-window {
  background: var(--bg-secondary);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 800px;
  width: 100%;
  border: 1px solid var(--border-color);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  animation: slideIn 0.6s ease;
}

.terminal-window:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.terminal-header {
  background: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
  margin-right: 16px;
}

.btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: scale(1.2);
}

.btn:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.btn.close {
  background: #ff5f56;
}

.btn.minimize {
  background: #ffbd2e;
}

.btn.maximize {
  background: #27ca3f;
}

.terminal-title {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  flex-grow: 1;
}

.terminal-body {
  padding: 24px;
  line-height: 1.6;
  font-size: 14px;
  overflow-y: auto;
  flex-grow: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) var(--bg-secondary);
}

.terminal-body::-webkit-scrollbar {
  width: 8px;
}

.terminal-body::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.code-line {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.prompt {
  color: var(--accent-purple);
  margin-right: 8px;
  font-weight: 600;
}

.command {
  color: var(--accent-blue);
  font-weight: 500;
}

.output {
  margin-left: 24px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.keyword {
  color: var(--accent-red);
  font-weight: 500;
}

.variable {
  color: var(--accent-cyan);
}

.property {
  color: var(--accent-green);
}

.string {
  color: var(--accent-yellow);
}

.number {
  color: var(--accent-cyan);
}

.comment {
  color: var(--text-secondary);
  font-style: italic;
}

.project-link,
.social-link {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-blue);
  transition: all 0.2s ease;
  position: relative;
}

.project-link:hover,
.social-link:hover {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  text-decoration: none;
}

.project-link:focus,
.social-link:focus {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

.cursor {
  margin-top: 16px;
}

.cursor-blink {
  color: var(--text-primary);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

::selection {
  background: var(--accent-blue);
  color: var(--bg-primary);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus visible for better keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .terminal-window {
    max-height: 90vh;
  }

  .terminal-body {
    padding: 16px;
    font-size: 13px;
    -webkit-overflow-scrolling: touch;
  }

  .terminal-header {
    padding: 10px 12px;
  }

  .terminal-title {
    font-size: 12px;
  }
  
  .btn {
    width: 16px;
    height: 16px;
  }
  
  .project-link,
  .social-link {
    display: inline-block;
    padding: 4px 0;
    margin: 2px 0;
  }
}

@media (max-width: 480px) {
  .terminal-window {
    max-height: 95vh;
    border-radius: 0;
    margin: 0;
  }
  
  body {
    padding: 0;
  }

  .terminal-body {
    padding: 12px;
    font-size: 12px;
  }

  .output {
    margin-left: 16px;
  }
  
  .terminal-header {
    flex-wrap: wrap;
  }
  
  .terminal-title {
    order: 2;
    width: 100%;
    margin-top: 8px;
    text-align: center;
  }
  
  .terminal-buttons {
    display: none;
  }
}

/* Touch-friendly hover states */
@media (hover: none) and (pointer: coarse) {
  .project-link:active,
  .social-link:active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
  }
  
  .btn:active {
    transform: scale(0.95);
  }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .terminal-window {
    max-height: 95vh;
  }
  
  .terminal-body {
    padding: 12px;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .terminal-window {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .terminal-buttons {
    display: none;
  }
}