/* Base global: reglas del design system + reglas globales del prototipo. */
* { box-sizing: border-box; }
html { background: var(--bg-base); }
body { margin: 0; background: var(--bg-base); color: var(--text-body); font-family: var(--font-body); text-wrap: pretty; overflow-x: clip; } /* clip, no hidden: ningún ancestro de las tarjetas sticky debe ser contenedor de scroll */
h1, h2, h3, h4 { font-family: var(--font-body); color: var(--text-heading); margin: 0; text-wrap: balance; }
h5, h6 { font-family: var(--font-body); }
p { margin: 0; line-height: var(--lh-body); }
a { color: var(--accent-primary); text-decoration: none; }
a:hover { color: #A8F3D0; }
::selection { background: var(--accent-primary); color: var(--nv-black); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
img { max-width: 100%; }

.nv-root { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-base); color: var(--text-body); font-family: var(--font-body); }
.nv-root main { font-family: var(--font-body); }
.nv-root *:not(a):not(button):not(input):not(textarea):not(select):not(label) { cursor: default; }

.nv-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Botón (Button del design system) ---------- */
.nv-btn {
  font-family: var(--font-body); font-weight: var(--weight-semibold); font-size: var(--nv-fs-btn);
  border: none; border-radius: var(--radius-full); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: var(--btn-pad-y) var(--btn-pad-x); line-height: 1; text-decoration: none; text-align: center;
  transition: filter var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.nv-btn:hover { filter: brightness(1.1); }
.nv-btn:active { transform: scale(0.97); }
.nv-btn--primary { background: var(--accent-primary); color: var(--text-on-accent); }
.nv-btn--primary:hover { background: #A8F3D0; color: #060a09; }
.nv-btn--secondary {
  background: transparent; color: var(--text-heading);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: inset 0 0 0 1px #73B3E6;
}
.nv-btn--secondary:hover { box-shadow: inset 0 0 0 1px #A8F3D0; color: #A8F3D0; }

/* ---------- Liquid glass (botones/píldoras translúcidas) ---------- */
.nv-lg-btn { position: relative; overflow: hidden; background: rgba(250,252,251,0.01); background-blend-mode: luminosity; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: inset 0 1px 1px rgba(250,252,251,0.1); transition: color 200ms cubic-bezier(.2,.8,.2,1), transform 150ms cubic-bezier(.2,.8,.2,1); }
.nv-lg-btn::before,
.nv-glass-edge::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.4px; background: linear-gradient(180deg, rgba(250,252,251,0.45) 0%, rgba(250,252,251,0.15) 20%, rgba(250,252,251,0) 40%, rgba(250,252,251,0) 60%, rgba(250,252,251,0.15) 80%, rgba(250,252,251,0.45) 100%); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.nv-root a.nv-lg-btn:hover { color: #A8F3D0; }
.nv-lg-btn:active { transform: scale(0.97); }

/* ---------- Etiqueta (Badge del design system) ---------- */
.nv-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-weight: 500; font-size: var(--nv-fs-label); line-height: 1.2;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-heading);
  border: 1px solid #293155; border-radius: var(--radius-full); padding: 7px 16px;
}

/* ---------- Títulos de sección ---------- */
@media (min-width: 1150px) { main h2 { font-size: clamp(22px, 1.75vw, 24px) !important; } }

/* ---------- Animaciones ---------- */
@keyframes nv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nv-fade-in-go { from { opacity: 0; } to { opacity: 1; } }
.nv-fade-in { animation: nv-fade-in 2600ms cubic-bezier(.33,0,.2,1) 3300ms both; }
.nv-fade-in.nv-fade-go { animation: nv-fade-in-go 2600ms cubic-bezier(.33,0,.2,1) 500ms both; }

@keyframes nv-marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes nv-marquee-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.nv-marquee-left { animation: nv-marquee-left 26s linear infinite; }
.nv-marquee-right { animation: nv-marquee-right 30s linear infinite; }

/* Aparición por grupos en móvil (ver assets/js/motion.js) */
@media (max-width: 899px) {
  .nv-rv { transition: opacity 1200ms cubic-bezier(.4,0,.2,1) !important; }
  .nv-rv:not(.nv-rv-in) { opacity: 0 !important; }
  .nv-rv.nv-rv-in { opacity: 1 !important; }
  .nv-rv.nv-rv-ov { opacity: 1 !important; }
  /* Interva ERP, "Qué es" y "Módulos": el fundido lo avanza el script cuadro por cuadro (reveal.ts). */
  .nv-qe .nv-rv, .nv-mod .nv-rv { transition: none !important; }
  .nv-rv-rel { position: relative; }
  .nv-rv-ov::after { content: ''; position: absolute; inset: -2px; background: var(--nv-rv-bg, #060a09); opacity: 1; transition: opacity 1200ms cubic-bezier(.4,0,.2,1); pointer-events: none; z-index: 60; }
  .nv-rv-ov.nv-rv-in::after { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .nv-fade-in, .nv-fade-in.nv-fade-go { animation: none; opacity: 1; }
  .nv-marquee-left, .nv-marquee-right { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
