/* ══════════════════════════════════════════════════════════════════════════════
   ATLAS DESIGN SYSTEM — TOKENS (CSS VARIABLES)
   Conceito: Carta de navegação pessoal
   Paleta: Verde-floresta (#0F2A22), Osso (#F3EEE3), Cobre (#D98A3D)
   ══════════════════════════════════════════════════════════════════════════════ */

:root,
[data-theme="dark"] {
  /* Cores Base — Tema Escuro (Padrão) */
  --bg-primary: #091a15;
  --bg-surface: #0F2A22;
  --bg-card: #133329;
  --bg-card-hover: #184034;
  --bg-elevated: #1a4537;

  /* Bordas */
  --border-subtle: rgba(243, 238, 227, 0.12);
  --border-strong: rgba(243, 238, 227, 0.28);
  --border-focus: #D98A3D;

  /* Texto */
  --text-primary: #F3EEE3;
  --text-secondary: #A3B8AD;
  --text-muted: #6D857A;
  --text-faint: rgba(243, 238, 227, 0.45);

  /* Acento Único — Cobre Cartográfico */
  --copper: #D98A3D;
  --copper-hover: #C5782E;
  --copper-light: #EBB67E;
  --copper-faint: rgba(217, 138, 61, 0.15);

  /* Semântica Restrita */
  --positive: #52c486;
  --positive-faint: rgba(82, 196, 134, 0.15);
  --negative: #fa7d70;
  --negative-faint: rgba(250, 125, 112, 0.15);
  --warning: #D98A3D;
  --warning-faint: rgba(217, 138, 61, 0.15);

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);

  /* Legado / Aliases de Compatibilidade */
  --forest: var(--bg-surface);
  --forest-dark: var(--bg-primary);
  --forest-surface: var(--bg-surface);
  --forest-card: var(--bg-card);
  --forest-hover: var(--bg-card-hover);
  --forest-border: var(--border-subtle);
  --forest-border-hover: var(--border-strong);
  --bone: var(--text-primary);
  --bone-muted: var(--text-secondary);
  --bone-faint: var(--text-faint);
}

[data-theme="light"] {
  /* Cores Base — Tema Claro (Osso / Pergaminho) */
  --bg-primary: #F3EEE3;
  --bg-surface: #FAF7F0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F2ECE0;
  --bg-elevated: #FFFFFF;

  /* Bordas */
  --border-subtle: rgba(15, 42, 34, 0.12);
  --border-strong: rgba(15, 42, 34, 0.25);
  --border-focus: #C5782E;

  /* Texto */
  --text-primary: #0F2A22;
  --text-secondary: #2C483B;
  --text-muted: #536E61;
  --text-faint: rgba(15, 42, 34, 0.45);

  /* Acento Único — Cobre Cartográfico Adaptado */
  --copper: #C5782E;
  --copper-hover: #A85F1E;
  --copper-light: #8E4F18;
  --copper-faint: rgba(197, 120, 46, 0.15);

  /* Semântica Restrita */
  --positive: #1E7E44;
  --positive-faint: rgba(30, 126, 68, 0.15);
  --negative: #BD271E;
  --negative-faint: rgba(189, 39, 30, 0.15);
  --warning: #C5782E;
  --warning-faint: rgba(197, 120, 46, 0.15);

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(15, 42, 34, 0.08);
  --shadow-md: 0 4px 14px rgba(15, 42, 34, 0.1);
  --shadow-lg: 0 12px 30px rgba(15, 42, 34, 0.12);

  /* Legado / Aliases de Compatibilidade */
  --forest: var(--bg-surface);
  --forest-dark: var(--bg-primary);
  --forest-surface: var(--bg-surface);
  --forest-card: var(--bg-card);
  --forest-hover: var(--bg-card-hover);
  --forest-border: var(--border-subtle);
  --forest-border-hover: var(--border-strong);
  --bone: var(--text-primary);
  --bone-muted: var(--text-secondary);
  --bone-faint: var(--text-faint);
}

/* ── Escala Universal de Tipografia, Espaçamento e Formas ─────────────────────── */
:root {
  /* Tipografia */
  --font-serif: 'Instrument Serif', 'Fraunces', Georgia, serif;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Tamanhos e Linhas */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 38px;
  --text-4xl: 48px;

  /* Espaçamento */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Raios de Borda */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --r: 8px;

  /* Transições Suaves */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ── Superfícies de Navegador & Acessibilidade ─────────────────────────────────── */
::selection {
  background: var(--copper);
  color: #0F2A22;
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

[data-tabular],
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Scrollbar com acabamento cartográfico */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--copper);
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
