/* ============================================================
 * brand.css — sistema de diseño compartido entre landings públicos
 *   (marketing/home y miafore/comparator).
 *
 * Aquí viven SÓLO tokens y primitivas reutilizables: variables CSS,
 * reset mínimo, tipografía base, botones, container, eyebrow, fade-up.
 * Cualquier estilo específico de una sección (hero, mockup, calculadora)
 * va en su propia hoja, no aquí.
 *
 * Fuente de fuentes: Google Fonts (Syne + DM Sans), Font Awesome 6.5.
 * Esta hoja NO los carga — eso lo hace cada layout para tener control
 * sobre el orden de preload.
 * ============================================================ */

:root {
  --color-primary:      oklch(55% 0.20 230);
  --color-primary-lt:   oklch(72% 0.12 230);
  --color-primary-dk:   oklch(32% 0.22 230);
  --color-accent:       oklch(70% 0.20 190);
  --color-accent-dk:    oklch(60% 0.18 190);
  --color-bg:           oklch(98.5% 0.006 230);
  --color-bg-tint:      oklch(96.5% 0.010 230);
  --color-surface:      oklch(100% 0 0);
  --color-border:       oklch(88% 0.010 230);
  --color-border-soft:  oklch(93% 0.008 230);
  --color-text:         oklch(16% 0.018 230);
  --color-text-mid:     oklch(44% 0.014 230);
  --color-text-muted:   oklch(62% 0.008 230);
  --color-hero-bg:      oklch(14% 0.030 240);
  --color-hero-surface: oklch(18% 0.030 240);
  --color-hero-border:  oklch(28% 0.025 240);
  --color-hero-text-mid: oklch(70% 0.018 240);
  --color-dark-section: oklch(12% 0.025 235);

  --color-positive:     oklch(58% 0.18 145);   /* verde para la mejor AFORE */
  --color-negative:     oklch(58% 0.20 25);    /* rojo para la peor AFORE */
  --color-neutral-bar:  oklch(72% 0.04 230);   /* gris-azulado intermedio */

  --font-display: 'Syne', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.25rem;
  --text-xl:   clamp(1.5rem, 3vw, 2.25rem);
  --text-2xl:  clamp(2rem, 4.5vw, 3.5rem);
  --text-3xl:  clamp(2.5rem, 6vw, 5rem);

  --space-1: 0.25rem; --space-2: 0.5rem;  --space-3: 0.75rem;
  --space-4: 1rem;    --space-6: 1.5rem;  --space-8: 2rem;
  --space-12: 3rem;   --space-16: 4rem;   --space-24: 6rem;

  --shadow-sm: 0 1px 4px oklch(0% 0 0 / 0.06);
  --shadow-md: 0 4px 16px oklch(0% 0 0 / 0.10);
  --shadow-lg: 0 12px 40px oklch(0% 0 0 / 0.14);

  --duration-fast: 150ms;
  --duration-mid:  250ms;
  --duration-slow: 400ms;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  --container: min(100%, 1120px);
}

/* ---- Reset mínimo --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---- Tipografía base ------------------------------------------------ */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h2 { line-height: 1.12; }
h3 { line-height: 1.2; font-weight: 700; }
p { text-wrap: pretty; margin: 0; max-width: 65ch; }
ul { margin: 0; padding: 0; list-style: none; }
li { max-width: 65ch; }

.eyebrow, .label-caps {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--color-text-mid);
}

/* ---- Container ------------------------------------------------------ */
.container {
  width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---- Botones -------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-6);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform var(--duration-fast) var(--ease-out-quart),
              background-color var(--duration-mid) var(--ease-out-quart),
              color var(--duration-mid) var(--ease-out-quart),
              border-color var(--duration-mid) var(--ease-out-quart);
}
.btn--primary       { background: var(--color-accent); color: oklch(14% 0.030 240); }
.btn--primary:hover { background: var(--color-accent-dk); }
.btn--ghost-dark    { background: transparent; color: oklch(100% 0 0); border-color: var(--color-hero-border); }
.btn--ghost-dark:hover  { border-color: oklch(55% 0.025 240); background: oklch(20% 0.030 240); }
.btn--ghost-light   { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn--ghost-light:hover { border-color: var(--color-text); }
.btn--small         { min-height: 38px; padding: 0 var(--space-4); font-size: var(--text-xs); }

@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
}

/* ---- Foco accesible ------------------------------------------------- */
.btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- Animaciones de entrada (cards en scroll/load) ----------------- */
@media (prefers-reduced-motion: no-preference) {
  .fade-up {
    animation: fadeUp var(--duration-slow) var(--ease-out-quart) both;
    animation-delay: calc(var(--i, 0) * 80ms);
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
