/* ============================================
   MKEYZ SOUND HUB — DESIGN TOKENS v1.0
   Fuente única de verdad visual.
   Cambia un valor aquí → cambia todo el Hub.
   ============================================ */

/* Las fuentes se cargan desde index.html con <link preconnect> —
   un @import aquí bloquearía el primer render (descarga en serie). */

:root {
  /* ---------- PALETA NÚCLEO ---------- */
  --bg-void:        #030308;   /* fondo absoluto */
  --bg-deep:        #0a0a14;   /* capas elevadas */
  --bg-surface:     #10101e;   /* superficies sólidas */

  --mint:           #5ef2c4;   /* acción primaria / éxito */
  --purple:         #9d6bff;   /* identidad / navegación activa */
  --gold:           #f2c95e;   /* alertas suaves / destacados */
  --pink:           #ff6bd6;   /* acentos raros, usar con cuentagotas */
  --cyan:           #00eaff;   /* acento cyberpunk — toggles, foco activo */

  --text-hi:        #f0f0f8;   /* texto principal */
  --text-mid:       #9a9ab0;   /* texto secundario */
  --text-low:       #55556a;   /* labels, placeholders */

  --danger:         #ff5e7a;

  /* ---------- CRISTAL ----------
     Cristal OSCURO: sobre el fondo plexus, las tarjetas velan las líneas
     neón (se intuyen a través, no compiten con el contenido). */
  --glass-bg:       rgba(9, 9, 19, 0.62);
  --glass-bg-hover: rgba(18, 18, 34, 0.75);
  --glass-border:   rgba(255, 255, 255, 0.13);
  --glass-blur:     18px;
  --glass-blur-nav: 28px;

  /* ---------- GLOW (cyberpunk sutil) ---------- */
  --glow-mint:      0 0 24px rgba(94, 242, 196, 0.25);
  --glow-purple:    0 0 24px rgba(157, 107, 255, 0.25);
  --glow-gold:      0 0 20px rgba(242, 201, 94, 0.22);
  --glow-cyan:      0 0 22px rgba(0, 234, 255, 0.3);

  /* ---------- TIPOGRAFÍA ---------- */
  --font-display:   'Syne', sans-serif;       /* títulos, nav, números grandes */
  --font-mono:      'Space Mono', monospace;  /* datos, chips, metadatos */

  --fs-hero:        clamp(1.8rem, 4vw, 2.6rem);
  --fs-title:       1.25rem;
  --fs-body:        0.92rem;
  --fs-data:        0.8rem;
  --fs-micro:       0.68rem;

  /* ---------- ESPACIADO & FORMA ---------- */
  --sp-1: 0.35rem;
  --sp-2: 0.7rem;
  --sp-3: 1.1rem;
  --sp-4: 1.8rem;
  --sp-5: 2.8rem;

  --r-chip:   999px;
  --r-card:   18px;
  --r-panel:  24px;

  /* ---------- MOVIMIENTO ---------- */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast:     160ms var(--ease-out);
  --t-med:      320ms var(--ease-out);
  --t-view:     420ms var(--ease-out);
}

/* ---------- RESET MÍNIMO ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, transparent 1px, transparent 2px),
    var(--bg-void);
  color: var(--text-hi);
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Atmósfera: dos orbes de luz fijos detrás del cristal.
   Sin ellos, el glassmorphism no tiene nada que desenfocar. */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
}
body::before {
  width: 55vw; height: 55vw;
  top: -20vw; right: -15vw;
  background: radial-gradient(circle, rgba(157,107,255,0.16), transparent 70%);
}
body::after {
  width: 45vw; height: 45vw;
  bottom: -15vw; left: -10vw;
  background: radial-gradient(circle, rgba(94,242,196,0.10), transparent 70%);
}

/* Constelación plexus — líneas neón púrpura/mint detrás del cristal.
   SVG generativo inline (~2KB): pesa nada, escala a cualquier pantalla
   y usa la paleta exacta de los tokens. */
.bg-plexus {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.38; /* presente pero sin robar protagonismo al contenido */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900'%3E%3Cdefs%3E%3Cfilter id='b' x='-30%25' y='-30%25' width='160%25' height='160%25'%3E%3CfeGaussianBlur stdDeviation='2.4' result='bl'/%3E%3CfeMerge%3E%3CfeMergeNode in='bl'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg stroke='%239d6bff' fill='none' stroke-width='1.1' stroke-linecap='round' filter='url(%23b)'%3E%3Cpath d='M1180 120L1300 80L1370 180L1250 240Z M1180 120L1370 180 M1300 80L1250 240'/%3E%3Cpath d='M180 420L420 330L560 470L360 560Z M180 420L560 470 M420 330L360 560'/%3E%3Cpath d='M140 760L320 680L420 820L240 860Z M140 760L420 820'/%3E%3Cpath d='M-40 300C300 180 600 380 760 300' opacity='.45'/%3E%3Cpath d='M900 900C1050 760 1250 700 1500 740' opacity='.45'/%3E%3Cpath d='M560 470L1180 120' opacity='.35'/%3E%3C/g%3E%3Cg stroke='%235ef2c4' fill='none' stroke-width='1.1' stroke-linecap='round' filter='url(%23b)'%3E%3Cpath d='M700 480L830 400L960 520L820 600Z M700 480L960 520'/%3E%3Cpath d='M380 880L650 700L900 760 M650 700L560 470'/%3E%3Cpath d='M-50 560C300 470 700 590 920 450S1320 260 1500 320' opacity='.55'/%3E%3Cpath d='M420 330L830 400 M960 520L1250 240' opacity='.55'/%3E%3C/g%3E%3Cg fill='%23efeaff' filter='url(%23b)'%3E%3Ccircle cx='1180' cy='120' r='2.4'/%3E%3Ccircle cx='1300' cy='80' r='2'/%3E%3Ccircle cx='1370' cy='180' r='2.4'/%3E%3Ccircle cx='1250' cy='240' r='2'/%3E%3Ccircle cx='180' cy='420' r='2.6'/%3E%3Ccircle cx='420' cy='330' r='2'/%3E%3Ccircle cx='560' cy='470' r='2.4'/%3E%3Ccircle cx='360' cy='560' r='2'/%3E%3Ccircle cx='140' cy='760' r='2.4'/%3E%3Ccircle cx='320' cy='680' r='2'/%3E%3Ccircle cx='240' cy='860' r='2'/%3E%3C/g%3E%3Cg fill='%23bff7e4' filter='url(%23b)'%3E%3Ccircle cx='700' cy='480' r='2.6'/%3E%3Ccircle cx='830' cy='400' r='2'/%3E%3Ccircle cx='960' cy='520' r='2.4'/%3E%3Ccircle cx='820' cy='600' r='2'/%3E%3Ccircle cx='650' cy='700' r='2.4'/%3E%3Ccircle cx='900' cy='760' r='2'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

::selection { background: var(--purple); color: var(--bg-void); }

/* Accesibilidad: foco visible y respeto a reduced motion */
:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Móvil: blur más ligero — el backdrop-filter es lo más caro de pintar
   en GPUs de gama media; con el cristal oscuro apenas se nota la rebaja
   y el scroll gana fluidez. */
@media (max-width: 720px) {
  :root {
    --glass-blur: 10px;
    --glass-blur-nav: 16px;
  }
}
