/* ==========================================================================
   Design tokens — Personal OS
   Los valores de acento se sobreescriben en runtime desde Settings (settings.service.js)
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-var.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Superficies — tema "carbon" (default) */
  --background: #09090b;
  --background-glow-1: rgba(124, 58, 237, 0.16);
  --background-glow-2: rgba(154, 236, 63, 0.05);
  --surface: #111113;
  --surface-2: #151518;
  --surface-elevated: #1b1b20;
  --surface-hover: #202026;
  --overlay: rgba(4, 4, 6, 0.72);

  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --grid-line: rgba(255, 255, 255, 0.035);
  --dot: rgba(255, 255, 255, 0.085);

  /* Texto */
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-disabled: #52525b;

  /* Acentos */
  --accent: #9aec3f;
  --accent-contrast: #0a0f03;
  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 40%, transparent);
  --accent-2: #a78bfa;
  --accent-2-soft: color-mix(in oklab, var(--accent-2) 16%, transparent);
  --accent-2-line: color-mix(in oklab, var(--accent-2) 45%, transparent);

  /* Estados */
  --success: var(--accent);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --info: #7dd3fc;

  /* Heatmap */
  --heat-empty: rgba(255, 255, 255, 0.045);
  --heat-miss: rgba(255, 255, 255, 0.075);
  --heat-1: color-mix(in oklab, var(--heat-color, var(--accent)) 45%, #16161a);
  --heat-2: var(--heat-color, var(--accent));

  /* Tipografía */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --text-2xs: 0.6875rem; /* 11 */
  --text-xs: 0.75rem;    /* 12 */
  --text-sm: 0.8125rem;  /* 13 */
  --text-base: 0.9375rem;/* 15 */
  --text-md: 1.0625rem;  /* 17 */
  --text-lg: 1.375rem;   /* 22 */
  --text-xl: 1.875rem;   /* 30 */
  --text-2xl: 2.5rem;    /* 40 */
  --text-3xl: clamp(2.5rem, 7vw, 3.75rem);

  /* Espaciado */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;

  /* Formas */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  /* Efectos (intensidad controlada por data-effects) */
  --glow-strength: 1;
  --shadow-pop: 0 18px 48px -12px rgba(0, 0, 0, 0.6);
  --focus-ring: 0 0 0 2px var(--background), 0 0 0 4px var(--accent);

  /* Movimiento */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur: 220ms;
  --dur-slow: 600ms;

  /* Layout */
  --sidebar-w: 248px;
  --rail-w: 76px;
  --topbar-h: 60px;
  --bottomnav-h: 64px;
  --content-max: 1360px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Temas ---- */
:root[data-theme='deep'] {
  --background: #0a0812;
  --background-glow-1: rgba(139, 92, 246, 0.24);
  --background-glow-2: rgba(154, 236, 63, 0.06);
  --surface: #110e1a;
  --surface-2: #151220;
  --surface-elevated: #1c1829;
  --surface-hover: #221d31;
  --border: rgba(196, 181, 253, 0.09);
  --border-strong: rgba(196, 181, 253, 0.17);
  --dot: rgba(196, 181, 253, 0.1);
}

:root[data-theme='oled'] {
  --background: #000000;
  --background-glow-1: rgba(124, 58, 237, 0.1);
  --background-glow-2: rgba(154, 236, 63, 0.03);
  --surface: #0a0a0b;
  --surface-2: #0e0e10;
  --surface-elevated: #141417;
  --surface-hover: #19191d;
  --dot: rgba(255, 255, 255, 0.07);
}

/* ---- Intensidad de efectos ---- */
:root[data-effects='0'] {
  --glow-strength: 0;
  --dot: transparent;
  --background-glow-1: transparent;
  --background-glow-2: transparent;
}
:root[data-effects='2'] {
  --glow-strength: 1.8;
  --dot: rgba(255, 255, 255, 0.11);
  --background-glow-1: rgba(139, 92, 246, 0.26);
  --background-glow-2: rgba(154, 236, 63, 0.09);
}

/* ---- Movimiento reducido ---- */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion='on']) {
    --dur-fast: 0ms;
    --dur: 0ms;
    --dur-slow: 0ms;
  }
}
:root[data-motion='off'] {
  --dur-fast: 0ms;
  --dur: 0ms;
  --dur-slow: 0ms;
}
