/* ============================================================ */
/*                      RESET & VARIABLES                       */
/* ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #04040d;
  --surface: #0b0b1a;
  --card: #0f0f22;
  --cyan: #00f0ff;
  --purple: #a855f7;
  --pink: #ff2d78;
  --white: #eef0ff;
  --muted: #6b7299;
  --border: rgba(0,240,255,0.12);
  --glow-cyan: 0 0 30px rgba(0,240,255,0.4), 0 0 60px rgba(0,240,255,0.15);
  --glow-purple: 0 0 30px rgba(168,85,247,0.4);
  --glow-pink: 0 0 30px rgba(255,45,120,0.4);
}

/* ============================================================ */
/*                     BASE & SCROLLBAR                         */
/* ============================================================ */

html { scroll-behavior: smooth; }
body { font-family: 'Exo 2', sans-serif; background: var(--bg); color: var(--white); overflow-x: hidden; }

/* Textura de ruido de fondo */
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999; opacity: 0.6;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 2px; }

/* ============================================================ */
/*                          NAVBAR                              */
/* ============================================================ */

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6vw; height: 90px;
  background: rgba(4,4,13,0.75);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 140px; width: auto; mix-blend-mode: screen; filter: brightness(1.2) drop-shadow(0 0 8px rgba(0,240,255,0.4)); transition: filter 0.3s; }
.logo img:hover { filter: brightness(1.4) drop-shadow(0 0 16px rgba(0,240,255,0.7)); }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; transition: color 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }
.nav-cta { background: transparent; border: 1px solid var(--cyan); color: var(--cyan); padding: 0.55rem 1.4rem; font-family: 'Orbitron', monospace; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; cursor: pointer; text-decoration: none; transition: all 0.3s; clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%); }
.nav-cta:hover { background: var(--cyan); color: var(--bg); box-shadow: var(--glow-cyan); }

/* ============================================================ */
/*                     HERO — PORTAFOLIO                        */
/* ============================================================ */

.portfolio-hero {
  padding: 140px 6vw 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Grid animado de fondo */
.portfolio-hero::after {
  content: ''; position: absolute; inset: -50%;
  background-image: linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite; pointer-events: none;
}
@keyframes gridMove { 0% { transform: translateY(0); } 100% { transform: translateY(60px); } }

/* Orbs de color de fondo */
.orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.orb-1 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(0,240,255,0.1), transparent 70%); top: -50px; left: -100px; animation: float1 8s ease-in-out infinite; }
.orb-2 { width: 350px; height: 350px; background: radial-gradient(circle, rgba(168,85,247,0.12), transparent 70%); bottom: -50px; right: -80px; animation: float2 10s ease-in-out infinite; }
@keyframes float1 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(20px,-30px); } }
@keyframes float2 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-20px,25px); } }

/* Textos del hero */
.hero-eyebrow { font-family: 'Orbitron', monospace; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.4em; color: var(--cyan); text-transform: uppercase; margin-bottom: 1.5rem; position: relative; z-index: 1; opacity: 0; animation: fadeUp 0.8s 0.2s forwards; }
.hero-title { font-family: 'Orbitron', monospace; font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 900; line-height: 1.05; margin-bottom: 1.2rem; position: relative; z-index: 1; opacity: 0; animation: fadeUp 0.8s 0.4s forwards; }
.hero-title .gradient { background: linear-gradient(90deg, var(--cyan), var(--purple), var(--pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-sub { font-size: 1rem; color: var(--muted); max-width: 500px; margin: 0 auto; line-height: 1.8; position: relative; z-index: 1; opacity: 0; animation: fadeUp 0.8s 0.6s forwards; }

/* Animación de entrada */
@keyframes fadeUp { from { opacity: 0; transform: translateY(25px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================ */
/*                     GRID DE PROYECTOS                        */
/* ============================================================ */

.portfolio-section { padding: 0 6vw 100px; }

/* Grid principal de cards */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2.5rem;
}

/* Card de proyecto — es un link clickeable */
.showcase-card {
  cursor: pointer;
  transition: transform 0.3s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.showcase-card:hover { transform: translateY(-6px); }

/* Imagen vertical de la card */
.showcase-img-wrap {
  width: 100%; aspect-ratio: 3/4;
  overflow: hidden; position: relative;
  border: 1px solid var(--border);
  transition: border-color 0.3s, box-shadow 0.3s;
  background: var(--card);
}
.showcase-card:hover .showcase-img-wrap {
  border-color: rgba(0,240,255,0.35);
  box-shadow: 0 0 25px rgba(0,240,255,0.1);
}
.showcase-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s; }
.showcase-card:hover .showcase-img-wrap img { transform: scale(1.04); }

/* Placeholder cuando no hay imagen aún */
.showcase-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; background: linear-gradient(135deg, var(--surface), var(--card));
  position: relative; overflow: hidden;
}
.showcase-placeholder::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}
.showcase-placeholder-icon { font-size: 3rem; position: relative; z-index: 1; }
.showcase-placeholder-text { font-family: 'Orbitron', monospace; font-size: 0.62rem; color: var(--muted); letter-spacing: 0.2em; text-transform: uppercase; position: relative; z-index: 1; }

/* Info debajo de la imagen */
.showcase-info { padding: 1.2rem 0 0; }
.showcase-name {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 900; color: var(--white);
  margin-bottom: 0.6rem; line-height: 1.2;
}
.showcase-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.7; }

/* ============================================================ */
/*                     CTA — TU PROYECTO AQUÍ                   */
/* ============================================================ */

.portfolio-cta {
  text-align: center; padding: 80px 6vw 100px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: relative; overflow: hidden;
}

/* Gradientes animados de fondo */
.portfolio-cta::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(0,240,255,0.14) 0%, rgba(168,85,247,0.08) 40%, transparent 70%);
  pointer-events: none;
  animation: ctaPulse 5s ease-in-out infinite;
}
.portfolio-cta::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(168,85,247,0.12) 0%, transparent 65%);
  pointer-events: none;
  animation: ctaPulse 5s ease-in-out infinite; animation-delay: 2.5s;
}
@keyframes ctaPulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%,-50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%,-50%) scale(1.25); }
}

/* Textos del CTA */
.cta-label { font-family: 'Orbitron', monospace; font-size: 0.68rem; letter-spacing: 0.45em; color: var(--pink); text-transform: uppercase; margin-bottom: 1.2rem; position: relative; z-index: 1; }
.cta-title { font-family: 'Orbitron', monospace; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 900; line-height: 1.15; margin-bottom: 1rem; position: relative; z-index: 1; }
.cta-title .highlight { background: linear-gradient(90deg, var(--cyan), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.cta-sub { font-size: 1rem; color: var(--muted); max-width: 460px; margin: 0 auto 2.5rem; line-height: 1.8; position: relative; z-index: 1; }

/* Botón principal */
.btn-primary { position: relative; z-index: 1; background: linear-gradient(135deg, var(--cyan), var(--purple)); color: var(--bg); border: none; padding: 0.9rem 2.4rem; font-family: 'Orbitron', monospace; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; cursor: pointer; text-decoration: none; display: inline-block; clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%); transition: transform 0.3s; }
.btn-primary:hover { animation: btnEncendido 0.4s ease forwards; }
@keyframes btnEncendido {
  0%   { transform: translateY(0)    scale(1); }
  100% { transform: translateY(-4px) scale(1.06); }
}

/* ============================================================ */
/*                       LÍNEA NEON                             */
/* ============================================================ */

.neon-line { height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent); opacity: 0.4; }

/* ============================================================ */
/*                          FOOTER                              */
/* ============================================================ */

footer { background: var(--bg); border-top: 1px solid var(--border); padding: 3rem 6vw; display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-copy { font-size: 0.8rem; color: var(--muted); }
.footer-links { display: flex; gap: 2rem; }
.footer-links a { font-size: 0.8rem; color: var(--muted); text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: var(--cyan); }

/* ============================================================ */
/*                   BOTÓN FLOTANTE WHATSAPP                    */
/* ============================================================ */

.whatsapp-float { position: fixed; bottom: 2rem; right: 2rem; z-index: 200; width: 58px; height: 58px; background: #25D366; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(37,211,102,0.5); text-decoration: none; transition: transform 0.6s ease, box-shadow 0.6s ease; animation: bounceIn 1s 2s both; }
.whatsapp-float:hover { transform: scale(1.12); box-shadow: 0 6px 30px rgba(37,211,102,0.75); animation: bounceIn 1s 2s both, waTintineo 0.9s ease; }
.whatsapp-float svg { width: 30px; height: 30px; fill: white; }

/* Animación de tintineo al hacer hover */
@keyframes waTintineo {
  0%   { transform: scale(1.12); box-shadow: 0 6px 30px rgba(37,211,102,0.75); }
  20%  { transform: scale(1.2);  box-shadow: 0 0 40px rgba(37,211,102,1), 0 0 80px rgba(37,211,102,0.5); }
  40%  { transform: scale(1.12); box-shadow: 0 0 15px rgba(37,211,102,0.4); }
  60%  { transform: scale(1.18); box-shadow: 0 0 40px rgba(37,211,102,1), 0 0 80px rgba(37,211,102,0.5); }
  100% { transform: scale(1.12); box-shadow: 0 6px 30px rgba(37,211,102,0.75); }
}

/* Animación de entrada al cargar la página */
@keyframes bounceIn { 0% { opacity: 0; transform: scale(0.3); } 60% { transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }

/* ============================================================ */
/*                     ANIMACIÓN REVEAL                         */
/* ============================================================ */

/* Elementos que aparecen suavemente al hacer scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

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

@media (max-width: 900px) {
  .nav-links { display: none; }
  .showcase-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .showcase-grid { grid-template-columns: 1fr; }
}

/* ============================================================ */
/*                     MODAL DE PROYECTO                        */
/* ============================================================ */

/* Overlay oscuro de fondo */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(4,4,13,0.92);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Cuando el modal esta activo */
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Contenedor principal del modal */
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

/* Linea cyan superior del modal */
.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
}

/* Esquinas decorativas del modal */
.modal-corner { position: absolute; width: 16px; height: 16px; }
.modal-corner-tl { top: 8px; left: 8px; border-top: 1px solid rgba(0,240,255,0.5); border-left: 1px solid rgba(0,240,255,0.5); }
.modal-corner-tr { top: 8px; right: 8px; border-top: 1px solid rgba(0,240,255,0.5); border-right: 1px solid rgba(0,240,255,0.5); }
.modal-corner-bl { bottom: 8px; left: 8px; border-bottom: 1px solid rgba(0,240,255,0.5); border-left: 1px solid rgba(0,240,255,0.5); }
.modal-corner-br { bottom: 8px; right: 8px; border-bottom: 1px solid rgba(0,240,255,0.5); border-right: 1px solid rgba(0,240,255,0.5); }

/* Boton de cerrar X */
.modal-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 10;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
  transition: all 0.3s;
}
.modal-close:hover { border-color: var(--pink); color: var(--pink); box-shadow: var(--glow-pink); }

/* ── LADO IZQUIERDO — CARRUSEL ── */
.modal-carousel {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

/* Cada slide del carrusel */
.carousel-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.carousel-slide.active { opacity: 1; }
.carousel-slide img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}

/* Placeholder cuando no hay imagen */
.carousel-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem;
  background: linear-gradient(135deg, var(--surface), var(--card));
  position: relative; overflow: hidden;
}
.carousel-placeholder::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}
.carousel-placeholder-text {
  font-family: 'Orbitron', monospace;
  font-size: 0.62rem; color: var(--muted);
  letter-spacing: 0.2em; text-transform: uppercase;
  position: relative; z-index: 1;
}

/* Flechas del carrusel */
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 5;
  background: rgba(4,4,13,0.7);
  border: 1px solid var(--border);
  color: var(--cyan);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}
.carousel-arrow:hover { background: rgba(0,240,255,0.15); border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.carousel-arrow-prev { left: 0.6rem; }
.carousel-arrow-next { right: 0.6rem; }

/* Puntitos indicadores */
.carousel-dots {
  position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.5rem; z-index: 5;
}
.carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  cursor: pointer;
  transition: all 0.3s;
}
.carousel-dot.active { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

/* ── LADO DERECHO — INFO ── */
.modal-info {
  padding: 3rem 2.5rem;
  display: flex; flex-direction: column; justify-content: center;
  gap: 1.2rem;
}

/* Etiqueta de categoria */
.modal-category {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem; letter-spacing: 0.35em;
  color: var(--cyan); text-transform: uppercase;
  opacity: 0.8;
}

/* Titulo del proyecto */
.modal-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 900; line-height: 1.2;
  color: var(--white);
}

/* Linea divisora */
.modal-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0.3;
}

/* Descripcion del proyecto */
.modal-desc {
  font-size: 0.9rem; color: var(--muted);
  line-height: 1.8;
}

/* Boton ir al sitio */
.modal-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: var(--bg);
  padding: 0.95rem 2.2rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  transition: all 0.3s;
  align-self: flex-start;
  margin-top: 0.5rem;
  box-shadow: var(--glow-cyan);
}
.modal-btn:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(0,240,255,0.7), 0 0 80px rgba(0,240,255,0.3); }
.modal-btn[href="#"] { opacity: 10 }

/* ── RESPONSIVE DEL MODAL ── */
@media (max-width: 700px) {
  .modal { grid-template-columns: 1fr; }
  .modal-carousel { aspect-ratio: 4/3; border-right: none; border-bottom: 1px solid var(--border); }
  .modal-info { padding: 2rem 1.5rem; }
}
