/* ============================================
   NIMBUS XP — DESIGN SYSTEM
   Variables · Reset · Utilidades globales
   Toggle dark/light
   ============================================ */

/* ── LIGHT MODE (default) ─────────────────── */
:root {
  /* Accent invariables */
  --indigo:       #6F00FF;
  --indigo-soft:  #8B3FFF;
  --indigo-deep:  #4A00B0;
  --neon:         #39FF14;
  --neon-readable:#1FA800;
  --midnight:     #191970;

  /* Light palette */
  --bg-0:         #FFFFFF;
  --bg-1:         #FAFAFB;
  --bg-2:         #F4F4F6;
  --bg-3:         #ECECF0;
  --line:         rgba(20,20,30,0.08);
  --line-strong:  rgba(20,20,30,0.16);
  --line-indigo:  rgba(111,0,255,0.25);
  --text-1:       #14141C;
  --text-2:       #5C5C6B;
  --text-3:       #8B8B9A;
  --text-mono:    #6F6F7E;

  /* Typography */
  --font-display: 'Inter Tight', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  --font-serif:   'Instrument Serif', Georgia, serif;

  /* Layout */
  --gutter: clamp(20px, 4vw, 56px);
  --max-w:  1440px;

  /* Nav background (light) */
  --nav-bg: rgba(255,255,255,0.85);
}

/* ── DARK MODE ────────────────────────────── */
[data-theme="dark"] {
  --bg-0:      #07070B;
  --bg-1:      #0C0C12;
  --bg-2:      #12121A;
  --bg-3:      #1A1A24;
  --line:      rgba(255,255,255,0.07);
  --line-strong: rgba(255,255,255,0.14);
  --line-indigo: rgba(111,0,255,0.35);
  --text-1:    #F4F4F7;
  --text-2:    #A8A8B8;
  --text-3:    #6B6B7A;
  --text-mono: #8B8BA0;
  --nav-bg:    rgba(7,7,11,0.80);

  /* En dark: el neon puro es legible */
  --neon-readable: var(--neon);
}

/* ── RESET ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg-1);
  color: var(--text-1);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  overflow-wrap: break-word;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── GRID BLUEPRINT (dark only) ────────────── */
[data-theme="dark"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6), transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.6), transparent 75%);
}

/* ── NOISE OVERLAY (dark only) ─────────────── */
[data-theme="dark"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

[data-theme="dark"] main,
[data-theme="dark"] header,
[data-theme="dark"] footer,
[data-theme="dark"] section { position: relative; z-index: 2; }

/* ── UTILITIES ────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mono);
}

/* ── TAG PILL (neon) ──────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-readable);
  padding: 6px 12px;
  border: 1px solid rgba(57,255,20,0.30);
  border-radius: 999px;
  background: rgba(57,255,20,0.06);
}
.tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--neon-readable);
  box-shadow: 0 0 8px var(--neon-readable);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

/* ── TAG PILL (indigo) ────────────────────── */
.tag-indigo {
  color: var(--indigo-soft);
  border-color: rgba(111,0,255,0.30);
  background: rgba(111,0,255,0.06);
}
.tag-indigo::before {
  background: var(--indigo-soft);
  box-shadow: 0 0 8px var(--indigo-soft);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ── BUTTONS ──────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-display);
  letter-spacing: -0.005em;
  border: 0;
  transition: all .25s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 0 0 1px var(--indigo), 0 12px 40px -8px rgba(111,0,255,0.4);
}
.btn-primary:hover {
  background: var(--indigo-deep);
  box-shadow: 0 0 0 1px var(--indigo-deep), 0 14px 50px -8px rgba(111,0,255,0.65);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--text-1);
  background: rgba(111,0,255,0.05);
}

/* ── TICKER ───────────────────────────────── */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--bg-0);
  overflow: hidden;
  position: relative;
  z-index: 10;
}
.ticker-track {
  display: flex;
  gap: 48px;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mono);
  letter-spacing: 0.08em;
  white-space: nowrap;
  animation: scroll-x 60s linear infinite;
}
.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ticker-track span::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--neon-readable);
  flex-shrink: 0;
}
@keyframes scroll-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── NAVIGATION ───────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  transition: background .3s;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 36px; width: auto; display: block; }

.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-2);
  transition: color .2s;
  font-weight: 450;
}
.nav-links a:hover { color: var(--text-1); }
/* Botón CTA dentro del nav — color explícito para no heredar text-2 */
.nav-links .btn-primary { color: #ffffff; }
.nav-links .btn-primary:hover { color: #ffffff; }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  display: grid;
  place-items: center;
  transition: all .2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--text-1);
  color: var(--text-1);
}
.icon-sun, .icon-moon { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
.icon-sun { display: block; }
[data-theme="dark"] .icon-sun { display: none; }

@media (max-width: 900px) {
  .nav-links a:not(.btn):not(.theme-toggle) { display: none; }
}

/* ── SECTION PRIMITIVES ───────────────────── */
section { padding: clamp(72px, 10vw, 140px) 0; }

.section-head {
  margin-bottom: clamp(40px, 6vw, 72px);
  max-width: 880px;
}
.section-eyebrow { margin-bottom: 18px; }
.section-title {
  font-size: clamp(32px, 4.5vw, 64px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.section-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--indigo-soft);
}
.section-sub {
  font-size: clamp(15px, 1.3vw, 18px);
  color: var(--text-2);
  margin-top: 22px;
  max-width: 60ch;
  line-height: 1.6;
}

/* ── CARDS BASE ───────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  transition: all .3s;
}
.card:hover {
  border-color: var(--line-indigo);
  transform: translateY(-3px);
}

/* ── METRICS BASE ─────────────────────────── */
.m-value {
  font-family: var(--font-mono);
  font-size: clamp(48px, 6vw, 88px);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text-1);
}
[data-theme="dark"] .m-value {
  background: linear-gradient(180deg, #fff 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── FOOTER ───────────────────────────────── */
footer {
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  padding: 60px 0 32px;
}
.foot-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.foot-brand p {
  color: var(--text-2);
  font-size: 14px;
  margin-top: 16px;
  max-width: 32ch;
  line-height: 1.55;
}
.foot-col h5 {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.foot-col ul { display: flex; flex-direction: column; gap: 12px; }
.foot-col a {
  font-size: 14px;
  color: var(--text-2);
  transition: color .2s;
}
.foot-col a:hover { color: var(--text-1); }
.foot-bottom {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── WHATSAPP FLOTANTE ────────────────────── */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #25D366;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.4);
  transition: transform .2s, box-shadow .2s;
}
.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37,211,102,0.55);
}
.wa-float svg { width: 26px; height: 26px; fill: #fff; }

/* ── REVEAL ANIMATION ─────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .8s ease, transform .8s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE FOOTER ────────────────────── */
@media (max-width: 900px) { .foot-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .foot-top { grid-template-columns: 1fr; } }
