/* =========================================================
   Janus Design System — Colors & Type
   ========================================================= */

/* ---------- FONTS ----------
   Self-hosted in /fonts. We use Inter Tight (display + UI) and
   JetBrains Mono (code/numerics). Both are SIL OFL licensed. */

@font-face {
  font-family: "Inter Tight";
  src: url("./fonts/InterTight-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("./fonts/JetBrainsMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- ROOT TOKENS (LIGHT) ---------- */

:root {
  /* ===== Color: Neutrals (slate, cool) ===== */
  --slate-0:  #ffffff;
  --slate-50: #f7f8fa;
  --slate-100:#eef0f4;
  --slate-200:#e2e5ec;
  --slate-300:#cdd2dc;
  --slate-400:#9aa2b3;
  --slate-500:#6b7384;
  --slate-600:#4a5160;
  --slate-700:#333947;
  --slate-800:#1f2430;
  --slate-900:#0f1320;
  --slate-950:#080b14;

  /* ===== Color: Janus Navy Primary (#1D3461 — Manual de Marca v1.0) ===== */
  --navy-50:  #ecf0f7;
  --navy-100: #ccd6e7;
  --navy-200: #99adcf;
  --navy-300: #6783b6;
  --navy-400: #3a5a92;
  --navy-500: #1d3461;   /* CORE — Navy Primary */
  --navy-600: #1d3461;   /* alias kept for landing/brochure compatibility */
  --navy-700: #182a4f;
  --navy-800: #11203c;
  --navy-900: #0b162b;
  --deep-dark:#111820;   /* Background UI (dark mode root) */

  /* ===== Color: Janus Blue (#2979FF — Manual de Marca v1.0) ===== */
  --azul-50:  #e8f0ff;
  --azul-100: #c5d9ff;
  --azul-200: #8eb3ff;
  --azul-300: #5a91ff;
  --azul-400: #3a82ff;
  --azul-500: #2979ff;   /* CORE — Janus Blue */
  --azul-600: #1565c0;   /* Blue Dark per manual */
  --azul-700: #0f4d96;
  --azul-800: #0a3870;
  --azul-900: #07264f;

  /* ===== Color: Janus Turquesa (data / accent — used sparingly) ===== */
  --turq-50:  #e6f8f6;
  --turq-100: #b8ece7;
  --turq-200: #80ddd5;
  --turq-300: #4dccc1;
  --turq-400: #26c2b5;
  --turq-500: #00b8a9;   /* CORE — Turquesa acento */
  --turq-600: #009d91;
  --turq-700: #008178;
  --turq-800: #006760;
  --turq-900: #004d48;

  /* ===== Color: Semantic ===== */
  --green-500:  #10b981;
  --green-50:   #ecfdf5;
  --amber-500:  #f59e0b;
  --amber-50:   #fffbeb;
  --red-500:    #ef4444;
  --red-50:     #fef2f2;
  --cyan-500:   #06b6d4;  /* used for data/identity accents */
  --cyan-50:    #ecfeff;

  /* ===== Surface / Foreground / Border ===== */
  --surface-0:  var(--slate-50);     /* page background */
  --surface-1:  var(--slate-0);      /* card / elevated */
  --surface-2:  var(--slate-100);    /* hover / sunken */
  --surface-3:  var(--slate-200);    /* deeper sunken */
  --surface-inv:var(--slate-900);    /* inverse panel */

  --fg-1:       var(--slate-900);    /* primary text */
  --fg-2:       var(--slate-600);    /* secondary text */
  --fg-3:       var(--slate-400);    /* tertiary / icons */
  --fg-inv:     var(--slate-0);      /* on inverse */

  --border:        var(--slate-200);
  --border-strong: var(--slate-300);
  --border-inv:    rgba(255,255,255,0.10);

  /* ===== Brand mappings =====
     Navy is the institutional "deep" surface (hero, footer, dark panels).
     Azul corporativo is the action color (buttons, links, focus).
     Turquesa is the data/accent color (used SPARINGLY — charts, status dots,
     micro-emphasis). It must never compete with Azul for action affordance. */
  --brand-deep:    var(--navy-600);  /* Janus Navy — hero/footer */
  --brand-deep-2:  var(--navy-500);

  --brand:         var(--azul-500);  /* primary action */
  --brand-hover:   var(--azul-600);
  --brand-press:   var(--azul-700);
  --brand-soft:    var(--azul-50);
  --brand-fg:      var(--slate-0);

  --accent:        var(--turq-500); /* data accent — sparingly */
  --accent-soft:   var(--turq-50);
  --accent-fg:     var(--navy-700);

  --link:          var(--azul-500);
  --link-hover:    var(--azul-600);

  --success: var(--green-500);
  --warning: var(--amber-500);
  --danger:  var(--red-500);
  --info:    var(--cyan-500);

  /* ===== Spacing (4px base) ===== */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;

  /* ===== Radius ===== */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  /* ===== Shadows ===== */
  --shadow-sm: 0 1px 2px rgba(15, 19, 32, 0.04), 0 0 0 1px rgba(15, 19, 32, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 19, 32, 0.08), 0 0 0 1px rgba(15, 19, 32, 0.06);
  --shadow-focus: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--brand);

  /* ===== Type families ===== */
  --font-sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* ===== Type scale (1.250 — major third) ===== */
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;   /* body */
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-30: 30px;
  --fs-38: 38px;
  --fs-48: 48px;
  --fs-60: 60px;
  --fs-76: 76px;

  /* ===== Line heights ===== */
  --lh-tight: 1.1;
  --lh-snug:  1.25;
  --lh-normal:1.5;
  --lh-mono:  1.45;

  /* ===== Letter spacing ===== */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-eyebrow: 0.08em;

  /* ===== Motion ===== */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-press: 80ms;
  --dur-hover: 150ms;
  --dur-panel: 200ms;
  --dur-page:  300ms;
}

/* ---------- DARK MODE ---------- */

:root[data-theme="dark"],
.theme-dark {
  --surface-0:  var(--slate-950);
  --surface-1:  var(--slate-900);
  --surface-2:  var(--slate-800);
  --surface-3:  var(--slate-700);
  --surface-inv:var(--slate-50);

  --fg-1:       var(--slate-50);
  --fg-2:       var(--slate-300);
  --fg-3:       var(--slate-500);
  --fg-inv:     var(--slate-900);

  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --border-inv:    var(--slate-200);

  --brand-deep:    var(--navy-700);
  --brand-deep-2:  var(--navy-600);

  --brand:       var(--azul-400);
  --brand-hover: var(--azul-300);
  --brand-press: var(--azul-200);
  --brand-soft:  rgba(54, 114, 186, 0.14);
  --brand-fg:    var(--slate-0);

  --accent:      var(--turq-400);
  --accent-soft: rgba(38, 194, 181, 0.14);
  --accent-fg:   var(--slate-50);

  --link:        var(--azul-300);
  --link-hover:  var(--azul-200);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  --shadow-focus: 0 0 0 2px var(--surface-1), 0 0 0 4px var(--brand);
}

/* ---------- SEMANTIC TYPE ---------- */

.t-display, h1.t-display {
  font-family: var(--font-sans);
  font-size: var(--fs-76);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
  color: var(--fg-1);
}

h1, .h1 {
  font-family: var(--font-sans);
  font-size: var(--fs-48);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
  color: var(--fg-1);
}

h2, .h2 {
  font-family: var(--font-sans);
  font-size: var(--fs-30);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
  color: var(--fg-1);
}

h3, .h3 {
  font-family: var(--font-sans);
  font-size: var(--fs-20);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
  color: var(--fg-1);
}

h4, .h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-snug);
  font-weight: 600;
  color: var(--fg-1);
}

p, .p, .body {
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  font-weight: 400;
  color: var(--fg-1);
}

.body-sm {
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: var(--lh-normal);
  color: var(--fg-2);
}

.caption {
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  line-height: var(--lh-normal);
  color: var(--fg-2);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  font-weight: 600;
  color: var(--fg-2);
}

code, .code, kbd, samp {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: var(--lh-mono);
  font-weight: 500;
  color: var(--fg-1);
}

.code-block {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  line-height: var(--lh-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  color: var(--fg-1);
  white-space: pre;
  overflow-x: auto;
}

.metric {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
a:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}
