// Kisti — Cinematic Coming-Soon Landing
// React 18 + Babel inline. Single-file app.

const { useState, useEffect, useRef } = React;

// ───────── Inline lucide-style icons ─────────
const Icon = ({ children, className = "w-4 h-4", strokeWidth = 2, ...rest }) =>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"
stroke="currentColor" strokeWidth={strokeWidth} strokeLinecap="round" strokeLinejoin="round"
className={className} {...rest}>{children}</svg>;

const ChevronRight = (p) => <Icon {...p}><path d="m9 18 6-6-6-6" /></Icon>;
const Menu = (p) => <Icon {...p}><line x1="4" x2="20" y1="6" y2="6" /><line x1="4" x2="20" y1="12" y2="12" /><line x1="4" x2="20" y1="18" y2="18" /></Icon>;
const Check = (p) => <Icon {...p}><polyline points="20 6 9 17 4 12" /></Icon>;
const Sparkles = (p) => <Icon {...p}><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.582a.5.5 0 0 1 0 .962L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" /><path d="M20 3v4" /><path d="M22 5h-4" /><path d="M4 17v2" /><path d="M5 18H3" /></Icon>;
const Bag = (p) => <Icon {...p}><path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z" /><line x1="3" x2="21" y1="6" y2="6" /><path d="M16 10a4 4 0 0 1-8 0" /></Icon>;
const Phone = (p) => <Icon {...p}><rect width="14" height="20" x="5" y="2" rx="2" ry="2" /><path d="M12 18h.01" /></Icon>;
const Shield = (p) => <Icon {...p}><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" /></Icon>;
const Zap = (p) => <Icon {...p}><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" /></Icon>;
const ArrowRight = (p) => <Icon {...p}><line x1="5" x2="19" y1="12" y2="12" /><polyline points="12 5 19 12 12 19" /></Icon>;
const Search = (p) => <Icon {...p}><circle cx="11" cy="11" r="8" /><path d="m21 21-4.3-4.3" /></Icon>;
const QrCode = (p) => <Icon {...p}><rect width="5" height="5" x="3" y="3" rx="1" /><rect width="5" height="5" x="16" y="3" rx="1" /><rect width="5" height="5" x="3" y="16" rx="1" /><path d="M21 16h-3a2 2 0 0 0-2 2v3" /><path d="M21 21v.01" /><path d="M12 7v3a2 2 0 0 1-2 2H7" /><path d="M3 12h.01" /><path d="M12 3h.01" /><path d="M12 16v.01" /><path d="M16 12h1" /><path d="M21 12v.01" /><path d="M12 21v-1" /></Icon>;
const Lock = (p) => <Icon {...p}><rect width="18" height="11" x="3" y="11" rx="2" ry="2" /><path d="M7 11V7a5 5 0 0 1 10 0v4" /></Icon>;

// ───────── Kisti logo mark (recreated from the supplied PNG) ─────────
const KistiMark = ({ className = "h-8" }) =>
<img src="assets/kisti-logo.png" alt="Kisti" className={"block w-auto " + className} />;


// ───────── Primitive UI ─────────
const BrandButton = ({ label = "Join the waitlist", icon, onClick, as = "button", href }) => {
  const cls = "group inline-flex items-center justify-center gap-2 rounded-full bg-brand text-ink font-semibold text-sm px-5 py-3 transition-all hover:brightness-110 active:scale-[0.98] shadow-[0_0_0_1px_rgba(255,255,255,0.18)_inset,0_8px_30px_-10px_rgba(59,255,157,0.45)]";
  const inner =
  <>
      {icon}
      <span>{label}</span>
      <ChevronRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-px" />
    </>;

  return as === "a" ? <a href={href} className={cls}>{inner}</a> : <button onClick={onClick} className={cls}>{inner}</button>;
};

const GhostButton = ({ children, href = "#" }) =>
<a href={href} className="group rounded-full border border-white/15 text-white text-sm font-medium px-5 py-3 hover:bg-white/5 inline-flex items-center gap-2 transition-colors">
    {children}<ChevronRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-px" />
  </a>;


const SectionEyebrow = ({ label, tag }) =>
<div className="inline-flex items-center gap-2 text-xs text-white/60">
    <span className="w-1.5 h-1.5 rounded-full bg-brand"></span>
    <span>{label}</span>
    {tag && <span className="px-2 py-0.5 rounded-full border border-white/10 text-white/50">{tag}</span>}
  </div>;


// Green shiny gradient style for headline word
const gradientStyle = {
  backgroundImage: 'linear-gradient(to right, #06120A 0%, #0B3F24 12.5%, #B6FFD4 32.5%, #3BFF9D 50%, #0B3F24 67.5%, #06120A 87.5%, #06120A 100%)',
  backgroundSize: '200% auto',
  WebkitBackgroundClip: 'text',
  backgroundClip: 'text',
  color: 'transparent',
  WebkitTextFillColor: 'transparent',
  filter: 'url(#c3-noise)'
};

const fmtTk = (n) => '৳' + n.toLocaleString('en-IN', { maximumFractionDigits: 0 });

// ───────── 1) Navbar ─────────
function Navbar({ scrolled, openWaitlist }) {
  const links = ['How it works', 'Where to use'];
  return (
    <nav className={"fixed top-0 inset-x-0 z-30 transition-all " + (scrolled ? "bg-black/40 backdrop-blur-xl border-b border-white/[0.06]" : "")}>
      <div className="max-w-6xl mx-auto px-6 pt-5 pb-3">
        <div className="flex items-center justify-between anim-fadedown">
          <a href="#top" className="flex items-center gap-2.5">
            <KistiMark className="h-7" />
          </a>
          <div className="hidden md:flex gap-8">
            {links.map((l, i) =>
            <a key={l} href={"#" + l.toLowerCase().replace(/\s+/g, '-')} className="text-white/70 text-sm font-medium hover:text-white transition-colors anim-fadedown"
            style={{ animationDelay: 0.1 + i * 0.05 + 's' }}>{l}</a>
            )}
          </div>
          <div className="flex items-center gap-2">
            <ComingSoonPill />
            <div className="hidden sm:block">
              <BrandButton label="Join the waitlist" as="a" href="#waitlist" />
            </div>
            <button className="md:hidden w-10 h-10 rounded-full border border-white/10 bg-white/5 flex items-center justify-center" aria-label="Menu">
              <Menu className="w-4 h-4" />
            </button>
          </div>
        </div>
      </div>
    </nav>);

}

function ComingSoonPill() {
  return (
    <span className="hidden sm:inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-white/10 bg-white/[0.03] text-[11px] font-mono text-white/70">
      <span className="relative w-2 h-2 rounded-full bg-brand pulse-dot"></span>
      COMING SOON · BANGLADESH · 2026
    </span>);

}

// ───────── 2) Hero ─────────
function Hero() {
  return (
    <section id="top" className="relative pt-32 md:pt-44 pb-8 md:pb-20 text-center flex flex-col items-center px-6" style={{ zIndex: 6 }}>
      <h1 className="text-4xl md:text-7xl font-semibold tracking-tight leading-[0.9] anim-hero" style={{ animationDelay: '0.3s' }}>
        <span className="block text-white">Shop now. Pay in 4.</span>
        <span className="block animate-shiny" style={gradientStyle}>Zero interest.</span>
      </h1>

      <p className="mt-8 text-white/60 max-w-lg text-base md:text-lg leading-[1.55] anim-hero" style={{ animationDelay: '0.5s' }}>
        Bangladesh's first Buy Now, Pay Later. Split any purchase into <b className="text-white">4 equal monthly installments</b> at 200+ local shops. Repay with bKash, Nagad, or any bank — 0% interest, always.
      </p>

      <div id="waitlist" className="mt-9 w-full max-w-md anim-hero" style={{ animationDelay: '0.7s' }}>
        <WaitlistForm />
        <div className="mt-3 text-xs text-white/40 font-mono">
          · <b className="text-white/70">2,847 people</b> already on the watchlist · no spam, ever
        </div>
      </div>
    </section>);

}

function WaitlistForm() {
  const [email, setEmail] = useState("");
  const [done, setDone] = useState(false);
  const [err, setErr] = useState("");
  const submit = (e) => {
    e.preventDefault();
    if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email)) {setErr("Please enter a valid email.");return;}
    setErr("");
    setDone(true);
  };
  if (done) return (
    <div className="liquid-glass rounded-2xl px-5 py-5 text-left">
      <div className="flex items-center gap-3">
        <span className="w-9 h-9 rounded-full bg-brand text-ink inline-flex items-center justify-center"><Check className="w-4 h-4" strokeWidth={3} /></span>
        <div>
          <div className="text-white text-sm font-semibold">You're on the watchlist.</div>
          <div className="text-white/60 text-xs mt-0.5">We'll ping <span className="text-white">{email}</span> the day Kisti launches.</div>
        </div>
        <div className="ml-auto font-mono text-[10px] text-white/40">#KISTI-{Math.floor(Math.random() * 9000 + 1000)}</div>
      </div>
    </div>);

  return (
    <form onSubmit={submit} className="liquid-glass rounded-2xl p-1.5 flex items-center gap-1.5">
      <input
        type="email" value={email}
        onChange={(e) => {setEmail(e.target.value);setErr("");}}
        placeholder="your@email.com"
        className="flex-1 min-w-0 bg-transparent px-4 py-3 text-sm text-white placeholder-white/35 outline-none" />
      
      <button type="submit" className="group inline-flex items-center gap-1.5 rounded-xl bg-brand text-ink font-semibold text-sm px-4 py-3 whitespace-nowrap shrink-0 hover:brightness-110 active:scale-[0.98] transition-all">
        Join watchlist <ArrowRight className="w-3.5 h-3.5 transition-transform group-hover:translate-x-px" />
      </button>
      {err && <div className="absolute mt-16 text-xs text-rose-300 font-mono">{err}</div>}
    </form>);

}

// ───────── 3) macOS-style strip (rebranded as a checkout strip) ─────────
function StatusBar() {
  const items = ['Aarong', 'Daraz', 'Pickaboo', 'Chaldal', 'Foodpanda', 'Bata'];
  return (
    <div className="w-full h-10 bg-black/40 backdrop-blur-md border-t border-b border-white/10 anim-fadedown"
    style={{ animationDelay: '0.9s', position: 'relative', zIndex: 6 }}>
      <div className="max-w-6xl mx-auto px-6 h-full flex items-center justify-between text-xs">
        <div className="flex items-center gap-4">
          <KistiMark className="h-3.5" />
          <span className="text-white/40">|</span>
          <span className="text-white/60 font-mono">Live in</span>
          <span className="text-white/80">Dhaka</span>
          <span className="text-white/60 hidden sm:inline">· Chattogram</span>
          <span className="text-white/60 hidden md:inline">· Sylhet</span>
          <span className="text-white/60 hidden lg:inline">· Khulna</span>
        </div>
        <div className="flex items-center gap-3 text-white/60">
          <Search className="w-3.5 h-3.5" />
          <span className="font-mono">200+ MERCHANTS AT LAUNCH</span>
        </div>
      </div>
    </div>);

}

// ───────── 4) Phone app mockup (3 phones, staggered) ─────────
function PhoneFrame({ children, width = 300, opacity = 1, transform }) {
  return (
    <div className="relative mx-auto" style={{ width, opacity, transform, transformOrigin: 'bottom center' }}>
      <div className="relative rounded-[44px] p-[5px] device-shadow"
      style={{ background: 'linear-gradient(160deg, #1a2a20 0%, #0a1410 60%, #050a07 100%)' }}>
        <div className="relative rounded-[40px] overflow-hidden bg-[#06120A]" style={{ aspectRatio: '9/19.5' }}>
          {/* Status bar */}
          <div className="relative flex items-center justify-between px-6 pt-2.5 pb-1 text-[11px] font-semibold text-white">
            <span>9:41</span>
            <div className="absolute left-1/2 -translate-x-1/2 top-2 w-24 h-6 rounded-full bg-black"></div>
            <div className="flex items-center gap-1">
              <svg width="13" height="9" viewBox="0 0 16 12" fill="currentColor"><rect x="0" y="8" width="2.5" height="4" rx="0.5" /><rect x="4" y="5" width="2.5" height="7" rx="0.5" /><rect x="8" y="2" width="2.5" height="10" rx="0.5" /><rect x="12" y="0" width="2.5" height="12" rx="0.5" /></svg>
              <span className="text-[9px] font-mono ml-0.5">5G</span>
              <span className="ml-1 inline-block w-5 h-2.5 rounded-[3px] border border-white/70 relative align-middle">
                <span className="absolute inset-[1px] bg-white rounded-[1px]"></span>
              </span>
            </div>
          </div>
          {/* Screen content */}
          <div className="relative h-[calc(100%-32px)] overflow-hidden">{children}</div>
        </div>
      </div>
    </div>);

}

function ScreenHome() {
  const merchants = [
  { name: 'Daraz', c: '#F85606' },
  { name: 'Aarong', c: '#9B2C5F' },
  { name: 'Chaldal', c: '#0EAD69' },
  { name: 'Pickaboo', c: '#2D8CFF' }];

  return (
    <div className="h-full flex flex-col px-5 pt-3 pb-4">
      <div className="flex items-center justify-between">
        <div>
          <div className="text-[10px] text-white/45 font-mono uppercase tracking-wider">শুভ সন্ধ্যা</div>
          <div className="text-base text-white font-semibold tracking-tight">Hi, Rashed</div>
        </div>
        <div className="w-9 h-9 rounded-full bg-gradient-to-br from-brand to-brandDeep flex items-center justify-center text-ink text-xs font-bold">RH</div>
      </div>

      <div className="relative mt-4 rounded-2xl p-4 overflow-hidden" style={{ background: 'linear-gradient(135deg, #0BCB75 0%, #06120A 95%)' }}>
        <div className="absolute inset-0 opacity-30" style={{ background: 'radial-gradient(120% 60% at 0% 0%, rgba(59,255,157,0.5), transparent 60%)' }} />
        <div className="relative">
          <div className="text-[10px] text-white/70 font-mono uppercase tracking-wider">Available limit</div>
          <div className="mt-1 flex items-baseline gap-1.5">
            <span className="text-2xl text-white font-bold tracking-tight">৳88,000</span>
            <span className="text-[10px] text-white/60 font-mono">/ ৳1,00,000</span>
          </div>
          <div className="mt-2.5 h-1 rounded-full bg-white/15 overflow-hidden">
            <div className="h-full bg-white" style={{ width: '88%' }}></div>
          </div>
          <div className="mt-3 flex items-center justify-between text-[10px] text-white/70">
            <span>Next due · ৳3,000</span><span className="font-mono">15 JUN</span>
          </div>
        </div>
      </div>

      <div className="mt-4 grid grid-cols-3 gap-2">
        {[{ label: 'Pay', icon: <Lock className="w-4 h-4" /> }, { label: 'Shop', icon: <Bag className="w-4 h-4" /> }, { label: 'Scan', icon: <QrCode className="w-4 h-4" /> }].map((a) =>
        <div key={a.label} className="rounded-xl bg-white/[0.05] border border-white/[0.06] flex flex-col items-center justify-center py-3 gap-1.5 text-white">
            <span className="text-brand">{a.icon}</span>
            <span className="text-[10px] font-medium">{a.label}</span>
          </div>
        )}
      </div>

      <div className="mt-4 flex-1">
        <div className="flex items-center justify-between mb-2">
          <span className="text-[10px] uppercase tracking-widest text-white/40 font-mono">Pay in 4 at</span>
          <span className="text-[10px] text-brand">See all</span>
        </div>
        <div className="space-y-1.5">
          {merchants.map((m) =>
          <div key={m.name} className="rounded-xl bg-white/[0.04] border border-white/[0.05] p-2.5 flex items-center gap-3">
              <div className="w-9 h-9 rounded-lg flex items-center justify-center text-white text-xs font-bold" style={{ background: m.c }}>{m.name[0]}</div>
              <div className="flex-1">
                <div className="text-xs text-white font-medium">{m.name}</div>
                <div className="text-[10px] text-white/40 font-mono">৳ split into 4</div>
              </div>
              <ChevronRight className="w-3.5 h-3.5 text-white/30" />
            </div>
          )}
        </div>
      </div>

      <div className="mt-3 rounded-2xl bg-white/[0.04] border border-white/[0.05] flex items-center justify-between px-2 py-2">
        {[{ i: <Bag className="w-4 h-4" />, a: true }, { i: <QrCode className="w-4 h-4" /> }, { i: <Sparkles className="w-4 h-4" /> }, { i: <Phone className="w-4 h-4" /> }].map((t, i) =>
        <div key={i} className={"flex-1 flex justify-center py-1.5 " + (t.a ? "text-brand" : "text-white/45")}>{t.i}</div>
        )}
      </div>
    </div>);

}

function ScreenCheckout() {
  const installment = 3000;
  return (
    <div className="h-full flex flex-col px-5 pt-3 pb-4">
      <div className="flex items-center justify-between mb-3">
        <button className="w-8 h-8 rounded-full bg-white/[0.06] flex items-center justify-center text-white"><ChevronRight className="w-3.5 h-3.5 rotate-180" /></button>
        <div className="text-xs text-white/70 font-medium">Checkout</div>
        <div className="w-8 h-8"></div>
      </div>

      <div className="rounded-xl bg-white/[0.04] border border-white/[0.05] p-3 flex items-center gap-3 mb-3">
        <div className="w-11 h-11 rounded-lg bg-gradient-to-br from-white/15 to-white/[0.03] flex items-center justify-center"><Phone className="w-5 h-5 text-white/70" /></div>
        <div className="flex-1 min-w-0">
          <div className="text-[11px] text-white font-medium leading-tight truncate">iPhone 15 Pro · 256GB</div>
          <div className="text-[10px] text-white/40 font-mono mt-0.5">Daraz · Natural Titanium</div>
        </div>
        <div className="text-xs text-white font-semibold tracking-tight">৳12,000</div>
      </div>

      <div className="relative rounded-2xl p-3.5 overflow-hidden border border-brand/30" style={{ background: 'linear-gradient(135deg, rgba(59,255,157,0.14), rgba(11,203,117,0.04) 60%)' }}>
        <div className="flex items-center justify-between">
          <div className="text-[10px] uppercase tracking-widest text-brand font-mono font-semibold">Pay in 4 with Kisti</div>
          <div className="text-[9px] font-mono text-white/40">0% APR</div>
        </div>
        <div className="mt-2 flex items-baseline gap-1.5">
          <span className="text-2xl text-white font-bold tracking-tight">৳{installment.toLocaleString('en-IN')}</span>
          <span className="text-[11px] text-white/55">/ month × 4</span>
        </div>

        <div className="mt-4 relative">
          <div className="absolute top-3 left-3 right-3 h-px bg-white/15"></div>
          <div className="grid grid-cols-4 gap-1 relative">
            {['Now', 'M2', 'M3', 'M4'].map((m, i) =>
            <div key={i} className="flex flex-col items-center">
                <div className={"w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold relative " + (
              i === 0 ? "bg-brand text-ink ring-2 ring-brand/30" : "bg-white/10 text-white/50")}>{i + 1}</div>
                <div className="mt-1.5 text-[9px] text-white/60 font-medium">{m}</div>
                <div className="text-[8px] text-white/35 font-mono">৳3,000</div>
              </div>
            )}
          </div>
        </div>
      </div>

      <div className="mt-3 space-y-1.5">
        <div className="flex items-center justify-between text-[11px]"><span className="text-white/50">Interest</span><span className="text-brand font-semibold">৳0.00</span></div>
        <div className="flex items-center justify-between text-[11px]"><span className="text-white/50">Late fees</span><span className="text-brand font-semibold">৳0.00</span></div>
        <div className="flex items-center justify-between text-xs pt-2 border-t border-white/10"><span className="text-white/80 font-medium">Total</span><span className="text-white font-bold tracking-tight">৳12,000</span></div>
      </div>

      <div className="mt-3 rounded-xl bg-white/[0.04] border border-white/[0.05] p-2.5 flex items-center gap-2.5">
        <span className="w-7 h-7 rounded-md flex items-center justify-center text-[10px] font-bold text-white" style={{ background: '#E2136E' }}>b</span>
        <div className="flex-1 min-w-0">
          <div className="text-[11px] text-white font-medium">bKash · 01XXXXX1234</div>
          <div className="text-[9px] text-white/40 font-mono">FIRST PAYMENT FROM</div>
        </div>
        <span className="w-2 h-2 rounded-full bg-brand"></span>
      </div>

      <button className="mt-auto rounded-xl bg-brand text-ink font-bold text-sm py-3 inline-flex items-center justify-center gap-1.5">
        <Lock className="w-3.5 h-3.5" strokeWidth={2.6} /> Pay ৳3,000 now
      </button>
    </div>);

}

function ScreenPlan({ tick }) {
  const installment = 3000;
  const months = ['Today', 'Month 2', 'Month 3', 'Month 4'];
  const today = new Date();
  const dates = months.map((_, i) => {const d = new Date(today);d.setMonth(d.getMonth() + i);return d.toLocaleDateString('en-GB', { day: '2-digit', month: 'short' });});
  const paid = tick % 5;
  return (
    <div className="h-full flex flex-col px-5 pt-3 pb-4">
      <div className="flex items-center justify-between mb-3">
        <button className="w-8 h-8 rounded-full bg-white/[0.06] flex items-center justify-center text-white"><ChevronRight className="w-3.5 h-3.5 rotate-180" /></button>
        <div className="text-xs text-white/70 font-medium">Your plan</div>
        <button className="w-8 h-8 rounded-full bg-white/[0.06] flex items-center justify-center text-[10px] text-white/60 font-bold">···</button>
      </div>

      <div className="text-center pb-2">
        <div className="text-[10px] uppercase tracking-widest text-white/40 font-mono">Daraz · order #84221</div>
        <div className="mt-1 text-2xl text-white font-bold tracking-tight">৳12,000.00</div>
        <div className="text-[11px] text-white/50 mt-0.5">{paid} of 4 paid · 0% interest</div>
        <div className="mt-3 grid grid-cols-4 gap-1.5">
          {[0, 1, 2, 3].map((i) =>
          <div key={i} className="relative h-1.5 rounded-full overflow-hidden" style={{ background: i < paid ? '#3BFF9D' : 'rgba(255,255,255,0.08)' }}>
              {i === paid && <span className="absolute inset-0" style={{ background: 'linear-gradient(90deg, transparent, rgba(59,255,157,0.6), transparent)', animation: 'sweep 1.4s ease infinite' }} />}
            </div>
          )}
        </div>
      </div>

      <div className="flex-1 space-y-2 mt-2">
        {[0, 1, 2, 3].map((i) => {
          const state = i < paid ? 'paid' : i === paid ? 'due' : 'upcoming';
          return (
            <div key={i} className={"rounded-xl px-3 py-2.5 flex items-center gap-3 " + (
            state === 'due' ? 'bg-white/[0.05] border border-brand/30' :
            state === 'paid' ? 'bg-brand/10 border border-brand/15' :
            'bg-white/[0.025] border border-white/[0.04] opacity-65')}>
              <div className={"w-7 h-7 rounded-full flex items-center justify-center text-[10px] font-bold flex-shrink-0 " + (
              state === 'paid' ? 'bg-brand text-ink' : state === 'due' ? 'bg-white/10 text-white border border-brand/40' : 'bg-white/5 text-white/40')}>
                {state === 'paid' ? <Check className="w-3 h-3" strokeWidth={3} /> : i + 1}
              </div>
              <div className="flex-1 min-w-0">
                <div className="text-[11px] text-white font-medium">{months[i]}</div>
                <div className="text-[9px] text-white/45 font-mono">{dates[i].toUpperCase()}</div>
              </div>
              <div className="text-right">
                <div className="text-[11px] text-white font-semibold tracking-tight">৳{installment.toLocaleString('en-IN')}</div>
                <div className={"text-[9px] uppercase tracking-wider font-mono " + (
                state === 'paid' ? 'text-brand' : state === 'due' ? 'text-white/70' : 'text-white/40')}>
                  {state === 'paid' ? 'Paid' : state === 'due' ? 'Due' : '—'}
                </div>
              </div>
            </div>);

        })}
      </div>

      <button className="mt-3 rounded-xl bg-white/[0.05] border border-white/10 text-white font-semibold text-[11px] py-2.5 inline-flex items-center justify-center gap-1.5">
        Pay with bKash <ChevronRight className="w-3 h-3" />
      </button>
    </div>);

}

function CheckoutMockup() {
  const [tick, setTick] = useState(0);
  useEffect(() => {
    const id = setInterval(() => setTick((t) => t + 1), 2800);
    return () => clearInterval(id);
  }, []);

  return (
    <section className="max-w-6xl mx-auto px-6 py-8 md:py-24 relative" style={{ zIndex: 6 }}>
      <div className="text-center mb-6 md:mb-12 anim-fadeup">
        <SectionEyebrow label="The app" tag="iOS · Android" />
        <h2 className="mt-4 text-3xl md:text-5xl font-semibold tracking-tight leading-[1.02] max-w-3xl mx-auto">
          One app. <span className="text-brand">Every payment.</span>
        </h2>
        <p className="mt-4 text-white/55 max-w-md mx-auto text-base leading-[1.55]">
          Shop, split, and repay — entirely from your phone. No bank visits, no paperwork, no card needed.
        </p>
      </div>

      <div className="relative anim-fadeup-lg" style={{ animationDelay: '0.2s' }}>
        <div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[80%] h-[60%] pointer-events-none"
        style={{ background: 'radial-gradient(closest-side, rgba(59,255,157,0.20), transparent 70%)', filter: 'blur(40px)' }} />

        <div className="hidden md:flex relative justify-center items-end gap-2 lg:gap-4">
          <div style={{ zIndex: 1 }}>
            <PhoneFrame width={260} opacity={0.92} transform="rotate(-6deg) translateY(24px)">
              <ScreenHome />
            </PhoneFrame>
          </div>
          <div style={{ zIndex: 3 }}>
            <PhoneFrame width={300}>
              <ScreenCheckout />
            </PhoneFrame>
          </div>
          <div style={{ zIndex: 1 }}>
            <PhoneFrame width={260} opacity={0.92} transform="rotate(6deg) translateY(24px)">
              <ScreenPlan tick={tick} />
            </PhoneFrame>
          </div>
        </div>

        <div className="md:hidden flex justify-center">
          <PhoneFrame><ScreenCheckout /></PhoneFrame>
        </div>
      </div>

      <div className="mt-14 flex flex-col sm:flex-row items-center justify-center gap-3 anim-fadeup">
        <a href="#waitlist" className="inline-flex items-center gap-3 rounded-2xl border border-white/15 bg-white/[0.03] px-5 py-3 hover:bg-white/[0.05] transition-colors">
          <svg viewBox="0 0 384 512" className="w-5 h-5 text-white" fill="currentColor"><path d="M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z" /></svg>
          <div className="text-left">
            <div className="text-[10px] text-white/50 font-mono">COMING TO</div>
            <div className="text-sm text-white font-semibold">App Store</div>
          </div>
        </a>
        <a href="#waitlist" className="inline-flex items-center gap-3 rounded-2xl border border-white/15 bg-white/[0.03] px-5 py-3 hover:bg-white/[0.05] transition-colors">
          <svg viewBox="0 0 24 24" className="w-5 h-5 text-white" fill="currentColor"><path d="M3.609 1.814 13.792 12 3.61 22.186a.996.996 0 0 1-.61-.92V2.734a1 1 0 0 1 .609-.92zm10.89 10.893 2.302 2.302-10.937 6.333zm3.199-3.198 2.748 1.591a1 1 0 0 1 0 1.8l-2.748 1.591L15.5 12zM5.864 2.658l10.937 6.333-2.302 2.302L5.864 2.658z" /></svg>
          <div className="text-left">
            <div className="text-[10px] text-white/50 font-mono">COMING TO</div>
            <div className="text-sm text-white font-semibold">Google Play</div>
          </div>
        </a>
      </div>
    </section>);

}
// ───────── 5) Why Kisti (FeatureTriage adaptation) ─────────
function WhyKisti() {
  const buckets = [
  { name: '0% interest', count: 'Always', c: '#3BFF9D', items: ['Zero APR · zero late fees', 'The price you see is what you pay'] },
  { name: 'bKash · Nagad', count: 'Built-in', c: '#B6FFD4', items: ['Repay how you already pay', 'No card needed, ever'] },
  { name: 'Auto-growing limit', count: '৳5K → ৳1,00,000', c: 'rgba(59,255,157,0.6)', items: ['Starts modest, grows with you', 'On-time = higher limit, automatic'] },
  { name: 'Bangla-first', count: 'বাংলা', c: 'rgba(59,255,157,0.35)', items: ['App, support & SMS in Bengali', 'Built by people who live here'] }];

  const chips = ['Soft NID check · no CIB hit', 'Approved in 10 min', 'Face ID & 2FA', 'In-store QR pay', 'BFIU compliant'];
  return (
    <section id="how-it-works" className="max-w-6xl mx-auto px-6 py-20 md:py-28" style={{ position: 'relative', zIndex: 6 }}>
      <div className="grid md:grid-cols-2 gap-10 md:gap-16 items-start">
        <div className="anim-fadeup">
          <SectionEyebrow label="Why Kisti" tag="Built for Bangladesh" />
          <h2 className="mt-5 text-3xl md:text-5xl font-semibold tracking-tight leading-[1.02]">
            Pay-later,<br />
            <span className="text-brand">finally done right.</span>
          </h2>
          <p className="mt-6 text-white/60 text-base leading-[1.6] max-w-md">
            Card-based EMIs are clunky and expensive. Loan sharks are worse. We built something honest in between — for the 170 million people who deserve it.
          </p>
          <div className="mt-7 flex flex-wrap gap-2">
            {chips.map((c) =>
            <span key={c} className="text-xs text-white/70 px-3 py-1.5 rounded-full border border-white/10 bg-white/[0.03]">{c}</span>
            )}
          </div>
        </div>
        <div className="liquid-glass rounded-2xl p-5">
          <div className="text-xs text-white/50 mb-4 font-mono">TODAY · 12,480 PAYMENTS SCHEDULED</div>
          <div className="grid grid-cols-2 gap-3">
            {buckets.map((b) =>
            <div key={b.name} className="liquid-glass rounded-lg p-3">
                <div className="flex items-center gap-2 mb-2.5">
                  <span className="w-2 h-2 rounded-full" style={{ background: b.c }}></span>
                  <span className="text-xs font-medium text-white">{b.name}</span>
                  <span className="ml-auto text-[10px] text-white/40 font-mono">{b.count}</span>
                </div>
                <ul className="space-y-1.5">
                  {b.items.map((it, i) =>
                <li key={i} className="text-[11px] text-white/60 leading-snug">{it}</li>
                )}
                </ul>
              </div>
            )}
          </div>
        </div>
      </div>
    </section>);

}

// ───────── 6) Merchant strip ─────────
function MerchantStrip() {
  const merchants = ['Daraz', 'Chaldal', 'Shajgoj', 'AjkerDeal', 'Bikroy', 'Rokomari', 'Pickaboo', 'Aarong', 'Apex', 'Foodpanda', 'Bata', 'Yellow', 'Sailor', 'Le Reve', 'Khaas Food', 'Hatil'];
  return (
    <section id="where-to-use" className="max-w-6xl mx-auto px-6 py-16 md:py-20" style={{ position: 'relative', zIndex: 6 }}>
      <div className="text-xs uppercase tracking-widest text-white/40 text-center font-mono">
        Trusted by the brands you already shop with
      </div>
      <div className="mt-10 relative overflow-hidden" style={{
        maskImage: 'linear-gradient(90deg, transparent, black 12%, black 88%, transparent)',
        WebkitMaskImage: 'linear-gradient(90deg, transparent, black 12%, black 88%, transparent)'
      }}>
        <div className="flex gap-6 md:gap-12 whitespace-nowrap" style={{ animation: 'marquee 60s linear infinite', width: 'fit-content' }}>
          {[...merchants, ...merchants].map((m, i) =>
          <div key={i} className="inline-flex items-center gap-2 text-lg md:text-3xl font-semibold tracking-tight"
          style={{ color: i % 3 === 0 ? 'rgba(255,255,255,0.85)' : 'rgba(255,255,255,0.35)' }}>
              {m}
              <span className="text-xs font-mono text-brand/70">৳/4</span>
            </div>
          )}
        </div>
      </div>
      <div className="mt-6 text-center text-xs text-white/40 font-mono">
        * 200+ MERCHANTS READY AT LAUNCH · DHAKA · CHATTOGRAM · SYLHET
      </div>
    </section>);

}

// ───────── 7) Testimonials ─────────
function Testimonials() {
  const items = [
  { q: "I've been waiting for something like Kisti in Bangladesh. Card EMIs were never an option for me — Kisti makes pay-later actually accessible.", name: 'Rashed Hossain', role: 'Software engineer', co: 'Dhaka' },
  { q: "As a small online seller, I'm signing up day one. Pay-in-4 is going to lift my checkout conversion in a way nothing else has.", name: 'Tahmina Akhter', role: 'Founder · online boutique', co: 'Chattogram' },
  { q: "Repaying through bKash is the killer feature. No new cards, no bank queues. This is how BNPL should work here.", name: 'Fahim Rahman', role: 'Marketing lead', co: 'Sylhet' }];

  return (
    <section className="max-w-6xl mx-auto px-6 py-20 md:py-28 border-t border-white/10" style={{ position: 'relative', zIndex: 6 }}>
      <div className="grid md:grid-cols-3 gap-6">
        {items.map((it, i) =>
        <figure key={i} className="liquid-glass rounded-2xl p-6 anim-fadeup" style={{ animationDelay: i * 0.08 + 's' }}>
            <blockquote className="text-sm text-white/85 leading-[1.6]">"{it.q}"</blockquote>
            <figcaption className="mt-6 pt-5 border-t border-white/10">
              <div className="text-sm font-semibold text-white">{it.name}</div>
              <div className="text-xs text-white/50">{it.role}</div>
              <div className="text-xs text-brand font-semibold tracking-wide uppercase mt-2">{it.co}</div>
            </figcaption>
          </figure>
        )}
      </div>
      <div className="mt-4 text-center text-[10px] text-white/30 font-mono">* PRE-LAUNCH FEEDBACK FROM WAITLIST MEMBERS</div>
    </section>);

}

// ───────── 8) Waitlist section with watermark (replaces pricing) ─────────
function WaitlistSection() {
  return (
    <section className="c3-section" style={{ position: 'relative', zIndex: 6 }}>
      <svg style={{ position: 'absolute', width: 0, height: 0 }} aria-hidden>
        <filter id="c3-noise">
          <feTurbulence type="fractalNoise" baseFrequency="0.5" numOctaves="2" stitchTiles="stitch" />
          <feComponentTransfer><feFuncA type="linear" slope="0.075" /></feComponentTransfer>
          <feComposite in2="SourceGraphic" operator="in" result="noise" />
          <feBlend in="SourceGraphic" in2="noise" mode="overlay" />
        </filter>
      </svg>

      <div className="c3-watermark-container">
        <div className="c3-watermark-main">
          <span className="c3-watermark-line-1" style={{ lineHeight: "0.85" }}>Pay in 4</span>
          <span className="c3-watermark-line-2" style={{ lineHeight: "2" }}>কিস্তি</span>
        </div>
      </div>

      <div className="relative z-10 grid md:grid-cols-3 gap-5 w-full max-w-5xl mt-16">
        <PerkCard tier="01" title="Founding member" perks={[
        'Skip the queue at launch',
        'Higher starting limit (৳10K vs ৳5K)',
        'Founders\' chat group access',
        'Exclusive launch-day perks']
        } />
        <PerkCard tier="02" title="Early access" perks={[
        'Try Kisti 6 weeks before public launch',
        'Direct line to our team',
        'Shape the roadmap with feedback',
        'Surprise drops with partner brands']
        } highlight />
        <PerkCard tier="03" title="Launch notify" perks={[
        'Email when Kisti is live',
        'Priority onboarding queue',
        'First-month interest-free guarantee',
        'No spam, ever']
        } />
      </div>

      <div className="relative z-10 mt-12 w-full max-w-md">
        <div className="text-center mb-3">
          <SectionEyebrow label="Reserve your spot" tag="60 seconds" />
        </div>
        <WaitlistForm />
        <div className="mt-3 text-[11px] text-white/50 font-mono text-center">
          · <b className="text-white">2,847 people</b> · joining ~120 / day · launch 2026
        </div>
      </div>
    </section>);

}

function PerkCard({ tier, title, perks, highlight }) {
  return (
    <div className={"liquid-glass rounded-2xl p-6 transition-all hover:-translate-y-1 " + (highlight ? "border border-brand/30 bg-brand/[0.04]" : "")}>
      <div className="flex items-center justify-between mb-3">
        <span className="text-[10px] uppercase tracking-widest text-white/40 font-mono">{tier}</span>
        {highlight && <span className="text-[10px] uppercase tracking-widest text-brand font-mono px-2 py-0.5 rounded-full bg-brand/10 border border-brand/20">Recommended</span>}
      </div>
      <h3 className="text-xl text-white font-semibold tracking-tight">{title}</h3>
      <ul className="mt-5 space-y-3">
        {perks.map((p, i) =>
        <li key={i} className="flex items-start gap-2.5 text-[13px] text-white/75 leading-snug">
            <span className={"w-5 h-5 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5 " + (highlight ? "bg-brand text-ink" : "bg-white/10 text-white")}>
              <Check className="w-3 h-3" strokeWidth={3} />
            </span>
            {p}
          </li>
        )}
      </ul>
    </div>);

}

// ───────── 9) FAQ ─────────
function FAQ() {
  const qs = [
  { q: 'When does Kisti launch?', a: 'Public launch is targeted for 2026, starting in Dhaka, Chattogram, and Sylhet. Waitlist members get access 6 weeks earlier in batches.' },
  { q: 'How does the pay-in-4 work?', a: "We split any purchase into 4 equal payments, one per month, over 4 months. Pay the first at checkout — the rest auto-deduct via bKash, Nagad, or your bank. Zero interest. Zero fees." },
  { q: 'Is this really 0% interest? How do you make money?', a: "Yes — 0% interest, 0% APR, no hidden fees. Merchants pay us a small fee for the boost in conversion and average order value Kisti drives. Shoppers pay nothing extra." },
  { q: 'What if I miss a payment?', a: "We never charge late fees. If a payment fails, your account is paused until you catch up — and we'll work with you to find a plan that works. No collections calls. No predatory tactics." },
  { q: 'How big a purchase can I make?', a: "Everyone starts with a ৳5,000 limit. Pay on time and it grows automatically — all the way up to ৳1,00,000." },
  { q: 'Where can I use Kisti?', a: "At 200+ merchants at launch — Daraz, Aarong, Chaldal, Foodpanda, Pickaboo, Apex and more. Online, in-app, and in-store via QR code." }];

  const [open, setOpen] = useState(0);
  return (
    <section id="faq" className="max-w-3xl mx-auto px-6 py-20 md:py-28" style={{ position: 'relative', zIndex: 6 }}>
      <div className="text-center">
        <SectionEyebrow label="FAQ" tag="প্রশ্ন" />
        <h2 className="mt-5 text-3xl md:text-5xl font-semibold tracking-tight leading-[1.02]">The short answers.</h2>
      </div>
      <div className="mt-12 border-t border-white/10">
        {qs.map((it, i) =>
        <div key={i} className="border-b border-white/10">
            <button onClick={() => setOpen(open === i ? -1 : i)} className="w-full flex items-center justify-between text-left py-5 group">
              <span className="flex items-baseline gap-4">
                <span className="text-[11px] font-mono text-white/40 w-6">0{i + 1}</span>
                <span className="text-base md:text-lg text-white font-medium">{it.q}</span>
              </span>
              <span className={"w-8 h-8 rounded-full border border-white/15 flex items-center justify-center flex-shrink-0 transition-all text-lg " + (open === i ? "bg-brand text-ink border-brand" : "text-white")}>
                {open === i ? '−' : '+'}
              </span>
            </button>
            <div className="overflow-hidden transition-[max-height] duration-300" style={{ maxHeight: open === i ? '200px' : '0' }}>
              <p className="text-sm text-white/60 leading-[1.6] pl-10 pb-5 pr-8">{it.a}</p>
            </div>
          </div>
        )}
      </div>
    </section>);

}

// ───────── 10) Final CTA ─────────
function FinalCTA() {
  return (
    <section className="max-w-6xl mx-auto px-6 py-20 md:py-28" style={{ position: 'relative', zIndex: 6 }}>
      <div className="liquid-glass relative overflow-hidden rounded-3xl px-5 md:px-8 py-12 md:py-24 text-center anim-fadeup-lg">
        <div className="absolute inset-0 pointer-events-none" style={{
          background: 'radial-gradient(700px circle at 50% 0%, rgba(59,255,157,0.18), transparent 70%)'
        }} />
        <div className="relative">
          <div className="inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-white/10 bg-white/[0.03] text-[11px] font-mono text-white/70 mb-8">
            <span className="relative w-2 h-2 rounded-full bg-brand pulse-dot"></span>
            COMING TO BANGLADESH · 2026
          </div>
          <h2 className="text-2xl md:text-6xl font-semibold tracking-tight leading-[1.1]">
            Skip the line.<br />
            <span className="animate-shiny" style={gradientStyle}>Join the watchlist.</span>
          </h2>
          <p className="mt-6 text-white/60 max-w-md mx-auto text-sm leading-[1.6]">
            Be first to shop with Kisti when we go live. Waitlist members get a higher starting limit, founders'-chat access, and launch-day perks.
          </p>
          <div className="mt-8 max-w-md mx-auto">
            <WaitlistForm />
          </div>
          <div className="mt-4 text-[11px] text-white/40 font-mono">
            · 2,847 already in · no spam · 1-click unsubscribe
          </div>
        </div>
      </div>
    </section>);

}

// ───────── 11) Footer ─────────
function Footer() {
  return (
    <footer className="border-t border-white/10 mt-10" style={{ position: 'relative', zIndex: 6 }}>
      <div className="max-w-6xl mx-auto px-6 py-16">
        <div className="grid md:grid-cols-4 gap-10">
          <div className="md:col-span-2">
            <KistiMark className="h-7" />
            <p className="mt-5 text-sm text-white/55 max-w-sm leading-relaxed">
              Bangladesh's Buy Now, Pay Later. Shop at 200+ merchants and pay in 4 equal monthly installments — 0% interest, no hidden fees. Launching 2026.
            </p>
            <div className="mt-5 flex gap-2">
              {[
                { label: 'IG', href: 'https://www.instagram.com/kisti.ltd' },
                { label: 'FB', href: 'https://www.facebook.com/share/1HzFKN6RQs/?mibextid=wwXIfr' },
              ].map(({ label, href }) =>
              <a key={label} href={href} target="_blank" rel="noopener noreferrer" className="w-9 h-9 rounded-full border border-white/15 text-white/70 hover:bg-white/5 hover:text-white inline-flex items-center justify-center text-[11px] font-mono">{label}</a>
              )}
            </div>
          </div>
          {[
          { h: 'Product', items: ['How it works', 'Where to use', 'FAQ', 'For merchants'] },
          { h: 'Legal', items: ['Terms', 'Privacy', 'Complaints', 'Press kit'] }].
          map((col) =>
          <div key={col.h}>
              <div className="text-[11px] uppercase tracking-widest text-brand font-mono mb-4">{col.h}</div>
              <ul className="space-y-2.5">
                {col.items.map((it) =>
              <li key={it}><a href="#" className="text-sm text-white/70 hover:text-white">{it}</a></li>
              )}
              </ul>
            </div>
          )}
        </div>

        <div className="mt-14 pt-6 border-t border-white/10 flex flex-wrap items-center justify-between gap-3 font-mono text-[11px] text-white/40">
          <div>© 2026 Kisti Ltd · Registered in Bangladesh · BFIU Compliant</div>
          <div>Made with ৳ in Dhaka · ঢাকায় তৈরি</div>
          <div>kisti.io · hello@kisti.io</div>
        </div>
      </div>
    </footer>);

}

// ───────── Backdrop layers ─────────
function BackgroundVideo({ src }) {
  const ref = useRef(null);
  useEffect(() => {
    const video = ref.current;
    if (!video) return;
    // Safari plays HLS natively
    if (video.canPlayType('application/vnd.apple.mpegurl')) {
      video.src = src;
      return;
    }
    // Everyone else: hls.js
    if (window.Hls && window.Hls.isSupported()) {
      const hls = new window.Hls({ enableWorker: true, lowLatencyMode: false });
      hls.loadSource(src);
      hls.attachMedia(video);
      return () => hls.destroy();
    }
    // Last resort: try direct (will likely fail)
    video.src = src;
  }, [src]);
  return (
    <video ref={ref} autoPlay loop muted playsInline
           className="w-full h-full object-cover" />
  );
}

function Background() {
  return (
    <>
      {/* Fullscreen background video */}
      <div className="fixed inset-0 pointer-events-none overflow-hidden" style={{ zIndex: 0 }}>
        <BackgroundVideo src="https://stream.mux.com/Si6ej2ZRrxRCnTYBXSScDRCdd7CGnyTqiPszZcw3z4I.m3u8" />
        
        {/* Dark veil + green tint for legibility */}
        <div className="absolute inset-0" style={{
          background: 'linear-gradient(180deg, rgba(6,18,10,0.55) 0%, rgba(6,18,10,0.75) 60%, rgba(6,18,10,0.92) 100%)'
        }} />
        <div className="absolute inset-0" style={{
          background: 'radial-gradient(80% 60% at 50% 30%, rgba(11,203,117,0.18), transparent 70%)',
          mixBlendMode: 'screen'
        }} />
      </div>
      {/* Animated radial blooms */}
      <div className="fixed inset-0 pointer-events-none" style={{ zIndex: 0 }}>
        <div className="absolute -top-40 -left-32 w-[700px] h-[700px] rounded-full opacity-40"
        style={{ background: 'radial-gradient(closest-side, rgba(59,255,157,0.25), transparent 70%)', filter: 'blur(40px)' }} />
        <div className="absolute top-1/3 -right-32 w-[600px] h-[600px] rounded-full opacity-30"
        style={{ background: 'radial-gradient(closest-side, rgba(11,203,117,0.30), transparent 70%)', filter: 'blur(40px)' }} />
        <div className="absolute bottom-0 left-1/3 w-[700px] h-[700px] rounded-full opacity-20"
        style={{ background: 'radial-gradient(closest-side, rgba(59,255,157,0.30), transparent 70%)', filter: 'blur(60px)' }} />
      </div>
      {/* Dot grid */}
      <div className="fixed inset-0 pointer-events-none" style={{
        backgroundImage: 'radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0)',
        backgroundSize: '22px 22px',
        maskImage: 'linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2) 60%, transparent)',
        WebkitMaskImage: 'linear-gradient(180deg, rgba(0,0,0,0.6), rgba(0,0,0,0.2) 60%, transparent)',
        zIndex: 1
      }} />
      {/* Vertical guide lines at the 36rem container edges */}
      <div className="hidden md:block pointer-events-none fixed inset-y-0 left-1/2 -translate-x-[calc(50%+36rem)] w-px bg-white/[0.04]" style={{ zIndex: 5 }} />
      <div className="hidden md:block pointer-events-none fixed inset-y-0 left-1/2 translate-x-[calc(-50%+36rem)] w-px bg-white/[0.04]" style={{ zIndex: 5 }} />
    </>);

}

// ───────── Root ─────────
function App() {
  const [scrolled, setScrolled] = useState(false);
  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 24);
    window.addEventListener('scroll', onScroll);
    return () => window.removeEventListener('scroll', onScroll);
  }, []);

  return (
    <div className="relative min-h-screen overflow-x-hidden bg-[#06120A] text-white">
      <Background />

      {/* Root noise filter for shiny headline */}
      <svg style={{ position: 'absolute', width: 0, height: 0 }} aria-hidden>
        <filter id="c3-noise">
          <feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch" />
          <feColorMatrix type="matrix" values="0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.35 0" />
          <feComposite in2="SourceGraphic" operator="in" result="noise" />
          <feBlend in="SourceGraphic" in2="noise" mode="multiply" />
        </filter>
      </svg>

      <Navbar scrolled={scrolled} />
      <Hero />
      <CheckoutMockup />
      <WhyKisti />
      <MerchantStrip />
      <WaitlistSection />
      <FinalCTA />
      <Footer />
    </div>);

}

ReactDOM.createRoot(document.getElementById('root')).render(<App />);