@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

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

body {
  font-family: "Poppins", sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* ===== FONDO GLOBAL ===== */
body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e3a8a, #0ea5e9);
  background-attachment: fixed;
  color: #fff;
}

/* ===== HEADER ===== */
.contenedor-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 99;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.contenedor-header header {
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.logo a {
  font-size: 28px;
  color: #178cb3;
  text-decoration: none;
  font-weight: 700;
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li a {
  color: #fff;
  margin: 0 15px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: 0.3s;
}

nav ul li a:hover {
  color: #38bdf8;
}

.nav-responsive {
  display: none;
  cursor: pointer;
  font-size: 22px;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 70px;
  overflow: hidden;
  background: transparent;
}

.hero-content {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: auto;
  width: 100%;
  padding: 40px 20px;
  gap: 40px;
}

.hero-texto {
  position: relative;
  z-index: 2;
  flex: 1;
  max-width: 720px;
}

.hero-tag {
  font-size: 13px;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 3.2rem;
  line-height: 1.15;
  font-weight: 700;
}

.hero h1 .highlight {
  color: #38bdf8;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(2.5rem, 3.4vw, 3.5rem);
  line-height: 1.15;
  overflow-wrap: normal;
  text-wrap: balance;
}

.hero-text {
  font-size: 16px;
  color: #cbd5e1;
  line-height: 1.7;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.badge {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge i {
  color: #38bdf8;
  font-size: 11px;
}

.hero-texto {
  position: relative;
  z-index: 3;
  flex: 1;
  max-width: 650px;
  gap: 20px;
}

.hero h1 {
  line-height: 1.12;
  margin-bottom: 4px;
}

.hero-text {
  max-width: 560px;
  line-height: 1.7;
}

.hero-buttons {
  margin-top: 4px;
}

/* Hero: integración de la fotografía */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: transparent;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-texto {
  position: relative;
  z-index: 3;
  flex: 1;
  max-width: 680px;
}

/* ===== HERO: foto integrada ===== */
.hero-content {
  min-height: calc(100vh - 70px);
}

.hero-img {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}

/* Halo verde */
.hero-img::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 10%;
  bottom: 12%;
  width: 80%;
  height: 70%;
  background: radial-gradient(
    circle,
    rgba(66, 126, 101, 0.6) 0%,
    rgba(66, 126, 101, 0) 70%
  );
  filter: blur(40px);
}

.hero-img::after {
  content: none;
}

.hero-img img {
  display: block;
  height: 92%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 0 25px rgba(0, 0, 0, 0.35));

  /* Fundido: borde izquierdo + parte inferior */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 30%),
    linear-gradient(to bottom, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 30%),
    linear-gradient(to bottom, #000 80%, transparent 100%);
  mask-composite: intersect;
}

/* Móvil: foto de fondo suave */
@media (max-width: 768px) {
  .hero-img {
    width: 100%;
    opacity: 0.3;
  }

  .hero-img img {
    height: 80%;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  }
}

/* Adaptación a móvil */
@media (max-width: 768px) {
  .hero-texto {
    max-width: 100%;
  }
}

/* ===== BOTONES ===== */
.btn-primary {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  background: #178cb3;
  color: #fff;
  border: 2px solid #178cb3;
  transition: 0.3s;
}

.btn-primary:hover {
  background: #0f6f8f;
  border-color: #0f6f8f;
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 2px solid #38bdf8;
  color: #fff;
  transition: 0.3s;
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-2px);
}

/* ===== SECCIONES GENERALES ===== */
.skills,
.contacto {
  padding: 80px 20px;
}

.contenido-seccion {
  max-width: 1100px;
  margin: auto;
  background: rgba(30, 35, 38, 0.45);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px 30px;
}

.section-label {
  text-align: center;
  font-size: 13px;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 8px;
}

h2 {
  text-align: center;
  font-size: 42px;
  margin-bottom: 40px;
  font-weight: 700;
}

/* ===== SKILLS GRID (servicios) ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.skill-card {
  background: #1e2326;
  padding: 28px 24px;
  border-radius: 15px;
  text-align: center;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.skill-card:hover {
  transform: translateY(-5px);
  background: #252f33;
}

.skill-card i {
  font-size: 2rem;
  color: #178cb3;
}

.skill-card h4 {
  font-size: 17px;
  font-weight: 600;
}

.skill-card p {
  font-size: 13px;
  color: #cfcfcf;
  line-height: 1.5;
}

.card-tag {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* ===== PROYECTOS ===== */
.projects {
  padding: 80px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.projects .contenido-seccion {
  /* hereda contenido-seccion */
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 24px;
  margin-top: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
  background: #1e2326;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-info {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-type {
  font-size: 11px;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-info h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.project-info p {
  color: #cfcfcf;
  font-size: 13px;
  line-height: 1.6;
  flex: 0 0 auto;
}

.project-results {
  margin: 14px 0 10px;
}

.project-results span {
  font-size: 12px;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-info a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s;
  margin-top: auto;
}

.project-info a:hover {
  color: #7dd3fc;
}

.project-info a:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 4px;
  border-radius: 2px;
}

.project-technologies {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 18px;
}

.technology-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #46514e;
  border-radius: 6px;
  background-color: #252a2e;
  color: #e0e8e5;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Card CTA */
.project-card--cta {
  background: rgba(23, 140, 179, 0.08);
  border: 2px dashed rgba(56, 189, 248, 0.3);
}

.project-info--cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 280px;
  gap: 12px;
}

.cta-icon {
  font-size: 3rem;
  color: #38bdf8;
  opacity: 0.5;
}

/* ===== PROCESO ===== */
.proceso-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.paso {
  background: #1e2326;
  border-radius: 15px;
  padding: 30px 24px;
  text-align: center;
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  position: relative;
  transition: 0.3s;
}

.paso:hover {
  transform: translateY(-5px);
  background: #252f33;
}

.paso-numero {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.paso i {
  font-size: 2rem;
  color: #178cb3;
  margin-bottom: 14px;
  display: block;
}

.paso h4 {
  font-size: 17px;
  margin-bottom: 10px;
}

.paso p {
  font-size: 13px;
  color: #cfcfcf;
  line-height: 1.5;
}

.paso-conector {
  color: #38bdf8;
  font-size: 20px;
  opacity: 0.4;
  flex-shrink: 0;
}

/* ===== CONTACTO ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 15px;
  margin-bottom: 14px;
  background: #252a2e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  transition: 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #38bdf8;
}

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

.contact-form button {
  position: relative;
  overflow: hidden;
  background: transparent;
  border: 2px solid #38bdf8;
  color: #fff;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: 0.3s;
  width: 100%;
}

.contact-form button .overlay {
  position: absolute;
  inset: 0;
  width: 0;
  height: 100%;
  background: #178cb3;
  z-index: -1;
  transition: 0.5s;
}

.contact-form button:hover .overlay {
  width: 100%;
}

.info-card {
  background: rgba(30, 35, 38, 0.6);
  padding: 24px;
  border-radius: 12px;
}

.info-card ul {
  list-style: none;
}

.info-card li {
  margin-bottom: 14px;
  color: #cbd5e1;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-card li i {
  color: #38bdf8;
  width: 16px;
  flex-shrink: 0;
}

/* ===== FOOTER ===== */
footer {
  background: #252a2e;
  text-align: center;
  padding: 50px 20px;
}

.arriba {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  margin-bottom: 24px;
  transition: 0.3s;
  text-decoration: none;
}

.arriba:hover {
  background: #178cb3;
  border-color: #178cb3;
}

.redes {
  margin: 8px 0 0;
}

.redes a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  margin: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 17px;
  transition: 0.3s;
  text-decoration: none;
}

.redes a:hover {
  background: #178cb3;
  border-color: #178cb3;
  transform: translateY(-3px);
}

/* ===== WHATSAPP FLOTANTE ===== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  z-index: 999;
  text-decoration: none;
  opacity: 0;
  transform: translateY(30px) scale(0.8);
  animation: whatsappEntrada 0.7s ease-out 0.5s forwards;
  transition:
    transform 0.3s,
    background 0.3s;
}

.whatsapp-float:hover {
  background: #1da851;
  transform: translateY(-4px) scale(1.05);
}

@keyframes whatsappEntrada {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

/* ========================================
   MENÚ DE NAVEGACIÓN
======================================== */

/* Escritorio */
.nav-responsive {
  display: none;
  cursor: pointer;
  font-size: 22px;
  color: #ffffff;
  background: transparent;
  border: none;
  padding: 10px;
  z-index: 1001;
}

.contenedor-header nav {
  display: block;
}

.contenedor-header nav ul {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ========================================
   TABLET Y MÓVIL: HASTA 980 PX
======================================== */

@media (max-width: 980px) {
  /* Menú móvil */
  .contenedor-header nav {
    display: none;
  }

  .contenedor-header .nav-responsive {
    display: block;
  }

  .contenedor-header nav.responsive {
    display: block;
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background-color: #252a2e;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
  }

  .contenedor-header nav.responsive ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .contenedor-header nav.responsive ul li {
    width: 100%;
    padding: 12px 20px;
  }

  /* Hero */
  .hero {
    min-height: auto;
  }

  .hero-content {
    padding-top: 70px;
    padding-bottom: 70px;
  }

  .hero-texto {
    flex: 1;
  }
}

/* ========================================
   TABLET: HASTA 768 PX
======================================== */

@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    text-align: left;
    padding: 50px 20px;
    gap: 30px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-img-placeholder {
    width: 180px;
    height: 180px;
    font-size: 60px;
  }

  h2 {
    font-size: 32px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .proceso-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .paso {
    max-width: 100%;
  }

  .paso-conector {
    transform: rotate(90deg);
  }
}

/* ========================================
   MÓVIL: HASTA 480 PX
======================================== */

@media (max-width: 480px) {
  .hero-content {
    padding: 40px 20px;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.4rem);
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .hero-texto {
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(2rem, 7vw, 2.5rem);
  }
}

/* Formulario de contacto: accesibilidad y espaciado */

.contact-form .form-description {
  color: #cfcfcf;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.contact-form .form-group {
  margin-bottom: 18px;
}

.contact-form .form-group label {
  display: block;
  margin-bottom: 7px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: inherit;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 3px;
  border-color: #7dd3fc;
}

.contact-form button:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 4px;
}

.privacy-notice {
  margin: 0 0 18px;
  color: #cfcfcf;
  font-size: 13px;
  line-height: 1.6;
}

.privacy-notice a {
  color: #7dd3fc;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-notice a:hover {
  color: #ffffff;
}

.privacy-notice a:focus-visible {
  outline: 3px solid #7dd3fc;
  outline-offset: 3px;
}

.project-technologies {
  margin-top: 14px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  line-height: 1.8;
  color: #b8b8b8;
}

.project-technologies strong {
  color: #ffffff;
  font-weight: 600;
}

/* Etiquetas de tecnologías en las tarjetas de proyectos */
.project-technologies {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 18px;
}

.technology-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #46514e;
  border-radius: 6px;
  background-color: #252a2e;
  color: #e0e8e5;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.5;
}

/* Evitar desbordamientos horizontales en proyectos */
.projects,
.projects .contenido-seccion,
.projects .projects-container,
.projects .project-card {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.projects .contenido-seccion {
  width: 100%;
}

.projects .project-card img {
  display: block;
  max-width: 100%;
}

/* Adaptación a móviles */
@media (max-width: 600px) {
  .projects {
    padding: 40px 12px;
  }

  .projects .contenido-seccion {
    padding: 24px 12px;
  }

  .projects .projects-container {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .projects .project-info {
    padding: 18px;
  }

  .projects .project-card img {
    height: 180px;
  }

  .projects h2 {
    font-size: 32px;
  }
}

.skills-grid .skill-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: 420px;
  justify-self: center;
}

/* ===== SOBRE MÍ ===== */
.sobre-mi {
  padding: 80px 20px;
}

.sobre-mi-contenido {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sobre-mi-contenido p {
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .sobre-mi {
    padding: 40px 12px;
  }
}
