@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:wght@400;700&display=swap');

:root {
  --terminal-bg: #0a0a0a;
  --terminal-text: #a8ab78;
  --terminal-cursor: #a8ab78;
  --terminal-prompt: #4e9a06;
  --terminal-error: #ff5555;
  --terminal-accent: #dce3b5;
  --crt-scanline: rgba(255, 255, 255, 0.05);
  --crt-flicker: rgba(18, 16, 16, 0.15);
  --text-left-margin: 10%; /* Cambia de 15% a 10% o el valor que prefieras */
  --mobile-left-margin: 3%; /* Cambia de 5% a 3% o proporcional */
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Ubuntu Mono', monospace;
  color: var(--terminal-text);
  background-color: var(--terminal-bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

body {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.terminal-container {
  display: flex;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  padding-left: 30px;
}

.console-icon {
  color: var(--terminal-prompt);
  margin-right: 0.5rem;
  font-weight: bold;
  font-size: 1.2em;
  flex-shrink: 0;
  text-shadow: 0 0 5px rgba(78, 154, 6, 0.6);
}

#typewriter {
  position: relative;
  display: inline-block;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.5em;
  text-shadow: 0 0 8px rgba(220, 227, 181, 0.4);
  padding-right: 0.5em;
  text-align: left;
  margin: 0;
}

#typewriter::after {
  content: "|";
  position: absolute;
  right: 0;
  animation: blink-caret 1.2s step-end infinite;
  color: var(--terminal-cursor);
  opacity: 0;
  transition: opacity 0.1s ease;
  font-weight: bold;
}

@media (max-width: 768px) {
  #typewriter::after {
    position: relative;
    left: 2px;
    display: inline-block;
  }
  
  #typewriter.cursor-visible::after {
    position: relative;
  }
}

#typewriter.cursor-visible::after {
  opacity: 1;
}

.typo-error {
  position: relative;
  display: inline-block;
}

.typo-error::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--terminal-error);
  animation: error-underline 0.3s ease-out;
}

/* Animations */
@keyframes blink-caret {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

@keyframes error-underline {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes human-typing {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

.crt-effect {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(
      to bottom,
      var(--crt-flicker) 50%, 
      rgba(0, 0, 0, 0.15) 50%
    ),
    linear-gradient(
      to right,
      rgba(255, 0, 0, 0.03),
      rgba(0, 255, 0, 0.02),
      rgba(0, 0, 255, 0.03)
    );
  background-size: 100% 4px, 5px 100%;
  pointer-events: none;
  z-index: 20;
  mix-blend-mode: overlay;
}

.crt-scanline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 97%,
    var(--crt-scanline) 98%
  );
  background-size: 100% 8px;
  animation: scanline 8s linear infinite;
  pointer-events: none;
  z-index: 21;
}

@keyframes scanline {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 100%;
  }
}

#background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.6;
}

.human-type {
  animation: human-typing 0.1s ease;
}

@media (max-width: 768px) {
  .terminal-container {
    padding-left: 15px;
    width: 95%;
  }
  
  #typewriter {
    font-size: 1.1rem;
  }
  
  .console-icon {
    font-size: 1.1rem;
  }
}

.star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  animation: twinkle var(--duration) infinite ease-in-out;
  opacity: var(--opacity, 0.8);
  width: 2px;
  height: 2px;
  box-shadow: 0 0 5px 1px rgba(255, 255, 255, 0.7);
}

@keyframes twinkle {
  0%, 100% { opacity: var(--opacity); }
  50% { opacity: calc(var(--opacity) * 1.5); }
}

.particle {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: float var(--duration) infinite linear;
}

@keyframes float {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-20px) translateX(5px); }
  100% { transform: translateY(0) translateX(0); }
}