// sections-v2.jsx — Fluentra landing sections (production version)
// Content adapted for Fluentra's real product & plans.
// Pricing: Test (Free), POC ($50), Starter ($500), Custom
// i18n: detects navigator.language → es | en

// ─── i18n ────────────────────────────────────────────────────────────────────
const LANG = (navigator.language || '').toLowerCase().startsWith('es') ? 'es' : 'en';

const T = {
  en: {
    // nav
    how: 'How it works', features: 'Features', demo: 'Demo',
    cases: 'Use cases', pricing: 'Pricing', docs: 'docs ↗',
    signin: 'Sign in', start: 'Start free',
    // hero
    eyebrow: 'Now in production',
    h1a: 'Automate your logic.', h1b: 'React to anything.',
    sub: 'Fluentra is an event-driven workflow engine for backends. Define stateful logic with triggers, conditions, and waits — then run long-lived instances without babysitting a queue.',
    cta1: 'Start building free', cta2: 'Watch 2-min demo',
    trust1: 'Zero infra to manage', trust2: '99.9% uptime', trust3: 'Global', trust4: '$0 to start · usage-based',
    // how
    how_kicker: 'How it works', how_title: 'From event to outcome in three steps',
    how_desc: 'Compose triggers, conditions, and durable waits. Fluentra handles the state, retries, and timing — for as long as it takes.',
    step1_n: '01 / DEFINE', step1_t: 'Sketch the workflow', step1_b: 'Drag and drop nodes — triggers, branches, waits, actions — in the visual editor. No code required.',
    step2_n: '02 / TRIGGER', step2_t: 'Receive any event', step2_b: 'Webhooks, HTTP, or any integration. Each event spawns a stateful instance with its own memory and timeline.',
    step3_n: '03 / RUN', step3_t: 'Run for seconds — or months', step3_b: 'Instances persist across restarts. Wait hours for an event, days for a follow-up, or months for a renewal.',
    // features
    feat_kicker: 'Platform', feat_title: 'Built like infrastructure should be',
    feat_desc: 'Six guarantees that turn brittle cron jobs and tangled queues into durable, observable workflows.',
    f1t: 'Durable waits', f1b: 'Wait minutes, days, or months. Instances survive restarts without losing context.',
    f2t: 'Branching logic', f2b: 'Conditional logic, parallel forks, joins, and sub-flows — all visual, all testable.',
    f3t: 'API actions', f3b: 'Call external REST APIs directly from any node. Capture responses as variables for downstream logic.',
    f4t: 'Multi-tenant', f4b: 'Fully isolated environments per organization with role-based access and per-tenant endpoints.',
    f5t: 'Audit-grade logs', f5b: 'Every transition and side effect is captured. Replay any instance, inspect any state, prove any action.',
    f6t: 'Secure by default', f6b: 'JWT-based auth, per-tenant isolation, and scoped webhook endpoints. Your data never crosses tenant boundaries.',
    // demo
    demo_kicker: 'Live demo', demo_title: 'Speeding truck monitor',
    demo_desc: 'A real workflow: count three speeding events per truck within an hour, then auto-issue a ticket. Watch it run.',
    demo_pause: 'Pause', demo_resume: 'Resume', demo_stream: 'stream',
    demo_reset: 'Reset', demo_watching: 'watching', demo_ticket: 'ticket issued',
    // cases
    cases_kicker: 'Use cases', cases_title: 'Replaces a queue, a cron, and a state machine',
    cases_desc: 'Teams use Fluentra wherever logic outlives a single request.',
    c1t: 'Payments & dunning', c1b: 'Retry failed charges on a schedule, escalate to humans, freeze accounts — all in one durable flow.',
    c2t: 'User onboarding', c2b: 'Drip emails, in-app nudges, sales handoff. Long-lived state per user, branched on behavior.',
    c3t: 'Fleet & IoT', c3b: 'Aggregate sensor events, fire alerts, throttle false positives. Stateful per-device with hourly windows.',
    // pricing
    price_kicker: 'Pricing', price_title: 'Pay for what runs, not what waits',
    price_desc: 'Start free. Scale as you grow. No hidden fees.',
    p1n: 'Test', p1p: '$0', p1per: '/ forever', p1f1: '5 workflow instances / month', p1f2: 'All node types', p1f3: 'Webhook endpoints', p1f4: 'Instance history', p1cta: 'Start free',
    popular: 'Popular',
    p2n: 'POC', p2p: '$50', p2per: '/ month', p2f1: '50 workflow instances / month', p2f2: 'All node types', p2f3: 'Multiple webhook endpoints', p2f4: 'Full instance history', p2f5: 'Multi-tenant support', p2cta: 'Start POC',
    p3n: 'Starter', p3p: '$500', p3per: '/ month', p3f1: '10,000 instances / month', p3f2: 'All node types + sub-flows', p3f3: 'Unlimited webhook endpoints', p3f4: 'Priority support', p3f5: 'SLA monitoring', p3cta: 'Get Starter',
    // footer
    ft1: 'Event-driven workflow automation for developers and technical teams.',
    fc1: 'Product', fc2: 'Resources', fc3: 'Company',
    fwf: 'Workflows', ftr: 'Triggers', fch: 'Changelog', fdo: 'Docs', fex: 'Examples', fst: 'Status', fab: 'About', fbl: 'Blog', fco: 'Contact',
    copy: '© 2026 Fluentra, Inc.',
    sys: 'All systems operational',
  },
  es: {
    how: 'Cómo funciona', features: 'Funciones', demo: 'Demo',
    cases: 'Casos de uso', pricing: 'Precios', docs: 'docs ↗',
    signin: 'Iniciar sesión', start: 'Comenzar gratis',
    eyebrow: 'Ya en producción',
    h1a: 'Automatiza tu lógica.', h1b: 'Reacciona a todo.',
    sub: 'Fluentra es un motor de flujos de trabajo orientado a eventos. Define lógica con estado — triggers, condiciones y esperas — y ejecuta instancias de larga duración sin gestionar colas.',
    cta1: 'Comenzar gratis', cta2: 'Ver demo de 2 min',
    trust1: 'Cero infra que gestionar', trust2: '99.9% uptime', trust3: 'Global', trust4: '$0 para empezar · pago por uso',
    how_kicker: 'Cómo funciona', how_title: 'De evento a resultado en tres pasos',
    how_desc: 'Compón triggers, condiciones y esperas duraderas. Fluentra gestiona el estado, los reintentos y el tiempo — todo el tiempo que sea necesario.',
    step1_n: '01 / DEFINIR', step1_t: 'Diseña el flujo', step1_b: 'Arrastra y suelta nodos — triggers, ramas, esperas, acciones — en el editor visual. Sin código.',
    step2_n: '02 / DISPARAR', step2_t: 'Recibe cualquier evento', step2_b: 'Webhooks, HTTP o cualquier integración. Cada evento crea una instancia con su propio estado y línea de tiempo.',
    step3_n: '03 / EJECUTAR', step3_t: 'Corre segundos — o meses', step3_b: 'Las instancias persisten entre reinicios. Espera horas un evento, días un seguimiento, o meses una renovación.',
    feat_kicker: 'Plataforma', feat_title: 'Construido como debería ser la infraestructura',
    feat_desc: 'Seis garantías que convierten cron jobs frágiles y colas enredadas en flujos de trabajo duraderos y observables.',
    f1t: 'Esperas duraderas', f1b: 'Espera minutos, días o meses. Las instancias sobreviven a reinicios sin perder contexto.',
    f2t: 'Lógica de ramificación', f2b: 'Lógica condicional, forks paralelos, joins y sub-flujos — todo visual, todo testeable.',
    f3t: 'Acciones API', f3b: 'Llama a APIs REST externas desde cualquier nodo. Captura respuestas como variables para la lógica siguiente.',
    f4t: 'Multi-tenant', f4b: 'Entornos completamente aislados por organización con acceso por roles y endpoints por tenant.',
    f5t: 'Logs de auditoría', f5b: 'Cada transición y efecto secundario queda registrado. Reproduce cualquier instancia, inspecciona cualquier estado.',
    f6t: 'Seguro por defecto', f6b: 'Auth JWT, aislamiento por tenant y endpoints con alcance. Tus datos nunca cruzan fronteras entre tenants.',
    demo_kicker: 'Demo en vivo', demo_title: 'Monitor de velocidad excesiva',
    demo_desc: 'Un flujo real: cuenta tres eventos de exceso de velocidad por camión en una hora y emite un ticket automáticamente.',
    demo_pause: 'Pausar', demo_resume: 'Reanudar', demo_stream: 'stream',
    demo_reset: 'Reiniciar', demo_watching: 'monitoreando', demo_ticket: 'ticket emitido',
    cases_kicker: 'Casos de uso', cases_title: 'Reemplaza una cola, un cron y una máquina de estados',
    cases_desc: 'Los equipos usan Fluentra donde la lógica supera la duración de una sola solicitud.',
    c1t: 'Pagos y dunning', c1b: 'Reintenta cargos fallidos en un horario, escala a humanos, congela cuentas — en un solo flujo duradero.',
    c2t: 'Onboarding de usuarios', c2b: 'Emails graduales, nudges in-app, handoff de ventas. Estado por usuario a largo plazo, ramificado por comportamiento.',
    c3t: 'Flota e IoT', c3b: 'Agrega eventos de sensores, dispara alertas, filtra falsos positivos. Stateful por dispositivo con ventanas horarias.',
    price_kicker: 'Precios', price_title: 'Paga por lo que corre, no por lo que espera',
    price_desc: 'Empieza gratis. Escala conforme creces. Sin costos ocultos.',
    p1n: 'Test', p1p: '$0', p1per: '/ siempre', p1f1: '5 instancias de flujo / mes', p1f2: 'Todos los tipos de nodo', p1f3: 'Endpoints de webhook', p1f4: 'Historial de instancias', p1cta: 'Comenzar gratis',
    popular: 'Popular',
    p2n: 'POC', p2p: '$50', p2per: '/ mes', p2f1: '50 instancias de flujo / mes', p2f2: 'Todos los tipos de nodo', p2f3: 'Múltiples endpoints de webhook', p2f4: 'Historial completo de instancias', p2f5: 'Soporte multi-tenant', p2cta: 'Iniciar POC',
    p3n: 'Starter', p3p: '$500', p3per: '/ mes', p3f1: '10,000 instancias / mes', p3f2: 'Todos los nodos + sub-flujos', p3f3: 'Endpoints de webhook ilimitados', p3f4: 'Soporte prioritario', p3f5: 'Monitoreo de SLA', p3cta: 'Obtener Starter',
    ft1: 'Automatización de flujos de trabajo orientada a eventos para desarrolladores y equipos técnicos.',
    fc1: 'Producto', fc2: 'Recursos', fc3: 'Empresa',
    fwf: 'Flujos', ftr: 'Triggers', fch: 'Cambios', fdo: 'Docs', fex: 'Ejemplos', fst: 'Estado', fab: 'Acerca de', fbl: 'Blog', fco: 'Contacto',
    copy: '© 2026 Fluentra, Inc.',
    sys: 'Todos los sistemas operativos',
  },
}[LANG];

// ─── Icon component ───────────────────────────────────────────────────────────
function Icon({ name, size = 18 }) {
  const s = size;
  const stroke = "currentColor";
  const sw = 1.6;
  const common = { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke, strokeWidth: sw, strokeLinecap: "round", strokeLinejoin: "round" };
  switch (name) {
    case "bolt":   return <svg {...common}><path d="M13 2 4 14h7l-1 8 9-12h-7l1-8Z"/></svg>;
    case "check":  return <svg {...common}><path d="M20 6 9 17l-5-5"/></svg>;
    case "arrow":  return <svg {...common}><path d="M5 12h14M13 6l6 6-6 6"/></svg>;
    case "branch": return <svg {...common}><circle cx="6" cy="6" r="2"/><circle cx="18" cy="18" r="2"/><circle cx="6" cy="18" r="2"/><path d="M6 8v8M8 6h7a3 3 0 0 1 3 3v7"/></svg>;
    case "clock":  return <svg {...common}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>;
    case "shield": return <svg {...common}><path d="M12 3 4 6v6c0 5 3.5 8 8 9 4.5-1 8-4 8-9V6l-8-3Z"/></svg>;
    case "stack":  return <svg {...common}><path d="m12 3 9 5-9 5-9-5 9-5Z"/><path d="m3 13 9 5 9-5"/><path d="m3 18 9 5 9-5"/></svg>;
    case "globe":  return <svg {...common}><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>;
    case "code":   return <svg {...common}><path d="m16 18 6-6-6-6M8 6l-6 6 6 6"/></svg>;
    case "lock":   return <svg {...common}><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>;
    case "truck":  return <svg {...common}><path d="M3 7h11v9H3zM14 11h4l3 3v2h-7z"/><circle cx="7" cy="18" r="1.6"/><circle cx="17.5" cy="18" r="1.6"/></svg>;
    case "card":   return <svg {...common}><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 10h18"/></svg>;
    case "user":   return <svg {...common}><circle cx="12" cy="8" r="4"/><path d="M4 20a8 8 0 0 1 16 0"/></svg>;
    case "play":   return <svg {...common}><path d="M7 5v14l12-7L7 5Z"/></svg>;
    case "github": return <svg viewBox="0 0 24 24" width={s} height={s} fill="currentColor"><path d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.92.58.11.79-.25.79-.56v-2c-3.2.7-3.87-1.54-3.87-1.54-.52-1.33-1.28-1.69-1.28-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.03 1.76 2.7 1.25 3.36.96.1-.74.4-1.25.73-1.54-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.04 0 0 .97-.31 3.18 1.18a11.06 11.06 0 0 1 5.79 0c2.2-1.49 3.17-1.18 3.17-1.18.62 1.58.23 2.75.11 3.04.74.81 1.18 1.84 1.18 3.1 0 4.43-2.69 5.41-5.26 5.69.41.36.78 1.07.78 2.15v3.18c0 .31.21.68.8.56C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5Z"/></svg>;
  }
  return null;
}

/* ─── NAV ────────────────────────────────────────────────────── */
function Nav() {
  return (
    <header className="nav">
      <div className="container nav-inner">
        <a href="/" className="brand">
          <span className="brand-mark"></span>
          <span>Fluentra</span>
        </a>
        <nav className="nav-links">
          <a href="#how">{T.how}</a>
          <a href="#features">{T.features}</a>
          <a href="#demo">{T.demo}</a>
          <a href="#cases">{T.cases}</a>
          <a href="#pricing">{T.pricing}</a>
          <a href="https://api.fluentra.cloud/docs" target="_blank" className="mono" style={{fontSize:13}}>{T.docs}</a>
        </nav>
        <div className="nav-cta">
          <a className="btn btn-ghost btn-sm" href="https://app.fluentra.cloud">{T.signin}</a>
          <a className="btn btn-primary btn-sm" href="https://app.fluentra.cloud">{T.start}<Icon name="arrow" size={14}/></a>
        </div>
      </div>
    </header>
  );
}

/* ─── HERO ───────────────────────────────────────────────────── */
function Hero() {
  return (
    <section className="hero">
      <div className="gridbg"></div>
      <div className="glow" style={{width:600,height:600,top:-200,left:-150,background:"radial-gradient(circle, #6366F1 0%, transparent 60%)"}}></div>
      <div className="glow" style={{width:500,height:500,top:-50,right:-200,background:"radial-gradient(circle, #22D3EE 0%, transparent 60%)",opacity:.35}}></div>
      <div className="container hero-inner">
        <div className="reveal in">
          <span className="eyebrow">
            <span className="eyebrow-dot"></span>
            {T.eyebrow}
          </span>
          <h1 className="display">
            {T.h1a}<br/>
            <em>{T.h1b}</em>
          </h1>
          <p className="hero-sub">{T.sub}</p>
          <div className="hero-ctas">
            <a className="btn btn-accent" href="https://app.fluentra.cloud">{T.cta1}<Icon name="arrow" size={14}/></a>
            <a className="btn btn-ghost" href="#demo"><Icon name="play" size={14}/>{T.cta2}</a>
          </div>
          <div className="hero-trust">
            <span><Icon name="shield" size={13}/>{T.trust1}</span>
            <span><Icon name="bolt" size={13}/>{T.trust2}</span>
            <span><Icon name="globe" size={13}/>{T.trust3}</span>
            <span>{T.trust4}</span>
          </div>
        </div>
        <div className="reveal in" style={{position:"relative"}}>
          <div style={{
            background:"linear-gradient(180deg,#11131F 0%,#0C0E1A 100%)",
            border:"1px solid rgba(255,255,255,.07)",
            borderRadius:18,padding:18,
            boxShadow:"0 40px 80px -30px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.04) inset"
          }}>
            <div style={{display:"flex",alignItems:"center",gap:8,marginBottom:14,paddingBottom:12,borderBottom:"1px solid rgba(255,255,255,.06)"}}>
              <span style={{width:8,height:8,borderRadius:"50%",background:"#34D399",boxShadow:"0 0 8px #34D399"}}></span>
              <span className="mono" style={{fontSize:11,color:"#9CA3B7"}}>workflow.run · instance_4f3a</span>
              <span className="mono" style={{fontSize:11,color:"#5B6378",marginLeft:"auto"}}>14ms · queued 0</span>
            </div>
            <HeroDiagram/>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ─── HOW IT WORKS ───────────────────────────────────────────── */
function HowItWorks() {
  return (
    <section className="how" id="how">
      <div className="container">
        <div className="section-head">
          <span className="section-kicker">{T.how_kicker}</span>
          <h2 className="section-title">{T.how_title}</h2>
          <p className="section-desc">{T.how_desc}</p>
        </div>
        <div className="steps">
          <div className="step reveal">
            <span className="step-num">{T.step1_n}</span>
            <h3 className="step-title">{T.step1_t}</h3>
            <p className="step-body">{T.step1_b}</p>
            <div className="step-viz"><StepVizDefine/></div>
          </div>
          <div className="step reveal">
            <span className="step-num">{T.step2_n}</span>
            <h3 className="step-title">{T.step2_t}</h3>
            <p className="step-body">{T.step2_b}</p>
            <div className="step-viz"><StepVizWebhook/></div>
          </div>
          <div className="step reveal">
            <span className="step-num">{T.step3_n}</span>
            <h3 className="step-title">{T.step3_t}</h3>
            <p className="step-body">{T.step3_b}</p>
            <div className="step-viz"><StepVizRuntime/></div>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ─── FEATURES ───────────────────────────────────────────────── */
function Features() {
  const items = [
    { icon: "clock",   title: T.f1t, body: T.f1b },
    { icon: "branch",  title: T.f2t, body: T.f2b },
    { icon: "code",    title: T.f3t, body: T.f3b },
    { icon: "stack",   title: T.f4t, body: T.f4b },
    { icon: "shield",  title: T.f5t, body: T.f5b },
    { icon: "lock",    title: T.f6t, body: T.f6b },
  ];
  return (
    <section className="features" id="features">
      <div className="container">
        <div className="section-head">
          <span className="section-kicker">{T.feat_kicker}</span>
          <h2 className="section-title">{T.feat_title}</h2>
          <p className="section-desc">{T.feat_desc}</p>
        </div>
        <div className="feat-grid">
          {items.map((f, i) => (
            <div key={i} className="feat">
              <div className="feat-icon"><Icon name={f.icon} size={18}/></div>
              <h3 className="feat-title">{f.title}</h3>
              <p className="feat-body">{f.body}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ─── DEMO ───────────────────────────────────────────────────── */
function Demo() {
  const [events, setEvents] = React.useState([]);
  const [count, setCount] = React.useState(0);
  const [fired, setFired] = React.useState(false);
  const [running, setRunning] = React.useState(true);

  React.useEffect(() => {
    if (!running) return;
    const trucks = ["TRK-019","TRK-042","TRK-007","TRK-113","TRK-228"];
    const id = setInterval(() => {
      const truck = trucks[Math.floor(Math.random()*trucks.length)];
      const speed = 78 + Math.floor(Math.random()*22);
      const isOver = speed > 80;
      const t = Date.now();
      setEvents(evts => [{ t, truck, speed, isOver, ticket: false }, ...evts].slice(0, 14));
      if (isOver) {
        setCount(c => {
          const n = c + 1;
          if (n >= 3) {
            setFired(true);
            setEvents(evts => [{ t: t+1, truck, speed, isOver, ticket: true }, ...evts].slice(0, 14));
            setTimeout(() => { setFired(false); setCount(0); }, 1400);
            return 0;
          }
          return n;
        });
      }
    }, 1100);
    return () => clearInterval(id);
  }, [running]);

  return (
    <section className="demo" id="demo">
      <div className="container">
        <div className="section-head">
          <span className="section-kicker">{T.demo_kicker}</span>
          <h2 className="section-title">{T.demo_title}</h2>
          <p className="section-desc">{T.demo_desc}</p>
        </div>
        <div className="demo-shell">
          <div className="demo-header">
            <span className="demo-dot r"></span>
            <span className="demo-dot y"></span>
            <span className="demo-dot g"></span>
            <span style={{marginLeft:8}}>app.fluentra.cloud · speeding-truck-monitor</span>
            <span style={{marginLeft:"auto",color:"#5B6378"}}>v2 · prod</span>
          </div>
          <div className="demo-body">
            <div className="demo-canvas">
              <TruckDiagram events={events} count={count} fired={fired}/>
            </div>
            <div className="demo-side">
              <h4>Event stream</h4>
              {events.length === 0 && (
                <div style={{color:"#5B6378",fontSize:12,fontFamily:"Geist Mono, monospace",padding:"8px 4px"}}>
                  waiting for events…
                </div>
              )}
              {events.map((e, i) => (
                <div key={e.t+"-"+i} className={"ev"+(e.ticket?" ticket":"")}>
                  <span className="ev-time">{new Date(e.t).toLocaleTimeString([],{hour12:false}).slice(3)}</span>
                  <span className="ev-truck">{e.truck}</span>
                  {e.ticket
                    ? <span className="ev-speed" style={{color:"#F87171"}}>→ ticket</span>
                    : <span className="ev-speed">{e.speed} mph</span>}
                </div>
              ))}
            </div>
          </div>
          <div className="demo-controls">
            <button className="btn btn-ghost btn-sm" onClick={() => setRunning(r => !r)}>
              {running ? T.demo_pause : T.demo_resume} {T.demo_stream}
            </button>
            <button className="btn btn-ghost btn-sm" onClick={() => { setEvents([]); setCount(0); setFired(false); }}>
              {T.demo_reset}
            </button>
            <span className="mono" style={{marginLeft:"auto",fontSize:12,color:"#9CA3B7"}}>
              count: <b style={{color:"#EDEFF7"}}>{count}</b> / 3 · {fired
                ? <span style={{color:"#F87171"}}>{T.demo_ticket}</span>
                : T.demo_watching}
            </span>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ─── USE CASES ──────────────────────────────────────────────── */
function UseCases() {
  const cases = [
    { icon: "card",  title: T.c1t, body: T.c1b,
      snippet: <><span className="k">on</span>(<span className="v">"charge.failed"</span>) → wait 3d → retry → escalate</> },
    { icon: "user",  title: T.c2t, body: T.c2b,
      snippet: <><span className="k">on</span>(<span className="v">"signup"</span>) → wait 24h → if !active → email</> },
    { icon: "truck", title: T.c3t, body: T.c3b,
      snippet: <><span className="k">window</span>(1h) → count &gt; 3 → <span className="v">issue.ticket</span>()</> },
  ];
  return (
    <section className="cases" id="cases">
      <div className="container">
        <div className="section-head">
          <span className="section-kicker">{T.cases_kicker}</span>
          <h2 className="section-title">{T.cases_title}</h2>
          <p className="section-desc">{T.cases_desc}</p>
        </div>
        <div className="case-grid">
          {cases.map((c, i) => (
            <div key={i} className="case">
              <div className="case-icon"><Icon name={c.icon} size={20}/></div>
              <h3 className="case-title">{c.title}</h3>
              <p className="case-body">{c.body}</p>
              <div className="case-snippet">{c.snippet}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

/* ─── PRICING ────────────────────────────────────────────────── */
function Pricing() {
  const Bullet = ({children}) => (
    <li><Icon name="check" size={14}/><span>{children}</span></li>
  );
  return (
    <section className="pricing" id="pricing">
      <div className="container">
        <div className="section-head">
          <span className="section-kicker">{T.price_kicker}</span>
          <h2 className="section-title">{T.price_title}</h2>
          <p className="section-desc">{T.price_desc}</p>
        </div>
        <div className="price-grid">
          {/* Test */}
          <div className="tier">
            <span className="tier-name">{T.p1n}</span>
            <div className="tier-price"><b>{T.p1p}</b><span> USD {T.p1per}</span></div>
            <ul className="tier-list">
              <Bullet>{T.p1f1}</Bullet>
              <Bullet>{T.p1f2}</Bullet>
              <Bullet>{T.p1f3}</Bullet>
              <Bullet>{T.p1f4}</Bullet>
            </ul>
            <a className="btn btn-ghost tier-cta" href="https://app.fluentra.cloud">{T.p1cta}</a>
          </div>
          {/* POC — featured */}
          <div className="tier featured">
            <span className="badge">{T.popular}</span>
            <span className="tier-name">{T.p2n}</span>
            <div className="tier-price"><b>{T.p2p}</b><span> USD {T.p2per}</span></div>
            <ul className="tier-list">
              <Bullet>{T.p2f1}</Bullet>
              <Bullet>{T.p2f2}</Bullet>
              <Bullet>{T.p2f3}</Bullet>
              <Bullet>{T.p2f4}</Bullet>
              <Bullet>{T.p2f5}</Bullet>
            </ul>
            <a className="btn btn-accent tier-cta" href="https://app.fluentra.cloud">{T.p2cta}</a>
          </div>
          {/* Starter */}
          <div className="tier">
            <span className="tier-name">{T.p3n}</span>
            <div className="tier-price"><b>{T.p3p}</b><span> USD {T.p3per}</span></div>
            <ul className="tier-list">
              <Bullet>{T.p3f1}</Bullet>
              <Bullet>{T.p3f2}</Bullet>
              <Bullet>{T.p3f3}</Bullet>
              <Bullet>{T.p3f4}</Bullet>
              <Bullet>{T.p3f5}</Bullet>
            </ul>
            <a className="btn btn-ghost tier-cta" href="https://app.fluentra.cloud">{T.p3cta}</a>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ─── FOOTER ─────────────────────────────────────────────────── */
function Footer() {
  return (
    <footer>
      <div className="container">
        <div className="foot">
          <div className="foot-brand">
            <div className="brand"><span className="brand-mark"></span><span>Fluentra</span></div>
            {T.ft1}
          </div>
          <div className="foot-col">
            <h5>{T.fc1}</h5>
            <ul>
              <li><a href="#features">{T.fwf}</a></li>
              <li><a href="#pricing">{T.pricing}</a></li>
              <li><a href="https://app.fluentra.cloud">Dashboard</a></li>
              <li><a href="https://api.fluentra.cloud/docs">{T.fdo}</a></li>
            </ul>
          </div>
          <div className="foot-col">
            <h5>{T.fc2}</h5>
            <ul>
              <li><a href="https://api.fluentra.cloud/docs">{T.fdo}</a></li>
              <li><a href="#">{T.fex}</a></li>
              <li><a href="https://api.fluentra.cloud/docs">{T.fst}</a></li>
            </ul>
          </div>
          <div className="foot-col">
            <h5>{T.fc3}</h5>
            <ul>
              <li><a href="mailto:hello@fluentra.cloud">{T.fco}</a></li>
              <li><a href="#">{T.fab}</a></li>
            </ul>
          </div>
        </div>
        <div className="foot-bottom">
          <span>{T.copy}</span>
          <span className="status-dot">{T.sys}</span>
          <span><a href="#" style={{display:"inline-flex",gap:6,alignItems:"center"}}><Icon name="github" size={14}/> github.com/fluentra</a></span>
        </div>
      </div>
    </footer>
  );
}

Object.assign(window, { Nav, Hero, HowItWorks, Features, Demo, UseCases, Pricing, Footer, Icon });
