/* ============================================================
   NEXUS WISP — Design Tokens
   Paleta monocromática + Glassmorphism + Animaciones
   ============================================================ */

/* ── Dark theme ─────────────────────────────────────────── */
:root[data-theme="dark"] {
  color-scheme: dark;

  /* Canvas & mesh */
  --bg-canvas: #07080a;
  --bg-mesh-1: rgba(255, 255, 255, 0.055);
  --bg-mesh-2: rgba(255, 255, 255, 0.032);
  --bg-mesh-3: rgba(255, 255, 255, 0.025);

  /* Glass surfaces */
  --glass-surface:  rgba(16,  18,  23,  0.62);
  --glass-card:     rgba(22,  25,  32,  0.56);
  --glass-elevated: rgba(30,  34,  43,  0.64);
  --glass-input:    rgba(16,  18,  23,  0.36);
  --glass-modal:    rgba(14,  16,  21,  0.85);
  --glass-highlight:rgba(255,255,255,  0.08);

  /* Text */
  --text-main:      #f5f7fa;
  --text-primary:   #f5f7fa;
  --text-secondary: #c4c9d4;
  --text-muted:     #7d8594;

  /* Borders */
  --border-glass:   rgba(255,255,255, 0.14);
  --border-strong:  rgba(255,255,255, 0.32);
  --specular-top:   rgba(255,255,255, 0.18);

  /* Primary (monochrome) */
  --primary:        #f5f7fa;
  --primary-text:   #090a0d;
  --primary-hover:  #dce1ea;
  --primary-soft:   rgba(255,255,255, 0.12);

  /* Accent gradients */
  --accent-gradient: linear-gradient(135deg, #e2e8f4 0%, #94a3b8 100%);
  --accent-glow:     0 0 24px rgba(226,232,244, 0.18), 0 0 48px rgba(148,163,184, 0.10);

  /* Elevations */
  --elevation-card:
    0 20px 42px -12px rgba(0,0,0,0.85),
    0  6px 16px  -4px rgba(0,0,0,0.60),
    inset 0 1px 0 rgba(255,255,255,0.15);
  --elevation-card-hover:
    0 28px 54px -12px rgba(0,0,0,0.92),
    0 10px 22px  -4px rgba(0,0,0,0.68),
    inset 0 1px 0 rgba(255,255,255,0.26);
  --elevation-modal:
    0 32px 68px -12px rgba(0,0,0,0.92),
    inset 0 1px 0 rgba(255,255,255,0.24);
}

/* ── Light theme ─────────────────────────────────────────── */
:root[data-theme="light"] {
  color-scheme: light;

  --bg-canvas: #eceff4;
  --bg-mesh-1: rgba(255,255,255, 0.85);
  --bg-mesh-2: rgba(15, 23, 42,  0.05);
  --bg-mesh-3: rgba(255,255,255, 0.65);

  --glass-surface:  rgba(255,255,255, 0.64);
  --glass-card:     rgba(255,255,255, 0.58);
  --glass-elevated: rgba(244,246,249, 0.72);
  --glass-input:    rgba(255,255,255, 0.44);
  --glass-modal:    rgba(255,255,255, 0.92);
  --glass-highlight:rgba(15, 23, 42,  0.06);

  --text-main:      #0c0f14;
  --text-primary:   #0c0f14;
  --text-secondary: #374151;
  --text-muted:     #6b7280;

  --border-glass:  rgba(15,23,42, 0.14);
  --border-strong: rgba(15,23,42, 0.34);
  --specular-top:  rgba(255,255,255, 0.90);

  --primary:       #0f172a;
  --primary-text:  #ffffff;
  --primary-hover: #1e293b;
  --primary-soft:  rgba(15,23,42, 0.08);

  --accent-gradient: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  --accent-glow:     0 0 24px rgba(15,23,42, 0.12), 0 0 48px rgba(51,65,85, 0.08);

  --elevation-card:
    0 18px 36px -12px rgba(15,23,42,0.16),
    0  4px 12px  -2px rgba(15,23,42,0.08),
    inset 0 1px 0 rgba(255,255,255,0.85);
  --elevation-card-hover:
    0 26px 48px -12px rgba(15,23,42,0.24),
    0  8px 18px  -4px rgba(15,23,42,0.12),
    inset 0 1px 0 rgba(255,255,255,0.95);
  --elevation-modal:
    0 30px 64px -12px rgba(15,23,42,0.28),
    inset 0 1px 0 rgba(255,255,255,0.90);
}

/* ── Global tokens (theme-agnostic) ────────────────────── */
:root {
  /* Border radius */
  --radius-sm:   3px;
  --radius-md:   5px;
  --radius-lg:   8px;
  --radius-xl:   10px;
  --radius-full: 9999px;

  /* Blur */
  --blur-sm:  8px;
  --blur-md:  16px;
  --blur-lg:  24px;
  --blur-xl:  36px;

  /* Easing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:    cubic-bezier(0.0,  0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4,  0, 0.2, 1);

  /* Durations */
  --duration-fast:   120ms;
  --duration-normal: 220ms;
  --duration-slow:   400ms;
}

/* ── Reset ──────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── Body ───────────────────────────────────────────────── */
body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(circle at 14% 16%, var(--bg-mesh-1) 0%, transparent 42%),
    radial-gradient(circle at 86% 20%, var(--bg-mesh-2) 0%, transparent 40%),
    radial-gradient(circle at 50% 88%, var(--bg-mesh-3) 0%, transparent 46%);
  background-size: 175% 175%;
  background-attachment: fixed;
  animation: meshDrift 20s ease-in-out infinite alternate;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}

/* ── Typography helpers ─────────────────────────────────── */
.hidden { display: none !important; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.022em; color: var(--text-main); }
code, pre, .mono { font-family: "JetBrains Mono", Consolas, monospace; font-variant-numeric: tabular-nums; }

/* ── SVG icons ──────────────────────────────────────────── */
.svg-icon {
  width: 15px; height: 15px; stroke: currentColor; stroke-width: 2;
  stroke-linecap: square; stroke-linejoin: miter; fill: none;
  flex-shrink: 0; vertical-align: middle;
}
.svg-icon-sm { width: 13px; height: 13px; }

/* ── Animate-in utility ─────────────────────────────────── */
.animate-in {
  animation: fadeInUp var(--duration-slow) var(--ease-spring) both;
}

/* ── Keyframes ──────────────────────────────────────────── */
@keyframes meshDrift {
  0%   { background-position: 0%  0%,  100% 10%, 40%  100%; }
  50%  { background-position: 85% 40%,  15% 80%, 70%   20%; }
  100% { background-position: 25% 90%,  90% 25%, 10%   55%; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0);    }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.90); }
  to   { opacity: 1; transform: scale(1);    }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-6px); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: var(--elevation-card); }
  50%       { box-shadow: var(--elevation-card-hover), var(--accent-glow); }
}

@keyframes ripple {
  from { opacity: 0.4; transform: scale(0); }
  to   { opacity: 0;   transform: scale(2.5); }
}

@keyframes spin-anim { to { transform: rotate(360deg); } }

@keyframes pulse-mono {
  0%   { box-shadow: 0 0 0 0   rgba(255,255,255,0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(255,255,255,0);    }
  100% { box-shadow: 0 0 0 0   rgba(255,255,255,0);    }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
