
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --verde: #4ade80;
  --verde-fuerte: #14a73e;
  --fondo-tarjeta: rgba(17, 17, 19, 0.7);
  --borde-tarjeta: #27272a;
  --red: #ff3737;
  --texto-muted: #a1a1aa;
  --amarillo: rgb(240, 255, 81);
  --fuente-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --fuente-cuerpo: system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(-45deg, #000000, #0b0110, #140329, #000000);
  background-size: 400% 400%;
  animation: aurora 12s ease infinite;
  background-attachment: fixed;
  color: #ffffff;
  font-family: var(--fuente-cuerpo);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

@keyframes aurora {
  0% {background-position: 0% 50%;}
  6.25% {background-position: 12.5% 50%;}
  12.5% {background-position: 25% 50%;}
  25% {background-position: 50% 50%;}
  50% {background-position: 100% 50%;}
  75% {background-position: 50% 50%;}
  87.5% {background-position: 25% 50%;}
  93.75%{background-position: 12.5% 50%;}
  100% {background-position: 0% 50% ;}
}

.info-head {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--borde-tarjeta);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--fuente-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.logo span {
  color: var(--verde);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  color: #e4e4e7;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--verde);
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: var(--verde);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cv {
  border: 1px solid var(--verde);
  border-radius: 20em;
  padding: 0.5em 1.2em;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-cv:hover {
  background: var(--verde);
  color: #000000;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

.contenido-pagina {
  min-height: 100vh;
  padding: 40px 6% 80px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-section {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 20px 0;
}

@keyframes fadeOutScroll {
  to {
    opacity: 0;
    transform: translateY(-50px);
  }
}

@keyframes fadeInScroll {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.texto-magico {
  display: inline-block;
  position: relative;
  color: #ffffff;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-family: var(--fuente-display);
}

.texto-magico::before {
  content: "";
  animation: cambiarTexto 14s infinite;
}

.texto-magico::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 15%;
  height: 70%;
  width: 3px;
  background-color: var(--verde);
  animation: parpadeoCursor 0.8s infinite;
}

@keyframes parpadeoCursor {
  0%, 100% {opacity: 1;}
  50% {opacity: 0;}
}

@keyframes cambiarTexto {
  0%   { content:"F"; }
  1%   { content:"Fr"; }
  2%   { content:"Fro"; }
  3%   { content:"Fron"; }
  4%   { content:"Front"; }
  5%   { content:"Fronte"; }
  6%   { content:"Fronten"; }
  7%   { content:"Frontend"; }
  8%   { content:"Frontend D"; }
  9%   { content:"Frontend De"; }
  10%  { content:"Frontend Dev"; }
  11%  { content:"Frontend Deve"; }
  12%  { content:"Frontend Devel"; }
  13%  { content:"Frontend Develo"; }
  14%  { content:"Frontend Develop"; }
  15%  { content:"Frontend Develope"; }
  16%  { content:"Frontend Developer"; }
  19%  { content:"Frontend Developer"; }
  27%  { content:""; }
  28%  { content:"B"; }
  29%  { content:"Ba"; }
  30%  { content:"Bac"; }
  31%  { content:"Back"; }
  32%  { content:"Backe"; }
  33%  { content:"Backen"; }
  34%  { content:"Backend"; }
  35%  { content:"Backend D"; }
  36%  { content:"Backend De"; }
  37%  { content:"Backend Dev"; }
  38%  { content:"Backend Deve"; }
  39%  { content:"Backend Devel"; }
  40%  { content:"Backend Develo"; }
  41%  { content:"Backend Develop"; }
  42%  { content:"Backend Develope"; }
  43%  { content:"Backend Developer"; }
  47%  { content:""; }
  48%  { content:"A"; }
  49%  { content:"Ad"; }
  50%  { content:"Adm"; }
  51%  { content:"Admi"; }
  52%  { content:"Admin"; }
  53%  { content:"AdminS"; }
  54%  { content:"AdminSy"; }
  55%  { content:"AdminSys"; }
  56%  { content:"AdminSys"; }
  60%  { content:""; }
  61%  { content:"A"; }
  62%  { content:"An"; }
  63%  { content:"Ana"; }
  64%  { content:"Anal"; }
  65%  { content:"Anali"; }
  66%  { content:"Analis"; }
  67%  { content:"Analisis"; }
  68%  { content:"Analisis d"; }
  69%  { content:"Analisis de"; }
  70%  { content:"Analisis de D"; }
  71%  { content:"Analisis de Da"; }
  72%  { content:"Analisis de Dat"; }
  73%  { content:"Analisis de Datos"; }
  74%  { content:"Analisis de Datos"; }
  75%  { content:""; }
  80%  { content:"M"; }
  81%  { content:"Ma"; }
  82%  { content:"Mac"; }
  83%  { content:"Mach"; }
  84%  { content:"Machi"; }
  85%  { content:"Machin"; }
  86%  { content:"Machine"; }
  87%  { content:"Machine L"; }
  88%  { content:"Machine Le"; }
  89%  { content:"Machine Lea"; }
  90%  { content:"Machine Lear"; }
  91%  { content:"Machine Learn"; }
  92%  { content:"Machine Learni"; }
  93%  { content:"Machine Learnin"; }
  94%  { content:"Machine Learning"; }
  100% { content:"Machine Learning"; }
}

.typing-container,
.brillo-nombre,
.nombre-dev,
.descripcion {
  animation: fadeOutScroll linear forwards;
  animation-timeline: view();
  animation-range: exit 0% exit 80%;
}

.typing-container,
.nombre-dev,
.descripcion {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
}

.brillo-nombre {
  position: absolute;
  top: 44%;
  left: 20%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 90px;
  background-color: #00ff5e;
  border-radius: 50%;
  z-index: 1;
  filter: blur(90px);
  pointer-events: none;
}

.nombre-dev {
  font-family: var(--fuente-display);
  font-size: clamp(2.6rem, 8vw, 6rem);
  color: hsl(142, 69%, 58%);
  text-shadow:
    0 0 8px rgba(1, 159, 59, 0.3),
    0 0 20px rgba(57, 181, 103, 0.2);
  z-index: 2;
}

.descripcion {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--texto-muted);
  max-width: 42ch;
  z-index: 2;
}

.habilidades {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
  z-index: 2;
}

.skill-badge {
  border: 1px solid var(--borde-tarjeta);
  background: rgba(255, 255, 255, 0.03);
  color: #e4e4e7;
  font-size: 0.85rem;
  padding: 0.4em 1em;
  border-radius: 20em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.skill-badge:hover {
  border-color: var(--verde);
  color: var(--verde);
}

section[id] {
  scroll-margin-top: 90px;
  padding-top: 60px;
}

.titulo-seccion {
  font-family: var(--fuente-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.titulo-seccion span {
  color: var(--verde);
  font-size: 1rem;
  font-weight: 400;
  font-family: var(--fuente-cuerpo);
  color: var(--texto-muted);
}

.sobre-mi-texto {
  color: var(--texto-muted);
  line-height: 1.7;
  max-width: 65ch;
  font-size: 1.05rem;
}

.tarjeta {
  background: var(--fondo-tarjeta);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde-tarjeta);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;

  animation: fadeInScroll linear forwards;
  animation-timeline: view();
  animation-range: entry 10% cover 30%;
}

.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.proyecto-card {
  display: block;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.proyecto-card:hover {
  transform: translateY(-4px);
  border-color: var(--verde);
}

.proyecto-card h3 {
  font-family: var(--fuente-display);
  margin-bottom: 0.6rem;
}

.proyecto-card p {
  color: var(--texto-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.proyecto-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.proyecto-tags span {
  font-size: 0.75rem;
  color: var(--verde);
  border: 1px solid var(--verde-fuerte);
  border-radius: 20em;
  padding: 0.2em 0.7em;
}


.proyecto-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.proyecto-status .status {
  font-size: 0.75rem;
  border-radius: 20em;
  padding: 0.2em 0.7em;
}

.proyecto-status .progreso{
    color: var(--amarillo);
  border: 1px solid var(--amarillo);
}

.proyecto-status .completado {
  color: var(--verde);
  border: 1px solid var(--verde-fuerte);
}


.ver-mas {
  display: inline-block;
  margin-top: 1rem;
  color: var(--verde);
  font-size: 0.9rem;
  font-weight: 500;
}


.contacto-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.contacto-link {
  border: 1px solid var(--borde-tarjeta);
  border-radius: 20em;
  padding: 0.6em 1.3em;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contacto-link:hover {
  border-color: var(--verde);
  color: var(--verde);
}

.contacto-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;

  display: flex;
  align-items: center;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
  padding: 0.7em 1.4em 0.7em 1.1em;
  color: white;
  background: linear-gradient(
    0deg,
    rgba(20, 167, 62, 1) 0%,
    rgb(2, 154, 15) 100%
  );
  border: none;
  box-shadow: 0 0.7em 1.5em -0.5em #14a73e98;
  letter-spacing: 0.05em;
  border-radius: 20em;

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contacto-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5em 1.5em -0.5em #14a73e98;
}

.contacto-btn:active {
  transform: translateY(0);
  box-shadow: 0 0.3em 1em -0.5em #14a73e98;
}

.proyecto-detalle {
  max-width: 800px;
  margin: 0 auto;
  padding: 100px 6% 80px;
}

.volver {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--verde);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.proyecto-detalle h1 {
  font-family: var(--fuente-display);
  font-size: clamp(2rem, 5vw, 3rem);
  color: hsl(142, 69%, 58%);
  margin-bottom: 1rem;
}

.proyecto-detalle .sobre-mi-texto {
  margin-bottom: 1.5rem;
}

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 6% 60px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  color: var(--texto-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--borde-tarjeta);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a:hover {
  color: var(--verde);
}


@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 6%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-bottom: 1px solid var(--borde-tarjeta);
  }

  .nav-links.abierto {
    max-height: 320px;
    padding: 1rem 6% 1.5rem;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.7em 0;
  }

  .nav-cv {
    display: inline-block;
    margin-top: 0.5rem;
  }

  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 600px) {
  .hero-section {
    min-height: 75vh;
    align-items: flex-start;
    text-align: left;
  }

  .brillo-nombre {
    left: 50%;
    width: 140px;
  }

  .contacto-btn span {
    display: none;
  }

  .contacto-btn {
    padding: 0.9em;
    border-radius: 50%;
    bottom: 1.2rem;
    right: 1.2rem;
  }

  .proyectos-grid {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .texto-magico::before,
  .texto-magico::after,
  .typing-container,
  .brillo-nombre,
  .nombre-dev,
  .descripcion,
  .tarjeta,
  .proyecto-card {
    animation: none !important;
  }
}

.tarjeta-synapsis {
  background: var(--fondo-tarjeta);
  backdrop-filter: blur(10px);
  border: 1px solid var(--borde-tarjeta);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;

  animation: fadeInScroll linear forwards;
  animation-timeline: view();
  animation-range: entry 10% cover 30%;
}

.tarjeta-synapsis:hover{
  transform: translateY(-4px);
  border-color: var(--red);
}
