// PROVE landing page + 3 hero variants.
// All exposed as separate React components used by prove-app.jsx.

const { useState: useState_L, useMemo: useMemo_L, useEffect: useEffect_L } = React;

// ─────────────────────────────────────────────────────────────────────────────
// NowLivePill — "Now live on iOS" brand pill (no numbers).
// ─────────────────────────────────────────────────────────────────────────────
function NowLivePill({ style }) {
  return (
    <div style={{
      display: 'inline-flex', alignItems: 'center', gap: 10,
      padding: '7px 14px',
      border: '1px solid rgba(255,255,255,0.18)',
      borderRadius: 999,
      fontSize: 11, letterSpacing: 0.1 + 'em',
      textTransform: 'uppercase', color: 'rgba(255,255,255,0.85)',
      fontWeight: 500,
      ...style,
    }}>
      <span style={{
        width: 8, height: 8, borderRadius: '50%', background: 'var(--coral)',
        animation: 'prove-pulse 1.6s ease-out infinite',
      }} />
      Now live on iOS
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// HERO VARIANT A — "Stadium"
// ─────────────────────────────────────────────────────────────────────────────
function HeroStadium({ headline, sub }) {
  return (
    <div style={{
      width: '100%', minHeight: 900, background: 'var(--bg)',
      position: 'relative', overflow: 'hidden',
      padding: '32px 72px 80px',
      display: 'flex', flexDirection: 'column',
    }}>
      <NavBar />

      {/* coral diagonal stripe */}
      <div style={{
        position: 'absolute', top: -50, right: -200, width: 700, height: 1200,
        background: 'var(--coral)',
        transform: 'rotate(15deg)', opacity: 0.94, zIndex: 0,
      }} />
      <div style={{
        position: 'absolute', top: -50, right: -200, width: 700, height: 1200,
        background: 'repeating-linear-gradient(45deg, transparent 0 24px, rgba(0,0,0,0.06) 24px 26px)',
        transform: 'rotate(15deg)', zIndex: 1,
      }} />

      <div style={{ flex: 1, display: 'flex', alignItems: 'center', position: 'relative', zIndex: 2, gap: 60 }}>
        <div style={{ flex: 1, maxWidth: 720 }}>
          <NowLivePill style={{ marginBottom: 32 }} />

          <h1 style={{
            fontFamily: 'var(--display)',
            fontSize: 'clamp(72px, 8vw, 132px)',
            fontWeight: 900, lineHeight: 0.88,
            letterSpacing: '-0.045em',
            color: '#fff', margin: 0,
            textTransform: 'uppercase', textWrap: 'balance',
          }}>
            {headline}
          </h1>

          <p style={{
            fontSize: 20, lineHeight: 1.5,
            color: 'rgba(255,255,255,0.7)',
            maxWidth: 580,
            marginTop: 32, marginBottom: 40,
          }}>{sub}</p>

          <div style={{ display: 'flex', gap: 16, alignItems: 'center', flexWrap: 'wrap' }}>
            <CTAButton primary size="lg" onClick={() => (window.location.hash = '/signup')}>Get started — Free</CTAButton>
            <CTAButton size="lg" onClick={() => (window.location.hash = '/login')}>Sign in</CTAButton>
          </div>
        </div>

        {/* floating phone with feed */}
        <div style={{
          position: 'relative', flexShrink: 0,
          transform: 'rotate(4deg) translateY(-20px)',
        }}>
          <PhoneMock width={280} height={580}>
            <FeedScreenPreview />
          </PhoneMock>
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// HERO VARIANT B — "Ticker"
// Pure typography focus. No live counters, no fake stats.
// ─────────────────────────────────────────────────────────────────────────────
function HeroTicker({ headline, sub }) {
  return (
    <div style={{
      width: '100%', minHeight: 900, background: 'var(--bg)',
      position: 'relative', overflow: 'hidden',
      padding: '32px 72px 80px',
      display: 'flex', flexDirection: 'column',
    }}>
      <NavBar />

      <div style={{
        position: 'absolute', inset: 0,
        backgroundImage: 'linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px)',
        backgroundSize: '80px 80px',
        maskImage: 'radial-gradient(ellipse at center, #000 30%, transparent 80%)',
        WebkitMaskImage: 'radial-gradient(ellipse at center, #000 30%, transparent 80%)',
      }} />

      <div style={{
        flex: 1, display: 'flex', flexDirection: 'column',
        alignItems: 'center', justifyContent: 'center',
        position: 'relative', zIndex: 2, textAlign: 'center',
      }}>
        <NowLivePill style={{ marginBottom: 36 }} />

        <h1 style={{
          fontFamily: 'var(--display)',
          fontSize: 'clamp(76px, 9vw, 160px)',
          fontWeight: 900, lineHeight: 0.84,
          letterSpacing: '-0.05em',
          color: '#fff', margin: 0,
          textTransform: 'uppercase',
          maxWidth: 1200, textWrap: 'balance',
        }}>
          {headline.split(' ').map((word, i, arr) => {
            const isLast = i === arr.length - 1;
            const isPenultimate = i === arr.length - 2;
            return (
              <React.Fragment key={i}>
                <span style={{
                  color: isLast || isPenultimate ? 'var(--coral)' : '#fff',
                  fontStyle: isLast ? 'italic' : 'normal',
                }}>{word}</span>
                {i < arr.length - 1 ? ' ' : ''}
              </React.Fragment>
            );
          })}
        </h1>

        <p style={{
          fontSize: 22, lineHeight: 1.5,
          color: 'rgba(255,255,255,0.7)',
          maxWidth: 680, marginTop: 36, marginBottom: 40,
        }}>{sub}</p>

        <div style={{ display: 'flex', gap: 16, alignItems: 'center', flexWrap: 'wrap', justifyContent: 'center' }}>
          <CTAButton primary size="lg" onClick={() => (window.location.hash = '/signup')}>Get started — Free</CTAButton>
          <CTAButton size="lg" onClick={() => (window.location.hash = '/login')}>Sign in</CTAButton>
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// HERO VARIANT C — "Mugshot"
// ─────────────────────────────────────────────────────────────────────────────
function HeroMugshot({ headline, sub }) {
  const D = window.PROVE_DATA;
  const tiles = D.proofs.slice(0, 12);

  return (
    <div style={{
      width: '100%', minHeight: 900, background: 'var(--bg)',
      position: 'relative', overflow: 'hidden',
      display: 'flex', flexDirection: 'column',
    }}>
      <div style={{
        position: 'absolute', inset: 0,
        display: 'grid',
        gridTemplateColumns: 'repeat(6, 1fr)',
        gridAutoRows: '1fr', gap: 4, padding: 4,
      }}>
        {tiles.map((p, i) => (
          <div key={p.id} style={{ position: 'relative', overflow: 'hidden' }}>
            <BlurTile hue={D.habits[p.habit].hue} seed={i + 3} aspect="1/1" />
          </div>
        ))}
      </div>

      <div style={{
        position: 'absolute', inset: 0,
        background: 'linear-gradient(180deg, rgba(13,13,13,0.4) 0%, rgba(13,13,13,0.85) 60%, var(--bg) 100%)',
      }} />

      <div style={{
        position: 'relative', zIndex: 2,
        padding: '32px 72px 80px',
        display: 'flex', flexDirection: 'column', flex: 1,
      }}>
        <NavBar />
        <div style={{ flex: 1, display: 'flex', alignItems: 'flex-end', paddingBottom: 40 }}>
          <div style={{ maxWidth: 920 }}>
            <NowLivePill style={{ marginBottom: 28 }} />
            <h1 style={{
              fontFamily: 'var(--display)',
              fontSize: 'clamp(80px, 9vw, 156px)',
              fontWeight: 900, lineHeight: 0.86,
              letterSpacing: '-0.05em', color: '#fff',
              margin: 0,
              textTransform: 'uppercase', textWrap: 'balance',
            }}>{headline}</h1>
            <p style={{
              fontSize: 22, lineHeight: 1.45,
              color: 'rgba(255,255,255,0.82)',
              maxWidth: 680, marginTop: 28, marginBottom: 36,
              borderLeft: '3px solid var(--coral)', paddingLeft: 20,
            }}>{sub}</p>
            <div style={{ display: 'flex', gap: 16, alignItems: 'center', flexWrap: 'wrap' }}>
              <CTAButton primary size="lg" onClick={() => (window.location.hash = '/signup')}>Get started — Free</CTAButton>
              <CTAButton size="lg" onClick={() => (window.location.hash = '/login')}>Sign in</CTAButton>
            </div>
          </div>
        </div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// NAV BAR with brand-anchor coral border + Day 1 pill
// ─────────────────────────────────────────────────────────────────────────────
function NavBar({ animated }) {
  return (
    <div style={{
      display: 'flex', alignItems: 'center', justifyContent: 'space-between',
      paddingBottom: 16, position: 'relative', zIndex: 3,
    }}>
      <div style={{
        display: 'flex', alignItems: 'center', gap: 12,
        animation: animated ? 'prove-fade-blur 0.4s ease-out 0.3s backwards' : 'none',
      }}>
        <ProveLogo size={20} color="#fff" />
        <Day1Pill />
      </div>
      <nav style={{ display: 'flex', gap: 32, fontSize: 14, color: 'rgba(255,255,255,0.7)' }}>
        {[
          { label: 'How it works', id: 'how-it-works' },
          { label: 'The Window',   id: 'prove-window' },
          { label: 'Stakes',       id: 'stakes' },
          { label: 'Manifesto',    id: 'manifesto' },
        ].map(({ label, id }, i) => (
          <a key={label}
            onClick={() => {
              const el = document.getElementById(id);
              if (el) el.scrollIntoView({ behavior: 'smooth', block: 'start' });
            }}
            style={{
            ...navLink,
            animation: animated ? `prove-fade-blur 0.3s ease-out ${500 + i * 80}ms backwards` : 'none',
          }}>{label}</a>
        ))}
      </nav>
      <div style={{ animation: animated ? 'prove-fade-blur 0.3s ease-out 0.85s backwards' : 'none' }}>
        <div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
          <CTAButton size="sm" onClick={() => (window.location.hash = '/login')}>Sign in</CTAButton>
          <MagneticButton><CTAButton size="sm" primary onClick={() => (window.location.hash = '/signup')}>Get started</CTAButton></MagneticButton>
        </div>
      </div>
    </div>
  );
}
const navLink = { color: 'inherit', textDecoration: 'none', cursor: 'pointer', fontWeight: 500 };

function Day1Pill() {
  return (
    <span style={{
      display: 'inline-flex', alignItems: 'center', gap: 6,
      padding: '3px 9px',
      background: 'rgba(255,97,85,0.12)',
      border: '1px solid rgba(255,97,85,0.4)',
      borderRadius: 999,
      fontSize: 10, fontWeight: 700,
      letterSpacing: 0.1 + 'em', textTransform: 'uppercase',
      color: 'var(--coral)',
      fontFamily: 'var(--mono)',
    }}>
      <span style={{ width: 5, height: 5, borderRadius: '50%', background: 'var(--coral)' }} />
      Day 1
    </span>
  );
}

function CTAButton({ children, primary, size = 'md', inverse, onClick }) {
  const sizes = {
    sm: { padding: '8px 14px', fontSize: 13 },
    md: { padding: '14px 22px', fontSize: 15 },
    lg: { padding: '18px 28px', fontSize: 17 },
  };
  let bg = 'transparent', color = '#fff', border = '1px solid rgba(255,255,255,0.25)';
  if (primary) { bg = 'var(--coral)'; color = '#0D0D0D'; border = '1px solid var(--coral)'; }
  if (inverse) { bg = '#0D0D0D'; color = '#fff'; border = '1px solid #0D0D0D'; }
  return (
    <button onClick={onClick} style={{
      ...sizes[size],
      background: bg, color, border,
      borderRadius: 999,
      fontWeight: 600,
      letterSpacing: '-0.005em',
      cursor: 'pointer',
      fontFamily: 'inherit',
      transition: 'transform 0.12s, filter 0.12s',
      whiteSpace: 'nowrap',
    }}
    onMouseEnter={(e) => { e.currentTarget.style.transform = 'translateY(-1px)'; e.currentTarget.style.filter = 'brightness(1.08)'; }}
    onMouseLeave={(e) => { e.currentTarget.style.transform = ''; e.currentTarget.style.filter = ''; }}
    >{children}</button>
  );
}

// Mini phone preview content used in HeroStadium
function FeedScreenPreview() {
  const D = window.PROVE_DATA;
  const proofs = D.proofs.slice(0, 3);
  return (
    <div style={{
      height: '100%', width: '100%',
      background: 'var(--bg)', color: '#fff',
      padding: '40px 12px 12px',
      display: 'flex', flexDirection: 'column', gap: 8,
      overflow: 'hidden',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '0 4px 8px' }}>
        <ProveLogo size={14} color="#fff" />
        <div style={{ display: 'flex', gap: 6 }}>
          <div style={{ width: 18, height: 18, borderRadius: 4, background: 'rgba(255,255,255,0.08)' }} />
          <div style={{ width: 18, height: 18, borderRadius: '50%', background: 'oklch(72% 0.10 30)' }} />
        </div>
      </div>
      <div style={{ display: 'flex', gap: 4, fontSize: 10, color: 'rgba(255,255,255,0.6)', marginBottom: 4 }}>
        <span style={{ color: '#fff', borderBottom: '1px solid var(--coral)', paddingBottom: 2 }}>Following</span>
        <span style={{ padding: '0 6px' }}>All</span>
        <span style={{ padding: '0 6px' }}>Trending</span>
      </div>
      {proofs.map((p, i) => {
        const u = D.byHandle[p.user];
        const h = D.habits[p.habit];
        return (
          <div key={p.id} style={{
            background: 'rgba(255,255,255,0.04)',
            border: '1px solid rgba(255,255,255,0.06)',
            borderRadius: 10, overflow: 'hidden',
            flex: i === 0 ? '1.2' : '1', display: 'flex', flexDirection: 'column',
          }}>
            <div style={{ position: 'relative', flex: 1, minHeight: 0 }}>
              <BlurTile hue={h.hue} seed={i + 7} aspect="auto" style={{ height: '100%', position: 'absolute', inset: 0, aspectRatio: 'auto' }} />
              <div style={{
                position: 'absolute', top: 6, left: 6,
                fontSize: 8, padding: '2px 6px', background: 'var(--coral)', color: '#0D0D0D',
                fontWeight: 700, letterSpacing: 0.06 + 'em', textTransform: 'uppercase',
              }}>{h.label}</div>
              <div style={{
                position: 'absolute', top: 6, right: 6,
                fontFamily: 'var(--mono)', fontSize: 9, color: '#fff',
                background: 'rgba(0,0,0,0.5)', padding: '2px 6px', borderRadius: 999,
              }}>day {p.day}</div>
            </div>
            <div style={{ display: 'flex', alignItems: 'center', gap: 6, padding: '6px 8px' }}>
              <div style={{ width: 14, height: 14, borderRadius: '50%', background: u.tone, fontSize: 8, color: '#000', display: 'flex', alignItems: 'center', justifyContent: 'center', fontWeight: 700 }}>{u.avatar}</div>
              <span style={{ fontSize: 10, color: '#fff' }}>{u.handle}</span>
            </div>
          </div>
        );
      })}
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION 2 — How it works
// ─────────────────────────────────────────────────────────────────────────────
function HowItWorks() {
  const steps = [
    { n: '01', title: 'Pick your habit', icon: 'calendar',
      body: 'One habit. One camera. That’s it. Lift, run, read, meditate, code, cook — whatever you’ve been saying you’d do. The first proof is always the hardest.' },
    { n: '02', title: 'Post video proof daily', icon: 'camera',
      body: 'Inside the PROVE Window. 6 AM to 11:59 PM. 60 seconds, raw, no edits. Your face. Your habit. On the record. Miss the window and your streak resets to zero. No appeals. No exceptions.' },
    { n: '03', title: 'Stake coins. Climb the streak.', icon: 'coin',
      body: 'Your community watches. They stake coins on whether you’ll show up tomorrow. Back you if they believe. Doubt you if they don’t. Every day you prove them right — or wrong. The longer your streak, the bigger the multiplier.' },
  ];
  return (
    <section id="how-it-works" style={{
      background: '#111111', color: '#fff',
      padding: '140px 72px',
      borderTop: '1px solid rgba(255,255,255,0.06)',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', marginBottom: 80 }}>
        <h2 style={{
          fontFamily: 'var(--display)', fontSize: 'clamp(56px, 6vw, 96px)', fontWeight: 900,
          lineHeight: 0.92, letterSpacing: '-0.045em', margin: 0,
          textTransform: 'uppercase', maxWidth: 880, textWrap: 'balance',
        }}>The loop is simple. <span style={{ color: 'var(--coral)', fontStyle: 'italic' }}>Doing it isn’t.</span></h2>
        <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.4)' }}>§ 01 / how it works</span>
      </div>

      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 24 }}>
        {steps.map((s) => (
          <div key={s.n} style={{
            border: '1px solid rgba(255,255,255,0.12)',
            background: 'linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%)',
            padding: '40px 36px', position: 'relative',
            minHeight: 320, display: 'flex', flexDirection: 'column',
            borderRadius: 8,
            transition: 'transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease',
          }}
          onMouseEnter={(e) => { e.currentTarget.style.transform = 'translateY(-4px)'; e.currentTarget.style.borderColor = 'rgba(255,97,85,0.4)'; e.currentTarget.style.boxShadow = '0 20px 60px rgba(255,97,85,0.08)'; }}
          onMouseLeave={(e) => { e.currentTarget.style.transform = ''; e.currentTarget.style.borderColor = 'rgba(255,255,255,0.12)'; e.currentTarget.style.boxShadow = ''; }}
          >
            <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start' }}>
              <span style={{
                fontFamily: 'var(--mono)', fontSize: 48, fontWeight: 700,
                color: 'var(--coral)', lineHeight: 1, letterSpacing: '-0.02em',
              }}>{s.n}</span>
              <StepIcon kind={s.icon} />
            </div>
            <h3 style={{
              fontFamily: 'var(--display)',
              fontSize: 28, fontWeight: 800, letterSpacing: '-0.025em',
              lineHeight: 1.05, margin: '72px 0 18px',
              textTransform: 'uppercase',
              textWrap: 'balance',
            }}>{s.title}</h3>
            <p style={{
              color: 'rgba(255,255,255,0.65)', fontSize: 15, lineHeight: 1.6,
              margin: 0,
            }}>{s.body}</p>
          </div>
        ))}
      </div>
    </section>
  );
}

function StepIcon({ kind }) {
  const sz = 36;
  if (kind === 'calendar') return (
    <svg width={sz} height={sz} viewBox="0 0 36 36" fill="none" stroke="var(--coral)" strokeWidth={1.6}>
      <rect x="4" y="7" width="28" height="25" rx="2" />
      <path d="M4 14 H32" />
      <path d="M11 4 V10 M25 4 V10" strokeLinecap="round" />
      <rect x="9" y="18" width="4" height="4" fill="var(--coral)" stroke="none" />
      <rect x="16" y="18" width="4" height="4" fill="var(--coral)" stroke="none" opacity="0.5" />
    </svg>
  );
  if (kind === 'camera') return (
    <svg width={sz} height={sz} viewBox="0 0 36 36" fill="none" stroke="var(--coral)" strokeWidth={1.6}>
      <rect x="3" y="9" width="30" height="20" rx="2" />
      <circle cx="18" cy="19" r="6" />
      <circle cx="18" cy="19" r="2.5" fill="var(--coral)" stroke="none" />
      <path d="M12 9 L14 5 H22 L24 9" />
    </svg>
  );
  if (kind === 'coin') return (
    <svg width={sz} height={sz} viewBox="0 0 36 36" fill="none" stroke="var(--coral)" strokeWidth={1.6}>
      <ellipse cx="18" cy="12" rx="11" ry="4" />
      <path d="M7 12 V20 C7 22.2 11.9 24 18 24 S29 22.2 29 20 V12" />
      <path d="M7 20 V28 C7 30.2 11.9 32 18 32 S29 30.2 29 28 V20" />
    </svg>
  );
  return null;
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION — MANIFESTO (replaces the old StatsBand)
// ─────────────────────────────────────────────────────────────────────────────
function ManifestoSection() {
  const lines = [
    'Your camera is your contract.',
    'Your streak is your reputation.',
    'Your backers are your conscience.',
  ];
  return (
    <section id="manifesto" style={{
      background: 'var(--bg)', color: '#fff',
      padding: '140px 72px',
      borderTop: '1px solid rgba(255,255,255,0.06)',
      position: 'relative', overflow: 'hidden',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', marginBottom: 56 }}>
        <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.4)' }}>§ 02 / manifesto</span>
        <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.3)' }}>read aloud · then post your proof</span>
      </div>

      <h2 style={{
        fontFamily: 'var(--display)',
        fontStyle: 'italic',
        fontSize: 'clamp(64px, 7vw, 112px)',
        fontWeight: 800, lineHeight: 0.96,
        letterSpacing: '-0.04em',
        margin: 0,
        maxWidth: 1280, textWrap: 'balance',
        color: '#fff',
      }}>
        Most people quit in private.<br/>
        PROVE makes you quit <span style={{ color: 'var(--coral)' }}>in public.</span>
      </h2>

      <div style={{
        marginTop: 72,
        padding: '36px 40px',
        background: 'rgba(255,97,85,0.03)',
        borderLeft: '2px solid var(--coral)',
        display: 'flex', flexDirection: 'column', gap: 12,
      }}>
        {lines.map((line, i) => (
          <div key={i} style={{
            display: 'flex', alignItems: 'baseline', gap: 28,
          }}>
            <MonoNum size={11} color="rgba(255,255,255,0.4)" weight={500} style={{
              minWidth: 32, letterSpacing: 0.12 + 'em', textTransform: 'uppercase',
            }}>0{i + 1}</MonoNum>
            <span style={{
              fontFamily: 'var(--display)',
              fontSize: 'clamp(20px, 1.8vw, 26px)',
              fontWeight: 800, letterSpacing: '-0.02em',
              lineHeight: 1.2,
              color: 'var(--coral)',
              textTransform: 'uppercase',
              flex: 1,
            }}>{line}</span>
          </div>
        ))}
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION 4 — Feed Preview (mosaic of 6 phones)
// Center phone glows coral.
// ─────────────────────────────────────────────────────────────────────────────
function FeedPreviewSection() {
  const D = window.PROVE_DATA;
  const phones = D.proofs.slice(0, 6);

  return (
    <section style={{
      background: 'var(--bg)', color: '#fff',
      padding: '120px 72px',
      borderTop: '1px solid rgba(255,255,255,0.06)',
      position: 'relative', overflow: 'hidden',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', marginBottom: 72 }}>
        <div style={{ maxWidth: 700 }}>
          <h2 style={{
            fontFamily: 'var(--display)', fontSize: 'clamp(48px, 5vw, 84px)',
            fontWeight: 800, letterSpacing: '-0.04em', margin: 0,
            textTransform: 'uppercase', lineHeight: 0.92,
          }}>Your habits.<br/><span style={{ color: 'var(--coral)', fontStyle: 'italic' }}>Witnessed.</span></h2>
          <p style={{ fontSize: 18, color: 'rgba(255,255,255,0.6)', marginTop: 24, maxWidth: 520 }}>
            Real people. Real proof. No filters, no edits, no "I’ll start Monday." Sixty seconds of video, posted inside the PROVE Window. Miss it, lose your streak.
          </p>
        </div>
        <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.4)' }}>§ 03 / the feed</span>
      </div>

      <div style={{
        display: 'grid', gridTemplateColumns: 'repeat(6, 1fr)',
        gap: 20, alignItems: 'center',
      }}>
        {phones.map((p, i) => {
          const u = D.byHandle[p.user];
          const h = D.habits[p.habit];
          const offset = (i % 2 === 0 ? 30 : -30);
          // The center two phones (i=2 and i=3) glow coral
          const isCenter = i === 2 || i === 3;
          return (
            <div key={p.id} style={{
              transform: `translateY(${offset}px) rotate(${(i % 2 === 0 ? -2 : 2)}deg)`,
              width: '100%',
              filter: isCenter ? 'drop-shadow(0 0 80px rgba(255,97,85,0.3))' : 'none',
            }}>
              <div style={{
                width: '100%', aspectRatio: '9/19',
                borderRadius: 18, padding: 4,
                background: 'linear-gradient(180deg, #2a2a2a, #0f0f0f)',
                boxShadow: '0 20px 40px rgba(0,0,0,0.5)',
                position: 'relative',
              }}>
                <div style={{
                  width: '100%', height: '100%',
                  borderRadius: 14, overflow: 'hidden',
                  background: 'var(--bg)', position: 'relative',
                }}>
                  <BlurTile hue={h.hue} seed={i + 11} aspect="auto" style={{ height: '100%', position: 'absolute', inset: 0, aspectRatio: 'auto' }} />
                  <div style={{ position: 'absolute', inset: 0, background: 'linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7))' }} />
                  <PlayOverlay size={32} />
                  <div style={{
                    position: 'absolute', top: 8, left: 8,
                    background: 'var(--coral)', color: '#0D0D0D',
                    fontSize: 8, fontWeight: 700, padding: '2px 6px',
                    letterSpacing: 0.06 + 'em', textTransform: 'uppercase',
                  }}>{h.label}</div>
                  <div style={{
                    position: 'absolute', top: 8, right: 8,
                    fontFamily: 'var(--mono)', fontSize: 8, color: '#fff',
                    background: 'rgba(0,0,0,0.6)', padding: '2px 5px',
                  }}>day {p.day}</div>
                  <div style={{
                    position: 'absolute', bottom: 8, left: 8, right: 8,
                    display: 'flex', alignItems: 'center', gap: 5,
                  }}>
                    <div style={{ width: 14, height: 14, borderRadius: '50%', background: u.tone, fontSize: 8, color: '#000', display: 'flex', alignItems: 'center', justifyContent: 'center', fontWeight: 700 }}>{u.avatar}</div>
                    <span style={{ fontSize: 9, color: '#fff' }}>{u.handle}</span>
                  </div>
                </div>
              </div>
            </div>
          );
        })}
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION — THE PROVE WINDOW (new)
// PROVE's most psychologically powerful mechanic.
// ─────────────────────────────────────────────────────────────────────────────
function PROVEWindowSection() {
  return (
    <section id="prove-window" style={{
      background: 'var(--bg)', color: '#fff',
      padding: '140px 72px',
      borderTop: '1px solid rgba(255,255,255,0.06)',
      position: 'relative', overflow: 'hidden',
    }}>
      {/* faint ring backdrop */}
      <div style={{
        position: 'absolute', top: '50%', left: '50%',
        width: 1400, height: 1400,
        transform: 'translate(-50%, -50%)',
        border: '1px solid rgba(255,255,255,0.04)', borderRadius: '50%',
        pointerEvents: 'none',
      }} />
      <div style={{
        position: 'absolute', top: '50%', left: '50%',
        width: 1000, height: 1000,
        transform: 'translate(-50%, -50%)',
        border: '1px solid rgba(255,255,255,0.04)', borderRadius: '50%',
        pointerEvents: 'none',
      }} />

      <div style={{
        maxWidth: 900, margin: '0 auto', textAlign: 'center', position: 'relative', zIndex: 2,
      }}>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 48 }}>
          <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.4)' }}>§ 04 / the prove window</span>
          <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.3)' }}>opens daily · local time</span>
        </div>

        <ClockSVG />

        <h2 style={{
          fontFamily: 'var(--display)',
          fontSize: 'clamp(56px, 6vw, 96px)',
          fontWeight: 800, lineHeight: 0.92,
          letterSpacing: '-0.04em',
          margin: '48px 0 24px',
          color: '#fff',
          textTransform: 'uppercase',
          textWrap: 'balance',
        }}>
          Every day. One window.<br/>
          <span style={{ color: 'var(--coral)', fontFamily: 'var(--mono)', fontWeight: 600, letterSpacing: '-0.03em' }}>
            6 AM – 11:59 PM.
          </span>
        </h2>

        <p style={{
          fontSize: 22, lineHeight: 1.5,
          color: 'rgba(255,255,255,0.7)',
          maxWidth: 680, margin: '0 auto',
        }}>
          Miss it and your streak resets to zero. No grace period. No excuses.
          <br/><span style={{ color: '#fff', fontWeight: 600 }}>This is the only rule that matters.</span>
        </p>
      </div>

      {/* consequence cards */}
      <div style={{
        display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16,
        marginTop: 80, maxWidth: 1200, marginLeft: 'auto', marginRight: 'auto',
      }}>
        <ConsequenceCard
          icon="post"
          headline="Post proof"
          body="Streak lives. Backers cheer."
          tone="positive"
        />
        <ConsequenceCard
          icon="miss"
          headline="Miss the window"
          body="Streak dies. Doubters collect."
          tone="neutral"
        />
        <ConsequenceCard
          icon="fake"
          headline="Fake it"
          body="Community flags it. Streak gone."
          tone="neutral"
        />
      </div>
    </section>
  );
}

function ClockSVG() {
  return <LiveClock size={220} />;
}

function ConsequenceCard({ icon, headline, body, tone }) {
  const isPositive = tone === 'positive';
  return (
    <div style={{
      border: '1px solid rgba(255,255,255,0.1)',
      background: isPositive ? 'rgba(255,97,85,0.04)' : 'rgba(255,255,255,0.02)',
      padding: 28,
      position: 'relative',
      minHeight: 220,
      display: 'flex', flexDirection: 'column',
    }}>
      <div style={{ marginBottom: 24 }}>
        <ConsequenceIcon kind={icon} />
      </div>
      <h3 style={{
        fontFamily: 'var(--display)',
        fontSize: 22, fontWeight: 700,
        letterSpacing: '-0.02em',
        color: isPositive ? 'var(--coral)' : '#fff',
        margin: 0, marginBottom: 8,
        textTransform: 'uppercase',
      }}>{headline}</h3>
      <p style={{
        fontSize: 16, lineHeight: 1.45,
        color: 'rgba(255,255,255,0.65)',
        margin: 0,
      }}>{body}</p>
    </div>
  );
}

function ConsequenceIcon({ kind }) {
  const c = 'var(--coral)';
  if (kind === 'post') return (
    <svg width="40" height="40" viewBox="0 0 40 40" fill="none" stroke={c} strokeWidth="1.5">
      <rect x="6" y="10" width="28" height="20" rx="2" />
      <circle cx="20" cy="20" r="6" />
      <path d="M16 4 L20 8 L24 4" strokeLinecap="round" strokeLinejoin="round" />
      <circle cx="20" cy="20" r="2.5" fill={c} stroke="none" />
    </svg>
  );
  if (kind === 'miss') return (
    <svg width="40" height="40" viewBox="0 0 40 40" fill="none" stroke="rgba(255,255,255,0.5)" strokeWidth="1.5">
      <circle cx="20" cy="20" r="14" />
      <line x1="20" y1="10" x2="20" y2="20" strokeLinecap="round" />
      <line x1="20" y1="20" x2="26" y2="22" strokeLinecap="round" />
      <line x1="34" y1="6" x2="6" y2="34" stroke={c} strokeWidth="2" strokeLinecap="round" />
    </svg>
  );
  if (kind === 'fake') return (
    <svg width="40" height="40" viewBox="0 0 40 40" fill="none" stroke="rgba(255,255,255,0.5)" strokeWidth="1.5">
      <path d="M20 4 L34 12 V22 C34 28 28 34 20 36 C12 34 6 28 6 22 V12 Z" />
      <line x1="14" y1="14" x2="26" y2="26" stroke={c} strokeWidth="2" strokeLinecap="round" />
      <line x1="26" y1="14" x2="14" y2="26" stroke={c} strokeWidth="2" strokeLinecap="round" />
    </svg>
  );
  return null;
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION — Stakes (split layout, tug-of-war demo)
// ─────────────────────────────────────────────────────────────────────────────
function StakesSection() {
  const [back, setBack] = useState_L(2840);
  const [doubt, setDoubt] = useState_L(410);

  return (
    <section id="stakes" style={{
      background: 'var(--bg)', color: '#fff',
      padding: '120px 72px',
      borderTop: '1px solid rgba(255,255,255,0.06)',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', marginBottom: 64 }}>
        <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.4)' }}>§ 05 / the stakes</span>
        <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.3)' }}>live demo</span>
      </div>

      {/* Tagline above demo */}
      <p style={{
        fontFamily: 'var(--display)',
        fontSize: 'clamp(28px, 3vw, 44px)',
        fontWeight: 700, letterSpacing: '-0.025em',
        color: 'rgba(255,255,255,0.9)',
        margin: '0 0 60px', maxWidth: 1000, lineHeight: 1.15,
        textWrap: 'balance',
      }}>
        When real coins are on the line,
        <span style={{ color: 'var(--coral)' }}> "I’ll start tomorrow" </span>
        stops making sense.
      </p>

      <div style={{
        display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 80,
        alignItems: 'center',
      }}>
        <div>
          <h2 style={{
            fontFamily: 'var(--display)', fontSize: 'clamp(48px, 5vw, 84px)',
            fontWeight: 800, letterSpacing: '-0.04em', margin: '0 0 28px',
            textTransform: 'uppercase', lineHeight: 0.92, textWrap: 'balance',
          }}>Back yourself. <span style={{ color: 'var(--coral)' }}>Doubt others.</span></h2>
          <p style={{ fontSize: 19, lineHeight: 1.55, color: 'rgba(255,255,255,0.7)', maxWidth: 480, marginBottom: 32 }}>
            Stake coins on every proof. Your back-and-doubt history builds your REP score. The longer the streak, the bigger the multiplier.
          </p>
          <ul style={{ listStyle: 'none', padding: 0, margin: '0 0 36px', display: 'flex', flexDirection: 'column', gap: 14 }}>
            {[
              'Free coins to start. Earn the rest by proving.',
              'No buying coins. No paying to win.',
              'Coins are bragging rights, not real money.',
            ].map((s, i) => (
              <li key={i} style={{ display: 'flex', gap: 14, alignItems: 'flex-start', fontSize: 15, color: 'rgba(255,255,255,0.85)' }}>
                <MonoNum size={13} color="var(--coral)">0{i + 1}</MonoNum>
                {s}
              </li>
            ))}
          </ul>
        </div>

        {/* right: interactive stake demo */}
        <div style={{
          border: '1px solid rgba(255,255,255,0.1)',
          background: 'rgba(255,255,255,0.02)',
          padding: 28, borderRadius: 4,
        }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 16 }}>
            <Avatar user={window.PROVE_DATA.byHandle['maya.k']} size={40} />
            <div style={{ flex: 1 }}>
              <div style={{ fontWeight: 600, fontSize: 14 }}>maya.k</div>
              <div style={{ fontSize: 12, color: 'rgba(255,255,255,0.5)' }}>front squat proof · 32 sec</div>
            </div>
            <HabitPill habit={window.PROVE_DATA.habits.lifting} dark />
          </div>
          <div style={{ position: 'relative', aspectRatio: '16/9', marginBottom: 24, borderRadius: 2, overflow: 'hidden' }}>
            <BlurTile hue={18} seed={2} aspect="auto" style={{ position: 'absolute', inset: 0, aspectRatio: 'auto' }} />
            <PlayOverlay size={56} />
            <div style={{
              position: 'absolute', top: 12, right: 12,
              fontFamily: 'var(--mono)', fontSize: 11, color: '#fff',
              background: 'rgba(0,0,0,0.5)', padding: '3px 8px',
            }}>day 47</div>
          </div>

          <div style={{
            fontSize: 11, letterSpacing: 0.1 + 'em', textTransform: 'uppercase',
            color: 'rgba(255,255,255,0.5)', marginBottom: 12,
          }}>Live stake split</div>
          <StakeBar back={back} doubt={doubt} height={44} />

          <div style={{ display: 'flex', gap: 12, marginTop: 20 }}>
            <StakeButton variant="back" onClick={() => setBack((b) => b + 50)}>
              Back +50
            </StakeButton>
            <StakeButton variant="doubt" onClick={() => setDoubt((d) => d + 50)}>
              Doubt +50
            </StakeButton>
          </div>
          <div style={{
            marginTop: 16,
            display: 'flex', flexDirection: 'column', gap: 6,
          }}>
            <div style={{
              padding: '10px 14px',
              background: 'rgba(255,97,85,0.08)',
              border: '1px solid rgba(255,97,85,0.2)',
              fontSize: 12, color: 'rgba(255,255,255,0.85)',
              fontFamily: 'var(--mono)',
            }}>
              → if she proves on day 47: she keeps her streak + backers earn from doubters
            </div>
            <div style={{
              padding: '10px 14px',
              background: 'rgba(255,255,255,0.04)',
              border: '1px solid rgba(255,255,255,0.1)',
              fontSize: 12, color: 'rgba(255,255,255,0.65)',
              fontFamily: 'var(--mono)',
            }}>
              → if she misses: doubters collect. streak resets. no exceptions.
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

function StakeButton({ variant, onClick, children }) {
  const isBack = variant === 'back';
  return (
    <button onClick={onClick} style={{
      flex: 1,
      padding: '14px 20px',
      background: isBack ? 'var(--coral)' : 'rgba(255,255,255,0.06)',
      color: isBack ? '#0D0D0D' : '#fff',
      border: isBack ? '1px solid var(--coral)' : '1px solid rgba(255,255,255,0.2)',
      borderRadius: 2,
      fontSize: 14, fontWeight: 700,
      letterSpacing: '0.04em',
      textTransform: 'uppercase',
      cursor: 'pointer',
      fontFamily: 'inherit',
      transition: 'all 0.12s',
    }}
    onMouseEnter={(e) => e.currentTarget.style.filter = 'brightness(1.1)'}
    onMouseLeave={(e) => e.currentTarget.style.filter = ''}
    >{children}</button>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION — PROVE vs the rest (comparison table)
// ─────────────────────────────────────────────────────────────────────────────
function ComparisonSection() {
  const cols = ['PROVE', 'Habit trackers', 'Accountability partners', 'Vision boards'];
  // entries: text per column. 'yes' / 'no' / 'sometimes'
  const rows = [
    ['Video proof required',         ['yes', 'no', 'no', 'no']],
    ['Real stakes on every post',    ['yes', 'no', 'no', 'no']],
    ['Public streak on the line',    ['yes', 'no', 'sometimes', 'no']],
    ['Community bets on you',        ['yes', 'no', 'no', 'no']],
    ['Daily hard deadline',          ['yes', 'no', 'no', 'no']],
    ['Works without willpower',      ['yes', 'no', 'no', 'no']],
  ];

  const Mark = ({ kind }) => {
    if (kind === 'yes') return (
      <svg width="22" height="22" viewBox="0 0 22 22" fill="none" stroke="#0D0D0D" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round">
        <path d="M5 11.5 L9 15.5 L17 6.5" />
      </svg>
    );
    if (kind === 'sometimes') return (
      <span style={{ fontFamily: 'var(--mono)', fontSize: 11, color: 'rgba(255,255,255,0.4)', letterSpacing: 0.04 + 'em' }}>
        sometimes
      </span>
    );
    return (
      <svg width="18" height="18" viewBox="0 0 18 18" fill="none" stroke="rgba(255,255,255,0.25)" strokeWidth="1.6" strokeLinecap="round">
        <line x1="4" y1="4" x2="14" y2="14" />
        <line x1="14" y1="4" x2="4" y2="14" />
      </svg>
    );
  };

  return (
    <section style={{
      background: 'var(--bg)', color: '#fff',
      padding: '120px 72px',
      borderTop: '1px solid rgba(255,255,255,0.06)',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', marginBottom: 56 }}>
        <div style={{ maxWidth: 880 }}>
          <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(255,255,255,0.4)' }}>§ 06 / vs the rest</span>
          <h2 style={{
            fontFamily: 'var(--display)',
            fontSize: 'clamp(40px, 4.4vw, 72px)',
            fontWeight: 800, letterSpacing: '-0.035em',
            margin: '18px 0 0',
            textTransform: 'uppercase', lineHeight: 0.94,
            textWrap: 'balance',
          }}>
            Why accountability apps fail —<br/>
            <span style={{ color: 'var(--coral)' }}>and why PROVE doesn’t.</span>
          </h2>
        </div>
      </div>

      <div style={{
        border: '1px solid rgba(255,255,255,0.1)',
        overflow: 'hidden',
      }}>
        {/* header row */}
        <div style={{
          display: 'grid',
          gridTemplateColumns: '2fr 1fr 1fr 1fr 1fr',
          alignItems: 'stretch',
        }}>
          <div style={{
            padding: '20px 24px',
            fontFamily: 'var(--mono)', fontSize: 11,
            letterSpacing: 0.1 + 'em', textTransform: 'uppercase',
            color: 'rgba(255,255,255,0.5)',
            borderRight: '1px solid rgba(255,255,255,0.08)',
            background: 'rgba(255,255,255,0.02)',
          }}>Feature</div>
          {cols.map((c, i) => {
            const isProve = i === 0;
            return (
              <div key={c} style={{
                padding: '20px 16px',
                fontFamily: 'var(--display)',
                fontSize: 15, fontWeight: 700,
                textTransform: 'uppercase',
                letterSpacing: '-0.01em',
                color: isProve ? '#0D0D0D' : 'rgba(255,255,255,0.65)',
                background: isProve ? 'var(--coral)' : 'rgba(255,255,255,0.02)',
                borderRight: i < cols.length - 1 ? '1px solid rgba(255,255,255,0.08)' : 'none',
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                textAlign: 'center',
              }}>{c}</div>
            );
          })}
        </div>

        {/* data rows */}
        {rows.map(([label, values], ri) => (
          <div key={label} style={{
            display: 'grid',
            gridTemplateColumns: '2fr 1fr 1fr 1fr 1fr',
            borderTop: '1px solid rgba(255,255,255,0.08)',
            alignItems: 'stretch',
          }}>
            <div style={{
              padding: '22px 24px',
              fontSize: 15,
              color: 'rgba(255,255,255,0.85)',
              fontWeight: 500,
              borderRight: '1px solid rgba(255,255,255,0.08)',
            }}>{label}</div>
            {values.map((v, ci) => {
              const isProve = ci === 0;
              return (
                <div key={ci} style={{
                  padding: '22px 24px',
                  display: 'flex', alignItems: 'center', justifyContent: 'center',
                  background: isProve ? 'var(--coral)' : 'transparent',
                  borderRight: ci < values.length - 1 ? '1px solid rgba(255,255,255,0.08)' : 'none',
                }}>
                  <Mark kind={v} />
                </div>
              );
            })}
          </div>
        ))}
      </div>
    </section>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION — Final CTA (replaces the email-form FoundingCTA)
// ─────────────────────────────────────────────────────────────────────────────
function FinalCTA() {
  return (
    <section style={{
      background: 'var(--coral)', color: '#0D0D0D',
      padding: '160px 72px',
      position: 'relative', overflow: 'hidden',
    }}>
      <div style={{
        position: 'absolute', top: -100, left: -100, right: -100, bottom: -100,
        backgroundImage: 'repeating-linear-gradient(-45deg, transparent 0 40px, rgba(0,0,0,0.04) 40px 42px)',
      }} />
      <div style={{ position: 'relative', zIndex: 2, maxWidth: 1100 }}>
        <span style={{ fontFamily: 'var(--mono)', fontSize: 13, color: 'rgba(0,0,0,0.6)' }}>§ 07 / the window opens</span>
        <h2 style={{
          fontFamily: 'var(--display)', fontSize: 'clamp(72px, 8.5vw, 160px)',
          fontWeight: 900, letterSpacing: '-0.05em', margin: '24px 0 28px',
          textTransform: 'uppercase', lineHeight: 0.84, textWrap: 'balance',
        }}>
          The window opens at 6 AM.<br/>
          Will you post?
        </h2>
        <p style={{
          fontSize: 22, lineHeight: 1.45,
          color: 'rgba(0,0,0,0.7)',
          maxWidth: 600, marginBottom: 44,
        }}>
          iOS + Android · Free to download · No credit card ever
        </p>

        <BigAppStoreButton />
      </div>
    </section>
  );
}

function BigAppStoreButton() {
  return (
    <ShimmerButton>
      <button style={{
        display: 'inline-flex', alignItems: 'center', gap: 16,
        padding: '20px 32px',
        background: '#0D0D0D', color: '#fff',
        border: 'none', borderRadius: 999,
        cursor: 'pointer', fontFamily: 'inherit',
        boxShadow: '0 8px 30px rgba(0,0,0,0.25)',
        transition: 'transform 0.12s',
        position: 'relative', zIndex: 1,
      }}
      onClick={() => (window.location.hash = '/signup')}
      onMouseEnter={(e) => e.currentTarget.style.transform = 'translateY(-2px)'}
      onMouseLeave={(e) => e.currentTarget.style.transform = ''}
      >
        <svg width="32" height="38" viewBox="0 0 26 32" fill="currentColor">
          <path d="M19.4 16.8c0-3.3 2.7-4.9 2.8-5-1.5-2.2-3.9-2.5-4.7-2.5-2-.2-3.9 1.2-4.9 1.2-1 0-2.6-1.2-4.2-1.1-2.2 0-4.2 1.3-5.3 3.2-2.3 3.9-.6 9.7 1.6 12.9 1.1 1.6 2.4 3.3 4 3.2 1.6-.1 2.2-1 4.2-1 1.9 0 2.5 1 4.2 1 1.7 0 2.9-1.6 3.9-3.1 1.2-1.8 1.7-3.6 1.8-3.7-.1 0-3.4-1.3-3.4-5.1zM16.3 7.3c.9-1 1.5-2.5 1.3-4-1.2.1-2.7.8-3.6 1.8-.8.9-1.5 2.4-1.3 3.9 1.4.1 2.7-.7 3.6-1.7z"/>
        </svg>
        <div style={{ textAlign: 'left', lineHeight: 1.1 }}>
          <div style={{ fontSize: 12, opacity: 0.7, marginBottom: 2 }}>Download on the</div>
          <div style={{ fontSize: 22, fontWeight: 700, letterSpacing: '-0.01em' }}>App Store</div>
        </div>
      </button>
    </ShimmerButton>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// SECTION — Footer
// ─────────────────────────────────────────────────────────────────────────────
function FooterSection() {
  return (
    <footer style={{
      background: 'var(--bg)', color: 'rgba(255,255,255,0.6)',
      padding: '60px 72px 40px',
      borderTop: '1px solid rgba(255,255,255,0.08)',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', flexWrap: 'wrap', gap: 40 }}>
        <div>
          <ProveLogo size={28} color="#fff" />
          <p style={{ fontSize: 16, maxWidth: 360, marginTop: 16, lineHeight: 1.5, color: 'rgba(255,255,255,0.75)' }}>
            Built for people tired of saying they will.
          </p>
        </div>
        <div style={{ display: 'flex', gap: 64, flexWrap: 'wrap' }}>
          {[
            { t: 'Product', l: ['Feed', 'The Window', 'Leaderboard', 'Manifesto'] },
            { t: 'Company', l: ['About', 'Press', 'Careers', 'Contact'] },
            { t: 'Legal',   l: ['Privacy', 'Terms', 'Trust & safety', 'Press'] },
          ].map((col) => (
            <div key={col.t}>
              <div style={{
                fontSize: 11, letterSpacing: 0.1 + 'em', textTransform: 'uppercase',
                color: 'rgba(255,255,255,0.4)', marginBottom: 14, fontFamily: 'var(--mono)',
              }}>{col.t}</div>
              <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 8 }}>
                {col.l.map((x) => <li key={x} style={{ fontSize: 14, cursor: 'pointer' }}>{x}</li>)}
              </ul>
            </div>
          ))}
        </div>
        <AppStoreBadge />
      </div>
      <div style={{
        marginTop: 60, paddingTop: 24,
        borderTop: '1px solid rgba(255,255,255,0.06)',
        display: 'flex', justifyContent: 'space-between',
        fontSize: 12, fontFamily: 'var(--mono)', color: 'rgba(255,255,255,0.4)',
      }}>
        <span>© 2026 PROVE Inc.</span>
        <span>The PROVE Window opens daily at your local 6:00 AM.</span>
      </div>
    </footer>
  );
}

function AppStoreBadge() {
  return (
    <div
      onClick={() => (window.location.hash = '/signup')}
      style={{
      border: '1px solid rgba(255,255,255,0.2)',
      padding: '10px 18px',
      display: 'flex', alignItems: 'center', gap: 12,
      borderRadius: 8, cursor: 'pointer', color: '#fff',
    }}>
      <svg width="26" height="32" viewBox="0 0 26 32" fill="currentColor">
        <path d="M19.4 16.8c0-3.3 2.7-4.9 2.8-5-1.5-2.2-3.9-2.5-4.7-2.5-2-.2-3.9 1.2-4.9 1.2-1 0-2.6-1.2-4.2-1.1-2.2 0-4.2 1.3-5.3 3.2-2.3 3.9-.6 9.7 1.6 12.9 1.1 1.6 2.4 3.3 4 3.2 1.6-.1 2.2-1 4.2-1 1.9 0 2.5 1 4.2 1 1.7 0 2.9-1.6 3.9-3.1 1.2-1.8 1.7-3.6 1.8-3.7-.1 0-3.4-1.3-3.4-5.1zM16.3 7.3c.9-1 1.5-2.5 1.3-4-1.2.1-2.7.8-3.6 1.8-.8.9-1.5 2.4-1.3 3.9 1.4.1 2.7-.7 3.6-1.7z"/>
      </svg>
      <div>
        <div style={{ fontSize: 10, opacity: 0.7 }}>Download on the</div>
        <div style={{ fontSize: 16, fontWeight: 600 }}>App Store</div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// CORAL TOP BORDER — brand anchor strip
// ─────────────────────────────────────────────────────────────────────────────
function CoralTopBorder() {
  return (
    <div style={{
      width: '100%', height: 3, background: 'var(--coral)',
    }} />
  );
}

// ─────────────────────────────────────────────────────────────────────────────
// Full landing flow
// ─────────────────────────────────────────────────────────────────────────────
function FullLanding({ heroVariant = 'stadium', headline, sub }) {
  const Hero = heroVariant === 'ticker' ? HeroTicker
    : heroVariant === 'mugshot' ? HeroMugshot
    : HeroStadium;
  const scrollRef = React.useRef(null);
  return (
    <div ref={scrollRef} style={{
      width: '100%', height: '100%',
      background: 'var(--bg)', color: '#fff',
      overflow: 'auto', position: 'relative',
    }}>
      <ScrollProgress container={scrollRef} />
      <div style={{
        position: 'absolute', top: 0, left: 0, right: 0, height: 3,
        background: 'var(--coral)',
        animation: 'prove-border-draw 0.4s ease-out 0.1s backwards',
        zIndex: 60,
      }} />
      <Hero headline={headline} sub={sub} />
      <MarqueeTicker items={['Post your proof', 'Stake on friends', 'Build your REP', 'Prove it daily']} />
      <ProblemSection />
      <ScienceSection />
      <HowItWorks />
      <DayInLifeSection />
      <ManifestoSection />
      <FeedPreviewSection />
      <PROVEWindowSection />
      <StakesSection />
      <REPDeepDive />
      <NoCheatingSection />
      <ComparisonSection />
      <HallOfStreaks />
      <LiveActivityStream />
      <FAQSection />
      <FinalCTAv2 />
      <FooterSectionV2 />
    </div>
  );
}

Object.assign(window, {
  HeroStadium, HeroTicker, HeroMugshot, FullLanding,
  HowItWorks, ManifestoSection, FeedPreviewSection, PROVEWindowSection,
  StakesSection, ComparisonSection, FinalCTA, FooterSection,
  NavBar, CTAButton, NowLivePill, Day1Pill, CoralTopBorder,
});
