/* =========================================================================
 * DA · Capa UX (da-ux.css)
 * --------------------------------------------------------------------------
 * Se enlaza al final del <head> en todas las páginas (tools/inject-ux.js).
 * Aplica, sobre las utilidades de Tailwind CDN, las reglas de las skills
 * de UX: tipografía (≤3 pesos, nada bajo 12px), paleta (sombras suaves,
 * sin brillos de neón), anti-slop (sin vidrio esmerilado ni texto arcoíris)
 * y movimiento (sólo transform/opacity, respeta reduced-motion).
 *
 * Especificidad: "html .clase" (0,1,1) gana a la utilidad del CDN (0,1,0)
 * sin depender de que el CDN inyecte su <style> después de este archivo.
 * Las variantes responsivas (sm:, md:) sólo suben a 12px, nunca bajan.
 * ========================================================================= */

/* -------------------------------------------------------------------------
 * 1 · TIPOGRAFÍA
 * ------------------------------------------------------------------------- */

/* Pesos: 400 / 500 / 600. El 700 (font-bold) pasa a 600: la jerarquía la
 * da el tamaño, no el grosor. */
html .font-bold,
html .font-extrabold,
html .font-black,
html b,
html strong {
  font-weight: 600;
}

/* Tamaño mínimo 12px (meta). Las etiquetas mono de 9–11px eran ilegibles
 * en móvil. */
html .text-\[9px\],
html .text-\[10px\],
html .text-\[11px\] {
  font-size: 0.75rem;
  line-height: 1.4;
}

/* Interlineado: títulos 1.1–1.25, cuerpo 1.5–1.6. */
html h1,
html h2,
html h3 {
  text-wrap: balance;               /* evita palabras huérfanas ("y") */
}

html h1.leading-none,
html h2.leading-none,
html h3.leading-none,
html h1.leading-tight,
html h2.leading-tight {
  line-height: 1.15;
}

html p {
  text-wrap: pretty;
}

/* Las etiquetas en mayúsculas con tracking muy abierto se leen peor;
 * se moderan sin perder el carácter técnico. */
html .tracking-widest { letter-spacing: 0.12em; }
html .tracking-\[0\.2em\],
html .tracking-\[0\.25em\],
html .tracking-\[0\.3em\] { letter-spacing: 0.12em; }

/* -------------------------------------------------------------------------
 * 2 · COLOR Y ELEVACIÓN
 * ------------------------------------------------------------------------- */

/* Texto con degradado multicolor (sky → teal → emerald): un solo acento. */
html .bg-clip-text.text-transparent {
  background-image: none;
  -webkit-text-fill-color: currentColor;
  color: rgb(var(--da-secondary));
}

/* Sombras: difusas y con alfa bajo. shadow-2xl/xl de Tailwind llegan a
 * 0.25 de alfa; se reemplazan por borde + sombra suave. */
html .shadow-2xl {
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 16px 32px -16px rgb(15 23 42 / 0.12);
}
html .shadow-xl {
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 12px 24px -12px rgb(15 23 42 / 0.10);
}
html .shadow-lg {
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 16px -8px rgb(15 23 42 / 0.08);
}

html .hover\:shadow-2xl:hover,
html .hover\:shadow-xl:hover,
html .group:hover .group-hover\:shadow-xl {
  box-shadow: 0 2px 4px rgb(15 23 42 / 0.04), 0 12px 24px -12px rgb(15 23 42 / 0.07);
}

/* Brillos de neón arbitrarios (shadow-[0_0_20px_rgba(...)]): fuera. */
html [class*="shadow-[0_0_"] {
  box-shadow: none;
}

/* Sombras de color (shadow-primary/30, shadow-cyan-500/20…): sin halo. */
html [class*="shadow-primary/"],
html [class*="shadow-blue-"],
html [class*="shadow-cyan-"],
html [class*="shadow-sky-"],
html [class*="shadow-emerald-"] {
  --tw-shadow-color: rgb(15 23 42 / 0.08);
  --tw-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

/* Vidrio esmerilado: los paneles quedan opacos o translúcidos sin blur.
 * El encabezado y el mega menú ya son opacos (da-temas.css). */
html [class*="backdrop-blur"] {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Manchas decorativas desenfocadas (blobs blur-3xl): decoración pura. */
html .blur-3xl.pointer-events-none,
html .blur-3xl[aria-hidden="true"],
html .absolute.rounded-full.blur-3xl {
  display: none;
}

/* -------------------------------------------------------------------------
 * 3 · MOVIMIENTO
 * Hover de tarjetas: desplazamiento de 2px como máximo; nada de escalar.
 * ------------------------------------------------------------------------- */
html .hover\:scale-105:hover,
html .hover\:scale-110:hover,
html .group:hover .group-hover\:scale-105,
html .group:hover .group-hover\:scale-110 {
  --tw-scale-x: 1;
  --tw-scale-y: 1;
}

html .hover\:-translate-y-1:hover,
html .hover\:-translate-y-2:hover {
  --tw-translate-y: -2px;
}

/* Puntos de "en vivo": un pulso suave y lento en lugar de ping/bounce. */
html .animate-ping,
html .animate-bounce {
  animation: da-ux-breathe 2.4s ease-in-out infinite;
}

@keyframes da-ux-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* AOS: las entradas sólo se desvanecen (sin flip/zoom/slide). Antes, en
 * páginas como la licencia, el documento entraba con data-aos="flip-left". */
html [data-aos^="flip"],
html [data-aos^="zoom"],
html [data-aos^="slide"] {
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* Estado final inmediato: AOS, entradas, cinta de logos. */
  html [data-aos] {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  html .animate-ticker,
  html .animate-entrance {
    animation: none !important;
    opacity: 1 !important;
  }
  html *,
  html *::before,
  html *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html .animate-ping,
  html .animate-bounce,
  html .animate-pulse,
  html .animate-spin:not([role="status"]) {
    animation: none !important;
  }

  html [class*="hover:-translate-y"]:hover,
  html [class*="hover:scale"]:hover {
    --tw-translate-y: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
  }
}

/* -------------------------------------------------------------------------
 * 4 · INTERACCIÓN Y ACCESIBILIDAD
 * ------------------------------------------------------------------------- */

/* Barras de desplazamiento visibles: ocultarlas quita la pista de que
 * hay más contenido (algunas páginas usaban ::-webkit-scrollbar {display:none}). */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: block;
  width: 10px;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: rgb(var(--da-slate-400) / 0.6);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
html::-webkit-scrollbar-track { background: transparent; }

/* Áreas táctiles: los enlaces-botón y botones de icono, mínimo 44px en
 * pantallas táctiles. */
@media (pointer: coarse) {
  html button:not(.da-temas__btn),
  html a.inline-flex[class*="px-"] {
    min-height: 44px;
  }
}

/* Anillo de foco visible en todo elemento interactivo (teclado). */
html :focus-visible {
  outline: 2px solid rgb(var(--da-primary));
  outline-offset: 2px;
}

/* Anillo de foco visible también sobre fondos oscuros. */
html .bg-slate-900 :focus-visible,
html .bg-slate-950 :focus-visible,
html .gem-hero-bg :focus-visible,
html footer :focus-visible {
  outline-color: rgb(var(--da-secondary));
}

/* Respeta el borde de la tarjeta al recibir foco dentro (enlaces de tarjeta). */
html a:focus-visible > .rounded-xl,
html a:focus-visible.rounded-xl {
  outline-offset: 3px;
}

@media (min-width: 1024px) and (max-width: 1279px), (min-width: 1536px) {
  header nav[aria-label="Navegación principal"] {
    gap: 0;
  }

  header nav[aria-label="Navegación principal"] > a,
  header nav[aria-label="Navegación principal"] > button {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  header nav[aria-label="Navegación principal"] > a[class*="bg-primary"] {
    margin-left: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}
