// geoky-sections.jsx — Geoky landing (BOZZA pre-launch).
// Aligned to GMR v2 + Brynx + Marketear + CrewRev + DTwin + InfluRep system.
// Copy is BOZZA — iterate when the MVP matures.

const ECO_ORDER = ['brynx', 'dtwin', 'marketear', 'influrep', 'geoky', 'klenux'];

// ---- Logo: Geoky wordmark (typeset — brand-kit asset spells "GEOKE", so the
// "GEOKY" rename is rendered as styled text following the same G-pink pattern). ----
function GkLogo({ size = 'm' }) {
  const heights = { s: 18, m: 22, l: 28, xl: 40 };
  const h = heights[size];
  return (
    <a href="#top" className="bx-mark" aria-label="Geoky — home"
       style={{
         fontFamily: '"DM Sans", ui-sans-serif, system-ui, sans-serif',
         fontSize: h,
         fontWeight: 500,
         lineHeight: 1,
         letterSpacing: '-0.025em',
         display: 'inline-flex',
         alignItems: 'baseline',
         textDecoration: 'none',
       }}>
      <span style={{ color: '#EC4899' }}>G</span><span style={{ color: '#E4E4E8' }}>EOKY</span>
    </a>
  );
}

// ============================================================
// 0 · HEADER
// ============================================================
function GkHeader() {
  return (
    <header className="linear-header">
      <div className="container">
        <GkLogo />
        <nav>
          <a href="#how">How it works</a>
          <a href="#tracks">Take-aways</a>
          <a href="#pricing">Pricing</a>
          <a href="https://app.geoky.ai/login" className="btn-x brand">Start free <span className="arrow">→</span></a>
        </nav>
      </div>
    </header>
  );
}

// ============================================================
// 1 · HERO
// ============================================================
function GkHero() {
  return (
    <section id="top" style={{ position: 'relative', paddingTop: 80, paddingBottom: 96, overflow: 'hidden' }}>
      <div className="ambient"/>
      <div className="container layer" style={{ paddingTop: 56 }}>
        <div className="hero-grid">
          <div className="col gap-6">
            <span className="pill-x brand reveal" style={{ alignSelf: 'flex-start' }}>
              <span className="dot"/> Generative engine optimization
            </span>

            <h1 className="t-display reveal">
              Your customers stopped Googling.<br/>
              <span className="muted">They're asking AI.</span><br/>
              Do you know what it says about you?
            </h1>

            <p className="t-lead reveal" style={{ maxWidth: 600 }}>
              Search moved inside ChatGPT, Claude, Perplexity and Gemini. Your brand is being described, recommended — or ignored — in answers you never see. Geoky shows you exactly what the AI says about you, and how to change it. You get the verdict, not a rank tracker.
            </p>

            <div className="col gap-3 reveal" style={{ marginTop: 8 }}>
              <div className="row gap-3" style={{ flexWrap: 'wrap' }}>
                <a href="https://app.geoky.ai/login" className="btn-x brand">Start free <span className="arrow">→</span></a>
                <a href="#sample" className="btn-x">See a sample take-away</a>
              </div>
              <span className="cta-microcopy">
                No credit card<span className="sep">·</span>No setup<span className="sep">·</span>First read in minutes
              </span>
            </div>
          </div>

          <div className="reveal">
            <TakeawayPreview />
          </div>
        </div>
      </div>
    </section>
  );
}

// Hero visual — a stylized "weekly take-away" card.
// Brand vs competitors across 4 engines + 3 confidence-labeled findings.
function TakeawayPreview() {
  return (
    <div className="report-preview" aria-hidden="true">
      <div className="report-chrome">
        <span className="filename">
          <span className="ext">WK 42</span>
          take-away.geoky
        </span>
        <span className="status">Weekly · Mon 09:00</span>
      </div>

      <h4 className="report-title">Brand visibility · this week</h4>
      <div className="report-sub">4 engines · 3 competitors · twins n=240</div>

      <div className="report-section-h">Engine presence · share of mention</div>
      <div className="report-bars"><span className="lbl">ChatGPT</span><span className="track"><span className="fill" style={{ width: '74%' }}/></span><span className="val">62%</span></div>
      <div className="report-bars"><span className="lbl">Claude</span><span className="track"><span className="fill" style={{ width: '58%' }}/></span><span className="val">48%</span></div>
      <div className="report-bars"><span className="lbl">Perplexity</span><span className="track"><span className="fill" style={{ width: '40%' }}/></span><span className="val">32%</span></div>
      <div className="report-bars"><span className="lbl">Gemini</span><span className="track"><span className="fill" style={{ width: '22%' }}/></span><span className="val">18%</span></div>

      <div className="report-section-h">Take-aways · this week</div>
      <div className="report-find">
        <span className="idx">01</span>
        <span>You're now the #1 mention on ChatGPT for "AI research agency" queries — up from #3. <span className="cite">[conf. high]</span></span>
      </div>
      <div className="report-find">
        <span className="idx">02</span>
        <span>Gemini still misframes you as a "dashboard tool" — schema-page update needed. <span className="cite">[conf. high]</span></span>
      </div>
      <div className="report-find">
        <span className="idx">03</span>
        <span>Competitor X picked up 6pp share on Perplexity — likely tied to a new blog post. <span className="cite">[conf. medium]</span></span>
      </div>

      <div className="report-foot">
        <span className="pages">wk 42 · vs wk 41</span>
        <span>geoky · weekly take-aways</span>
      </div>
    </div>
  );
}

// ============================================================
// 2 · CONTRARIAN
// ============================================================
function GkContrarian() {
  return (
    <section className="brynx-strip reveal">
      <div className="container">
        <p className="text">
          Stop optimizing for ten blue links. Nobody's scrolling them.<br/>
          <span className="em">Optimize for the one answer the AI gives.</span>
        </p>
      </div>
    </section>
  );
}

// ============================================================
// 3 · PROBLEM
// ============================================================
function GkProblem() {
  const items = [
    { n: '01', strike: 'One answer, not ten links', body: 'The answer replaced the list. People ask AI and act on one synthesized reply — they never see page one.' },
    { n: '02', strike: "There's no dashboard for it",  body: "You can't see it. There's no dashboard for what ChatGPT tells a buyer about your brand." },
    { n: '03', strike: 'Lose the deal silently',     body: "Your competitor might own the answer. And you'd never know until the deal is lost." },
  ];
  return (
    <section className="linear-section" id="problem">
      <hr className="section-rule"/>
      <div className="container col gap-7" style={{ paddingTop: 56 }}>
        <span className="mono-label" data-num="01">The problem</span>
        <h2 className="t-h1 reveal" style={{ maxWidth: 1100, marginTop: 4 }}>
          SEO got you ranked.<br/>
          <span className="muted">The ranking isn't where the decision happens anymore.</span>
        </h2>

        <div className="problem-list reveal-stagger" style={{ marginTop: 16 }}>
          {items.map(it => (
            <div key={it.n} className="problem-row">
              <div className="num">{it.n} ·</div>
              <div>
                <div className="body">{it.body}</div>
                <div className="strike-meta">{it.strike}</div>
              </div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ============================================================
// 4 · DELIVERS (RaaS)
// ============================================================
function GkDelivers() {
  const props = [
    { g: '◆', name: 'See what AI says about you.',         desc: 'Verbatim, across engines, against competitors.' },
    { g: '◇', name: 'Audience-realistic, not a generic probe.', desc: 'Digital twins ask the way your customers ask.' },
    { g: '§', name: 'Diagnostic take-aways.',              desc: "What's hurting your presence and what to do — confidence-labeled, never guesswork." },
  ];
  return (
    <section className="linear-section" id="delivers">
      <hr className="section-rule"/>
      <div className="container col gap-7" style={{ paddingTop: 56 }}>
        <span className="mono-label" data-num="02">What Geoky delivers</span>
        <h2 className="t-h1 reveal" style={{ maxWidth: 1100, marginTop: 4 }}>
          The answer the AI gives,<br/>
          <span className="muted">measured and improved.</span>
        </h2>
        <p className="t-lead reveal" style={{ maxWidth: 820 }}>
          Geoky runs your brand and your competitors through generative engines the way your real audience would — using digital twins — and returns what the AI actually says, tracked over time.
        </p>

        <div className="delivers-grid reveal-stagger" style={{ marginTop: 16 }}>
          {props.map(p => (
            <div key={p.name} className="deliver-card">
              <span className="glyph">{p.g}</span>
              <h3 className="name">{p.name}</h3>
              <p className="desc">{p.desc}</p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ============================================================
// 5 · HOW IT WORKS (signature — describes the product flow)
// ============================================================
function GkHow() {
  return (
    <section className="linear-section" id="how">
      <hr className="section-rule"/>
      <div className="container col gap-7" style={{ paddingTop: 56 }}>
        <span className="mono-label" data-num="03">How it works</span>
        <h2 className="t-h1 reveal" style={{ maxWidth: 1100, marginTop: 4 }}>
          Describe your brand.<br/>
          <span className="muted">Get the read every week.</span>
        </h2>

        <div className="how-grid reveal-stagger" style={{ marginTop: 16 }}>
          <div className="how-step">
            <span className="step-num">01 · Set up your brand</span>
            <h3 className="step-name">Name, voice, competitors.</h3>
            <p className="step-desc">Name, voice, competitors, the occasions you care about. Once.</p>
          </div>
          <div className="how-step" style={{ paddingLeft: 32 }}>
            <span className="step-num">02 · Geoky builds your twins</span>
            <h3 className="step-name">Audience-realistic queries.</h3>
            <p className="step-desc">Audience-realistic digital twins on the GMR Twin platform query the AI the way your customers do.</p>
          </div>
          <div className="how-step" style={{ paddingLeft: 32 }}>
            <span className="step-num">03 · Weekly take-aways</span>
            <h3 className="step-name">Three insights, every Monday.</h3>
            <p className="step-desc">Three confidence-labeled insights: where you show up, where you don't, and what moved.</p>
          </div>
        </div>
      </div>
    </section>
  );
}

// ============================================================
// 6 · WHAT YOU TRACK (4 cards — 2x2, reuses .crew-grid + .usecase-grid)
// ============================================================
function GkTracks() {
  const tracks = [
    { name: 'Brand visibility',     role: 'Are you in the answer at all, and how prominently.',          glyph: '◐', tag: 'presence' },
    { name: 'Sentiment & framing',  role: 'How the AI characterizes you, in its own words.',             glyph: '◇', tag: 'framing' },
    { name: 'Competitor share',     role: 'Who the AI names instead of you.',                            glyph: '⇄', tag: 'competition' },
    { name: 'Movement',             role: 'What changed week over week, and likely why.',                glyph: '∿', tag: 'trend' },
  ];
  return (
    <section className="linear-section" id="tracks">
      <hr className="section-rule"/>
      <div className="container col gap-7" style={{ paddingTop: 56 }}>
        <span className="mono-label" data-num="04">What you track</span>
        <h2 className="t-h1 reveal" style={{ maxWidth: 1100, marginTop: 4 }}>
          Your presence in the answer,<br/>
          <span className="muted">over time.</span>
        </h2>

        <div className="crew-grid usecase-grid reveal-stagger" style={{ marginTop: 16 }}>
          {tracks.map(c => (
            <div key={c.name} className="crew-card">
              <div className="crew-head">
                <span className="crew-glyph">{c.glyph}</span>
                <div className="col" style={{ gap: 2 }}>
                  <h3 className="crew-name">{c.name}</h3>
                </div>
              </div>
              <p className="crew-role">{c.role}</p>
              <span className="crew-tag">{c.tag}</span>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ============================================================
// 7 · STATS
// ============================================================
function GkStats() {
  return (
    <section className="linear-section" style={{ paddingTop: 24 }}>
      <div className="container reveal">
        <div className="bx-stats">
          <div className="bx-stat">
            <span className="v"><span className="accent">4</span></span>
            <span className="k">Generative engines tracked</span>
          </div>
          <div className="bx-stat">
            <span className="v">3</span>
            <span className="k">Take-aways every week</span>
          </div>
          <div className="bx-stat">
            <span className="v">100+</span>
            <span className="k">Twin attributes per query</span>
          </div>
          <div className="bx-stat">
            <span className="v">0</span>
            <span className="k">Dashboards to read</span>
          </div>
        </div>
      </div>
    </section>
  );
}

// ============================================================
// 8 · REPLACES
// ============================================================
function GkReplaces() {
  return (
    <section className="replaces-strip reveal" id="replaces">
      <div className="container">
        <h2 className="replaces-big">
          Replaces <span className="accent">·</span><br/>
          <span className="em">flying blind in AI search.</span>
        </h2>
        <p className="replaces-foot">
          Rank trackers, manual ChatGPT spot-checks, gut-feel brand monitoring — folded into one product that ships the answer.
        </p>
      </div>
    </section>
  );
}

// ============================================================
// 9 · PRICING
// ============================================================
function GkPricing() {
  return (
    <section className="linear-section" id="pricing">
      <hr className="section-rule"/>
      <div className="container col gap-7" style={{ paddingTop: 56 }}>
        <span className="mono-label" data-num="05">Pricing</span>
        <h2 className="t-h1 reveal" style={{ maxWidth: 1100, marginTop: 4 }}>
          Start free.<br/>
          <span className="muted">Scale when it pays off.</span>
        </h2>

        <div className="pricing-grid reveal-stagger" style={{ marginTop: 16 }}>

          <div className="price-card">
            <span className="tier">Start</span>
            <h3 className="name">For first brands.</h3>
            <div className="price-row">
              <span className="price">$149</span>
              <span className="period">/ mo</span>
            </div>
            <ul>
              <li>149,000 tokens per month</li>
              <li>All four engines</li>
              <li>Card payment, monthly or annual (2 months free)</li>
              <li>Top-up anytime — $1 = 1,000 tokens</li>
            </ul>
            <a href="https://app.geoky.ai/login" className="btn-x cta">Choose Start</a>
          </div>

          <div className="price-card featured">
            <span className="ribbon">Most popular</span>
            <span className="tier">Pro</span>
            <h3 className="name">For ongoing tracking.</h3>
            <div className="price-row">
              <span className="price">$299</span>
              <span className="period">/ mo</span>
            </div>
            <ul>
              <li>350,000 tokens per month (+17% bonus)</li>
              <li>Priority tracking</li>
              <li>Card payment, monthly or annual</li>
              <li>Top-up anytime — $1 = 1,000 tokens</li>
            </ul>
            <a href="https://app.geoky.ai/login" className="btn-x brand cta">Choose Pro <span className="arrow">→</span></a>
          </div>

          <div className="price-card">
            <span className="tier">Enterprise</span>
            <h3 className="name">For agencies.</h3>
            <div className="price-row">
              <span className="price">Contact us</span>
            </div>
            <ul>
              <li>All GMR products, one wallet</li>
              <li>Volume token economics</li>
              <li>Invoice billing &amp; SSO</li>
              <li>Multi-client for agencies</li>
            </ul>
            <a href="#contact" className="btn-x cta">Talk to sales</a>
          </div>

        </div>

        <p className="pricing-micro">
          Start free — 149K tokens, no credit card, all 4 engines included. First read in minutes. Top up anytime · $1 = 1,000 tokens.
        </p>
      </div>
    </section>
  );
}

// ============================================================
// 10 · FINAL CTA
// ============================================================
function GkFinalCTA() {
  return (
    <section className="final-cta" id="start">
      <div className="container layer">
        <h2 className="heading reveal">
          Find out what the AI says about you<br/>
          <span className="muted">— before your competitor does.</span>
        </h2>
        <div className="ctas reveal">
          <a href="https://app.geoky.ai/login" className="btn-x brand">Start free <span className="arrow">→</span></a>
          <a href="#contact" className="btn-x">Talk to us</a>
        </div>
        <div className="micro reveal">No credit card · 4 engines · First read in minutes</div>
      </div>
    </section>
  );
}

// ============================================================
// 11 · FOOTER (with 6-product ecosystem bar)
// ============================================================
function GkFooter() {
  return (
    <>
      <div className="eco-bar" id="contact">
        <div className="container">
          <div className="inner">
            <span className="label">Part of the GMR stack</span>
            <div className="pellets">
              {ECO_ORDER.map(id => {
                const b = SITE_BRANDS[id];
                const isActive = id === 'geoky';
                return (
                  <a key={id} href={b.url} className={`pellet ${isActive ? 'active' : ''}`}
                     target={isActive ? undefined : '_blank'}
                     rel={isActive ? undefined : 'noopener'}
                     aria-label={b.long}>
                    <span className="eco-mono">
                      <img src={MONO_FILES[id]} alt={b.mono}/>
                    </span>
                    <span className="eco-name">{b.long}</span>
                  </a>
                );
              })}
            </div>
          </div>
        </div>
      </div>

      <footer className="linear-footer">
        <div className="container">
          <div className="row between" style={{ alignItems: 'flex-start', marginBottom: 40, flexWrap: 'wrap', gap: 40 }}>
            <div className="col gap-3" style={{ maxWidth: 360 }}>
              <GkLogo size="m"/>
              <span style={{ color: 'var(--text-4)', fontSize: 13, lineHeight: 1.5, marginTop: 8 }}>
                Generative engine optimization. See what AI says about your brand — measured weekly through audience-realistic digital twins.
              </span>
              <span style={{ color: 'var(--text-5)', fontSize: 12, marginTop: 4 }}>
                Part of GMR — AI-native products that deliver results, not tools.
              </span>
            </div>

            <div className="row gap-7" style={{ flexWrap: 'wrap' }}>
              <div className="col" style={{ minWidth: 130 }}>
                <span className="group-label">Product</span>
                <a href="#how">How it works</a>
                <a href="#tracks">What you track</a>
                <a href="#sample">Sample take-away</a>
              </div>
              <div className="col" style={{ minWidth: 120 }}>
                <span className="group-label">Pricing</span>
                <a href="#pricing">Plans</a>
                <a href="https://app.geoky.ai/login">Start free</a>
                <a href="#contact">Enterprise</a>
              </div>
              <div className="col" style={{ minWidth: 120 }}>
                <span className="group-label">Account</span>
                <a href="https://app.geoky.ai/login">Login</a>
                <a href="https://app.geoky.ai/login">Sign up</a>
              </div>
              <div className="col" style={{ minWidth: 110 }}>
                <span className="group-label">Legal</span>
                <a href="https://www.iubenda.com/privacy-policy/74776910" className="iubenda-black iubenda-noiframe iubenda-embed" title="Privacy Policy">Privacy Policy</a>
                <a href="https://www.iubenda.com/privacy-policy/74776910/cookie-policy" className="iubenda-black iubenda-noiframe iubenda-embed" title="Cookie Policy">Cookie Policy</a>
                <a href="https://www.iubenda.com/terms-and-conditions/74776910" className="iubenda-black iubenda-noiframe iubenda-embed" title="Terms and Conditions">Terms and Conditions</a>
              </div>
            </div>
          </div>

          <hr style={{ height: 1, background: 'var(--line)', border: 0 }}/>

          <div className="row between" style={{ padding: '20px 0 0', alignItems: 'center', flexWrap: 'wrap', gap: 12 }}>
            <span className="mono">© Geoky · part of GMR Inc · {new Date().getFullYear()}</span>
            <span className="mono">geoky.ai</span>
          </div>
        </div>
      </footer>
    </>
  );
}

Object.assign(window, {
  GkLogo,
  GkHeader, GkHero, TakeawayPreview, GkContrarian, GkProblem,
  GkDelivers, GkHow, GkTracks, GkStats, GkReplaces,
  GkPricing, GkFinalCTA, GkFooter,
  ECO_ORDER,
});
