/* ==========================================================================
   Quantely — sistema visual basado en la referencia "Fey"
   Lienzo negro mate, tipografía luminosa, color solo como señal.
   ========================================================================== */

:root {
  /* Colores */
  --white: #ffffff;
  --ink: #0b0b0b;
  --charcoal: #191919;
  --obsidian: #131313;
  --graphite: #868f97;
  --mist: #cccccc;
  --smoke: #525252;
  --ash: #999999;
  --ember: #ffa16c;
  --signal: #479ffa;
  --growth: #4ebe96;
  --loss: #e5736b;
  --abyss: #000000;
  --gradient-ember: linear-gradient(97.13deg, #ffa16c 8.47%, #551b10 108.41%);
  --gradient-frost: linear-gradient(96.44deg, #b6d6ff 6.12%, #393f56 110.28%);

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* Tipografía (Inter sustituye a Calibre) */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Radios */
  --r-card: 16px;
  --r-small: 10px;
  --r-icon: 6px;
  --r-pill: 99px;

  /* Sombras */
  --shadow-halo: rgba(0, 0, 0, 0.8) 0 0 44px 0;
  --shadow-featured: rgba(0, 0, 0, 0.5) 0 0 35px 0;
  --shadow-button: rgba(0, 0, 0, 0.85) 0 1px 0 0, rgba(255, 255, 255, 0.25) 0 0 14px 0;

  /* Layout */
  --max: 1200px;
  --gutter: 24px;
  --section: 128px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01" on, "tnum" on, "cv11" on;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 6px;
}

.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;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--white); color: var(--ink);
  padding: 10px 16px; border-radius: var(--r-pill); font-weight: 500;
}
.skip-link:focus { top: 16px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }

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

.display {
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.065em;
  text-wrap: balance;
}
.h2 {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.06em;
  text-wrap: balance;
}
.h3 { font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -0.03em; }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--graphite); line-height: 1.6; max-width: 58ch; text-wrap: pretty; }
.muted { color: var(--graphite); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--graphite);
  letter-spacing: 0.01em;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--growth); box-shadow: 0 0 10px var(--growth); }

.accent-ember {
  background: var(--gradient-ember);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}
.accent-frost {
  background: var(--gradient-frost);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

/* ---------- Botones (pill) ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--white); color: var(--ink); box-shadow: 0 0 24px rgba(255, 255, 255, 0.12); }
.btn-primary:hover { background: #e9e9e9; box-shadow: 0 0 32px rgba(255, 255, 255, 0.22); }
.btn-ghost { background: var(--ink); color: var(--white); border: 1px solid var(--line-strong); box-shadow: var(--shadow-button); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.35); }
.btn-quiet { color: var(--graphite); padding: 0 14px; }
.btn-quiet:hover { color: var(--white); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn .icon { transition: transform 0.2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; line-height: 1.4;
  border: 1px solid var(--line-strong); color: var(--mist);
}
.badge-growth { border-color: rgba(78, 190, 150, 0.4); color: var(--growth); }
.badge-signal { border-color: rgba(71, 159, 250, 0.4); color: var(--signal); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Tarjetas ---------- */

.card {
  background: var(--charcoal);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-featured);
}

/* ---------- Navegación ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 11, 0.72);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.05em; }
.logo-mark {
  width: 32px; height: 32px; flex: none; border-radius: 9px; overflow: hidden;
  display: grid; place-items: center;
  background: #0b1120;
  box-shadow: 0 0 0 1px rgba(160, 220, 255, 0.16), 0 4px 18px -4px rgba(56, 189, 248, 0.45);
}
.logo-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  position: relative;
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 500; color: var(--graphite);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--white); }
.nav-links a[aria-current="true"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px;
  height: 1px; background: var(--signal);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center; border: 1px solid var(--line-strong); }

.mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px var(--gutter) 24px;
}
.mobile-menu a { display: flex; align-items: center; min-height: 48px; font-size: 17px; font-weight: 500; color: var(--mist); border-bottom: 1px solid var(--line); }
.mobile-menu .btn { margin-top: 16px; }
.nav.is-open .mobile-menu { display: block; }

@media (max-width: 900px) {
  .nav-links, .nav-actions .btn-quiet { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 480px) {
  .nav-actions .btn-primary { display: none; }
}

/* ---------- Secciones ---------- */

.section { padding-block: var(--section); }
.section-head { display: grid; gap: 20px; margin-bottom: 56px; max-width: 760px; }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }
@media (max-width: 720px) {
  :root { --section: 88px; --gutter: 16px; }
  .section-head { margin-bottom: 40px; }
}

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 56px 0 40px; color: var(--graphite); font-size: 14px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a:hover { color: var(--white); }
.disclaimer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.65; color: var(--graphite); max-width: 900px; }
.disclaimer strong { color: var(--mist); font-weight: 500; }

/* Selector de idioma */
.lang-switch {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: var(--r-pill);
  font: 600 12.5px/1 var(--mono, var(--font)); letter-spacing: 0.06em; color: var(--graphite);
  border: 1px solid var(--line-strong); transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lang-switch:hover { color: var(--white); border-color: rgba(46, 242, 164, 0.5); }
.lang-switch .icon { width: 15px; height: 15px; }
.mobile-menu [data-lang-switch] .icon, .footer-links [data-lang-switch] .icon { width: 15px; height: 15px; vertical-align: -2px; }
.gate-lang { text-align: center; font-size: 13.5px; }
.gate-lang a { display: inline-flex; align-items: center; gap: 6px; color: var(--graphite); }
.gate-lang a:hover { color: var(--white); }
.gate-lang .icon { width: 15px; height: 15px; }
@media (max-width: 900px) { .nav-actions .lang-switch { display: none; } }
