/* ══════════════════════════════════════════════════════════════
   FlowiLead v5 — AI-native components (loaded after landing.css)
   - .flow-current     flowing data particles (CSS-only)
   - .pillar-grid      3 brand pillars (Flujo · Sistema · Conversión)
   - .product-stack    Core / Engine / Intelligence modular cards
   - .vs-grid          Caos vs Flujo comparison
   - .glass            evolved glassmorphism surface
   ══════════════════════════════════════════════════════════════ */

/* Section wrapper used by all v5 sections */
.section { padding: 96px 0; position: relative; }
.section--alt { background: linear-gradient(180deg, var(--bg-dark), var(--bg-surface) 50%, var(--bg-dark)); }
.section__head { text-align: center; margin-bottom: 64px; max-width: 760px; margin-left: auto; margin-right: auto; }
.section__eyebrow {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.5px;
    text-transform: uppercase; margin-bottom: 16px;
    border: 1px solid var(--accent-glow);
}
.section__title {
    font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700;
    letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 12px;
}
.section__title .grad-text {
    background: var(--grad-flow); -webkit-background-clip: text;
    background-clip: text; color: transparent;
}
.section__subtitle { font-size: 1.05rem; color: var(--text-secondary); }

/* ── Glass surface (evolved glassmorphism) ── */
.glass {
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border: 1px solid var(--border);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.04);
    position: relative; overflow: hidden;
}

/* ── Brand pillars (Flujo · Sistema · Conversión) ── */
.pillar-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
    max-width: 980px; margin: 0 auto;
}
.pillar {
    padding: 28px 24px; border-radius: var(--radius);
    background: var(--bg-card); border: 1px solid var(--border);
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    position: relative; overflow: hidden;
}
.pillar::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--pillar-color, var(--accent));
    transform: scaleX(0.4); transform-origin: left; transition: transform 0.4s;
}
.pillar:hover { transform: translateY(-4px); border-color: var(--pillar-color, var(--accent)); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.pillar:hover::before { transform: scaleX(1); }
.pillar--flow    { --pillar-color: var(--accent); }
.pillar--system  { --pillar-color: var(--intel); }
.pillar--convert { --pillar-color: var(--convert); }
.pillar__icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(108,62,255,0.18);
    color: var(--pillar-color); margin-bottom: 16px;
    font-size: 1.4rem; font-weight: 700;
}
.pillar--system  .pillar__icon { background: rgba(45,123,255,0.18); }
.pillar--convert .pillar__icon { background: rgba(0,230,210,0.18); }
.pillar__title { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.pillar__text { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.55; }

/* ── Product Stack: Core / Engine / Intelligence ── */
.product-stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.product-card {
    padding: 32px 26px; border-radius: var(--radius-lg);
    background: var(--bg-card); border: 1px solid var(--border);
    position: relative; overflow: hidden; cursor: default;
    transition: all 0.3s ease;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--card-color, var(--accent)); }
.product-card--core   { --card-color: var(--accent); }
.product-card--engine { --card-color: var(--intel); }
.product-card--intel  { --card-color: var(--convert); }
.product-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.product-card__badge {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.95rem; letter-spacing: -0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.product-card--core   .product-card__badge { background: linear-gradient(135deg, #6C3EFF, #00E6D2); }
.product-card--engine .product-card__badge { background: linear-gradient(135deg, #2D7BFF, #6C3EFF); }
.product-card--intel  .product-card__badge { background: linear-gradient(135deg, #00E6D2, #2D7BFF); }
.product-card__name { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.product-card__short { font-size: 0.82rem; color: var(--text-muted); }
.product-card__bullets { list-style: none; padding: 0; margin: 0; }
.product-card__bullets li {
    padding: 8px 0; padding-left: 22px; position: relative;
    font-size: 0.92rem; color: var(--text-secondary); line-height: 1.5;
    border-top: 1px solid var(--border-subtle);
}
.product-card__bullets li:first-child { border-top: none; }
.product-card__bullets li::before {
    content: ''; position: absolute; left: 0; top: 14px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--card-color, var(--accent));
    box-shadow: 0 0 8px var(--card-color, var(--accent));
}

/* ── Caos vs Flujo (visual narrative) ── */
.vs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; align-items: stretch; }
.vs-panel {
    padding: 28px 24px; border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative; overflow: hidden; min-height: 320px;
}
.vs-panel--chaos {
    background: linear-gradient(135deg, rgba(239,68,68,0.06), rgba(251,191,36,0.04));
    border-color: rgba(239,68,68,0.18);
}
.vs-panel--flow {
    background: linear-gradient(135deg, rgba(108,62,255,0.06), rgba(0,230,210,0.06));
    border-color: rgba(108,62,255,0.22);
    box-shadow: var(--shadow-flow);
}
.vs-panel__label {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.vs-panel--chaos .vs-panel__label { background: rgba(239,68,68,0.15); color: #FCA5A5; }
.vs-panel--flow  .vs-panel__label { background: rgba(0,230,210,0.18); color: #6EE7B7; }
.vs-panel__title { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.vs-panel__sub { font-size: 0.92rem; color: var(--text-secondary); margin-bottom: 24px; }

/* Particle stage — chaos = scattered jitter, flow = ordered current */
.vs-stage {
    position: relative; height: 140px; border-radius: 12px;
    background: rgba(0,0,0,0.25); overflow: hidden;
    border: 1px solid rgba(255,255,255,0.04);
}
.vs-particle {
    position: absolute; width: 8px; height: 8px; border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}
.vs-panel--chaos .vs-particle { color: #EF4444; background: currentColor; opacity: 0.7; animation: chaosJitter 2s ease-in-out infinite; }
.vs-panel--chaos .vs-particle:nth-child(1)  { top: 12%; left: 8%;  animation-delay: 0s; }
.vs-panel--chaos .vs-particle:nth-child(2)  { top: 60%; left: 22%; animation-delay: 0.3s; color: #FBBF24; }
.vs-panel--chaos .vs-particle:nth-child(3)  { top: 30%; left: 40%; animation-delay: 0.7s; }
.vs-panel--chaos .vs-particle:nth-child(4)  { top: 75%; left: 55%; animation-delay: 0.1s; color: #FBBF24; }
.vs-panel--chaos .vs-particle:nth-child(5)  { top: 45%; left: 70%; animation-delay: 0.5s; }
.vs-panel--chaos .vs-particle:nth-child(6)  { top: 18%; left: 85%; animation-delay: 0.9s; color: #FBBF24; }
.vs-panel--chaos .vs-particle:nth-child(7)  { top: 80%; left: 88%; animation-delay: 0.2s; }
.vs-panel--chaos .vs-particle:nth-child(8)  { top: 55%; left: 12%; animation-delay: 0.4s; color: #FBBF24; }
.vs-panel--chaos .vs-particle:nth-child(9)  { top: 25%; left: 60%; animation-delay: 0.8s; }
.vs-panel--chaos .vs-particle:nth-child(10) { top: 70%; left: 35%; animation-delay: 0.6s; color: #FBBF24; }

@keyframes chaosJitter {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    25%      { transform: translate(8px, -6px) scale(1.1); opacity: 0.85; }
    50%      { transform: translate(-4px, 5px) scale(0.9); opacity: 0.4; }
    75%      { transform: translate(6px, 3px) scale(1.05); opacity: 0.7; }
}

.vs-panel--flow .vs-particle { color: var(--accent); background: currentColor; opacity: 0; animation: flowTravel 3.2s linear infinite; }
.vs-panel--flow .vs-particle:nth-child(1) { top: 22%; animation-delay: 0s;   color: #6C3EFF; }
.vs-panel--flow .vs-particle:nth-child(2) { top: 22%; animation-delay: 0.6s; color: #2D7BFF; }
.vs-panel--flow .vs-particle:nth-child(3) { top: 22%; animation-delay: 1.2s; color: #00E6D2; }
.vs-panel--flow .vs-particle:nth-child(4) { top: 50%; animation-delay: 0.3s; color: #6C3EFF; }
.vs-panel--flow .vs-particle:nth-child(5) { top: 50%; animation-delay: 0.9s; color: #2D7BFF; }
.vs-panel--flow .vs-particle:nth-child(6) { top: 50%; animation-delay: 1.5s; color: #00E6D2; }
.vs-panel--flow .vs-particle:nth-child(7) { top: 78%; animation-delay: 0.5s; color: #6C3EFF; }
.vs-panel--flow .vs-particle:nth-child(8) { top: 78%; animation-delay: 1.1s; color: #2D7BFF; }
.vs-panel--flow .vs-particle:nth-child(9) { top: 78%; animation-delay: 1.7s; color: #00E6D2; }
.vs-panel--flow .vs-particle:nth-child(10){ top: 78%; animation-delay: 2.3s; color: #00E6D2; }

@keyframes flowTravel {
    0%   { left: -10px; opacity: 0; transform: scale(0.6); }
    10%  { opacity: 1; transform: scale(1); }
    90%  { opacity: 1; transform: scale(1); }
    100% { left: calc(100% + 10px); opacity: 0; transform: scale(0.6); }
}

.vs-stage__lanes {
    position: absolute; inset: 0; pointer-events: none;
    display: flex; flex-direction: column; justify-content: space-around;
    padding: 12px 14px;
}
.vs-stage__lane-label {
    font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.4px;
    text-transform: uppercase; opacity: 0.6;
}

.vs-panel__metrics { display: flex; gap: 16px; margin-top: 16px; }
.vs-metric {
    flex: 1; padding: 10px 12px; border-radius: 8px;
    background: rgba(0,0,0,0.25); border: 1px solid var(--border-subtle);
}
.vs-metric__label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.vs-metric__value { font-size: 1.15rem; font-weight: 700; margin-top: 4px; }
.vs-panel--chaos .vs-metric__value { color: #FCA5A5; }
.vs-panel--flow  .vs-metric__value { color: #6EE7B7; }

/* ── Flow Current — hero data flow visualization ── */
.flow-current {
    position: relative; height: 80px; margin: 32px 0;
    border-radius: 999px; overflow: hidden;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border-subtle);
}
.flow-current::before {
    content: ''; position: absolute; inset: 0;
    background: var(--grad-flow); opacity: 0.18; filter: blur(12px);
}
.flow-current__particle {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--p-color, var(--accent));
    box-shadow: 0 0 12px var(--p-color, var(--accent));
    animation: flowParticle 4s linear infinite;
}
.flow-current__particle:nth-child(1) { --p-color: #6C3EFF; animation-delay: 0s; }
.flow-current__particle:nth-child(2) { --p-color: #6C3EFF; animation-delay: 0.4s; }
.flow-current__particle:nth-child(3) { --p-color: #2D7BFF; animation-delay: 0.9s; }
.flow-current__particle:nth-child(4) { --p-color: #2D7BFF; animation-delay: 1.4s; }
.flow-current__particle:nth-child(5) { --p-color: #00E6D2; animation-delay: 2.0s; }
.flow-current__particle:nth-child(6) { --p-color: #00E6D2; animation-delay: 2.6s; }
.flow-current__particle:nth-child(7) { --p-color: #00E6D2; animation-delay: 3.1s; }

@keyframes flowParticle {
    0%   { left: -12px; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { left: calc(100% + 12px); opacity: 0; }
}

.flow-current__stages {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; pointer-events: none;
}
.flow-current__stage {
    font-size: 0.72rem; font-weight: 600; letter-spacing: 0.5px;
    text-transform: uppercase; color: var(--text-secondary);
    background: rgba(0,0,0,0.4); padding: 4px 10px; border-radius: 999px;
    border: 1px solid var(--border-subtle); backdrop-filter: blur(8px);
}

body.anim-off .vs-particle,
body.anim-off .flow-current__particle { animation: none !important; }
body.anim-off .vs-panel--flow .vs-particle,
body.anim-off .flow-current__particle { opacity: 0.7; }

/* ── Responsive ── */
@media (max-width: 880px) {
    .pillar-grid, .product-stack, .vs-grid { grid-template-columns: 1fr; }
    .section { padding: 64px 0; }
}
