/* ============================================================
   IQDOTNET — Design System Core
   Archivo: custom.css
   Autor: Nelson Guajardo
   Versión: v1.6 (PROD SAFE · LINE-PRESERVING)
   ------------------------------------------------------------
   Propósito:
   - Unificar comportamiento visual de todas las secciones
   - Mantener identidad IQDOTNET (claridad, profundidad, control)
   - Evitar efectos frágiles o dependientes del hover accidental
   ------------------------------------------------------------
   Política:
   - ❌ No eliminar reglas existentes
   - ❌ No compactar por estética
   - ✅ Priorizar legibilidad y estabilidad
============================================================ */

/* ============================================================
   IQDOTNET — Title System v1.4 (STABLE · PROD)
============================================================ */

.iq-title {
  position: relative;
  display: inline-block;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  padding-left: 16px;
}

.iq-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 4px;
  height: 1.25em;
  background: #ffd400;
  border-radius: 9999px;
}

.iq-title span {
  color: #ffd400;
}

@media (min-width: 768px) {
  .iq-title {
    padding-left: 18px;
  }
  .iq-title::before {
    width: 5px;
    height: 1.3em;
  }
}

/* ============================================================
   GLOBAL — Motion Safety (Accessibility)
============================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ============================================================
   CARD BASE — Shared Mental Model
============================================================ */

:where(
  .problema-card,
  .solucion-card,
  .caso-card,
  .tech-card,
  #proceso .step-card
) {
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    background-color 0.35s ease;
}

/* ============================================================
   VIEWPORT ENTRY — Unified (JS controlled)
   ------------------------------------------------------------
   ⚠️ Nota:
   No usamos `transition: all` para evitar
   efectos colaterales en futuras propiedades
============================================================ */

:where(
  .problema-card,
  .solucion-card,
  .caso-card,
  .tech-card,
  #proceso .step-card
).in-view {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

/* ============================================================
   HOVER EFFECT — Individual Card Only
============================================================ */

:where(
  .problema-card,
  .solucion-card,
  .caso-card,
  .tech-card,
  #proceso .step-card
):hover {
  border-color: rgba(255, 212, 0, 0.45);
  box-shadow:
    0 0 0 1px rgba(255, 212, 0, 0.15),
    0 22px 42px rgba(0, 0, 0, 0.45);
  background-color: rgba(255, 255, 255, 0.04);
  transform: translateY(-4px);
}

/* ============================================================
   GLOW LATERAL — Semántico
============================================================ */

:where(
  .problema-card,
  .solucion-card,
  .caso-card,
  .tech-card,
  #proceso .step-card
)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(255, 212, 0, 0.12),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

:where(
  .problema-card,
  .solucion-card,
  .caso-card,
  .tech-card,
  #proceso .step-card
):hover::before {
  opacity: 1;
}

/* ============================================================
   CONTACTO — CTA SAFE
============================================================ */

#contacto .contact-card {
  opacity: 1 !important;
  transform: none !important;
}

/* ============================================================
   NAV — Shrink (FAIL-SAFE)
============================================================ */

#iq-nav {
  transform: translateZ(0);
}

#iq-nav.nav-shrink img {
  height: 32px;
  width: 32px;
}

/* ============================================================
   FOOTER — Icon System
============================================================ */

.footer-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.footer-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ============================================================
   IQDOTNET — PROCESO (RESTORE ORIGINALITY · DEFINITIVO)
============================================================ */

#proceso .step-card {
  isolation: isolate;
  background-color: rgba(18, 18, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

#proceso .step-number {
  position: absolute;
  top: -12px;
  right: -8px;
  font-size: 96px;
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* ============================================================
   IQDOTNET — UX STABILITY PATCH (CRÍTICO)
   ------------------------------------------------------------
   ⚠️ EXCEPCIÓN CONTROLADA:
   Estas secciones NO dependen de opacity JS
   para evitar layout shift crítico
============================================================ */

#problemas,
#soluciones,
#casos,
#tecnologia,
#proceso {
  isolation: isolate;
}

#problemas .problema-card,
#soluciones .solucion-card,
#casos .caso-card,
#tecnologia .tech-card,
#proceso .step-card {
  opacity: 1;
}

/* ============================================================
   IQDOTNET — NAV ACTIVE STATE
============================================================ */

.iq-nav-link {
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s ease;
}

.iq-nav-link.nav-active {
  color: #ffd400;
}

.iq-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: #ffd400;
  border-radius: 9999px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.iq-nav-link.nav-active::after {
  transform: scaleX(1);
}

/* ============================================================
   TRUST LOGOS
============================================================ */

.trust-logo {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.trust-logo.in-view {
  opacity: 1;
  transform: none;
}
