/* ============================================================
   VARIABLES Y RESET
============================================================ */
:root {
  /* ── Paleta elegante monocromática: negros, blancos y grises ──
     Se conservan los nombres de variables por compatibilidad;
     solo cambian sus valores. */
  --azul-oscuro: #0a0a0b;   /* fondo principal (casi negro) */
  --azul-medio:  #161619;   /* tarjetas y secciones alternas */
  --celeste:     #ffffff;   /* color de acento (blanco) */
  --celeste-claro: #d4d4d8; /* acento suave / estados hover */
  --blanco:      #ffffff;
  --gris-texto:  #b4b4bd;   /* texto secundario */
  --gris-suave:  #71717a;   /* texto terciario */
  --whatsapp:    #25D366;   /* verde de marca (se mantiene para el CTA) */

  --radio: 16px;
  --sombra: 0 16px 40px rgba(0, 0, 0, 0.45);
  --transicion: 0.3s ease;
  --max-ancho: 1140px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--azul-oscuro);
  color: var(--blanco);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.container {
  width: 90%;
  max-width: var(--max-ancho);
  margin: 0 auto;
}

/* ============================================================
   BOTONES
============================================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transicion);
  white-space: nowrap;
  overflow: hidden;      /* recorta el brillo que barre */
  isolation: isolate;    /* crea contexto: los efectos con z-index negativo
                            quedan sobre el fondo del botón pero bajo el texto */
}

/* ===== Animación: brillo que barre al pasar el mouse =====
   Se aplica a los botones sólidos (primary y whatsapp). */
.btn-primary::before,
.btn-whatsapp::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn-primary:hover::before,
.btn-whatsapp:hover::before {
  left: 130%;
}

.btn-primary {
  background: var(--celeste);
  color: var(--azul-oscuro);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.14);
}
.btn-primary:hover {
  background: var(--celeste-claro);
  transform: translateY(-3px);
}

.btn-ghost {
  background: transparent;
  color: var(--blanco);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn-ghost:hover {
  border-color: var(--celeste);
  color: var(--celeste);
}

.btn-outline {
  background: transparent;
  color: var(--celeste);
  border-color: var(--celeste);
}
.btn-outline:hover {
  background: var(--celeste);
  color: var(--azul-oscuro);
  transform: translateY(-3px);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}
.btn-whatsapp:hover {
  background: #1ebe5b;
  transform: translateY(-3px);
}

/* ===== Animación: flecha que aparece y se desliza ===== */
.btn-arrow::after {
  content: "→";
  position: relative;
  z-index: 2;
  font-weight: 700;
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  transform: translateX(-6px);
  transition: max-width 0.3s ease, opacity 0.3s ease,
              transform 0.3s ease, margin-left 0.3s ease;
}
.btn-arrow:hover::after {
  max-width: 20px;
  opacity: 1;
  margin-left: 4px;
  transform: translateX(0);
}

/* ===== Animación: los botones outline se rellenan desde el centro ===== */
.btn-outline::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--celeste);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s ease;
}
.btn-outline:hover::before {
  transform: scaleX(1);
}
/* al rellenarse, el efecto ya da el color; evitamos el doble fondo */
.btn-outline:hover {
  background: transparent;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 18px 0;
  transition: var(--transicion);
}
.navbar.scrolled {
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: blur(10px);
  padding: 12px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: inline-flex;
  align-items: center;
  transition: opacity var(--transicion);
}
.logo:hover { opacity: 0.8; }
.logo-img {
  height: 38px;
  width: auto;
  display: block;
}
/* En el footer el logo se muestra un poco más grande */
.footer .logo-img { height: 50px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  color: var(--gris-texto);
  font-weight: 500;
  transition: var(--transicion);
}
.nav-links a:hover { color: var(--celeste); }
.nav-cta {
  background: var(--celeste);
  color: var(--azul-oscuro) !important;
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 600;
}
.nav-cta:hover { background: var(--celeste-claro); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 26px;
  height: 3px;
  background: var(--blanco);
  border-radius: 3px;
  transition: var(--transicion);
}

/* ============================================================
   HERO
============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  background: #050506;
  overflow: hidden;
}
/* Lienzo de partículas: cubre el hero y queda detrás del contenido */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none; /* los eventos de mouse los capta la sección .hero */
}
.hero-inner { position: relative; z-index: 2; }
.hero-glow {
  position: absolute;
  top: 10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: var(--celeste);
  filter: blur(180px);
  opacity: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.hero-content {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
  color: var(--celeste-claro);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--gris-texto);
  margin: 0 auto 34px;
  max-width: 600px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 34px;
}
.hero-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  color: var(--gris-suave);
  font-size: 0.95rem;
}
.hero-points span { color: var(--gris-texto); }

/* ============================================================
   SECCIONES GENERALES
============================================================ */
.section { padding: 90px 0; }
.section-alt { background: var(--azul-medio); }
.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 55px;
}
.eyebrow {
  color: var(--celeste);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
}
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 12px 0 14px;
}
.section-head p { color: var(--gris-texto); }

.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--azul-medio);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radio);
  transition: var(--transicion);
}
.section-alt .card { background: var(--azul-oscuro); }

/* ============================================================
   SERVICIOS
============================================================ */
.service-card {
  position: relative;
  padding: 38px 30px;
  text-align: center;
}
.service-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: var(--sombra);
}
.service-card.featured {
  border-color: var(--celeste);
  box-shadow: 0 0 0 1px var(--celeste), var(--sombra);
}
.ribbon {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--celeste);
  color: var(--azul-oscuro);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
}
.service-icon {
  font-size: 2.6rem;
  margin-bottom: 16px;
}
.service-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.service-desc {
  color: var(--gris-texto);
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--celeste);
  margin-bottom: 22px;
}
.price span {
  font-size: 0.95rem;
  color: var(--gris-suave);
  font-weight: 500;
}

/* ============================================================
   PORTAFOLIO
============================================================ */
.work-card {
  overflow: hidden;
}
.work-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--sombra);
}
.work-img {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
}
.work-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(5, 5, 6, 0.72);
  backdrop-filter: blur(6px);
  color: var(--blanco);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.work-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.work-card:hover .work-img img { transform: scale(1.08); }
.work-body { padding: 24px; }
.work-body h3 { font-size: 1.25rem; margin-bottom: 6px; }
.work-body p {
  color: var(--gris-texto);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

/* ============================================================
   POR QUÉ ELEGIRNOS
============================================================ */
.feature {
  text-align: center;
  padding: 30px 20px;
}
.feature-icon {
  font-size: 2.4rem;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.feature h3 { font-size: 1.15rem; margin-bottom: 8px; }
.feature p { color: var(--gris-texto); font-size: 0.92rem; }

/* ============================================================
   CONTACTO
============================================================ */
.section-contact {
  background: linear-gradient(135deg, var(--azul-medio), var(--azul-oscuro));
}
.contact-box {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 50px 30px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
}
.contact-box h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 12px 0 14px;
}
.contact-box > p { color: var(--gris-texto); margin-bottom: 30px; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}
.contact-note { color: var(--gris-suave); font-size: 0.95rem; }
.contact-note strong { color: var(--celeste-claro); }

/* ============================================================
   FOOTER
============================================================ */
.footer {
  background: #060607;
  padding: 50px 0 30px;
  text-align: center;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.footer p { color: var(--gris-texto); }
.footer-social { display: flex; gap: 24px; }
.footer-social a {
  color: var(--gris-texto);
  font-weight: 500;
  transition: var(--transicion);
}
.footer-social a:hover { color: var(--celeste); }
.footer small { color: var(--gris-suave); margin-top: 8px; }

/* ============================================================
   BOTÓN FLOTANTE WHATSAPP
============================================================ */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: var(--whatsapp);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
  animation: pulse 2.2s infinite;
  transition: transform var(--transicion);
}
.whatsapp-float:hover { transform: scale(1.1); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ============================================================
   ANIMACIONES AL HACER SCROLL
============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    background: var(--azul-medio);
    padding: 40px;
    gap: 30px;
    transition: right var(--transicion);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
  }
  .nav-links.open { right: 0; }
  .nav-toggle { display: flex; z-index: 1100; }
  .nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.active span:nth-child(2) { opacity: 0; }
  .nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 110px 0 70px; }
  .hero-actions .btn { flex: 1; }
}

/* Respeta usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .whatsapp-float { animation: none; }
  html { scroll-behavior: auto; }
}
