/* ============================================================
   pilot.cr — globals.css
   Variables CSS, reset, tipografía base.
   Paleta heredada de Pilot Desk Design System + Nunito.
   Diferenciación visual vs nabu.me se trabaja en layout.css
   y components.css (composiciones distintas, mismos tokens).
   ============================================================ */

:root {
  /* ---------------- Color tokens (Design System v2 — index-v2.html) ---------------- */

  /* Primary (verde Pilot) + verdes profundos para bandas oscuras y gradientes */
  --color-primary: #34A953;
  --color-primary-light: #d1fae5;       /* green-tint-2 */
  --color-primary-dark: #0f3d24;        /* green-deep */
  --color-primary-hover: #2d9348;
  --gradient-primary: linear-gradient(150deg, #34A953 0%, #0f3d24 100%);

  /* Alias v2 (mismos valores que index-v2.html — disponibles para composiciones) */
  --green: #34A953;
  --green-deep: #0f3d24;
  --green-forest: #0a2e1b;
  --green-tint: #ecfdf5;
  --green-tint-2: #d1fae5;
  --ink: #14211a;
  --ink-soft: #45584e;
  --ink-faint: #7d8d84;
  --paper: #ffffff;
  --paper-2: #f6f8f7;
  --line: #e6eae8;
  --amber: #e8a13c;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Neutros base (estructura semántica — remapeados a la paleta ink/paper v2) */
  --color-text: #14211a;                /* ink */
  --color-text-muted: #45584e;          /* ink-soft */
  --color-text-light: #7d8d84;          /* ink-faint */
  --color-text-inverse: #eaf3ee;
  --color-bg-app: #ffffff;              /* fondo BLANCO, no cream */
  --color-bg-surface: #ffffff;
  --color-bg-elevated: #ffffff;
  --color-bg-alt: #f6f8f7;              /* paper-2 — superficie alterna */
  --color-border: #e6eae8;              /* line */
  --color-border-light: #eef1f0;
  --color-border-strong: #d4dad7;

  /* Nav (header) — transparente con blur al scroll (v2) */
  --color-nav-bg: rgba(255, 255, 255, 0.72);
  --color-nav-bg-scrolled: rgba(255, 255, 255, 0.94);
  --color-nav-border: rgba(230, 234, 232, 0);
  --color-nav-border-scrolled: #e6eae8;
  --color-nav-text: #14211a;
  --color-nav-text-muted: #45584e;

  /* Footer — fondo claro paper-2 (v2) */
  --color-footer-bg: #f6f8f7;
  --color-footer-text: #45584e;
  --color-footer-text-muted: #7d8d84;
  --color-footer-border: #e6eae8;

  /* Soft accents (badges / callouts / pills — SIEMPRE pasteles) */
  --color-soft-info-bg: #eff6ff;
  --color-soft-info-border: #3b82f6;
  --color-soft-info-text: #1e3a8a;
  --color-soft-tip-bg: #f0fdf4;
  --color-soft-tip-border: #22c55e;
  --color-soft-tip-text: #14532d;
  --color-soft-warning-bg: #fffbeb;
  --color-soft-warning-border: #f59e0b;
  --color-soft-warning-text: #78350f;
  --color-soft-danger-bg: #fef2f2;
  --color-soft-danger-border: #ef4444;
  --color-soft-danger-text: #7f1d1d;
  --color-soft-success-bg: #ecfdf5;
  --color-soft-success-border: #10b981;
  --color-soft-success-text: #064e3b;
  --color-soft-neutral-bg: #f6f8f7;
  --color-soft-neutral-text: #45584e;

  /* Hero / pillar accents (tints verdes v2) */
  --color-hero-tint: #ecfdf5;           /* green-tint */
  --color-hero-tint-strong: #d1fae5;    /* green-tint-2 */
  --color-bg-soft: #f6f8f7;

  /* ---------------- Tipografía ---------------- */

  --font-family-base: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;

  /* Escala (1rem = 17px en root → ligeramente más grande que nabu.me a 16px → mejor lectura long-form) */
  --font-size-xs: 0.75rem;     /* 12.75px */
  --font-size-sm: 0.875rem;    /* 14.9px */
  --font-size-base: 1rem;      /* 17px */
  --font-size-lg: 1.125rem;    /* 19.1px */
  --font-size-xl: 1.25rem;     /* 21.25px */
  --font-size-2xl: 1.5rem;     /* 25.5px */
  --font-size-3xl: 2rem;       /* 34px */
  --font-size-4xl: 2.625rem;   /* 44.6px */
  --font-size-5xl: 3.5rem;     /* 59.5px */
  --font-size-6xl: 4.5rem;     /* 76.5px — hero gigante */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-base: 1.65;
  --line-height-relaxed: 1.75;

  --letter-spacing-tight: -0.02em;
  --letter-spacing-snug: -0.015em;
  --letter-spacing-base: 0;
  --letter-spacing-wide: 0.025em;

  /* ---------------- Spacing ---------------- */

  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* ---------------- Border radius ---------------- */

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* ---------------- Shadows (suaves, no flashy) ---------------- */

  --shadow-xs: 0 1px 2px rgba(20, 33, 26, 0.04);
  --shadow-sm: 0 1px 3px rgba(20, 33, 26, 0.06), 0 1px 2px rgba(20, 33, 26, 0.04);
  --shadow-md: 0 14px 34px rgba(20, 33, 26, 0.08), 0 2px 4px rgba(20, 33, 26, 0.04);
  --shadow-lg: 0 22px 50px rgba(20, 33, 26, 0.10), 0 4px 10px rgba(20, 33, 26, 0.04);
  --shadow-xl: 0 24px 54px rgba(20, 33, 26, 0.12), 0 8px 16px rgba(20, 33, 26, 0.05);
  --shadow-primary: 0 8px 24px rgba(52, 169, 83, 0.28);

  /* ---------------- Transitions ---------------- */

  --transition-fast: 120ms ease;
  --transition-base: 220ms ease;
  --transition-slow: 380ms cubic-bezier(0.22, 1, 0.36, 1);

  /* ---------------- Layout ---------------- */

  --container-max: 1200px;
  --container-narrow: 880px;
  --container-prose: 720px;
  --nav-height: 72px;
  --section-spacing: clamp(3rem, 7vw, 6rem);
}

/* ============================================================
   Reset (Eric Meyer + modern adjustments)
   ============================================================ */

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-bg-app);
  overflow-x: hidden;
  min-height: 100vh;
  /* Grano sutil de fondo (v2) */
  background-image:
    radial-gradient(circle at 1px 1px, rgba(20, 33, 26, 0.04) 1px, transparent 0);
  background-size: 28px 28px;
}

img, picture, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary-dark); }

ul, ol { list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================================
   Tipografía base
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-base);
  font-weight: 800;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  letter-spacing: var(--letter-spacing-snug);
}

h1 {
  font-size: clamp(2rem, 4.5vw, var(--font-size-5xl));
  letter-spacing: var(--letter-spacing-tight);
  font-weight: 900;
}

h2 {
  font-size: clamp(1.75rem, 3vw, var(--font-size-4xl));
  font-weight: 800;
  margin-top: var(--space-12);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: clamp(1.35rem, 2vw, var(--font-size-2xl));
  font-weight: 700;
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

p.lead {
  font-size: var(--font-size-lg);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
}

strong, b {
  font-weight: 700;
  color: var(--color-text);
}

em, i { font-style: italic; }

small { font-size: var(--font-size-sm); }

code, kbd {
  font-family: var(--font-family-mono);
  font-size: 0.92em;
  background: var(--color-soft-neutral-bg);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
  color: var(--color-text);
}

/* Prose content (long-form en módulos, casos de uso, legales) */
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { margin-top: var(--space-16); }
.prose h3 { margin-top: var(--space-10); }
.prose ul, .prose ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}
.prose ul li, .prose ol li {
  margin-bottom: var(--space-2);
  line-height: var(--line-height-relaxed);
}
.prose ul li::marker { color: var(--color-primary); }
.prose ol { list-style: decimal; }
.prose ol li::marker { color: var(--color-text-muted); font-weight: 700; }

/* Eyebrow (kicker con guion verde — v2). Usado en cabeceras de sección. */
.eyebrow {
  font-family: var(--font-family-base);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1.5px;
  background: var(--color-primary);
  display: inline-block;
}
.eyebrow--center { justify-content: center; }

/* ============================================================
   Container + utilidades
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow { max-width: var(--container-narrow); }
.container--prose { max-width: var(--container-prose); }

.section { padding: var(--section-spacing) 0; }
.section--tight { padding: var(--space-12) 0; }

/* Skip-to-content (a11y) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 9999;
  font-weight: 700;
  transition: top var(--transition-fast);
}
.skip-link:focus { top: 0; color: #fff; }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Focus visible (a11y) */
*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

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