/* ============================================================
   BALEXUS — Sistema visual "Partner Premium" (2026)
   Se carga después de styles.css/segments.css:
   1) Re-tokeniza la paleta global (todas las páginas heredan).
   2) Aporta los componentes px-* de la nueva home.
   ============================================================ */

:root {
    --bg-primary: #070B12;
    --bg-secondary: #0D131D;
    --bg-card: #0D131D;
    --bg-card-hover: #101826;
    --accent-primary: #38D6C4;
    --accent-secondary: #7C6BFF;
    --accent-gradient: linear-gradient(135deg, #38D6C4, #7C6BFF);
    --text-primary: #EAF0F7;
    --text-secondary: #94A0B4;
    --text-accent: #38D6C4;
    --border: rgba(151, 178, 209, 0.10);
    --border-hover: rgba(56, 214, 196, 0.40);
    --glow: rgba(56, 214, 196, 0.18);
    --glow-strong: rgba(56, 214, 196, 0.38);
    /* tokens propios del sistema premium */
    --px-panel-2: #101826;
    --px-line: rgba(151, 178, 209, 0.10);
    --px-line-strong: rgba(151, 178, 209, 0.22);
    --px-faint: #55617A;
    --px-warm: #E8B86B;
    --px-accent-dim: rgba(56, 214, 196, 0.12);
    --px-mono: 'JetBrains Mono', 'Cascadia Code', ui-monospace, Consolas, monospace;
    /* firma del sistema: esquinas asimétricas */
    --px-r-tile: 40px 10px 40px 10px;
    --px-r-tile-alt: 10px 48px 10px 48px;
}

/* Grid fino de fondo en toda la web */
body::before {
    content: "";
    position: fixed; inset: 0;
    background-image:
        linear-gradient(var(--px-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--px-line) 1px, transparent 1px);
    background-size: 88px 88px; opacity: 0.5;
    mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, black 25%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 0%, black 25%, transparent 70%);
    pointer-events: none; z-index: 0;
}

::selection { background: var(--accent-primary); color: #041210; }

/* ---------- Marca nexo ---------- */
.nav-logo { display: flex; align-items: center; gap: 2px; font-weight: 700; font-size: 20px; letter-spacing: -0.015em; color: var(--text-primary); }
.nav-logo .nexo-mark { display: block; margin: 0 2px; }
.footer-brand .nav-logo { font-size: 18px; }

/* ---------- Navbar: alineación vertical con el CTA ---------- */
.nav-menu { align-items: center; }
.nav-menu > li { display: flex; align-items: center; }

/* ---------- Navbar CTA ---------- */
.nav-cta-btn {
    font-size: 14px; font-weight: 600; color: #041210 !important;
    background: var(--accent-primary); border-radius: 8px; padding: 9px 18px;
    transition: transform 0.15s, box-shadow 0.15s;
    display: inline-block; cursor: pointer; border: none; font-family: inherit;
}
.nav-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--glow-strong); color: #041210 !important; }

/* ============================================================
   Componentes de la home premium (px-*)
   ============================================================ */
.px-wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 1; }
.px-section { padding: 96px 0; position: relative; }
.px-eyebrow { font-family: var(--px-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-primary); margin-bottom: 14px; }
.px-h2 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 750; letter-spacing: -0.028em; line-height: 1.12; text-wrap: balance; color: var(--text-primary); }
.px-section-head { max-width: 640px; margin-bottom: 48px; }
.px-section-head p { color: var(--text-secondary); margin-top: 16px; font-size: 16.5px; }

/* ---------- hero ---------- */
.px-hero { padding: 84px 0 76px; position: relative; }
.px-hero .px-wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.px-hero-tag {
    font-family: var(--px-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--accent-primary); display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid rgba(56, 214, 196, 0.3); background: var(--px-accent-dim);
    padding: 6px 12px; border-radius: 100px; margin-bottom: 28px;
}
.px-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-primary); }
.px-dot--pulse { animation: pxPulse 2.4s ease-in-out infinite; }
@keyframes pxPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.px-h1 { font-size: clamp(38px, 4.8vw, 60px); line-height: 1.06; font-weight: 800; letter-spacing: -0.032em; text-wrap: balance; color: var(--text-primary); }
.px-h1 .px-typed-wrap { color: var(--accent-primary); }
.px-caret { display: inline-block; width: 3px; height: 0.9em; background: var(--accent-primary); vertical-align: -0.1em; margin-left: 2px; animation: pxBlink 1s steps(1) infinite; }
@keyframes pxBlink { 50% { opacity: 0; } }
.px-lede { color: var(--text-secondary); font-size: 17.5px; margin: 24px 0 34px; max-width: 50ch; }
.px-lede em { color: var(--text-primary); font-style: normal; font-weight: 600; }
.px-cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.px-btn {
    display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
    padding: 14px 26px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
    font-family: inherit; background: none;
}
.px-btn--primary { background: var(--accent-primary); color: #041210; }
.px-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px var(--glow-strong); color: #041210; }
.px-btn--ghost { border-color: var(--px-line-strong); color: var(--text-primary); }
.px-btn--ghost:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* slots de imagen con tratamiento orgánico */
.px-img {
    position: relative; overflow: hidden;
    border-radius: var(--px-r-tile);
    background: linear-gradient(160deg, #131C2C, #0A1019 65%);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55), 0 0 80px rgba(56, 214, 196, 0.07);
}
.px-img::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(200deg, transparent 55%, rgba(7, 11, 18, 0.55) 100%),
        radial-gradient(140% 110% at 50% 40%, transparent 62%, rgba(7, 11, 18, 0.8) 100%);
}
.px-img::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background-image: linear-gradient(rgba(151, 178, 209, 0.06) 1px, transparent 1px);
    background-size: 100% 28px; mix-blend-mode: overlay; pointer-events: none;
}
.px-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.92) contrast(1.03); }
.px-hero-visual { position: relative; }
.px-hero-visual .px-img { aspect-ratio: 4/3.4; }
.px-chip {
    position: absolute; z-index: 3; font-family: var(--px-mono); font-size: 10.5px;
    background: rgba(8, 12, 19, 0.88); border: 1px solid rgba(151, 178, 209, 0.16);
    border-left: 2px solid var(--accent-primary);
    border-radius: 6px; padding: 7px 12px; color: var(--text-secondary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px);
}
.px-chip .v { color: var(--accent-primary); }
.px-chip--a { top: 18px; right: -14px; animation: pxFloat 6s ease-in-out infinite; }
.px-chip--b { bottom: 64px; left: -18px; animation: pxFloat 7s ease-in-out 1.2s infinite; }
@keyframes pxFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- métricas ---------- */
.px-stats { border-top: 1px solid var(--px-line); border-bottom: 1px solid var(--px-line); background: rgba(13, 19, 29, 0.6); }
.px-stats .px-wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.px-stat { padding: 30px 24px; border-right: 1px solid var(--px-line); }
.px-stat:first-child { padding-left: 0; }
.px-stat:last-child { border-right: none; }
.px-stat-num { font-family: var(--px-mono); font-variant-numeric: tabular-nums; font-size: clamp(28px, 3vw, 38px); font-weight: 600; color: var(--accent-primary); letter-spacing: -0.02em; }
.px-stat-lbl { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* ---------- soluciones (tarjetas con foto) ---------- */
.px-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.px-card {
    border: 1px solid var(--px-line); border-radius: 14px; overflow: hidden;
    background: var(--bg-card); transition: transform 0.2s, border-color 0.2s;
    display: flex; flex-direction: column;
}
.px-card:hover { transform: translateY(-5px); border-color: var(--border-hover); }
.px-card .px-img { border-radius: 0; aspect-ratio: 16/10; box-shadow: none; }
.px-card .px-img::before { background: linear-gradient(180deg, transparent 55%, rgba(13, 19, 29, 0.96) 100%); }
.px-card-body { padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.px-card-body h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; color: var(--text-primary); }
.px-card-body p { color: var(--text-secondary); font-size: 14.5px; flex: 1; }
.px-card-link { font-size: 14px; font-weight: 600; color: var(--accent-primary); }
.px-card-link::after { content: " →"; }

/* ---------- terminal de agentes ---------- */
.px-proof { background: rgba(13, 19, 29, 0.5); border-top: 1px solid var(--px-line); border-bottom: 1px solid var(--px-line); }
.px-proof .px-wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
/* evita que el contenido nowrap del terminal robe ancho a la otra columna */
.px-proof .px-wrap > *, .px-hero .px-wrap > *, .px-proceso > *, .px-founder > * { min-width: 0; }
.px-proof-copy p { color: var(--text-secondary); margin: 18px 0; font-size: 16.5px; }
.px-proof-copy p em { color: var(--text-primary); font-style: normal; font-weight: 600; }
.px-points { list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 14px; padding: 0; }
.px-points li { display: block; position: relative; padding-left: 24px; color: var(--text-secondary); font-size: 15px; }
.px-points li::before { content: "✓"; color: var(--accent-primary); font-family: var(--px-mono); position: absolute; left: 0; top: 1px; }
.px-points li b { color: var(--text-primary); font-weight: 600; }
.px-term { border: 1px solid var(--px-line-strong); border-radius: 12px; background: #060B12; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5); overflow: hidden; }
.px-term-bar { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--px-line); background: var(--px-panel-2); font-family: var(--px-mono); font-size: 12px; color: var(--text-secondary); }
.px-term-bar .lights { display: flex; gap: 6px; }
.px-term-bar .lights i { width: 10px; height: 10px; border-radius: 50%; background: var(--px-faint); }
.px-term-bar .lights i:first-child { background: var(--accent-primary); }
.px-term-body { font-family: var(--px-mono); font-size: 13px; line-height: 1.95; padding: 18px 20px; min-height: 262px; max-height: 262px; overflow: hidden; }
.px-term-body .ln { display: flex; gap: 13px; opacity: 0; animation: pxLnIn 0.25s ease forwards; }
@keyframes pxLnIn { to { opacity: 1; } }
.px-term-body .t { color: var(--px-faint); flex-shrink: 0; }
.px-term-body .agent { color: var(--accent-primary); flex-shrink: 0; min-width: 19ch; }
.px-term-body .msg { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-term-body .run { color: var(--px-warm); }

/* ---------- proceso ---------- */
.px-proceso { display: grid; grid-template-columns: 0.72fr 1.28fr; gap: 64px; align-items: center; }
.px-proceso .px-img { aspect-ratio: 4/5; border-radius: var(--px-r-tile-alt); }
.px-steps { display: grid; grid-template-columns: 1fr; gap: 30px; counter-reset: pxstep; }
.px-step { border-top: 2px solid var(--px-line-strong); padding-top: 22px; }
.px-step::before { counter-increment: pxstep; content: "0" counter(pxstep); font-family: var(--px-mono); font-size: 13px; color: var(--accent-primary); display: block; margin-bottom: 12px; }
.px-step h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.px-step p { color: var(--text-secondary); font-size: 14.5px; }

/* ---------- founder ---------- */
.px-founder { display: grid; grid-template-columns: 0.62fr 1.38fr; gap: 56px; align-items: center; }
.px-founder .px-img { aspect-ratio: 4/4.6; border-radius: var(--px-r-tile-alt); }
.px-quote { font-size: clamp(21px, 2.4vw, 28px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.35; text-wrap: balance; color: var(--text-primary); }
.px-quote .a { color: var(--accent-primary); }
.px-founder-meta { margin-top: 26px; color: var(--text-secondary); font-size: 15px; }
.px-founder-meta b { color: var(--text-primary); display: block; font-size: 16px; }
.px-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.px-badges span { font-family: var(--px-mono); font-size: 11px; color: var(--text-secondary); border: 1px solid var(--px-line-strong); border-radius: 100px; padding: 5px 12px; }

/* ---------- CTA final ---------- */
.px-final { border-top: 1px solid var(--px-line); text-align: center; padding: 130px 0; position: relative; overflow: hidden; }
.px-final::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(60% 90% at 50% 100%, rgba(56, 214, 196, 0.10), transparent 65%); pointer-events: none; }
.px-final-bg { position: absolute; inset: 0; z-index: 0; }
.px-final-bg img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0.38; filter: saturate(0.9);
    mask-image: radial-gradient(85% 110% at 50% 55%, black 25%, transparent 82%);
    -webkit-mask-image: radial-gradient(85% 110% at 50% 55%, black 25%, transparent 82%);
}
.px-final .px-wrap { z-index: 2; }
.px-final .px-h2 { max-width: 24ch; margin: 0 auto 18px; }
.px-final p { color: var(--text-secondary); max-width: 46ch; margin: 0 auto 36px; }
.px-final .px-cta-row { justify-content: center; }
.px-micro { font-family: var(--px-mono); font-size: 12px; color: var(--px-faint); margin-top: 26px; }
.px-micro b { color: var(--accent-primary); font-weight: 500; }

/* ============================================================
   Páginas de segmento (empresas / pymes / individuos)
   ============================================================ */
.px-page-hero { padding: 72px 0 64px; position: relative; }
.px-page-hero .px-wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.px-page-hero .px-wrap > * { min-width: 0; }
.px-page-hero .px-h1 { font-size: clamp(34px, 4.4vw, 54px); }
.px-page-hero .px-lede { font-size: 17px; margin: 20px 0 30px; max-width: 48ch; }
.px-page-hero .px-img { aspect-ratio: 16/11; }

.px-stats--3 { grid-template-columns: repeat(3, 1fr) !important; }

.px-sec-split { display: grid; grid-template-columns: 1fr 0.85fr; gap: 52px; align-items: center; margin-bottom: 44px; }
.px-sec-split--rev { grid-template-columns: 0.85fr 1fr; }
.px-sec-split .px-img { aspect-ratio: 16/10; border-radius: var(--px-r-tile-alt); }
.px-sec-split .px-section-head { margin-bottom: 0; }
.px-sec-split > * { min-width: 0; }

.px-probs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.px-probs--3 { grid-template-columns: repeat(3, 1fr); }
.px-prob { border: 1px solid var(--px-line); border-radius: 14px; background: var(--bg-card); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.2s, border-color 0.2s; }
.px-prob:hover { transform: translateY(-4px); border-color: var(--border-hover); }
.px-prob-q { padding: 22px 24px; border-bottom: 1px solid var(--px-line); background: rgba(232, 184, 107, 0.045); }
.px-prob-q .tag { font-family: var(--px-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--px-warm); display: block; margin-bottom: 10px; }
.px-prob-q p { color: var(--text-secondary); font-size: 15px; font-style: italic; }
.px-prob-a { padding: 22px 24px; flex: 1; }
.px-prob-a .tag { font-family: var(--px-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-primary); display: block; margin-bottom: 10px; }
.px-prob-a p { color: var(--text-primary); font-size: 15px; }

.px-svcs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.px-svc { border: 1px solid var(--px-line); border-radius: 12px; background: var(--bg-card); padding: 24px 22px; transition: transform 0.2s, border-color 0.2s; }
.px-svc:hover { transform: translateY(-4px); border-color: var(--border-hover); }
.px-svc code { font-family: var(--px-mono); font-size: 10.5px; color: var(--px-faint); display: block; margin-bottom: 12px; }
.px-svc b { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; display: block; margin-bottom: 6px; color: var(--text-primary); }
.px-svc p { font-size: 13.5px; color: var(--text-secondary); }

.px-band { background: rgba(13, 19, 29, 0.5); border-top: 1px solid var(--px-line); border-bottom: 1px solid var(--px-line); }
.px-pills { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.px-pills span { font-family: var(--px-mono); font-size: 12px; color: var(--accent-primary); border: 1px solid rgba(56, 214, 196, 0.3); background: var(--px-accent-dim); border-radius: 100px; padding: 7px 14px; }

.px-training { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.px-course { border: 1px solid var(--px-line); border-radius: 12px; background: var(--bg-card); padding: 26px 24px; display: flex; flex-direction: column; gap: 8px; }
.px-course .dur { font-family: var(--px-mono); font-size: 11px; color: var(--px-warm); }
.px-course b { font-size: 17px; color: var(--text-primary); }
.px-course p { color: var(--text-secondary); font-size: 14px; flex: 1; }

@media (max-width: 940px) {
    .px-page-hero .px-wrap, .px-sec-split, .px-sec-split--rev, .px-probs, .px-probs--3, .px-training { grid-template-columns: 1fr; }
    .px-svcs { grid-template-columns: 1fr; }
    .px-stats--3 { grid-template-columns: 1fr 1fr !important; }
}

/* ---------- indicador "pensando" del asistente ---------- */
.ai-thinking { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.ai-thinking svg { width: 20px; height: 20px; animation: aiThinkSpin 2.8s ease-in-out infinite; }
.ai-thinking .tk-a { transform-origin: 32px 32px; animation: aiThinkStroke 1.4s ease-in-out infinite; }
.ai-thinking .tk-b { transform-origin: 32px 32px; animation: aiThinkStroke 1.4s ease-in-out 0.7s infinite; }
.ai-thinking .tk-c { animation: aiThinkCore 1.4s ease-in-out infinite; }
.ai-thinking-text { font-size: 13.5px; color: var(--text-secondary); letter-spacing: 0.01em; }
.ai-thinking-text i { font-style: normal; animation: aiThinkDot 1.2s ease-in-out infinite; }
.ai-thinking-text i:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking-text i:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiThinkSpin { 0%, 100% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(90deg) scale(1.08); } }
@keyframes aiThinkStroke { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes aiThinkCore { 0%, 100% { r: 8; opacity: 1; } 50% { r: 5.5; opacity: 0.7; } }
@keyframes aiThinkDot { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .ai-thinking svg, .ai-thinking .tk-a, .ai-thinking .tk-b, .ai-thinking .tk-c, .ai-thinking-text i { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 940px) {
    .px-hero .px-wrap, .px-proof .px-wrap, .px-founder, .px-proceso { grid-template-columns: 1fr; }
    .px-stats .px-wrap { grid-template-columns: repeat(2, 1fr); }
    .px-stat:nth-child(2) { border-right: none; }
    .px-stat:nth-child(-n+2) { border-bottom: 1px solid var(--px-line); }
    .px-cards { grid-template-columns: 1fr; }
    .px-chip--a { right: 8px; }
    .px-chip--b { left: 8px; }
    .px-stat:first-child { padding-left: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    .px-caret, .px-dot--pulse, .px-chip--a, .px-chip--b { animation: none; }
}
