/* ============================================================
   Asher Encounters — Homepage
   Hero · Three Programs · AI Insights · Primary CTA · Newsletter
   ============================================================ */
(function () {
  const DS = window.AsherEncountersDesignSystem_12251c;
  const { Tag, Eyebrow, Card, Button } = DS;
  const A = window.Asher;
  const { Reveal, SectionHeader, ImageFrame, ArticleCard, NewsletterForm, BookButton, Nav, Footer, BookingModal, FloatingBook } = A;
  const R = React;

  const PROGRAMS = [
    { code: 'capital', href: 'program-capital-conviction.html', icon: 'landmark', theme: 'violet', img: A.img('1497366811353-6870744d04b2'),
      status: 'Coming Soon', statusVariant: 'outline',
      name: 'Capital & Conviction', sub: 'Silicon Valley AI Investor Tour', bookProgram: 'Capital & Conviction — AI Investor Tour',
      strengths: ['Closed-door VC & founder access', 'Capped cohort of vetted allocators', '1:1 matchmaking to your thesis'],
      desc: 'A 10-day private immersion for fund managers, family offices, and capital allocators. Closed-door access to Sand Hill Road, frontier AI labs, and the founders shaping the next decade — built for the people deploying serious capital into AI.' },
    { code: 'frontier', href: 'program-ai-frontier.html', icon: 'cpu', theme: 'ink', img: A.img('1522071820081-009f0129c71c'),
      status: 'October 2026 · Booking Now', statusVariant: 'honey',
      name: 'AI Frontier', sub: 'Inside Silicon Valley', bookProgram: 'AI Frontier — Inside Silicon Valley',
      strengths: ['The anchor AI conference, fully curated', 'Business & technical tracks, every background', 'Private company visits + faculty workshops'],
      desc: 'A 7-day curated immersion into the heart of Silicon Valley’s AI ecosystem — private company visits, university workshops, capital matchmaking, and a Napa Valley finale. The first cohort anchors on a major AI conference in October 2026. Designed for founders, transformation executives, and tech leaders.' },
    { code: 'compass', href: 'program-compass.html', icon: 'compass', theme: 'warm', img: A.img('1562774053-701939374585'),
      status: 'Jan–Mar 2027 · Early Registration Open', statusVariant: 'solid',
      name: 'Compass', sub: 'College & Career Strategy Camp', bookProgram: 'Compass — College & Career Strategy Camp',
      strengths: ['Stanford & Berkeley, explored deeply', 'Former admissions-officer strategy', 'A real Silicon Valley life preview'],
      desc: 'A 7-day founder-led program for international families with students applying to US universities. Deep, dual-perspective exploration of Stanford, UC Berkeley, and select campuses — plus admissions strategy, Silicon Valley career pathways, and a real “life preview” of the Bay Area.' },
  ];

  const INSIGHTS = [
    { date: 'Jun 5, 2026', title: 'Where Sand Hill is writing AI checks in H2 2026', excerpt: 'Our read on how the Valley’s leading funds are deploying into AI this half — and what it signals for Q3 deal flow.', theme: 'violet', src: A.img('1497366754035-f200968a6e72', 500), href: 'insights.html#sandhill' },
    { date: 'May 28, 2026', title: 'The infrastructure mega-cycle: why the Valley is rebuilding everything', excerpt: 'From compute to networking to data centers — an inside look at the buildout reshaping AI economics.', theme: 'ink', src: A.img('1558494949-ef010cbdcc31', 500), href: 'insights.html#infrastructure' },
    { date: 'May 14, 2026', title: 'Inside the new wave of AI agent startups', excerpt: 'A field guide to the agent companies our cohorts are meeting this quarter — and which are worth a second conversation.', theme: 'lavender', src: A.img('1518770660439-4636190af475', 500), href: 'insights.html#agents' },
    { date: 'Apr 30, 2026', title: 'Cross-border AI: what Chinese founders are getting right (and wrong) about the US market', excerpt: 'Lessons from 18 months of advising founders crossing the Pacific.', theme: 'honey', src: A.img('1501594907352-04cda38ebc29', 500) },
    { date: 'Apr 16, 2026', title: 'Stanford HAI’s 2026 outlook: what faculty are watching', excerpt: 'Our recap of the most important research themes coming out of Stanford’s AI institute this year.', theme: 'lilac', src: A.img('1507842217343-583bb7270b66', 500) },
  ];

  /* ---------- Hero ---------- */
  function Hero() {
    return R.createElement('section', { style: { position: 'relative', overflow: 'hidden' } },
      R.createElement('div', { 'aria-hidden': 'true', style: { position: 'absolute', top: -180, right: -120, width: 520, height: 520, borderRadius: '50%', background: 'rgba(176,166,238,0.50)', filter: 'blur(100px)', pointerEvents: 'none' } }),
      R.createElement('div', { 'aria-hidden': 'true', style: { position: 'absolute', bottom: -220, left: -160, width: 480, height: 480, borderRadius: '50%', background: 'rgba(246,200,95,0.20)', filter: 'blur(100px)', pointerEvents: 'none' } }),
      R.createElement('div', { className: 'ae-container ae-hero-split', style: { position: 'relative', display: 'grid', gridTemplateColumns: '1.05fr 0.95fr', gap: 'clamp(32px, 5vw, 64px)', alignItems: 'center', paddingTop: 'clamp(48px, 6vw, 88px)', paddingBottom: 'clamp(40px, 5vw, 72px)' } },
        /* left column */
        R.createElement(Reveal, { as: 'div' },
          R.createElement('h1', { style: { fontFamily: 'var(--font-display)', fontWeight: 800, fontSize: 'clamp(2.5rem, 5.2vw, 4.1rem)', lineHeight: 1.02, letterSpacing: '-0.025em', color: 'var(--ink)', margin: 0, textWrap: 'balance' } },
            'Where the world comes to understand ',
            R.createElement('span', { style: { position: 'relative', whiteSpace: 'nowrap', color: 'var(--violet)' } }, 'what is next',
              R.createElement('span', { 'aria-hidden': 'true', style: { position: 'absolute', left: 0, right: 0, bottom: '0.08em', height: '0.34em', background: 'var(--honey)', borderRadius: 8, zIndex: -1 } })),
            '.'),
          R.createElement('p', { style: { fontFamily: 'var(--font-sans)', fontSize: 'clamp(1.05rem, 1.5vw, 1.22rem)', lineHeight: 1.6, color: 'var(--text-body)', maxWidth: '46ch', margin: '24px 0 0' } },
            'We design exclusive, high-touch group tours that give investors, tech executives, and AI enthusiasts access to Silicon Valley’s AI and VC ecosystem — turning a trip into a strategic advantage.'),
          R.createElement('div', { 'data-hero-cta': '', style: { display: 'flex', alignItems: 'center', gap: 16, flexWrap: 'wrap', marginTop: 32 } },
            R.createElement(BookButton, { size: 'lg' }),
            R.createElement('a', { href: '#programs', style: { display: 'inline-flex', alignItems: 'center', gap: 7, fontFamily: 'var(--font-sans)', fontSize: '0.98rem', fontWeight: 600, color: 'var(--violet)', textDecoration: 'none' } },
              'Explore the programs', R.createElement('i', { 'data-lucide': 'arrow-down', style: { width: 17, height: 17 } })))
        ),
        /* right column — contained image panel */
        R.createElement(Reveal, { as: 'div', delay: 120, style: { position: 'relative' } },
          R.createElement(ImageFrame, { theme: 'lavender', ratio: '4 / 5', icon: 'building-2', src: A.img('1521747116042-5a810fda9664', 1100),
            label: 'Hero image · Stanford courtyard or Bay Area skyline at golden hour (swap for licensed / video later)' }),
          R.createElement(Card, { variant: 'raised', padding: '0', onClick: () => A.openBooking('AI Frontier — Inside Silicon Valley'), title: 'Book the October 2026 cohort',
            style: { position: 'absolute', left: -18, bottom: 26, maxWidth: 266, overflow: 'hidden', cursor: 'pointer' } },
            R.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 10, padding: '11px 14px' } },
              R.createElement('div', { style: { flex: 'none', width: 38, height: 38, borderRadius: 'var(--radius-md)', background: 'var(--honey)', color: 'var(--honey-ink)', display: 'grid', placeItems: 'center' } },
                R.createElement('i', { 'data-lucide': 'calendar-clock', style: { width: 19, height: 19 } })),
              R.createElement('div', null,
                R.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 6 } },
                  R.createElement('span', { style: { width: 8, height: 8, borderRadius: '50%', background: 'var(--success)', boxShadow: '0 0 0 3px var(--success-tint)' } }),
                  R.createElement('span', { style: { whiteSpace: 'nowrap', fontFamily: 'var(--font-label, var(--font-mono))', fontSize: '0.74rem', letterSpacing: '0.13em', textTransform: 'uppercase', fontWeight: 700, color: 'var(--success)' } }, 'Now booking')),
                R.createElement('div', { style: { fontFamily: 'var(--font-display)', fontWeight: 700, fontSize: '0.9rem', lineHeight: 1.15, color: 'var(--ink)', marginTop: 3 } }, 'AI Frontier · October 2026'),
                R.createElement('div', { style: { fontFamily: 'var(--font-mono)', fontSize: '0.58rem', letterSpacing: '0.08em', textTransform: 'uppercase', color: 'var(--slate)', lineHeight: 1.5, marginTop: 2 } }, 'Oct 25–31 · limited seats'))),
            R.createElement('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8, padding: '8px 14px', background: 'var(--ink)' } },
              R.createElement('span', { style: { fontFamily: 'var(--font-sans)', fontSize: '0.74rem', fontWeight: 600, color: 'var(--paper)' } }, 'Reserve your seat'),
              R.createElement('i', { 'data-lucide': 'arrow-up-right', style: { width: 15, height: 15, color: 'var(--lavender)' } })))
        )
      )
    );
  }

  /* ---------- Three Programs ---------- */
  function ProgramCard({ p, i }) {
    const [hover, setHover] = R.useState(false);
    const statusStyle = { whiteSpace: 'normal', lineHeight: 1.35, textAlign: 'left' };
    const variant = p.statusVariant === 'honey' ? 'honey' : p.statusVariant === 'solid' ? 'solid' : 'outline';
    const bookable = p.statusVariant !== 'outline';
    const onBook = (e) => { e.preventDefault(); e.stopPropagation(); A.openBooking(p.bookProgram); };
    const statusEl = R.createElement(Tag, Object.assign(
      { variant, style: Object.assign({}, statusStyle, bookable ? { cursor: 'pointer', boxShadow: variant === 'honey' ? '0 2px 0 var(--honey-deep)' : '0 2px 0 var(--lavender-700)', marginBottom: 2 } : {}) },
      bookable ? { role: 'button', tabIndex: 0, title: 'Book this cohort', onClick: onBook, onKeyDown: (e) => { if (e.key === 'Enter' || e.key === ' ') onBook(e); } } : {}),
      p.status,
      bookable ? R.createElement('i', { 'data-lucide': 'arrow-up-right', style: { width: 13, height: 13 } }) : null);
    return R.createElement(Reveal, { as: 'div', delay: i * 90 },
      R.createElement('a', { href: p.href, onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false),
        style: { display: 'block', textDecoration: 'none', height: '100%' } },
        R.createElement(Card, { variant: 'raised', padding: '0', style: { overflow: 'hidden', height: '100%', display: 'flex', flexDirection: 'column',
          transform: hover ? 'translateY(-5px)' : 'none', boxShadow: hover ? 'var(--shadow-lg)' : 'var(--shadow-md)', transition: 'all var(--dur-base) var(--ease-out)' } },
          R.createElement(ImageFrame, { theme: p.theme, height: 184, icon: p.icon, chip: null, radius: '0', src: p.img,
            label: p.name + ' — program image' }),
          R.createElement('div', { style: { padding: '24px 26px 26px', display: 'flex', flexDirection: 'column', gap: 0, flex: 1 } },
            R.createElement('div', { style: { display: 'inline-flex', marginBottom: 16 } }, statusEl),
            R.createElement('h3', { style: { fontSize: '1.5rem', margin: 0, color: 'var(--text-strong)', lineHeight: 1.15 } }, p.name),
            R.createElement('div', { style: { fontFamily: 'var(--font-sans)', fontSize: '0.92rem', fontWeight: 600, color: 'var(--violet)', margin: '4px 0 12px' } }, p.sub),
            R.createElement('p', { style: { fontFamily: 'var(--font-sans)', fontSize: '0.95rem', lineHeight: 1.62, color: 'var(--text-muted)', margin: '0 0 16px' } }, p.desc),
            R.createElement('ul', { style: { listStyle: 'none', margin: '0 0 22px', padding: 0, display: 'flex', flexDirection: 'column', gap: 9 } },
              (p.strengths || []).map((s, j) => R.createElement('li', { key: j, style: { display: 'flex', gap: 10, alignItems: 'flex-start' } },
                R.createElement('span', { style: { flex: 'none', marginTop: 2, width: 18, height: 18, borderRadius: '50%', background: 'var(--lilac-100)', color: 'var(--violet)', display: 'grid', placeItems: 'center' } },
                  R.createElement('i', { 'data-lucide': 'check', style: { width: 12, height: 12 } })),
                R.createElement('span', { style: { fontFamily: 'var(--font-sans)', fontSize: '0.875rem', lineHeight: 1.4, color: 'var(--text-muted)', fontWeight: 500 } }, s)))),
            R.createElement('span', { style: { marginTop: 'auto', alignSelf: 'flex-start', display: 'inline-flex', alignItems: 'center', gap: 8, whiteSpace: 'nowrap', fontFamily: 'var(--font-sans)', fontSize: '0.9rem', fontWeight: 700, color: hover ? 'var(--paper)' : 'var(--violet)', background: hover ? 'var(--violet)' : 'var(--lilac-100)', padding: '11px 20px', borderRadius: 'var(--radius-pill)', boxShadow: hover ? 'var(--squish-violet)' : 'none', transition: 'all var(--dur-base) var(--ease-out)' } },
              'View program details', R.createElement('i', { 'data-lucide': 'arrow-right', style: { width: 17, height: 17, transform: hover ? 'translateX(3px)' : 'none', transition: 'transform var(--dur-base) var(--ease-out)' } }))
          )
        )
      )
    );
  }

  function Programs() {
    return R.createElement('section', { id: 'programs' },
      R.createElement('div', { className: 'ae-container', style: { paddingTop: 'var(--section-y)' } },
        R.createElement(Reveal, { as: 'div', style: { maxWidth: 640, marginBottom: 44 } },
          R.createElement(SectionHeader, { eyebrow: 'The programs', title: 'Three ways to experience Silicon Valley.',
            intro: 'Each immersion is small, curated, and built around a distinct audience — capital, builders, and families. Apply once; we curate the room around your goals.' })),
        R.createElement('div', { className: 'ae-grid-3', style: { display: 'grid', gridTemplateColumns: 'repeat(3, minmax(0, 1fr))', gap: 22, alignItems: 'stretch' } },
          PROGRAMS.map((p, i) => R.createElement(ProgramCard, { key: p.code, p, i }))
        )
      )
    );
  }

  /* ---------- AI Insights / credibility ---------- */
  function Insights() {
    return R.createElement('section', { id: 'insights' },
      R.createElement('div', { className: 'ae-container ae-insights-split', style: { paddingTop: 'var(--section-y)', display: 'grid', gridTemplateColumns: '0.82fr 1.18fr', gap: 'clamp(32px, 4vw, 60px)', alignItems: 'start' } },
        R.createElement(Reveal, { as: 'div', style: { position: 'sticky', top: 96 } },
          R.createElement(Eyebrow, null, 'AI Insights'),
          R.createElement('h2', { style: { fontSize: 'clamp(1.7rem, 2.6vw, 2.3rem)', margin: '14px 0 0', color: 'var(--text-strong)', letterSpacing: '-0.02em', textWrap: 'balance', maxWidth: '20ch' } },
            'We live inside Silicon Valley’s innovation loop — so you don’t have to guess what matters.'),
          R.createElement('a', { href: 'newsletter.html', style: { display: 'inline-flex', alignItems: 'center', gap: 8, marginTop: 24, fontFamily: 'var(--font-sans)', fontSize: '0.98rem', fontWeight: 700, color: 'var(--violet)', textDecoration: 'none' } },
            'Read the AI Digest', R.createElement('i', { 'data-lucide': 'arrow-right', style: { width: 17, height: 17 } }))
        ),
        R.createElement('div', { style: { display: 'flex', flexDirection: 'column' } },
          INSIGHTS.slice(0, 3).map((a, i) => R.createElement(Reveal, { as: 'div', key: i, delay: i * 60,
            style: i ? { borderTop: '1px solid var(--border-soft)' } : {} },
            R.createElement(ArticleCard, a)))
        )
      )
    );
  }

  /* ---------- Primary CTA block (placement #3) ---------- */
  function CtaBlock() {
    return R.createElement('section', { 'data-cta-block': '', style: { marginTop: 'var(--section-y)' } },
      R.createElement('div', { className: 'ae-container' },
        R.createElement('div', { style: { position: 'relative', overflow: 'hidden', background: 'var(--ink)', borderRadius: 'var(--radius-2xl)', padding: 'clamp(48px, 7vw, 96px) clamp(28px, 5vw, 80px)', textAlign: 'center' } },
          R.createElement('div', { 'aria-hidden': 'true', style: { position: 'absolute', top: -120, left: '12%', width: 420, height: 420, borderRadius: '50%', background: 'rgba(176,166,238,0.34)', filter: 'blur(110px)' } }),
          R.createElement('div', { 'aria-hidden': 'true', style: { position: 'absolute', bottom: -160, right: '8%', width: 420, height: 420, borderRadius: '50%', background: 'rgba(246,200,95,0.22)', filter: 'blur(110px)' } }),
          R.createElement('img', { src: 'assets/mark-cream.png', alt: '', 'aria-hidden': 'true', style: { position: 'absolute', left: -60, bottom: -70, width: 320, opacity: 0.07 } }),
          R.createElement(Reveal, { as: 'div', style: { position: 'relative' } },
            R.createElement(Eyebrow, { color: 'var(--lavender)' }, 'Limited seats per cohort'),
            R.createElement('h2', { style: { fontFamily: 'var(--font-display)', fontWeight: 800, fontSize: 'clamp(2.1rem, 4.4vw, 3.4rem)', lineHeight: 1.05, letterSpacing: '-0.02em', color: 'var(--paper)', margin: '16px auto 0', maxWidth: '18ch', textWrap: 'balance' } },
              'Ready to see the Valley from the inside?'),
            R.createElement('p', { style: { fontFamily: 'var(--font-sans)', fontSize: 'clamp(1.02rem, 1.5vw, 1.18rem)', lineHeight: 1.6, color: 'rgba(243,242,239,0.74)', margin: '18px auto 0', maxWidth: '46ch' } },
              'Limited seats per cohort. Book a discovery call to find the right program for you.'),
            R.createElement('div', { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 16, marginTop: 34 } },
              R.createElement(BookButton, { size: 'lg' }))
          )
        )
      )
    );
  }

  /* ---------- Newsletter ---------- */
  function Newsletter() {
    return R.createElement('section', { id: 'newsletter', style: { marginTop: 'clamp(40px, 6vw, 80px)' } },
      R.createElement('div', { className: 'ae-container' },
        R.createElement(Reveal, { as: 'div' },
          R.createElement('div', { style: { background: 'var(--white)', border: '1px solid var(--border-soft)', borderRadius: 'var(--radius-2xl)', boxShadow: 'var(--shadow-md)', padding: 'clamp(36px, 5vw, 64px)', textAlign: 'center' } },
            R.createElement('div', { style: { display: 'inline-flex', marginBottom: 18 } }, R.createElement(Tag, { variant: 'honey' }, 'Free weekly intelligence')),
            R.createElement('h2', { style: { fontSize: 'clamp(1.9rem, 3.4vw, 2.7rem)', margin: 0, color: 'var(--text-strong)', letterSpacing: '-0.02em' } }, 'The Asher AI Digest'),
            R.createElement('p', { style: { fontFamily: 'var(--font-sans)', fontSize: 'clamp(1rem, 1.4vw, 1.12rem)', lineHeight: 1.6, color: 'var(--text-muted)', margin: '16px auto 28px', maxWidth: '54ch' } },
              'Weekly intelligence on Silicon Valley AI investment, founder moves, and frontier research.'),
            R.createElement('div', { style: { maxWidth: 760, margin: '0 auto' } }, R.createElement(NewsletterForm, { layout: 'row' })),
            R.createElement('p', { style: { fontFamily: 'var(--font-mono)', fontSize: '0.7rem', letterSpacing: '0.08em', color: 'var(--text-faint)', marginTop: 18 } }, 'Free. No spam. Unsubscribe anytime.')
          )
        )
      )
    );
  }

  function HomePage() {
    return R.createElement(R.Fragment, null,
      R.createElement(Nav, { current: 'index.html' }),
      R.createElement('main', null,
        R.createElement(Hero),
        R.createElement(Programs),
        R.createElement(Insights),
        R.createElement(CtaBlock),
        R.createElement(Newsletter)
      ),
      R.createElement(Footer),
      R.createElement(FloatingBook),
      R.createElement(BookingModal)
    );
  }

  window.Asher = Object.assign(window.Asher || {}, { HomePage });
})();
