// QYAS — Homepage
const { useState: useStateH, useEffect: useEffectH } = React;
const { Nav, Footer, useLang } = window.QyasShell;

function Pillar({ num, title, body, accent }) {
  return (
    <div className="card" style={{ position: "relative", height: "100%" }}>
      <div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: 24 }}>
        <span className="mono" style={{ fontSize: 11, fontWeight: 600, color: accent, letterSpacing: "0.08em" }}>0{num}</span>
        <div style={{ width: 36, height: 36, borderRadius: 9, background: `${accent}14`, display: "grid", placeItems: "center", color: accent, fontFamily: "var(--font-mono)", fontWeight: 700 }}>·</div>
      </div>
      <h3 style={{ marginBottom: 10 }}>{title}</h3>
      <p style={{ color: "var(--ink-600)", fontSize: 14.5, lineHeight: 1.6 }}>{body}</p>
    </div>
  );
}

function HierarchyDiagram() {
  const Node = ({ label, sub, color, dashed }) => (
    <div style={{ padding: "16px 20px", background: "#fff", border: `1.5px ${dashed ? "dashed" : "solid"} ${color}`, borderRadius: 12, textAlign: "center", minWidth: 140, position: "relative" }}>
      <div className="mono" style={{ fontSize: 10, color, fontWeight: 600, letterSpacing: "0.08em" }}>{sub}</div>
      <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 16, color: "var(--ink-900)", marginTop: 2 }}>{label}</div>
    </div>
  );
  return (
    <div style={{ background: "var(--surface)", border: "1px solid var(--ink-200)", borderRadius: 20, padding: 48, position: "relative", overflow: "hidden" }} className="blueprint-fine">
      <div style={{ display: "grid", gap: 28, justifyContent: "center", justifyItems: "center", position: "relative", zIndex: 1 }}>
        {/* L1 */}
        <Node label="ACME Water Co." sub="01 · ORGANIZATION" color="#0B4A6F" />
        <Connector />
        {/* L2: 3 sites */}
        <div style={{ display: "flex", gap: 24 }}>
          <Node label="Riyadh" sub="02 · SITE" color="#059669" />
          <Node label="Jeddah" sub="02 · SITE" color="#059669" />
          <Node label="Dammam" sub="02 · SITE" color="#059669" dashed />
        </div>
        <Connector />
        {/* L3: stations */}
        <div style={{ display: "flex", gap: 16 }}>
          <Node label="Plant 03" sub="03 · STATION" color="#0284C7" />
          <Node label="Reservoir 5" sub="03 · STATION" color="#0284C7" />
          <Node label="Treatment 2" sub="03 · STATION" color="#0284C7" />
          <Node label="Desal Plant 1" sub="03 · STATION" color="#0284C7" dashed />
        </div>
        <Connector />
        {/* L4: meters */}
        <div style={{ display: "flex", gap: 10, flexWrap: "wrap", justifyContent: "center", maxWidth: 720 }}>
          {["Inlet A-12","Pump P-7","Tank T-4","Outlet C-3","Sales SM-9","Pressure B-2","Temp X-1","Flow F-3"].map(m => (
            <div key={m} className="mono" style={{ padding: "8px 12px", background: "rgba(217,119,6,0.06)", border: "1px solid rgba(217,119,6,0.18)", borderRadius: 8, fontSize: 11.5, color: "#92400E", fontWeight: 600 }}>
              {m}
            </div>
          ))}
        </div>
        <div className="mono" style={{ fontSize: 10.5, color: "var(--ink-500)", letterSpacing: "0.08em", fontWeight: 600 }}>04 · SECTIONS & METERS</div>
      </div>
    </div>
  );
}

function Connector() {
  return <div style={{ width: 1, height: 24, background: "linear-gradient(to bottom, var(--ink-300), transparent)" }}></div>;
}

function Roles() {
  const roles = [
    { name: "Owner",       scope: "Full access", access: 100, perms: ["sites","plants","meters","reports","users","settings","billing"], note: "Tenant root" },
    { name: "Auditor",     scope: "Read everything", access: 95, perms: ["sites","plants","meters","reports","users","audit"], note: "Compliance" },
    { name: "Manager",     scope: "Region", access: 70, perms: ["sites","plants","users","reports"], note: "Reads + writes" },
    { name: "Site Manager",scope: "One site", access: 55, perms: ["site","meters","users","reports"], note: "Site-bound" },
    { name: "Supervisor",  scope: "Plants assigned", access: 45, perms: ["plants","meters","readings"], note: "Reads readings" },
    { name: "Client",      scope: "Own meters", access: 30, perms: ["my meters","reports"], note: "External" },
    { name: "Operator",    scope: "Assigned meters", access: 15, perms: ["meters","log readings"], note: "Field-only" },
  ];
  return (
    <div style={{ border: "1px solid var(--ink-200)", borderRadius: 16, overflow: "hidden", background: "#fff" }}>
      <div style={{ display: "grid", gridTemplateColumns: "1fr 1fr 2fr 1fr 0.8fr", padding: "12px 20px", background: "#F8FAFC", fontFamily: "var(--font-mono)", fontSize: 10.5, fontWeight: 600, color: "var(--ink-500)", letterSpacing: "0.08em", textTransform: "uppercase", borderBottom: "1px solid var(--ink-200)" }}>
        <div>Role</div><div>Scope</div><div>Permissions</div><div>Access</div><div style={{ textAlign: "right" }}>Note</div>
      </div>
      {roles.map((r, i) => (
        <div key={r.name} style={{ display: "grid", gridTemplateColumns: "1fr 1fr 2fr 1fr 0.8fr", padding: "16px 20px", alignItems: "center", borderBottom: i < roles.length - 1 ? "1px solid var(--ink-100)" : "none", gap: 12 }}>
          <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 15, color: "var(--ink-900)" }}>{r.name}</div>
          <div style={{ fontSize: 13, color: "var(--ink-600)" }}>{r.scope}</div>
          <div style={{ display: "flex", flexWrap: "wrap", gap: 4 }}>
            {r.perms.map(p => <span key={p} className="tag" style={{ fontSize: 10, padding: "3px 7px" }}>{p}</span>)}
          </div>
          <div>
            <div style={{ height: 4, background: "var(--ink-100)", borderRadius: 2, overflow: "hidden", maxWidth: 90 }}>
              <div style={{ width: `${r.access}%`, height: "100%", background: r.access > 60 ? "#0B4A6F" : r.access > 35 ? "#0284C7" : "#94A3B8" }}></div>
            </div>
            <div className="mono" style={{ fontSize: 10, color: "var(--ink-500)", marginTop: 4 }}>{r.access}%</div>
          </div>
          <div className="mono" style={{ fontSize: 11, color: "var(--ink-500)", textAlign: "right" }}>{r.note}</div>
        </div>
      ))}
    </div>
  );
}

function AlertExplainer() {
  return (
    <div style={{ display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 64, alignItems: "center" }}>
      <div>
        <span className="eyebrow">CHAPTER 05 · ALERT SYSTEM</span>
        <h2 style={{ marginTop: 14, marginBottom: 18 }}>Out-of-range readings don't wait for anyone to notice them.</h2>
        <p className="lead" style={{ marginBottom: 32 }}>Threshold checks run on every submitted reading. Responsible managers receive a push notification before the operator finishes their route.</p>
        <div style={{ display: "grid", gap: 16 }}>
          {[
            { step: "01", title: "Reading entered", body: "Operator submits a value from the field." },
            { step: "02", title: "Threshold check", body: "System compares against configured min / max." },
            { step: "03", title: "Push notification", body: "Responsible managers notified instantly via OneSignal." },
            { step: "04", title: "AI suggestion", body: "Pattern recognition surfaces predictive corrective actions." },
          ].map(s => (
            <div key={s.step} style={{ display: "grid", gridTemplateColumns: "auto 1fr", gap: 18, alignItems: "flex-start" }}>
              <div className="mono" style={{ width: 40, height: 40, border: "1px solid var(--ink-200)", borderRadius: 8, display: "grid", placeItems: "center", fontWeight: 600, color: "var(--accent)", fontSize: 12 }}>{s.step}</div>
              <div>
                <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 16, color: "var(--ink-900)" }}>{s.title}</div>
                <div style={{ color: "var(--ink-600)", fontSize: 14, marginTop: 2 }}>{s.body}</div>
              </div>
            </div>
          ))}
        </div>
      </div>
      {/* Live alert visual */}
      <div className="card-dark" style={{ padding: 0, borderRadius: 18, overflow: "hidden", background: "var(--ink-900)" }}>
        <div style={{ padding: "16px 20px", display: "flex", justifyContent: "space-between", alignItems: "center", borderBottom: "1px solid #1f2937" }}>
          <span className="mono" style={{ fontSize: 10.5, color: "#94A3B8", letterSpacing: "0.08em" }}>INCIDENT 14:31:54 UTC</span>
          <span className="tag tag-dark" style={{ color: "#fca5a5" }}><span className="dot pulse"></span>OVER MAX</span>
        </div>
        <div style={{ padding: "32px 28px" }}>
          <div className="mono" style={{ fontSize: 11, color: "#94A3B8", letterSpacing: "0.05em" }}>PRESSURE METER · PUMP P-7</div>
          <div style={{ fontFamily: "var(--font-display)", fontWeight: 700, fontSize: 64, color: "#fff", letterSpacing: "-0.03em", marginTop: 8, fontVariantNumeric: "tabular-nums" }}>
            7.2<span style={{ fontSize: 28, color: "#94A3B8", fontWeight: 500, marginLeft: 6 }}>bar</span>
          </div>
          {/* threshold bar */}
          <div style={{ marginTop: 20, position: "relative", height: 28, background: "#1f2937", borderRadius: 6, overflow: "hidden" }}>
            <div style={{ position: "absolute", left: "33%", right: 0, top: 0, bottom: 0, background: "rgba(220,38,38,0.18)" }}></div>
            <div style={{ position: "absolute", top: 0, bottom: 0, left: "33%", width: 1, background: "#DC2626" }}></div>
            <div style={{ position: "absolute", top: 0, bottom: 0, left: 0, width: "60%", background: "linear-gradient(90deg, #059669, #D97706 70%, #DC2626)", borderRadius: "6px 0 0 6px" }}></div>
            <div style={{ position: "absolute", left: "60%", top: -3, bottom: -3, width: 3, background: "#fff", borderRadius: 2, boxShadow: "0 0 12px rgba(255,255,255,0.6)" }}></div>
          </div>
          <div className="mono" style={{ display: "flex", justifyContent: "space-between", marginTop: 6, fontSize: 10, color: "#94A3B8" }}>
            <span>min 2.0</span><span style={{ color: "#fca5a5" }}>max 6.0</span><span>scale 12.0</span>
          </div>
        </div>
        <div style={{ borderTop: "1px solid #1f2937", padding: "16px 20px", display: "grid", gridTemplateColumns: "1fr 1fr", gap: 16 }}>
          <div>
            <div className="mono" style={{ fontSize: 10, color: "#64748B", letterSpacing: "0.06em" }}>NOTIFIED</div>
            <div style={{ color: "#fff", fontSize: 13, marginTop: 4 }}>3 managers · 1 site mgr</div>
          </div>
          <div>
            <div className="mono" style={{ fontSize: 10, color: "#64748B", letterSpacing: "0.06em" }}>LATENCY</div>
            <div style={{ color: "#fff", fontSize: 13, marginTop: 4, fontFamily: "var(--font-mono)" }}>3.4s</div>
          </div>
        </div>
      </div>
    </div>
  );
}

function Workflow() {
  const steps = [
    "Operator gets push + email reminder.",
    "Opens app — sees assigned meters.",
    "Selects a meter, enters current reading.",
    "System validates against min / max thresholds.",
    "Out-of-range → manager push notification.",
    "Reading stored with timestamp + GPS.",
    "Value flows into dashboard & reports.",
  ];
  return (
    <div className="blueprint" style={{ padding: 56, borderRadius: 20, color: "#cbd5e1" }}>
      <div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-end", marginBottom: 36 }}>
        <div>
          <span className="eyebrow" style={{ color: "#FBBF24" }}>READING WORKFLOW</span>
          <h2 style={{ color: "#fff", marginTop: 12 }}>Seven steps. Every time.</h2>
        </div>
        <span className="tag tag-dark"><span className="dot"></span>RUNTIME · 9.4s avg</span>
      </div>
      <div style={{ display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: 0, position: "relative" }}>
        {steps.map((s, i) => (
          <div key={i} style={{ position: "relative" }}>
            <div style={{ padding: "20px 16px 24px", borderLeft: "1px solid rgba(255,255,255,0.08)", borderRight: i === 6 ? "1px solid rgba(255,255,255,0.08)" : "none", height: "100%" }}>
              <div className="mono" style={{ fontSize: 10.5, color: "#FBBF24", fontWeight: 600, letterSpacing: "0.08em", marginBottom: 10 }}>STEP 0{i+1}</div>
              <div style={{ color: "#fff", fontSize: 14, lineHeight: 1.45, fontWeight: 500 }}>{s}</div>
            </div>
            {/* dotted line + arrow */}
            <div style={{ position: "absolute", top: 36, left: "100%", width: "100%", height: 1, borderTop: i < 6 ? "1px dashed rgba(255,255,255,0.16)" : "none", display: i < 6 ? "block" : "none" }}></div>
          </div>
        ))}
      </div>
    </div>
  );
}

function Tech() {
  const items = [
    { label: "OneSignal", note: "Push" },
    { label: "Firebase", note: "Push" },
    { label: "Amazon SNS", note: "Push" },
    { label: "Huawei Push", note: "Push" },
    { label: "Google Maps", note: "Geo" },
    { label: "Supabase", note: "Backend" },
    { label: "Odoo ERP", note: "Billing" },
    { label: "i18next", note: "Localization" },
  ];
  return (
    <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 0, border: "1px solid var(--ink-200)", borderRadius: 16, background: "#fff", overflow: "hidden" }}>
      {items.map((it, i) => (
        <div key={it.label} style={{ padding: "28px 24px", borderRight: (i+1) % 4 !== 0 ? "1px solid var(--ink-100)" : "none", borderBottom: i < 4 ? "1px solid var(--ink-100)" : "none", textAlign: "center" }}>
          <div style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 17, color: "var(--ink-900)" }}>{it.label}</div>
          <div className="mono" style={{ fontSize: 10.5, color: "var(--ink-500)", letterSpacing: "0.08em", marginTop: 6, textTransform: "uppercase" }}>{it.note}</div>
        </div>
      ))}
    </div>
  );
}

function FAQ() {
  const items = [
    { q: "How does QYAS handle factories with thousands of meters?", a: "Sites are organized into stations and sections. Hierarchical permissions and indexed reading queries keep large deployments fast." },
    { q: "What happens when a reading is out of range?", a: "The system logs a warning, attaches the threshold context, and sends a push notification via OneSignal to all responsible managers — typically under 4 seconds." },
    { q: "Does QYAS support Arabic and right-to-left layouts?", a: "Yes. The full UI mirrors for Arabic. English, French, and German are supported left-to-right." },
    { q: "Can clients see only their own meters?", a: "Yes. The Client role is scoped to assigned meters and reports — they never see other tenants' data." },
    { q: "What devices does the operator app run on?", a: "iOS and Android. Operators receive push notifications and reminders to log readings on schedule." },
  ];
  const [open, setOpen] = useStateH(0);
  return (
    <div style={{ border: "1px solid var(--ink-200)", borderRadius: 16, background: "#fff", overflow: "hidden" }}>
      {items.map((it, i) => (
        <div key={i} style={{ borderBottom: i < items.length - 1 ? "1px solid var(--ink-100)" : "none" }}>
          <button onClick={() => setOpen(open === i ? -1 : i)} style={{ width: "100%", padding: "20px 24px", display: "flex", justifyContent: "space-between", alignItems: "center", textAlign: "left", gap: 16 }}>
            <div style={{ display: "flex", gap: 16, alignItems: "center" }}>
              <span className="mono" style={{ fontSize: 11, color: "var(--ink-400)", fontWeight: 600 }}>{String(i+1).padStart(2,"0")}</span>
              <span style={{ fontFamily: "var(--font-display)", fontWeight: 600, fontSize: 16, color: "var(--ink-900)" }}>{it.q}</span>
            </div>
            <span style={{ fontFamily: "var(--font-mono)", fontSize: 18, color: "var(--ink-500)", transform: open === i ? "rotate(45deg)" : "rotate(0)", transition: "transform .15s ease" }}>+</span>
          </button>
          {open === i && (
            <div style={{ padding: "0 24px 24px 56px", color: "var(--ink-600)", fontSize: 14.5, lineHeight: 1.6 }}>{it.a}</div>
          )}
        </div>
      ))}
    </div>
  );
}

function Home() {
  const { lang, setLang, t } = useLang();
  const cta = (window.I18N[lang] || window.I18N.en).cta;

  return (
    <>
      <Nav active="home" lang={lang} setLang={setLang} />

      {/* HERO */}
      <section className="hero" style={{ padding: "80px 0 120px" }}>
        <div className="hero-glow"></div>
        <div className="container" style={{ position: "relative", zIndex: 2 }}>
          <div style={{ display: "grid", gridTemplateColumns: "1.05fr 1fr", gap: 64, alignItems: "center" }}>
            <div>
              <span className="eyebrow">{t.hero.eyebrow}</span>
              <h1 style={{ marginTop: 18, marginBottom: 24 }}>{t.hero.title}</h1>
              <p className="lead">{t.hero.lead}</p>
              <div style={{ display: "flex", gap: 12, marginTop: 36, flexWrap: "wrap" }}>
                <a href="contact.html" className="btn btn-amber">{cta.download} <span>↓</span></a>
                <a href="how-it-works.html" className="btn btn-ghost" style={{ background: "rgba(255,255,255,0.06)", borderColor: "rgba(255,255,255,0.12)", color: "#fff" }}>See how it works →</a>
              </div>
              <div style={{ marginTop: 56, display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 24, paddingTop: 28, borderTop: "1px solid rgba(255,255,255,0.1)" }}>
                {t.hero.stats.map(s => (
                  <div key={s.label}>
                    <div style={{ fontFamily: "var(--font-display)", fontWeight: 700, fontSize: 28, color: "#fff", letterSpacing: "-0.02em", fontVariantNumeric: "tabular-nums" }}>{s.value}</div>
                    <div className="mono" style={{ fontSize: 10.5, color: "#94A3B8", marginTop: 4, letterSpacing: "0.06em", textTransform: "uppercase" }}>{s.label} · {s.meta}</div>
                  </div>
                ))}
              </div>
            </div>
            {/* Phone + dashboard montage */}
            <div className="hero-mock-stage">
              <div className="hero-mock-dash">
                <DashboardMock />
              </div>
              <div className="hero-mock-phone">
                <PhoneMock />
              </div>
            </div>
          </div>
        </div>
      </section>

      {/* TRUSTED BY */}
      <section className="tight" style={{ background: "#fff", borderBottom: "1px solid var(--ink-200)" }}>
        <div className="container" style={{ display: "flex", alignItems: "center", justifyContent: "space-between", flexWrap: "wrap", gap: 32 }}>
          <span className="mono" style={{ fontSize: 11, color: "var(--ink-500)", letterSpacing: "0.08em", textTransform: "uppercase" }}>Operating across factories & utilities in</span>
          <div style={{ display: "flex", gap: 48, fontFamily: "var(--font-display)", fontWeight: 700, fontSize: 18, color: "var(--ink-300)", letterSpacing: "-0.01em", flexWrap: "wrap" }}>
            <span>Riyadh</span><span>Jeddah</span><span>Dammam</span><span>Mecca</span><span>Tabuk</span><span>Abu Dhabi</span><span>Cairo</span>
          </div>
        </div>
      </section>

      {/* PILLARS */}
      <section style={{ background: "var(--bg)" }}>
        <div className="container">
          <div className="section-header split">
            <div>
              <span className="eyebrow">CHAPTER 01 · WHAT QYAS DOES</span>
              <h2 style={{ marginTop: 14 }}>Reading collection, threshold alerts, and operational oversight — across every site, plant, meter and operator.</h2>
            </div>
            <p className="lead">Operators log daily readings. The system flags anything abnormal. Managers see it in real time. Built for water and utility companies that can't afford a missed meter.</p>
          </div>
          <div style={{ display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 20 }}>
            <Pillar num={1} title="Track & record" body="Operators log daily readings on mobile. The system reminds them on schedule and tracks compliance per route." accent="#0B4A6F" />
            <Pillar num={2} title="Organize everything" body="Each site contains stations, each station contains sections and meters. Hierarchy that mirrors how factories actually run." accent="#059669" />
            <Pillar num={3} title="Role-based access" body="Seven distinct user roles, each with its own scope of visibility and permitted actions — Operator to Project Owner." accent="#0284C7" />
            <Pillar num={4} title="Instant alerts" body="Out-of-range readings trigger push notifications to responsible managers within seconds. No waiting for the next shift." accent="#D97706" />
          </div>
        </div>
      </section>

      {/* HIERARCHY */}
      <section style={{ background: "#fff", borderTop: "1px solid var(--ink-200)", borderBottom: "1px solid var(--ink-200)" }}>
        <div className="container">
          <div className="section-header split">
            <div>
              <span className="eyebrow">CHAPTER 02 · DATA MODEL</span>
              <h2 style={{ marginTop: 14 }}>Four levels. Everything flows along them.</h2>
            </div>
            <p className="lead">Permissions, readings, and reports all inherit through this hierarchy. Configure once at the level that makes sense; cascade down to every meter beneath it.</p>
          </div>
          <HierarchyDiagram />
        </div>
      </section>

      {/* ROLES */}
      <section>
        <div className="container">
          <div className="section-header split">
            <div>
              <span className="eyebrow">CHAPTER 03 · ACCESS CONTROL</span>
              <h2 style={{ marginTop: 14 }}>Seven roles. Each sees only what they should.</h2>
            </div>
            <p className="lead">Permissions narrow as you move from Owner to Operator. Every screen, action, and report respects role scope by default.</p>
          </div>
          <Roles />
        </div>
      </section>

      {/* WORKFLOW */}
      <section style={{ background: "var(--bg)" }}>
        <div className="container">
          <Workflow />
        </div>
      </section>

      {/* ALERTS */}
      <section style={{ background: "#fff", borderTop: "1px solid var(--ink-200)", borderBottom: "1px solid var(--ink-200)" }}>
        <div className="container">
          <AlertExplainer />
        </div>
      </section>

      {/* DASHBOARD PREVIEW */}
      <section>
        <div className="container">
          <div className="section-header split">
            <div>
              <span className="eyebrow">CHAPTER 06 · DASHBOARD & REPORTS</span>
              <h2 style={{ marginTop: 14 }}>Eight live counters. Three reports. One source of truth.</h2>
            </div>
            <p className="lead">Every role-appropriate home page opens with eight live counters and the latest readings. Three report types — meter readings, water sales, customer ledger — each filterable by date with bar charts.</p>
          </div>
          <DashboardMock />
        </div>
      </section>

      {/* TECH */}
      <section style={{ background: "#fff", borderTop: "1px solid var(--ink-200)" }}>
        <div className="container">
          <div className="section-header split">
            <div>
              <span className="eyebrow">CHAPTER 07 · INTEGRATIONS</span>
              <h2 style={{ marginTop: 14 }}>Plays well with the stack you already run.</h2>
            </div>
            <p className="lead">Push notifications via OneSignal, Firebase, Amazon SNS, or Huawei Push. Maps via Google. Backend via Supabase. ERP integration via Odoo. Localization through i18next.</p>
          </div>
          <Tech />
        </div>
      </section>

      {/* FAQ */}
      <section style={{ background: "var(--bg)" }}>
        <div className="container">
          <div className="section-header split">
            <div>
              <span className="eyebrow">FREQUENTLY ASKED</span>
              <h2 style={{ marginTop: 14 }}>Questions operators ask before deploying.</h2>
            </div>
            <p className="lead">Can't find what you're looking for? <a href="contact.html" style={{ color: "var(--primary)", textDecoration: "underline" }}>Talk to us directly</a>.</p>
          </div>
          <FAQ />
        </div>
      </section>

      {/* CTA */}
      <section className="blueprint" style={{ padding: "120px 0" }}>
        <div className="container" style={{ textAlign: "center", color: "#fff", position: "relative", zIndex: 1 }}>
          <span className="eyebrow" style={{ color: "#FBBF24" }}>READY WHEN YOU ARE</span>
          <h2 style={{ color: "#fff", marginTop: 16, marginBottom: 22, maxWidth: 760, marginLeft: "auto", marginRight: "auto" }}>Stop guessing if your meters are working. Know.</h2>
          <p className="lead" style={{ color: "#94A3B8", margin: "0 auto 36px" }}>Download QYAS for iOS and Android. Or talk to us about deploying it across your factory operations.</p>
          <div style={{ display: "flex", gap: 12, justifyContent: "center", flexWrap: "wrap" }}>
            <a href="contact.html" className="btn btn-amber">{cta.download} <span>↓</span></a>
            <a href="contact.html" className="btn btn-ghost" style={{ background: "rgba(255,255,255,0.06)", borderColor: "rgba(255,255,255,0.12)", color: "#fff" }}>{cta.demo}</a>
          </div>
        </div>
      </section>

      <Footer lang={lang} />
    </>
  );
}

ReactDOM.createRoot(document.getElementById("root")).render(<Home />);
