*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-color: #0a0a0f;
  --bg-darker: #0d0d14;
  --primary-color: #1a2aaa;
  --secondary-color: #ff6b00;
  --text-main: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.2);
  --accent-green: #28c840;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-color);
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  color: var(--text-main);
  overflow-x: hidden;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@keyframes glitch-anim {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 2px); filter: hue-rotate(90deg); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -1px); filter: hue-rotate(-90deg); }
  80% { transform: translate(2px, 1px); }
  100% { transform: translate(0); filter: none; }
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.7; }
  94% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes scanline {
  0% { top: -100%; }
  100% { top: 100%; }
}

@keyframes borderGlow {
  0%, 100% { 
    border-color: rgba(26, 42, 170, 0.5); 
    box-shadow: 0 0 40px rgba(26, 42, 170, 0.25), 0 0 80px rgba(255, 107, 0, 0.1); 
  }
  50% { 
    border-color: rgba(255, 107, 0, 0.5); 
    box-shadow: 0 0 50px rgba(255, 107, 0, 0.3), 0 0 100px rgba(26, 42, 170, 0.15); 
  }
}

@keyframes statFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes rotateGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes textShadow {
  0% { text-shadow: 0 0 10px rgba(255, 107, 0, 0.5); }
  50% { text-shadow: 0 0 20px rgba(255, 107, 0, 0.8), 0 0 40px rgba(26, 42, 170, 0.5); }
  100% { text-shadow: 0 0 10px rgba(255, 107, 0, 0.5); }
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
  position: relative;
}

.hero-bg-gradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 80%, rgba(26, 42, 170, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 107, 0, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(26, 42, 170, 0.05) 0%, transparent 70%);
  animation: rotateGradient 15s ease infinite;
  background-size: 200% 200%;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(26, 42, 170, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 42, 170, 0.06) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.12) 2px, rgba(0,0,0,0.12) 4px);
  pointer-events: none;
}

.hero-moving-scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to bottom, transparent, rgba(26, 42, 170, 0.3), transparent);
  animation: scanline 8s linear infinite;
  pointer-events: none;
}

/* Terminal */
.terminal {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 860px;
  background: rgba(17, 17, 24, 0.95);
  border-radius: 14px;
  border: 1px solid rgba(26, 42, 170, 0.5);
  backdrop-filter: blur(10px);
  overflow: hidden;
  animation: borderGlow 4s ease-in-out infinite;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.terminal.visible {
  opacity: 1;
  transform: translateY(0);
}

.glitching {
  animation: glitch-anim 0.4s ease-in-out, flicker 8s ease-in-out infinite !important;
}

.terminal-header {
  background: #0d0d14;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(26, 42, 170, 0.25);
}

.dot { width: 13px; height: 13px; border-radius: 50%; }
.dot-red { background: #ff5f57; box-shadow: 0 0 8px rgba(255, 95, 87, 0.5); }
.dot-yellow { background: #febc2e; box-shadow: 0 0 8px rgba(254, 188, 46, 0.5); }
.dot-green { background: #28c840; box-shadow: 0 0 8px rgba(40, 200, 64, 0.5); }

.terminal-title {
  margin-left: 14px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.terminal-content {
  padding: 3rem 3.5rem 4rem;
}

.neofetch {
  color: var(--accent-green);
  font-size: 0.82rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  opacity: 0.65;
}

.main-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  animation: float 5s ease-in-out infinite;
}

.shimmer-text {
  background: linear-gradient(90deg, #1a2aaa, #ff6b00, #1a2aaa, #ff6b00);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite, textShadow 2s ease-in-out infinite;
}

.typewriter-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2.5rem;
  min-height: 2.5rem;
}

.typewriter-text {
  color: var(--secondary-color);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 500;
  text-shadow: 0 0 20px rgba(255, 107, 0, 0.5);
}

.cursor {
  display: inline-block;
  width: 3px;
  height: 1.3em;
  background: var(--secondary-color);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.8);
}

.cta-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.btn {
  padding: 0.85rem 2.2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #1a2aaa 0%, #2d4aee 50%, #1a2aaa 100%);
  background-size: 200% 100%;
  color: #fff;
  border: 2px solid var(--secondary-color);
  box-shadow: 0 0 25px rgba(26, 42, 170, 0.5);
  animation: shimmer 4s linear infinite;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 45px rgba(26, 42, 170, 0.8);
}

.btn-secondary {
  background: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
  box-shadow: 0 0 15px rgba(255, 107, 0, 0.15);
}

.btn-secondary:hover {
  background: var(--secondary-color);
  color: var(--bg-color);
  box-shadow: 0 0 35px rgba(255, 107, 0, 0.5);
  transform: translateY(-3px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  text-align: center;
  padding: 1.2rem 1rem;
  background: rgba(26, 42, 170, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(26, 42, 170, 0.15);
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 107, 0, 0.08);
  border-color: rgba(255, 107, 0, 0.3);
  transform: translateY(-4px);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6b00, #ff9a3c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.terminal-footer {
  padding: 0.8rem 1.5rem;
  border-top: 1px solid rgba(26, 42, 170, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.status-online { color: var(--accent-green); }

/* Projects Section */
.projects {
  padding: 2rem 2rem;
  background: var(--bg-color);
  position: relative;
}

.section-title {
  font-size: 3rem;
  color: #fff;
  margin-bottom: 4rem;
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-title span { color: var(--secondary-color); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  background: rgba(17, 17, 24, 0.6);
  border: 1px solid rgba(26, 42, 170, 0.2);
  padding: 1rem;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 107, 0, 0.5);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.project-card h3 { color: #fff; font-size: 1.5rem; margin-bottom: 1rem; }
.project-card p { color: var(--text-dim); line-height: 1.6; margin-bottom: 2rem; }

.tag-group { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.tag {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: rgba(26, 42, 170, 0.15);
  color: #1a2aaa;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid rgba(26, 42, 170, 0.2);
}

/* Contact Section */
.contact {
  padding: 5rem 2rem;
  background: linear-gradient(to bottom, var(--bg-color), var(--bg-darker));
  position: relative;
}

.contact-container {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-input, .form-textarea {
  background: rgba(17, 17, 24, 0.8);
  border: 1px solid rgba(26, 42, 170, 0.3);
  padding: 1.2rem;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  outline: none;
}

.form-textarea { resize: none; }

.btn-submit {
  padding: 1.2rem;
  background: var(--secondary-color);
  color: var(--bg-color);
  border: none;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-whatsapp {
  padding: 1.2rem 2.2rem;
  background: transparent;
  color: #25D366;
  border: 2px solid #25D366;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: fit-content;
  margin: 2rem auto 0;
  box-shadow: 0 0 15px rgba(37, 211, 102, 0.15);
}

.btn-whatsapp:hover {
  background: #25D366;
  color: #fff;
  box-shadow: 0 0 35px rgba(37, 211, 102, 0.5);
  transform: translateY(-3px);
}

.btn-whatsapp svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Footer */
.site-footer {
  padding: 4rem 2rem;
  background: var(--bg-darker);
  border-top: 1px solid rgba(26, 42, 170, 0.1);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Media Queries */
@media (max-width: 768px) {
  .hero {
    padding: 1rem;
  }

  .terminal-content {
    padding: 2rem 1.5rem 3rem;
  }

  .main-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-title {
    font-size: 2.2rem;
    margin-bottom: 2.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }
  
  .terminal-header {
    padding: 10px 14px;
  }
  
  .terminal-title {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 0.5rem;
  }

  .terminal-content {
    padding: 1.5rem 1rem 2.5rem;
  }

  .neofetch {
    font-size: 0.7rem;
    margin-bottom: 1.5rem;
  }

  .neofetch div {
    white-space: normal;
    word-break: break-all;
  }

  .cta-group {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 0.8rem 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .typewriter-text {
    font-size: 1rem;
  }
  
  .terminal-title {
    display: none;
  }
  
  .terminal-footer {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, var(--secondary-color), transparent);
  animation: pulse 2s ease-in-out infinite;
}

/* Particles */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
