/* ==========================================================================
   CYBROTRIX DESIGN TOKENS
   Single source of truth for color, type, space, radius, shadow and motion.
   Dark is the brand default. Light is an explicit opt-in via [data-theme="light"].
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg-0: #07090f;
  --bg-1: #0b0f17;
  --bg-2: #10151f;
  --bg-3: #161c28;
  --bg-4: #1c2432;
  --bg-elev: rgba(16, 21, 31, 0.86);

  /* Lines */
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line-accent: rgba(79, 140, 255, 0.38);

  /* Text */
  --fg-0: #f4f6fa;
  --fg-1: #c2c9d6;
  --fg-2: #8c97a8;
  --fg-3: #5f6b7c;
  --fg-inverse: #07090f;

  /* Brand accent: Cybrotrix blue */
  --accent: #4f8cff;
  --accent-600: #2f6bff;
  --accent-700: #1f55e0;
  --accent-soft: rgba(79, 140, 255, 0.12);
  --accent-glow: rgba(79, 140, 255, 0.28);
  --accent-fg: #ffffff;

  /* Secondary accent: signal teal (data, intelligence) */
  --teal: #38d6d0;
  --teal-soft: rgba(56, 214, 208, 0.12);

  /* Product accent: SourceFoundry ember (used only on SourceFoundry surfaces) */
  --ember: #f9600e;
  --ember-2: #ffb547;
  --ember-soft: rgba(249, 96, 14, 0.12);

  /* Status */
  --ok: #3ecf8e;
  --warn: #f5b14c;
  --danger: #f0616b;

  /* Typography */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --text-2xl: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
  --text-3xl: clamp(1.6rem, 1.25rem + 1.6vw, 2.3rem);
  --text-display: clamp(1.9rem, 1.35rem + 2.6vw, 3.2rem);

  --leading-tight: 1.08;
  --leading-snug: 1.25;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.035em;
  --tracking-snug: -0.02em;
  --tracking-wide: 0.08em;
  --tracking-wider: 0.14em;

  /* Spacing (4px base) */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-7: 2rem;
  --s-8: 2.5rem;
  --s-9: 3rem;
  --s-10: 4rem;
  --s-11: 5rem;
  --s-12: 6.5rem;

  --section-y: clamp(4.5rem, 6vw + 2rem, 8.5rem);
  --container: 1200px;
  --container-wide: 1360px;
  --container-narrow: 760px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 72px;

  /* Radius: restrained */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-accent: 0 12px 40px -12px var(--accent-glow);

  /* Motion */
  --dur-fast: 150ms;
  --dur-base: 260ms;
  --dur-slow: 480ms;
  --dur-reveal: 720ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);

  /* Z-index scale */
  --z-header: 100;
  --z-menu: 110;
  --z-drawer: 120;
  --z-toast: 200;
}

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

  --bg-0: #f7f8fb;
  --bg-1: #ffffff;
  --bg-2: #f1f3f8;
  --bg-3: #e8ebf2;
  --bg-4: #dde2ec;
  --bg-elev: rgba(255, 255, 255, 0.88);

  --line: rgba(10, 16, 30, 0.09);
  --line-strong: rgba(10, 16, 30, 0.16);
  --line-accent: rgba(47, 107, 255, 0.4);

  --fg-0: #0b1020;
  --fg-1: #2b3446;
  --fg-2: #5a6578;
  --fg-3: #8a94a6;
  --fg-inverse: #ffffff;

  --accent: #2f6bff;
  --accent-600: #1f55e0;
  --accent-700: #1745bd;
  --accent-soft: rgba(47, 107, 255, 0.1);
  --accent-glow: rgba(47, 107, 255, 0.22);

  --teal: #0fa9a3;
  --teal-soft: rgba(15, 169, 163, 0.12);

  --ember: #e4550a;
  --ember-2: #d9902b;
  --ember-soft: rgba(228, 85, 10, 0.1);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px -10px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, 0.25);
}
