/* global Icon */
// Features page — deep dive on every capability. Anchored long-scroll.
const { useState: useStateFT, useEffect: useEffectFT } = React;

const FT_GROUPS = [
  {
    id: 'service',
    label: 'Run service',
    color: 'var(--accent)',
    features: [
      { id:'register',    name:'Register (POS)',        desc:'Adaptive density, shift mode, splits & comps.' },
      { id:'kds',         name:'Kitchen display',       desc:'Tickets, wait timers, station routing.' },
      { id:'shiftmode',   name:'Shift mode',            desc:'PIN-locked full-screen POS for the floor.' },
      { id:'orders',      name:'Orders',                desc:'Table service, takeaway, delivery in one view.' },
    ],
  },
  {
    id: 'menu',
    label: 'Menu & inventory',
    color: 'var(--accent-3)',
    features: [
      { id:'menustudio', name:'Menu Studio',    desc:'AI import, photo generation, atomic publish.' },
      { id:'inventory',  name:'Inventory',      desc:'Ingredients, recipes, auto-decrement, par levels.' },
      { id:'discounts',  name:'Discounts',      desc:'Happy hour, staff meals, coupons, combos.' },
    ],
  },
  {
    id: 'reach',
    label: 'Reach guests',
    color: 'var(--accent-2)',
    features: [
      { id:'website',    name:'Website builder',  desc:'Puck-based visual editor, AI remix, fast CDN.' },
      { id:'qr',         name:'QR table ordering', desc:'Guest to paid in 10 seconds.' },
      { id:'directory',  name:'Public directory',  desc:'SEO listing, network link juice.' },
      { id:'events',     name:'Events studio',     desc:'Ticketed events, private dining, deposits.' },
    ],
  },
  {
    id: 'guests',
    label: 'Guest flow',
    color: 'var(--accent-2)',
    features: [
      { id:'reservations', name:'Reservations', desc:'Day view, SMS reminders, table auto-assign.' },
      { id:'tables',       name:'Tables & QR',  desc:'Floor plan, QR codes per table.' },
      { id:'guestorder',   name:'Guest order',  desc:'Self-serve ordering on the guest device.' },
    ],
  },
  {
    id: 'team',
    label: 'Manage the team',
    color: 'var(--accent)',
    features: [
      { id:'team',          name:'Schedule & roles',  desc:'Drag-to-copy, recurring shifts, roles & pay.' },
      { id:'timesheets',    name:'Timesheets',        desc:'Clock in, breaks, overtime, approvals.' },
      { id:'employeeapp',   name:'Employee app',      desc:'Onboarding, shifts, requests, earnings.' },
      { id:'availability',  name:'Availability',      desc:'Staff submit, managers approve with a note.' },
    ],
  },
  {
    id: 'business',
    label: 'Run the business',
    color: 'var(--accent-3)',
    features: [
      { id:'analytics',  name:'Analytics',    desc:'Revenue, covers, labor %, turn time.' },
      { id:'feedback',   name:'Guest feedback', desc:'Emoji capture, tag sentiment, movers.' },
      { id:'payments',   name:'Payments',     desc:'Stripe, SumUp, Viva, Adyen — your choice.' },
      { id:'dashboard',  name:'Dashboard',    desc:'Morning numbers in one glance.' },
      { id:'settings',   name:'Settings & permissions', desc:'Roles, audit log, device management.' },
    ],
  },
];

const FTEyebrow = ({ children, color = 'var(--accent)' }) => (
  <div style={{ fontSize:11.5, letterSpacing:'.12em', textTransform:'uppercase', color, fontWeight:600, display:'inline-flex', alignItems:'center', gap:8 }}>
    <span style={{ width:18, height:1, background:color, display:'inline-block' }}/> {children}
  </div>
);

// Sidebar TOC
const FTSidebar = ({ active, onJump }) => (
  <aside className="ft-sidebar" style={{ position:'sticky', top:96, alignSelf:'start', display:'grid', gap:28, paddingRight:12 }}>
    {FT_GROUPS.map(g => (
      <div key={g.id}>
        <div style={{ fontSize:10.5, letterSpacing:'.12em', textTransform:'uppercase', color:'var(--muted)', fontWeight:700, marginBottom:10 }}>{g.label}</div>
        <div style={{ display:'grid', gap:4 }}>
          {g.features.map(f => (
            <a key={f.id} onClick={() => onJump(f.id)}
              style={{
                cursor:'pointer',
                padding:'6px 10px',
                borderRadius:6,
                fontSize:13.5,
                color: active===f.id ? 'var(--ink)' : 'var(--ink-2)',
                fontWeight: active===f.id ? 600 : 400,
                background: active===f.id ? 'var(--paper-2)' : 'transparent',
                borderLeft: active===f.id ? `2px solid ${g.color}` : '2px solid transparent',
                transition:'all .14s',
              }}>
              {f.name}
            </a>
          ))}
        </div>
      </div>
    ))}
  </aside>
);

// ──────────────────────────────────────────────────────────────
// Individual feature sections
// ──────────────────────────────────────────────────────────────

const FSection = ({ id, eyebrow, color, title, lede, bullets, mockup, reverse }) => (
  <section id={id} className="ft-section" style={{ padding:'72px 0', borderTop:'1px solid var(--line)' }}>
    <div style={{ display:'grid', gridTemplateColumns: reverse ? '1fr 1.2fr' : '1.2fr 1fr', gap:48, alignItems:'center' }}>
      <div style={{ order: reverse ? 2 : 1 }}>
        <FTEyebrow color={color}>{eyebrow}</FTEyebrow>
        <h2 className="serif" style={{ fontSize:'clamp(32px, 3.5vw, 46px)', margin:'14px 0 14px', fontWeight:400, letterSpacing:'-0.022em', lineHeight:1.05 }}>
          {title}
        </h2>
        <p style={{ fontSize:16, color:'var(--ink-2)', lineHeight:1.6 }}>{lede}</p>
        {bullets && (
          <ul style={{ marginTop:20, padding:0, listStyle:'none', display:'grid', gap:10 }}>
            {bullets.map((b,i) => (
              <li key={i} style={{ display:'flex', gap:10, alignItems:'flex-start', fontSize:14.5, color:'var(--ink-2)' }}>
                <span style={{ width:18, height:18, borderRadius:999, background:`color-mix(in oklch, ${color}, white 88%)`, color, display:'grid', placeItems:'center', flexShrink:0, marginTop:2 }}>
                  <Icon name="check" size={10}/>
                </span>
                {b}
              </li>
            ))}
          </ul>
        )}
      </div>
      <div style={{ order: reverse ? 1 : 2 }}>{mockup}</div>
    </div>
  </section>
);

// Mockups (reused & themed per feature)
const MockRegister = () => (
  <div className="card-paper" style={{ padding:0, border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', overflow:'hidden', boxShadow:'var(--shadow-md)' }}>
    <div style={{ padding:'14px 18px', borderBottom:'1px solid var(--line)', display:'flex', alignItems:'center', justifyContent:'space-between', fontSize:12 }}>
      <span style={{ color:'var(--muted)', fontFamily:'JetBrains Mono' }}>TABLE 4 · NORA · 22m</span>
      <span style={{ padding:'2px 8px', background:'var(--accent-wash)', color:'var(--accent-ink)', borderRadius:99, fontSize:10.5, fontWeight:600 }}>ACTIVE</span>
    </div>
    <div style={{ display:'grid', gridTemplateColumns:'1fr 1.1fr' }}>
      <div style={{ padding:14, borderRight:'1px solid var(--line)' }}>
        <div style={{ display:'flex', gap:4, marginBottom:10, overflow:'hidden' }}>
          {['All','Coffee','Brunch','Pastry','Cocktails'].map((c,i) => (
            <span key={c} style={{ padding:'4px 9px', borderRadius:6, background: i===0?'var(--accent-wash)':'var(--paper-2)', color: i===0?'var(--accent-ink)':'var(--muted)', fontSize:11, fontWeight:500, whiteSpace:'nowrap' }}>{c}</span>
          ))}
        </div>
        <div style={{ display:'grid', gridTemplateColumns:'repeat(3, 1fr)', gap:6 }}>
          {['Flat white','Cortado','Espresso','Avocado toast','Pistachio bun','Almond crois.'].map((n,i) => (
            <div key={i} style={{ padding:8, border:'1px solid var(--line)', borderRadius:8 }}>
              <div style={{ aspectRatio:'1.3/1', borderRadius:5, background:`linear-gradient(${30+i*50}deg, var(--accent-soft), var(--accent-3-soft))`, marginBottom:5 }}/>
              <div style={{ fontSize:10.5, fontWeight:500, lineHeight:1.2 }}>{n}</div>
            </div>
          ))}
        </div>
      </div>
      <div style={{ padding:14, background:'var(--paper-2)' }}>
        <div style={{ fontSize:11, color:'var(--muted)', marginBottom:8 }}>2 people · Nora</div>
        {[
          { n:'Flat White', sub:'Oat milk', q:2, p:'€7.60' },
          { n:'Avocado toast', sub:'+ Egg', q:1, p:'€11.00' },
          { n:'Pistachio bun', sub:'', q:2, p:'€8.40' },
        ].map((r,i) => (
          <div key={i} style={{ padding:'8px 0', borderTop: i>0 ? '1px solid var(--line)' : '0', display:'flex', gap:8, alignItems:'center' }}>
            <div style={{ flex:1 }}>
              <div style={{ fontSize:12, fontWeight:500 }}>{r.n}</div>
              {r.sub && <div style={{ fontSize:10.5, color:'var(--muted)' }}>{r.sub}</div>}
            </div>
            <span style={{ fontSize:11, color:'var(--muted)', fontFamily:'JetBrains Mono' }}>×{r.q}</span>
            <span style={{ fontSize:12, fontWeight:500, fontFamily:'JetBrains Mono' }}>{r.p}</span>
          </div>
        ))}
        <div style={{ marginTop:10, paddingTop:10, borderTop:'1px solid var(--line)', display:'flex', justifyContent:'space-between', fontSize:13.5, fontWeight:600 }}>
          <span>Total</span><span style={{ fontFamily:'JetBrains Mono' }}>€27.00</span>
        </div>
        <div style={{ marginTop:10, display:'grid', gridTemplateColumns:'1fr 1fr', gap:6 }}>
          <div style={{ padding:'8px', background:'var(--bg)', borderRadius:6, fontSize:11, textAlign:'center', border:'1px solid var(--line)' }}>Split</div>
          <div style={{ padding:'8px', background:'var(--accent)', color:'#fff', borderRadius:6, fontSize:11, textAlign:'center', fontWeight:600 }}>Charge €27.00</div>
        </div>
      </div>
    </div>
  </div>
);

const MockKDS = () => (
  <div className="card-paper" style={{ padding:'18px 20px', border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', boxShadow:'var(--shadow-md)' }}>
    <div style={{ display:'grid', gridTemplateColumns:'repeat(3, 1fr)', gap:10, marginBottom:14 }}>
      {[
        { label:'New', n:2, color:'var(--accent-3)' },
        { label:'Preparing', n:3, color:'var(--accent)' },
        { label:'Ready', n:2, color:'var(--ok)' },
      ].map(c => (
        <div key={c.label} style={{ padding:'10px 12px', background:'var(--paper-2)', border:'1px solid var(--line)', borderRadius:10 }}>
          <div style={{ display:'flex', alignItems:'center', gap:6, fontSize:11, fontWeight:500 }}>
            <span style={{ width:7, height:7, borderRadius:2, background:c.color }}/>{c.label}
          </div>
          <div className="t-tabular" style={{ fontSize:24, fontWeight:500, marginTop:4, fontFamily:'JetBrains Mono' }}>{c.n}</div>
        </div>
      ))}
    </div>
    {[
      { id:'#412', t:'T3 · 4 guests', wait:'0:24', tone:'var(--ok)', items:['2× Pan de cristal','1× Burnt leeks','2× Cod à la brasa'] },
      { id:'#408', t:'T6 · 6 guests', wait:'9:24', tone:'var(--warn)', items:['3× Cod à la brasa','3× Olive oil cake'] },
    ].map((o,i) => (
      <div key={o.id} style={{ padding:'12px 14px', background:'var(--paper-2)', border:'1px solid var(--line)', borderRadius:10, marginBottom: i<1 ? 8:0 }}>
        <div style={{ display:'flex', justifyContent:'space-between', fontSize:11, marginBottom:4 }}>
          <span style={{ fontFamily:'JetBrains Mono', color:'var(--muted)' }}>{o.id} · {o.t}</span>
          <span style={{ fontFamily:'JetBrains Mono', color:o.tone, fontWeight:600 }}>{o.wait}</span>
        </div>
        {o.items.map((it,j) => <div key={j} style={{ fontSize:12.5, color:'var(--ink-2)', marginTop:2 }}>{it}</div>)}
        <div style={{ marginTop:10, display:'grid', gridTemplateColumns:'1fr 1fr', gap:6 }}>
          <div style={{ padding:'10px', background:'var(--bg)', border:'1px solid var(--line)', borderRadius:6, fontSize:12, fontWeight:600, textAlign:'center' }}>✓ Ready</div>
          <div style={{ padding:'10px', background:'var(--bg)', border:'1px solid var(--line)', borderRadius:6, fontSize:12, textAlign:'center', color:'var(--muted)' }}>Delay</div>
        </div>
      </div>
    ))}
  </div>
);

const MockSchedule = () => (
  <div className="card-paper" style={{ padding:0, border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', overflow:'hidden', boxShadow:'var(--shadow-md)' }}>
    <div style={{ padding:'14px 18px', borderBottom:'1px solid var(--line)', display:'flex', alignItems:'center', justifyContent:'space-between' }}>
      <span style={{ fontSize:12, fontWeight:500 }}>Week of Apr 20</span>
      <span style={{ fontSize:11, padding:'3px 9px', background:'var(--accent-wash)', color:'var(--accent-ink)', borderRadius:99, fontWeight:600 }}>↻ 24 recurring</span>
    </div>
    <div style={{ padding:'12px 16px' }}>
      <div style={{ display:'grid', gridTemplateColumns:'80px repeat(7, 1fr)', fontSize:10, color:'var(--muted)', padding:'6px 0', borderBottom:'1px solid var(--line)', letterSpacing:'.06em', textTransform:'uppercase' }}>
        <div/>{['Mon','Tue','Wed','Thu','Fri','Sat','Sun'].map(d => <div key={d} style={{ textAlign:'center' }}>{d}</div>)}
      </div>
      {[
        { name:'Lucía', role:'Server' },
        { name:'Marco', role:'Bar' },
        { name:'Karim', role:'Kitchen' },
        { name:'Nora', role:'Server' },
      ].map((p,i) => (
        <div key={p.name} style={{ display:'grid', gridTemplateColumns:'80px repeat(7, 1fr)', padding:'6px 0', borderTop: i>0 ? '1px solid var(--line)' : '0', alignItems:'center' }}>
          <div>
            <div style={{ fontSize:11.5, fontWeight:500 }}>{p.name}</div>
            <div style={{ fontSize:9.5, color:'var(--muted)' }}>{p.role}</div>
          </div>
          {[0,1,2,3,4,5,6].map(d => {
            const has = (i+d) % 3 !== 1;
            return (
              <div key={d} style={{ padding:2, height:32 }}>
                {has && <div style={{ height:'100%', borderRadius:4, background:'var(--accent-wash)', color:'var(--accent-ink)', display:'grid', placeItems:'center', fontSize:9, fontWeight:500, fontFamily:'JetBrains Mono' }}>10-17</div>}
              </div>
            );
          })}
        </div>
      ))}
    </div>
  </div>
);

const MockInventory = () => (
  <div className="card-paper" style={{ padding:'18px 20px', border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', boxShadow:'var(--shadow-md)' }}>
    <div style={{ display:'grid', gridTemplateColumns:'repeat(3, 1fr)', gap:10, marginBottom:14 }}>
      {[
        { l:'Tracked', v:'20', color:'var(--ink)' },
        { l:'Low stock', v:'2', color:'var(--warn)' },
        { l:'Out', v:'1', color:'var(--danger)' },
      ].map(c => (
        <div key={c.l} style={{ padding:'10px 12px', background:'var(--paper-2)', border:'1px solid var(--line)', borderRadius:10 }}>
          <div style={{ fontSize:10.5, color:'var(--muted)', letterSpacing:'.06em', textTransform:'uppercase', fontWeight:600 }}>{c.l}</div>
          <div className="t-tabular" style={{ fontSize:24, fontWeight:500, marginTop:4, color:c.color, fontFamily:'JetBrains Mono' }}>{c.v}</div>
        </div>
      ))}
    </div>
    {[
      { n:'Eggs (large)', unit:'each', sku:'PRZ-20', sup:'Green Farms', on:'60/72', s:'In stock', color:'var(--ok)' },
      { n:'Lamb shoulder', unit:'kg', sku:'MT-22', sup:'Prime Meat', on:'5.8/12', s:'Low', color:'var(--warn)' },
      { n:'Octopus', unit:'kg', sku:'SEA-11', sup:'Coastal', on:'0/4', s:'Out', color:'var(--danger)' },
    ].map((it,i) => (
      <div key={i} style={{ padding:'10px 0', borderTop: i>0 ? '1px solid var(--line)' : '0', display:'flex', alignItems:'center', gap:10 }}>
        <div style={{ flex:1, minWidth:0 }}>
          <div style={{ fontSize:13, fontWeight:500 }}>{it.n}</div>
          <div style={{ fontSize:10.5, color:'var(--muted)', fontFamily:'JetBrains Mono', marginTop:2 }}>{it.sku} · {it.unit} · {it.sup}</div>
        </div>
        <div className="t-tabular" style={{ fontSize:12, color:'var(--muted)', fontFamily:'JetBrains Mono' }}>{it.on}</div>
        <span style={{ fontSize:10.5, padding:'2px 8px', borderRadius:99, background: `color-mix(in oklch, ${it.color}, white 86%)`, color: it.color, fontWeight:600 }}>{it.s}</span>
      </div>
    ))}
  </div>
);

const MockMenuStudio = () => (
  <div className="card-paper" style={{ padding:20, border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', position:'relative', overflow:'hidden', boxShadow:'var(--shadow-md)' }}>
    <div style={{ position:'absolute', top:-60, right:-60, width:200, height:200, borderRadius:'50%', background:'radial-gradient(circle, var(--accent-wash), transparent 60%)' }}/>
    <div style={{ position:'relative' }}>
      <div style={{ display:'flex', alignItems:'center', gap:8, color:'var(--accent)', fontSize:12, fontWeight:600, marginBottom:14 }}>
        <Icon name="sparkle" size={14}/> AI generating 12 photos
      </div>
      <div style={{ display:'grid', gridTemplateColumns:'repeat(4, 1fr)', gap:8 }}>
        {[0,1,2,3,4,5,6,7].map(i => (
          <div key={i} style={{ aspectRatio:1, borderRadius:8, background: i<5 ? `linear-gradient(${30+i*40}deg, var(--accent-soft), var(--accent-3-soft))` : 'var(--paper-2)', position:'relative' }}>
            {i >= 5 && (
              <div style={{ position:'absolute', inset:0, display:'grid', placeItems:'center' }}>
                <div style={{ width:6, height:6, borderRadius:999, background:'var(--accent)', animation:'pulse 1.4s ease-in-out infinite' }}/>
              </div>
            )}
          </div>
        ))}
      </div>
      <div style={{ marginTop:16, height:4, borderRadius:99, background:'var(--line)', overflow:'hidden' }}>
        <div style={{ height:'100%', width:'67%', background:'var(--accent)' }}/>
      </div>
      <div style={{ marginTop:8, display:'flex', justifyContent:'space-between', fontSize:11, color:'var(--muted)', fontFamily:'JetBrains Mono' }}>
        <span>8 of 12 generated</span><span>est. 42s remaining</span>
      </div>
    </div>
  </div>
);

const MockReservations = () => (
  <div className="card-paper" style={{ padding:0, border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', overflow:'hidden', boxShadow:'var(--shadow-md)' }}>
    <div style={{ padding:'14px 18px', borderBottom:'1px solid var(--line)' }}>
      <div style={{ fontSize:11, letterSpacing:'.1em', textTransform:'uppercase', color:'var(--muted)', fontWeight:600 }}>Tonight · 24 reservations · 68 covers</div>
    </div>
    <div style={{ padding:'14px 18px' }}>
      {[
        { t:'19:00', n:'Mendoza party', s:4, tag:'Birthday', color:'var(--accent)' },
        { t:'19:30', n:'Walk-in', s:2, tag:null },
        { t:'19:30', n:'Katz', s:6, tag:'Gluten-free', color:'var(--ok)' },
        { t:'20:00', n:'Fabri', s:3, tag:null },
        { t:'20:00', n:'Kowalski', s:2, tag:'Anniversary', color:'var(--accent-3)' },
      ].map((r,i) => (
        <div key={i} style={{ padding:'10px 0', borderTop: i>0 ? '1px solid var(--line)' : '0', display:'flex', gap:12, alignItems:'center' }}>
          <div style={{ fontFamily:'JetBrains Mono', fontSize:13, fontWeight:500, width:44 }}>{r.t}</div>
          <div style={{ flex:1 }}>
            <div style={{ fontSize:13, fontWeight:500 }}>{r.n}</div>
            <div style={{ fontSize:11, color:'var(--muted)' }}>{r.s} guests · Table {['4','12','6','8','2'][i]}</div>
          </div>
          {r.tag && <span style={{ fontSize:10.5, padding:'2px 8px', borderRadius:99, background:`color-mix(in oklch, ${r.color}, white 86%)`, color:r.color, fontWeight:600 }}>{r.tag}</span>}
        </div>
      ))}
    </div>
  </div>
);

const MockQR = () => (
  <div style={{ display:'flex', justifyContent:'center' }}>
    <div style={{ width:230, aspectRatio:'9/18.5', background:'var(--ink-fixed)', borderRadius:26, padding:9, boxShadow:'var(--shadow-lg)' }}>
      <div style={{ width:'100%', height:'100%', background:'var(--bg)', borderRadius:18, padding:'18px 14px', position:'relative', overflow:'hidden' }}>
        <div style={{ fontSize:9.5, color:'var(--muted)', fontFamily:'JetBrains Mono', letterSpacing:'.08em' }}>CASA LUPE · TABLE 4</div>
        <div className="serif" style={{ fontSize:22, lineHeight:1.05, marginTop:6, fontWeight:400, letterSpacing:'-0.01em' }}>Tonight's menu</div>
        <div style={{ marginTop:12, display:'grid', gap:6 }}>
          {[
            ['Pan de cristal','€5.00'],['Pulpo gallego','€18.00'],
            ['Cordero al horno','€24.00'],['Tarta de queso','€8.00'],
          ].map(([n,p],i) => (
            <div key={i} style={{ display:'flex', gap:8, alignItems:'center', padding:'7px', border:'1px solid var(--line)', borderRadius:8 }}>
              <div style={{ width:22, height:22, borderRadius:5, background:`linear-gradient(${30+i*50}deg, var(--accent-soft), var(--accent-3-soft))` }}/>
              <div style={{ flex:1, fontSize:10, fontWeight:500, lineHeight:1.1 }}>{n}</div>
              <div style={{ fontSize:9.5, fontFamily:'JetBrains Mono', color:'var(--muted)' }}>{p}</div>
            </div>
          ))}
        </div>
        <div style={{ position:'absolute', bottom:14, left:14, right:14, padding:'10px', background:'var(--ink)', color:'var(--bg)', borderRadius:8, fontSize:11, fontWeight:600, textAlign:'center' }}>
          Pay €55.00 with  Apple Pay
        </div>
      </div>
    </div>
  </div>
);

const MockWebsite = () => (
  <div className="card-paper" style={{ padding:16, border:'1px solid var(--line)', borderRadius:16, background:'var(--paper-2)', boxShadow:'var(--shadow-md)' }}>
    <div style={{ display:'flex', gap:6, marginBottom:10 }}>
      {['#E84C3D','#F1C40F','#2ECC71'].map((c,i) => <span key={i} style={{ width:10, height:10, borderRadius:999, background:c }}/>)}
      <div style={{ flex:1, marginLeft:8, padding:'3px 8px', background:'var(--bg)', border:'1px solid var(--line)', borderRadius:6, fontSize:11, color:'var(--muted)', fontFamily:'JetBrains Mono' }}>casalupe.es</div>
    </div>
    <div style={{ background:'var(--bg)', borderRadius:10, padding:'32px 26px', border:'1px solid var(--line)' }}>
      <div style={{ fontSize:10, color:'var(--muted)', letterSpacing:'.1em', textTransform:'uppercase' }}>Bilbao · est. 2019</div>
      <div className="serif" style={{ fontSize:52, lineHeight:1, marginTop:8, fontWeight:400, letterSpacing:'-0.02em' }}>Casa Lupe</div>
      <div style={{ fontSize:13.5, color:'var(--ink-2)', marginTop:14, maxWidth:360, lineHeight:1.55 }}>A neighborhood tavern. Wood fire. Natural wine. Whatever Paco brought back from the market.</div>
      <div style={{ marginTop:22, display:'flex', gap:10 }}>
        <span style={{ padding:'9px 16px', background:'var(--ink)', color:'#fff', borderRadius:7, fontSize:12.5, fontWeight:600 }}>Reserve a table</span>
        <span style={{ padding:'9px 16px', border:'1px solid var(--line)', borderRadius:7, fontSize:12.5, fontWeight:500 }}>View menu</span>
      </div>
      <div style={{ marginTop:26, display:'grid', gridTemplateColumns:'repeat(3, 1fr)', gap:8 }}>
        {[0,1,2].map(i => (
          <div key={i} style={{ aspectRatio:'1.2/1', borderRadius:6, background:`linear-gradient(${20+i*80}deg, var(--accent-soft), var(--accent-3-soft))` }}/>
        ))}
      </div>
    </div>
  </div>
);

const MockAnalytics = () => (
  <div className="card-paper" style={{ padding:0, border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', overflow:'hidden', boxShadow:'var(--shadow-md)' }}>
    <div style={{ padding:'16px 22px', borderBottom:'1px solid var(--line)' }}>
      <div style={{ fontSize:11, letterSpacing:'.1em', textTransform:'uppercase', color:'var(--muted)', fontWeight:600 }}>Revenue · today</div>
      <div style={{ display:'flex', alignItems:'baseline', gap:10, marginTop:6 }}>
        <div className="serif t-tabular" style={{ fontSize:40, fontWeight:400, letterSpacing:'-0.02em', lineHeight:1 }}>€1,248</div>
        <div style={{ fontSize:12, color:'var(--ok)', fontWeight:500 }}>↑ +18% vs last week</div>
      </div>
    </div>
    <div style={{ padding:'22px' }}>
      <svg viewBox="0 0 300 70" style={{ width:'100%', height:70 }}>
        <defs>
          <linearGradient id="analfill" x1="0" y1="0" x2="0" y2="1">
            <stop offset="0%" stopColor="var(--accent)" stopOpacity="0.22"/>
            <stop offset="100%" stopColor="var(--accent)" stopOpacity="0"/>
          </linearGradient>
        </defs>
        <path d="M0,60 L25,50 L50,54 L75,35 L100,40 L125,26 L150,32 L175,20 L200,25 L225,12 L250,16 L275,5 L300,3 L300,70 L0,70 Z" fill="url(#analfill)"/>
        <path d="M0,60 L25,50 L50,54 L75,35 L100,40 L125,26 L150,32 L175,20 L200,25 L225,12 L250,16 L275,5 L300,3" fill="none" stroke="var(--accent)" strokeWidth="2.2"/>
      </svg>
      <div style={{ display:'flex', justifyContent:'space-between', fontSize:10, color:'var(--muted)', fontFamily:'JetBrains Mono', marginTop:4 }}>
        {['08','10','12','14','16','18','20','22'].map(t => <span key={t}>{t}</span>)}
      </div>
    </div>
    <div style={{ padding:'12px 22px 18px', display:'grid', gridTemplateColumns:'1fr 1fr 1fr', gap:14, borderTop:'1px solid var(--line)' }}>
      {[
        { l:'Orders', v:'74', c:'+9%', up:true },
        { l:'Covers', v:'112', c:'-4%', up:false },
        { l:'Avg check', v:'€16.86', c:'+2%', up:true },
      ].map((s,i) => (
        <div key={i}>
          <div style={{ fontSize:10.5, color:'var(--muted)', letterSpacing:'.06em', textTransform:'uppercase', fontWeight:500 }}>{s.l}</div>
          <div className="t-tabular serif" style={{ fontSize:22, fontWeight:400, marginTop:2, letterSpacing:'-0.01em' }}>{s.v}</div>
          <div style={{ fontSize:10.5, color: s.up?'var(--ok)':'var(--danger)', marginTop:2 }}>{s.up?'↑':'↓'} {s.c}</div>
        </div>
      ))}
    </div>
  </div>
);

const MockFeedback = () => (
  <div className="card-paper" style={{ padding:0, border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', overflow:'hidden', boxShadow:'var(--shadow-md)' }}>
    <div style={{ padding:'18px 22px', borderBottom:'1px solid var(--line)' }}>
      <div style={{ fontSize:11, letterSpacing:'.1em', textTransform:'uppercase', color:'var(--muted)', fontWeight:600 }}>Feedback · last 7 days</div>
      <div style={{ display:'flex', gap:20, alignItems:'baseline', marginTop:8 }}>
        <div>
          <div className="serif t-tabular" style={{ fontSize:34, fontWeight:400, letterSpacing:'-0.02em', lineHeight:1 }}>4.6 <span style={{ fontSize:13, color:'var(--muted)' }}>/ 5</span></div>
          <div style={{ fontSize:11, color:'var(--ok)', marginTop:4 }}>↑ +0.3 vs prior</div>
        </div>
        <div>
          <div className="serif t-tabular" style={{ fontSize:28, fontWeight:400, letterSpacing:'-0.02em', lineHeight:1 }}>142</div>
          <div style={{ fontSize:11, color:'var(--muted)', marginTop:4 }}>responses</div>
        </div>
        <div>
          <div className="serif t-tabular" style={{ fontSize:28, fontWeight:400, letterSpacing:'-0.02em', lineHeight:1, color:'var(--ok)' }}>68%</div>
          <div style={{ fontSize:11, color:'var(--muted)', marginTop:4 }}>loved it</div>
        </div>
      </div>
    </div>
    <div style={{ padding:'18px 22px' }}>
      <div style={{ fontSize:11, letterSpacing:'.06em', textTransform:'uppercase', color:'var(--muted)', fontWeight:600, marginBottom:10 }}>Movers this week</div>
      {[
        { n:'Pulpo gallego', prev:'4.8', cur:'4.2', dir:'down', color:'var(--danger)', count:'11 responses' },
        { n:'Cordero al horno', prev:'4.3', cur:'4.8', dir:'up', color:'var(--ok)', count:'14 responses' },
      ].map((d,i) => (
        <div key={i} style={{ padding:'10px 12px', borderRadius:8, marginBottom:8, background: `color-mix(in oklch, ${d.color}, white 92%)`, border:`1px solid color-mix(in oklch, ${d.color}, white 78%)`, display:'flex', alignItems:'center', gap:10 }}>
          <span style={{ fontSize:16, color:d.color }}>{d.dir === 'up' ? '↑' : '↓'}</span>
          <div style={{ flex:1, minWidth:0 }}>
            <div style={{ fontSize:13, fontWeight:500 }}>{d.n}</div>
            <div style={{ fontSize:11, color:'var(--muted)', fontFamily:'JetBrains Mono', marginTop:2 }}>{d.prev} → {d.cur} · {d.count}</div>
          </div>
        </div>
      ))}
    </div>
    <div style={{ padding:'0 22px 18px' }}>
      <div style={{ fontSize:11, letterSpacing:'.06em', textTransform:'uppercase', color:'var(--muted)', fontWeight:600, marginBottom:10 }}>Tag sentiment</div>
      {[
        { t:'Food', l:68, g:24, b:8, count:46 },
        { t:'Service', l:54, g:36, b:10, count:38 },
        { t:'Speed', l:28, g:30, b:42, count:18 },
        { t:'Atmosphere', l:80, g:18, b:2, count:24 },
      ].map((row,i) => (
        <div key={i} style={{ marginBottom:10 }}>
          <div style={{ display:'flex', justifyContent:'space-between', fontSize:12, marginBottom:4 }}>
            <span style={{ fontWeight:500 }}>{row.t}</span>
            <span style={{ color:'var(--muted)' }}>{row.count} mentions</span>
          </div>
          <div style={{ display:'flex', height:6, borderRadius:99, overflow:'hidden', background:'var(--paper-2)' }}>
            <div style={{ width:`${row.l}%`, background:'var(--ok)' }}/>
            <div style={{ width:`${row.g}%`, background:'var(--warn)' }}/>
            <div style={{ width:`${row.b}%`, background:'var(--danger)' }}/>
          </div>
        </div>
      ))}
    </div>
  </div>
);

const MockEmployeeApp = () => (
  <div style={{ background:'var(--ink-fixed)', borderRadius:22, padding:'30px 28px', color:'var(--ink-fixed-on)', boxShadow:'var(--shadow-lg)' }}>
    <div style={{ display:'flex', alignItems:'center', gap:10, marginBottom:18 }}>
      <div style={{ width:34, height:34, borderRadius:9, background:'var(--accent)', color:'#fff', display:'grid', placeItems:'center', fontSize:13, fontWeight:600 }}>CL</div>
      <div>
        <div style={{ fontSize:13, fontWeight:500 }}>Casa Lupe</div>
        <div style={{ fontSize:11, color:'rgba(244,241,234,.6)' }}>Team onboarding</div>
      </div>
    </div>
    <div style={{ display:'flex', gap:4, marginBottom:18 }}>
      {[1,1,1,0,0,0].map((f,i) => <div key={i} style={{ flex: i===2?2:1, height:4, borderRadius:99, background: f?'var(--accent)':'rgba(255,255,255,.15)' }}/>)}
    </div>
    <div className="serif" style={{ fontSize:26, lineHeight:1.1, marginBottom:6, fontWeight:400, letterSpacing:'-0.015em', color:'var(--ink-fixed-on)' }}>Set your PIN</div>
    <div style={{ fontSize:12.5, color:'rgba(244,241,234,.6)', marginBottom:18 }}>Used to clock in at the register.</div>
    <div style={{ display:'flex', justifyContent:'center', gap:14, marginBottom:16 }}>
      {[1,1,1,0].map((f,i) => <span key={i} style={{ width:14, height:14, borderRadius:999, background:f?'var(--accent)':'transparent', border:`2px solid ${f?'var(--accent)':'rgba(255,255,255,.25)'}` }}/>)}
    </div>
    <div style={{ display:'grid', gridTemplateColumns:'repeat(3, 1fr)', gap:7 }}>
      {['1','2','3','4','5','6','7','8','9'].map(k => (
        <div key={k} style={{ height:44, borderRadius:9, background:'rgba(255,255,255,.06)', border:'1px solid rgba(255,255,255,.1)', display:'grid', placeItems:'center', fontSize:17, fontWeight:500, fontFamily:'JetBrains Mono', color:'var(--ink-fixed-on)' }}>{k}</div>
      ))}
    </div>
  </div>
);

const MockDirectory = () => (
  <div className="card-paper" style={{ padding:20, border:'1px solid var(--line)', borderRadius:16, background:'var(--bg)', boxShadow:'var(--shadow-md)' }}>
    <div style={{ fontSize:11, letterSpacing:'.1em', textTransform:'uppercase', color:'var(--muted)', fontWeight:600, marginBottom:12 }}>Bilbao · Wine bars · 24 venues</div>
    {[
      { n:'Casa Lupe', cat:'Neighborhood tavern · San Francisco', r:'4.8' },
      { n:'Marigold', cat:'Natural wine bar · Deusto', r:'4.9' },
      { n:'LOAM', cat:'Seasonal · Indautxu', r:'4.7' },
    ].map((v,i) => (
      <div key={i} style={{ padding:'12px 0', borderTop: i>0 ? '1px solid var(--line)' : '0', display:'flex', alignItems:'center', gap:12 }}>
        <div style={{ width:44, height:44, borderRadius:10, background:`linear-gradient(${30+i*60}deg, var(--accent-soft), var(--accent-3-soft))` }}/>
        <div style={{ flex:1 }}>
          <div style={{ fontSize:14, fontWeight:500 }}>{v.n}</div>
          <div style={{ fontSize:12, color:'var(--muted)' }}>{v.cat}</div>
        </div>
        <div style={{ fontSize:13, color:'var(--accent-3)', fontWeight:500 }}>★ {v.r}</div>
      </div>
    ))}
  </div>
);

// ──────────────────────────────────────────────────────────────
// Root Features page
// ──────────────────────────────────────────────────────────────
const Features = ({ go }) => {
  const [active, setActive] = useStateFT('register');
  useEffectFT(() => {
    const ids = FT_GROUPS.flatMap(g => g.features.map(f => f.id));
    const handler = () => {
      let best = ids[0];
      for (const id of ids) {
        const el = document.getElementById(id);
        if (!el) continue;
        const r = el.getBoundingClientRect();
        if (r.top < window.innerHeight * 0.35) best = id;
      }
      setActive(best);
    };
    window.addEventListener('scroll', handler, { passive: true });
    handler();
    return () => window.removeEventListener('scroll', handler);
  }, []);

  const jump = (id) => {
    const el = document.getElementById(id);
    if (!el) return;
    el.scrollIntoView({ behavior:'smooth', block:'start' });
  };

  return (
    <div data-screen-label="features-page" style={{ minHeight:'100%', background:'var(--bg)' }} className="ft-scroll">
      <style>{`
        .ft-nav-container { max-width: 1280px; margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; }
        @media (max-width: 860px) {
          .ft-hero { padding: 48px 20px 32px !important; }
          .ft-hero h1 { font-size: clamp(40px, 9vw, 58px) !important; }
          .ft-body { grid-template-columns: 1fr !important; gap: 20px !important; padding: 0 20px 80px !important; }
          .ft-sidebar { position: relative !important; top: 0 !important; padding: 0 0 12px !important; display: flex !important; gap: 8px !important; overflow-x: auto !important; border-bottom: 1px solid var(--line); margin: 0 -20px; padding-left: 20px !important; padding-right: 20px !important; flex-direction: row !important; }
          .ft-sidebar > div { flex: 0 0 auto; min-width: 120px; }
          .ft-sidebar > div > div:first-child { font-size: 9.5px !important; margin-bottom: 6px !important; }
          .ft-section { padding: 48px 0 !important; }
          .ft-section > div { grid-template-columns: 1fr !important; gap: 28px !important; }
          .ft-section > div > div:first-child { order: 1 !important; }
          .ft-section > div > div:last-child { order: 2 !important; }
          .ft-nav-links { display: none !important; }
          .ft-nav-container { padding: 12px 20px !important; }
          .ft-cta-block { grid-template-columns: 1fr !important; padding: 48px 24px !important; gap: 28px !important; }
        }
      `}</style>
      {/* Header nav */}
      <header style={{ position:'sticky', top:0, zIndex:50, background:'color-mix(in oklch, var(--bg), transparent 8%)', backdropFilter:'saturate(160%) blur(12px)', WebkitBackdropFilter:'saturate(160%) blur(12px)', borderBottom:'1px solid var(--line)' }}>
        <div className="ft-nav-container">
          <a onClick={() => go('landing')} className="vv-mark" style={{ fontSize:17, cursor:'pointer' }}><span className="glyph"/> Vividish</a>
          <nav className="ft-nav-links" style={{ display:'flex', gap:28, fontSize:13.5, color:'var(--ink-2)' }}>
            <a onClick={() => go('landing')} style={{cursor:'pointer'}}>Home</a>
            <a style={{cursor:'pointer', color:'var(--ink)', fontWeight:500}}>Features</a>
            <a onClick={() => { go('landing'); setTimeout(() => { const el = document.getElementById('pricing'); if (el) el.scrollIntoView({behavior:'smooth'});}, 200);}} style={{cursor:'pointer'}}>Pricing</a>
          </nav>
          <div style={{ display:'flex', gap:10, alignItems:'center' }}>
            <button className="btn btn-ghost" onClick={() => go('dashboard')}>Sign in</button>
            <button className="btn btn-primary" onClick={() => go('onboarding')}>Start free <Icon name="arrow-right" size={14}/></button>
          </div>
        </div>
      </header>

      {/* Hero */}
      <section className="ft-hero" style={{ padding:'72px 32px 48px', maxWidth:1280, margin:'0 auto' }}>
        <FTEyebrow>Product details</FTEyebrow>
        <h1 className="serif" style={{ fontSize:'clamp(48px, 6vw, 80px)', margin:'16px 0 20px', fontWeight:400, letterSpacing:'-0.028em', lineHeight:1 }}>
          Every feature,<br/>
          <em style={{ fontStyle:'italic', color:'var(--accent)' }}>examined.</em>
        </h1>
        <p style={{ fontSize:19, color:'var(--ink-2)', lineHeight:1.55, maxWidth:620 }}>
          This page is the pitch's long version. Every screen in Vividish, why it exists, what it does, and who it's for. Jump around with the sidebar — or read top to bottom like a novel.
        </p>
      </section>

      {/* Body: sidebar + content */}
      <div className="ft-body" style={{ maxWidth:1280, margin:'0 auto', padding:'0 32px 80px', display:'grid', gridTemplateColumns:'240px 1fr', gap:56 }}>
        <FTSidebar active={active} onJump={jump}/>
        <main>
          {/* Run service */}
          <FSection
            id="register"
            eyebrow="Run service · Register"
            color="var(--accent)"
            title="A point-of-sale that keeps up with the rush."
            lede="The register is the tool your floor team touches hundreds of times a day. We made it adaptive: simple when it's quiet, dense when it's slammed. Every button is built for greasy thumbs and two-second decisions."
            bullets={[
              'Category grid, search, PLU codes, favorites',
              'Table, takeaway, and walk-in modes',
              'Modifiers, mods, notes per line',
              'Split check by seat, item, or amount',
              'Discount stacking with staff-meal & happy-hour rules',
              'Tip presets + custom, card-and-cash split',
              'Void with audit trail',
            ]}
            mockup={<MockRegister/>}
          />

          <FSection
            id="kds"
            eyebrow="Run service · Kitchen display"
            color="var(--accent)"
            title="Tickets flow. Wait timers turn red."
            lede="Orders land from the register as tickets, sorted by station. The expeditor sees median wait, longest ticket, and station load at a glance. Buttons are 60-pixel high touch targets — built for a kitchen at peak."
            bullets={[
              'Automatic station routing (cold / grill / bar / pastry)',
              'Course firing for long meals',
              'Wait timer goes yellow at 8 min, red at 12',
              'Bump to kitchen, mark ready, runner call',
              'Void with full audit trail back to the register',
            ]}
            mockup={<MockKDS/>}
            reverse
          />

          <FSection
            id="shiftmode"
            eyebrow="Run service · Shift mode"
            color="var(--accent)"
            title="The iPad can't wander off the register."
            lede="Enter shift mode to lock the full screen to POS only. The sidebar, settings, and every other surface disappear. Exit is PIN-protected; employees without admin access stay put. Auto-locks after two minutes idle."
            bullets={[
              'Full-screen POS with PIN-protected exit',
              'Hides admin surfaces from the floor',
              'Auto-lock after 2 minutes idle',
              'Built-in punch clock for the current session',
            ]}
            mockup={<MockRegister/>}
          />

          <FSection
            id="orders"
            eyebrow="Run service · Orders"
            color="var(--accent)"
            title="Every ticket, every channel, one view."
            lede="Dine-in, takeaway, delivery, QR — all tickets land in the same surface. Filter by channel, sort by wait, jump to the table. The ticket detail drawer lets you reassign, add notes, or bump to a different station."
            bullets={[
              'Tickets from every channel in one view',
              'Jump to the table floor-plan from a ticket',
              'Reassign items between tables',
              'Push notifications when something needs attention',
            ]}
            mockup={<MockKDS/>}
            reverse
          />

          {/* Menu & inventory */}
          <FSection
            id="menustudio"
            eyebrow="Menu & inventory · Menu Studio"
            color="var(--accent-3)"
            title="From PDF to published menu in four minutes."
            lede="Drop your existing menu — PDF, photo, spreadsheet. AI reads items, prices, allergens, and matches against a library of 140,000 canonical dishes. Generate photography with the sparkle button. Review drafts, tune categories, publish atomically."
            bullets={[
              'AI import from PDF, photo, or spreadsheet',
              'Canonical-item matching (140k dishes)',
              'AI photo generation, one button per item or batch',
              'Category / subcategory / course structure',
              'Atomic publish with diff preview + rollback',
              '"86" (out of stock) toggle that propagates everywhere',
              'Allergen flags, dietary tags, course sequencing',
            ]}
            mockup={<MockMenuStudio/>}
          />

          <FSection
            id="inventory"
            eyebrow="Menu & inventory · Inventory"
            color="var(--accent-3)"
            title="Stock that knows the menu."
            lede="Ingredients tie to recipes. Sell a burger, the bun, patty, cheese, and sauce all decrement. When an ingredient hits zero, every dish that uses it auto-hides from the register and QR. Par levels trigger reorder suggestions."
            bullets={[
              'Ingredient + recipe modeling',
              'Auto-decrement on sale, restore on void',
              'Par levels, reorder suggestions, supplier integration',
              'CSV / PDF import for existing stock sheets',
              'Auto-hide menu items when ingredients run out',
              'Stock counts via mobile, full audit trail',
            ]}
            mockup={<MockInventory/>}
            reverse
          />

          <FSection
            id="discounts"
            eyebrow="Menu & inventory · Discounts"
            color="var(--accent-3)"
            title="Rules that the register actually respects."
            lede="Happy hour pricing, staff meals, coupons, combos. All configured once, all enforced automatically. No server has to remember it's 17:59."
            bullets={[
              'Time-based (happy hour, lunch special)',
              'Role-based (staff 50% off, after shift)',
              'Combo rules (get X with Y)',
              'Coupon codes with expiries & limits',
              'Stacking rules, audit log',
            ]}
            mockup={<MockRegister/>}
          />

          {/* Reach */}
          <FSection
            id="website"
            eyebrow="Reach guests · Website"
            color="var(--accent-2)"
            title="A real website, not a Linktree."
            lede="Visual Puck-based editor. Blocks for hero, menu, reservations, events, gallery. The 'Remix' button regenerates copy and photos in your voice. Custom domain, EU-based CDN, zero code. Your menu is the same source of truth as the register."
            bullets={[
              'Puck visual block editor',
              'Pre-made blocks: hero, menu, reservations, events, gallery',
              'AI remix (copy + photos, in your brand voice)',
              'Custom domain + SSL, auto-renewed',
              'EU CDN, sub-200ms response times',
              'Built-in SEO and schema.org tagging',
            ]}
            mockup={<MockWebsite/>}
            reverse
          />

          <FSection
            id="qr"
            eyebrow="Reach guests · QR ordering"
            color="var(--accent-2)"
            title="Guest → paid in 10 seconds."
            lede="Scan the QR code on the table. See your menu, your photos, your brand. Apple Pay / Google Pay checkout. Order lands on the kitchen display the instant it's paid. No app to download, no login, no friction."
            bullets={[
              'Branded menu, your photos, your fonts',
              'Apple Pay / Google Pay / card in one sheet',
              'Order lands on KDS instantly after payment',
              'Language auto-detect (EN/ES/FR/IT/DE/PT)',
              'Guest can order more rounds without re-scanning',
              'Tip presets, splitting with friends',
            ]}
            mockup={<MockQR/>}
          />

          <FSection
            id="directory"
            eyebrow="Reach guests · Public directory"
            color="var(--accent-2)"
            title="Ranked on Google. For free."
            lede="Every venue on Vividish gets a listing in our city directory. SEO-optimized, schema-tagged, and pulling link juice from the whole network. More foot traffic, no ad spend. Think of it as the yellow pages, but built right."
            bullets={[
              'City landing pages, category pages, search',
              'Schema.org restaurant tagging',
              'Menu, hours, photos pulled from your Vividish workspace',
              'Network link authority',
              'Auto-updated when you update your workspace',
            ]}
            mockup={<MockDirectory/>}
            reverse
          />

          <FSection
            id="events"
            eyebrow="Reach guests · Events studio"
            color="var(--accent-2)"
            title="Ticketed nights. Private dining. Deposits."
            lede="Run paid events from the same workspace. Wine dinners, DJ nights, private buyouts. Ticket sales flow into your financials. Deposits flow into your reservations. Guests show up with a QR ticket."
            bullets={[
              'Ticketed events, tiers, limited capacity',
              'Private dining with deposits & menus',
              'Automatic reservation blocks from bookings',
              'QR tickets, at-door scan',
              'Refund & cancellation policies',
            ]}
            mockup={<MockReservations/>}
          />

          {/* Guest flow */}
          <FSection
            id="reservations"
            eyebrow="Guest flow · Reservations"
            color="var(--accent-2)"
            title="One calm view. Fewer no-shows."
            lede="A day view your host actually reads. SMS and email reminders sent at the right cadence. Party-size-aware availability that respects your floor plan. Notes carry through to the table — birthdays, allergies, regulars."
            bullets={[
              'Day view with slot availability',
              'SMS + email reminders, reply to cancel',
              'Automatic table assignment respecting floor plan',
              'Guest notes (birthdays, diet, regulars)',
              'Waitlist with text alerts',
              'Deposit-backed reservations for busy nights',
            ]}
            mockup={<MockReservations/>}
          />

          <FSection
            id="tables"
            eyebrow="Guest flow · Tables & QR"
            color="var(--accent-2)"
            title="Your floor, in software."
            lede="Build your floor plan — tables, booths, the bar, the terrace. Each table gets a QR code. Print them as coasters or stickers. Orders are tagged with the table, the host's seat count, and the reservation if there is one."
            bullets={[
              'Visual floor plan builder',
              'QR code per table, printable',
              'Seat count, party size, visible at a glance',
              'Table status (open / occupied / dirty / reserved)',
              'Orders auto-tagged with table context',
            ]}
            mockup={<MockReservations/>}
            reverse
          />

          <FSection
            id="guestorder"
            eyebrow="Guest flow · Guest order"
            color="var(--accent-2)"
            title="Guests order from their phone."
            lede="The guest-facing side of QR ordering. Native-feeling, blazing fast, multilingual. The same menu you update in Menu Studio. When a guest orders, it lands at the right table on the right KDS station."
            bullets={[
              'Native-feeling web app, no download',
              'Multilingual (auto-detect, manual override)',
              'Allergen filter, dietary tags',
              'Order history, re-order with one tap',
              'Pay-your-share splitting',
            ]}
            mockup={<MockQR/>}
          />

          {/* Team */}
          <FSection
            id="team"
            eyebrow="Team · Schedule & roles"
            color="var(--accent)"
            title="Build a week in five minutes."
            lede="Drag-to-copy between days. Recurring shifts with edit-all / edit-future / edit-one scopes. Coverage warnings when a day is understaffed. Post open shifts to your team — anyone qualified can claim."
            bullets={[
              'Drag-to-copy shifts between days',
              'Recurring shifts with scope-aware edits',
              'Coverage warnings (e.g., Friday 7pm understaffed)',
              'Open shifts with claim requests',
              'Role definitions with permissions and hourly rates',
              'Print a paper schedule for the break room',
            ]}
            mockup={<MockSchedule/>}
          />

          <FSection
            id="timesheets"
            eyebrow="Team · Timesheets"
            color="var(--accent)"
            title="Clock in. Clock out. Done."
            lede="Employees clock in at the register with their PIN. Breaks are tracked. Overtime is calculated automatically. Managers approve weekly, export to payroll provider. No more paper timesheets, no more 'how many hours did I work?'"
            bullets={[
              'PIN clock in/out at the register',
              'Break tracking (paid / unpaid policy)',
              'Overtime math (weekly threshold, configurable)',
              'Manager approval with audit log',
              'Payroll export (CSV or direct integration)',
              'Tip allocation and pooling rules',
            ]}
            mockup={<MockSchedule/>}
            reverse
          />

          <FSection
            id="employeeapp"
            eyebrow="Team · Employee app"
            color="var(--accent)"
            title="Staff onboard in two minutes."
            lede="New hire gets an invite link. Five screens: confirm details, set PIN, emergency contact, share availability, done. They land on a dashboard showing their next shift, earnings this week, open shifts they can claim, and pending requests."
            bullets={[
              'Invite link, no install required',
              '5-step onboarding (name, PIN, emergency, availability, tour)',
              'Dashboard with upcoming shifts, earnings, open shifts',
              'Submit time-off and availability requests',
              'See manager\'s response and decision notes',
              'Claim open shifts, propose swaps',
            ]}
            mockup={<MockEmployeeApp/>}
          />

          <FSection
            id="availability"
            eyebrow="Team · Availability"
            color="var(--accent)"
            title="Staff say when they can work. You decide."
            lede="Employees submit weekly availability with weekday + time range. Managers see the pool and build schedules around it. Every request can be approved or denied with a note — that note shows in the employee's dashboard so they know why."
            bullets={[
              'Weekday + time range + date span',
              'Note-to-manager field, free text',
              'Manager approve / deny with required note on deny',
              'Decision note visible in employee dashboard',
              'Availability auto-respected by scheduler',
            ]}
            mockup={<MockEmployeeApp/>}
            reverse
          />

          {/* Business */}
          <FSection
            id="analytics"
            eyebrow="Business · Analytics"
            color="var(--accent-3)"
            title="Numbers that move the needle."
            lede="Not a dashboard of vanity metrics. Revenue through the day. Best-selling items by profit margin, not just top-sold. Covers versus capacity. Labor cost as a percentage of revenue. The numbers a real operator asks for on Monday morning."
            bullets={[
              'Revenue live + daily + weekly',
              'Profit-weighted best-sellers (not just top-sold)',
              'Labor % of revenue, live',
              'Cover time + table-turn medians',
              'Channel mix (dine-in vs QR vs takeaway)',
              'Export anything to CSV',
            ]}
            mockup={<MockAnalytics/>}
          />

          <FSection
            id="feedback"
            eyebrow="Business · Guest feedback"
            color="var(--accent-3)"
            title="Every guest leaves an opinion. We turn it into a decision."
            lede="One tap after the bill gets you a 41% response rate — vs 2–3% for email surveys. On your side: sentiment by item, by server, by time-of-day — with the one thing most analytics tools skip: what changed this week and why it matters. The loop closes itself."
            bullets={[
              'Emoji capture (😕 / 🙂 / 😍) — 3 seconds to submit',
              'Optional: tag Food / Service / Speed / Atmosphere / Value / Cleanliness',
              'Optional: per-item thumbs (which dish was the issue)',
              'Optional: free-text comment',
              'Tag sentiment breakdown — where you win, where you slip',
              'Movers card — items whose rating shifted ≥0.2 this week',
              'Live stream of responses with server, table, order context',
              'Filter by server, item, time-of-day, channel',
            ]}
            mockup={<MockFeedback/>}
          />

          <FSection
            id="payments"
            eyebrow="Business · Payments"
            color="var(--accent-3)"
            title="Your processor. Your terms."
            lede="We don't mark up payments. Use Stripe, SumUp, Viva Wallet, or Adyen — bring the terms you already negotiated. Terminal integration for card present, Apple Pay / Google Pay for QR, invoices for events."
            bullets={[
              'Stripe, SumUp, Viva Wallet, Adyen supported',
              'No markup beyond processor cost',
              'Card-present terminal integration',
              'Apple Pay / Google Pay for QR ordering',
              'Multi-currency for border-town venues',
              'Invoices and deposits for events',
            ]}
            mockup={<MockAnalytics/>}
            reverse
          />

          <FSection
            id="dashboard"
            eyebrow="Business · Dashboard"
            color="var(--accent-3)"
            title="Morning numbers, one glance."
            lede="The home screen when you sign in. Today's revenue, orders, and covers — with deltas. Biggest movers. Anything flagged. The one view you'll pull up before the first espresso."
            bullets={[
              'Revenue, orders, covers with trend deltas',
              'Live revenue-through-day chart',
              'Flagged items (no-shows, low-stock, missed reorders)',
              'Configurable per role',
            ]}
            mockup={<MockAnalytics/>}
          />

          <FSection
            id="settings"
            eyebrow="Business · Settings"
            color="var(--accent-3)"
            title="Permissions, devices, audit."
            lede="Role-based access control. Every role maps to surfaces and actions. Manager can publish menus; server can't. Owner can see payroll; manager can only approve. Every consequential action is logged with user, time, and context — searchable for six years."
            bullets={[
              'Role-based permissions (granular, per-action)',
              'Device registry (iPads, printers, card readers)',
              'Audit log, 6-year retention',
              'GDPR-native data tools (export, delete, DPA)',
              'Multi-venue permissions for groups',
            ]}
            mockup={<MockEmployeeApp/>}
            reverse
          />
        </main>
      </div>

      {/* CTA */}
      <section style={{ padding:'48px 32px 96px' }}>
        <div className="lnd-invert-card ft-cta-block" style={{ maxWidth:1280, margin:'0 auto', background:'var(--ink-fixed)', color:'var(--ink-fixed-on)', borderRadius:28, padding:'72px 56px', display:'grid', gridTemplateColumns:'1.2fr 1fr', gap:32, alignItems:'center', position:'relative', overflow:'hidden' }}>
          <div aria-hidden style={{ position:'absolute', top:-60, right:-60, width:280, height:280, borderRadius:'50%', background:'var(--accent)', opacity:.22, filter:'blur(18px)' }}/>
          <div style={{ position:'relative', zIndex:1 }}>
            <h2 className="serif" style={{ fontSize:'clamp(36px, 4.2vw, 56px)', margin:0, fontWeight:400, letterSpacing:'-0.025em', lineHeight:1.05 }}>
              Ready to see it running your venue?
            </h2>
            <p style={{ marginTop:18, color:'rgba(244,241,234,.72)', fontSize:16, maxWidth:480 }}>
              Start free for 30 days. We'll import your menu, set up your QR codes, and stay on a call until your first order goes through.
            </p>
          </div>
          <div style={{ display:'flex', flexDirection:'column', gap:10, position:'relative', zIndex:1 }}>
            <button className="btn" style={{ background:'var(--accent)', color:'#fff', border:0, padding:'14px 22px', fontSize:15, justifyContent:'center', fontWeight:600 }} onClick={() => go('onboarding')}>
              Start your workspace <Icon name="arrow-right" size={15}/>
            </button>
            <button className="btn" style={{ background:'transparent', color:'var(--ink-fixed-on)', borderColor:'rgba(255,255,255,.24)', padding:'14px 22px', fontSize:14.5, justifyContent:'center' }} onClick={() => go('landing')}>
              Back to overview
            </button>
          </div>
        </div>
      </section>
      {window.LND_Footer && <window.LND_Footer/>}
      <style>{`@keyframes pulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }`}</style>
    </div>
  );
};

window.Features = Features;
