/* global React */

/* ============================================
   ABOUT PAGE
   ============================================ */
function FounderCard({ name, role, bio, imgSrc, objectPosition = 'center top', founderKey }) {
  return (
    <div className="founder-card glass glass-interactive" data-founder={founderKey} style={{
      borderRadius: 20,
      padding: 28,
      width: '100%',
      maxWidth: 480,
    }}>
      <div style={{
        width: '100%',
        aspectRatio: '4 / 5',
        borderRadius: 14,
        overflow: 'hidden',
        background: 'linear-gradient(135deg, rgba(168,197,232,0.18), rgba(12,20,48,0.6))',
        position: 'relative',
        marginBottom: 24,
      }}>
        {imgSrc && (
          <img
            src={imgSrc}
            alt={name}
            loading="lazy"
            style={{
              position: 'absolute',
              inset: 0,
              width: '100%',
              height: '100%',
              objectFit: 'cover',
              objectPosition,
              filter: 'saturate(0.55) hue-rotate(-12deg) contrast(1.04) brightness(0.92)',
            }}
          />
        )}
        {/* ice-blue duotone overlay */}
        <div style={{
          position: 'absolute',
          inset: 0,
          background: 'linear-gradient(180deg, rgba(12,20,48,0.18) 0%, rgba(12,20,48,0.05) 40%, rgba(4,8,16,0.55) 100%)',
          mixBlendMode: 'multiply',
          pointerEvents: 'none',
        }} />
        <div style={{
          position: 'absolute',
          inset: 0,
          background: 'linear-gradient(135deg, rgba(168,197,232,0.18), transparent 50%)',
          mixBlendMode: 'screen',
          pointerEvents: 'none',
        }} />
        {/* glass scan-line */}
        <div style={{
          position: 'absolute',
          left: 0, right: 0, top: '50%',
          height: 1,
          background: 'rgba(168,197,232,0.18)',
          pointerEvents: 'none',
        }} />
        {/* corner mono caption */}
        <div style={{
          position: 'absolute',
          top: 12, left: 14,
          fontFamily: 'var(--font-mono)',
          fontSize: 10,
          textTransform: 'uppercase',
          letterSpacing: '0.12em',
          color: 'var(--accent-ice)',
          textShadow: '0 1px 4px rgba(0,0,0,0.6)',
        }}>
          {name.split(' ')[0]}
        </div>
      </div>
      <h3 className="serif" style={{ fontSize: 36, letterSpacing: '-0.02em', lineHeight: 1.1, marginBottom: 6 }}>{name}</h3>
      <div className="eyebrow" style={{ marginBottom: 14, color: 'var(--accent-ice)' }}>{role}</div>
      <p style={{ fontSize: 15, lineHeight: 1.55, color: 'var(--text-secondary)' }}>{bio}</p>
    </div>
  );
}

function AboutPageBody() {
  const values = [
    { n: '01', t: 'Ship to production.', d: 'We measure ourselves against deployments, not demos.' },
    { n: '02', t: 'Speak the language.', d: 'Azerbaijani, Russian, English. No model is good at our region by default — we make it good.' },
    { n: '03', t: 'Earn the audit.', d: 'Every agent we ship can be inspected, reasoned about, and held accountable.' },
    { n: '04', t: 'Respect the data.', d: "Our clients' data is sensitive. We architect for that from day one." },
  ];

  return (
    <>
      <PageHeader
        eyebrow="ABOUT — APPLIED AI LAB"
        title={<>Most AI shops talk about transformation. <em style={{ color: 'var(--accent-ice)', fontStyle: 'italic' }}>We ship working agents.</em></>}
      />

      {/* Manifesto */}
      <section style={{ paddingTop: 40, paddingBottom: 120 }}>
        <div className="container">
          <div className="manifesto" style={{ maxWidth: 760, fontFamily: 'var(--font-serif)' }}>
            <p style={{ fontSize: 'clamp(20px, 2vw, 26px)', lineHeight: 1.5, color: 'var(--text-primary)', marginBottom: 28, fontStyle: 'italic' }}>
              Codage builds production AI for industries the global model providers don't optimize for — Azerbaijani-language document processing, Caspian-region regulatory environments, the operational realities of enterprises that have run on Russian-language documentation for forty years.
            </p>
            <p style={{ fontSize: 'clamp(18px, 1.6vw, 22px)', lineHeight: 1.55, color: 'var(--text-secondary)', marginBottom: 28 }}>
              We work in the gap between what frontier models can do in English and what businesses in our region actually need.
            </p>
            <p style={{ fontSize: 'clamp(18px, 1.6vw, 22px)', lineHeight: 1.55, color: 'var(--text-secondary)' }}>
              Our agents don't sit in a sandbox. They process onboarding applications at retail banks, triage life insurance claims, query four decades of seismic reports, and detect fraud in real time. We measure success in production uptime and client retention, not press coverage.
            </p>
          </div>
        </div>
      </section>

      {/* Values — typographic list, no glass cards */}
      <section data-bg="elevated" style={{ paddingTop: 100, paddingBottom: 120 }}>
        <div className="container">
          <div className="section-hairline" style={{ marginBottom: 56 }} />
          <div style={{ display: 'grid', gridTemplateColumns: '1fr 2fr', gap: 80, marginBottom: 80 }} className="values-head">
            <div>
              <div className="eyebrow" style={{ marginBottom: 16 }}>HOW WE WORK</div>
              <h2 className="serif" style={{ fontSize: 'clamp(40px, 5vw, 72px)', letterSpacing: '-0.025em', lineHeight: 1.0, margin: 0 }}>
                Four <em style={{ color: 'var(--accent-ice)', fontStyle: 'italic' }}>principles.</em>
              </h2>
            </div>
            <p style={{ fontSize: 17, lineHeight: 1.6, color: 'var(--text-secondary)', alignSelf: 'end', maxWidth: 540 }}>
              These aren't slogans. They're how we choose what to build, what to refuse, and how we operate the agents we ship into production.
            </p>
          </div>

          <div className="values-list">
            {values.map((v, i) => (
              <div key={v.n} className="value-row" style={{
                display: 'grid',
                gridTemplateColumns: '80px 1fr 1.2fr',
                gap: 48,
                padding: '40px 0',
                alignItems: 'baseline',
                borderTop: '1px solid var(--border-glass)',
                borderBottom: i === values.length - 1 ? '1px solid var(--border-glass)' : 'none',
              }}>
                <div className="serif" style={{ fontSize: 'clamp(36px, 4vw, 56px)', color: 'var(--accent-ice)', lineHeight: 0.9, letterSpacing: '-0.02em' }}>{v.n}</div>
                <h3 className="serif" style={{ fontSize: 'clamp(28px, 3.5vw, 48px)', letterSpacing: '-0.02em', lineHeight: 1.05, margin: 0 }}>{v.t}</h3>
                <p style={{ fontSize: 17, lineHeight: 1.55, color: 'var(--text-secondary)', margin: 0 }}>{v.d}</p>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* Mark divider — ghost mark separates manifesto/values from team */}
      <div aria-hidden="true" style={{ display: 'flex', justifyContent: 'center', padding: '40px 0' }}>
        <img src="assets/brand/codage-favicon.png" alt="" width="48" height="48" style={{
          width: 64, height: 64, opacity: 0.3,
          filter: 'drop-shadow(0 0 24px rgba(168,197,232,0.25))',
        }} />
      </div>

      {/* Founders */}
      <section style={{ paddingTop: 80, paddingBottom: 120 }}>
        <div className="container">
          <div className="eyebrow" style={{ marginBottom: 24 }}>THE FOUNDERS</div>
          <h2 className="serif section-h2" style={{ fontSize: 'clamp(40px, 5vw, 64px)', letterSpacing: '-0.025em', lineHeight: 1.05, marginBottom: 60, maxWidth: 800 }}>
            Two founders. <em style={{ color: 'var(--accent-ice)', fontStyle: 'italic' }}>Six agents in production.</em>
          </h2>
          <div className="founders-grid" style={{
            display: 'grid',
            gridTemplateColumns: 'repeat(2, minmax(0, 480px))',
            gap: 32,
            justifyContent: 'center',
            marginBottom: 48,
          }}>
            <FounderCard
              founderKey="elgun"
              name="Elgun Hasanov"
              role="Co-founder · Applied AI"
              bio="Builds production AI agents for Caspian enterprises. Background in machine learning and software engineering."
              imgSrc="assets/team/elgun.jpg"
              objectPosition="center 25%"
            />
            <FounderCard
              founderKey="fatulla"
              name="Fatulla Bashirov"
              role="Co-founder · Engineering"
              bio="Leads engineering and infrastructure. Specialist in NLP systems and language-specific model fine-tuning."
              imgSrc="assets/team/fatulla.jpg"
              objectPosition="center 20%"
            />
          </div>
          <p style={{
            textAlign: 'center',
            fontSize: 15,
            color: 'var(--text-secondary)',
            maxWidth: 600,
            margin: '0 auto',
          }}>
            Codage is hiring senior ML and AI engineers. Reach us at{' '}
            <a href="mailto:info@codage.az" style={{ color: 'var(--accent-ice)', borderBottom: '1px solid var(--accent-ice)' }}>info@codage.az</a>.
          </p>
        </div>
      </section>

      {/* Locations — composed strip with topo map, not equal cards */}
      <section data-bg="deep" style={{ paddingTop: 80, paddingBottom: 140, position: 'relative', overflow: 'hidden' }}>
        <div className="container" style={{ position: 'relative', zIndex: 2 }}>
          <div className="section-hairline" style={{ marginBottom: 56 }} />
          <div className="eyebrow" style={{ marginBottom: 28 }}>WHERE WE WORK</div>

          <div className="locations-strip" style={{
            display: 'grid',
            gridTemplateColumns: '1.4fr 1px 1fr',
            gap: 64,
            alignItems: 'flex-start',
          }}>
            {/* Baku — anchor */}
            <div>
              <div style={{ display: 'flex', alignItems: 'baseline', gap: 14, marginBottom: 14, flexWrap: 'wrap' }}>
                <h3 className="serif" style={{ fontSize: 'clamp(56px, 8vw, 120px)', letterSpacing: '-0.03em', lineHeight: 0.92, margin: 0 }}>Bakı</h3>
                <span style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--text-tertiary)', letterSpacing: '0.12em' }}>HEADQUARTERS</span>
              </div>
              <div style={{ fontFamily: 'var(--font-mono)', fontSize: 12, color: 'var(--text-tertiary)', letterSpacing: '0.1em', marginBottom: 32 }}>40.4093°N · 49.8671°E</div>
              <div style={{ display: 'grid', gap: 14, fontSize: 16 }}>
                <a href="tel:+994515133777" style={{ color: 'var(--text-primary)' }}>+994 51 513 37 77</a>
                <a href="mailto:info@codage.az" style={{ color: 'var(--accent-ice)' }}>info@codage.az</a>
                <a href="mailto:fatulla@codage.az" style={{ color: 'var(--accent-ice)' }}>fatulla@codage.az</a>
              </div>
            </div>

            {/* Vertical hairline divider */}
            <div style={{ width: 1, height: '100%', background: 'var(--border-glass)' }} />

            {/* Paris — secondary */}
            <div>
              <div style={{ display: 'flex', alignItems: 'baseline', gap: 14, marginBottom: 14, flexWrap: 'wrap' }}>
                <h3 className="serif" style={{ fontSize: 'clamp(40px, 5vw, 72px)', letterSpacing: '-0.025em', lineHeight: 0.95, margin: 0 }}>Paris</h3>
                <span style={{ fontFamily: 'var(--font-mono)', fontSize: 10, color: 'var(--text-tertiary)', letterSpacing: '0.12em' }}>DESK</span>
              </div>
              <div style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--text-tertiary)', letterSpacing: '0.1em', marginBottom: 28 }}>48.8566°N · 2.3522°E</div>
              <div style={{ display: 'grid', gap: 12, fontSize: 15 }}>
                <a href="tel:+33744772671" style={{ color: 'var(--text-primary)' }}>+33 7 44 77 26 71</a>
                <a href="mailto:elgun@codage.az" style={{ color: 'var(--accent-ice)' }}>elgun@codage.az</a>
              </div>
            </div>
          </div>
        </div>

        {/* Subtle topographic visual in the background */}
        <div aria-hidden="true" style={{
          position: 'absolute', right: -80, top: '50%', transform: 'translateY(-50%)',
          width: 600, height: 400, opacity: 0.18, pointerEvents: 'none',
        }}>
          <svg viewBox="0 0 600 400" style={{ width: '100%', height: '100%' }}>
            {Array.from({ length: 12 }).map((_, i) => {
              const r = 40 + i * 24;
              return <ellipse key={i} cx="300" cy="200" rx={r * 1.4} ry={r * 0.65} fill="none" stroke="rgba(168,197,232,0.4)" strokeWidth="0.6" />;
            })}
          </svg>
        </div>
      </section>
    </>
  );
}

/* ============================================
   LAB PAGE
   ============================================ */
function LabPageBody() {
  const posts = [
    { date: '2026-04-12', dateShort: '04.12', title: 'Tokenizing Azerbaijani: why off-the-shelf tokenizers waste 30% of your context window.', read: '8 min', tag: 'NLP' },
    { date: '2026-03-28', dateShort: '03.28', title: 'Building a multilingual RAG pipeline over forty years of seismic reports.', read: '12 min', tag: 'RAG' },
    { date: '2026-03-09', dateShort: '03.09', title: 'Liveness detection on low-bandwidth mobile networks: lessons from the field.', read: '6 min', tag: 'Vision' },
    { date: '2026-02-21', dateShort: '02.21', title: 'Why we re-architected our fraud detection agent around explanations, not predictions.', read: '10 min', tag: 'Fraud' },
    { date: '2026-02-04', dateShort: '02.04', title: 'What we learned shipping our first agent into production banking.', read: '14 min', tag: 'Production' },
    { date: '2026-01-19', dateShort: '01.19', title: 'Russian + Azerbaijani medical NER: a benchmark and what it taught us.', read: '9 min', tag: 'NLP' },
    { date: '2026-01-05', dateShort: '01.05', title: 'Sub-50ms LLM inference: the engineering behind real-time fraud explanations.', read: '11 min', tag: 'Inference' },
    { date: '2025-12-15', dateShort: '12.15', title: 'Glass, code, and the Caspian: notes on building Codage.', read: '7 min', tag: 'Lab' },
  ];

  return (
    <>
      <PageHeader
        eyebrow="LAB — NOTES FROM THE WORK"
        title={<>What we <em style={{ color: 'var(--accent-ice)', fontStyle: 'italic' }}>learn</em>, written down.</>}
        lead="Engineering notes, benchmarks, and post-mortems from shipping AI agents into regulated production. Not blog posts — work."
      />

      <section style={{ paddingTop: 40, paddingBottom: 160 }}>
        <div className="container">
          <div style={{ borderTop: '1px solid var(--border-glass)' }} />
          {posts.map((p, i) => (
            <a key={i} href="#" className="lab-row" style={{
              display: 'grid',
              gridTemplateColumns: '120px 80px 1fr 80px',
              gap: 32,
              alignItems: 'baseline',
              padding: '36px 0',
              borderBottom: '1px solid var(--border-glass)',
              transition: 'padding 400ms var(--ease-out-expo), background 400ms ease',
            }}
            onMouseOver={e => { e.currentTarget.style.paddingLeft = '12px'; }}
            onMouseOut={e => { e.currentTarget.style.paddingLeft = '0'; }}>
              <span style={{ fontFamily: 'var(--font-mono)', fontSize: 12, color: 'var(--text-tertiary)', textTransform: 'uppercase', letterSpacing: '0.1em' }}>{p.date}</span>
              <span className="chip" style={{ justifySelf: 'start' }}>{p.tag}</span>
              <h3 className="serif" style={{ fontSize: 'clamp(22px, 2.4vw, 32px)', letterSpacing: '-0.015em', lineHeight: 1.2, color: 'var(--text-primary)' }}>{p.title}</h3>
              <span style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--text-tertiary)', textAlign: 'right', textTransform: 'uppercase', letterSpacing: '0.1em' }}>{p.read}</span>
            </a>
          ))}
        </div>
      </section>
    </>
  );
}

/* ============================================
   CONTACT PAGE
   ============================================ */
function ContactPageBody() {
  const [form, setForm] = React.useState({ name: '', company: '', sector: '', message: '' });
  const [submitted, setSubmitted] = React.useState(false);
  const max = 280;
  const onSubmit = (e) => { e.preventDefault(); setSubmitted(true); };

  return (
    <>
      <PageHeader
        eyebrow="CONTACT"
        title={<>Book a 30-minute <em style={{ color: 'var(--accent-ice)', fontStyle: 'italic' }}>AI Workflow Audit.</em></>}
        lead="We review one of your workflows, estimate automation potential, and tell you whether an AI agent actually makes sense. No deck, no pitch — we either see a clear opportunity or we tell you it's not the right fit yet."
      />

      <section style={{ paddingTop: 40, paddingBottom: 160 }}>
        <div className="container">
          <div className="contact-grid" style={{ display: 'grid', gridTemplateColumns: '1.4fr 1fr', gap: 60, alignItems: 'start' }}>
            {/* Form */}
            <div className="glass" style={{ padding: 40, borderRadius: 20 }}>
              <div className="eyebrow" style={{ marginBottom: 20 }}>SEND US A NOTE</div>
              {submitted ? (
                <div style={{ padding: '40px 0' }}>
                  <h3 className="serif" style={{ fontSize: 36, letterSpacing: '-0.02em', lineHeight: 1.1, marginBottom: 16, color: 'var(--accent-ice)' }}>Thanks — we'll be in touch.</h3>
                  <p style={{ color: 'var(--text-secondary)' }}>Response within 24 hours on business days.</p>
                </div>
              ) : (
                <form onSubmit={onSubmit} style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
                  <ContactField label="Name" value={form.name} onChange={v => setForm(f => ({ ...f, name: v }))} />
                  <ContactField label="Company" value={form.company} onChange={v => setForm(f => ({ ...f, company: v }))} />
                  <div>
                    <label className="eyebrow" style={{ display: 'block', marginBottom: 10 }}>Sector</label>
                    <select value={form.sector} onChange={e => setForm(f => ({ ...f, sector: e.target.value }))}
                      style={{
                        width: '100%', padding: '14px 16px', fontSize: 16,
                        background: 'rgba(180,200,230,0.04)',
                        border: '1px solid var(--border-glass)',
                        borderRadius: 10,
                        color: 'var(--text-primary)',
                        fontFamily: 'var(--font-body)',
                        appearance: 'none',
                      }}>
                      <option value="">Select…</option>
                      <option>Banking</option>
                      <option>Fintech</option>
                      <option>Insurance</option>
                      <option>Oil & Gas</option>
                      <option>Energy</option>
                      <option>Other</option>
                    </select>
                  </div>
                  <div>
                    <label className="eyebrow" style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 10 }}>
                      <span>What are you trying to solve?</span>
                      <span style={{ color: form.message.length > max ? '#E8A8B5' : 'var(--text-tertiary)' }}>{form.message.length} / {max}</span>
                    </label>
                    <textarea value={form.message} onChange={e => setForm(f => ({ ...f, message: e.target.value.slice(0, max) }))}
                      rows={4}
                      style={{
                        width: '100%', padding: '14px 16px', fontSize: 16,
                        background: 'rgba(180,200,230,0.04)',
                        border: '1px solid var(--border-glass)',
                        borderRadius: 10,
                        color: 'var(--text-primary)',
                        fontFamily: 'var(--font-body)',
                        resize: 'vertical',
                        lineHeight: 1.5,
                      }} />
                  </div>
                  <button type="submit" className="btn btn-primary" style={{ alignSelf: 'flex-start', padding: '14px 28px' }}>
                    Send
                    <svg className="arrow-icon" width="14" height="14" viewBox="0 0 14 14" fill="none">
                      <path d="M2 7h10m0 0L7 2m5 5L7 12" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
                    </svg>
                  </button>
                </form>
              )}
            </div>

            {/* Direct */}
            <div style={{ display: 'flex', flexDirection: 'column', gap: 24 }}>
              <a href="https://calendar.app.google/an2mX8SWcKPFcvNK6" target="_blank" rel="noopener noreferrer" className="glass glass-interactive" style={{
                padding: 28, borderRadius: 16, display: 'block',
              }}>
                <div className="eyebrow" style={{ marginBottom: 16, color: 'var(--accent-ice)' }}>BOOK · 30 MIN</div>
                <h3 className="serif" style={{ fontSize: 26, letterSpacing: '-0.02em', lineHeight: 1.15, marginBottom: 12 }}>AI Workflow Audit.</h3>
                <p style={{ fontSize: 14, color: 'var(--text-secondary)', marginBottom: 12 }}>One workflow, walked through end-to-end. Honest assessment of automation potential — including when it's not the right fit yet.</p>
                <span style={{ fontFamily: 'var(--font-mono)', fontSize: 11, textTransform: 'uppercase', letterSpacing: '0.1em', color: 'var(--accent-ice)' }}>Open calendar →</span>
              </a>

              {[
                { city: 'BAKU', sub: 'Headquarters', phone: '+994 51 513 37 77', email: 'info@codage.az' },
                { city: 'PARIS', sub: 'Desk', phone: '+33 7 44 77 26 71', email: 'elgun@codage.az' },
                { city: 'FATULLA', sub: 'Engineering & infrastructure', phone: null, email: 'fatulla@codage.az' },
              ].map(l => (
                <div key={l.city} className="glass" style={{ padding: 24, borderRadius: 14 }}>
                  <div className="eyebrow" style={{ marginBottom: 6 }}>{l.city}</div>
                  <div style={{ fontFamily: 'var(--font-mono)', fontSize: 11, textTransform: 'uppercase', letterSpacing: '0.08em', color: 'var(--text-tertiary)', marginBottom: 14 }}>{l.sub}</div>
                  {l.phone && (
                    <a href={`tel:${l.phone.replace(/\s/g,'')}`} style={{ display: 'block', fontSize: 16, color: 'var(--text-primary)', marginBottom: 6 }}>{l.phone}</a>
                  )}
                  <a href={`mailto:${l.email}`} style={{ fontSize: 14, color: 'var(--accent-ice)', borderBottom: '1px solid var(--border-glass)' }}>{l.email}</a>
                </div>
              ))}
              <p style={{ fontSize: 13, color: 'var(--text-tertiary)', fontFamily: 'var(--font-mono)', textTransform: 'uppercase', letterSpacing: '0.1em' }}>Response within 24 hours on business days.</p>
            </div>
          </div>
        </div>
      </section>

      <FAQSection />
    </>
  );
}

function FAQSection() {
  const [open, setOpen] = React.useState(0);
  const faqs = [
    {
      q: 'Do you use OpenAI, open-source models, or custom models?',
      a: 'We choose per deployment based on the client\'s security, latency, language, and cost requirements. Closed frontier models for some workflows, fine-tuned open-weight models for others, and our own custom models where regional language quality matters.',
    },
    {
      q: 'Can you deploy on-premise?',
      a: 'Yes. For sensitive industries, we deploy in private cloud, on-premise, or fully air-gapped environments. We\'ve architected for each.',
    },
    {
      q: 'Do you support Azerbaijani and Russian documents?',
      a: 'Yes. This is one of our core advantages. We\'ve fine-tuned tokenizers and NER models specifically for Azerbaijani and Russian text in financial, medical, and technical domains.',
    },
    {
      q: 'Do you only build chatbots?',
      a: 'No. Most of our work is workflow automation, document intelligence, retrieval systems, and decision-support agents. Conversational interfaces are sometimes part of the solution but rarely the whole solution.',
    },
    {
      q: 'How long does a proof of concept take?',
      a: 'Typically 2–6 weeks depending on data access and system complexity. The first week is usually spent on data assessment and scope definition before any model work begins.',
    },
    {
      q: 'What happens after we book the workflow audit?',
      a: 'A 30-minute call where we walk through one of your workflows, identify automation potential, and give you our honest assessment. No deck, no pitch — we either see a clear AI opportunity or we tell you it\'s not the right fit yet.',
    },
  ];
  return (
    <section data-bg="elevated" style={{ paddingTop: 100, paddingBottom: 140 }}>
      <div className="container">
        <div className="section-hairline" style={{ marginBottom: 48, transform: 'scaleX(1)' }} />
        <div className="faq-head" style={{ display: 'grid', gridTemplateColumns: '1fr 1.6fr', gap: 64, marginBottom: 48 }}>
          <div>
            <div className="eyebrow" style={{ marginBottom: 16 }}>FAQ</div>
            <h2 className="serif" style={{ fontSize: 'clamp(36px, 4.5vw, 64px)', letterSpacing: '-0.025em', lineHeight: 1.0, margin: 0 }}>
              Six questions <em style={{ color: 'var(--accent-ice)', fontStyle: 'italic' }}>we get every week.</em>
            </h2>
          </div>
          <p style={{ fontSize: 17, lineHeight: 1.6, color: 'var(--text-secondary)', alignSelf: 'flex-end', maxWidth: 540, margin: 0 }}>
            If your question isn't here, ask it on the audit call — we'd rather answer something specific than something generic.
          </p>
        </div>

        <div className="faq-list">
          {faqs.map((f, i) => {
            const isOpen = open === i;
            return (
              <div key={i} className={`faq-row${isOpen ? ' is-open' : ''}`} style={{ borderBottom: i === faqs.length - 1 ? '1px solid var(--border-glass)' : 'none' }}>
                <button
                  onClick={() => setOpen(isOpen ? -1 : i)}
                  aria-expanded={isOpen}
                  style={{
                    display: 'grid',
                    gridTemplateColumns: '60px 1fr 32px',
                    gap: 24,
                    alignItems: 'baseline',
                    width: '100%',
                    padding: '28px 0',
                    textAlign: 'left',
                    fontFamily: 'inherit',
                    color: 'inherit',
                  }}
                >
                  <span style={{ fontFamily: 'var(--font-mono)', fontSize: 11, color: 'var(--text-tertiary)', letterSpacing: '0.12em' }}>0{i + 1}</span>
                  <h3 className="serif faq-q" style={{
                    fontSize: 'clamp(22px, 2.4vw, 30px)',
                    letterSpacing: '-0.015em',
                    lineHeight: 1.2,
                    margin: 0,
                  }}>{f.q}</h3>
                  <span style={{
                    width: 24,
                    height: 24,
                    border: '1px solid var(--border-glass)',
                    borderRadius: '50%',
                    display: 'inline-flex',
                    alignItems: 'center',
                    justifyContent: 'center',
                    color: 'var(--accent-ice)',
                    fontFamily: 'var(--font-mono)',
                    fontSize: 14,
                    transition: 'transform 300ms var(--ease-out-expo)',
                    transform: isOpen ? 'rotate(45deg)' : 'rotate(0)',
                    justifySelf: 'flex-end',
                  }}>+</span>
                </button>
                <div className="faq-body">
                  <div style={{
                    display: 'grid',
                    gridTemplateColumns: '60px 1fr 32px',
                    gap: 24,
                    paddingBottom: 32,
                  }}>
                    <span />
                    <p style={{ fontSize: 17, lineHeight: 1.6, color: 'var(--text-secondary)', maxWidth: 720, margin: 0 }}>{f.a}</p>
                  </div>
                </div>
              </div>
            );
          })}
        </div>
      </div>
    </section>
  );
}

function ContactField({ label, value, onChange }) {
  return (
    <div>
      <label className="eyebrow" style={{ display: 'block', marginBottom: 10 }}>{label}</label>
      <input type="text" value={value} onChange={e => onChange(e.target.value)}
        style={{
          width: '100%', padding: '14px 16px', fontSize: 16,
          background: 'rgba(180,200,230,0.04)',
          border: '1px solid var(--border-glass)',
          borderRadius: 10,
          color: 'var(--text-primary)',
          fontFamily: 'var(--font-body)',
        }} />
    </div>
  );
}

Object.assign(window, { AboutPageBody, LabPageBody, ContactPageBody, FounderCard });
