/* ==========================================================
   NewsNator — Page: Home / This week's digest
   ========================================================== */

function EventCard({ event, layout = 'wide' }) {
  const m = makerBySlug(event.makerSlug);
  const summary = (window.__lang === 'zh' && event.summaryZh) ? event.summaryZh : event.summary;
  const caption = (window.__lang === 'zh' && event.captionZh) ? event.captionZh : event.caption;
  const title = event.title;
  const compact = layout === 'compact';

  return (
    <article className="card card-hover" style={{padding: compact ? '20px' : '28px'}}>
      <header className="flex items-center gap-3" style={{marginBottom: 16}}>
        <Avatar maker={m} size={36}/>
        <div style={{display:'flex', flexDirection:'column', minWidth:0}}>
          <a href={`/makers/${m.slug}`} style={{fontWeight:600, fontSize:14, color:'var(--fg)'}}>
            {m.name}
            <span style={{marginLeft:6, color:'var(--fg-faint)', fontWeight:400}}>{m.flag}</span>
          </a>
          <div className="flex items-center gap-2 mono" style={{fontSize:11, color:'var(--fg-muted)', flexWrap:'wrap'}}>
            <span style={{whiteSpace:'nowrap'}}>@{m.handle}</span>
            <span style={{color:'var(--fg-faint)'}}>·</span>
            <span style={{whiteSpace:'nowrap'}}>{fmtRelative(event.published)}</span>
            <span style={{color:'var(--fg-faint)'}}>·</span>
            <SourceChip source={event.source}/>
          </div>
        </div>
        <div className="grow"/>
        <TypeChip type={event.type}/>
      </header>

      <h3 className="title-md" style={{marginBottom: 10, textWrap:'balance'}}>{title}</h3>

      <AISummary summary={summary} caption={caption} sourceUrl={event.sourceUrl}/>

      {event.tools.length > 0 && false && (
        <div className="mt-6" style={{borderTop:'1px solid var(--border-soft)', paddingTop:14}}>
          <div className="flex items-center gap-3" style={{flexWrap:'wrap'}}>
            <span className="mono faint" style={{fontSize:11, letterSpacing:'0.04em'}}>tools mentioned</span>
            <div className="flex items-center gap-2">
              {event.tools.map(d => (
                <a key={d} href={`/tools/${d}`} className="flex items-center gap-2" title={toolByDomain(d).name}
                   style={{padding:'2px 8px 2px 4px', borderRadius:999, border:'1px solid var(--border)', fontSize:11, color:'var(--fg-soft)'}}>
                  <ToolIcon domain={d} size={20}/>
                  <span className="mono">{toolByDomain(d).name}</span>
                </a>
              ))}
            </div>
          </div>
        </div>
      )}

      {event.numbers && Object.keys(event.numbers).length > 0 && (
        <div className="mt-4 flex items-center gap-6 mono" style={{fontSize:11, color:'var(--fg-muted)', flexWrap:'wrap'}}>
          {Object.entries(event.numbers).slice(0, 4).map(([k,v]) => (
            <span key={k} className="flex items-center gap-2">
              <span style={{color:'var(--fg-faint)'}}>{k.replace(/_/g, ' ')}</span>
              <span style={{color:'var(--fg)', fontWeight:600}}>
                {typeof v === 'number' && v > 1000 ? v.toLocaleString() : v}
              </span>
            </span>
          ))}
        </div>
      )}
    </article>
  );
}

// ----------------- Hero Metric -----------------
function MetricCard({ label, value, sub, accent }) {
  return (
    <div style={{
      padding:'24px',
      border:'1px solid var(--border)',
      borderRadius:'var(--r-md)',
      background: accent ? 'var(--accent-soft)' : 'var(--bg-elev)',
      borderColor: accent ? 'var(--accent)' : 'var(--border)',
    }}>
      <div className="eyebrow" style={{marginBottom:10, color: accent ? 'var(--accent)' : 'var(--fg-muted)'}}>{label}</div>
      <div className="num title-lg" style={{color: accent ? 'var(--accent)' : 'var(--fg)'}}>{value}</div>
      {sub && <div className="muted mono" style={{fontSize:12, marginTop:4}}>{sub}</div>}
    </div>
  );
}

// ----------------- Hero  -----------------
function HomeHero() {
  const isZh = window.__lang === 'zh';
  const summary = isZh ? THIS_WEEK.heroSummaryZh : THIS_WEEK.heroSummary;
  const range = isZh ? THIS_WEEK.dateRangeZh : THIS_WEEK.dateRange;
  const issueNum = parseInt(THIS_WEEK.yearWeek.split('-W')[1]);

  return (
    <section style={{padding:'56px 0 40px', borderBottom:'1px solid var(--border)'}}>
      <div className="container-narrow">
        {/* Letter masthead */}
        <div style={{display:'grid', gridTemplateColumns:'auto 1fr', gap:'8px 28px', alignItems:'baseline', padding:'0 0 28px', marginBottom:36, borderBottom:'1px dashed var(--border)', fontFamily:'var(--font-mono)', fontSize:12, color:'var(--fg-muted)'}}>
          <span className="faint" style={{letterSpacing:'0.06em'}}>FROM</span>
          <span style={{color:'var(--fg)'}}>opc.how digest &lt;digest@opc.how&gt;</span>
          <span className="faint" style={{letterSpacing:'0.06em'}}>DATE</span>
          <span style={{color:'var(--fg)'}}>{range} · {THIS_WEEK.yearWeek}</span>
          <span className="faint" style={{letterSpacing:'0.06em'}}>SUBJECT</span>
          <span style={{color:'var(--fg)', fontWeight:600}}>{isZh ? '本周 100 位独立创业者发生了什么' : 'What 100 indie builders did this week'}</span>
          <span className="faint" style={{letterSpacing:'0.06em'}}>ISSUE</span>
          <span style={{color:'var(--fg)'}}>#{String(issueNum).padStart(3, '0')} · 5 min read</span>
        </div>

        <h1 className="title-xxl" style={{maxWidth: '20ch', marginBottom: 24, fontSize:'clamp(36px, 5vw, 56px)'}}>
          {isZh ? '本周值得知道的事' : 'What\'s worth knowing this week'}
        </h1>
        <p className="lede" style={{maxWidth: '64ch', marginBottom: 24, fontSize:18}}>
          {summary}
        </p>
        <p className="mono" style={{margin:0, fontSize:12, color:'var(--fg-muted)', letterSpacing:'0.02em'}}>
          {isZh ? '— 你的 opc.how 编辑' : '— Your opc.how editor'}
        </p>
      </div>
    </section>
  );
}

// ----------------- Metric strip -----------------
function MetricStrip() {
  const M = THIS_WEEK.metrics;
  const topTool = toolByDomain(M.topTool);
  return (
    <section style={{padding:'0 0 64px'}}>
      <div className="container">
        <div style={{display:'grid', gridTemplateColumns:'repeat(4, 1fr)', gap:16}}>
          <MetricCard label={t('home_metric_events')} value={M.totalEvents}
                     sub="across 5 platforms"/>
          <MetricCard label={t('home_metric_mrr')} value={fmtMRR(M.mrrDisclosed)}
                     sub="combined, this week" accent/>
          <MetricCard label={t('home_metric_launches')} value={M.newLaunches}
                     sub="2 already past $1k MRR"/>
          <MetricCard label={t('home_metric_top_tool')} value={topTool.name}
                     sub={`${M.topToolMentions} mentions · +5 WoW`}/>
        </div>
      </div>
    </section>
  );
}

// ----------------- Trends row -----------------
function TrendStrip() {
  const isZh = window.__lang === 'zh';
  return (
    <section style={{padding:'56px 0 16px'}}>
      <div className="container-narrow">
        <div className="flex items-baseline gap-3 mb-6">
          <span className="num mono" style={{fontSize:11, fontWeight:600, color:'var(--accent)', letterSpacing:'0.08em'}}>§ 01</span>
          <h2 className="title-md" style={{flex:1}}>{t('home_trends_heading')}</h2>
          <span className="mono faint" style={{fontSize:11}}>{THIS_WEEK.trends.length} {isZh ? '个主题' : 'themes'}</span>
        </div>
        <div style={{display:'grid', gridTemplateColumns:'repeat(2, 1fr)', gap:14}}>
          {THIS_WEEK.trends.map(tr => {
            const name = isZh ? tr.nameZh : tr.name;
            return (
              <a key={tr.slug} href={`/trends/${tr.slug}`} className="card card-hover" style={{padding:'18px 20px', textDecoration:'none'}}>
                <div className="flex items-center gap-3 mb-3">
                  <div className="eyebrow" style={{fontSize:10}}>TREND</div>
                  <div className="grow"/>
                  <div className="mono num" style={{fontSize:13, color:'var(--accent)', fontWeight:600}}>{tr.score}</div>
                </div>
                <h3 className="title-sm" style={{marginBottom:10, textWrap:'balance', fontSize:15}}>{name}</h3>
                <div style={{height:4, background:'var(--bg-sunken)', borderRadius:2, overflow:'hidden', marginBottom:8}}>
                  <div style={{height:'100%', width: tr.score + '%', background:'var(--accent)'}}/>
                </div>
                <div className="mono faint" style={{fontSize:10}}>{tr.eventIds.length} {isZh ? '篇' : 'posts'} →</div>
              </a>
            );
          })}
        </div>
      </div>
    </section>
  );
}

// ----------------- Tool bubble wall -----------------
function ToolBubbleSection() {
  return (
    <section style={{padding:'0 0 64px'}}>
      <div className="container">
        <div className="section-head">
          <div className="section-head-left">
            <h2 className="title-lg">{t('home_tools_heading')}</h2>
            <span className="count">{t('home_tools_subhead', { n: THIS_WEEK.metrics.totalEvents })}</span>
          </div>
          <a href="/tools" className="btn btn-sm">{t('see_all')} →</a>
        </div>
        <div style={{padding:'40px 32px', border:'1px solid var(--border)', borderRadius:'var(--r-lg)', background:'var(--bg-elev)'}}>
          <BubbleWall items={TOOL_MENTIONS} onSelect={(d) => navigate('/tools/' + d)}/>
          <div className="hr-dashed mt-8 mb-4"/>
          <div className="flex items-center gap-6 mono" style={{fontSize:11, color:'var(--fg-muted)', flexWrap:'wrap'}}>
            <span className="flex items-center gap-2"><span style={{width:8,height:8,borderRadius:4,background:'var(--positive)'}}/>rising mentions</span>
            <span className="flex items-center gap-2"><span style={{width:8,height:8,borderRadius:4,background:'var(--negative)'}}/>falling</span>
            <span className="flex items-center gap-2"><span style={{width:8,height:8,borderRadius:4,background:'var(--fg-faint)'}}/>unchanged</span>
            <span className="grow"/>
            <span>size ∝ mentions · click to open the tool page</span>
          </div>
        </div>
      </div>
    </section>
  );
}

// ----------------- Maker activity grid -----------------
function MakerActivity() {
  const isZh = window.__lang === 'zh';
  const sorted = [...EVENTS].sort((a,b) => b.score - a.score);
  return (
    <section style={{padding:'56px 0 16px'}}>
      <div className="container-narrow">
        <div className="flex items-baseline gap-3 mb-6">
          <span className="num mono" style={{fontSize:11, fontWeight:600, color:'var(--accent)', letterSpacing:'0.08em'}}>§ 02</span>
          <h2 className="title-md" style={{flex:1}}>{t('home_makers_heading')}</h2>
          <span className="mono faint" style={{fontSize:11}}>{sorted.length} {isZh ? '条' : 'stories'}</span>
        </div>
        <div style={{display:'grid', gap:16}}>
          {sorted.map(ev => <EventCard key={ev.id} event={ev}/>)}
        </div>
      </div>
    </section>
  );
}

// ----------------- Archive row -----------------
function ArchiveStrip() {
  const isZh = window.__lang === 'zh';
  return (
    <section style={{padding:'40px 0 64px'}}>
      <div className="container-narrow">
        <div className="flex items-baseline gap-3 mb-6">
          <span className="num mono" style={{fontSize:11, fontWeight:600, color:'var(--accent)', letterSpacing:'0.08em'}}>§ 03</span>
          <h2 className="title-md" style={{flex:1}}>{t('home_archive_heading')}</h2>
          <a href="/archive" className="mono faint" style={{fontSize:11, textDecoration:'underline', textUnderlineOffset:2}}>{isZh ? '全部往期' : 'all issues'} →</a>
        </div>
        <div className="card" style={{padding:'4px 24px'}}>
          {ARCHIVE.slice(1, 6).map(issue => (
            <a key={issue.yearWeek} href={`/archive/${issue.yearWeek}`}
               className="row-line" style={{gridTemplateColumns:'90px 1fr 90px', textDecoration:'none', color:'var(--fg)', gap: 14}}>
              <span className="mono" style={{fontSize:12, color:'var(--fg-muted)'}}>{issue.yearWeek}</span>
              <span style={{fontWeight:500, fontSize:14}}>{issue.headline}</span>
              <span className="mono faint" style={{fontSize:11, textAlign:'right'}}>{issue.date}</span>
            </a>
          ))}
        </div>

        {/* Sign-off */}
        <div style={{marginTop:64, padding:'32px 0 8px', borderTop:'1px dashed var(--border)', fontFamily:'var(--font-mono)', fontSize:12, color:'var(--fg-muted)', lineHeight:1.8}}>
          <p style={{margin:'0 0 4px', color:'var(--fg)', fontWeight:500}}>{isZh ? '下周日见。' : 'See you next Sunday.'}</p>
          <p style={{margin:'0 0 18px'}}>— opc.how</p>
          <p style={{margin:0, fontSize:11}}>
            {isZh ? '回复邮件举报某位创业者 · ' : 'Reply to flag a builder · '}
            <a href="/opt-out" style={{color:'var(--fg)', textDecoration:'underline', textUnderlineOffset:2}}>{isZh ? '一键退订' : 'one-click unsubscribe'}</a>
            {' · '}
            <a href="/archive" style={{color:'var(--fg)', textDecoration:'underline', textUnderlineOffset:2}}>{isZh ? '往期归档' : 'past issues'}</a>
          </p>
        </div>
      </div>
    </section>
  );
}

// ----------------- Lessons-from-failure spotlight -----------------
function LessonsSection() {
  const isZh = window.__lang === 'zh';
  const lessonIds = ['e-010','e-008','e-009','e-012','e-011'];
  const lessons = lessonIds.map(id => EVENTS.find(e => e.id === id)).filter(Boolean);
  if (!lessons.length) return null;

  return (
    <section style={{padding:'0 0 64px'}}>
      <div className="container">
        <div className="section-head">
          <div className="section-head-left">
            <h2 className="title-lg">{isZh ? '失败功课' : 'Lessons from the field'}</h2>
            <span className="count">{lessons.length}</span>
          </div>
          <a href="/trends/lessons-from-failure" className="btn btn-sm">{isZh ? '完整专题' : 'The trend page'} →</a>
        </div>
        <p className="soft" style={{maxWidth:'60ch', marginBottom:24, fontSize:14, lineHeight:1.6, color:'var(--fg-soft)'}}>
          {isZh
            ? '本周 indie 圈最值得读的几篇 —— 都是创业者公开承认"哪里搞砸了、下次怎么改"。点开任何一条都能跳到原文。'
            : 'The most-shared honest retrospectives in indie SaaS this week — founders publicly naming what went wrong and what they\'re changing. Every card links to the original source.'}
        </p>
        <div style={{display:'grid', gridTemplateColumns:'1fr 1fr 1fr', gap:16}}>
          {lessons.map((ev, i) => <LessonCard key={ev.id} event={ev} highlight={i === 0}/>)}
        </div>
      </div>
    </section>
  );
}

function LessonCard({ event, highlight }) {
  const isZh = window.__lang === 'zh';
  const m = makerBySlug(event.makerSlug);
  const caption = isZh && event.captionZh ? event.captionZh : event.caption;
  const summary = isZh && event.summaryZh ? event.summaryZh : event.summary;
  const isCommunity = event.makerSlug === 'community';

  return (
    <a href={event.sourceUrl} target="_blank" rel="noopener"
       className="card card-hover"
       style={{
         padding:'24px 24px 20px',
         textDecoration:'none', color:'var(--fg)',
         display:'flex', flexDirection:'column',
         borderColor: highlight ? 'var(--fg)' : 'var(--border)',
         gridColumn: highlight ? 'span 2' : 'auto',
       }}>
      <div className="flex items-center gap-2 mb-4" style={{flexWrap:'wrap'}}>
        <span className="chip chip-negative" style={{fontSize:10}}>{isZh ? '复盘' : 'POST-MORTEM'}</span>
        <SourceChip source={event.source}/>
        <span className="grow"/>
        <span className="mono faint" style={{fontSize:10}}>{fmtRelative(event.published)}</span>
      </div>

      <h3 className="title-md" style={{marginBottom:14, fontSize: highlight ? 22 : 18, lineHeight:1.25, textWrap:'balance', color:'var(--fg)'}}>
        {event.title}
      </h3>

      {caption && (
        <p style={{margin:'0 0 14px', padding:'10px 14px', borderLeft:'2px solid var(--accent)', background:'var(--bg-sunken)', fontFamily:'var(--font-mono)', fontSize:13, lineHeight:1.4, color:'var(--fg)', borderRadius:'0 var(--r-sm) var(--r-sm) 0'}}>
          "{caption}"
        </p>
      )}

      {highlight && (
        <p className="soft" style={{margin:'0 0 16px', fontSize:13, lineHeight:1.6, color:'var(--fg-soft)', overflow:'hidden', display:'-webkit-box', WebkitLineClamp:4, WebkitBoxOrient:'vertical'}}>
          {summary}
        </p>
      )}

      <div className="flex items-center gap-3 mt-4" style={{paddingTop:14, borderTop:'1px solid var(--border-soft)', marginTop:'auto'}}>
        {!isCommunity && m ? <Avatar maker={m} size={28}/> : (
          <span style={{width:28, height:28, borderRadius:'50%', background:'var(--bg-sunken)', color:'var(--fg-muted)', display:'grid', placeItems:'center', fontFamily:'var(--font-mono)', fontSize:11, fontWeight:600}}>IH</span>
        )}
        <div style={{display:'flex', flexDirection:'column', minWidth:0, flex:1}}>
          <span style={{fontWeight:600, fontSize:13}}>{m ? m.name : 'Indie Hackers'}</span>
          <span className="mono faint" style={{fontSize:10}}>{new URL(event.sourceUrl).hostname.replace('www.','')}</span>
        </div>
        <span className="mono faint" style={{fontSize:14}}>↗</span>
      </div>
    </a>
  );
}

Object.assign(window, { LessonsSection, LessonCard });
function NewsletterSection() {
  const [email, setEmail] = useState('');
  const [done, setDone] = useState(false);

  const isZh = window.__lang === 'zh';
  const heading = isZh ? '每周日，所有动态一封信。' : 'Every Sunday. 100 builders. One inbox.';
  const sub = isZh
    ? '想追踪这 100 位独立创业者本周的全部动态？每周日 22:00 UTC，我们把 50+ 条事件压缩成一封 5 分钟可读完的 digest，直接发到你的邮箱。'
    : 'Want to follow what these 100 indie builders shipped, killed, and crossed this week? Every Sunday at 22:00 UTC we distill 50+ events into a 5-minute digest and drop it in your inbox.';
  const ctaPlaceholder = isZh ? '你的邮箱' : 'you@yourdomain.com';
  const ctaLabel       = isZh ? '订阅' : 'Subscribe';
  const proof          = isZh ? '已有 4,217 位独立创业者订阅' : 'Joined by 4,217 indie builders';
  const sample         = isZh ? '本期预览' : 'This week\'s preview';
  const free           = isZh ? '永久免费 · 一键退订' : 'Free forever · one-click unsubscribe';

  const previewLines = isZh ? [
    'Tibo 的 Revid.ai 突破 $465K MRR — Outrank 形成闭环',
    'Marc Lou 反思 14 个产品 — "应该做 3 个"',
    'Pieter Levels 把 Nomad List 迁到 Cloudflare — 月支出降 11×',
    '+ 4 条本周趋势 · 22 次 Anthropic 提及 · 6 个新发布',
  ] : [
    'Tibo\'s Revid.ai crosses $465K MRR — closes the loop with Outrank',
    'Marc Lou\'s 14-product reflection — "I\'d have done 3"',
    'Pieter Levels migrates Nomad List to Cloudflare — 11× cheaper',
    '+ 4 weekly trends · 22 Anthropic mentions · 6 new launches',
  ];

  const submit = (e) => {
    e.preventDefault();
    if (!email || !email.includes('@')) return;
    setDone(true);
  };

  return (
    <section style={{padding:'40px 0'}}>
      <div className="container-narrow">
        <div className="card" style={{
          padding:'0',
          overflow:'hidden',
          borderColor:'var(--fg)',
          boxShadow:'var(--shadow-md)',
        }}>
          <div style={{display:'grid', gridTemplateColumns:'1.1fr 0.9fr', minHeight: 360}}>
            {/* LEFT — pitch + form */}
            <div style={{padding:'40px 44px', display:'flex', flexDirection:'column'}}>
              <div className="eyebrow mb-4">
                <span style={{display:'inline-flex', alignItems:'center', gap:8}}>
                  <span style={{width:6, height:6, borderRadius:3, background:'var(--accent)', boxShadow:'0 0 0 3px var(--accent-soft)'}}/>
                  {isZh ? '每周日 · 22:00 UTC' : 'Sundays · 22:00 UTC'}
                </span>
              </div>

              <h2 className="title-xl" style={{marginBottom:18, fontSize:36, lineHeight:1.05, maxWidth:'18ch', textWrap:'balance'}}>
                {heading}
              </h2>

              <p className="soft" style={{margin:0, fontSize:14, lineHeight:1.6, maxWidth:'42ch', marginBottom:28}}>
                {sub}
              </p>

              {done ? (
                <div style={{padding:'16px 18px', border:'1px solid var(--positive)', background:'var(--positive-soft)', color:'var(--positive)', borderRadius:'var(--r-sm)', fontFamily:'var(--font-mono)', fontSize:13}}>
                  ✓ {isZh ? '已订阅。下周日见。' : 'You\'re in. See you Sunday.'}
                </div>
              ) : (
                <form onSubmit={submit} style={{display:'flex', gap:8, marginTop:'auto'}}>
                  <input
                    type="email"
                    required
                    value={email}
                    onChange={e => setEmail(e.target.value)}
                    placeholder={ctaPlaceholder}
                    style={{
                      flex:1,
                      padding:'12px 14px',
                      fontFamily:'var(--font-mono)',
                      fontSize:13,
                      color:'var(--fg)',
                      background:'var(--bg)',
                      border:'1px solid var(--border)',
                      borderRadius:'var(--r-sm)',
                      outline:'none',
                    }}
                  />
                  <button type="submit" className="btn btn-primary" style={{padding:'10px 18px'}}>{ctaLabel} →</button>
                </form>
              )}

              <div className="flex items-center gap-6 mt-4" style={{fontFamily:'var(--font-mono)', fontSize:11, color:'var(--fg-muted)', flexWrap:'wrap'}}>
                <span className="flex items-center gap-2">
                  <span style={{width:5, height:5, borderRadius:3, background:'var(--positive)'}}/>
                  {proof}
                </span>
                <span style={{color:'var(--fg-faint)'}}>·</span>
                <span>{free}</span>
              </div>
            </div>

            {/* RIGHT — issue preview (looks like an inbox card) */}
            <div style={{background:'var(--bg-sunken)', borderLeft:'1px solid var(--border)', padding:'32px 36px', display:'flex', flexDirection:'column'}}>
              <div className="flex items-center gap-3 mb-4" style={{paddingBottom:14, borderBottom:'1px dashed var(--border)'}}>
                <span style={{width:24, height:24, borderRadius:5, background:'var(--accent)', color:'#fff', display:'grid', placeItems:'center', fontFamily:'var(--font-mono)', fontWeight:700, fontSize:12}}>o</span>
                <span style={{display:'flex', flexDirection:'column'}}>
                  <span style={{fontWeight:600, fontSize:13}}>opc.how digest</span>
                  <span className="mono faint" style={{fontSize:10}}>digest@opc.how · {isZh ? '今天 22:00' : '· Today, 22:00 UTC'}</span>
                </span>
                <span className="grow"/>
                <span className="chip chip-accent" style={{fontSize:9}}>2026-W19</span>
              </div>

              <div className="eyebrow mb-3">{sample}</div>
              <ul style={{listStyle:'none', padding:0, margin:0, display:'flex', flexDirection:'column', gap:11, flex:1}}>
                {previewLines.map((line, i) => (
                  <li key={i} className="flex items-start gap-3" style={{fontSize:13, lineHeight:1.5}}>
                    <span style={{marginTop:7, width:5, height:5, borderRadius:3, background:'var(--accent)', flexShrink:0}}/>
                    <span style={{color:'var(--fg-soft)'}}>{line}</span>
                  </li>
                ))}
              </ul>

              <div className="mt-6" style={{paddingTop:14, borderTop:'1px dashed var(--border)', fontFamily:'var(--font-mono)', fontSize:10, color:'var(--fg-faint)', display:'flex', justifyContent:'space-between'}}>
                <span>Reply to flag a maker · ↩ takes you to the unsubscribe page</span>
                <span>1,847 words · 5 min read</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}
// ----------------- Home page entry -----------------
function HomePage() {
  return (
    <div className="page-enter">
      <HomeHero/>
      <NewsletterSection/>
      <TrendStrip/>
      <MakerActivity/>
      <ArchiveStrip/>
    </div>
  );
}

Object.assign(window, { EventCard, MetricCard, NewsletterSection, HomePage });
