// sections.jsx — content sections for the Olvire site
// Exposes: Nav, Hero, Marquee, WhatYouGet, MobileTour, DashboardTour, Process, Pricing, FAQ, Contact, Footer

// (useState/useEffect/useRef already destructured in mockups.jsx)

// ──────────────────────────────────────────────────────────────
// Nav
// ──────────────────────────────────────────────────────────────
function Nav() {
  const [scrolled, setScrolled] = useState(false);
  useEffect(() => {
    const onScroll = () => setScrolled(window.scrollY > 24);
    window.addEventListener('scroll', onScroll);
    onScroll();
    return () => window.removeEventListener('scroll', onScroll);
  }, []);
  return (
    <nav className="nav" data-scrolled={scrolled}>
      <div className="container nav-inner">
        <div className="nav-left">
          <a href="#top" className="brand-mark">
            <span className="brand-wordmark">
              <span style={{color:'var(--olv-accent)'}}>o</span>lvire
            </span>
          </a>
        </div>
        <div className="nav-center nav-links">
          <a href="#what">What you get</a>
          <a href="#dashboard">Dashboard</a>
          <a href="#process">Process</a>
          <a href="#pricing">Pricing</a>
          <a href="#faq">FAQ</a>
        </div>
        <div className="nav-right">
          <a href="#contact" className="btn btn-primary">
            Apply now
            <LucideIcon name="arrow-right" size={14}/>
          </a>
        </div>
      </div>
    </nav>
  );
}

// ──────────────────────────────────────────────────────────────
// Hero
// ──────────────────────────────────────────────────────────────
function Hero({ heroVariant, accent, preview }) {
  return (
    <header className="hero" id="top">
      <div className="container hero-inner">
        <div>
          <h1 className="hero-title">
            Your regulars already love you.<br/>
            Now you can <span className="accent">actually keep them.</span>
          </h1>
          <p className="hero-sub">
            Most coffee shops have loyal customers but no way to reach them between visits.
            Your own Android and iOS app gives you their phone: push notifications, loyalty beans, one-tap reorder.
            They stay longer, come back more often, and bring friends. Payments go straight to your Stripe account. No per-order fees, no revenue cut.
          </p>
          <div className="hero-cta">
            <a href="#contact" className="btn btn-primary btn-lg pulse">
              Claim your spot
              <LucideIcon name="arrow-right" size={15}/>
            </a>
            <a href="#what" className="btn btn-ghost btn-lg">
              See what you get
            </a>
          </div>
        </div>

        <div className="stage">
          <HeroStage variant={heroVariant} preview={preview} />
        </div>
      </div>
    </header>
  );
}

// HeroStage shows the dashboard with phone floating in front
function HeroStage({ variant = "stack", preview = "abstract" }) {
  // variants: 'stack' (dashboard + phone overlapping), 'phone' (phone only, large), 'dash' (dashboard only)
  const Phone         = preview === "abstract" ? PhoneAbstract : PhoneMockup;
  const AndroidPhone  = preview === "abstract" ? PhoneAbstract : AndroidPhoneMockup;
  const Dash          = preview === "screenshot"
    ? () => (
        <div className="dash">
          <div className="dash-chrome">
            <span className="dot" style={{background:'#FF5F57'}}></span>
            <span className="dot" style={{background:'#FEBC2E'}}></span>
            <span className="dot" style={{background:'#28C840'}}></span>
            <div className="url">
              <LucideIcon name="lock" size={10} style={{color:'var(--jade)'}}/>
              yourshop.olvire.com/admin
            </div>
          </div>
          <img src="mockup-preview.png?v=5" alt="Menu dashboard" style={{width:'100%',display:'block',borderRadius:'0 0 13px 13px'}} />
        </div>
      )
    : preview === "abstract" ? DashboardAbstract : DashboardMockup;

  if (preview === "hidden") {
    return (
      <div style={{ position:'absolute', inset:0, display:'grid', placeItems:'center' }}>
        <div style={{
          position: 'relative',
          width: '100%',
          maxWidth: 520,
          aspectRatio: '1 / 1.1',
          border: '1px solid var(--line)',
          borderRadius: 28,
          background: 'var(--bg-1)',
          padding: 56,
          display: 'flex',
          flexDirection: 'column',
          justifyContent: 'space-between',
          overflow: 'hidden',
        }}>
          <div style={{ position:'absolute', inset:0,
            backgroundImage: `radial-gradient(circle at 30% 20%, var(--olv-accent-glow), transparent 60%)`,
            opacity: 0.45 }}></div>
          <div style={{ position: 'relative', zIndex: 1, fontFamily: 'var(--font-mono)', fontSize: 11,
                        letterSpacing: '0.16em', color: 'var(--fg-3)' }}>
            PRODUCT PREVIEW · BY APPOINTMENT
          </div>
          <div style={{ position: 'relative', zIndex: 1, fontFamily: 'var(--font-display)',
                        fontVariationSettings: '"wdth" 95, "opsz" 96', fontWeight: 700,
                        fontSize: 'clamp(140px, 14vw, 220px)', lineHeight: 0.85, letterSpacing: '-0.04em',
                        color: 'var(--olv-accent)' }}>
            O
          </div>
          <div style={{ position: 'relative', zIndex: 1 }}>
            <div style={{ fontFamily: 'var(--font-display)', fontWeight: 600, fontSize: 22,
                          lineHeight: 1.15, color: 'var(--fg-1)' }}>
              We'd rather show you a live build than a screenshot.
            </div>
            <div style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--fg-3)',
                          letterSpacing: '0.08em', marginTop: 14 }}>
              REQUEST A DEMO ↓
            </div>
          </div>
        </div>
      </div>
    );
  }

  if (variant === "phone") {
    return (
      <div style={{ position:'absolute', inset:0, display:'grid', placeItems:'center' }}>
        <div style={{ transform: 'scale(1.25)' }}>
          <Phone />
        </div>
      </div>
    );
  }
  if (variant === "dash") {
    return (
      <div style={{ position:'absolute', inset:0, display:'grid', placeItems:'center' }}>
        {/* Warm ambient glow behind the dashboard */}
        <div style={{
          position:'absolute', width:'90%', height:'70%',
          background:'radial-gradient(ellipse at 50% 40%, rgba(194,105,19,0.18) 0%, transparent 68%)',
          filter:'blur(48px)', zIndex:0, pointerEvents:'none',
        }}/>
        <div style={{
          width:'100%', position:'relative', zIndex:1,
          transform: 'perspective(1600px) rotateY(-6deg) rotateX(3deg)',
          transformOrigin: 'center top',
          filter: 'drop-shadow(0 28px 56px rgba(0,0,0,0.42))',
        }}>
          <Dash />
        </div>
      </div>
    );
  }
  // default: stack — dashboard fills top, phones rise from bottom corners as proof
  return (
    <div style={{ position:'absolute', inset:0, overflow:'visible' }}>
      {/* Warm ambient glow behind dashboard */}
      <div style={{
        position:'absolute', left:'10%', top:'5%', width:'80%', height:'55%',
        background:'radial-gradient(ellipse, rgba(194,105,19,0.14) 0%, transparent 70%)',
        filter:'blur(40px)', zIndex:0, pointerEvents:'none',
      }}/>
      {/* Dashboard — full width, top-anchored, slight 3D recede */}
      <div className="stage-dash-wrap" style={{
        position:'absolute',
        left: '50%',
        top: 0,
        width: '100%',
        transform: 'translateX(-50%)',
        transformOrigin: 'center top',
        filter: 'drop-shadow(0 24px 52px rgba(0,0,0,0.45)) brightness(1.06)',
        zIndex: 1,
      }}>
        <Dash />
      </div>
      {/* iPhone — bottom-left corner, small so dashboard stays dominant */}
      <div className="stage-phone-left" style={{
        position:'absolute',
        left: '2%',
        bottom: -60,
        zIndex: 3,
        transform: 'rotate(-5deg) scale(0.64)',
        transformOrigin: 'bottom center',
        filter: 'drop-shadow(0 20px 40px rgba(0,0,0,0.55))',
      }}>
        <Phone />
      </div>
      {/* Android — bottom-right corner, mirrored */}
      <div className="stage-phone-right" style={{
        position:'absolute',
        right: '4%',
        bottom: -40,
        zIndex: 3,
        transform: 'rotate(4deg) scale(0.64)',
        transformOrigin: 'bottom center',
        filter: 'drop-shadow(0 20px 40px rgba(0,0,0,0.55))',
      }}>
        <AndroidPhone />
      </div>
    </div>
  );
}


// ──────────────────────────────────────────────────────────────
// What You Get — two columns side by side
// ──────────────────────────────────────────────────────────────
function WhatYouGet() {
  return (
    <section className="section" id="what">
      <div className="container">
        <div style={{ maxWidth: 720 }}>
          <div className="section-eyebrow">WHAT YOU GET</div>
          <h2 className="section-title">The digital relationship your regulars want. <span className="accent">The tools your team</span> needs.</h2>
          <p className="section-sub">
            Two things that work together: an app your customers download and keep on their phone,
            and a dashboard your whole team runs the floor from. Both carry your brand.
            Both work from day one. Built, launched, and looked after end to end.
          </p>
        </div>

        <div className="split-2">
          {/* Customer app card */}
          <div className="product-card">
            <span className="tag">CUSTOMER · ANDROID + iOS</span>
            <h3>Your app, on Android and iOS</h3>
            <p className="lede">
              A real app your customers download and keep on their phone. Not a punch card, not a website link, not a generic loyalty tab inside Square. Your name, your colors, your menu.
            </p>
            <ul className="feature-list">
              <li><span className="ic"><LucideIcon name="coffee" size={16}/></span>
                <div>Full menu with customisations
                  <span className="desc">Milks, shots, syrups, sizes. Customers build their order exactly how they like it.</span>
                </div>
              </li>
              <li><span className="ic"><LucideIcon name="car" size={16}/></span>
                <div>Order ahead · drive through lane or counter pickup
                  <span className="desc">Customers choose how they're collecting. Their order is ready when they arrive.</span>
                </div>
              </li>
              <li><span className="ic"><LucideIcon name="credit-card" size={16}/></span>
                <div>Pay in the app · cards, Google Pay, Apple Pay
                  <span className="desc">Checkout takes seconds. Payment goes straight to your bank. No middleman, no cut.</span>
                </div>
              </li>
              <li><span className="ic"><LucideIcon name="star" size={16}/></span>
                <div>Loyalty beans, referrals &amp; favorites
                  <span className="desc">Beans on every order, redeemable for free items you configure. Regulars refer friends and both get rewarded.</span>
                </div>
              </li>
              <li><span className="ic"><LucideIcon name="bell" size={16}/></span>
                <div>Order tracking &amp; one-tap reorder
                  <span className="desc">Customers watch their order move from new to ready. Their usual is one tap away next time.</span>
                </div>
              </li>
            </ul>
          </div>

          {/* Dashboard card */}
          <div className="product-card">
            <span className="tag">YOUR TEAM · WEB DASHBOARD</span>
            <h3>One dashboard, two views</h3>
            <p className="lede">
              Baristas get a live order board. Orders appear the moment a customer places them and move through stages as they're made. You get everything else: menu, deals, analytics, customers. All in one place.
            </p>
            <ul className="feature-list">
              <li>
                <div style={{ fontSize: 10, fontFamily: 'var(--font-mono)', letterSpacing: '0.12em', color: 'var(--olv-accent)', paddingBottom: 4 }}>FOR BARISTAS</div>
              </li>
              <li><span className="ic"><LucideIcon name="layout-grid" size={16}/></span>
                <div>Live order board · New · Making · Ready
                  <span className="desc">Orders land instantly. Baristas work from any browser: tablet, laptop, or a screen behind the counter.</span>
                </div>
              </li>
              <li>
                <div style={{ fontSize: 10, fontFamily: 'var(--font-mono)', letterSpacing: '0.12em', color: 'var(--olv-accent)', paddingBottom: 4, paddingTop: 8 }}>FOR OWNERS</div>
              </li>
              <li><span className="ic"><LucideIcon name="utensils" size={16}/></span>
                <div>Menu, modifiers &amp; availability
                  <span className="desc">Pause an item in one tap when you run out of oat milk at 8:14am.</span>
                </div>
              </li>
              <li><span className="ic"><LucideIcon name="tag" size={16}/></span>
                <div>Deals, promo codes &amp; broadcast notifications
                  <span className="desc">Happy hour discounts, item deals, flash promo codes. Push to every customer's phone in one tap.</span>
                </div>
              </li>
              <li><span className="ic"><LucideIcon name="bar-chart-3" size={16}/></span>
                <div>Orders, refunds &amp; analytics
                  <span className="desc">Full order history with search, filters, CSV export. Refunds in two taps.</span>
                </div>
              </li>
              <li><span className="ic"><LucideIcon name="users" size={16}/></span>
                <div>Customer lookup, team roles &amp; permissions
                  <span className="desc">Search any customer, adjust loyalty beans, view their order history. Owner, admin and barista roles: invite, scope, remove.</span>
                </div>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </section>
  );
}

// ──────────────────────────────────────────────────────────────
// Mobile Tour — phone with steppable feature list
// ──────────────────────────────────────────────────────────────
const MOBILE_STEPS = [
  { title: "A direct line between visits", body: "Push notifications, loyalty progress, referral bonuses and drop announcements. Your customers see your brand outside the shop, not just at the counter." },
  { title: "One-tap reorder, surfaced on launch", body: "The home screen leads with the customer's last order and quick favorites. Most repeat orders close in under 15 seconds." },
  { title: "Loyalty without the punch card", body: "Customers earn beans on every order. When a reward unlocks they tap to apply it at checkout — the item comes through free in their cart. No punch card, no separate app, no third-party platform." },
  { title: "Drive through or counter, their choice", body: "Customers pick how they're collecting at checkout. Live tracking shows them their order status and the barista sees exactly where to direct the handoff." },
];

// Map each tour step index to a phone screen name
// notif → account (beans + referral + notif toggle), reorder → menucat, loyalty → rewards, tracking → tracking
const STEP_SCREENS = ['account', 'menucat', 'rewards', 'tracking'];

function MobileTour({ preview = "abstract" }) {
  const [active, setActive] = useState(0);
  const Phone = preview === "abstract" ? PhoneAbstract : PhoneMockup;
  return (
    <section className="section" id="mobile" style={{ background: 'var(--bg-1)', borderTop: '1px solid var(--line)', borderBottom: '1px solid var(--line)' }}>
      <div className="container">
        <div style={{ maxWidth: 720 }}>
          <div className="section-eyebrow">FOR YOUR CUSTOMERS</div>
          <h2 className="section-title">Their next order, opened in <span className="accent">15 seconds.</span></h2>
          <p className="section-sub">
            Between visits, the app keeps your brand on their screen. Push notifications, loyalty rewards and referrals that turn regulars into recruiters.
          </p>
        </div>

        <div className="tour" style={preview === "hidden" ? { gridTemplateColumns: '1fr' } : null}>
          <div className="tour-list">
            {MOBILE_STEPS.map((s, i) => (
              <div className="tour-item" key={i}
                   data-active={i === active}
                   onClick={() => setActive(i)}>
                <div className="n">{String(i+1).padStart(2, '0')}</div>
                <div>
                  <h4>{s.title}</h4>
                  <p>{s.body}</p>
                </div>
              </div>
            ))}
          </div>
          {preview !== "hidden" && (
            <div style={{ display: 'grid', placeItems: 'center' }}>
              <Phone screen="menucat" />
            </div>
          )}
        </div>
        <div style={{ marginTop: 48 }}>
          <a href="#contact" className="btn btn-primary btn-lg">
            Get your app built
            <LucideIcon name="arrow-right" size={15}/>
          </a>
        </div>
      </div>
    </section>
  );
}

// ──────────────────────────────────────────────────────────────
// Dashboard Tour — large dashboard with tabs
// ──────────────────────────────────────────────────────────────
function DashboardTour({ preview = "abstract" }) {
  const [tab, setTab] = useState("queue");
  return (
    <section className="section" id="dashboard">
      <div className="container">
        <div style={{ maxWidth: 720 }}>
          <div className="section-eyebrow">FOR YOUR TEAM</div>
          <h2 className="section-title">A live order board for your baristas. <span className="accent">Full controls</span> for you.</h2>
          <p className="section-sub">
            Your baristas see every order the moment it's placed and work through them in sequence.
            You manage the menu, run deals, check revenue and issue refunds from anywhere, on any device.
            Same dashboard, different view depending on who's logged in.
          </p>
        </div>

        {preview === "detailed" && (
          <div style={{ display: 'flex', gap: 8, marginTop: 32 }}>
            {[
              { id: "queue", label: "Live queue", icon: "activity" },
              { id: "menu", label: "Menu", icon: "coffee" },
              { id: "analytics", label: "Analytics", icon: "bar-chart-3" },
            ].map(t => (
              <button key={t.id}
                      className={`btn ${tab === t.id ? 'btn-primary' : 'btn-ghost'}`}
                      style={{ padding: '10px 16px', fontSize: 13 }}
                      onClick={() => setTab(t.id)}>
                <LucideIcon name={t.icon} size={14}/>
                {t.label}
              </button>
            ))}
          </div>
        )}

        {preview !== "hidden" && (
          <div style={{ marginTop: 24 }}>
            {preview === "abstract"    ? <DashboardAbstract /> :
             preview === "screenshot"  ? (
               <div className="dash">
                 <div className="dash-chrome">
                   <span className="dot" style={{background:'#FF5F57'}}></span>
                   <span className="dot" style={{background:'#FEBC2E'}}></span>
                   <span className="dot" style={{background:'#28C840'}}></span>
                   <div className="url">
                     <LucideIcon name="lock" size={10} style={{color:'var(--jade)'}}/>
                     yourshop.olvire.com/admin
                   </div>
                 </div>
                 <img src="kds-preview.png?v=3" alt="Live order board" style={{width:'100%',display:'block',borderRadius:'0 0 13px 13px'}} />
               </div>
             ) : <DashboardMockup tab={tab} />}
          </div>
        )}

        <div className="dashboard-bullets" style={{ marginTop: 56, display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 24 }}>
          {[
            { t: "Run a flash deal in under a minute", b: "Type a message, pick a discount, hit send. Every customer gets a push notification. Works for seasonal drops, early-close notices, or just a quiet Tuesday that needs a lift." },
            { t: "Your regulars look after themselves", b: "Loyalty beans, referral bonuses and free item rewards run in the background. Customers come back because the app keeps nudging them. You don't have to." },
            { t: "Run the shop from your phone", b: "Pause a menu item, check today's revenue, issue a refund or see who's waiting. Do it from wherever you are. You don't need to be behind the counter to stay in control." },
          ].map((c, i) => (
            <div key={i} style={{ borderTop: '1px solid var(--line)', paddingTop: 18 }}>
              <div style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--olv-accent)', letterSpacing: '0.06em' }}>{String(i+1).padStart(2,'0')}</div>
              <div style={{ fontSize: 17, fontWeight: 600, marginTop: 8 }}>{c.t}</div>
              <div style={{ fontSize: 14, color: 'var(--fg-2)', marginTop: 8, lineHeight: 1.5 }}>{c.b}</div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ──────────────────────────────────────────────────────────────
// Process — 4 steps
// ──────────────────────────────────────────────────────────────
function Process() {
  const steps = [
    { n: "01", phase: "PHASE 1", title: "Discovery & brand kit", body: "Your menu, modifiers, brand assets, and payments are sorted. You get a working preview before anything is built.", checklist: ["Menu walkthrough", "Brand assets", "Stripe onboarding", "Working preview"] },
    { n: "02", phase: "PHASE 2", title: "Custom build", body: "Your Android and iOS apps are built, the dashboard is configured, and payments go straight to your Stripe account.", checklist: ["Android app", "iOS app", "Dashboard configured", "Payments connected"] },
    { n: "03", phase: "PHASE 3", title: "Soft launch", body: "Your team gets early access. A small group of your regulars pilots the app. Any tweaks are made before going wide.", checklist: ["Early team access", "Pilot with regulars", "Live monitoring", "Any tweaks needed"] },
    { n: "04", phase: "PHASE 4", title: "Launch & ongoing", body: "You go live. Hosting, updates, and fixes are handled from here. You get a direct line to me, not a support ticket.", checklist: ["Public launch", "Ongoing updates & fixes", "Hosting & uptime", "Direct line to me"] },
  ];
  return (
    <section className="section" id="process">
      <div className="container">
        <div style={{ maxWidth: 720 }}>
          <div className="section-eyebrow">HOW IT GETS BUILT</div>
          <h2 className="section-title">Four phases. <span className="accent">One launch.</span> Ongoing support.</h2>
          <p className="section-sub">
            From discovery to public launch and beyond, handled end to end.
            No unfinished handoffs, no scattered freelancers, no template
            you have to configure yourself.
          </p>
        </div>
        <div className="process">
          {steps.map(s => (
            <div className="process-step" key={s.n}>
              <span className="n">{s.phase}</span>
              <h4>{s.title}</h4>
              <p>{s.body}</p>
              <ul>
                {s.checklist.map((c, i) => <li key={i}>{c}</li>)}
              </ul>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ──────────────────────────────────────────────────────────────
// Pricing — single founding-rate card
// ──────────────────────────────────────────────────────────────
function Pricing() {
  const features = [
    { h: "The customer app", items: ["Your own Android and iOS apps. Feels like it belongs on their phone, not a website in disguise", "Full menu with customisations, cart, checkout, loyalty, referrals, favourites", "Order ahead: drive through lane or counter pickup, live order tracking", "Pay in the app: cards, Google Pay, Apple Pay", "Push notifications: order updates, promos, announcements"] },
    { h: "The admin dashboard", items: ["Live order board for baristas: New · Making · Ready", "Menu, modifier and availability management. Pause any item instantly", "Deals, promo codes and broadcast notifications in one tap", "Loyalty rules, referral bonuses and welcome rewards", "Customer lookup: search, view order history, adjust loyalty beans", "Full order history, refunds and CSV export", "Three roles: owner, admin, barista. Each sees only what they need"] },
    { h: "What's included in the monthly", items: ["Hosting and uptime. Always on, looked after by me", "App and dashboard updates as the product improves", "Direct support line. Not a ticketing system, not offshore", "No per-order fee. No revenue cut. Ever."] },
  ];

  return (
    <section className="section" id="pricing">
      <div className="container">
        <div style={{ maxWidth: 720 }}>
          <div className="section-eyebrow">SUMMER LAUNCH · 3 SPOTS</div>
          <h2 className="section-title">One price. <span className="accent">Everything</span> included.</h2>
          <p className="section-sub">
            We're building with three shops this summer. The first three get the launch rate: $1,997 setup instead of $3,997, and $199 a month that locks in and never goes up.
            When these spots fill, the launch rate is gone.
          </p>
        </div>

        <div className="founding-card">
          <div className="founding-header">
            <div>
              <span className="founding-tag">SUMMER LAUNCH · 3 SPOTS</span>
              <div className="founding-name">Your own branded app, configured for your shop</div>
              <div className="founding-desc">
                One price covers the design, the Android and iOS apps, the dashboard,
                payment setup, the launch, and everything after.
              </div>
            </div>
            <div className="founding-price-block">
              <div className="founding-setup">
                <div className="setup-label">ONE-TIME SETUP</div>
                <div className="setup-prices">
                  <span className="setup-was">$3,997</span>
                  <span className="setup-now">$1,997</span>
                </div>
                <div className="setup-meta">Launch rate · 3 spots remaining</div>
              </div>
              <div className="founding-divider"></div>
              <div className="founding-monthly">
                <div className="setup-label">THEN MONTHLY</div>
                <div className="monthly-amount">
                  <span className="amount">$199</span>
                  <span className="unit">/ month</span>
                </div>
                <div className="setup-meta">Hosting, updates, support. Locks in forever</div>
              </div>
            </div>
          </div>

          <div className="founding-features">
            {features.map((g, i) => (
              <div key={i} className="founding-group">
                <div className="founding-group-h">{g.h}</div>
                <ul>
                  {g.items.map((it, j) => (
                    <li key={j}>
                      <LucideIcon name="check" size={14}/>
                      <span>{it}</span>
                    </li>
                  ))}
                </ul>
              </div>
            ))}
          </div>

          <div className="founding-foot">
            <div className="founding-foot-left">
              <div className="cohort-slots">
                <span className="slot"></span>
                <span className="slot"></span>
                <span className="slot"></span>
              </div>
              <span className="cohort-meta" style={{color:'var(--fg-2)'}}>Summer launch · 3 spots · by application only</span>
            </div>
            <a href="#contact" className="btn btn-primary btn-lg">
              Reserve my spot
              <LucideIcon name="arrow-right" size={15}/>
            </a>
          </div>
        </div>

        <div className="pricing-fineprint">
          Stripe charges its standard processing fees (2.9% + 30¢ US, lower in the EU/UK) directly on top. Those go to Stripe. No cut of your revenue, ever.
        </div>
      </div>
    </section>
  );
}

// ──────────────────────────────────────────────────────────────
// FAQ
// ──────────────────────────────────────────────────────────────
function FAQ() {
  const [open, setOpen] = useState(0);
  const items = [
    { q: "Who owns the app, the data, and the Stripe account?", a: "You own your customer data, your Stripe account, and the branded customer-facing app. It's your shop's brand. The Olvire platform itself (the dashboard, the backend) stays under my maintenance as part of your monthly. If you ever stop the engagement, you keep your customers, your Stripe revenue, and your brand. Nothing of yours leaves with me." },
    { q: "Can I fully customize the brand, or is it a template?", a: "Everything is built around your shop. I start from your menu, your colours, your brand assets and the way your floor actually runs. The loyalty structure, the modifier names, the deal types, the reward thresholds are all configured to how you operate. Two shops built on Olvire won't look or feel alike." },
    { q: "How does payment flow work? Do you take a cut?", a: "Stripe processes payments directly into your Stripe account. I never touch funds and I never take a cut of your revenue. Stripe charges its standard processing fees (2.9% + 30¢ in the US, lower in the EU/UK). Those are Stripe's, not mine." },
    { q: "Will it be reliable? What happens if something goes wrong?", a: "Orders land on your board in real time. There's no meaningful delay between a customer placing an order and it appearing in front of your baristas. The infrastructure runs on Google's cloud, so uptime is solid. If something does break, you message me directly on Slack and I fix it. There's no support ticket queue, no call centre. It's just me, and I'm accountable." },
    { q: "How does loyalty actually work?", a: "Customers earn beans on every order at a rate you set. Rewards are specific items you configure: a free latte, a free pastry, whatever you like. When a customer hits the bean threshold, the reward unlocks on their Rewards screen. They tap to apply it at checkout and the item comes through free in their cart. They place the order exactly as normal. No punch cards, no separate app, no separate login." },
    { q: "Does this replace my POS or Square?", a: "No, and it's not meant to. Your POS handles in-person transactions. The app handles mobile orders and the customer relationship between visits. They run side by side. If you're on Square, Toast, or anything else, keep it. Nothing changes at the counter." },
    { q: "Who runs support after launch?", a: "I do, personally. You get a private Slack channel with me, ongoing, with coverage across core US business hours (9am to 6pm ET), so timezones aren't a friction even though I'm based in London. Customer-facing support (refunds, missing orders) is handled by your team via the dashboard." },
  ];
  return (
    <section className="section" id="faq">
      <div className="container">
        <div className="faq-grid" style={{ display: 'grid', gridTemplateColumns: '1fr 2fr', gap: 64, alignItems: 'start' }}>
          <div>
            <div className="section-eyebrow">FAQ</div>
            <h2 className="section-title" style={{ fontSize: 'clamp(36px, 3.6vw, 52px)' }}>Questions, answered straight.</h2>
            <p className="section-sub">Couldn't find what you need? Drop me a line. I reply within a day.</p>
          </div>
          <div className="faq" style={{ marginTop: 0 }}>
            {items.map((it, i) => (
              <div className="faq-item" key={i} data-open={open === i}>
                <button className="faq-q" onClick={() => setOpen(open === i ? -1 : i)}>
                  {it.q}
                  <span className="plus">+</span>
                </button>
                <div className="faq-a">{it.a}</div>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

// ──────────────────────────────────────────────────────────────
// Contact
// ──────────────────────────────────────────────────────────────
function Contact() {
  const [submitted, setSubmitted] = useState(false);
  const [submitting, setSubmitting] = useState(false);
  const [error, setError] = useState(null);

  const handleSubmit = async (e) => {
    e.preventDefault();
    if (submitting) return;
    setSubmitting(true);
    setError(null);
    const data = new FormData(e.target);
    try {
      const res = await fetch("https://formspree.io/f/mvzyzrly", {
        method: "POST",
        body: data,
        headers: { Accept: "application/json" },
      });
      if (res.ok) {
        setSubmitted(true);
        e.target.reset();
      } else {
        const body = await res.json().catch(() => ({}));
        setError(body?.errors?.[0]?.message || "Something went wrong. Please email haseeb@olvire.com directly.");
      }
    } catch (err) {
      setError("Network error. Please email haseeb@olvire.com directly.");
    } finally {
      setSubmitting(false);
    }
  };

  return (
    <section className="section" id="contact" style={{ paddingTop: 60 }}>
      <div className="container">
        <div className="contact">
          <div className="contact-info">
            <div className="section-eyebrow">3 SPOTS REMAINING</div>
            <h3>Tell me about your shop.</h3>
            <p>
              30 minutes on a call, with me, personally. I'll show you a live
              build, walk you through the dashboard, and answer everything.
              You'll know exactly what you're getting before you commit to anything.
            </p>
            <div className="talk-to">
              <div style={{ fontSize: 11, letterSpacing: '0.18em', textTransform: 'uppercase', color: 'var(--fg-3)', marginBottom: 12 }}>You'll talk to</div>
              <div className="who">
                <img src="assets/founder.png" alt="Muhammad Haseeb" className="avatar" style={{objectFit:'cover'}} />
                <div>
                  <div className="name">Muhammad Haseeb</div>
                  <div className="role">FOUNDER · OLVIRE</div>
                </div>
              </div>
              <div style={{ marginTop: 24, display: 'grid', gap: 10, fontSize: 13, color: 'var(--fg-2)' }}>
                <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
                  <LucideIcon name="mail" size={14} style={{ color: 'var(--olv-accent)' }}/>
                  haseeb@olvire.com
                </div>
                <div style={{ display: 'flex', alignItems: 'flex-start', gap: 10 }}>
                  <LucideIcon name="map-pin" size={14} style={{ color: 'var(--olv-accent)', marginTop: 2 }}/>
                  <span>128 City Road · London EC1V 2NX<br/>United Kingdom</span>
                </div>
              </div>
            </div>
          </div>

          {submitted ? (
            <div style={{ background: 'var(--bg-2)', borderRadius: 14, padding: 32, display: 'grid', placeItems: 'center', minHeight: 320 }}>
              <div style={{ textAlign: 'center', maxWidth: 320 }}>
                <div style={{ width: 56, height: 56, margin: '0 auto 18px', borderRadius: 999, background: 'var(--jade)', display: 'grid', placeItems: 'center', color: '#fff' }}>
                  <LucideIcon name="check" size={24}/>
                </div>
                <div style={{ fontSize: 20, fontWeight: 600, marginBottom: 8, fontFamily: 'var(--font-display)' }}>Application received.</div>
                <div style={{ color: 'var(--fg-2)', fontSize: 14, lineHeight: 1.5 }}>
                  I'll review it personally and get back to you within 24 hours to schedule a call.
                </div>
              </div>
            </div>
          ) : (
            <form className="contact-form" onSubmit={handleSubmit}>
              <input type="text" name="_gotcha" tabIndex="-1" autoComplete="off" style={{ position: 'absolute', left: '-9999px', width: 1, height: 1, opacity: 0 }} aria-hidden="true" />
              <input type="hidden" name="_subject" value="New Olvire application" />
              <div className="field-row">
                <div className="field">
                  <label>Your name</label>
                  <input type="text" name="Full name" placeholder="Alex Karra" required />
                </div>
                <div className="field">
                  <label>Shop name</label>
                  <input type="text" name="Shop name" placeholder="Your coffee shop" required />
                </div>
              </div>
              <div className="field">
                <label>Email</label>
                <input type="email" name="email" placeholder="alex@yourshop.com" required />
              </div>
              <div className="field">
                <label>Where are you?</label>
                <input type="text" name="Location" placeholder="City, country" />
              </div>
              <div className="field">
                <label>Anything specific?</label>
                <textarea name="Notes" rows="3" placeholder="What pulled you toward a custom app? Anything we should know going in?"></textarea>
              </div>
              {error && (
                <div style={{ fontSize: 13, color: '#c0392b', textAlign: 'center', marginTop: 6 }}>{error}</div>
              )}
              <button type="submit" disabled={submitting} className="btn btn-primary btn-lg" style={{ marginTop: 6, justifyContent: 'center', opacity: submitting ? 0.7 : 1, cursor: submitting ? 'wait' : 'pointer' }}>
                {submitting ? 'Sending…' : 'Send my application'}
                {!submitting && <LucideIcon name="arrow-right" size={15}/>}
              </button>
              <div style={{ fontSize: 11, color: 'var(--fg-3)', textAlign: 'center', marginTop: 4 }}>
                Application-based. I review every one personally.
              </div>
            </form>
          )}
        </div>
      </div>
    </section>
  );
}

// ──────────────────────────────────────────────────────────────
// Footer
// ──────────────────────────────────────────────────────────────
function Footer() {
  return (
    <footer className="footer">
      <div className="container">
        <div className="footer-grid">
          <div>
            <a href="#top" className="brand-mark" style={{ marginBottom: 18 }}>
              <span className="brand-wordmark">
                <span style={{color:'var(--olv-accent)'}}>o</span>lvire
              </span>
            </a>
            <p style={{ color: 'var(--fg-2)', fontSize: 14, lineHeight: 1.55, maxWidth: 320, marginTop: 16 }}>
              More return visits, more loyal regulars. No platform fees, no middleman.
            </p>
            <div style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--fg-3)', marginTop: 24, letterSpacing: '0.04em' }}>
              OLVIRE LTD · COMPANY №16749191<br/>
              128 CITY ROAD · LONDON EC1V 2NX
            </div>
          </div>
          <div>
            <h5>Product</h5>
            <ul>
              <li><a href="#what">The mobile app</a></li>
              <li><a href="#dashboard">The dashboard</a></li>
              <li><a href="#pricing">Pricing</a></li>
            </ul>
          </div>
          <div>
            <h5>Company</h5>
            <ul>
              <li><a href="#process">How we work</a></li>
              <li><a href="#faq">FAQ</a></li>
              <li><a href="#contact">Contact</a></li>
            </ul>
          </div>
          <div>
            <h5>Legal</h5>
            <ul>
              <li><a href="/privacy">Privacy Policy</a></li>
              <li><a href="/terms">Terms of Service</a></li>
            </ul>
          </div>
        </div>
        <div className="footer-bottom">
          <span>© 2026 OLVIRE LTD · ALL RIGHTS RESERVED</span>
          <span>BUILT IN LONDON</span>
        </div>
      </div>
    </footer>
  );
}


Object.assign(window, { Nav, Hero, WhatYouGet, MobileTour, DashboardTour, Process, Pricing, FAQ, Contact, Footer });
