/* ============================================
   Marcos Rivas · Landing Final
   ============================================ */

html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-display {
  letter-spacing: 0.005em;
  font-weight: 400;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #f5f8fc; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid #f5f8fc;
}
::-webkit-scrollbar-thumb:hover { background: #0088ff; }

/* ============================================
   Líneas de cuadrícula (fondos oscuros)
   ============================================ */
.grid-lines-dark {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ============================================
   Service cards
   ============================================ */
.service-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(3, 13, 36, 0.08);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(3, 13, 36, 0.03);
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(135deg, transparent 40%, rgba(0, 136, 255, 0.5), transparent 60%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 136, 255, 0.35);
  box-shadow: 0 20px 40px -10px rgba(0, 136, 255, 0.25);
}

.service-card:hover::before { opacity: 1; }

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.1), rgba(29, 78, 216, 0.05));
  border: 1px solid rgba(0, 136, 255, 0.2);
  color: #0088ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover .card-icon {
  transform: rotate(-6deg) scale(1.08);
  box-shadow: 0 0 24px rgba(0, 136, 255, 0.35);
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.2), rgba(29, 78, 216, 0.1));
}

/* ============================================
   Banner CTA (entre Servicios y Beneficios)
   ============================================ */
.cta-banner {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #030d24 0%, #1e3a8a 50%, #030d24 100%);
  overflow: hidden;
  border-top: 1px solid rgba(0, 136, 255, 0.2);
  border-bottom: 1px solid rgba(0, 136, 255, 0.2);
}

.cta-banner-glow-1 {
  position: absolute;
  top: -50%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: rgba(0, 136, 255, 0.25);
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}

.cta-banner-glow-2 {
  position: absolute;
  bottom: -50%;
  left: -5%;
  width: 350px;
  height: 350px;
  background: rgba(37, 99, 235, 0.2);
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.cta-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: #25d366;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  white-space: nowrap;
}

.cta-banner-btn:hover {
  background: #ffffff;
  color: #030d24;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .cta-banner-btn {
    padding: 12px 22px;
    font-size: 13px;
  }
}

/* ============================================
   Benefit cards
   ============================================ */
.benefit-card {
  background: #ffffff;
  border: 1px solid rgba(3, 13, 36, 0.08);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(3, 13, 36, 0.03);
}

.benefit-card:hover {
  border-color: rgba(0, 136, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -10px rgba(0, 136, 255, 0.2);
}

.benefit-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.1), rgba(29, 78, 216, 0.06));
  border: 1px solid rgba(0, 136, 255, 0.2);
  color: #0088ff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.benefit-card:hover .benefit-icon {
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.2), rgba(29, 78, 216, 0.1));
  box-shadow: 0 0 20px rgba(0, 136, 255, 0.3);
}

/* ============================================
   Project cards V2 (con modal)
   ============================================ */
.project-card-v2 {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(3, 13, 36, 0.06);
  border: 1px solid rgba(3, 13, 36, 0.04);
}

.project-card-v2:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px -12px rgba(0, 136, 255, 0.25);
  border-color: rgba(0, 136, 255, 0.2);
}

.project-preview {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #061536;
}

.project-preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.1), rgba(0,0,0,0.25));
  transition: opacity 0.3s ease, background 0.3s ease;
  z-index: 1;
}

.project-preview-icon {
  position: relative;
  z-index: 2;
  opacity: 0.85;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card-v2:hover .project-preview-icon {
  transform: scale(0.92);
  opacity: 0.4;
}

.project-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #0088ff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 6px;
  z-index: 3;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.project-card-v2:hover .project-play-btn {
  transform: translate(-50%, -50%) scale(1);
}

.project-card-v2:hover .project-preview-overlay {
  background: linear-gradient(135deg, rgba(0, 136, 255, 0.2), rgba(0, 0, 0, 0.4));
}

/* ============================================
   Preview de VIDEO en cards de proyectos
   (overrides para .project-preview-has-video)

   Comportamiento:
   - Por defecto: el video está oculto (opacity: 0).
     Se ve el ícono SVG sobre el gradiente de la card.
   - En hover: el video aparece con fade-in y se reproduce.
     El ícono se desvanece, el play-btn aparece (regla original).
   ============================================ */

/* El video llena toda el área pero está OCULTO por defecto */
.project-preview-has-video .project-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;            /* sobre el ícono cuando se vuelve visible */
  opacity: 0;            /* oculto por defecto */
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transform: scale(1.02);
}

/* Al hacer hover: el video aparece encima del ícono */
.project-card-v2:hover .project-preview-has-video .project-preview-video {
  opacity: 1;
  transform: scale(1);
}

/* En cards con video, el ícono se desvanece completamente al hover
   (en lugar del scale 0.92 / opacity 0.4 del default) para no verse
   detrás del video durante la transición */
.project-card-v2:hover .project-preview-has-video .project-preview-icon {
  opacity: 0;
  transform: scale(0.85);
}

/* El overlay queda por encima del video (z-index 3) para mantener
   el degradado oscuro inferior y que el play-btn destaque */
.project-preview-has-video .project-preview-overlay {
  z-index: 3;
}
.project-preview-has-video .project-play-btn {
  z-index: 4;
}

.project-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}

.view-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 20px;
  background: #030d24;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.view-project-btn:hover {
  background: #0088ff;
  transform: translateX(2px);
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 13, 36, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  animation: modalFadeIn 0.3s ease forwards;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes modalFadeIn {
  to { opacity: 1; }
}

.modal-container {
  position: relative;
  background: #ffffff;
  border-radius: 24px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  animation: modalScaleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalScaleIn {
  to { transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #030d24;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-close:hover {
  background: #0088ff;
  color: #ffffff;
  transform: scale(1.05);
}

.modal-content {
  overflow-y: auto;
  flex: 1;
}

.modal-hero {
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(255,255,255,0.2) 0%, transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,0.15) 0%, transparent 40%);
}

/* ============================================
   Video en cabecera del modal
   ============================================ */
.modal-hero-video {
  position: relative;
  width: 100%;
  background: #000000;
  overflow: hidden;
  line-height: 0;
}

.modal-hero-video video {
  width: 100%;
  height: auto;
  max-height: 60vh;
  display: block;
  background: #000000;
  outline: none;
}

/* Línea sutil de transición entre el video y el body del modal */
.modal-hero-video::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
              transparent,
              rgba(0, 136, 255, 0.4),
              transparent);
}

.modal-body {
  padding: 2.5rem;
}

.modal-stat {
  text-align: center;
  padding: 1rem 0.5rem;
  background: #f5f8fc;
  border-radius: 12px;
  border: 1px solid rgba(3, 13, 36, 0.05);
}

.tech-tag {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(0, 136, 255, 0.08);
  color: #0088ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(0, 136, 255, 0.2);
  font-family: 'JetBrains Mono', monospace;
}

.modal-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #25d366;
  color: #ffffff;
  font-weight: 700;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.modal-cta:hover {
  background: #1ea854;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.5);
}

@media (max-width: 640px) {
  .modal-hero { height: 180px; }
  .modal-body { padding: 1.5rem; }
  .modal-hero svg { width: 80px; height: 80px; }
  .modal-hero-video video { max-height: 45vh; }
}

/* ============================================
   Carrusel de Tecnologías (infinito)
   ============================================ */
.tech-marquee {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.tech-marquee-track {
  display: flex;
  gap: 1.5rem;
  width: max-content;
  animation: techMarquee 40s linear infinite;
  padding: 1rem 0;
}

.tech-marquee-reverse {
  animation: techMarqueeReverse 40s linear infinite;
}

@keyframes techMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes techMarqueeReverse {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* ============================================
   Logos circulares con tooltip en hover
   ============================================ */
.tech-logo-circle {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid rgba(3, 13, 36, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(3, 13, 36, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.tech-logo-circle img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.tech-logo-circle:hover {
  transform: translateY(-4px) scale(1.08);
  border-color: rgba(0, 136, 255, 0.4);
  box-shadow: 0 12px 28px rgba(0, 136, 255, 0.2);
  z-index: 10;
}

.tech-logo-circle:hover img {
  transform: scale(1.1);
}

/* Tooltip con el nombre */
.tech-logo-circle::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #030d24;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.02em;
}

.tech-logo-circle::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  border: 5px solid transparent;
  border-top-color: #030d24;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.tech-logo-circle:hover::after,
.tech-logo-circle:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Pausar al hover */
.tech-marquee:hover .tech-marquee-track {
  animation-play-state: paused;
}

@media (max-width: 640px) {
  .tech-logo-circle {
    width: 80px;
    height: 80px;
  }
  .tech-logo-circle img {
    width: 40px;
    height: 40px;
  }
}

/* ============================================
   Review cards (tipo Google Reviews)
   ============================================ */
.review-card {
  background: #ffffff;
  border: 1px solid rgba(3, 13, 36, 0.08);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(3, 13, 36, 0.04);
}

.review-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -8px rgba(3, 13, 36, 0.12);
  border-color: rgba(0, 136, 255, 0.2);
}

/* ============================================
   Botón WhatsApp flotante
   ============================================ */
.wa-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 60;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #25d366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -4px rgba(37, 211, 102, 0.5),
              0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s ease;
  text-decoration: none;
}

.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 32px -4px rgba(37, 211, 102, 0.7),
              0 4px 12px rgba(0,0,0,0.15);
}

.wa-float:active { transform: scale(0.95); }

.wa-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25d366;
  opacity: 0.5;
  animation: waPulse 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes waPulse {
  0%   { transform: scale(1);    opacity: 0.5; }
  70%  { transform: scale(1.7);  opacity: 0;   }
  100% { transform: scale(1.7);  opacity: 0;   }
}

.wa-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #030d24;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.wa-tooltip::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #030d24;
}

.wa-float:hover .wa-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 640px) {
  .wa-tooltip { display: none; }
  .wa-float {
    bottom: 1rem;
    right: 1rem;
    width: 58px;
    height: 58px;
  }
}

/* ============================================
   Reveal on scroll
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  h1.font-display {
    letter-spacing: 0;
  }
}

/* FAQ */
.faq-item .faq-header:hover .faq-header svg {
  transform: rotate(180deg);
}

.faq-item.open .faq-answer {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   Accesibilidad
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .wa-pulse { animation: none; }
  .tech-marquee-track { animation: none; }
}