/* ============================================================
   NOXIS — global.css
   Reset, variables, tipografía y utilidades base.
   ============================================================ */

:root {
  /* Paleta */
  --bg: #05060a;
  --bg-elev: #0b0d12;
  --bg-soft: #0f1218;
  --surface: #10141b;
  --surface-2: #171b23;

  --text: #f5f7fc;
  --text-dim: #98a1b0;
  --text-faint: #7b8494;

  --line: rgba(148, 163, 184, 0.10);
  --line-strong: rgba(148, 163, 184, 0.20);

  --accent: #3b82f6;
  --accent-soft: #6ea8ff;
  --accent-deep: #2f6fe0;
  --accent-glow: rgba(59, 130, 246, 0.32);
  --violet-soft: #a78bfa;

  /* Gradientes */
  --grad-brand: linear-gradient(135deg, #3b82f6 0%, #7c5cf5 100%);
  --grad-card: linear-gradient(
    180deg,
    rgba(5, 6, 10, 0) 38%,
    rgba(5, 6, 10, 0.42) 62%,
    rgba(4, 5, 8, 0.94) 100%
  );
  --grad-card-top: linear-gradient(180deg, rgba(5, 6, 10, 0.5) 0%, rgba(5, 6, 10, 0) 26%);
  --grad-hero: linear-gradient(92deg, #ffffff 0%, #cfe3ff 34%, #6ea8ff 62%, #a78bfa 100%);

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.42);
  --shadow-lift: 0 22px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.14);
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.38);

  /* Bordes / radios */
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Tipografía */
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.34s;

  --maxw: 1320px;
  --nav-h: 60px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Halos de fondo en una capa fija (compuesta, sin repintar al hacer scroll).
   Evita el costoso background-attachment: fixed sobre el body. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1100px 560px at 82% -8%, rgba(59, 130, 246, 0.09), transparent 62%),
    radial-gradient(820px 460px at -6% 12%, rgba(124, 92, 245, 0.06), transparent 58%),
    radial-gradient(700px 420px at 110% 60%, rgba(46, 111, 224, 0.05), transparent 60%);
  background-repeat: no-repeat;
}

/* ---------- Fondo dinámico: orbes flotantes ----------
   Capa fija global (visible en Inicio y Explorar), por detrás de todo
   el contenido. Los orbes los genera js/orbs.js: son idénticos entre sí
   (mismo tamaño, color y brillo, con el acento de la página) y solo
   cambian en posición y tempo. Solo se animan transform/opacity.
   El parallax usa las variables CSS de .orbs__layer para no interferir
   con la animación de cada orbe. */
.orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.orbs__layer {
  position: absolute;
  inset: 0;
  will-change: transform;
  transform: translate3d(var(--orbs-px, 0px), var(--orbs-py, 0px), 0);
  transition: transform 0.5s var(--ease);
}

/* Orbe base: idéntico para todos. Punto pequeño con núcleo claro y
   glow en el acento de la página. Sin filter: blur (el degradado ya
   difumina el borde → costo prácticamente cero). */
.orbs__orb {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, opacity;
  background: radial-gradient(
    circle at 50% 45%,
    #d4e3ff 0%,
    rgba(110, 168, 255, 0.85) 48%,
    transparent 74%
  );
  box-shadow: 0 0 10px 0 rgba(110, 168, 255, 0.55);
  animation: orb-float var(--orb-dur, 44s) linear infinite;
  animation-delay: var(--orb-delay, 0s);
}

@keyframes orb-float {
  0% {
    transform: translate3d(0, 20vh, 0);
    opacity: 0;
  }
  15% {
    opacity: 0.75;
  }
  50% {
    transform: translate3d(var(--orb-sway, 4vw), -28vh, 0);
  }
  85% {
    opacity: 0.75;
  }
  100% {
    transform: translate3d(0, -82vh, 0);
    opacity: 0;
  }
}

/* Menos orbes en pantallas chicas (batería). */
@media (max-width: 640px) {
  .orbs__orb:nth-child(n + 25) {
    display: none;
  }
}

/* Movimiento reducido: orbes estáticos y sin parallax. */
@media (prefers-reduced-motion: reduce) {
  .orbs__layer {
    transform: none;
    transition: none;
  }
  .orbs__orb {
    animation: none;
    opacity: 0.75;
  }
}

body.no-scroll {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* Foco de teclado visible y consistente en todos los interactivos.
   Los componentes que ya definen su propio anillo con box-shadow
   lo anulan (outline: none) de forma puntual. */
:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
  border-radius: inherit;
}

/* La caja del buscador ya comunica el foco con :focus-within. */
.nav__search input:focus-visible {
  outline: none;
}

::selection {
  background: var(--accent-glow);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

/* Contenedor */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

/* Utilidades */
.is-hidden {
  display: none !important;
}

.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;
}

/* Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Áreas táctiles cómodas (≥44px) en dispositivos de puntero grueso.
   Se prefija con `html` para ganar a las reglas de los componentes. */
@media (pointer: coarse) {
  html .nav__link { padding-top: 12px; padding-bottom: 12px; }
  html .brand { min-height: 44px; }
  html .nav__account-btn { width: 40px; height: 40px; }
  html .section-head__more { min-height: 44px; padding: 10px 14px; }
  html .search-suggest__item { min-height: 44px; padding: 9px; }
  html .filter-chip { min-height: 44px; padding: 9px 13px; }
  html .accordion__head { min-height: 44px; }
  html .tool-item { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  html .pagination__btn { min-width: 44px; height: 44px; }
  html .gallery__nav { width: 44px; height: 44px; }
  html .gallery__dots { gap: 12px; }
  html .gallery__dot { position: relative; width: 10px; height: 10px; }
  html .gallery__dot::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
  html .btn-primary,
  html .btn-secondary { min-height: 44px; }
  html .back-to-top { width: 48px; height: 48px; }
}