/* ═══════════════════════════════════════════════════════════════════════
   Resonans — sistema visual
   Un solo archivo, sin build. Tokens primero, componentes después.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Marca: el índigo eléctrico es la señal; el ámbar marca el dinero. */
  --brand-50:  #eef2ff;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;

  --accent-400: #fbbf24;
  --accent-500: #f59e0b;

  --ok-400:   #34d399;
  --warn-400: #fbbf24;

  /* Superficies: casi-negro con tinte frío, no gris puro. */
  --bg:        #08080c;
  --bg-soft:   #0d0d14;
  --surface:   #12121c;
  --surface-2: #1a1a28;
  --border:    #24243a;
  --border-lit:#32324e;

  --text:      #f4f4f8;
  --text-2:    #a8a8bd;
  --text-3:    #6e6e8a;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow:    0 8px 30px rgb(0 0 0 / .5);
  --shadow-lg: 0 24px 70px rgb(0 0 0 / .6);
  --glow:      0 0 0 1px rgb(99 102 241 / .3), 0 12px 48px rgb(99 102 241 / .28);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --maxw: 1160px;
}

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

/* El atributo `hidden` debe ganar SIEMPRE. Sin esto, cualquier regla de
   autor con `display` lo anula silenciosamente y el elemento se muestra
   igualmente — un fallo difícil de ver hasta que aparece en pantalla. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Malla de fondo: profundidad sin imágenes. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgb(99 102 241 / .16), transparent 60%),
    radial-gradient(48rem 34rem at 92% 6%,  rgb(168 85 247 / .12), transparent 60%),
    radial-gradient(40rem 30rem at 50% 100%, rgb(245 158 11 / .07), transparent 60%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / .022) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, #000 40%, transparent 100%);
  pointer-events: none;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.028em; line-height: 1.12; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

::selection { background: var(--brand-500); color: #fff; }

/* ── Layout ─────────────────────────────────────────────────────────── */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }

section { position: relative; padding: 104px 0; }
@media (max-width: 760px) { section { padding: 68px 0; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand-300);
  padding: 6px 14px; border-radius: 999px;
  background: rgb(99 102 241 / .1);
  border: 1px solid rgb(99 102 241 / .22);
}

.section-head { max-width: 660px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin: 18px 0 14px; }
.section-head p { color: var(--text-2); font-size: 1.08rem; }

.grad {
  background: linear-gradient(115deg, var(--brand-300) 0%, #c4b5fd 42%, var(--accent-400) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Botones ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; box-shadow: var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgb(99 102 241 / .5), 0 18px 60px rgb(99 102 241 / .42); }

.btn-ghost { background: rgb(255 255 255 / .04); border-color: var(--border-lit); color: var(--text); }
.btn-ghost:hover { background: rgb(255 255 255 / .08); border-color: var(--brand-500); transform: translateY(-2px); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent-400), var(--accent-500));
  color: #1a1200; box-shadow: 0 0 0 1px rgb(245 158 11 / .3), 0 12px 40px rgb(245 158 11 / .25);
}
.btn-accent:hover { transform: translateY(-2px); }

.btn-lg { padding: 16px 34px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Tarjetas ───────────────────────────────────────────────────────── */

.card {
  background: linear-gradient(160deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.card:hover { border-color: var(--border-lit); transform: translateY(-4px); box-shadow: var(--shadow); }

/* ── Navegación ─────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: blur(16px) saturate(160%);
  background: rgb(8 8 12 / .72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgb(8 8 12 / .9); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.logo { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.16rem; letter-spacing: -.03em; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  display: grid; place-items: center;
  box-shadow: 0 4px 18px rgb(99 102 241 / .45);
}
.logo-mark svg { width: 17px; height: 17px; }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-2); font-size: .93rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 900px) { .nav-links .hide-sm { display: none; } }

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero { padding: 92px 0 76px; text-align: center; }
.hero h1 { font-size: clamp(2.5rem, 6.4vw, 4.6rem); margin: 26px auto 22px; max-width: 15ch; }
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--text-2); max-width: 60ch; margin: 0 auto 38px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-note { margin-top: 20px; font-size: .87rem; color: var(--text-3); }

/* Ondas del hero */
.waveform { display: flex; align-items: center; justify-content: center; gap: 4px; height: 68px; margin: 44px auto 0; max-width: 560px; }
.waveform span {
  width: 4px; border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-700));
  animation: wave 1.5s ease-in-out infinite;
  opacity: .55;
}
@keyframes wave { 0%, 100% { height: 9px; } 50% { height: var(--h, 40px); } }

/* ── Demo en vivo ───────────────────────────────────────────────────── */

.demo-card {
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border-lit);
  border-radius: var(--radius-xl);
  padding: 34px;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.demo-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(30rem 18rem at 70% -10%, rgb(99 102 241 / .14), transparent 70%);
}
.demo-grid { display: grid; grid-template-columns: 1.35fr .95fr; gap: 30px; position: relative; }
@media (max-width: 880px) { .demo-grid { grid-template-columns: 1fr; } }

.field { display: block; margin-bottom: 18px; }
.field-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin-bottom: 9px; letter-spacing: .02em; }

textarea, input[type="text"], input[type="email"], input[type="password"], select {
  width: 100%; padding: 13px 16px;
  background: rgb(0 0 0 / .38);
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  color: var(--text); font-family: var(--font); font-size: .96rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
  resize: vertical;
}
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgb(99 102 241 / .18);
  background: rgb(0 0 0 / .5);
}
textarea::placeholder, input::placeholder { color: var(--text-3); }

.voice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.voice-opt {
  padding: 13px 15px; border-radius: var(--radius);
  border: 1px solid var(--border); background: rgb(0 0 0 / .28);
  cursor: pointer; transition: all .2s var(--ease); text-align: left;
  color: var(--text);
}
.voice-opt:hover { border-color: var(--border-lit); background: rgb(255 255 255 / .04); }
.voice-opt.active { border-color: var(--brand-500); background: rgb(99 102 241 / .14); box-shadow: 0 0 0 2px rgb(99 102 241 / .16); }
.voice-opt strong { display: block; font-size: .93rem; font-weight: 600; }
.voice-opt small { color: var(--text-3); font-size: .78rem; }

.player {
  margin-top: 20px; padding: 18px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: rgb(0 0 0 / .34);
  display: none;
}
.player.on { display: block; animation: fade-up .45s var(--ease-out); }
.player audio { width: 100%; }
.player-meta { display: flex; gap: 16px; margin-top: 12px; font-size: .8rem; color: var(--text-3); flex-wrap: wrap; }

.hint { font-size: .82rem; color: var(--text-3); margin-top: 12px; }
.err { color: #fca5a5; font-size: .87rem; margin-top: 12px; display: none; }
.err.on { display: block; }

/* ── Precios ────────────────────────────────────────────────────────── */

.toggle-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 44px; }
.toggle {
  position: relative; width: 54px; height: 30px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-lit); cursor: pointer;
  transition: background .25s;
}
.toggle.on { background: var(--brand-600); border-color: var(--brand-500); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  transition: transform .28s var(--ease);
}
.toggle.on::after { transform: translateX(24px); }
.toggle-label { font-size: .93rem; color: var(--text-2); font-weight: 500; }
.toggle-label.active { color: var(--text); }
.save-pill {
  font-size: .74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: rgb(52 211 153 / .16); color: var(--ok-400); border: 1px solid rgb(52 211 153 / .3);
}

.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
@media (max-width: 1080px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .plans { grid-template-columns: 1fr; } }

.plan { display: flex; flex-direction: column; position: relative; }
.plan.featured {
  border-color: var(--brand-500);
  background: linear-gradient(160deg, rgb(99 102 241 / .13), var(--surface));
  box-shadow: var(--glow);
}
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; white-space: nowrap;
}
.plan h3 { font-size: 1.16rem; margin-bottom: 6px; }
.plan-desc { font-size: .84rem; color: var(--text-3); min-height: 34px; }
.plan-price { margin: 18px 0 6px; display: flex; align-items: baseline; gap: 5px; }
.plan-price .amt { font-size: 2.5rem; font-weight: 700; letter-spacing: -.04em; }
.plan-price .per { font-size: .87rem; color: var(--text-3); }
.plan-annual { font-size: .78rem; color: var(--ok-400); min-height: 20px; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 24px; display: grid; gap: 11px; flex: 1; }
.plan li { display: flex; gap: 10px; font-size: .89rem; color: var(--text-2); line-height: 1.45; }
.plan li svg { flex-shrink: 0; width: 15px; height: 15px; margin-top: 4px; color: var(--brand-400); }

/* ── Calculadora de reparto ─────────────────────────────────────────── */

.calc {
  background: linear-gradient(150deg, rgb(245 158 11 / .07), var(--surface));
  border: 1px solid rgb(245 158 11 / .22);
  border-radius: var(--radius-xl);
  padding: 38px;
}
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .calc-grid { grid-template-columns: 1fr; gap: 28px; } }

input[type="range"] {
  width: 100%; height: 6px; border-radius: 999px; appearance: none;
  background: linear-gradient(90deg, var(--accent-500) var(--pct, 30%), var(--surface-2) var(--pct, 30%));
  cursor: pointer; margin: 14px 0 6px;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-400); border: 3px solid var(--bg);
  box-shadow: 0 3px 14px rgb(245 158 11 / .5); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--bg);
  background: var(--accent-400); box-shadow: 0 3px 14px rgb(245 158 11 / .5); cursor: grab;
}

.calc-out { text-align: center; padding: 30px; border-radius: var(--radius-lg); background: rgb(0 0 0 / .34); border: 1px solid var(--border); }
.calc-amount {
  font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 700; letter-spacing: -.045em;
  background: linear-gradient(120deg, var(--accent-400), #fcd34d);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

/* ── Código ─────────────────────────────────────────────────────────── */

.code {
  background: #06060a; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; border-bottom: 1px solid var(--border); background: rgb(255 255 255 / .022);
}
.code-tabs { display: flex; gap: 4px; }
.code-tab {
  padding: 5px 13px; border-radius: 7px; font-size: .8rem; font-weight: 500;
  color: var(--text-3); background: transparent; border: none; transition: all .18s;
}
.code-tab:hover { color: var(--text-2); }
.code-tab.active { background: rgb(99 102 241 / .18); color: var(--brand-300); }
.code pre { margin: 0; padding: 20px; overflow-x: auto; font-family: var(--mono); font-size: .84rem; line-height: 1.72; }
.code code { font-family: var(--mono); }
.tok-key { color: #c084fc; } .tok-str { color: #86efac; }
.tok-fn  { color: #7dd3fc; } .tok-com { color: #52526a; font-style: italic; }
.tok-num { color: #fbbf24; }

.copy-btn {
  background: rgb(255 255 255 / .05); border: 1px solid var(--border-lit);
  color: var(--text-2); padding: 5px 12px; border-radius: 7px; font-size: .78rem;
  transition: all .18s;
}
.copy-btn:hover { color: var(--text); border-color: var(--brand-500); }

/* ── Piezas varias ──────────────────────────────────────────────────── */

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 940px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }

.feat-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: rgb(99 102 241 / .13); border: 1px solid rgb(99 102 241 / .24);
  margin-bottom: 16px;
}
.feat-icon svg { width: 20px; height: 20px; color: var(--brand-300); }
.card h3 { font-size: 1.04rem; margin-bottom: 9px; }
.card p { color: var(--text-2); font-size: .9rem; line-height: 1.6; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat-num { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: .83rem; color: var(--text-3); margin-top: 4px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
@media (max-width: 940px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 12px; }
.step-n {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  font-weight: 700; font-size: .93rem; margin-bottom: 14px; box-shadow: 0 4px 16px rgb(99 102 241 / .38);
}
.step h4 { font-size: 1rem; margin-bottom: 7px; }
.step p { font-size: .87rem; color: var(--text-2); }

.cta-band {
  border-radius: var(--radius-xl); padding: 60px 40px; text-align: center;
  background: linear-gradient(140deg, rgb(99 102 241 / .18), rgb(168 85 247 / .1), rgb(245 158 11 / .07));
  border: 1px solid var(--border-lit);
  position: relative; overflow: hidden;
}
.cta-band h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: 16px; }
.cta-band p { color: var(--text-2); max-width: 52ch; margin: 0 auto 30px; }

footer { border-top: 1px solid var(--border); padding: 52px 0 40px; margin-top: 40px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
footer h5 { font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); margin: 0 0 14px; font-weight: 600; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
footer a { color: var(--text-2); font-size: .88rem; transition: color .18s; }
footer a:hover { color: var(--text); }
.foot-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .83rem; color: var(--text-3); }

.badge-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; color: var(--text-2);
  padding: 7px 13px; border-radius: 999px;
  background: rgb(255 255 255 / .035); border: 1px solid var(--border);
}
.badge svg { width: 13px; height: 13px; color: var(--ok-400); }

/* ── Animaciones de entrada ─────────────────────────────────────────── */

@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Mejora progresiva: sin JS el contenido SIEMPRE es visible. Solo cuando
   el script confirma que corre (.js en <html>) se aplica el estado inicial
   oculto. Evita que un fallo de JS deje la página en blanco. */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ── Accesibilidad ──────────────────────────────────────────────────── */

:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 3px; border-radius: 4px; }

.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; top: -60px; left: 16px; z-index: 100;
  background: var(--brand-600); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 10px;
  transition: top .2s;
}
.skip-link:focus { top: 0; }
