
/* =====================================================
   GOLBAL VARIABLES
   ===================================================== */
:root {
  --bg: #0b0b0b;
  --panel: #171717;
  --text: #dcdcdc;
  --muted: #a0a0a0;
  --line: #2b2b2b;
  --accent: #00ff41;
}

/* =====================================================
   RESET Y BASE
   ===================================================== */
*, *::before, *::after { 
  box-sizing: border-box; 
}

html { 
  scroll-behavior: smooth; 
}

body {
  margin: 0;
  font-family: "Courier New", monospace;
  background: var(--bg);
  color: var(--muted);
  overflow-x: hidden;
  line-height: 1.6;
}

/* Main Container */
.wrap { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 16px 20px; 
}

/* =====================================================
   NAVIGATION
   ===================================================== */
nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11,11,11,.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.nav { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px; 
}

.logo { 
  color: var(--text); 
  text-decoration: none; 
  letter-spacing: 3px; 
  font-weight: 700; 
}

.menu { 
  display: flex; 
  gap: 20px; 
  list-style: none; 
  margin: 0; 
  padding: 0; 
}

.menu a { 
  color: var(--muted); 
  text-decoration: none; 
  text-transform: uppercase; 
  font-size: 12px; 
  letter-spacing: 2px; 
  transition: color 0.3s;
}

.menu a:hover, 
.menu a.is-active { 
  color: var(--accent); 
}

/* =====================================================
   HEADERS
   ===================================================== */
header {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 48px 20px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.page-header { 
  min-height: 40vh; 
}

h1 {
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: 4px;
  font-size: clamp(36px, 7vw, 64px);
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}

/* Cursor typewriter */
header h1::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 2px;
  height: 1.1em;
  transform: translateY(-50%);
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink { 
  50% { opacity: 0; } 
}

.subtitle { 
  color: var(--accent); 
  margin: 0 0 8px; 
  font-size: 18px;
}

.lead { 
  max-width: 680px; 
  margin: 0 auto 24px; 
  line-height: 1.6; 
}


/* =====================================================
   BUTTONS
   ===================================================== */
.btns { 
  display: flex; 
  gap: 12px; 
  justify-content: center; 
  flex-wrap: wrap; 
}

.btn {
  border: 1px solid var(--line);
  padding: 10px 18px;
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 2px;
  background: transparent;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s;
}

.btn:hover { 
  border-color: var(--accent); 
  color: #000; 
  background: var(--accent); 
}

.btn.download:hover {
  box-shadow: 0 0 8px var(--accent);
  transform: translateY(-2px);
}

/* =====================================================
   SECTIONS
   ===================================================== */
section {
  padding: 64px 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, var(--panel) 20%, var(--panel) 80%, transparent);
  position: relative;
  z-index: 2;
}

h2 {
  color: var(--text);
  margin: 0 0 16px;
  text-align: center;
  letter-spacing: 2px;
  font-size: 32px;
}

.grid { 
  max-width: 1100px; 
  margin: 0 auto; 
  display: grid; 
  gap: 20px; 
}

/* =====================================================
    ABOUT SECTION
   ===================================================== */
.about { 
  grid-template-columns: 1fr 1fr; 
  align-items: start; 
}

.skills { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 8px; 
  margin-top: 12px; 
}

.skill { 
  border-left: 2px solid var(--accent); 
  padding: 8px 10px; 
  background: rgba(0,255,65,.05); 
  color: var(--text); 
  transition: all 0.3s;
}

.skill:hover {
  background: rgba(0,255,65,.1);
  transform: translateX(3px);
}

/* =====================================================
   PROJECT CARD
   ===================================================== */
.cards { 
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
}

.card { 
  border: 1px solid var(--line); 
  padding: 18px; 
  background: #121212; 
  transition: all 0.3s;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,255,65,0.1);
}

.card h3 { 
  margin: 0 0 6px; 
  color: var(--text); 
}

.tech { 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap; 
  margin-top: 10px; 
}

.tag { 
  font-size: 10px; 
  border: 1px solid var(--line); 
  padding: 3px 6px; 
  color: var(--accent); 
  text-transform: uppercase; 
  letter-spacing: 1px; 
}

/* =====================================================
   CONTACT FORM
   ===================================================== */

.contact-form { 
  max-width: 680px; 
  margin: 0 auto; 
}

.contact-form .row { 
  display: grid; 
  gap: 6px; 
  margin-bottom: 14px; 
}

.contact-form label {
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-form input, 
.contact-form textarea {
  background: #0f0f0f;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s;
}

.contact-form input:focus, 
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,255,65,.12);
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

/* =====================================================
   FOOTER
   ===================================================== */
footer { 
  text-align: center; 
  padding: 48px 20px; 
  border-top: 1px solid var(--line);
  background: var(--bg); 
}

.social-links { 
  display: flex; 
  gap: 1rem; 
  justify-content: center; 
  margin-top: 0.5rem; 
}

.social-links a { 
  color: var(--muted); 
  transition: color 0.3s; 
}

.social-links a:hover { 
  color: var(--accent); 
}

.social-links svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* =====================================================    
   RESPONSIVE    
   ===================================================== */

@media (max-width: 800px) {
  /* Single column layouts */
  .about, .skills, .cards {
    grid-template-columns: 1fr;
  }
  
  /* Smaller header on mobile */
  header {
    min-height: 50vh;
  }
  
  /* More compact navigation menu */
  .menu {
    gap: 15px;
  }
}

@media (max-width: 480px) {
  /* Reduced padding */
  .wrap {
    padding: 12px 15px;
  }
  
  section {
    padding: 40px 15px;
  }
  
  .menu {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  /* Smaller title */
  h1 {
    font-size: 28px;
  }
}

/* ==================================================
    Scanline 
  ===================================================*/

.scanline {
  position: fixed;
  left: 0;
  top: -10%;
  width: 100%;
  height: 3px;
  background: rgba(255,0,0,.85);
  box-shadow: 0 0 20px rgba(255,0,0,.7),
              0 0 40px rgba(255,0,0,.4);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  animation: scan 60s ease-in-out infinite;
  animation-delay: 4s; 
}


.scanline::before {
  content: "";
  position: fixed;
  left: 0;
  width: 100%;
  height: 100vh;
  background: radial-gradient(ellipse, rgba(255,0,0,0.05) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  opacity: 0;
  animation: halo 60s ease-in-out infinite;
  animation-delay: 4s; 
}

@keyframes scan {
  0%           { top: -10%; opacity: 1; }
  5%, 50%      { top: 100%; opacity: 1; }
  55%, 100%    { top: -10%; opacity: 1; }
}

@keyframes halo {
  0%           { top: 50vh; opacity: 1; }
  5%, 50%      { top: -50vh; opacity: 1; }
  55%, 100%    { top: 50vh; opacity: 1; }
}

/* =====================================================
   Notifications 
   ===================================================== */
.matrix-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 30px 40px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  min-width: 300px;
  text-align: center;
}

.matrix-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.notification-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: scan-notification 2s linear infinite;
}

.matrix-notification.error .notification-line {
  background: linear-gradient(90deg, transparent, #ff0000, transparent);
}

@keyframes scan-notification {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.notification-type {
  color: var(--accent);
  font-weight: bold;
  margin-right: 10px;
  font-size: 14px;
}

.matrix-notification.error .notification-type {
  color: #ff0000;
}

.notification-msg {
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Efecto de interferencia en error */
.matrix-notification.error {
  animation: interference 0.3s;
}

@keyframes interference {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  25% { transform: translate(-48%, -50%) scale(1); }
  75% { transform: translate(-52%, -50%) scale(1); }
}