/* =========================================================
   Radar Bisnero Design System — Tokens
   Capa 1: variables, reset, layout, tipografia, utilidades
   Hereda paleta base de Alethra. Extiende con tokens operativos.
   ========================================================= */

:root {
  /* ── Raw palette (inherited from Alethra) ── */
  --color-ivory-100:    #F6F4EF;
  --color-ivory-50:     #FBFAF7;
  --color-amber-500:    #C27A2C;
  --color-amber-700:    #9A5E21;
  --color-amber-100:    #FAF3EA;
  --color-ink-900:      #2B2B2B;
  --color-ink-600:      #6B6B6B;
  --color-ink-400:      #787878;
  --color-sand-300:     #E5E2DA;
  --color-dark-900:     #1C1917;
  --color-dark-400:     #A8A29E;

  /* ── Radar operational palette ── */
  --color-green-500:    #16a34a;
  --color-green-100:    #f0fdf4;
  --color-green-800:    #166534;
  --color-blue-500:     #2563eb;
  --color-blue-100:     #eff6ff;
  --color-blue-800:     #1e40af;
  --color-slate-100:    #f1f5f9;
  --color-slate-200:    #e2e8f0;
  --color-slate-500:    #64748b;
  --color-slate-700:    #334155;
  --color-red-500:      #dc2626;
  --color-red-100:      #fef2f2;

  /* ── Semantic: consumed by components ── */
  --color-bg:           var(--color-ivory-100);
  --color-bg-soft:      var(--color-ivory-50);
  --color-bg-card:      #ffffff;
  --color-text:         var(--color-ink-900);
  --color-text-soft:    var(--color-ink-600);
  --color-text-muted:   var(--color-ink-400);
  --color-heading:      var(--color-ink-900);
  --color-accent:       var(--color-amber-500);
  --color-accent-hover: var(--color-amber-700);
  --color-border:       var(--color-sand-300);
  --color-on-accent:    var(--color-ivory-50);

  /* ── Signal semantics (radar-specific) ── */
  --signal-viable-bg:     var(--color-green-100);
  --signal-viable-border: var(--color-green-500);
  --signal-viable-text:   var(--color-green-800);
  --signal-trend-bg:      var(--color-blue-100);
  --signal-trend-border:  var(--color-blue-500);
  --signal-trend-text:    var(--color-blue-800);
  --signal-highlight-bg:  var(--color-amber-100);
  --signal-highlight-border: var(--color-amber-500);
  --signal-highlight-text: var(--color-amber-700);

  /* ── Typography ── */
  --font-sans:  "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:  ui-monospace, "SF Mono", "Cascadia Code", monospace;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;

  --line-tight:   1.15;
  --line-snug:    1.35;
  --line-normal:  1.6;

  --tracking-tight:  -0.01em;

  /* ── Spacing (4px base) ── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.5rem;
  --space-6:  2rem;
  --space-8:  3rem;
  --space-10: 5rem;

  /* ── Borders & Radius ── */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  /* ── Layout ── */
  --container-lg: 72rem;
  --container-md: 56rem;

  /* ── Transitions ── */
  --transition-fast: 0.15s ease;

  /* ── Accessibility ── */
  --focus-ring:    2px solid var(--color-accent);
  --focus-offset:  2px;
  --focus-shadow:  0 0 0 3px rgba(194, 122, 44, 0.15);

  /* ── Semantic: surface & divider ── */
  --color-bg-subtle:    var(--color-slate-100);
  --color-border-light: var(--color-slate-100);
}

/* =========================================================
   Reset
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

/* =========================================================
   Layout
   ========================================================= */

.container {
  width: min(100% - 2rem, var(--container-lg));
  margin-inline: auto;
}

.container--md {
  width: min(100% - 2rem, var(--container-md));
  margin-inline: auto;
}

/* =========================================================
   Typography
   ========================================================= */

h1, h2, h3 {
  margin: 0;
  color: var(--color-heading);
  font-weight: 700;
  line-height: var(--line-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-base); font-weight: 600; }

p { margin: 0; }

/* =========================================================
   Utilities
   ========================================================= */

.text-muted  { color: var(--color-text-muted); }
.text-soft   { color: var(--color-text-soft); }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.text-mono   { font-family: var(--font-mono); }
.text-right  { text-align: right; }
.font-medium { font-weight: 500; }
.font-bold   { font-weight: 700; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
