:root {
  --green-main: #00ff88;
  --green-alt: #00ffdd;
  --bg-black: #050505;
}

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

body {
  background: var(--bg-black);
  color: white;
  font-family: system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
}

h1, h2, h3, .pn-phrase {
  transition: all 0.1s ease;
}

#noise-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  background-color: transparent;
  transition: opacity 0.5s steps(2);
}

.noise-active {
  opacity: 0.12 !important;
}

/* NAV */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}

.nav {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 255, 157, 0.2);
  z-index: 10000;
  box-sizing: border-box;
}

.nav > span {
  font-family: 'JetBrains Mono', monospace;
  font-weight: bold;
  font-size: 1.4rem;
  color: #00ff9d;
  text-shadow: 0 0 10px #00ff9d;
  letter-spacing: -1px;
}

.nav > div {
  display: flex;
  gap: 25px; 
}

.nav a {
  text-decoration: none;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 2px;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.nav a:hover {
  opacity: 1;
  color: #00ff9d;
  text-shadow: 0 0 8px #00ff9d;
}

/* HERO */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 8vw;
  position: relative;
  z-index: 1;
}

/* TEXT */
.glitch-text {
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  position: relative;
  text-transform: uppercase;
  line-height: 0.95;
}

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

/* GLITCH TEXT */
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
}

.glitch-text::before {
  color: var(--green-main);
  animation: glitchA 3s infinite;
}

.glitch-text::after {
  color: var(--green-alt);
  animation: glitchB 2.5s infinite;
}

.glitch-active-text {
  opacity: 1 !important;
  text-shadow: 2px 0 10px #00ff9d, -2px 0 5px rgba(255, 255, 255, 0.5);
  transform: skewX(-8deg) translateX(2px);
}

/* SUBTITLE */
.subtitle {
  margin-top: 24px;
  letter-spacing: 4px;
  font-size: 14px;
  color: #666;
}

.pn-phrase {
  font-family: 'JetBrains Mono', monospace; 
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #00ff9d;
  opacity: 0.4; 
  margin-top: 15px;
  transition: all 0.1s ease;
  max-width: 400px;
}

.brand-container {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  width: 180px;
  opacity: 0.2;
  transition: all 0.2s ease;
}

/* Efecto de pulso constante en el núcleo (muy PN) */
.core-pulse {
  animation: pulseCore 2s infinite;
}

/* SECTIONS */
.section {
  padding: 140px 10vw;
}

.section-title {
  font-size: 3rem;
  margin-bottom: 32px;
  letter-spacing: 6px;
}

.section-text {
  max-width: 600px;
  color: #777;
  line-height: 1.7;
}

.experience-section {
  padding: 100px 20px;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.timeline {
  width: 100%;
  border-left: 1px solid rgba(0, 255, 157, 0.2);
  margin-left: 40px;
  padding-left: 40px;
  position: relative;
}

.exp-item {
  margin-bottom: 40px;
  position: relative;
}

.exp-dot {
  position: absolute;
  left: -36px;
  top: 5px;
  width: 10px;
  height: 10px;
  background: #00ff9d;
  border-radius: 50%;
  box-shadow: 0 0 10px #00ff9d;
}

.exp-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  color: #fff;
  margin: 0;
}

.exp-company {
  color: #00ff9d;
  font-size: 1rem;
  opacity: 0.8;
}

.exp-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #888;
  margin: 5px 0 15px 0;
}

.exp-desc {
  font-size: 0.95rem;
  color: #ccc;
  line-height: 1.6;
}

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

.exp-tech span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: rgba(0, 255, 157, 0.1);
  color: #00ff9d;
  padding: 4px 8px;
  border: 1px solid rgba(0, 255, 157, 0.3);
  text-transform: uppercase;
}

/* PROJECTS */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.project {
  border: 1px solid rgba(255,255,255,0.1);
  padding: 24px;
  transition: all 0.3s;
}

.project:hover {
  border-color: var(--green);
  transform: translateY(-6px);
}

.projects a {
  text-decoration: none !important;
  color: inherit;                 
  outline: none;
}

.project a:visited,
.project a:hover,
.project a:active {
  text-decoration: none !important;
  color: inherit !important; 
}

.project h3 {
  margin-bottom: 12px;
}

.project span {
  font-size: 11px;
  color: var(--green);
  letter-spacing: 3px;
}

.about-section {
    padding: 100px 20px;
    max-width: 1000px;
    margin: 0 auto;
    font-family: 'JetBrains Mono', monospace;
}

.about-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Bloque principal de texto */
.profile-text p {
    color: #ccc;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 0.95rem;
    text-align: left;
    max-width: 70ch;
}

/* Grid para Educación y Skills */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .info-grid { grid-template-columns: 1fr; }
}

.data-block {
    background: rgba(0, 255, 157, 0.02);
    border: 1px solid rgba(0, 255, 157, 0.1);
    padding: 25px;
    position: relative;
}

.data-label {
    position: absolute;
    top: -10px;
    left: 20px;
    background: #000;
    padding: 0 10px;
    color: #00ff9d;
    font-size: 0.7rem;
    letter-spacing: 2px;
}

/* Estilos de Educación e Ítems */
.edu-item, .skill-group {
    margin-bottom: 20px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.edu-item:last-child, .skill-group:last-child { border: none; }

.date {
    color: #00ff9d;
    font-size: 0.8rem;
    display: block;
}

.edu-item strong, .skill-group strong {
    color: #fff;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.edu-item p, .skill-group p {
    font-size: 0.8rem;
    color: #aaa;
    margin: 5px 0;
}

.specialty {
    color: #00ff9d !important;
    font-style: italic;
}

/* CONTACT */
.contact-section {
  padding: 100px 20px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.contact-card {
  background: rgba(0, 255, 157, 0.03);
  border: 1px solid rgba(0, 255, 157, 0.2);
  padding: 40px 30px;
  text-decoration: none;
  color: #fff;
  position: relative;
  overflow: hidden; 
  transition: all 0.3s ease;
  clip-path: polygon(0% 0%, 100% 0%, 100% 75%, 85% 100%, 0% 100%);
}

.contact-card:nth-child(even) {
  clip-path: polygon(15% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 25%);
}

.contact-card:nth-child(3n) {
  clip-path: polygon(0% 0%, 85% 0%, 100% 15%, 100% 100%, 0% 100%);
}

.card-icon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  color: #00ff9d;
  display: block;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  color: #fff;
  margin: 0 0 5px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #aaa;
}

.contact-card:hover {
  background: rgba(0, 255, 157, 0.1);
  border-color: #00ff9d;
  transform: translateY(-5px) scale(1.02);
  /* El brillo ahora seguirá la forma del trapecio */
  filter: drop-shadow(0 0 15px rgba(0, 255, 157, 0.5));
}

.contact-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-top: 3px solid #00ff9d;
  border-left: 3px solid #00ff9d;
  opacity: 0;
  transition: all 0.3s ease;
}

.contact-card:hover::before {
  opacity: 1;
  top: 10px;
  left: 10px;
}

/* Efecto Overlay "escaneo" al hacer hover */
.card-overlay {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 157, 0.2), transparent);
  transition: all 0.5s ease;
}

.contact-card:hover .card-overlay {
  left: 100%; /* Se desplaza de izquierda a derecha */
}

.contact-message {
  font-family: 'JetBrains Mono', monospace;
  color: #888;
  font-size: 0.85rem;
  margin-top: 50px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

/* FOOTER */
.distopian-footer {
    background: #000;
    padding: 40px 20px;
    border-top: 1px solid rgba(0, 255, 157, 0.1);
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    overflow: hidden;
}

.footer-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00ff9d, transparent);
    margin-bottom: 30px;
    opacity: 0.3;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    font-size: 0.65rem;
    color: #444;
    margin: 5px 0;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nickname {
    color: #00ff9d;
    font-weight: 800;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 5px rgba(0, 255, 157, 0.5);
    letter-spacing: 3px;
    padding: 0 5px;
    background: rgba(0, 255, 157, 0.05);
    overflow: hidden;
}

.nickname::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    transform: skewX(-20deg);
    animation: scan-nick 3s infinite;
}

.barcode {
    width: 150px;
    height: 30px;
    background: repeating-linear-gradient(
        90deg,
        #222,
        #222 2px,
        transparent 2px,
        transparent 5px
    );
    opacity: 0.5;
    margin-bottom: 10px;
}

.pulse-green {
    color: #00ff9d;
    animation: simple-pulse 2s infinite;
}

/* =====================
   GLITCH EFFECTS
   ===================== */

.glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: var(--green-main);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 50;
}

.pn-phrase.glitch-active {
  opacity: 1;
  text-shadow: 0 0 10px #00ff9d;
  transform: skewX(-5deg); /* Un pequeño empujón visual */
}

.brand-container.glitch-active {
  opacity: 0.8;
  filter: drop-shadow(0 0 15px #00ff9d);
  animation: shake 0.2s infinite;
}

/* =========================
   GLITCH RAYS (vertical slices)
   ========================= */
.glitch-rays {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
}

.glitch-rays::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      transparent 0%,
      var(--green-main) 48%,
      transparent 52%
    );
  mix-blend-mode: screen;
  filter: blur(1px);
}

/* =========================
   SCANLINES / RAYAS
   ========================= */
.glitch-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  opacity: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.15) 0px,
      rgba(255,255,255,0.15) 1px,
      transparent 2px,
      transparent 6px
    );
  mix-blend-mode: overlay;
}

/* =========================
   ERROR MESSAGES
   ========================= */
.glitch-errors {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  font-family: monospace;
  font-size: 18px;
  color: var(--green-main);
  opacity: 0;
}

.glitch-errors span {
  position: absolute;
  white-space: nowrap;
  text-transform: uppercase;
  text-shadow:
    0 0 6px var(--green-main),
    0 0 12px rgba(0,255,136,0.6);

  transform-origin: left center;
}

/* NOISE */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  z-index: 100;
}

/* ANIMATIONS */
@keyframes glitchA {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, -2px); }
  40% { transform: translate(2px, 2px); }
  60% { transform: translate(-1px, 1px); }
  100% { transform: translate(0); }
}

@keyframes glitchB {
  0% { transform: translate(0); }
  30% { transform: translate(3px, -1px); }
  60% { transform: translate(-3px, 1px); }
  100% { transform: translate(0); }
}

@keyframes pulseCore {
  0%, 100% { opacity: 0.3; r: 3; }
  50% { opacity: 1; r: 5; }
}

.brand-container.glitch-active {
  opacity: 1;
  filter: drop-shadow(0 0 20px #00ff9d) contrast(150%);
  transform: translateY(-50%) scale(1.05);
  /* Efecto de distorsión de líneas */
  clip-path: inset(0 0 0 0); 
  animation: pn-glitch 0.3s steps(2) infinite;
}

@keyframes pn-glitch {
  0% { clip-path: inset(20% 0 50% 0); transform: translateY(-50%) translateX(-5px); }
  50% { clip-path: inset(10% 0 80% 0); transform: translateY(-50%) translateX(5px); }
  100% { clip-path: inset(0 0 0 0); transform: translateY(-50%) translateX(0); }
}

@keyframes simple-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes scan-nick {
    0% { left: -100%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

.nickname:hover {
    animation: micro-glitch 0.2s infinite;
    cursor: crosshair;
}

@keyframes micro-glitch {
    0% { transform: translate(0); text-shadow: 2px 0 #ff003c; }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); text-shadow: -2px 0 #00ff9d; }
    75% { transform: translate(-1px); }
    100% { transform: translate(0); }
}

@media (max-width: 768px) {
  .nav {
    padding: 12px 20px; /* Reducimos padding en móvil */
  }

  .nav > span {
    font-size: 1.1rem; /* Logo un poco más pequeño */
  }

  .nav > div {
    gap: 12px; /* Reducimos el espacio entre links para que quepan */
  }

  .nav a {
    font-size: 0.6rem; /* Tamaño optimizado para iPhone/Android */
    letter-spacing: 1px;
  }
}

/* Para celulares muy pequeños (ej. iPhone SE) */
@media (max-width: 400px) {
  .nav > div {
    gap: 8px;
  }
  .nav a {
    font-size: 0.55rem;
  }
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-center { order: -1; } /* El código de barras arriba en móvil */
}
/*
@keyframes shake {
  0% { transform: translateY(-50%) translate(2px, -2px); }
  50% { transform: translateY(-50%) translate(-2px, 2px); }
  100% { transform: translateY(-50%) translate(0px, 0px); }
}
*/

