/*!
 * WEB SKELETONS AI KIT — CORE DESIGN TOKENS (v1.0.0)
 * Arquitetura de Variáveis CSS (Custom Properties) Travadas para Projetos Web.
 * Referências Técnicas:
 * - MDN CSS Custom Properties: https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Cascading_variables/Using_custom_properties
 * - MDN clamp() Function: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/clamp
 */

:root {
  /* -------------------------------------------------------------------------
   * 1. PALETA SEMÂNTICA DE SUPERFÍCIES E CORES (LIGHT MODE DEFAULT)
   * ------------------------------------------------------------------------- */
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #f1f5f9;
  --bg-subtle: #e2e8f0;
  --bg-sidebar-dark: #0f172a;
  --bg-code: #0f172a;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-dark: #f8fafc;
  --text-on-brand: #ffffff;

  /* Brand & Accent Tokens */
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;

  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;

  /* Estados Semânticos */
  --state-success-bg: #dcfce7;
  --state-success-fg: #15803d;
  --state-warning-bg: #fef3c7;
  --state-warning-fg: #b45309;
  --state-danger-bg: #fee2e2;
  --state-danger-fg: #b91c1c;
  --state-info-bg: #dbeafe;
  --state-info-fg: #1d4ed8;

  /* Bordas e Divisores */
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;
  --ring-focus: 0 0 0 3px rgba(37, 99, 235, 0.25);

  /* -------------------------------------------------------------------------
   * 2. ESCALA ESPACIAL (SISTEMA LINEAR DE 4PX / 8PX)
   * ------------------------------------------------------------------------- */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* -------------------------------------------------------------------------
   * 3. DIMENSÕES ESTRUTURAIS TRAVADAS (AI-LOCKED GEOMETRY)
   * ------------------------------------------------------------------------- */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1240px;
  --container-2xl: 1440px;

  --header-height: 64px;
  --sidebar-width: 260px;
  --sidebar-narrow: 240px;
  --aside-width: 300px;
  --toc-width: 220px;

  /* -------------------------------------------------------------------------
   * 4. TIPOGRAFIA FLUIDA COM CLAMP() E ESCALA MODULAR
   * ------------------------------------------------------------------------- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --text-xs: 0.75rem;                                    /* 12px */
  --text-sm: 0.875rem;                                   /* 14px */
  --text-base: 1rem;                                     /* 16px */
  --text-lg: clamp(1.05rem, 0.95rem + 0.3vw, 1.1875rem); /* 17px–19px */
  --text-xl: clamp(1.2rem, 1.05rem + 0.5vw, 1.375rem);   /* 19px–22px */
  --text-2xl: clamp(1.4rem, 1.15rem + 0.9vw, 1.75rem);   /* 22px–28px */
  --text-3xl: clamp(1.75rem, 1.35rem + 1.4vw, 2.25rem);  /* 28px–36px */
  --text-4xl: clamp(2.1rem, 1.5rem + 2.1vw, 3rem);       /* 34px–48px */

  /* -------------------------------------------------------------------------
   * 5. RAIOS DE BORDA, SOMBRAS E TRANSIÇÕES
   * ------------------------------------------------------------------------- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.07), 0 1px 3px -1px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 32px -6px rgba(15, 23, 42, 0.12), 0 6px 12px -3px rgba(15, 23, 42, 0.06);

  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 220ms;

  /* Escala Z-Index Controlada */
  --z-base: 1;
  --z-sticky: 20;
  --z-header: 40;
  --z-sidebar: 50;
  --z-modal: 100;
  --z-toast: 200;
}

/* ---------------------------------------------------------------------------
 * SUPORTE NATIVO A DARK MODE ([data-theme="dark"])
 * --------------------------------------------------------------------------- */
[data-theme="dark"] {
  --bg-canvas: #0b1120;
  --bg-surface: #111827;
  --bg-elevated: #1e293b;
  --bg-subtle: #334155;
  --bg-sidebar-dark: #070b14;
  --bg-code: #070b14;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-subtle: #1e293b;
  --border-strong: #334155;
}
