// screens/info.jsx — About, How We Test, Editors, Careers, Press, Accessibility, Contact

const InfoScreen = ({ slug, onNavigate }) => {
  switch (slug) {
    case '/about':         return <AboutPage onNavigate={onNavigate} />;
    case '/how-we-test':   return <HowWeTestPage onNavigate={onNavigate} />;
    case '/editors':       return <EditorsPage onNavigate={onNavigate} />;
    case '/careers':       return <CareersPage onNavigate={onNavigate} />;
    case '/press':         return <PressPage onNavigate={onNavigate} />;
    case '/accessibility': return <AccessibilityPage onNavigate={onNavigate} />;
    case '/contact':       return <ContactPage onNavigate={onNavigate} />;
    case '/privacy':       return <SimpleInfoPage title="Privacy" eyebrow="Last updated May 2026" sections={PRIVACY} />;
    case '/terms':         return <SimpleInfoPage title="Terms of use" eyebrow="Last updated May 2026" sections={TERMS} />;
    default:               return <NotFoundPage slug={slug} onNavigate={onNavigate} />;
  }
};

/* --------------------------------------------------------------- */
const InfoHero = ({ eyebrow, title, sub, accent }) => (
  <section style={{ paddingTop: 'var(--s-10)', paddingBottom: 'var(--s-6)' }}>
    <div className="page" style={{ maxWidth: 920 }}>
      <span className="eyebrow" style={accent ? { color: 'var(--accent)' } : null}>{eyebrow}</span>
      <h1 className="display" style={{ fontSize: 'clamp(36px, 5vw, 64px)', margin: '12px 0 18px' }}>{title}</h1>
      {sub && (
        <p style={{ fontSize: 'clamp(16px, 1.4vw, 20px)', color: 'var(--ink-soft)', lineHeight: 1.55, maxWidth: 680, margin: 0 }}>
          {sub}
        </p>
      )}
    </div>
  </section>
);

const Crumb = ({ path, onNavigate }) => (
  <div className="page" style={{ paddingTop: 'var(--s-5)' }}>
    <nav style={{ fontSize: 12, color: 'var(--ink-mute)', fontFamily: 'var(--font-mono)' }}>
      <a href="#/" onClick={e=>{e.preventDefault(); onNavigate('/');}} style={{ color: 'inherit' }}>/</a>
      <span style={{ margin: '0 6px', opacity: .5 }}>/</span>
      <span style={{ color: 'var(--ink-soft)' }}>{path.replace(/^\//, '')}</span>
    </nav>
  </div>
);

/* --------------------------------------------------------------- About */
const AboutPage = ({ onNavigate }) => (
  <article>
    <Crumb path="/about" onNavigate={onNavigate} />
    <InfoHero eyebrow="About inspirecipe"
              title="The food site we wanted to read."
              sub="Inspirecipe started in 2024 with a stubborn premise: every recipe on the internet should actually work the first time you cook it. We test, we weigh, we photograph the real result, and we publish only what passes." />
    <section className="section" style={{ paddingTop: 0 }}>
      <div className="page" style={{ display: 'grid', gridTemplateColumns: '1fr 1.4fr', gap: 'var(--s-12)', alignItems: 'start' }} className="about-grid">
        <div style={{ position: 'sticky', top: 92 }}>
          <Photo tone="butter" label="our test kitchen" ratio="4/5" radius="var(--r-4)" />
        </div>
        <div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--s-6)' }}>
          {[
            { h: 'Why we exist', p: 'Most recipe sites optimize for pageviews. They bury the recipe under a thousand-word story, inflate the ad density, and accept that you’ll bounce after the third pop-up. We optimize for the opposite metric: did you cook it, and would you cook it again.' },
            { h: 'How we’re different', p: 'Every recipe has a real, named editor with public credentials. Every recipe is tested at least three times — twice by the editor, once by a separate tester in another kitchen. We publish the test notes. We update old recipes when we learn something. We won’t accept ads that interrupt the cooking flow.' },
            { h: 'Our writing rules', p: 'Headnotes are 60–90 words. Steps are short, plain, and assume you can read a thermometer. We don’t pretend a 60-minute recipe is a 30-minute recipe. We don’t fabricate ratings, reviews, or testimonials.' },
            { h: 'Who pays the bills', p: 'Subscriptions, a tiny number of vetted sponsors, and a small affiliate program for kitchen tools we actually use in the test kitchen. We will never gate a recipe behind a paywall.' },
          ].map((b, i) => (
            <div key={i}>
              <h2 className="display" style={{ fontSize: 24, margin: '0 0 8px' }}>{b.h}</h2>
              <p style={{ margin: 0, fontSize: 16, lineHeight: 1.7, color: 'var(--ink-soft)' }}>{b.p}</p>
            </div>
          ))}
          <div className="row" style={{ gap: 10, marginTop: 'var(--s-4)' }}>
            <button className="btn btn-primary" onClick={()=>onNavigate('/how-we-test')}>How we test <Icon name="arrowR" size={14} /></button>
            <button className="btn btn-ghost" onClick={()=>onNavigate('/editors')}>Meet the editors</button>
          </div>
        </div>
      </div>
      <style>{`@media(max-width:880px){ .about-grid { grid-template-columns: 1fr !important; } .about-grid > div:first-child { position: static !important; } }`}</style>
    </section>
  </article>
);

/* --------------------------------------------------------------- How we test */
const HowWeTestPage = ({ onNavigate }) => {
  const steps = [
    { n: '01', h: 'Editor develops',
      p: 'A named editor writes the first draft of the recipe in our test kitchen, weighing every ingredient, photographing each pass. They commit to the technique and the time estimate before testing begins.' },
    { n: '02', h: 'First cook',
      p: 'The editor cooks the recipe as written, end to end, without deviation. They time the active and passive minutes, photograph the result, and write the troubleshooting notes that survived the test.' },
    { n: '03', h: 'Second cook (variation)',
      p: 'The editor cooks the recipe again, intentionally varying one factor — a different brand of butter, a different oven, a different season of produce. We log what changed in the result and decide whether to surface it in the page.' },
    { n: '04', h: 'Independent test',
      p: 'A separate tester — different kitchen, different equipment, no contact with the editor — cooks the recipe as written. We compare both sets of photos and notes. If the result diverges, we go back to step 1.' },
    { n: '05', h: 'Final shoot',
      p: 'Photographs are unedited. We use natural light. The plate you see is the plate the editor ate. We do not stage with non-edible props.' },
    { n: '06', h: 'Publish',
      p: 'The recipe ships with the editor name, credentials, the test count, the test notes, and the publish date. From this point on, every reader-reported issue we can reproduce triggers a re-test.' },
    { n: '07', h: 'Update',
      p: 'Recipes age. When a substitution comes up that we want to surface, when a technique improves, when an ingredient is reformulated by manufacturers — we update the page and stamp the date. No silent edits.' },
  ];

  return (
    <article>
      <Crumb path="/how-we-test" onNavigate={onNavigate} />
      <InfoHero eyebrow="Editorial process · Seven passes"
                title="How we test."
                sub="Every recipe goes through seven passes before publication. The whole process takes 4–8 weeks per recipe. Here is exactly what happens." />
      <section className="section" style={{ paddingTop: 'var(--s-4)' }}>
        <div className="page" style={{ maxWidth: 880 }}>
          <ol style={{ listStyle: 'none', padding: 0, margin: 0 }}>
            {steps.map((s, i) => (
              <li key={i} style={{
                display: 'grid', gridTemplateColumns: '90px 1fr',
                gap: 'var(--s-6)', padding: 'var(--s-6) 0',
                borderTop: '1px solid var(--line)',
              }} className="hwt-row">
                <div className="display num" style={{ fontSize: 38, color: 'var(--accent)', lineHeight: 1 }}>{s.n}</div>
                <div>
                  <h2 className="display" style={{ fontSize: 24, margin: '0 0 8px' }}>{s.h}</h2>
                  <p style={{ margin: 0, fontSize: 16, color: 'var(--ink-soft)', lineHeight: 1.65 }}>{s.p}</p>
                </div>
              </li>
            ))}
          </ol>
        </div>
      </section>

      <section className="section" style={{ background: 'var(--bg-sunken)' }}>
        <div className="page" style={{ textAlign: 'center', maxWidth: 720, margin: '0 auto' }}>
          <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 'var(--s-6)' }} className="hwt-stats">
            {[
              { n: '3×',  l: 'Minimum cooks per recipe' },
              { n: '4–8', l: 'Weeks per recipe, dev to publish' },
              { n: '42',  l: 'Named editors worldwide' },
              { n: '0',   l: 'Fabricated reviews ever published' },
            ].map((s, i) => (
              <div key={i}>
                <div className="display num" style={{ fontSize: 'clamp(36px, 4vw, 56px)', color: 'var(--ink-strong)' }}>{s.n}</div>
                <div style={{ fontSize: 12, color: 'var(--ink-mute)', textTransform: 'uppercase', letterSpacing: '.06em', marginTop: 4 }}>{s.l}</div>
              </div>
            ))}
          </div>
        </div>
        <style>{`@media(max-width:680px){ .hwt-stats { grid-template-columns: 1fr 1fr !important; gap: var(--s-8) !important; } .hwt-row { grid-template-columns: 60px 1fr !important; gap: var(--s-4) !important; } }`}</style>
      </section>
    </article>
  );
};

/* --------------------------------------------------------------- Editors */
const EDITORS = [
  { name: 'Mira Chen',     role: 'Senior Recipe Editor',   region: 'New York', cred: 'ICE NYC · 12 yrs',         tone: 'butter', bio: 'Leads our baking and dessert program. Previously pastry chef at two NYC restaurants. Tested 412 recipes for inspirecipe to date.' },
  { name: 'Sofia Romano',  role: 'Pastry Lead',            region: 'Rome',     cred: 'Le Cordon Bleu · 9 yrs',    tone: 'cream',  bio: 'Italian and French pastry. Trained in Paris, runs our European test kitchen out of Rome. Writes our lamination and yeast bread guides.' },
  { name: 'Ji-ho Park',    role: 'Asia Editor',            region: 'Seoul',    cred: 'Seoul · 11 yrs',            tone: 'warm',   bio: 'Korean and broader East Asian cooking. Built our donburi, bibimbap and gochujang chicken recipes. Speaks Korean, Japanese, English.' },
  { name: 'Alex Bauer',    role: 'Technique Editor',       region: 'Berlin',   cred: 'Berlin · 14 yrs',           tone: 'herb',   bio: 'Heads our Methods section. Background in classical European cookery; obsessive about pan sauces and reverse-sear.' },
  { name: 'Dewi Pratama',  role: 'Indonesia Editor',       region: 'Jakarta',  cred: 'Jakarta · 8 yrs',           tone: 'warm',   bio: 'Indonesian and broader Southeast Asian cuisine. Maintains our nasi goreng, rendang, and sambal guides.' },
  { name: 'Akira Tanaka',  role: 'Japan Editor',           region: 'Tokyo',    cred: 'Tokyo · 10 yrs',            tone: 'sea',    bio: 'Japanese home cooking and donburi. Quietly the most rigorous tester on staff — averages five passes per recipe.' },
  { name: 'Camille Aubert', role: 'France Editor',         region: 'Lyon',     cred: 'Lyon · 13 yrs',             tone: 'butter', bio: 'French classics, viennoiserie, and our weekend brioche program. Anything butter-forward eventually ends up on her bench.' },
  { name: 'Han-na Kim',    role: 'Korea Editor',           region: 'Seoul',    cred: 'Seoul · 7 yrs',             tone: 'green',  bio: 'Banchan and fermented Korean foods. Built our kimchi, gochujang and ssam family of recipes from scratch.' },
];

const EditorsPage = ({ onNavigate }) => (
  <article>
    <Crumb path="/editors" onNavigate={onNavigate} />
    <InfoHero eyebrow="42 named editors worldwide"
              title="Our editors."
              sub="Every recipe on inspirecipe is written by a real, credentialed editor with a name, a track record, and a public bio. No content-farm aliases. Here is the core team." />
    <section className="section" style={{ paddingTop: 0 }}>
      <div className="page">
        <div style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: 14 }} className="editors-grid">
          {EDITORS.map(p => (
            <article key={p.name} className="card" style={{ overflow: 'hidden' }}>
              <Photo tone={p.tone} ratio="1/1" radius="0" label={`portrait · ${p.name.split(' ')[0]}`} />
              <div style={{ padding: 'var(--s-5)' }}>
                <h3 className="display" style={{ fontSize: 19, margin: '0 0 4px', color: 'var(--ink-strong)' }}>{p.name}</h3>
                <div style={{ fontSize: 13, color: 'var(--ink-soft)', marginBottom: 4 }}>{p.role} · {p.region}</div>
                <div style={{ fontSize: 11, color: 'var(--ink-mute)', fontFamily: 'var(--font-mono)', marginBottom: 12 }}>{p.cred}</div>
                <p style={{ margin: 0, fontSize: 13, color: 'var(--ink-soft)', lineHeight: 1.55 }}>{p.bio}</p>
              </div>
            </article>
          ))}
        </div>
        <style>{`@media(max-width:1000px){ .editors-grid{ grid-template-columns: repeat(3, 1fr) !important; } } @media(max-width:760px){ .editors-grid{ grid-template-columns: 1fr 1fr !important; } } @media(max-width:480px){ .editors-grid{ grid-template-columns: 1fr !important; } }`}</style>
      </div>
    </section>
  </article>
);

/* --------------------------------------------------------------- Careers */
const ROLES = [
  { title: 'Senior Recipe Editor, Baking',  team: 'Editorial',      location: 'New York or remote',   type: 'Full-time' },
  { title: 'Editor, Southeast Asian Cuisine', team: 'Editorial',    location: 'Jakarta or remote',    type: 'Full-time' },
  { title: 'Test Cook, Pastry',             team: 'Test Kitchen',   location: 'Rome',                  type: 'Full-time' },
  { title: 'Photo Director',                team: 'Visual',         location: 'New York',              type: 'Full-time' },
  { title: 'Senior Engineer, AI Search',    team: 'Engineering',    location: 'Remote (EU/US hours)',  type: 'Full-time' },
  { title: 'Localization Editor (id, ja, ko)', team: 'Editorial',   location: 'Remote',                type: 'Contract' },
];

const CareersPage = ({ onNavigate }) => (
  <article>
    <Crumb path="/careers" onNavigate={onNavigate} />
    <InfoHero eyebrow="We’re hiring" title="Work at inspirecipe."
              sub="Editors, test cooks, photographers, engineers, and localizers. We are remote-first with three physical test kitchens — New York, Rome, Jakarta — and we send everyone to one of them at least twice a year." />
    <section className="section" style={{ paddingTop: 'var(--s-4)' }}>
      <div className="page" style={{ maxWidth: 880 }}>
        <ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>
          {ROLES.map((r, i) => (
            <li key={i}>
              <a href="#" onClick={e=>e.preventDefault()} className="row between"
                 style={{
                   padding: 'var(--s-5) var(--s-2)', borderTop: '1px solid var(--line)',
                   textDecoration: 'none', color: 'inherit', gap: 'var(--s-4)',
                   transition: 'background .15s var(--ease)',
                 }}
                 onMouseEnter={e=>e.currentTarget.style.background='var(--bg-sunken)'}
                 onMouseLeave={e=>e.currentTarget.style.background='transparent'}>
                <div>
                  <div className="display" style={{ fontSize: 20, color: 'var(--ink-strong)' }}>{r.title}</div>
                  <div className="row" style={{ gap: 12, fontSize: 13, color: 'var(--ink-mute)', marginTop: 4 }}>
                    <span>{r.team}</span><span>·</span><span>{r.location}</span><span>·</span><span>{r.type}</span>
                  </div>
                </div>
                <span className="btn btn-ghost btn-sm">Apply <Icon name="arrowR" size={12} /></span>
              </a>
            </li>
          ))}
        </ul>
        <p style={{ marginTop: 'var(--s-8)', fontSize: 14, color: 'var(--ink-mute)' }}>
          Don’t see your role? Write to <a href="#" onClick={e=>e.preventDefault()} style={{ color: 'var(--accent)' }}>careers@inspirecipe.com</a>.
        </p>
      </div>
    </section>
  </article>
);

/* --------------------------------------------------------------- Press */
const PressPage = ({ onNavigate }) => (
  <article>
    <Crumb path="/press" onNavigate={onNavigate} />
    <InfoHero eyebrow="Press & media" title="Press."
              sub="Editorial coverage, awards, and assets. For interview requests, write to press@inspirecipe.com." />
    <section className="section" style={{ paddingTop: 0 }}>
      <div className="page">
        <div className="eyebrow" style={{ marginBottom: 14 }}>Mentioned in</div>
        <div style={{
          display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)', gap: 14,
          padding: 'var(--s-5) 0', borderTop: '1px solid var(--line)', borderBottom: '1px solid var(--line)',
          marginBottom: 'var(--s-10)',
        }} className="press-logos">
          {['Eater', 'The Infatuation', 'NYT Cooking', 'Bon Appétit', 'Saveur', 'TASTE'].map((p, i) => (
            <div key={i} style={{
              display: 'grid', placeItems: 'center', height: 60,
              fontFamily: 'var(--font-display)', fontSize: 17, color: 'var(--ink-mute)',
              letterSpacing: '.02em',
            }}>{p}</div>
          ))}
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 'var(--s-6)' }} className="press-quotes">
          {[
            { q: 'The recipe site we’ve been waiting a decade for. Tested, transparent, and mercifully short on preamble.', from: 'Eater, March 2026' },
            { q: 'A different model — one that respects readers, credits editors, and quietly does the work everyone else stopped doing.', from: 'TASTE, April 2026' },
          ].map((c, i) => (
            <blockquote key={i} className="card" style={{ padding: 'var(--s-6)', margin: 0 }}>
              <p className="display" style={{ fontSize: 22, lineHeight: 1.35, margin: '0 0 var(--s-4)', color: 'var(--ink-strong)' }}>
                &ldquo;{c.q}&rdquo;
              </p>
              <div style={{ fontSize: 13, color: 'var(--ink-mute)', fontFamily: 'var(--font-mono)' }}>{c.from}</div>
            </blockquote>
          ))}
        </div>
        <style>{`@media(max-width:880px){ .press-logos{ grid-template-columns: repeat(3, 1fr) !important; } .press-quotes{ grid-template-columns: 1fr !important; } }`}</style>
      </div>
    </section>
  </article>
);

/* --------------------------------------------------------------- Accessibility */
const AccessibilityPage = ({ onNavigate }) => (
  <article>
    <Crumb path="/accessibility" onNavigate={onNavigate} />
    <InfoHero eyebrow="Built for everyone, on every device"
              title="Accessibility."
              sub="Inspirecipe targets WCAG 2.2 AA across every page. We test against assistive tech monthly. Here is what that means in practice — and how to tell us when we miss." />
    <section className="section" style={{ paddingTop: 0 }}>
      <div className="page" style={{ maxWidth: 780 }}>
        {[
          { h: 'Keyboard navigation', p: 'Every interactive element is reachable and operable by keyboard. Focus rings are visible and high-contrast. Tab order follows the visual hierarchy.' },
          { h: 'Screen reader support', p: 'Semantic landmarks (header, nav, main, footer), heading hierarchy, ARIA labels on icon-only buttons, and live-region announcements for asynchronous content like the AI Sous-Chef.' },
          { h: 'Contrast & type', p: 'Body text targets 7:1 contrast, large text 4.5:1. Type size never drops below 14px on mobile or 15px on desktop. Users can resize text 200% without horizontal scrolling.' },
          { h: 'Cook Mode', p: 'Cook Mode uses extra-large type (minimum 32px on mobile), large tap targets (60px minimum), and screen-awake mode. It is designed to work with wet, floury hands at kitchen distance.' },
          { h: 'Motion', p: 'All non-essential motion respects prefers-reduced-motion. The hero scrubber, page transitions, and step-by-step animations all gracefully degrade.' },
        ].map((b, i) => (
          <div key={i} style={{ paddingBlock: 'var(--s-5)', borderTop: i ? '1px solid var(--line)' : 'none' }}>
            <h2 className="display" style={{ fontSize: 21, margin: '0 0 6px' }}>{b.h}</h2>
            <p style={{ margin: 0, color: 'var(--ink-soft)', lineHeight: 1.65 }}>{b.p}</p>
          </div>
        ))}
        <div className="card" style={{ marginTop: 'var(--s-6)', padding: 'var(--s-5)', background: 'var(--accent-tint)', borderColor: 'var(--accent-soft)' }}>
          <h3 className="display" style={{ fontSize: 19, margin: '0 0 6px' }}>Tell us when we miss</h3>
          <p style={{ margin: 0, fontSize: 15, color: 'var(--ink)' }}>
            Email <a href="#" onClick={e=>e.preventDefault()} style={{ color: 'var(--accent)', fontWeight: 600 }}>access@inspirecipe.com</a> with the page and the issue. We aim to acknowledge within 2 business days and ship a fix within 14.
          </p>
        </div>
      </div>
    </section>
  </article>
);

/* --------------------------------------------------------------- Contact */
const ContactPage = ({ onNavigate }) => {
  const [name, setName] = useState('');
  const [email, setEmail] = useState('');
  const [topic, setTopic] = useState('General');
  const [msg, setMsg] = useState('');
  const [sent, setSent] = useState(false);

  return (
    <article>
      <Crumb path="/contact" onNavigate={onNavigate} />
      <InfoHero eyebrow="Get in touch" title="Contact us."
                sub="Real humans read every message. We typically reply within 1 business day." />
      <section className="section" style={{ paddingTop: 'var(--s-4)' }}>
        <div className="page" style={{ display: 'grid', gridTemplateColumns: '1fr 1.4fr', gap: 'var(--s-12)' }} className="contact-grid">
          <aside>
            {[
              { h: 'Editorial', e: 'editors@inspirecipe.com', d: 'Recipe questions, corrections, suggestions.' },
              { h: 'Press', e: 'press@inspirecipe.com', d: 'Interviews, quotes, media assets.' },
              { h: 'Partnerships', e: 'partners@inspirecipe.com', d: 'Sponsorships and brand collaborations.' },
              { h: 'Accessibility', e: 'access@inspirecipe.com', d: 'Accessibility issues, AT compatibility.' },
              { h: 'Careers', e: 'careers@inspirecipe.com', d: 'Open roles and general applications.' },
            ].map((c, i) => (
              <div key={i} style={{ paddingBlock: 'var(--s-4)', borderTop: '1px solid var(--line)' }}>
                <div className="eyebrow" style={{ marginBottom: 4 }}>{c.h}</div>
                <div style={{ fontSize: 14, color: 'var(--accent)', fontWeight: 600, fontFamily: 'var(--font-mono)' }}>{c.e}</div>
                <div style={{ fontSize: 13, color: 'var(--ink-soft)', marginTop: 4 }}>{c.d}</div>
              </div>
            ))}
          </aside>

          <form className="card" style={{ padding: 'var(--s-6)' }}
                onSubmit={e=>{e.preventDefault(); if (name && email && msg) setSent(true);}}>
            {!sent ? (
              <>
                <h2 className="display" style={{ fontSize: 26, margin: '0 0 var(--s-5)' }}>Send a message</h2>
                <div style={{ display: 'grid', gap: 14 }}>
                  <Field label="Your name" value={name} onChange={setName} />
                  <Field label="Email" value={email} onChange={setEmail} type="email" />
                  <div>
                    <label style={{ display: 'block', fontSize: 12, color: 'var(--ink-soft)', marginBottom: 6, fontWeight: 600, letterSpacing: '.02em' }}>Topic</label>
                    <div className="row wrap" style={{ gap: 6 }}>
                      {['General', 'Editorial', 'Press', 'Partnerships', 'Accessibility'].map(t => (
                        <button type="button" key={t} onClick={()=>setTopic(t)}
                                className={`chip ${topic === t ? 'is-active' : 'chip-outline'}`}
                                style={{ cursor: 'pointer' }}>{t}</button>
                      ))}
                    </div>
                  </div>
                  <Field label="Message" value={msg} onChange={setMsg} multiline />
                  <button type="submit" className="btn btn-primary btn-lg" style={{ alignSelf: 'flex-start', marginTop: 4 }}>
                    Send message <Icon name="arrowR" size={14} />
                  </button>
                </div>
              </>
            ) : (
              <div style={{ textAlign: 'center', padding: 'var(--s-8) 0' }}>
                <div style={{
                  width: 56, height: 56, borderRadius: 999, margin: '0 auto var(--s-4)',
                  background: 'var(--accent)', color: 'var(--accent-ink)',
                  display: 'grid', placeItems: 'center',
                }}><Icon name="check" size={26} stroke={2.5} /></div>
                <h2 className="display" style={{ fontSize: 24, margin: '0 0 8px' }}>Message received.</h2>
                <p style={{ color: 'var(--ink-soft)', fontSize: 15, margin: 0 }}>We’ll reply within 1 business day.</p>
              </div>
            )}
          </form>
        </div>
        <style>{`@media(max-width:880px){ .contact-grid{ grid-template-columns: 1fr !important; } }`}</style>
      </section>
    </article>
  );
};

const Field = ({ label, value, onChange, type = 'text', multiline = false }) => (
  <div>
    <label style={{ display: 'block', fontSize: 12, color: 'var(--ink-soft)', marginBottom: 6, fontWeight: 600, letterSpacing: '.02em' }}>{label}</label>
    {multiline ? (
      <textarea value={value} onChange={e=>onChange(e.target.value)} rows={6}
                style={inputStyle()} />
    ) : (
      <input type={type} value={value} onChange={e=>onChange(e.target.value)} style={inputStyle()} />
    )}
  </div>
);
const inputStyle = () => ({
  width: '100%', font: 'inherit', fontSize: 15,
  padding: '10px 14px', borderRadius: 'var(--r-2)',
  border: '1px solid var(--line-strong)',
  background: 'var(--bg)', color: 'var(--ink)',
  outline: 'none', resize: 'vertical',
});

/* --------------------------------------------------------------- Simple legal */
const PRIVACY = [
  { h: 'What we collect', p: 'Account email (if you subscribe), saved-recipe IDs in your local browser, and aggregate page analytics that do not identify individuals. We never sell user data.' },
  { h: 'Cookies', p: 'A single first-party session cookie for sign-in. No third-party tracking cookies. No advertising IDs.' },
  { h: 'Your rights', p: 'Request a copy of your data, ask for deletion, or unsubscribe at any time. Email privacy@inspirecipe.com — we respond in 7 days.' },
];
const TERMS = [
  { h: 'Use of recipes', p: 'You may cook our recipes, print them, share a link with friends, and quote up to 50 words. Wholesale republication requires written permission.' },
  { h: 'Account', p: 'You are responsible for keeping your sign-in credentials secret. Tell us if you suspect an account has been compromised.' },
  { h: 'Liability', p: 'We test rigorously but kitchens vary. Always use safe food-handling practices and adjust to your equipment.' },
];
const SimpleInfoPage = ({ title, eyebrow, sections }) => (
  <article>
    <InfoHero eyebrow={eyebrow} title={title} />
    <section className="section" style={{ paddingTop: 0 }}>
      <div className="page" style={{ maxWidth: 720 }}>
        {sections.map((s, i) => (
          <div key={i} style={{ paddingBlock: 'var(--s-5)', borderTop: i ? '1px solid var(--line)' : 'none' }}>
            <h2 className="display" style={{ fontSize: 21, margin: '0 0 6px' }}>{s.h}</h2>
            <p style={{ margin: 0, color: 'var(--ink-soft)', lineHeight: 1.65 }}>{s.p}</p>
          </div>
        ))}
      </div>
    </section>
  </article>
);

/* --------------------------------------------------------------- Not found */
const NotFoundPage = ({ slug, onNavigate }) => (
  <article>
    <section className="section" style={{ paddingTop: 'var(--s-16)', textAlign: 'center' }}>
      <div className="page" style={{ maxWidth: 560 }}>
        <span className="eyebrow" style={{ color: 'var(--accent)' }}>404</span>
        <h1 className="display" style={{ fontSize: 'clamp(36px, 5vw, 56px)', margin: '12px 0 14px' }}>This page isn’t cooked yet.</h1>
        <p style={{ color: 'var(--ink-soft)', fontSize: 16, marginBottom: 'var(--s-6)' }}>
          The route <code style={{ fontFamily: 'var(--font-mono)', background: 'var(--bg-sunken)', padding: '2px 6px', borderRadius: 4 }}>{slug}</code> doesn’t exist (yet). Try the homepage or browse all recipes.
        </p>
        <div className="row center" style={{ gap: 10 }}>
          <button className="btn btn-primary" onClick={()=>onNavigate('/')}>Go home</button>
          <button className="btn btn-ghost" onClick={()=>onNavigate('/recipes')}>All recipes</button>
        </div>
      </div>
    </section>
  </article>
);

Object.assign(window, { InfoScreen });
