/* =========================================================================
   Tokens de diseño
   - Paleta base: azul noche + degradado violeta → magenta (identidad del cliente).
   - Cada modo de visión redefine SOLO variables; los componentes no cambian.
   - Contrastes revisados para AA (texto normal ≥ 4.5:1 sobre --bg y --surface).
   ========================================================================= */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url('../assets/fonts/nunito-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../assets/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
}

:root {
  /* Tipografía */
  --font-display: 'Nunito', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text-scale: 1;

  --fs-xs: 0.75rem;    /* 12 */
  --fs-sm: 0.8125rem;  /* 13 */
  --fs-md: 0.9375rem;  /* 15 */
  --fs-lg: 1.0625rem;  /* 17 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.75rem;   /* 28 */
  --fs-3xl: 2.25rem;   /* 36 */

  /* Espaciado (múltiplos de 4) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --gutter: 20px;

  /* Radios: muy redondeados, como en las infografías */
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --r-2xl: 34px; --r-pill: 999px;

  /* Movimiento */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 160ms; --dur: 280ms; --dur-slow: 420ms;

  /* Alturas de sistema */
  --statusbar-h: 0px;
  --nav-h: 68px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* ---------- Paleta: visión estándar ---------- */
  --bg: #120A2A;
  --bg-elev: #180F36;
  --surface: #211548;
  --surface-2: #2B1D5C;
  --surface-3: #372770;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);

  --text: #FFFFFF;
  --text-2: #D4CAF0;   /* 12.6:1 sobre --bg */
  --text-3: #A99CD3;   /* 7.1:1 sobre --bg, 5.9:1 sobre --surface */
  --text-on-accent: #FFFFFF;

  --brand-1: #7C3AED;
  --brand-2: #C026D3;
  --brand-3: #DB2777;
  --brand-glow: #FF4FA0;
  --accent-text: #F9A8D4;  /* rosa claro legible sobre fondo oscuro (9:1) */
  --grad: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-3) 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, .28), rgba(219, 39, 119, .22));
  --grad-text: linear-gradient(90deg, #C084FC 0%, #F472B6 60%, #FB7185 100%);

  --like: #16A34A;
  --like-soft: rgba(22, 163, 74, .18);
  --pass: #E11D48;
  --pass-soft: rgba(225, 29, 72, .18);
  --chat: #7C3AED;
  --chat-soft: rgba(124, 58, 237, .22);

  --verified: #3B82F6;
  --online: #22C55E;
  --warning: #F59E0B;
  --danger: #F43F5E;
  --danger-text: #FDA4AF;
  --success-text: #86EFAC;

  --focus: #FDE68A;

  --shadow-sm: 0 2px 8px rgba(5, 2, 20, .35);
  --shadow-md: 0 10px 30px rgba(5, 2, 20, .45);
  --shadow-lg: 0 24px 60px rgba(5, 2, 20, .6);
  --shadow-glow: 0 10px 34px rgba(219, 39, 119, .38);
  --scrim: rgba(8, 4, 22, .62);

  color-scheme: dark;
}

/* ---------- Protanopia y deuteranopia (rojo-verde): azul / naranja ---------- */
html[data-vision="protan"] {
  --brand-1: #4F46E5;
  --brand-2: #6D28D9;
  --brand-3: #2563EB;
  --brand-glow: #60A5FA;
  --accent-text: #FCD34D;
  --grad-text: linear-gradient(90deg, #93C5FD 0%, #A5B4FC 60%, #FCD34D 100%);
  --grad-soft: linear-gradient(135deg, rgba(79, 70, 229, .3), rgba(37, 99, 235, .22));
  --shadow-glow: 0 10px 34px rgba(37, 99, 235, .38);

  --like: #2563EB;   --like-soft: rgba(37, 99, 235, .2);
  --pass: #C2410C;   --pass-soft: rgba(234, 88, 12, .2);
  --chat: #7C3AED;   --chat-soft: rgba(124, 58, 237, .22);
  --verified: #38BDF8;
  --online: #FBBF24;
  --danger: #EA580C;
  --danger-text: #FDBA74;
  --success-text: #93C5FD;
}

/* ---------- Tritanopia (azul-amarillo): turquesa / rojo / magenta ---------- */
html[data-vision="tritan"] {
  --brand-1: #BE185D;
  --brand-2: #DB2777;
  --brand-3: #DC2626;
  --brand-glow: #FB7185;
  --accent-text: #FDA4AF;
  --grad-text: linear-gradient(90deg, #F9A8D4 0%, #FDA4AF 60%, #5EEAD4 100%);
  --grad-soft: linear-gradient(135deg, rgba(190, 24, 93, .28), rgba(220, 38, 38, .2));
  --shadow-glow: 0 10px 34px rgba(220, 38, 38, .35);

  --like: #0F766E;   --like-soft: rgba(13, 148, 136, .22);
  --pass: #DC2626;   --pass-soft: rgba(220, 38, 38, .2);
  --chat: #A21CAF;   --chat-soft: rgba(162, 28, 175, .22);
  --verified: #14B8A6;
  --online: #2DD4BF;
  --danger: #EF4444;
  --success-text: #5EEAD4;
}

/* ---------- Monocromático: solo luminancia, forma e icono ---------- */
html[data-vision="mono"] {
  --bg: #111113;
  --bg-elev: #18181B;
  --surface: #1F1F23;
  --surface-2: #2A2A2F;
  --surface-3: #3A3A40;
  --text-2: #D4D4D8;
  --text-3: #A1A1AA;
  --brand-1: #52525B;
  --brand-2: #3F3F46;
  --brand-3: #27272A;
  --brand-glow: #A1A1AA;
  --accent-text: #E4E4E7;
  --grad: linear-gradient(135deg, #5B5B64 0%, #3F3F46 55%, #2E2E33 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .05));
  --grad-text: linear-gradient(90deg, #FAFAFA, #D4D4D8);
  --shadow-glow: 0 10px 30px rgba(0, 0, 0, .5);

  --like: #F4F4F5;   --like-soft: rgba(255, 255, 255, .14);
  --pass: #3F3F46;   --pass-soft: rgba(255, 255, 255, .08);
  --chat: #71717A;   --chat-soft: rgba(255, 255, 255, .1);
  --verified: #E4E4E7;
  --online: #E4E4E7;
  --danger: #A1A1AA;
  --danger-text: #E4E4E7;
  --success-text: #E4E4E7;
  --focus: #FFFFFF;
}
/* En monocromático el icono de "Me gusta" va oscuro sobre fondo claro */
html[data-vision="mono"] { --like-ink: #18181B; --verified-ink: #18181B; }
:root { --like-ink: #FFFFFF; --verified-ink: #FFFFFF; }

/* ---------- Alto contraste (combinable con cualquier modo) ---------- */
html[data-contrast="alto"] {
  --bg: #07030F;
  --bg-elev: #0B0618;
  --surface: #140C2C;
  --surface-2: #1D1340;
  --text-2: #FFFFFF;
  --text-3: #ECE6FF;
  --line: rgba(255, 255, 255, .34);
  --line-strong: rgba(255, 255, 255, .7);
  --scrim: rgba(0, 0, 0, .8);
}
html[data-contrast="alto"][data-vision="mono"] { --bg: #000; --surface: #0E0E10; --surface-2: #1A1A1D; }
