// pages-marketing.jsx — Home, Insurify product, Access, About, Contact

// ─── HOME ────────────────────────────────────────────────────────────────────
// Re-imagined home applying guiding principles from peer enterprise-healthcare sites:
//   · inline email capture in the hero (friction-free conversion)
//   · audience-segmented switcher (this is for you)
//   · numbered, capitalized 3-act platform narrative (DOCUMENT → AUTHORIZE → COLLECT)
//   · positively-framed business case with outcome-first metrics
//   · named customer spotlight with supporting pilot stats

function HomePage({ go }) {
  return (
    <div data-screen-label="01 Home">
      <HomeHero go={go} />
      <HomeTrustBar />
      <HomeLiveProducts go={go} />
      <HomeHowItWorks />
      <HomeOutcomes />
      <HomeComingNext />
      <HomeCustomerSpotlight />
      <HomeSecurityBand go={go} />
    </div>);

}

// ── Hero ─────────────────────────────────────────────────────────────────────
function HomeHero({ go }) {
  const heroRef = React.useRef(null);
  const mockRef = React.useRef(null);
  const headRef = React.useRef(null);
  const stageWrapRef = React.useRef(null);
  const rafId = React.useRef(0);
  const scrollRaf = React.useRef(0);
  const reduceMotion = React.useRef(false);

  React.useEffect(() => {
    reduceMotion.current = window.matchMedia &&
      window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    return () => { cancelAnimationFrame(rafId.current); cancelAnimationFrame(scrollRaf.current); };
  }, []);

  // Cursor-following emerald key light over the dark field
  const onHeroMove = (e) => {
    if (reduceMotion.current) return;
    const el = heroRef.current;
    if (!el) return;
    const r = el.getBoundingClientRect();
    const x = e.clientX - r.left, y = e.clientY - r.top;
    cancelAnimationFrame(rafId.current);
    rafId.current = requestAnimationFrame(() => {
      el.style.setProperty('--hx', x + 'px');
      el.style.setProperty('--hy', y + 'px');
      el.style.setProperty('--spot', '1');
      el.style.setProperty('--mx', (x / r.width - 0.5).toFixed(3));
      el.style.setProperty('--my', (y / r.height - 0.5).toFixed(3));
    });
  };
  const onHeroLeave = () => {
    const el = heroRef.current;
    if (el) el.style.setProperty('--spot', '0');
  };

  // Parallax exit — as you scroll, the headline falls behind the card like a
  // camera pan; transform/opacity only, rAF-throttled, passive listener.
  React.useEffect(() => {
    if (reduceMotion.current) return;
    const onScroll = () => {
      cancelAnimationFrame(scrollRaf.current);
      scrollRaf.current = requestAnimationFrame(() => {
        const y = window.scrollY;
        if (y > 940) return;
        if (headRef.current) {
          headRef.current.style.transform = 'translateY(' + (y * 0.22).toFixed(1) + 'px)';
          headRef.current.style.opacity = String(Math.max(0, 1 - y / 460));
        }
        if (stageWrapRef.current) {
          stageWrapRef.current.style.transform = 'translateY(' + (y * 0.08).toFixed(1) + 'px)';
        }
      });
    };
    window.addEventListener('scroll', onScroll, { passive: true });
    return () => window.removeEventListener('scroll', onScroll);
  }, []);

  // Subtle 3D tilt on the product mock
  const onMockMove = (e) => {
    if (reduceMotion.current) return;
    const el = mockRef.current;
    if (!el) return;
    const r = el.getBoundingClientRect();
    const px = (e.clientX - r.left) / r.width - 0.5;
    const py = (e.clientY - r.top) / r.height - 0.5;
    el.style.transform =
      'rotateX(' + (-py * 2.2).toFixed(2) + 'deg) rotateY(' + (px * 2.2).toFixed(2) + 'deg)';
  };
  const onMockLeave = () => {
    const el = mockRef.current;
    if (el) el.style.transform = '';
  };

  const HEAD_WORDS = ['Built', 'for', 'clinical', 'care'];

  return (
    <section className="emerald-field" ref={heroRef}
    onMouseMove={onHeroMove} onMouseLeave={onHeroLeave}
    style={{
      position: 'relative', overflow: 'hidden',
      paddingTop: 13, paddingBottom: 0
    }}>
      <style>{`
        @media (prefers-reduced-motion: no-preference) {
          /* —— opening: the stage is dark, the light comes up —— */
          .hero-scene-light {
            animation: heroSceneLight 1.5s cubic-bezier(.4,.1,.3,1) forwards;
          }
          @keyframes heroSceneLight {
            from { opacity: .92; } to { opacity: 0; }
          }
          /* —— slow camera dolly-in on the whole scene —— */
          .hero-dolly {
            transform-origin: 50% 22%;
            animation: heroDolly 2.8s cubic-bezier(.16,1,.3,1) forwards;
          }
          @keyframes heroDolly {
            from { transform: scale(1.05); } to { transform: scale(1); }
          }
          /* —— headline: words rise through line masks, one by one —— */
          .hw { display: inline-block; transform: translateY(112%);
            animation: hwUp .9s cubic-bezier(.16,1,.3,1) forwards; }
          @keyframes hwUp { to { transform: translateY(0); } }
          /* —— sub + CTAs: blur-to-sharp rise —— */
          .hero-rise {
            opacity: 0; transform: translateY(22px); filter: blur(8px);
            animation: heroRise 1.05s cubic-bezier(.16,1,.3,1) forwards;
          }
          .hero-rise-2 { animation-delay: .55s; }
          .hero-rise-3 { animation-delay: .75s; }
          @keyframes heroRise { to { opacity: 1; transform: translateY(0); filter: blur(0); } }

          /* —— "by physicians": the pen draws it, a light rides the pen tip —— */
          .hero-script-reveal {
            clip-path: inset(0 100% 0 0);
            animation: heroScriptDraw 1.7s cubic-bezier(.45,.05,.35,1) 1.35s forwards;
          }
          @keyframes heroScriptDraw { to { clip-path: inset(0 0 0 0); } }
          .hero-script-pen {
            animation: heroPen 1.7s cubic-bezier(.45,.05,.35,1) 1.35s forwards;
          }
          @keyframes heroPen {
            0%   { left: 0%;   opacity: 0; }
            6%   { opacity: 1; }
            88%  { opacity: 1; }
            100% { left: 100%; opacity: 0; }
          }

          /* —— the card stands up into the light, then one sweep crosses it —— */
          .hero-mock-rise {
            opacity: 0;
            animation: heroMockRise 1.5s cubic-bezier(.16,1,.3,1) 1.05s forwards;
          }
          @keyframes heroMockRise {
            from { opacity: 0; transform: perspective(1200px) translateY(64px) rotateX(9deg) scale(.94); }
            55%  { opacity: 1; }
            to   { opacity: 1; transform: perspective(1200px) translateY(0) rotateX(0deg) scale(1); }
          }
          .hero-sweep::after {
            content: ""; position: absolute; top: -40%; bottom: -40%; width: 34%; left: 0;
            filter: blur(10px);
            background: linear-gradient(105deg, transparent, rgba(255,255,255,.26) 45%, rgba(210,255,230,.38) 50%, rgba(255,255,255,.26) 55%, transparent);
            transform: translateX(-170%) skewX(-8deg);
            animation: heroSweep 1.35s cubic-bezier(.55,.08,.25,.96) 2.9s forwards;
          }
          @keyframes heroSweep { to { transform: translateX(430%) skewX(-8deg); } }

          /* —— ambient, video-like motion (continuous, slow, self-playing) —— */
          .hero-aurora { animation: heroAurora 22s ease-in-out infinite alternate; }
          .hero-aurora-2 { animation: heroAurora2 30s ease-in-out infinite alternate; }
          @keyframes heroAurora {
            from { transform: translate3d(-5%, -2%, 0) scale(1); }
            to   { transform: translate3d(9%, 7%, 0) scale(1.2); }
          }
          @keyframes heroAurora2 {
            from { transform: translate3d(7%, 5%, 0) scale(1.12); }
            to   { transform: translate3d(-9%, -5%, 0) scale(0.94); }
          }
          .hero-grid-pan { animation: heroGridPan 80s linear infinite; }
          @keyframes heroGridPan {
            from { background-position: 0 0, 0 0; }
            to   { background-position: -420px -420px, -420px -420px; }
          }
          .hero-glow-pulse { animation: heroGlowPulse 9s ease-in-out infinite alternate; }
          @keyframes heroGlowPulse {
            from { opacity: .7;  transform: translateX(-50%) scale(1); }
            to   { opacity: 1;   transform: translateX(-50%) scale(1.14); }
          }
          .hero-script-glow { animation: heroScriptGlow 7s ease-in-out 3.2s infinite; }
          @keyframes heroScriptGlow {
            0%, 100% { filter: drop-shadow(0 0 0px rgba(95,211,154,0)); }
            50%      { filter: drop-shadow(0 0 7px rgba(95,211,154,0.5)); }
          }
          /* —— lens flare as the pen lifts off the signature —— */
          .hero-script-flare { animation: heroFlare .75s cubic-bezier(.2,.7,.3,1) 2.92s both; }
          @keyframes heroFlare {
            0%   { opacity: 0;   transform: scale(.3); }
            35%  { opacity: .95; transform: scale(1.25); }
            100% { opacity: 0;   transform: scale(1.65); }
          }
          /* —— living film grain —— */
          .hero-grain-anim { animation: heroGrain .7s steps(1) infinite; }
          @keyframes heroGrain {
            0%   { transform: translate3d(0,0,0); }
            16%  { transform: translate3d(-6px,4px,0); }
            33%  { transform: translate3d(4px,-5px,0); }
            50%  { transform: translate3d(-4px,-3px,0); }
            66%  { transform: translate3d(5px,3px,0); }
            83%  { transform: translate3d(-3px,5px,0); }
            100% { transform: translate3d(0,0,0); }
          }
          /* —— primary CTA breathes light, slowly —— */
          .hero-cta-row .btn-arrow { animation: heroCtaBreath 7s ease-in-out 3.5s infinite; }
          @keyframes heroCtaBreath {
            0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,.18); }
            50%      { box-shadow: 0 10px 34px rgba(120,232,172,.30); }
          }
        }
        .hero-scene-light {
          position: absolute; inset: 0; z-index: 6; pointer-events: none;
          background: #03150E; opacity: 0;
        }
        /* —— doctor mode: hold the scrawl until the actor's pen touches down.
           The draw itself is driven imperatively (WAAPI) by hero-doctor.jsx —
           class-swap CSS animations proved unreliable here. —— */
        .emerald-field.doc-mode .hero-script-reveal { animation: none; clip-path: inset(0 100% 0 0); }
        .emerald-field.doc-mode .hero-script-pen { animation: none; }
        .emerald-field.doc-mode .hero-script-flare { animation: none; }
        /* mouse-parallax depth: background layers drift against the cursor */
        .hero-depth { position: absolute; inset: 0; pointer-events: none;
          transition: transform .7s cubic-bezier(.2,.7,.2,1); will-change: transform; }
        .hero-depth-1 { transform: translate3d(calc(var(--mx, 0) * -16px), calc(var(--my, 0) * -10px), 0); }
        .hero-depth-2 { transform: translate3d(calc(var(--mx, 0) * 12px), calc(var(--my, 0) * 8px), 0); }
        .hero-depth-3 { transform: translate3d(calc(var(--mx, 0) * -6px), calc(var(--my, 0) * -4px), 0); }
        .hero-script-flare {
          position: absolute; top: 6%; right: -4%; width: 26px; height: 26px;
          opacity: 0; pointer-events: none; border-radius: 999px; filter: blur(.5px);
          background: radial-gradient(closest-side, rgba(240,255,247,.95), rgba(120,232,172,.45) 55%, transparent);
        }
        /* glass catch-light along the card's top edge */
        .hero-mock-tilt::after {
          content: ""; position: absolute; left: 12px; right: 12px; top: 8px; height: 1px;
          z-index: 5; pointer-events: none; display: none;
          background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
        }
        .hw-mask { display: inline-block; overflow: hidden; vertical-align: bottom;
          padding-bottom: .06em; margin-bottom: -.06em; }
        .hw { display: inline-block; }
        .hero-script-pen {
          position: absolute; top: 12%; bottom: 12%; left: 0; width: 10px;
          margin-left: -5px; border-radius: 999px; opacity: 0; pointer-events: none;
          background: radial-gradient(closest-side, rgba(238,255,246,.95), rgba(120,232,172,.4) 60%, transparent);
          box-shadow: 0 0 18px 6px rgba(120,232,172,.4);
        }
        .hero-spotlight {
          position: absolute; inset: 0; pointer-events: none;
          opacity: var(--spot, 0);
          transition: opacity .5s ease;
          background: radial-gradient(460px circle at var(--hx, 50%) var(--hy, 240px),
            rgba(120,232,172,0.13), transparent 65%);
          mix-blend-mode: screen;
        }
        .hero-cta-row .btn { transition: background .15s ease, border-color .15s ease, transform .2s ease, box-shadow .2s ease; }
        .hero-cta-row .btn:hover { transform: translateY(-1.5px); }
        .hero-cta-row .btn:active { transform: translateY(0); }
        .hero-mock-tilt {
          transition: transform .3s cubic-bezier(.2,.7,.2,1);
          transform-style: preserve-3d;
          will-change: transform;
        }
        .hero-sweep { position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: 16px; overflow: hidden; }
        /* Ambient light: the amber "gap" story is told by crossfading a
           pre-blurred amber layer's OPACITY, not by animating the filter
           property on a 60-70px blur (non-compositable: it re-rasterizes
           every frame). */
        .hero-aurora { filter: blur(60px); }
        .hero-aurora-2 { filter: blur(70px); }
        .hero-glow-emerald, .hero-glow-amber { filter: blur(16px); transition: opacity .45s ease, transform .45s ease; }
        .hero-glow-amber { opacity: 0; }
        .hero-mock-stage:has([data-demo-state="gap"]) .hero-glow-amber { opacity: .95; }
        .hero-mock-stage:has([data-demo-state="gap"]) .hero-glow-emerald { opacity: .3; }
        .hero-mock-stage:has([data-demo-state="ready"]) .hero-glow-emerald { opacity: 1; transform: scale(1.06); }
      `}</style>

      {/* drifting aurora light — parallax depth layers drift against the cursor */}
      <div className="hero-depth hero-depth-1">
      <div className="hero-aurora" style={{
        position: 'absolute', top: '-12%', left: '-16%', width: '62%', height: '85%',
        background: 'radial-gradient(closest-side, rgba(31,115,80,0.5), transparent 70%)',
        pointerEvents: 'none'
      }} />
      </div>
      <div className="hero-depth hero-depth-2">
      <div className="hero-aurora-2" style={{
        position: 'absolute', bottom: '-22%', right: '-12%', width: '56%', height: '78%',
        background: 'radial-gradient(closest-side, rgba(95,211,154,0.14), transparent 70%)',
        pointerEvents: 'none'
      }} />
      </div>

      {/* fine grid texture for character */}
      <div className="hero-grid-pan" style={{
        position: 'absolute', inset: 0, opacity: 0.05, pointerEvents: 'none',
        backgroundImage:
        'linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px),' +
        'linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px)',
        backgroundSize: '42px 42px',
        maskImage: 'radial-gradient(120% 100% at 50% 0%, #000 35%, transparent 80%)',
        WebkitMaskImage: 'radial-gradient(120% 100% at 50% 0%, #000 35%, transparent 80%)'
      }} />
      {/* luminous top glow */}
      <div className="hero-depth hero-depth-3">
      <div className="hero-glow-pulse" style={{
        position: 'absolute', top: -240, left: '50%', transform: 'translateX(-50%)',
        width: 1000, height: 560, borderRadius: '50%',
        background: 'radial-gradient(closest-side, rgba(120,232,172,0.20), transparent)',
        pointerEvents: 'none'
      }} />
      </div>
      {/* cinematic vignette — pulls the eye to the lit center */}
      <div style={{
        position: 'absolute', inset: 0, pointerEvents: 'none',
        background: 'radial-gradient(130% 100% at 50% 0%, transparent 52%, rgba(2,15,10,0.5) 100%)'
      }} />
      {/* film grain — living, near-invisible, kills banding on the gradients */}
      <div className="hero-grain-anim" style={{
        position: 'absolute', inset: -8, pointerEvents: 'none',
        opacity: 0.05, mixBlendMode: 'overlay',
        backgroundImage: 'url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27160%27 height=%27160%27%3E%3Cfilter id=%27n%27%3E%3CfeTurbulence type=%27fractalNoise%27 baseFrequency=%270.9%27 numOctaves=%272%27/%3E%3C/filter%3E%3Crect width=%27160%27 height=%27160%27 filter=%27url(%23n)%27/%3E%3C/svg%3E")'
      }} />
      {/* cursor-following key light */}
      <div className="hero-spotlight" aria-hidden="true" />

      <div className="hero-dolly">
      <div className="cmd-container" style={{ position: 'relative', zIndex: 1 }}>
        <div ref={headRef} style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto', willChange: 'transform' }}>
          <h1 className="h-display hero-h1" style={{
            color: '#fff', fontSize: 'clamp(30px, 3.4vw, 48px)',
            lineHeight: 1.15, letterSpacing: '-0.025em',
            margin: 0, textAlign: 'center', textWrap: 'balance',
            textShadow: '0 0 44px rgba(120,232,172,0.22)'
          }}>
            {HEAD_WORDS.map((w, i) => (
              <React.Fragment key={w}>
                <span className="hw-mask"><span className="hw" style={{ animationDelay: (0.18 + i * 0.09) + 's' }}>{w}</span></span>
                {i < HEAD_WORDS.length - 1 ? ' ' : null}
              </React.Fragment>
            ))}
            <span className="hero-script-glow" style={{
              display: 'inline-block', height: '2em',
              verticalAlign: '-0.45em', marginLeft: '0.18em',
              whiteSpace: 'nowrap',
              position: 'relative', top: 31, left: -17
            }}>
              <span className="hero-script-reveal" style={{ display: 'block', height: '100%' }}>
                <img src="assets/by-physicians-cutout2.png" alt="by physicians"
                  style={{ display: 'block', height: '100%', width: 'auto' }} />
              </span>
              <span className="hero-script-pen" aria-hidden="true" />
              <span className="hero-script-flare" aria-hidden="true" />
            </span>
          </h1>
          <p className="hero-rise hero-rise-2 hero-sub hero-sub-d" style={{
            fontSize: 'clamp(13.5px, 1.85vw, 18px)', color: 'rgba(255,255,255,0.78)',
            lineHeight: 1.55, whiteSpace: 'nowrap',
            margin: '33px auto 0', fontWeight: 400
          }}>
            We build practical tools for physicians, APPs, and clinical teams designed around how care is actually delivered.
          </p>
          <p className="hero-rise hero-rise-2 hero-sub-m" style={{
            fontSize: 15, color: 'rgba(255,255,255,0.78)', lineHeight: 1.45,
            margin: '10px auto 0', fontWeight: 400
          }}>
            We build practical tools for physicians and APPs designed around how care is actually delivered.
          </p>

          <div className="hero-rise hero-rise-3 hero-cta-row" style={{
            marginTop: 26, display: 'flex', gap: 12, justifyContent: 'center',
            flexWrap: 'wrap'
          }}>
            <button className="btn btn-lg btn-arrow hero-cta-primary"
            style={{ background: '#fff', color: 'var(--accent-ink)' }}
            onClick={() => go('access')}>
              Get Insurify free <ArrowRight />
            </button>
            <button className="btn btn-lg hero-cta-secondary"
            style={{
              background: 'rgba(255,255,255,0.08)', color: '#fff',
              border: '1px solid rgba(255,255,255,0.28)'
            }}
            onClick={() => go('demo')}>
              Request a practice demo
            </button>
          </div>
        </div>

        <div ref={stageWrapRef} style={{ willChange: 'transform' }}>
        <div className="hero-mock-rise hero-mock-stage hero-video-stage" style={{
          position: 'relative',
          margin: '19px auto 0',
          paddingLeft: 'clamp(0px, 1.5vw, 28px)',
          paddingRight: 'clamp(0px, 1.5vw, 28px)',
          paddingBottom: 48,
          perspective: 1400
        }}>
          <div style={{ position: 'relative' }}>
          <div ref={mockRef} className="hero-mock-tilt"
          onMouseMove={onMockMove} onMouseLeave={onMockLeave}
          style={{ position: 'relative', zIndex: 1 }}>
            {/* Insurify promo clip — self-contained animated scene (laptop
               opens, app analyzes the note, gaps close to 98%). Transparent
               embed: the scene floats directly on the emerald field. */}
            <iframe className="hero-promo-embed"
              src="assets/insurify-promo-clip.html"
              title="Insurify product demonstration"
              scrolling="no"
              ref={(el) => {
                if (!el) return;
                // Same-origin patch: clear the page background and remove the
                // playback control bar; the scene itself is untouched.
                const patch = () => {
                  try {
                    const doc = el.contentDocument;
                    if (!doc || !doc.head || doc.getElementById('__hero-embed-patch')) return;
                    const s = doc.createElement('style');
                    s.id = '__hero-embed-patch';
                    s.textContent =
                      'html, body { background: transparent !important; }' +
                      'div[style*="rgba(20, 20, 20"] { display: none !important; }' +
                      // the stage SVG's drop shadow paints a dark card behind
                      // the transparent scene — kill it
                      'svg { box-shadow: none !important; }';
                    doc.head.appendChild(s);
                  } catch (e) { /* noop */ }
                };
                el.addEventListener('load', () => {
                  patch();
                  setTimeout(patch, 800);
                  setTimeout(patch, 2500);
                });
                patch();
              }}
              style={{
                display: 'block', width: '100%', height: 'auto',
                aspectRatio: '16 / 9', border: 0,
                background: 'transparent', pointerEvents: 'none', overflow: 'hidden'
              }}>
            </iframe>
          </div>
          </div>
        </div>
        </div>
      </div>
      </div>

      {/* opening scene light — the stage starts dark and comes up */}
      <div className="hero-scene-light" aria-hidden="true" />

      {/* the signing scene: doctor walks on, waves, writes the scrawl */}
      {typeof window !== 'undefined' && window.HeroDoctor ?
        React.createElement(window.HeroDoctor) : null}
    </section>);

}

// ── Trust bar / logo wall ─────────────────────────────────────────────────
function HomeTrustBar() {
  // Auto-scrolling marquee of clinician/org "logo lockups" — a monogram glyph +
  // org name. The track is duplicated so the loop is seamless; edges fade out.
  const ORGS = [
  { name: 'Insight Health Systems', short: 'IHS', shape: 'square', logo: 'assets/logos/insight.png', logoKey: 'orgInsight' },
  { name: 'UMKC School of Medicine', short: 'UMKC', shape: 'circle', logo: 'assets/logos/umkc.png', logoKey: 'orgUmkc' },
  { name: 'University of Kansas Health', short: 'KU', shape: 'rect', logo: 'assets/logos/ku-health.png', logoKey: 'orgKu' },
  { name: "St Luke's Hospital, Kansas City", short: 'SL', shape: 'pill', logo: 'assets/logos/saint-lukes.png', logoKey: 'orgStLukes' },
  { name: 'College Park Family Care', short: 'CP', shape: 'circle', logo: 'assets/logos/college-park.png', logoKey: 'orgCollegePark' },
  { name: 'Detroit Medical Center', short: 'DMC', shape: 'square', logo: 'assets/logos/dmc.png', logoKey: 'orgDmc' }];

  const loop = [...ORGS, ...ORGS];

  return (
    <section className="section-tight section-divider band-warm">
      <style>{`
        @keyframes clinicianMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
        .clinician-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); }
        .clinician-track { display: flex; align-items: center; width: max-content; gap: 14px; animation: clinicianMarquee 38s linear infinite; will-change: transform; }
        .clinician-marquee:hover .clinician-track { animation-play-state: paused; }
        @media (prefers-reduced-motion: reduce) { .clinician-track { animation: none; flex-wrap: wrap; justify-content: center; } }
      `}</style>
      <div className="cmd-container">
        <div style={{ textAlign: 'center', marginBottom: 24 }}>
          <span className="eyebrow" style={{ color: 'var(--ink-3)' }}>
            BUILT WITH CLINICIANS AT*
          </span>
        </div>
        <div className="clinician-marquee">
          <div className="clinician-track" aria-hidden="false">
            {loop.map((o, i) =>
            <LogoLockup key={i} org={o} />
            )}
          </div>
        </div>
      </div>
    </section>);

}

function LogoLockup({ org }) {
  if (org.logo) {
    const R = (typeof window !== 'undefined' && window.__resources) || {};
    const src = (org.logoKey && R[org.logoKey]) || org.logo;
    return (
      <div style={{
        flexShrink: 0, display: 'flex', alignItems: 'center', justifyContent: 'center',
        padding: '0 28px'
      }}>
        <img src={src} alt={org.name} loading="lazy" style={{
          height: 56, width: 'auto', objectFit: 'contain',
          opacity: 0.5, filter: 'grayscale(1)'
        }} />
      </div>);
  }
  const radius = org.shape === 'circle' ?
  999 : org.shape === 'pill' ? 999 : org.shape === 'rect' ? 4 : 3;
  const markSize = org.shape === 'pill' ? { w: 38, h: 22 } : { w: 28, h: 28 };
  return (
    <div style={{
      padding: '14px 22px', display: 'flex', alignItems: 'center',
      justifyContent: 'center', gap: 12, minHeight: 60, flexShrink: 0,
      background: 'var(--paper)', border: '1px solid var(--line-2)', boxShadow: 'var(--shadow-card)', borderRadius: 12
    }}>
      <div style={{
        width: markSize.w, height: markSize.h, borderRadius: radius,
        border: '1.5px solid var(--ink-3)',
        color: 'var(--ink-2)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        fontFamily: 'var(--font-mono)', fontSize: 10, fontWeight: 500,
        letterSpacing: '.04em', flexShrink: 0
      }}>{org.short}</div>
      <div style={{
        fontSize: 14, fontWeight: 500, color: 'var(--ink-2)',
        lineHeight: 1.3, letterSpacing: '-0.005em',
        textAlign: 'left', whiteSpace: 'nowrap'
      }}>{org.name}</div>
    </div>);

}

// ── Specialty rollout list ───────────────────────────────────────────────────
// Shows which procedural specialties Insurify is currently in cohort with and
// which are next on the rollout. Visual pattern adapted from peer practice-
// management sites: a left accent bar + specialty name + status pill, in a
// 3-up grid for the full version, a single inline strip for the compact one.
const SPECIALTY_ROLLOUT = [
{ name: 'Interventional Pain Medicine', status: 'live' },
{ name: 'Orthopedic Surgery', status: 'next' },
{ name: 'Neurosurgery', status: 'next' }];


// Full procedural-specialty roadmap, shown as a table on the home page.
// Status: 'live' = in cohort now, 'next' = launching next, 'roadmap' = planned.
// Edit freely — the table renders whatever is here (sized for 24 / an 8×3 grid).
const SPECIALTIES_ALL = [
{ name: 'Interventional Pain Medicine', status: 'live' },
{ name: 'Orthopedic Surgery', status: 'next' },
{ name: 'Neurosurgery', status: 'next' },
{ name: 'Spine Surgery', status: 'next' },
{ name: 'Sports Medicine', status: 'roadmap' },
{ name: 'Physical Medicine & Rehab', status: 'roadmap' },
{ name: 'Interventional Cardiology', status: 'roadmap' },
{ name: 'Cardiac Electrophysiology', status: 'roadmap' },
{ name: 'Vascular Surgery', status: 'roadmap' },
{ name: 'Gastroenterology', status: 'roadmap' },
{ name: 'Otolaryngology (ENT)', status: 'roadmap' },
{ name: 'Urology', status: 'roadmap' }];


const SPECIALTY_STATUS = {
  live: { tag: 'IN COHORT', dot: 'var(--accent)', tagBg: 'var(--accent-tint)', tagInk: 'var(--accent-ink)', tagBorder: 'var(--accent-tint-2)' },
  next: { tag: 'NEXT', dot: 'var(--accent)', tagBg: 'var(--paper)', tagInk: 'var(--accent)', tagBorder: 'var(--accent-tint-2)' },
  roadmap: { tag: 'ROADMAP', dot: 'var(--ink-4)', tagBg: 'var(--paper-2)', tagInk: 'var(--ink-3)', tagBorder: 'var(--line)' }
};

function SpecialtyRow({ item, dim }) {
  const live = item.status === 'live';
  return (
    <div style={{
      display: 'flex', alignItems: 'center', gap: 14,
      padding: dim ? '8px 0' : '14px 0',
      minWidth: 0
    }}>
      <span style={{
        width: 3, alignSelf: 'stretch',
        background: live ? 'var(--accent)' : 'var(--line)',
        borderRadius: 2, flexShrink: 0
      }} />
      <span style={{
        flex: 1, minWidth: 0,
        fontSize: dim ? 14 : 17,
        fontWeight: 500, letterSpacing: '-0.01em',
        color: live ? 'var(--ink)' : 'var(--ink-3)',
        lineHeight: 1.3
      }}>
        {item.name}
      </span>
      <span style={{
        fontFamily: 'var(--font-mono)',
        fontSize: 10.5, letterSpacing: '.16em', fontWeight: 500,
        padding: '4px 8px', borderRadius: 4, whiteSpace: 'nowrap',
        background: live ? 'var(--accent-tint)' : 'var(--paper-2)',
        color: live ? 'var(--accent-ink)' : 'var(--ink-3)',
        border: '1px solid ' + (live ? 'var(--accent-tint-2)' : 'var(--line)')
      }}>
        {live ? 'IN COHORT NOW' : 'COMING NEXT'}
      </span>
    </div>);

}

function SpecialtyRollout({ go, variant = 'full' }) {
  if (variant === 'table') {
    return (
      <section className="section section-divider">
        <div className="cmd-container">
          <div style={{
            display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between',
            gap: 24, flexWrap: 'wrap', marginBottom: 24
          }}>
            <div style={{ flex: '1 1 100%' }}>
              <div className="eyebrow" style={{ marginBottom: 8 }}>Specialty rollout</div>
              <h2 className="h-2" style={{
                fontSize: 'clamp(24px, 2.2vw, 34px)', margin: 0,
                letterSpacing: '-0.025em', lineHeight: 1.08
              }}>
                Starting with procedural specialties.<br /><span style={{ color: 'var(--accent)' }}>Built to go everywhere care does.</span>
              </h2>
              <p className="lede" style={{ marginTop: 18, marginBottom: 0, fontSize: 18.5, lineHeight: 1.5, maxWidth: 'none', color: 'var(--ink-2)' }}>
                Live with Interventional Pain Medicine practices today, expanding into in-patient
                and out-patient care, medications, imaging, and beyond.
              </p>
            </div>
            <div style={{ display: 'flex', gap: 16, flexWrap: 'wrap', fontSize: 12.5, color: 'var(--ink-3)' }}>
              {[['live', 'In cohort now'], ['next', 'Launching next'], ['roadmap', 'On the roadmap']].map(([k, label]) =>
              <span key={k} style={{ display: 'inline-flex', alignItems: 'center', gap: 7 }}>
                  <span style={{
                  width: 8, height: 8, borderRadius: 999, background: SPECIALTY_STATUS[k].dot,
                  boxShadow: k === 'live' ? '0 0 0 3px rgba(31,92,61,0.18)' : 'none'
                }} />
                  {label}
                </span>
              )}
            </div>
          </div>

          <div className="cols" style={{
            '--cols': 'repeat(3, 1fr)',
            border: '1px solid var(--line-2)', boxShadow: 'var(--shadow-card)',
            borderRadius: 14, overflow: 'hidden',
            background: 'var(--paper)'
          }}>
            {SPECIALTIES_ALL.map((s, i) => {
              const st = SPECIALTY_STATUS[s.status] || SPECIALTY_STATUS.roadmap;
              const col = i % 3;
              const row = Math.floor(i / 3);
              const rows = Math.ceil(SPECIALTIES_ALL.length / 3);
              const live = s.status === 'live';
              return (
                <div key={s.name} style={{
                  display: 'flex', alignItems: 'center', justifyContent: 'space-between',
                  gap: 10, padding: '13px 16px', minWidth: 0, minHeight: 56,
                  borderRight: col < 2 ? '1px solid var(--line)' : 0,
                  borderBottom: row < rows - 1 ? '1px solid var(--line)' : 0,
                  background: live ? 'var(--accent-tint)' : 'transparent'
                }}>
                  <span style={{ display: 'inline-flex', alignItems: 'flex-start', gap: 10, minWidth: 0 }}>
                    <span style={{
                      width: 7, height: 7, borderRadius: 999, flexShrink: 0, marginTop: 5,
                      background: st.dot,
                      boxShadow: live ? '0 0 0 3px rgba(31,92,61,0.16)' : 'none'
                    }} />
                    <span style={{
                      fontSize: 13.5, fontWeight: 500, letterSpacing: '-0.005em',
                      color: s.status === 'roadmap' ? 'var(--ink-2)' : 'var(--ink)',
                      lineHeight: 1.25
                    }}>{s.name}</span>
                  </span>
                  <span className="mono" style={{
                    fontSize: 9.5, letterSpacing: '.1em', fontWeight: 500, flexShrink: 0,
                    padding: '3px 6px', borderRadius: 4, whiteSpace: 'nowrap',
                    background: st.tagBg, color: st.tagInk, border: '1px solid ' + st.tagBorder
                  }}>{st.tag}</span>
                </div>);

            })}
          </div>

          <p style={{ marginTop: 18, fontSize: 13.5, color: 'var(--ink-3)', lineHeight: 1.5 }}>
            Don't see your specialty?{' '}
            <a href="mailto:develop@criterionmd.com"
            style={{ color: 'var(--accent)', borderBottom: '1px solid var(--accent-tint-2)', paddingBottom: 1 }}>
              Tell us what you need built
            </a>{' '}— we prioritize the roadmap with the practices in our cohort.
          </p>
        </div>
      </section>);

  }

  if (variant === 'compact') {
    return (
      <section className="section-tight section-divider">
        <div className="cmd-container">
          <div style={{
            display: 'flex', alignItems: 'center', justifyContent: 'space-between',
            gap: 20, padding: '18px 24px',
            background: 'var(--paper)', border: '1px solid var(--line-2)',
            boxShadow: 'var(--shadow-card)', borderRadius: 14,
            flexWrap: 'wrap'
          }}>
            <div className="mono" style={{
              fontSize: 11, letterSpacing: '.16em', color: 'var(--ink-3)',
              flexShrink: 0
            }}>SPECIALTY ROLLOUT</div>
            <div style={{
              display: 'flex', flexWrap: 'wrap', gap: 10, flex: 1,
              justifyContent: 'center'
            }}>
              {SPECIALTY_ROLLOUT.map((it) => {
                const live = it.status === 'live';
                return (
                  <span key={it.name} style={{
                    display: 'inline-flex', alignItems: 'center', gap: 8,
                    padding: '6px 12px 6px 10px', borderRadius: 999,
                    background: live ? 'var(--accent-tint)' : 'var(--bg)',
                    border: '1px solid ' + (live ? 'var(--accent-tint-2)' : 'var(--line)'),
                    fontSize: 13, fontWeight: 500,
                    color: live ? 'var(--accent-ink)' : 'var(--ink-2)',
                    whiteSpace: 'nowrap'
                  }}>
                    <span style={{
                      width: 6, height: 6, borderRadius: 999,
                      background: live ? 'var(--accent)' : 'var(--ink-4)',
                      boxShadow: live ? '0 0 0 3px rgba(31,92,61,0.18)' : 'none'
                    }} />
                    {it.name}
                    <span className="mono" style={{
                      fontSize: 10, letterSpacing: '.14em', fontWeight: 500,
                      color: live ? 'var(--accent)' : 'var(--ink-3)',
                      paddingLeft: 4, borderLeft: '1px solid ' + (live ? 'var(--accent-tint-2)' : 'var(--line)')
                    }}>
                      {live ? 'IN COHORT' : 'NEXT'}
                    </span>
                  </span>);

              })}
            </div>
            {go &&
            <a href="#" onClick={(e) => {e.preventDefault();go('insurify');}}
            style={{
              color: 'var(--accent)', fontSize: 13.5, fontWeight: 500,
              display: 'inline-flex', alignItems: 'center', gap: 6,
              borderBottom: '1px solid var(--accent-tint-2)', paddingBottom: 2,
              flexShrink: 0
            }}>
                See the rollout <ArrowRight />
              </a>
            }
          </div>
        </div>
      </section>);

  }

  // Full variant — used on Insurify and Solutions pages
  return (
    <section className="section section-divider">
      <div className="cmd-container">
        <div className="cols" style={{ '--cols': '1fr 1.6fr', gap: 56, alignItems: 'start' }}>
          <div>
            <div className="eyebrow" style={{ marginBottom: 8 }}>Specialty rollout</div>
            <h2 className="h-2" style={{
              fontSize: 'clamp(24px, 2.2vw, 34px)', margin: 0, textWrap: 'balance',
              letterSpacing: '-0.025em'
            }}>
              Starting with procedural specialties.{' '}<span style={{ color: 'var(--accent)' }}>Built to go everywhere care does.</span>
            </h2>
            <p className="sr-copy-d" style={{
              marginTop: 16, marginBottom: 0, fontSize: 16, lineHeight: 1.6,
              color: 'var(--ink-2)'
            }}>
              Insurify is currently rolling out with Interventional Pain Medicine practices in our
              design-partner cohort. Procedural specialties come first, then in-patient and
              out-patient care, medications, imaging, and other departments where coverage gets
              in the way.
            </p>
            <p className="sr-copy-m" style={{ display: 'none' }}>
              Live with Interventional Pain Medicine today. Procedural specialties come
              first, then everywhere coverage slows care down.
            </p>
            <a href="mailto:develop@criterionmd.com" className="sr-email"
            style={{
              display: 'inline-flex', alignItems: 'center', gap: 6, marginTop: 18,
              fontSize: 14, fontWeight: 500, color: 'var(--accent)',
              borderBottom: '1px solid var(--accent-tint-2)', paddingBottom: 2
            }}>
              Want your specialty added? Email us <ArrowRight />
            </a>
          </div>
          <div className="sr-panel-d" style={{
            background: 'var(--paper)', border: '1px solid var(--line-2)',
            boxShadow: 'var(--shadow-card)', borderRadius: 14, padding: '14px 28px'
          }}>
            {SPECIALTY_ROLLOUT.map((it, i) =>
            <div key={it.name} style={{
              borderBottom: i < SPECIALTY_ROLLOUT.length - 1 ? '1px solid var(--line-2)' : 0
            }}>
                <SpecialtyRow item={it} />
              </div>
            )}
            <div className="sr-footnote" style={{
              marginTop: 14, paddingTop: 14, borderTop: '1px solid var(--line)',
              fontSize: 13, color: 'var(--ink-3)', lineHeight: 1.5
            }}>
              More procedural specialties on the roadmap, being shaped with our design-partner cohort.
            </div>
          </div>

          {/* Mobile: swipeable cards, 4 specialties per card */}
          <div className="snap-cards peek-cards sr-carousel" style={{ display: 'none' }}>
            {(() => {
              const cards = [];
              for (let i = 0; i < SPECIALTIES_ALL.length; i += 4) cards.push(SPECIALTIES_ALL.slice(i, i + 4));
              return cards.map((card, ci) => (
                <div key={ci} style={{
                  background: 'var(--paper)', border: '1px solid var(--line-2)',
                  boxShadow: 'var(--shadow-card)', borderRadius: 14, padding: '8px 18px'
                }}>
                  {card.map((it, i) => {
                    const live = it.status === 'live';
                    const next = it.status === 'next' && SPECIALTY_ROLLOUT.some((r) => r.name === it.name);
                    return (
                      <div key={it.name} style={{
                        display: 'flex', alignItems: 'center', gap: 12, padding: '13px 0',
                        borderBottom: i < card.length - 1 ? '1px solid var(--line-2)' : 0
                      }}>
                        <span style={{
                          width: 3, alignSelf: 'stretch', borderRadius: 2, flexShrink: 0,
                          background: live ? 'var(--accent)' : 'var(--line)'
                        }}></span>
                        <span style={{
                          flex: 1, minWidth: 0, fontSize: 14.5, fontWeight: 500,
                          letterSpacing: '-0.01em', lineHeight: 1.3,
                          color: live || next ? 'var(--ink)' : 'var(--ink-3)'
                        }}>{it.name}</span>
                        <span style={{
                          fontFamily: 'var(--font-mono)', fontSize: 9.5, letterSpacing: '.12em',
                          fontWeight: 500, padding: '3px 7px', borderRadius: 4, whiteSpace: 'nowrap',
                          background: live ? 'var(--accent-tint)' : 'var(--paper-2)',
                          color: live ? 'var(--accent-ink)' : next ? 'var(--accent)' : 'var(--ink-3)',
                          border: '1px solid ' + (live || next ? 'var(--accent-tint-2)' : 'var(--line)')
                        }}>{live ? 'IN COHORT NOW' : next ? 'COMING NEXT' : 'COMING SOON'}</span>
                      </div>
                    );
                  })}
                </div>
              ));
            })()}
          </div>
        </div>
      </div>
    </section>);

}

// ── Outcomes / business case ─────────────────────────────────────────────────
// Reframes the old "Why we exist" stats as a positive business case, in the
// style peer enterprise sites use ("AI that pays for itself, and then some").
function HomeOutcomes() {
  const ITEMS = [
  {
    n: '01',
    head: "Recover the revenue you've already earned.",
    body: 'US ambulatory practices typically lose 5–11% of physician revenue to denials, write-offs, and underpayments. CriterionMD closes that gap.',
    stat: '5–11%', statLabel: 'physician revenue typically lost to denials',
    src: 'Sources: Change Healthcare Denials Index; MGMA industry reporting on denial write-offs.'
  },
  {
    n: '02',
    head: 'Give physicians their afternoons back.',
    body: 'Most initial denials are never reworked because the rework is too expensive. CriterionMD makes it cheap, and the queue small.',
    stat: '~65%', statLabel: 'of initial denials never reworked or appealed',
    src: 'Source: MGMA industry reporting on denial rework and resubmission rates.'
  },
  {
    n: '03',
    head: 'See the policy change before the denial.',
    body: 'Major payers publish thousands of medical-policy revisions every year. CriterionMD watches them and flags the active patients affected.',
    stat: '1,000s/yr', statLabel: 'payer-policy revisions tracked',
    src: 'Source: CriterionMD analysis of published payer medical-policy updates.'
  }];

  return (
    <section className="section section-divider">
      <div className="cmd-container">
        <div style={{ marginBottom: 22 }}>
          <h2 className="h-2" style={{
            fontSize: 'clamp(24px, 2.2vw, 34px)', margin: 0, lineHeight: 1.08
          }}>
            Built to{' '}
            <span style={{ color: 'var(--accent)' }}>pay for itself</span>
            , and then some.
          </h2>
        </div>

        <div className="grid-3 snap-cards" style={{ gap: 20 }}>
          {ITEMS.map((it) =>
          <article key={it.n} style={{
            background: 'var(--paper)', border: '1px solid var(--line-2)',
            boxShadow: 'var(--shadow-card)', borderRadius: 14, padding: '28px 28px 28px',
            display: 'flex', flexDirection: 'column'
          }}>
              <div style={{
              display: 'flex', justifyContent: 'flex-end',
              alignItems: 'baseline', marginBottom: 22
            }}>
                <span style={{
                fontSize: 'clamp(32px, 3.4vw, 44px)', fontWeight: 500,
                letterSpacing: '-0.035em', lineHeight: 1, color: 'var(--accent)'
              }}>{it.stat}</span>
              </div>
              <h3 style={{
              fontSize: 20, fontWeight: 500, letterSpacing: '-0.018em',
              lineHeight: 1.25, color: 'var(--ink)', margin: 0, textWrap: 'balance'
            }}>
                {it.head}
              </h3>
              <p style={{
              marginTop: 12, marginBottom: 0, fontSize: 15, lineHeight: 1.55,
              color: 'var(--ink-2)', flex: 1
            }}>{it.body}</p>
              <div style={{
              marginTop: 18, paddingTop: 14, borderTop: '1px solid var(--line)',
              fontSize: 12, color: 'var(--ink-3)',
              fontFamily: 'var(--font-mono)', letterSpacing: '.06em',
              textTransform: 'uppercase'
            }}>
                {it.statLabel}
              </div>
              <div style={{
              marginTop: 10, fontSize: 11.5, color: 'var(--ink-4)', lineHeight: 1.5
            }}>
                {it.src}
              </div>
            </article>
          )}
        </div>
        <p style={{
          marginTop: 18, marginBottom: 0, fontSize: 12.5, color: 'var(--ink)',
          textAlign: 'center', lineHeight: 1.4
        }}>
          Figures reflect published industry reporting and CriterionMD design-partner experience; sources noted per figure.
        </p>
      </div>
    </section>);

}

// ── Customer spotlight (multi-voice carousel) ──────────────────────────────
// Rotates 5 named, titled voices from different settings (single-specialty
// group, academic AMC, enterprise CMIO, surgical center, RCM). Pauses on hover.
// Each voice carries its own three pilot stats — the way peer enterprise
// healthcare sites anchor quotes with measurable outcomes.
function HomeCustomerSpotlight() {
  const VOICES = [
  {
    initials: 'HK', tint: '#1F5C3D',
    quote: `Every practice I've run has had five vendors that sort of solve five different pieces of the same problem. CriterionMD is the first thing I've seen that {connects} them, and starts where the money actually leaks.`,
    quoteShort: `CriterionMD is the first thing I've seen that {connects} them, and starts where the money actually leaks.`,
    name: 'Husban Khan',
    role: 'Clinical Administrator',
    org: 'Southeast Michigan Surgical Hospital',
    setting: 'Multi-specialty surgical hospital',
    stats: [
    { v: '$83K', l: 'denial revenue recovered in the first 90 days' },
    { v: '10 days', l: 'reduction in procedure authorization time' }]

  }];


  // Single static spotlight — no rotation, no carousel affordances.
  const idx = 0;
  const v = VOICES[idx];

  // Render a quote string with {emphasis} markers as inline accents.
  const renderQuote = (q) => {
    const parts = q.split(/(\{[^}]+\})/g);
    return parts.map((p, i) => {
      if (p.startsWith('{') && p.endsWith('}')) {
        return (
          <em key={i} style={{
            color: 'var(--accent)', fontStyle: 'normal',
            background: 'var(--accent-tint)', padding: '0 4px',
            borderRadius: 4
          }}>{p.slice(1, -1)}</em>);

      }
      return <React.Fragment key={i}>{p}</React.Fragment>;
    });
  };

  return (
    <section className="section section-divider band-emerald emerald-field">
      <div className="cmd-container">
        <div style={{
          display: 'flex', alignItems: 'flex-end', justifyContent: 'space-between',
          marginBottom: 28, gap: 24, flexWrap: 'wrap'
        }}>
          <div style={{ flex: '1 1 100%' }}>
            <h2 className="h-2" style={{
              fontSize: 'clamp(24px, 2.2vw, 34px)', margin: 0, color: '#fff',
              letterSpacing: '-0.025em', lineHeight: 1.08
            }}>
              Built alongside the practices that{' '}
              <span style={{ color: '#5FD39A' }}>actually use it.</span>
            </h2>
          </div>
          {VOICES.length > 1 &&
          <div style={{
            display: 'flex', alignItems: 'center', gap: 12,
            fontFamily: 'var(--font-mono)', fontSize: 12,
            letterSpacing: '.12em', color: 'var(--ink-3)'
          }}>
              {String(idx + 1).padStart(2, '0')} / {String(VOICES.length).padStart(2, '0')}
            </div>
          }
        </div>

        <div className="cols pilot-cols snap-cards" style={{
          background: 'var(--paper)', border: '1px solid var(--line-2)',
          boxShadow: 'var(--shadow-card-lg)', borderRadius: 18, overflow: 'hidden',
          '--cols': '1.5fr 1fr', alignItems: 'stretch',
          minHeight: 360
        }}>
          <div key={'l-' + v.name} style={{
            padding: '44px 44px',
            display: 'flex', flexDirection: 'column',
            justifyContent: 'space-between', gap: 28,
            opacity: 1,
            animation: VOICES.length > 1 ? 'psPaneIn .45s cubic-bezier(.2,.7,.2,1) both' : 'none'
          }}>
            <div style={{
              display: 'flex', alignItems: 'center', justifyContent: 'space-between'
            }}>
              <svg width="40" height="32" viewBox="0 0 40 32" fill="none"
              style={{ color: 'var(--accent)', opacity: 0.45 }}>
                <path d="M0 32V19.2C0 14.13 0.97 9.79 2.92 6.18C4.93 2.51 7.93 0.45 11.93 0v6.55c-4.5 1.27-6.75 4.55-6.75 9.85h6.75V32H0Zm21.84 0V19.2c0-5.07 1-9.41 2.99-13.02C26.88 2.51 29.89 0.45 33.93 0v6.55c-4.5 1.27-6.75 4.55-6.75 9.85h6.75V32H21.84Z"
                fill="currentColor" />
              </svg>
            </div>
            <blockquote style={{
              margin: 0, fontSize: 'clamp(16px, 1.55vw, 22px)', fontWeight: 450,
              letterSpacing: '-0.018em', lineHeight: 1.4, color: 'var(--ink)',
              textWrap: 'pretty'
            }}>
              <span className="pq-full">"{renderQuote(v.quote)}"</span>
              <span className="pq-short" style={{ display: 'none' }}>"{renderQuote(v.quoteShort || v.quote)}"</span>
            </blockquote>
            <div style={{ display: 'flex', alignItems: 'center', gap: 14 }}>
              <div style={{
                width: 44, height: 44, borderRadius: 999,
                background: v.tint + '14', border: '1px solid ' + v.tint + '33',
                color: v.tint,
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                fontWeight: 500, fontSize: 14, letterSpacing: '.02em',
                flexShrink: 0
              }}>{v.initials}</div>
              <div>
                <div style={{ fontWeight: 500, color: 'var(--ink)', fontSize: 15 }}>{v.name}</div>
                <div style={{ fontSize: 13.5, color: 'var(--ink)', marginTop: 2 }}>
                  {v.role} · {v.org}
                </div>
              </div>
            </div>
          </div>

          <div key={'r-' + v.name} style={{
            background: 'var(--bg)', borderLeft: '1px solid var(--line)',
            padding: '40px 36px', display: 'flex', flexDirection: 'column',
            justifyContent: 'space-between', gap: 20,
            opacity: 1,
            animation: VOICES.length > 1 ? 'psPaneIn .55s cubic-bezier(.2,.7,.2,1) both' : 'none'
          }}>
            <div className="mono" style={{
              fontSize: 12, letterSpacing: '.16em', color: 'var(--ink)'
            }}>
              FROM THE PILOT
            </div>
            <div style={{ display: 'grid', gap: 22 }}>
              {v.stats.map((s, i) =>
              <div key={s.l} style={{
                opacity: 1,
                animation: VOICES.length > 1 ? `psBulletIn .5s ease ${0.15 + i * 0.08}s both` : 'none'
              }}>
                  <div style={{
                  fontSize: 28, fontWeight: 500, letterSpacing: '-0.025em',
                  lineHeight: 1, color: 'var(--accent)'
                }}>{s.v}</div>
                  <div style={{
                  marginTop: 6, fontSize: 13, color: 'var(--ink)', lineHeight: 1.4
                }}>{s.l}</div>
                </div>
              )}
            </div>
            <div style={{
              fontSize: 12, color: 'var(--ink)',
              fontFamily: 'var(--font-mono)', letterSpacing: '.06em'
            }}>
              DESIGN-PARTNER PILOT · Q1 2026
            </div>
          </div>
        </div>

      </div>
    </section>);

}

// ── Security & trust band ────────────────────────────────────────────────────
// A compact compliance / posture summary near the bottom of the page — the kind
// of band peer healthcare-enterprise sites use to lock in trust before the
// final CTA. Links to the Security page already in the route table.
function HomeSecurityBand({ go }) {
  const ITEMS = [
  {
    title: 'HIPAA safeguards in place',
    sub: 'Administrative, physical, and technical safeguards, with PHI encrypted in transit and at rest and a completed security risk assessment.'
  },
  {
    title: 'BAA available',
    sub: 'Signed before any PHI ever touches the platform.'
  },
  {
    title: 'SOC 2 Type II',
    sub: 'Audit scheduled for Q4 2026.',
    tag: 'SCHEDULED'
  },
  {
    title: 'HITRUST CSF',
    sub: 'On our certification roadmap following SOC 2.',
    tag: 'PLANNED'
  }];

  return (
    <section className="section section-divider">
      <div className="cmd-container">
        <div className="cols pad-card" style={{
          background: 'var(--paper)', border: '1px solid var(--line-2)',
          boxShadow: 'var(--shadow-card-lg)', borderRadius: 18, padding: '44px 48px',
          '--cols': '1fr 1.5fr', gap: 56,
          alignItems: 'center'
        }}>
          <div>
            <div style={{
              display: 'flex', alignItems: 'center', gap: 10, marginBottom: 14
            }}>
              <span style={{
                width: 36, height: 36, borderRadius: 10, flexShrink: 0,
                background: 'var(--accent-tint)', color: 'var(--accent-ink)',
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                border: '1px solid var(--accent-tint-2)'
              }}>
                <ShieldIcon />
              </span>
              <span className="eyebrow" style={{ margin: 0 }}>Security &amp; trust</span>
            </div>
            <h2 className="h-2" style={{
              fontSize: 'clamp(24px, 2.2vw, 34px)', margin: 0, textWrap: 'balance',
              letterSpacing: '-0.025em'
            }}>
              Audit-grade,{' '}<span style={{ color: 'var(--accent)' }}>by default.</span>
            </h2>
            <p style={{
              marginTop: 14, marginBottom: 0,
              fontSize: 15, color: 'var(--ink-2)', lineHeight: 1.55
            }}>
              Built for environments where every authorization, policy revision, and revenue decision needs to be traceable back to the chart that produced it.
            </p>
            <a href="#" onClick={(e) => {e.preventDefault();go('security');}}
            style={{
              display: 'inline-flex', alignItems: 'center', gap: 6, marginTop: 20,
              fontSize: 14.5, fontWeight: 500, color: 'var(--accent)',
              borderBottom: '1px solid var(--accent-tint-2)', paddingBottom: 2
            }}>
              Read the security overview <ArrowRight />
            </a>
          </div>

          <div className="grid-2 snap-cards" style={{ gap: 14 }}>
            {ITEMS.map((it) =>
            <div key={it.title} style={{
              padding: '20px 20px', background: 'var(--bg)',
              border: '1px solid var(--line)', borderRadius: 12,
              display: 'flex', gap: 14, alignItems: 'flex-start'
            }}>
                <div style={{
                width: 36, height: 36, borderRadius: 10, flexShrink: 0,
                background: 'var(--paper)', border: '1px solid var(--line)',
                color: 'var(--accent)',
                display: 'flex', alignItems: 'center', justifyContent: 'center'
              }}>
                  <ShieldIcon />
                </div>
                <div style={{ minWidth: 0, flex: 1 }}>
                  <div style={{
                  display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap'
                }}>
                    <span style={{
                    fontSize: 14.5, fontWeight: 500, color: 'var(--ink)',
                    letterSpacing: '-0.01em'
                  }}>
                      {it.title}
                    </span>
                    {it.tag &&
                  <span className="mono" style={{
                    fontSize: 10, letterSpacing: '.12em', fontWeight: 500,
                    padding: '2px 6px', borderRadius: 4,
                    background: 'var(--warn-tint)', color: 'var(--warn)'
                  }}>{it.tag}</span>
                  }
                  </div>
                  <div style={{
                  fontSize: 13, color: 'var(--ink-3)',
                  marginTop: 6, lineHeight: 1.45
                }}>{it.sub}</div>
                </div>
              </div>
            )}
          </div>
        </div>
      </div>
    </section>);

}

function ShieldIcon() {
  return (
    <svg width="18" height="18" viewBox="0 0 18 18" fill="none">
      <path d="M9 1.5l6 2v5.5c0 3.6-2.6 6.3-6 7.5C5.6 15.3 3 12.6 3 9V3.5l6-2Z"
      stroke="currentColor" strokeWidth="1.4" strokeLinejoin="round" />
      <path d="M6 9l2.4 2.4L12 7.5" stroke="currentColor" strokeWidth="1.4"
      strokeLinecap="round" strokeLinejoin="round" />
    </svg>);

}

// ── Split CTA (preserved from original) ──────────────────────────────────────
// ── Live products (homepage) — two cards, everything else lives lower ───────
function HomeLiveProducts({ go }) {
  const insCol = PRODUCT_COLORS.insurify;
  const cqCol = PRODUCT_COLORS.codequickref;
  const CARDS = [
  {
    key: 'insurify', name: 'Insurify™', c: insCol,
    what: 'Reads the clinical note and shows what the payer requires before the prior authorization goes out.',
    solves: 'Preventable denials and documentation rework',
    audience: 'Physicians & APPs · Free in public beta',
    short: 'Checks your note against payer requirements as you write.',
    cta: 'Get Insurify free', ctaGo: 'access', more: null
  },
  {
    key: 'codequickref', name: 'Code QuickRef™', c: cqCol,
    what: 'Chrome extension that finds the right ICD-10 code from a plain-language description of symptoms.',
    solves: 'Hunting for exact code verbiage',
    audience: 'Physicians & APPs · Free in public beta',
    short: 'Plain-language ICD-10 lookup, inside any EHR.',
    cta: 'See Code QuickRef', ctaGo: 'solutions', ctaAnchor: 'code-quickref', more: null
  }];

  return (
    <section className="section section-divider live-today">
      <div className="cmd-container">
        <div style={{ marginBottom: 20 }}>
          <div className="eyebrow" style={{ marginBottom: 8, color: 'var(--ink)' }}>Live today</div>
          <h2 className="h-2" style={{ margin: 0 }}>
            Two tools you can use{' '}
            <span style={{ color: 'var(--accent)' }}>now.</span>
          </h2>
        </div>
        <div className="grid-2 snap-cards" style={{ gap: 20 }}>
          {CARDS.map((p) =>
          <div key={p.key} className="card" style={{
            padding: '28px 28px 24px', display: 'flex', flexDirection: 'column', gap: 0
          }}>
              <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 16 }}>
                <span style={{
                width: 40, height: 40, borderRadius: 11, background: p.c.tile, color: p.c.glyph,
                display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0
              }}>
                  <ProductMark k={p.key} size={22} />
                </span>
                <span style={{ fontSize: 20, fontWeight: 500, letterSpacing: '-0.015em' }}>{p.name}</span>
                <span className="pill" style={{ marginLeft: 'auto' }}>
                  <span className="pill-dot"></span> Beta
                </span>
              </div>
              <p className="lt-desc" style={{ fontSize: 15.5, lineHeight: 1.5, color: 'var(--ink)', margin: 0 }}>
                {p.what}
              </p>
              <p className="lt-short" style={{ display: 'none' }}>{p.short}</p>
              <div style={{
              marginTop: 16, paddingTop: 14, borderTop: '1px solid var(--line)',
              display: 'flex', flexDirection: 'column', gap: 6, fontSize: 13, color: 'var(--ink-3)'
            }}>
                <span><strong style={{ fontWeight: 500, color: 'var(--ink-2)' }}>Solves:</strong> {p.solves}</span>
              </div>
              <div style={{ display: 'flex', gap: 10, marginTop: 20 }}>
                <button className="btn btn-arrow" style={{ background: p.c.tile, color: '#fff' }}
              onClick={() => {
                go(p.ctaGo);
                if (p.ctaAnchor) {
                  // after the route renders, scroll the anchored section into view
                  setTimeout(() => {
                    const el = document.getElementById(p.ctaAnchor);
                    if (el) {
                      const y = el.getBoundingClientRect().top + window.scrollY - 90;
                      window.scrollTo({ top: y, behavior: 'instant' });
                    }
                  }, 60);
                }
              }}>
                  {p.cta} <ArrowRight />
                </button>
                {p.more &&
              <button className="btn btn-outline" onClick={() => go(p.more)}>
                    Learn more
                  </button>
              }
              </div>
            </div>
          )}
        </div>
      </div>
    </section>);

}

// ── How Insurify works — 3 steps, one line each ─────────────────────────────
function HomeHowItWorks() {
  const STEPS = [
  { n: '01', t: 'Write the note', s: 'Document the way you always have. No templates, no dropdowns.' },
  { n: '02', t: 'Insurify maps the payer\u2019s criteria', s: 'Procedure and payer detected; the policy is checked line by line.' },
  { n: '03', t: 'Close gaps before submission', s: 'Fix what\u2019s missing while the patient is still in the room.' }];

  return (
    <section className="section section-divider band-warm">
      <div className="cmd-container">
        <div style={{ marginBottom: 20 }}>
          <h2 className="h-2" style={{ margin: 0 }}>
            Write the note.{' '}
            <span style={{ color: 'var(--accent)' }}>Insurify checks it</span>
            {' '}against the payer.
          </h2>
        </div>
        <div className="grid-3 snap-cards" style={{ gap: 20 }}>
          {STEPS.map((st) =>
          <div key={st.n} style={{
            background: 'var(--paper)', border: '1px solid var(--line-2)',
            boxShadow: 'var(--shadow-card)', borderRadius: 14, padding: '24px 24px 22px'
          }}>
              <div style={{ fontSize: 20, fontWeight: 500, letterSpacing: '-0.015em', color: 'var(--ink)' }}>
                {st.t}
              </div>
              <p style={{ margin: '8px 0 0', fontSize: 15, lineHeight: 1.5, color: 'var(--ink-2)' }}>
                {st.s}
              </p>
            </div>
          )}
        </div>
      </div>
    </section>);

}

// ── Coming next — desktop: slim strip · mobile: titled card ────────────────
function HomeComingNext() {
  const items = PLATFORM_PRODUCTS.filter((p) => p.status !== 'available');
  return (
    <section className="section-tight section-divider">
      <div className="cmd-container">
        {/* Desktop strip */}
        <div className="cn-desktop" style={{
          display: 'flex', alignItems: 'center', gap: 20, flexWrap: 'wrap',
          padding: '14px 20px', border: '1px solid var(--line)', borderRadius: 12,
          background: 'var(--paper-2)'
        }}>
          <span className="eyebrow" style={{ fontSize: 11, color: 'var(--ink)' }}>Coming next</span>
          <span style={{
            flex: 1, display: 'inline-flex', alignItems: 'center', gap: 20,
            flexWrap: 'wrap', justifyContent: 'center'
          }}>
          {items.map((p) => {
            const c = PRODUCT_COLORS[p.key] || PRODUCT_COLORS.insurify;
            return (
              <span key={p.key} style={{
                display: 'inline-flex', alignItems: 'center', gap: 8,
                fontSize: 13.5, color: 'var(--ink-2)', fontWeight: 500
              }}>
                <span style={{
                  width: 22, height: 22, borderRadius: 6, background: c.tile, color: c.glyph,
                  display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0
                }}>
                  <ProductMark k={p.key} size={13} />
                </span>
                {p.name}
              </span>
            );
          })}
          </span>
        </div>

        {/* Mobile: header + centered subtitle above a spaced product card */}
        <div className="cn-mobile" style={{ display: 'none' }}>
          <div className="eyebrow" style={{ textAlign: 'center', marginBottom: 12, color: 'var(--ink)' }}>Coming next</div>
          <div className="card" style={{ padding: '18px 16px' }}>
            <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '16px 12px' }}>
              {items.map((p) => {
                const c = PRODUCT_COLORS[p.key] || PRODUCT_COLORS.insurify;
                return (
                  <span key={p.key} style={{
                    display: 'inline-flex', alignItems: 'center', gap: 9,
                    fontSize: 13.5, color: 'var(--ink-2)', fontWeight: 500, minWidth: 0
                  }}>
                    <span style={{
                      width: 24, height: 24, borderRadius: 7, background: c.tile, color: c.glyph,
                      display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0
                    }}>
                      <ProductMark k={p.key} size={14} />
                    </span>
                    <span style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{p.name}</span>
                  </span>
                );
              })}
            </div>
          </div>
        </div>
      </div>
    </section>);

}

function HomeSplitCTA({ go }) {
  return (
    <section className="section section-divider">
      <div className="cmd-container">
        <div className="grid-2" style={{ gap: 20 }}>
          <div style={{
            background: 'radial-gradient(120% 100% at 0% 0%, #1f7350 0%, rgba(31,115,80,0) 55%), linear-gradient(155deg, #0e4733 0%, #082a1f 100%)',
            color: '#fff',
            borderRadius: 18, padding: '48px 40px', border: '1px solid rgba(255,255,255,0.10)',
            display: 'flex', flexDirection: 'column', justifyContent: 'space-between', gap: 32
          }}>
            <div>
              <span className="pill" style={{ background: '#fff', borderColor: 'transparent' }}>
                For physicians &amp; APPs
              </span>
              <h2 className="h-2" style={{ marginTop: 20, color: '#fff' }}>
                Get Insurify,{' '}<span style={{ color: '#5FD39A' }}>free.</span>
              </h2>
              <p style={{
                fontSize: 15, color: 'rgba(255,255,255,0.82)',
                marginTop: 12, marginBottom: 0, lineHeight: 1.55
              }}>
                Sign up with your work email and NPI. Free for individual clinicians.
                About 90 seconds.
              </p>
            </div>
            <button className="btn btn-lg btn-arrow"
            style={{ background: '#fff', color: 'var(--accent-ink)', alignSelf: 'flex-start' }}
            onClick={() => go('access')}>
              Start free with NPI <ArrowRight />
            </button>
          </div>
          <div style={{
            background: 'var(--accent-tint)', color: 'var(--accent-ink)', borderRadius: 18,
            padding: '48px 40px', border: '1px solid var(--accent-tint-2)',
            display: 'flex', flexDirection: 'column', justifyContent: 'space-between', gap: 32
          }}>
            <div>
              <span className="pill"
              style={{ background: '#fff', borderColor: 'var(--accent-tint-2)' }}>
                For practices &amp; health orgs
              </span>
              <h2 className="h-2" style={{ marginTop: 20, color: 'var(--accent-ink)' }}>
                Scope a{' '}<span style={{ color: 'var(--accent)' }}>CriterionMD pilot.</span>
              </h2>
              <p style={{
                fontSize: 15, color: 'var(--accent-ink)', opacity: 0.85,
                marginTop: 12, marginBottom: 0, lineHeight: 1.55
              }}>
                Walk through the platform against your real payer mix, see the
                practice and enterprise solutions on the roadmap, and scope a pilot.
                Direct access to the founding team.
              </p>
            </div>
            <button className="btn btn-lg btn-primary btn-arrow"
            style={{ alignSelf: 'flex-start' }} onClick={() => go('demo')}>
              Request a practice demo <ArrowRight />
            </button>
          </div>
        </div>
      </div>
    </section>);

}

// Per-product brand colors. Each product gets its own identity while staying within a
// disciplined, premium palette. Insurify keeps the platform's pine green.
const PRODUCT_COLORS = {
  insurify: { tile: '#1F5C3D', glyph: '#FFFFFF', soft: '#EEF3EE', soft2: '#DDE7DE', ink: '#143C28' }, // forest
  codequickref: { tile: '#0E7A72', glyph: '#FFFFFF', soft: '#E4F3F1', soft2: '#BFE1DC', ink: '#0A4F49' }, // teal
  notes: { tile: '#3F3A89', glyph: '#FFFFFF', soft: '#EFEEF7', soft2: '#DCDAEF', ink: '#272566' }, // indigo
  authdesk: { tile: '#1E8A55', glyph: '#FFFFFF', soft: '#E6F2EC', soft2: '#C8E1D3', ink: '#0F5536' }, // emerald
  rcmiq: { tile: '#8A5A1B', glyph: '#FFFFFF', soft: '#F7EFE0', soft2: '#EAD9B8', ink: '#5A3D14' }, // copper
  denials: { tile: '#A33A2E', glyph: '#FFFFFF', soft: '#F7E8E5', soft2: '#EBC9C3', ink: '#6F2820' }, // crimson
  policy: { tile: '#28557A', glyph: '#FFFFFF', soft: '#E6EEF5', soft2: '#C5D5E3', ink: '#1A3C56' } // slate blue
};

function ProductMark({ k, size = 28 }) {
  // ScribeAware uses its own uploaded logo image on a white plate so it reads
  // on any background (dark product tiles, gradients, light menus).
  if (k === 'notes') {
    return (
      <span style={{
        width: size, height: size, borderRadius: Math.round(size * 0.22),
        background: '#fff', display: 'inline-flex', alignItems: 'center',
        justifyContent: 'center', overflow: 'hidden', flexShrink: 0
      }}>
        <img src={typeof window !== 'undefined' && window.__resources && window.__resources.scribeawareLogo || "assets/products/scribeaware.png"} alt="ScribeAware"
        width={Math.round(size * 0.82)} height={Math.round(size * 0.82)}
        style={{ display: 'block', objectFit: 'contain' }} />
      </span>);

  }
  const c = PRODUCT_COLORS[k] || PRODUCT_COLORS.insurify;
  const stroke = c.glyph;
  const accent = 'rgba(255,255,255,0.85)';
  const dim = 'rgba(255,255,255,0.35)';

  switch (k) {
    case 'insurify':{
        // Shield with a checkmark inside — verification / coverage
        return (
          <svg width={size} height={size} viewBox="0 0 32 32" fill="none">
            <path d="M16 4 L26 7 L26 16 C26 22 22 26.5 16 28.5 C10 26.5 6 22 6 16 L6 7 Z"
            stroke={stroke} strokeWidth="1.8" strokeLinejoin="round" />
            <path d="M11 16.5 L14.5 20 L21 12.5"
            stroke={stroke} strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round" />
          </svg>);
      }
    case 'notes':{
        // ScribeAware — bold diagonal pen stroke with a parallel dotted echo (AI awareness)
        return (
          <svg width={size} height={size} viewBox="0 0 32 32" fill="none">
          <path d="M6 24L22 4" stroke={dim} strokeWidth="1.5" strokeLinecap="round" strokeDasharray="1.4 3" />
          <path d="M10 28L26 8" stroke={stroke} strokeWidth="3" strokeLinecap="round" />
          <circle cx="26" cy="8" r="2.4" fill={accent} stroke="none" />
        </svg>);

      }
    case 'authdesk':{
        // Greenlight — three nested chevrons pointing right, accelerating opacity
        return (
          <svg width={size} height={size} viewBox="0 0 32 32" fill="none">
          <path d="M6 8l6 8-6 8" stroke={stroke} strokeWidth="2.2"
            strokeLinecap="round" strokeLinejoin="round" opacity="0.3" />
          <path d="M13 8l6 8-6 8" stroke={stroke} strokeWidth="2.2"
            strokeLinecap="round" strokeLinejoin="round" opacity="0.65" />
          <path d="M20 8l6 8-6 8" stroke={accent} strokeWidth="2.6"
            strokeLinecap="round" strokeLinejoin="round" />
        </svg>);

      }
    case 'rcmiq':{
        // Reckon — offset stacked ledger bars (financial balance)
        return (
          <svg width={size} height={size} viewBox="0 0 32 32" fill="none">
          <rect x="5" y="6" width="18" height="4" rx="1.5" fill={stroke} opacity="0.45" />
          <rect x="9" y="14" width="18" height="4" rx="1.5" fill={stroke} opacity="0.75" />
          <rect x="5" y="22" width="13" height="4" rx="1.5" fill={accent} />
          <circle cx="20" cy="24" r="2.2" fill={accent} stroke="none" />
        </svg>);

      }
    case 'denials':{
        // Rebound — a tight U-curve with an arrowhead pointing up-right (denial reversed)
        return (
          <svg width={size} height={size} viewBox="0 0 32 32" fill="none">
          <path d="M22 6c0 8-12 6-12 14a6 6 0 0 0 11 3.3"
            stroke={stroke} strokeWidth="2"
            strokeLinecap="round" strokeLinejoin="round" />
          <path d="M16 22l5.6 1.6L20 29" stroke={accent} strokeWidth="2"
            strokeLinecap="round" strokeLinejoin="round" />
          <circle cx="22" cy="6" r="2.2" fill={accent} stroke="none" />
        </svg>);

      }
    case 'policy':{
        // Sentinel — center point with two asymmetric arcing brackets (radar watch)
        return (
          <svg width={size} height={size} viewBox="0 0 32 32" fill="none">
          <path d="M5 11a12 12 0 0 1 9-6" stroke={stroke} strokeWidth="2"
            strokeLinecap="round" opacity="0.5" />
          <path d="M27 21a12 12 0 0 1-9 6" stroke={stroke} strokeWidth="2"
            strokeLinecap="round" opacity="0.5" />
          <circle cx="16" cy="16" r="5.5" stroke={stroke} strokeWidth="1.8" />
          <circle cx="16" cy="16" r="2.3" fill={accent} stroke="none" />
        </svg>);

      }
    case 'codequickref':{
        // Code QuickRef — magnifying glass over a code bracket (quick lookup)
        return (
          <svg width={size} height={size} viewBox="0 0 32 32" fill="none">
          <path d="M11 8l-6 8 6 8" stroke={stroke} strokeWidth="2"
            strokeLinecap="round" strokeLinejoin="round" opacity="0.5" />
          <path d="M18 8l6 8-6 8" stroke={stroke} strokeWidth="2"
            strokeLinecap="round" strokeLinejoin="round" opacity="0.5" />
          <circle cx="15" cy="15" r="5" stroke={accent} strokeWidth="2" />
          <path d="M18.8 18.8L22.5 22.5" stroke={accent} strokeWidth="2.2" strokeLinecap="round" />
        </svg>);

      }
    default:
      return null;
  }
}

// ─── SOLUTIONS PAGE ───────────────────────────────────────────────────────────

function RoadmapCard({ status, name, desc, active }) {
  return (
    <div className="card card-pad" style={{
      borderColor: active ? 'var(--accent-tint-2)' : 'var(--line)',
      background: active ? 'var(--accent-tint)' : 'var(--paper)'
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
        <span className="mono" style={{ fontSize: 12, letterSpacing: '.06em', color: active ? 'var(--accent-ink)' : 'var(--ink-3)' }}>
          {status.toUpperCase()}
        </span>
        {active &&
        <span style={{
          width: 8, height: 8, borderRadius: 999, background: 'var(--accent)',
          boxShadow: '0 0 0 4px rgba(31, 92, 61, 0.15)'
        }} />
        }
      </div>
      <div style={{ fontSize: 22, fontWeight: 500, letterSpacing: '-0.02em', color: 'var(--ink)' }}>{name}</div>
      <p style={{ fontSize: 14, color: 'var(--ink-2)', marginTop: 10, marginBottom: 0, lineHeight: 1.55 }}>{desc}</p>
    </div>);

}

// ── Insurify program clip — the SAME animated UI as the home-hero laptop, ────
// cropped to just the screen interior (no laptop chrome). Reuses the bundled
// promo clip; once the scene settles, a zoom transform is injected INSIDE the
// (same-origin) clip document so the laptop's screen exactly fills the
// embed viewport — one coordinate space, no cross-frame scaling drift.
function InsurifyAppClip() {
  const frameRef = React.useRef(null);
  const [ready, setReady] = React.useState(false);
  const [aspect, setAspect] = React.useState('522 / 286');
  React.useEffect(() => {
    let tries = 0;
    let last = null;
    let applied = null; // { s, l, t } currently-injected transform
    let aspectSet = false; // aspect is set ONCE — re-setting it re-flows the
                           // scene and the loop would chase its own tail
    // Bound the arrival. The crop loop can take an unpredictable amount of
    // time to converge; leaving the stage empty until it does meant a visitor
    // could stare at nothing for seconds and then get an unskippable fade.
    // At 1.6s we show the clip regardless — the crop keeps converging behind
    // it and lands as a layout-neutral transform.
    const showAnyway = setTimeout(() => setReady(true), 1600);
    const t = setInterval(() => {
      tries++;
      if (tries > 120) { clearInterval(t); return; }
      const f = frameRef.current;
      if (!f) return;
      let d;
      try { d = f.contentDocument; } catch (e) { clearInterval(t); return; }
      if (!d || !d.body || d.querySelectorAll('*').length < 20) return;
      const win = f.contentWindow;
      const screen = [...d.querySelectorAll('div')].find((el) =>
        win.getComputedStyle(el).backgroundColor === 'rgb(6, 35, 26)');
      if (!screen) return;
      const p = screen.getBoundingClientRect();
      if (!p.width) return;
      // Recover the UNtransformed screen rect: with transform-origin 0 0 and
      // scale(s) translate(-l,-t), a point q maps to s*(q - (l,t)).
      const cur = applied ?
        { l: p.left / applied.s + applied.l, t: p.top / applied.s + applied.t,
          w: p.width / applied.s, h: p.height / applied.s } :
        { l: p.left, t: p.top, w: p.width, h: p.height };
      const stable = last && Math.abs(cur.l - last.l) < 1 && Math.abs(cur.t - last.t) < 1 &&
          Math.abs(cur.w - last.w) < 1 && Math.abs(cur.h - last.h) < 1;
      // If the scene never fully settles (ambient motion), lock anyway after
      // ~10s rather than shipping the uncropped laptop.
      if (stable || (tries > 14 && !applied)) {
        const s = d.documentElement.clientWidth / cur.w;
        const need = !applied ||
          Math.abs(applied.s - s) > 0.005 ||
          Math.abs(applied.l - cur.l) > 1 || Math.abs(applied.t - cur.t) > 1;
        if (need) {
          const root = d.body.firstElementChild;
          d.body.style.overflow = 'hidden';
          root.style.transformOrigin = '0 0';
          root.style.transform = 'scale(' + s + ') translate(' + (-cur.l) + 'px, ' + (-cur.t) + 'px)';
          applied = { s: s, l: cur.l, t: cur.t };
          if (!aspectSet) {
            aspectSet = true;
            setAspect(cur.w + ' / ' + cur.h);
            setReady(true);
            clearTimeout(showAnyway);
          }
          // keep the loop alive: after the one-time aspect change the embed
          // resizes, the scene re-flows, and the next passes re-converge the
          // transform (transform updates are layout-neutral, so this settles)
        } else if (applied) {
          clearInterval(t); // converged
        }
      }
      last = cur;
    }, 700);
    return () => { clearInterval(t); clearTimeout(showAnyway); };
  }, []);
  return (
    <div style={{
      position: 'relative', width: '100%', aspectRatio: aspect,
      overflow: 'hidden', borderRadius: 10, background: '#06231A',
      boxShadow: '0 1px 0 rgba(15,20,20,.04), 0 24px 60px -24px rgba(10,53,39,.35)'
    }}>
      <iframe ref={frameRef} src="assets/insurify-promo-clip.html" title="Insurify product demonstration"
        scrolling="no"
        style={{
          position: 'absolute', inset: 0, width: '100%', height: '100%',
          border: 0, background: 'transparent', pointerEvents: 'none',
          overflow: 'hidden', opacity: ready ? 1 : 0, transition: 'opacity .28s ease'
        }} />
    </div>
  );
}

// ── Scale-to-fit wrapper for product mocks inside spotlight cards ──────────
// The app mocks have wide intrinsic layouts (split grids, long metadata rows)
// that can't reflow below ~designWidth. Instead of letting them blow the card
// grid open on narrow screens, render at designWidth and transform-scale down
// to the container. At desktop column widths scale ≈ 1 (no visual change).
function SpotScaledMock({ designWidth = 560, children }) {
  const boxRef = React.useRef(null);
  const innerRef = React.useRef(null);
  const [dim, setDim] = React.useState(null);
  React.useEffect(() => {
    const measure = () => {
      const box = boxRef.current, inner = innerRef.current;
      if (!box || !inner) return;
      const w = box.clientWidth;
      if (!w) return;
      const s = Math.min(1, w / designWidth);
      if (s < 1) {
        // measure the child's height at its design width before scaling
        inner.style.width = designWidth + 'px';
        setDim({ s, h: Math.ceil(inner.offsetHeight * s) });
      } else {
        inner.style.width = '100%';
        setDim({ s, h: 0 });
      }
    };
    measure();
    const t1 = setTimeout(measure, 350);
    const t2 = setTimeout(measure, 1200);
    window.addEventListener('resize', measure);
    return () => { window.removeEventListener('resize', measure); clearTimeout(t1); clearTimeout(t2); };
  }, [designWidth]);
  return (
    <div ref={boxRef} style={{ width: '100%', overflow: 'hidden', height: dim && dim.s < 1 ? dim.h : 'auto' }}>
      <div ref={innerRef} style={{
        // Wider than designWidth: render the child at container width (desktop
        // unchanged). Narrower: fix at designWidth and scale down to fit.
        width: dim && dim.s < 1 ? designWidth : '100%',
        transform: dim && dim.s < 1 ? 'scale(' + dim.s + ')' : 'none',
        transformOrigin: 'top left'
      }}>
        {children}
      </div>
    </div>
  );
}

// ── Insurify spotlight (Solutions page) ─────────────────────────────────────
// Scroll-triggered reveal: pill, heading, copy, CTAs and mock rise in on a
// staggered delay the first time the section enters view.
function InsurifySpotlight({ go }) {
  const ref = React.useRef(null);
  const [inView, setInView] = React.useState(false);
  React.useEffect(() => {
    const reduce = typeof window !== 'undefined' &&
      window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
    if (reduce) { setInView(true); return; }
    const el = ref.current;
    if (!el) { setInView(true); return; }
    const check = () => {
      const r = el.getBoundingClientRect();
      if (r.top < (window.innerHeight || 800) * 0.85 && r.bottom > 0) { setInView(true); return true; }
      return false;
    };
    if (check()) return;
    const onScroll = () => { if (check()) cleanup(); };
    const cleanup = () => window.removeEventListener('scroll', onScroll);
    window.addEventListener('scroll', onScroll, { passive: true });
    return cleanup;
  }, []);

  return (
    <section className="section section-divider" style={{ paddingTop: 32 }} ref={ref}>
      <style>{`
        @media (prefers-reduced-motion: no-preference) {
          /* Scroll reveal is transform-only: a stalled timeline then leaves
             the content 18px low but fully VISIBLE, never faded out. */
          .ib-rise { transform: translateY(18px); transition: transform .7s cubic-bezier(.2,.7,.2,1); }
          .ib-inview .ib-rise { transform: translateY(0); }
          .ib-inview .ib-rise-1 { transition-delay: .02s; }
          .ib-inview .ib-rise-2 { transition-delay: .12s; }
          .ib-inview .ib-rise-3 { transition-delay: .22s; }
          .ib-inview .ib-rise-4 { transition-delay: .30s; }
          .ib-inview .ib-rise-5 { transition-delay: .18s; }
          .ib-mock-float { animation: ibFloat 6s ease-in-out infinite; }
          @keyframes ibFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
        }
        .ib-pulse-dot { position: relative; }
        .ib-pulse-dot::after {
          content: ""; position: absolute; inset: -3px; border-radius: 999px;
          border: 1.5px solid var(--accent); opacity: 0;
        }
        @media (prefers-reduced-motion: no-preference) {
          .ib-pulse-dot::after { animation: ibPulse 2.2s ease-out infinite; }
        }
        @keyframes ibPulse { 0% { opacity: 0.55; transform: scale(0.6); } 100% { opacity: 0; transform: scale(2.2); } }
      `}</style>
      <div className={'cmd-container' + (inView ? ' ib-inview' : '')}>
        <div className="ib-rise ib-rise-1" style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 14 }}>
          <span className="eyebrow">In public beta</span>
          <span style={{ flex: 1, height: 1, background: 'var(--line)' }} />
        </div>
        <div className="card spotlight-card" style={{
          padding: 0, overflow: 'hidden',
          display: 'grid', gridTemplateColumns: '1fr 1.2fr', alignItems: 'stretch',
          background: 'var(--accent-tint)', borderColor: 'var(--accent-tint-2)'
        }}>
          <div style={{
            padding: '40px 40px', display: 'flex', flexDirection: 'column',
            justifyContent: 'space-between', gap: 24
          }}>
            <div>
              <div className="ib-rise ib-rise-2 ins-pills" style={{ display: 'flex', gap: 8, marginBottom: 16 }}>
                <span className="pill">
                  <span className="pill-dot ib-pulse-dot"></span> In public beta
                </span>
                <span className="pill pill-neutral" style={{ background: '#fff' }}>Free · NPI verified</span>
              </div>
              <h2 className="ib-rise ib-rise-3 h-2" style={{ color: 'var(--accent-ink)', textWrap: 'balance' }}>
                Insurify:{' '}<span style={{ color: 'var(--accent)' }}>real-time medical<br className="ins-card-br" style={{ display: 'none' }} />-necessity assistance.</span>
              </h2>
              <p className="ib-rise ib-rise-3 spot-copy-d" style={{
                fontSize: 15, color: 'var(--accent-ink)', opacity: 0.85,
                marginTop: 14, marginBottom: 0, lineHeight: 1.55
              }}>
                Reads the clinical note as it's written, identifies the procedure and payer,
                maps the documentation against the medical policy, and surfaces what's still
                missing before the authorization goes out. Free for NPI-verified physicians and APPs.
              </p>
              <p className="ib-rise ib-rise-3 spot-copy-m" style={{
                display: 'none', fontSize: 14.5, color: 'var(--accent-ink)', opacity: 0.85,
                marginTop: 12, marginBottom: 0, lineHeight: 1.5
              }}>
                Reads your note as you write and flags what the payer still needs.
              </p>
            </div>
            <div className="ib-rise ib-rise-4 spot-cta-row" style={{ display: 'flex', gap: 10 }}>
              <button className="btn btn-lg btn-arrow"
              style={{ background: 'var(--accent)', color: '#fff' }}
              onClick={() => go('access')}>
                Get Insurify free <ArrowRight />
              </button>
              <button className="btn btn-lg btn-outline"
              onClick={() => go('insurify')} style={{ background: '#fff' }}>
                Product details
              </button>
            </div>
          </div>
          <div className="ib-rise ib-rise-5 spotlight-mock" style={{ padding: '32px 32px 32px 0', display: 'flex', alignItems: 'center' }}>
            <div className="ib-mock-float" style={{ width: '100%' }}>
              <InsurifyAppClip />
            </div>
          </div>
        </div>
      </div>
    </section>);

}

function SolutionsPage({ go }) {
  return (
    <div data-screen-label="02 Solutions">
      <SolutionsHero go={go} />

      {/* In public beta: Insurify (Document layer) */}
      <InsurifySpotlight go={go} />

      {/* Specialty rollout — which specialties Insurify is rolling out for */}
      <SpecialtyRollout />

      {/* In public beta: Code QuickRef (coding assist, browser extension) */}
      <section className="section section-divider" id="code-quickref">
        <div className="cmd-container">
          <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 14 }}>
            <span className="eyebrow">In public beta</span>
            <span style={{ flex: 1, height: 1, background: 'var(--line)' }} />
          </div>
          <div className="card spotlight-card" style={{
            padding: 0, overflow: 'hidden',
            display: 'grid', gridTemplateColumns: '1.2fr 1fr', alignItems: 'stretch',
            background: PRODUCT_COLORS.codequickref.soft, borderColor: PRODUCT_COLORS.codequickref.soft2
          }}>
            <div style={{
              padding: '40px 40px', display: 'flex', flexDirection: 'column',
              justifyContent: 'space-between', gap: 24
            }}>
              <div>
                <div className="cqr-pills" style={{ display: 'flex', gap: 8, marginBottom: 16 }}>
                  <span className="pill" style={{ background: '#fff', color: PRODUCT_COLORS.codequickref.ink }}>
                    <span className="pill-dot" style={{ background: PRODUCT_COLORS.codequickref.tile }}></span> In public beta
                  </span>
                  <span className="pill pill-neutral" style={{ background: '#fff' }}>Free · Chrome extension</span>
                </div>
                <h2 className="h-2" style={{ color: PRODUCT_COLORS.codequickref.ink, textWrap: 'balance' }}>
                  Code QuickRef:{' '}<span style={{ color: PRODUCT_COLORS.codequickref.tile }}>Find the right ICD-10 code without knowing its exact verbiage.</span>
                </h2>
                <p className="spot-copy-d" style={{
                  fontSize: 15, color: PRODUCT_COLORS.codequickref.ink, opacity: 0.85,
                  marginTop: 14, marginBottom: 0, lineHeight: 1.55
                }}>
                  Describe a symptom or diagnosis the way you'd say it out loud, and Code QuickRef
                  suggests the closest-matching ICD-10 codes, ranked by fit. Runs as a Chrome
                  extension inside any EHR, so lookup never leaves the chart.
                </p>
                <p className="spot-copy-m" style={{
                  display: 'none', fontSize: 14.5, color: PRODUCT_COLORS.codequickref.ink, opacity: 0.85,
                  marginTop: 12, marginBottom: 0, lineHeight: 1.5
                }}>
                  Describe the diagnosis in plain words and get ranked ICD-10 matches. A free
                  Chrome extension that works inside any EHR.
                </p>
              </div>
              <div className="spot-cta-row cqr-cta" style={{ display: 'flex', gap: 10 }}>
                <button className="btn btn-lg btn-arrow"
                style={{ background: PRODUCT_COLORS.codequickref.tile, color: '#fff' }}
                onClick={(e) => e.preventDefault()}>
                  Add to Chrome, free <ArrowRight />
                </button>
              </div>
            </div>
            <div className="spotlight-mock" style={{ padding: '32px 40px 32px 0', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
              <SpotScaledMock designWidth={380}>
                <CodeQuickRefMock />
              </SpotScaledMock>
            </div>
          </div>
        </div>
      </section>

      <section className="section section-divider">
        <div className="cmd-container">
          <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 20 }}>
            <span className="eyebrow">In development</span>
            <span style={{ flex: 1, height: 1, background: 'var(--line)' }} />
          </div>
          <div className="grid-3 snap-cards peek-cards" style={{ gap: 16 }}>
            {PLATFORM_PRODUCTS.filter((p) => p.status !== 'available').map((p) => {
              const c = PRODUCT_COLORS[p.key] || PRODUCT_COLORS.insurify;
              const isScribe = p.key === 'notes';
              return (
                <div key={p.key} className="card" style={{ padding: '20px 20px 18px' }}>
                  <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 12 }}>
                    <span style={{
                      width: 30, height: 30, borderRadius: 8, background: c.tile, color: c.glyph,
                      display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0
                    }}>
                      <ProductMark k={p.key} size={16} />
                    </span>
                    <span style={{ fontSize: 15.5, fontWeight: 500, letterSpacing: '-0.01em' }}>
                      {isScribe ? p.name : p.name.replace('™', '')}
                    </span>
                    <span className="pill pill-neutral" style={{ marginLeft: 'auto', height: 20, fontSize: 11, whiteSpace: 'nowrap' }}>
                      {isScribe ? 'Fall 2026' : 'Soon'}
                    </span>
                  </div>
                  <p style={{ margin: 0, fontSize: 13.5, lineHeight: 1.5, color: 'var(--ink-2)' }}>{p.desc}</p>
                  <div style={{ marginTop: 10, fontSize: 12, color: 'var(--ink-3)' }}>For {p.audience}</div>
                </div>
              );
            })}
          </div>
        </div>
      </section>
    </div>);

}

// ── Solutions hero ───────────────────────────────────────────────────────────
function SolutionsHero({ go }) {
  return (
    <section style={{ paddingTop: 28, paddingBottom: 16 }}>
      <div className="cmd-container">
        <div style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto' }}>
          <h1 className="h-display" style={{
            fontSize: 'clamp(30px, 3.4vw, 48px)',
            lineHeight: 1.05, letterSpacing: '-0.025em', textWrap: 'balance', margin: 0
          }}>
            <span className="sol-h1-d">One platform carries the work{' '}
            <span style={{ color: 'var(--accent)' }}>from clinical note to clean payment.</span></span>
            <span className="sol-h1-m" style={{ display: 'none' }}>One platform,{' '}
            <span style={{ color: 'var(--accent)' }}>from note to clean payment.</span></span>
          </h1>
          <p className="sol-sub-d" style={{
            fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
            maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
          }}>
            CriterionMD forms the operating layer of a procedural-specialty practice.
          </p>
          <p className="sol-sub-d" style={{
            fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
            maxWidth: 84 + 'ch', margin: '6px auto 0', fontWeight: 400
          }}>
            Each product solves a specific failure point in the physician-payer workflow.
          </p>
          <p className="sol-sub-m" style={{ display: 'none' }}>
            Each product solves a failure point in the clinician-provider workflow.
          </p>

          <div style={{
            marginTop: 26, display: 'flex', gap: 12, justifyContent: 'center',
            flexWrap: 'wrap'
          }}>
            <button className="btn btn-lg btn-primary btn-arrow sol-cta-free"
            onClick={() => go('access')}>
              Get Insurify free <ArrowRight />
            </button>
            <button className="btn btn-lg btn-outline sol-cta-demo"
            onClick={() => go('demo')}>
              Request a practice demo
            </button>
          </div>
        </div>
      </div>
    </section>);

}

// ── Act header (DOCUMENT / AUTHORIZE / COLLECT) ──────────────────────────────
// A full-bleed section divider that groups the products under three platform
// layers — the three-act narrative reused from the home page, adapted as
// section markers between the deep product blocks.
function ActHeader({ n, label, title, sub }) {
  return (
    <section style={{
      borderTop: '1px solid var(--line)',
      background: 'var(--paper-2)',
      padding: '56px 0'
    }}>
      <div className="cmd-container">
        <div style={{
          display: 'grid', gridTemplateColumns: 'auto 1fr', gap: 32,
          alignItems: 'center'
        }}>
          <div style={{
            display: 'flex', flexDirection: 'column', alignItems: 'center',
            gap: 8, flexShrink: 0
          }}>
            <div style={{
              fontFamily: 'var(--font-mono)',
              fontSize: 'clamp(56px, 8vw, 96px)', fontWeight: 400,
              letterSpacing: '-0.05em', lineHeight: 0.85,
              color: 'var(--accent)', opacity: 0.92
            }}>{n}</div>
            <span className="mono" style={{
              fontSize: 12, letterSpacing: '.18em', color: 'var(--accent-ink)',
              fontWeight: 500
            }}>{label}</span>
          </div>
          <div>
            <h2 className="h-2" style={{
              fontSize: 'clamp(24px, 2.2vw, 34px)', textWrap: 'balance',
              margin: 0, letterSpacing: '-0.025em'
            }}>
              {title}
            </h2>
            <p style={{
              marginTop: 14, marginBottom: 0,
              fontSize: 17, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 64 + 'ch'
            }}>
              {sub}
            </p>
          </div>
        </div>
      </div>
    </section>);

}

// ── Co-development invitation ────────────────────────────────────────────────
// Reinforces that the product roadmap is intentionally fluid and shaped with
// practicing physicians and practices — sets up the develop@criterionmd.com
// channel as the main intake for collaboration.
function SolutionsCoDevelopment({ go }) {
  return (
    <section className="section section-divider">
      <div className="cmd-container">
        <div className="cols" style={{
          position: 'relative', overflow: 'hidden',
          borderRadius: 18, padding: '48px 48px',
          background: 'linear-gradient(155deg, var(--accent) 0%, var(--accent-ink) 100%)',
          color: '#fff',
          boxShadow: '0 1px 0 rgba(15,20,20,.04), 0 30px 80px -28px rgba(31,92,61,.45)',
          '--cols': '1.2fr 1fr', gap: 48, alignItems: 'center'
        }}>
          <div style={{
            position: 'absolute', inset: 0, opacity: 0.07,
            backgroundImage: 'linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px)',
            backgroundSize: '36px 36px', pointerEvents: 'none'
          }} />
          <div style={{ position: 'relative', zIndex: 1 }}>
            <div className="mono" style={{
              fontSize: 12, letterSpacing: '.18em', opacity: 0.8, marginBottom: 14
            }}>BUILD WITH US</div>
            <h2 className="h-2" style={{
              color: '#fff', textWrap: 'balance', margin: 0,
              fontSize: 'clamp(24px, 2.2vw, 34px)'
            }}>
              Have a workflow we should be{' '}
              <span style={{ color: 'var(--accent-tint-2)' }}>solving for?</span>
            </h2>
            <p style={{
              marginTop: 18, marginBottom: 0,
              fontSize: 17, lineHeight: 1.55,
              color: 'rgba(255,255,255,0.88)', maxWidth: 58 + 'ch'
            }}>
              We're actively developing new products with practicing physicians, practices,
              and health systems. If you're a doctor or a practice with a real problem you'd
              like to see solved, talk to us. We'll co-develop with you.
            </p>
          </div>
          <div style={{
            position: 'relative', zIndex: 1,
            background: 'rgba(255,255,255,0.08)',
            border: '1px solid rgba(255,255,255,0.2)',
            borderRadius: 14, padding: '28px 28px',
            backdropFilter: 'blur(6px)'
          }}>
            <div className="mono" style={{
              fontSize: 11, letterSpacing: '.16em',
              color: 'rgba(255,255,255,0.7)', marginBottom: 10
            }}>EMAIL THE DEVELOPMENT TEAM</div>
            <a href="mailto:develop@criterionmd.com"
            style={{
              color: '#fff', fontSize: 22, fontWeight: 500,
              letterSpacing: '-0.015em', display: 'inline-block',
              borderBottom: '1px solid rgba(255,255,255,0.4)',
              paddingBottom: 4, wordBreak: 'break-all'
            }}>
              develop@criterionmd.com
            </a>
            <p style={{
              marginTop: 16, marginBottom: 16,
              fontSize: 14, color: 'rgba(255,255,255,0.78)', lineHeight: 1.55
            }}>
              Tell us what you're stuck on. We read every note, and we'll route it to the
              founder closest to the problem.
            </p>
            <div style={{ display: 'flex', gap: 10, flexWrap: 'wrap' }}>
              <a href="mailto:develop@criterionmd.com" className="btn btn-lg btn-arrow"
              style={{ background: '#fff', color: 'var(--accent-ink)' }}>
                Email us <ArrowRight />
              </a>
              <button className="btn btn-lg btn-outline"
              onClick={() => go('contact')}
              style={{
                background: 'transparent', color: '#fff',
                borderColor: 'rgba(255,255,255,0.3)'
              }}>
                Visit Contact
              </button>
            </div>
          </div>
        </div>
      </div>
    </section>);

}

// ── Solutions outcomes / business case ───────────────────────────────────────
// Positive-framed numbered business case section, sized for the Solutions page.
function SolutionsOutcomes() {
  const ITEMS = [
  {
    n: '01',
    head: 'A single workflow, end to end.',
    body: 'One vendor between the chart and the payer, not five. Documentation, authorization, and collection sit on the same model of the patient, the procedure, and the policy.',
    tag: 'PLATFORM'
  },
  {
    n: '02',
    head: 'Revenue you would otherwise lose.',
    body: 'Denials caught earlier, underpayments surfaced earlier, peer-to-peers won more often. Every step where revenue typically leaks gets closed by the next product in the stack.',
    tag: 'OUTCOME'
  },
  {
    n: '03',
    head: 'Built around how procedural specialties actually work.',
    body: 'Spine, pain, orthopedics, EP, GI, ENT. Each product is designed by physicians in those specialties, with the payer-policy logic that actually applies to those procedures.',
    tag: 'POSTURE'
  }];

  return (
    <section className="section section-divider band-warm">
      <div className="cmd-container">
        <div style={{ maxWidth: 820, marginBottom: 36 }}>
          <div className="eyebrow" style={{ marginBottom: 8 }}>The business case</div>
          <h2 className="h-2" style={{
            fontSize: 'clamp(24px, 2.2vw, 34px)', margin: 0, textWrap: 'balance'
          }}>
            Multiple products,{' '}<span style={{ color: 'var(--accent)' }}>one outcome.</span>
          </h2>
          <p className="lede" style={{ marginTop: 16, fontSize: 18 }}>
            What you get when documentation, authorization, and collection are owned by the same platform, instead of five.
          </p>
        </div>
        <div className="grid-3 snap-cards" style={{ gap: 20 }}>
          {ITEMS.map((it) =>
          <article key={it.n} style={{
            background: 'var(--paper)', border: '1px solid var(--line-2)',
            boxShadow: 'var(--shadow-card)', borderRadius: 14, padding: '28px 28px 28px',
            display: 'flex', flexDirection: 'column'
          }}>
              <div style={{
              display: 'flex', justifyContent: 'space-between',
              alignItems: 'baseline', marginBottom: 22
            }}>
                <span className="mono" style={{
                fontSize: 13, color: 'var(--ink-3)', letterSpacing: '.08em'
              }}>{it.n}</span>
                <span className="mono" style={{
                fontSize: 10, letterSpacing: '.14em', color: 'var(--accent)',
                padding: '4px 8px', borderRadius: 4,
                background: 'var(--accent-tint)', border: '1px solid var(--accent-tint-2)'
              }}>{it.tag}</span>
              </div>
              <h3 style={{
              fontSize: 22, fontWeight: 500, letterSpacing: '-0.02em',
              lineHeight: 1.2, color: 'var(--ink)', margin: 0, textWrap: 'balance'
            }}>{it.head}</h3>
              <p style={{
              marginTop: 14, marginBottom: 0, fontSize: 15, lineHeight: 1.55,
              color: 'var(--ink-2)', flex: 1
            }}>{it.body}</p>
            </article>
          )}
        </div>
      </div>
    </section>);

}

function SolutionDeep({ n, name, tagline, body, audience, bullets, reverse, viz }) {
  return (
    <div className="grid-2" style={{
      gap: 56, alignItems: 'center',
      padding: '32px 0', borderBottom: '1px solid var(--line)'
    }}>
      <div style={{ order: reverse ? 2 : 1 }}>
        <h3 className="h-2" style={{ textWrap: 'balance' }}>{name}</h3>
        <div style={{ fontSize: 18, color: 'var(--accent)', fontWeight: 500, marginTop: 8 }}>{tagline}</div>
        <p style={{ fontSize: 17, color: 'var(--ink-2)', marginTop: 18, lineHeight: 1.6 }}>{body}</p>
        <div style={{ display: 'flex', gap: 8, marginTop: 16, flexWrap: 'wrap' }}>
          <span className="pill pill-neutral">{audience}</span>
          <span className="pill pill-neutral"><span className="pill-dot"></span> Coming soon</span>
        </div>
        <ul style={{ listStyle: 'none', padding: 0, margin: '24px 0 0', display: 'flex', flexDirection: 'column', gap: 10 }}>
          {bullets.map((b, i) =>
          <li key={i} style={{ display: 'flex', gap: 12, alignItems: 'flex-start', fontSize: 16, color: 'var(--ink-2)', lineHeight: 1.55 }}>
              <div style={{
              width: 20, height: 20, borderRadius: 999, background: 'var(--accent-tint)',
              color: 'var(--accent-ink)', display: 'flex', alignItems: 'center', justifyContent: 'center',
              marginTop: 2, flexShrink: 0
            }}><Check size={11} /></div>
              <span>{b}</span>
            </li>
          )}
        </ul>
      </div>
      <div style={{ order: reverse ? 1 : 2 }}>{viz}</div>
    </div>);

}

// ── In-development product card ─────────────────────────────────────────────
// Used in place of SolutionDeep for non-Insurify products. Intentionally vague:
// product is named (trademarks are public), but body/themes are framed broadly
// so we don't pigeon-hole a scope that's still being shaped with design partners.
function InDevelopmentCard({ n, productKey, name, tagline, audience, body, themes, reverse }) {
  const c = typeof PRODUCT_COLORS !== 'undefined' && PRODUCT_COLORS[productKey] ||
  { tile: '#1F5C3D', ink: '#143C28', soft: '#EEF3EE', soft2: '#DDE7DE' };
  return (
    <div className="grid-2" style={{
      gap: 48, alignItems: 'center',
      padding: '32px 0', borderBottom: '1px solid var(--line)'
    }}>
      <div style={{ order: reverse ? 2 : 1 }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 12 }}>
          <span className="mono" style={{
            fontSize: 12, letterSpacing: '.14em', color: 'var(--ink-3)'
          }}>{n}</span>
          <span style={{ flex: '0 0 24px', height: 1, background: 'var(--line)' }} />
          <span className="pill pill-neutral">
            <span className="pill-dot"></span> In development
          </span>
        </div>
        <h3 className="h-2" style={{ textWrap: 'balance', margin: 0 }}>{name}</h3>
        <div style={{ fontSize: 17, color: 'var(--accent)', fontWeight: 500, marginTop: 10 }}>
          {tagline}
        </div>
        <p style={{
          fontSize: 16, color: 'var(--ink-2)', marginTop: 16, marginBottom: 0,
          lineHeight: 1.6
        }}>{body}</p>
        <div style={{ display: 'flex', gap: 8, marginTop: 18, flexWrap: 'wrap' }}>
          <span className="pill pill-neutral">{audience}</span>
          {themes.map((t, i) =>
          <span key={i} style={{
            display: 'inline-flex', alignItems: 'center', gap: 6,
            padding: '4px 10px', borderRadius: 999,
            background: 'var(--bg)', color: 'var(--ink-2)',
            border: '1px solid var(--line)',
            fontFamily: 'var(--font-mono)', fontSize: 12, letterSpacing: '.04em'
          }}>{t}</span>
          )}
        </div>
      </div>

      {/* Abstract panel — intentionally non-specific. Just the product mark on
           the brand tile, with a subtle in-development indicator. No mock UI. */}
      <div style={{ order: reverse ? 1 : 2 }}>
        <div style={{
          position: 'relative', overflow: 'hidden',
          borderRadius: 18, padding: '40px 36px', minHeight: 280,
          background: `linear-gradient(155deg, ${c.tile} 0%, ${c.ink} 100%)`,
          color: '#fff',
          boxShadow: `0 1px 0 rgba(15,20,20,.04), 0 30px 80px -28px ${c.tile}55`,
          display: 'flex', flexDirection: 'column', justifyContent: 'space-between'
        }}>
          {/* subtle grid */}
          <div style={{
            position: 'absolute', inset: 0, opacity: 0.06,
            backgroundImage: 'linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px)',
            backgroundSize: '36px 36px', pointerEvents: 'none'
          }} />
          {/* glow */}
          <div style={{
            position: 'absolute', top: -120, right: -120, width: 320, height: 320,
            borderRadius: 999,
            background: 'radial-gradient(closest-side, rgba(255,255,255,0.22), transparent)',
            pointerEvents: 'none'
          }} />

          <div style={{
            position: 'relative', zIndex: 1, display: 'flex',
            alignItems: 'center', justifyContent: 'space-between'
          }}>
            <span className="mono" style={{
              fontSize: 12, letterSpacing: '.16em', opacity: 0.75
            }}>{n} · {name.replace(/™$/, '').toUpperCase()}</span>
            <span style={{
              display: 'inline-flex', alignItems: 'center', gap: 6,
              padding: '4px 10px', borderRadius: 999,
              background: 'rgba(255,255,255,0.18)',
              fontSize: 12, fontWeight: 500
            }}>
              <span style={{
                width: 6, height: 6, borderRadius: 999, background: '#fff',
                boxShadow: '0 0 0 4px rgba(255,255,255,0.22)'
              }} />
              In development
            </span>
          </div>

          <div style={{
            position: 'relative', zIndex: 1,
            width: 92, height: 92, borderRadius: 20,
            background: productKey === 'notes' ? '#fff' : 'rgba(255,255,255,0.16)',
            border: '1px solid rgba(255,255,255,0.28)',
            backdropFilter: 'blur(8px)',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            margin: '8px 0', overflow: 'hidden'
          }}>
            <ProductMark k={productKey} size={productKey === 'notes' ? 64 : 48} />
          </div>

          <div style={{
            position: 'relative', zIndex: 1,
            borderTop: '1px solid rgba(255,255,255,0.16)', paddingTop: 16,
            display: 'flex', justifyContent: 'space-between', alignItems: 'center',
            gap: 16, flexWrap: 'wrap'
          }}>
            <div>
              <div style={{
                fontFamily: 'var(--font-mono)', fontSize: 11,
                letterSpacing: '.14em', opacity: 0.7
              }}>SHAPED WITH</div>
              <div style={{ marginTop: 4, fontSize: 13, fontWeight: 500 }}>
                {themes[1] ? themes[1].replace(/^Co-developed (with|across) /, '') : 'Design partners'}
              </div>
            </div>
            <div style={{
              fontFamily: 'var(--font-mono)', fontSize: 11,
              letterSpacing: '.14em', opacity: 0.7
            }}>
              SCOPE FLUID
            </div>
          </div>
        </div>
      </div>
    </div>);

}

// ─── Solution previews ───────────────────────────────────────────────────────
function NotesViz() {
  return (
    <div className="mock">
      <div className="mock-bar" style={{ justifyContent: 'space-between' }}>
        <span>AI Note Completion · physician draft</span>
        <span className="mono">style · M. Okafor, MD</span>
      </div>
      <div style={{ padding: '20px 22px', fontSize: 13, lineHeight: 1.65, color: 'var(--ink-2)' }}>
        <div className="eyebrow" style={{ marginBottom: 8 }}>ASSESSMENT / PLAN</div>
        <p style={{ margin: 0 }}>
          Lumbar facet-mediated pain, L4-5 and L5-S1 bilateral.
          <br />
          Plan to proceed with diagnostic{' '}
          <mark style={{ background: 'var(--accent-tint)', color: 'var(--accent-ink)', padding: '0 3px', borderRadius: 3, position: 'relative' }}>
            lumbar medial branch block
          </mark>{' '}
          to target the{' '}
          <span style={{ position: 'relative', borderBottom: '1.5px dashed var(--warn)', cursor: 'help' }}>
            bilateral L4 to S1 facet joints
          </span>.
        </p>
        <div style={{
          marginTop: 14, padding: '10px 12px', background: 'var(--paper-2)',
          border: '1px solid var(--line)', borderRadius: 8, fontSize: 12,
          display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 10
        }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
            <div style={{
              width: 16, height: 16, borderRadius: 999, background: 'var(--warn-tint)',
              color: 'var(--warn)', display: 'flex', alignItems: 'center', justifyContent: 'center',
              fontWeight: 600, fontSize: 12
            }}>!</div>
            <span style={{ color: 'var(--ink-2)' }}>
              Inferred from prior notes. Confirm before signing.
            </span>
          </div>
          <div style={{ display: 'flex', gap: 6 }}>
            <button className="btn btn-sm" style={{ height: 26, padding: '0 10px', background: 'var(--accent)', color: '#fff' }}>Accept</button>
            <button className="btn btn-sm btn-outline" style={{ height: 26, padding: '0 10px' }}>Edit</button>
          </div>
        </div>
        <div className="eyebrow" style={{ marginTop: 18, marginBottom: 8 }}>STYLE LEARNED FROM DR. OKAFOR</div>
        <div style={{ display: 'flex', flexWrap: 'wrap', gap: 6 }}>
          {['Concise A/P', 'Levels-first format', 'Cites prior PT duration', 'Notes laterality early', 'No bullet lists'].map((t, i) =>
          <span key={i} className="pill pill-neutral" style={{ height: 22, fontSize: 12 }}>{t}</span>
          )}
        </div>
      </div>
    </div>);

}

function AuthDeskViz() {
  const items = [
  { p: 'Alvarez, R.', proc: 'Lumbar MBB · L4-5', payer: 'Aetna PPO', stage: 'Submitted', day: 'D+2', tone: 'progress' },
  { p: 'Chen, W.', proc: 'Cervical RFA · C5-C6', payer: 'BCBS NY', stage: 'Pending review', day: 'D+4', tone: 'wait' },
  { p: 'Diaz, A.', proc: 'Lumbar ESI · L4-5', payer: 'UHC', stage: 'Approved', day: 'D+6', tone: 'done' },
  { p: 'Fischer, H.', proc: 'SI joint inj.', payer: 'Cigna', stage: 'Add\'l info', day: 'D+3', tone: 'warn' },
  { p: 'Gomes, P.', proc: 'Lumbar RFA · L4', payer: 'Medicare', stage: 'P2P scheduled', day: 'D+5', tone: 'wait' }];

  return (
    <div className="mock">
      <div className="mock-bar" style={{ justifyContent: 'space-between' }}>
        <span>Authorization Desk · queue</span>
        <span className="mono">14 pending · 6 ready</span>
      </div>
      <div style={{ padding: 18 }}>
        {items.map((x, i) =>
        <div key={i} style={{
          display: 'grid', gridTemplateColumns: '1.2fr 1.2fr 0.9fr 1.2fr 0.6fr',
          gap: 10, padding: '12px 6px',
          borderBottom: i < items.length - 1 ? '1px solid var(--line-2)' : 0,
          fontSize: 12, alignItems: 'center'
        }}>
            <span style={{ fontWeight: 500 }}>{x.p}</span>
            <span style={{ color: 'var(--ink-2)' }}>{x.proc}</span>
            <span style={{ color: 'var(--ink-3)' }}>{x.payer}</span>
            <span className={'pill ' + (x.tone === 'warn' ? 'pill-warn' : x.tone === 'done' ? '' : 'pill-neutral')}
          style={{ height: 20, fontSize: 12 }}>
              <span className="pill-dot"></span> {x.stage}
            </span>
            <span className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', textAlign: 'right' }}>{x.day}</span>
          </div>
        )}
      </div>
    </div>);

}

function RcmViz() {
  return (
    <div className="mock" style={{ padding: 22 }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
        <span className="eyebrow">Reimbursement variance · this month</span>
        <span className="mono" style={{ fontSize: 12 }}>−$24,180</span>
      </div>
      <div style={{ marginTop: 18, display: 'flex', flexDirection: 'column', gap: 10 }}>
        {[
        { p: 'Aetna PPO', cpt: '64493', exp: '$310', got: '$278', d: '−10.3%' },
        { p: 'BCBS NY', cpt: '64635', exp: '$520', got: '$520', d: '0%' },
        { p: 'UHC', cpt: '64636', exp: '$280', got: '$224', d: '−20.0%' },
        { p: 'Cigna', cpt: '27096', exp: '$240', got: '$240', d: '0%' },
        { p: 'Medicare', cpt: '64493', exp: '$198', got: '$198', d: '0%' }].
        map((r, i) =>
        <div key={i} style={{
          display: 'grid', gridTemplateColumns: '1fr 0.6fr 0.6fr 0.6fr 0.6fr',
          gap: 12, fontSize: 12, alignItems: 'center'
        }}>
            <span style={{ fontWeight: 450 }}>{r.p}</span>
            <span className="mono" style={{ color: 'var(--ink-3)' }}>{r.cpt}</span>
            <span className="mono">{r.exp}</span>
            <span className="mono">{r.got}</span>
            <span className="mono" style={{
            color: r.d.startsWith('−') ? 'var(--danger)' : 'var(--ink-3)',
            textAlign: 'right', fontWeight: 500
          }}>{r.d}</span>
          </div>
        )}
      </div>
      <hr className="divider" style={{ margin: '20px 0 14px' }} />
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 14 }}>
        <PortalStat label="Net collection" value="94.1%" delta="+1.2 pts" />
        <PortalStat label="Days in A/R" value="34" delta="−3" />
        <PortalStat label="Recovered" value="$8.4K" delta="month-to-date" />
      </div>
    </div>);

}

function DenialViz() {
  return (
    <div className="mock" style={{ padding: 22 }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 16 }}>
        <span className="eyebrow">Top denial clusters · last 30 days</span>
        <span className="mono" style={{ fontSize: 12 }}>62 denials</span>
      </div>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
        {[
        { c: 'CO-50 · Not medically necessary', p: 'Aetna · 64493', n: 18, pct: 100 },
        { c: 'CO-197 · Auth required', p: 'BCBS · 64635', n: 14, pct: 78 },
        { c: 'CO-15 · Auth invalid', p: 'UHC · multiple', n: 11, pct: 61 },
        { c: 'CO-11 · Diagnosis inconsistent', p: 'Cigna · 27096', n: 9, pct: 50 },
        { c: 'CO-29 · Time-limit exceeded', p: 'Medicare · 64493', n: 6, pct: 33 }].
        map((d, i) =>
        <div key={i}>
            <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12, marginBottom: 6 }}>
              <span style={{ fontWeight: 450 }}>{d.c}</span>
              <span className="mono" style={{ color: 'var(--ink-3)' }}>{d.n} · {d.p}</span>
            </div>
            <div style={{ height: 5, background: 'var(--line-2)', borderRadius: 999, overflow: 'hidden' }}>
              <div style={{ width: `${d.pct}%`, height: '100%', background: i === 0 ? 'var(--danger)' : 'var(--warn)' }} />
            </div>
          </div>
        )}
      </div>
      <div style={{ marginTop: 18, padding: '10px 12px', background: 'var(--accent-tint)', border: '1px solid var(--accent-tint-2)', borderRadius: 8, fontSize: 12, color: 'var(--accent-ink)' }}>
        <strong style={{ fontWeight: 500 }}>Pattern detected.</strong> 12 of 18 Aetna CO-50 denials cite missing
        VAS history. Draft appeal templates ready for review.
      </div>
    </div>);

}

function PolicyViz() {
  return (
    <div className="mock" style={{ padding: 0 }}>
      <div className="mock-bar" style={{ justifyContent: 'space-between' }}>
        <span>Payer Policy Monitor · recent changes</span>
        <span className="mono">3 affect your patients</span>
      </div>
      <div style={{ padding: 18, display: 'flex', flexDirection: 'column', gap: 14 }}>
        {[
        { p: 'UnitedHealth', pol: 'MPM 2026T0590S · Facet joint injections', date: 'Effective Nov 1, 2026', impact: '3 patients', urgent: true },
        { p: 'Aetna', pol: 'CPB 0722 · Medial branch blocks · rev. 09', date: 'Effective Sep 15, 2026', impact: '11 patients', urgent: false },
        { p: 'BCBS NY', pol: 'MP 6.01.30 · Cervical RFA', date: 'Effective Jul 1, 2026', impact: 'No active patients', urgent: false }].
        map((p, i) =>
        <div key={i} style={{
          padding: '12px 14px', border: '1px solid var(--line)', borderRadius: 8,
          background: p.urgent ? 'var(--warn-tint)' : '#fff',
          borderColor: p.urgent ? '#F1D9BB' : 'var(--line)'
        }}>
            <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
              <div style={{ fontSize: 13, fontWeight: 500 }}>{p.p}</div>
              <span className={'pill ' + (p.urgent ? 'pill-warn' : 'pill-neutral')} style={{ height: 20, fontSize: 12 }}>
                <span className="pill-dot"></span> {p.urgent ? 'action required' : 'monitored'}
              </span>
            </div>
            <div style={{ fontSize: 12, color: 'var(--ink-2)', marginTop: 4 }}>{p.pol}</div>
            <div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 8, fontSize: 12, color: 'var(--ink-3)' }}>
              <span>{p.date}</span>
              <span className="mono">{p.impact}</span>
            </div>
          </div>
        )}
      </div>
    </div>);

}

// ─── INSURIFY PRODUCT PAGE ───────────────────────────────────────────────────
function InsurifyPage({ go }) {
  return (
    <div data-screen-label="03 Insurify">
      {/* Hero — one sentence, one job */}
      <section style={{ paddingTop: 30, paddingBottom: 8 }}>
        <div className="cmd-container">
          <div style={{ textAlign: 'center', maxWidth: 1200, margin: '0 auto' }}>
            <h1 className="h-display" style={{
              fontSize: 'clamp(30px, 3.4vw, 42px)',
              lineHeight: 1.08, letterSpacing: '-0.025em', margin: 0, textWrap: 'balance'
            }}>
              <span className="ins-h1-d">Know what the payer requires,{' '}
              <span style={{ color: 'var(--accent)' }}>before you submit.</span></span>
              <span className="ins-h1-m" style={{ display: 'none' }}>Know what payers require<br className="ins-h1-br" />{' '}
              <span style={{ color: 'var(--accent)' }}>before you submit.</span></span>
            </h1>
            <p className="ins-sub-d" style={{
              fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
            }}>
              Insurify reads the clinical note, maps it against the payer's
              medical-necessity criteria, and flags documentation gaps before the
              prior authorization goes out.
            </p>
            <p className="ins-sub-m" style={{ display: 'none' }}>
              Insurify reads the note, maps it against payer criteria, and flags gaps before submission.
            </p>
            <div style={{
              marginTop: 24, display: 'flex', gap: 12, justifyContent: 'center', flexWrap: 'wrap'
            }} className="hero-cta-row">
              <button className="btn btn-lg btn-primary btn-arrow" onClick={() => go('access')}>
                Get Insurify free <ArrowRight />
              </button>
              <button className="btn btn-lg btn-outline ins-hero-demo" onClick={() => go('demo')}>
                Request a practice demo
              </button>
            </div>
            {/* Active beta note — lives with the hero CTAs */}
            <div className="ins-beta-note" style={{
              display: 'flex', alignItems: 'center', gap: 14, flexWrap: 'nowrap',
              justifyContent: 'center', textAlign: 'left', whiteSpace: 'nowrap',
              margin: '22px auto 0', maxWidth: 'fit-content',
              padding: '14px 20px', border: '1px solid var(--accent-tint-2)', borderRadius: 12,
              background: 'var(--accent-tint)', fontSize: 13.5, color: 'var(--accent-ink)'
            }}>
              <span style={{ fontWeight: 500 }}>This is an active beta.</span>
              <span className="ins-beta-long" style={{ opacity: 0.85 }}>Expect frequent updates, driven by physician feedback from the cohort.</span>
              <span className="ins-beta-short" style={{ opacity: 0.85, display: 'none' }}>Expect frequent updates driven by physician feedback.</span>
            </div>
          </div>
        </div>
      </section>

      {/* Single supporting visual — the live Insurify program clip */}
      <section style={{ padding: '36px 0 8px' }} className="hero-mock-stage ins-page-mock">
        <div className="cmd-container" style={{ maxWidth: 860 }}>
          <InsurifyAppClip />
        </div>
      </section>

      {/* Workflow — 4 steps */}
      <section className="section section-divider">
        <div className="cmd-container">
          <div style={{ marginBottom: 20 }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>How it works</div>
            <h2 className="h-2" style={{ margin: 0 }}>
              <span style={{ color: 'var(--accent)' }}>Four steps</span>, all inside the visit.
            </h2>
          </div>
          <div className="grid-4 snap-cards" style={{ gap: 16 }}>
            {[
            { n: '01', t: 'Write or paste the note', s: 'Document in your own words. No templates.' },
            { n: '02', t: 'Confirm procedure & payer', s: 'Detected from the note; confirm with one click.' },
            { n: '03', t: 'See criteria & gaps', s: 'The payer\u2019s policy, checked line by line.' },
            { n: '04', t: 'Strengthen & submit', s: 'Close gaps while the patient is still in the room.' }].
            map((st) =>
            <div key={st.n} className="card" style={{ padding: '22px 22px 20px' }}>
                <div className="mono" style={{
                fontSize: 13, color: 'var(--accent)', letterSpacing: '.08em', marginBottom: 12
              }}>{st.n}</div>
                <div style={{ fontSize: 20, fontWeight: 500, letterSpacing: '-0.01em' }}>{st.t}</div>
                <p style={{ margin: '7px 0 0', fontSize: 13.5, lineHeight: 1.5, color: 'var(--ink-2)' }}>{st.s}</p>
              </div>
            )}
          </div>
        </div>
      </section>

      {/* Why it matters — 3 outcomes */}
      <section className="section section-divider band-warm">
        <div className="cmd-container">
          <div style={{ marginBottom: 20 }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>Why it matters</div>
            <h2 className="h-2" style={{ margin: 0 }}>
              Denials are cheapest to fix{' '}
              <span style={{ color: 'var(--accent)' }}>before they happen.</span>
            </h2>
          </div>
          <div className="grid-3 snap-cards" style={{ gap: 20 }}>
            {[
            { t: 'Fewer preventable denials', s: 'Documentation meets the payer\u2019s published criteria the first time.' },
            { t: 'Less rework', s: 'No after-hours addenda, peer-to-peers, or resubmission queues.' },
            { t: 'Stronger documentation', s: 'Notes that hold up clinically, medicolegally, and under audit.' }].
            map((it) =>
            <div key={it.t} style={{
              background: 'var(--paper)', border: '1px solid var(--line-2)',
              boxShadow: 'var(--shadow-card)', borderRadius: 14, padding: '24px 24px 22px'
            }}>
                <div style={{ fontSize: 20, fontWeight: 500, letterSpacing: '-0.015em' }}>{it.t}</div>
                <p style={{ margin: '8px 0 0', fontSize: 15, lineHeight: 1.5, color: 'var(--ink-2)' }}>{it.s}</p>
              </div>
            )}
          </div>
        </div>
      </section>

      {/* Who it's for */}
      <section className="section section-divider">
        <div className="cmd-container">
          <div style={{ marginBottom: 20 }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>Who it's for</div>
            <h2 className="h-2" style={{ margin: 0 }}>
              Built for the people{' '}
              <span style={{ color: 'var(--accent)' }}>who carry the burden.</span>
            </h2>
          </div>
          <div className="grid-3 snap-cards" style={{ gap: 20 }}>
            {[
            { t: 'Physicians', s: 'See gaps inline as you document, in your own words, with the policy citation.' },
            { t: 'APPs', s: 'The same real-time criteria guidance on every note you write.' },
            { t: 'Practice administrators', s: 'Every chart heading to authorization on one board, sorted by readiness.' }].
            map((it) =>
            <div key={it.t} className="card" style={{ padding: '24px 24px 22px' }}>
                <div style={{ fontSize: 20, fontWeight: 500, letterSpacing: '-0.015em' }}>{it.t}</div>
                <p style={{ margin: '8px 0 0', fontSize: 15, lineHeight: 1.5, color: 'var(--ink-2)' }}>{it.s}</p>
              </div>
            )}
          </div>
        </div>
      </section>

    </div>);

}

function Footnote({ label, body }) {
  return (
    <div style={{ textAlign: 'center' }}>
      <div className="eyebrow" style={{ marginBottom: body ? 6 : 0 }}>{label}</div>
      {body && <div style={{ fontSize: 13, color: 'var(--ink-2)', lineHeight: 1.5 }}>{body}</div>}
    </div>);

}

function FeatureRow({ num, kicker, title, body, mock, reverse }) {
  return (
    <div className="cols" style={{
      '--cols': '1fr 1.1fr', gap: 64, alignItems: 'center',
      padding: '36px 0', borderBottom: '1px solid var(--line)'
    }}>
      <div style={{ order: reverse ? 2 : 1 }}>
        <h3 className="h-2" style={{ textWrap: 'balance' }}>{title}</h3>
        <p className="lede" style={{ marginTop: 18, fontSize: 18 }}>{body}</p>
      </div>
      <div style={{ order: reverse ? 1 : 2 }}>{mock}</div>
    </div>);

}

function WorkflowCol({ role, points }) {
  return (
    <div className="card card-pad">
      <div className="eyebrow" style={{ marginBottom: 16 }}>{role}</div>
      <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 14 }}>
        {points.map((p, i) =>
        <li key={i} style={{ display: 'flex', gap: 12, alignItems: 'flex-start' }}>
            <span className="mono" style={{
            flexShrink: 0, fontSize: 12, color: 'var(--accent)',
            width: 22, height: 22, display: 'flex', alignItems: 'center', justifyContent: 'center',
            borderRadius: 999, background: 'var(--accent-tint)', marginTop: 1
          }}>{(i + 1).toString().padStart(2, '0').slice(1)}</span>
            <span style={{ fontSize: 15, color: 'var(--ink-2)', lineHeight: 1.5 }}>{p}</span>
          </li>
        )}
      </ul>
    </div>);

}

function SecRow({ t, s, pending }) {
  return (
    <div style={{ display: 'flex', gap: 14, alignItems: 'flex-start', padding: '16px 0', borderTop: '1px solid var(--line)' }}>
      <div style={{
        width: 22, height: 22, borderRadius: 999, marginTop: 2, flexShrink: 0,
        background: pending ? 'var(--paper-2)' : 'var(--accent-tint)',
        color: pending ? 'var(--ink-3)' : 'var(--accent-ink)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        border: '1px solid ' + (pending ? 'var(--line)' : 'var(--accent-tint-2)'),
        fontSize: 12, fontWeight: 600
      }}>
        {pending ? '…' : <Check size={12} />}
      </div>
      <div>
        <div style={{ fontSize: 15, fontWeight: 500 }}>{t}</div>
        <div style={{ fontSize: 13, color: 'var(--ink-3)', marginTop: 2 }}>{s}</div>
      </div>
    </div>);

}

function SecCard({ t, s, pending }) {
  return (
    <div style={{
      flex: '0 0 320px', scrollSnapAlign: 'start',
      padding: 22, borderRadius: 12,
      background: pending ? 'var(--paper-2)' : '#fff',
      border: '1px solid ' + (pending ? 'var(--line)' : 'var(--accent-tint-2)'),
      display: 'flex', flexDirection: 'column', gap: 12
    }}>
      <div style={{
        width: 36, height: 36, borderRadius: 10,
        background: pending ? '#fff' : 'var(--accent-tint)',
        color: pending ? 'var(--ink-3)' : 'var(--accent-ink)',
        border: '1px solid ' + (pending ? 'var(--line)' : 'var(--accent-tint-2)'),
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        fontSize: 14, fontWeight: 600
      }}>
        {pending ? <Check size={16} /> : <Check size={16} />}
      </div>
      <div style={{ fontSize: 17, fontWeight: 500, letterSpacing: '-0.01em', color: 'var(--ink)' }}>{t}</div>
      <p style={{ fontSize: 14, color: 'var(--ink-2)', margin: 0, lineHeight: 1.55 }}>{s}</p>
    </div>);

}

// Feature-row mini mocks
function MiniDetect() {
  return (
    <div className="mock" style={{ padding: 24 }}>
      <div style={{ fontFamily: 'var(--font-mono)', fontSize: 13, lineHeight: 1.7, color: 'var(--ink-2)' }}>
        <div>Plan for <span style={{ background: 'var(--accent-tint)', color: 'var(--accent-ink)', padding: '1px 5px', borderRadius: 3 }}>diagnostic</span></div>
        <div><span style={{ background: 'var(--accent-tint)', color: 'var(--accent-ink)', padding: '1px 5px', borderRadius: 3 }}>lumbar medial branch block</span></div>
        <div>at <span style={{ background: 'var(--accent-tint)', color: 'var(--accent-ink)', padding: '1px 5px', borderRadius: 3 }}>L4, L5</span> dorsal rami,</div>
        <div><span style={{ background: 'var(--accent-tint)', color: 'var(--accent-ink)', padding: '1px 5px', borderRadius: 3 }}>bilateral</span>.</div>
      </div>
      <hr className="divider" style={{ margin: '20px 0' }} />
      <div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
        <span className="eyebrow">Detected →</span>
        <span className="pill"><span className="mono">64493</span></span>
        <span className="pill"><span className="mono">64494</span></span>
        <span className="pill pill-neutral">×2 levels</span>
        <span className="pill pill-neutral">bilateral</span>
      </div>
    </div>);

}

function MiniPayer() {
  return (
    <div className="mock" style={{ padding: 0 }}>
      <div style={{ padding: '16px 20px', borderBottom: '1px solid var(--line)' }}>
        <div className="eyebrow">Patient coverage</div>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: 8 }}>
          <div>
            <div style={{ fontWeight: 500 }}>Aetna PPO · Open Access</div>
            <div style={{ fontSize: 12, color: 'var(--ink-3)' }}>Member ID W482******** · Active 2026</div>
          </div>
          <span className="pill"><Check size={11} /> verified</span>
        </div>
      </div>
      <div style={{ padding: '16px 20px' }}>
        <div className="eyebrow" style={{ marginBottom: 10 }}>Applicable policy</div>
        <div style={{
          padding: '12px 14px', background: 'var(--paper-2)', borderRadius: 8,
          border: '1px solid var(--line)', display: 'flex', justifyContent: 'space-between'
        }}>
          <div>
            <div style={{ fontSize: 14, fontWeight: 500 }}>CPB 0722</div>
            <div style={{ fontSize: 12, color: 'var(--ink-3)' }}>Facet joint injections, medial branch blocks, neurotomies</div>
          </div>
          <span className="mono" style={{ fontSize: 12, color: 'var(--ink-3)' }}>rev 2026-03</span>
        </div>
      </div>
    </div>);

}

function MiniMap() {
  return (
    <div className="mock" style={{ padding: 0 }}>
      <div style={{ padding: '14px 18px', borderBottom: '1px solid var(--line)', display: 'flex', justifyContent: 'space-between' }}>
        <span className="eyebrow">Criteria mapping</span>
        <span style={{ fontSize: 12, color: 'var(--ink-3)' }} className="mono">5 / 7 met</span>
      </div>
      <CriteriaList tick={0} />
    </div>);

}

function MiniReadiness() {
  return (
    <div className="mock" style={{ padding: 24 }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
        <div className="eyebrow">Authorization readiness</div>
        <span className="mono" style={{ fontSize: 13 }}>72%</span>
      </div>
      <div style={{ height: 8, background: 'var(--line-2)', borderRadius: 999, marginTop: 12, overflow: 'hidden' }}>
        <div style={{ width: '72%', height: '100%', background: 'var(--accent)' }} />
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16, marginTop: 24, paddingTop: 20, borderTop: '1px solid var(--line)' }}>
        <div>
          <div className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.06em' }}>MET</div>
          <div style={{ fontSize: 22, fontWeight: 500, marginTop: 4 }}>5</div>
        </div>
        <div>
          <div className="mono" style={{ fontSize: 12, color: 'var(--warn)', letterSpacing: '.06em' }}>GAPS</div>
          <div style={{ fontSize: 22, fontWeight: 500, marginTop: 4 }}>2</div>
        </div>
        <div>
          <div className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.06em' }}>THRESHOLD</div>
          <div style={{ fontSize: 22, fontWeight: 500, marginTop: 4 }}>86%</div>
        </div>
      </div>
      <div style={{ display: 'flex', gap: 8, marginTop: 20 }}>
        <button className="btn btn-sm btn-primary">Address gaps <ArrowRight /></button>
        <button className="btn btn-sm btn-outline">Submit anyway</button>
      </div>
    </div>);

}

// ── Lead submission ────────────────────────────────────────────────────────────────
// Posts to the /api/submit Vercel serverless function (see /api/submit.js).
// A lead only counts as delivered after a confirmed 2xx; anything else
// surfaces a visible mailto fallback so no lead is ever silently swallowed.
// In the static design preview (URL ends in .html) there is no API, so the
// submission is simulated to keep the flow reviewable.
const SUBMIT_API_LIVE = typeof window !== 'undefined' &&
  !window.location.pathname.endsWith('.html');

async function submitLead(kind, form) {
  const fd = new FormData(form);
  const data = {};
  fd.forEach(function (v, k) {
    if (data[k] !== undefined) data[k] = [].concat(data[k], v);
    else data[k] = v;
  });
  const payload = {
    kind: kind,
    ...data,
    page: window.location.href,
    utm: (typeof window !== 'undefined' && window.__utm) || undefined,
    submitted_at: new Date().toISOString()
  };
  const trackEvent = function () {
    if (typeof window.track === 'function') {
      window.track(
        kind === 'physician_signup' ? 'signup_submitted' :
        kind === 'demo_request' ? 'demo_requested' : 'contact_submitted',
        { kind: kind }
      );
    }
  };
  if (!SUBMIT_API_LIVE) {
    await new Promise(function (r) { setTimeout(r, 350); });
    trackEvent();
    return { ok: true, simulated: true };
  }
  try {
    const res = await fetch('/api/submit', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(payload)
    });
    if (res.ok) {
      trackEvent();
      let data = {};
      try { data = await res.json(); } catch (e) { /* no body */ }
      return { ok: true, verified: data.verified };
    }
    let msg = 'Request failed (' + res.status + ')';
    try {
      const body = await res.json();
      if (body && body.error) msg = body.error;
    } catch (e) { /* non-JSON error body */ }
    return { ok: false, error: msg };
  } catch (err) {
    return { ok: false, error: (err && err.message) || 'Network error' };
  }
}

// Hidden honeypot field — the API drops any submission that fills it.
function Honeypot() {
  return (
    <div aria-hidden="true" style={{
      position: 'absolute', left: -9999, width: 1, height: 1, overflow: 'hidden'
    }}>
      <label>
        Company website
        <input name="company_website" tabIndex={-1} autoComplete="off" />
      </label>
    </div>
  );
}

// Cloudflare Turnstile CAPTCHA — renders only when window.TURNSTILE_SITE_KEY
// is set. The widget injects a hidden cf-turnstile-response input into the
// form, which submitLead's FormData picks up automatically.
//
// Readiness is published to any form that needs it: submitting before the
// widget exists used to fail verification, i.e. the user was shown an ERROR
// for being fast. Now the wait is reported as STATUS and submit stays disabled
// until the widget is actually up.
const turnstileReady = { value: false, subs: new Set() };
function publishTurnstileReady(v) {
  if (turnstileReady.value === v) return;
  turnstileReady.value = v;
  turnstileReady.subs.forEach(function (f) { f(); });
}
function useTurnstileReady() {
  const KEY = typeof window !== 'undefined' && window.TURNSTILE_SITE_KEY;
  const [ready, setReady] = React.useState(function () { return !KEY || turnstileReady.value; });
  React.useEffect(function () {
    if (!KEY) { setReady(true); return; }
    const f = function () { setReady(turnstileReady.value); };
    turnstileReady.subs.add(f);
    f();
    return function () { turnstileReady.subs.delete(f); };
  }, [KEY]);
  return ready;
}

function TurnstileBox() {
  const ref = React.useRef(null);
  const widgetId = React.useRef(null);
  const ready = useTurnstileReady();
  React.useEffect(() => {
    const KEY = window.TURNSTILE_SITE_KEY;
    if (!KEY || !ref.current) return;
    let cancelled = false;
    const render = () => {
      if (cancelled || widgetId.current !== null || !window.turnstile) return;
      widgetId.current = window.turnstile.render(ref.current, {
        sitekey: KEY, theme: 'light', size: 'flexible'
      });
      publishTurnstileReady(true);
    };
    const removeWidget = () => {
      if (widgetId.current !== null && window.turnstile) {
        try { window.turnstile.remove(widgetId.current); } catch (e) { /* already gone */ }
      }
      widgetId.current = null;
      publishTurnstileReady(false);
    };
    let interval = null;
    if (window.turnstile) {
      render();
    } else {
      let s = document.getElementById('turnstile-script');
      if (!s) {
        s = document.createElement('script');
        s.id = 'turnstile-script';
        s.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit';
        s.async = true;
        document.head.appendChild(s);
      }
      interval = setInterval(() => { if (window.turnstile) { clearInterval(interval); render(); } }, 200);
    }
    return () => {
      cancelled = true;
      if (interval) clearInterval(interval);
      removeWidget();
    };
  }, []);
  if (typeof window === 'undefined' || !window.TURNSTILE_SITE_KEY) return null;
  return (
    <div style={{ marginTop: 16 }}>
      <div ref={ref}></div>
      {!ready &&
      <div className="mono" aria-live="polite" style={{
        fontSize: 11.5, color: 'var(--ink-3)', marginTop: 6, letterSpacing: '.04em'
      }}>
        Loading verification…
      </div>
      }
    </div>
  );
}

// Turnstile tokens are single-use: after a rejected submit, reset the form's
// widget so the retry gets a fresh token instead of re-sending a consumed one.
// (There is at most one widget per page, so a global reset is safe.)
function resetTurnstileIn(form) {
  try {
    if (window.turnstile) window.turnstile.reset();
  } catch (e) { /* widget not present */ }
}

// Live NPPES feedback under the NPI field. Debounced; only queries once the
// NPI is 10 digits. Purely informational — never blocks the signup.
function useNpiLiveCheck(npi, lastName) {
  const [status, setStatus] = React.useState(null); // {state, name}
  React.useEffect(() => {
    if (!SUBMIT_API_LIVE) { setStatus(null); return; }
    if (!/^\d{10}$/.test(npi)) { setStatus(null); return; }
    let dead = false;
    setStatus({ state: 'checking' });
    const t = setTimeout(() => {
      fetch('/api/npi-check?npi=' + encodeURIComponent(npi) + '&last_name=' + encodeURIComponent(lastName || ''))
        .then((r) => r.json())
        .then((d) => {
          if (dead) return;
          if (d.verified) setStatus({ state: 'verified', name: d.name });
          else if (d.found) setStatus({ state: 'found', name: d.name });
          else setStatus({ state: 'not_found' });
        })
        .catch(() => { if (!dead) setStatus(null); });
    }, 500);
    return () => { dead = true; clearTimeout(t); };
  }, [npi, lastName]);
  return status;
}

function NpiLiveStatus({ status }) {
  if (!status) return null;
  const styles = {
    checking: { color: 'var(--ink-3)' },
    verified: { color: 'var(--accent)' },
    found: { color: 'var(--ink-2)' },
    not_found: { color: 'var(--warn, #A15C07)' }
  };
  const msg =
    status.state === 'checking' ? 'Checking the NPPES registry…' :
    status.state === 'verified' ? '✓ Verified against NPPES: ' + status.name :
    status.state === 'found' ? 'NPI found (' + status.name + ') — name doesn\u2019t match yet; we\u2019ll review manually.' :
    'NPI not found in NPPES — you can still join; we\u2019ll review manually.';
  return (
    <div role="status" style={{ marginTop: 6, fontSize: 12.5, lineHeight: 1.45, ...styles[status.state] }}>
      {msg}
    </div>
  );
}

function FormFallback({ error, email = 'nk@criterionmd.com', subject = 'Website form submission' }) {
  return (
    <div role="alert" style={{
      marginTop: 18, padding: '14px 16px', borderRadius: 10,
      background: 'var(--warn-tint)', border: '1px solid var(--line)',
      fontSize: 13, color: 'var(--ink-2)', lineHeight: 1.55
    }}>
      <strong style={{ fontWeight: 500, color: 'var(--ink)' }}>We couldn't submit this right now.</strong>{' '}
      Your note wasn't lost — email us directly at{' '}
      <a href={'mailto:' + email + '?subject=' + encodeURIComponent(subject)}
      style={{ color: 'var(--accent)', fontWeight: 500 }}>{email}</a>{' '}
      and a real person will follow up.
      {error &&
      <span className="mono" style={{ display: 'block', marginTop: 6, fontSize: 11, color: 'var(--ink-4)' }}>
        {error}
      </span>
      }
    </div>
  );
}

// ── Inline field validation (validate on blur, clear on fix) ────────────────
const FIELD_MSGS = {
  first_name: 'First name is required',
  last_name: 'Last name is required',
  email: 'Enter a valid email address',
  npi: 'NPI must be 10 digits',
  organization: 'Organization is required'
};
function fieldMsg(name, value) {
  const v = (value || '').trim();
  if (name === 'email') return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) ? null : FIELD_MSGS.email;
  if (name === 'npi') return /^\d{10}$/.test(v) ? null : FIELD_MSGS.npi;
  return v ? null : FIELD_MSGS[name] || null;
}
function FieldError({ msg }) {
  return msg ? <div className="field-error" role="alert">{msg}</div> : null;
}

// ─── ACCESS — split: physician free signup + practice demo ───────────────────
function AccessPage({ go, initialTab }) {
  const [tab, setTab] = React.useState(function () {
    if (initialTab === 'practice' || initialTab === 'physician') return initialTab;
    try {
      const q = new URLSearchParams(window.location.search);
      if (q.get('tab') === 'practice') return 'practice';
    } catch (e) { /* noop */ }
    return 'physician';
  });
  const [sent, setSent] = React.useState(null);
  React.useEffect(function () {
    if (initialTab === 'practice' || initialTab === 'physician') setTab(initialTab);
  }, [initialTab]);
  if (sent) return <AccessSent kind={sent.kind} verified={sent.verified} go={go} reset={() => setSent(null)} />;

  return (
    <div data-screen-label="04 Get access">
      <section style={{ paddingTop: 32, paddingBottom: 0 }}>
        <div className="cmd-container">
          <div className="eyebrow" style={{ marginBottom: 8 }}>Get access</div>
          <h1 className="h-1" style={{ textWrap: 'balance' }}>
            <span style={{ color: 'var(--accent)' }}>Two ways</span>{' '}to get started.
          </h1>
          <p className="lede" style={{ marginTop: 16 }}>
            Insurify is free for individual physicians and APPs. The broader platform (Authorization Desk, RCM Intelligence, Denial Analytics, Payer Policy Monitor) is scoped per practice.
          </p>

          {/* Tab switcher */}
          <div style={{ marginTop: 36, display: 'inline-flex', padding: 4, background: 'var(--paper-2)', borderRadius: 999, border: '1px solid var(--line)' }}>
            <TabBtn active={tab === 'physician'} onClick={() => setTab('physician')}>
              <span style={{ width: 6, height: 6, borderRadius: 999, background: 'var(--accent)', display: 'inline-block', marginRight: 8 }} />
              I'm a physician or APP
            </TabBtn>
            <TabBtn active={tab === 'practice'} onClick={() => setTab('practice')}>
              I represent a practice or health org. Request a demo
            </TabBtn>
          </div>
        </div>
      </section>

      <section className="section" style={{ paddingTop: 36 }}>
        <div className="cmd-container">
          {tab === 'physician' ?
          <PhysicianSignup go={go} onSubmit={(r) => setSent({ kind: 'physician', verified: r && r.verified })} /> :
          <PracticeDemo onSubmit={() => setSent({ kind: 'practice' })} />}
        </div>
      </section>
    </div>);

}

function TabBtn({ active, onClick, children }) {
  return (
    <button onClick={onClick} style={{
      appearance: 'none', border: 0, padding: '10px 18px', borderRadius: 999,
      background: active ? '#fff' : 'transparent',
      color: active ? 'var(--ink)' : 'var(--ink-3)',
      fontSize: 13, fontWeight: 500, fontFamily: 'inherit',
      boxShadow: active ? 'var(--shadow-sm)' : 'none',
      transition: 'background var(--spring-snap), color var(--spring-snap), box-shadow var(--spring-snap)'
    }}>{children}</button>);

}

// US states for the practice-location fields on the physician signup form.
const US_STATES = ['AL','AK','AZ','AR','CA','CO','CT','DE','DC','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS','MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY'];

// Multi-state picker — pill toggles, each selected state emits a hidden input
// so it lands in the form payload as additional_states.
// Multi-state picker — pill toggles, each selected state emits a hidden input.
// `name` controls the payload field (default additional_states).
function StateMultiPick({ name = 'additional_states' }) {
  const [sel, setSel] = React.useState([]);
  const toggle = (st) => setSel((s) => s.includes(st) ? s.filter((x) => x !== st) : [...s, st]);
  return (
    <div>
      <div style={{
        display: 'flex', flexWrap: 'wrap', gap: 6, marginTop: 8,
        maxHeight: 150, overflowY: 'auto', padding: 8,
        border: '1px solid var(--line)', borderRadius: 10, background: '#fff'
      }}>
        {US_STATES.map((st) => {
          const on = sel.includes(st);
          return (
            <button key={st} type="button" onClick={() => toggle(st)} aria-pressed={on}
            className="mono pick-pill"
            style={{
              appearance: 'none', cursor: 'pointer', fontSize: 12,
              padding: '5px 9px', borderRadius: 999, border: '1px solid',
              borderColor: on ? 'var(--accent)' : 'var(--line)',
              background: on ? 'var(--accent-tint)' : '#fff',
              color: on ? 'var(--accent-ink)' : 'var(--ink-2)',
              fontWeight: on ? 600 : 400, letterSpacing: '.03em'
            }}>{st}</button>
          );
        })}
      </div>
      {sel.map((st) => <input key={st} type="hidden" name={name} value={st} />)}
      {sel.length > 0 &&
      <div style={{ marginTop: 6, fontSize: 12, color: 'var(--ink-3)' }}>
        Selected: {sel.join(', ')}
      </div>
      }
    </div>
  );
}

function PhysicianSignup({ go, onSubmit }) {
  const [npi, setNpi] = React.useState('');
  const [lastName, setLastName] = React.useState('');
  const [multiState, setMultiState] = React.useState('No');
  const [busy, setBusy] = React.useState(false);
  const [error, setError] = React.useState(null);
  const [errs, setErrs] = React.useState({});
  const npiLive = useNpiLiveCheck(npi, lastName);
  const captchaReady = useTurnstileReady();
  const check = (e) => {
    const { name, value } = e.target;
    setErrs((er) => ({ ...er, [name]: fieldMsg(name, value) }));
  };
  const clearErr = (e) => {
    const { name, value } = e.target;
    if (errs[name] && !fieldMsg(name, value)) setErrs((er) => ({ ...er, [name]: null }));
  };
  return (
    <div className="access-split" style={{ gap: 56, alignItems: 'flex-start' }}>
      <div>
        <div className="card card-pad" style={{ background: 'var(--accent-tint)', borderColor: 'var(--accent-tint-2)' }}>
          <div style={{ fontSize: 20, fontWeight: 500, color: 'var(--accent-ink)' }}>
            Insurify is free for licensed clinicians.
          </div>
          <p style={{ fontSize: 14, color: 'var(--accent-ink)', opacity: 0.85, marginTop: 8, marginBottom: 0, lineHeight: 1.55 }}>
            Insurify is currently waitlisted ahead of our August launch. Sign up with your work email, we verify your NPI against the NPPES registry, and you get priority access when we roll out. No credit card, no practice contract, no usage limits.
          </p>
        </div>

        <ul style={{ listStyle: 'none', padding: 0, margin: '32px 0 0', display: 'flex', flexDirection: 'column', gap: 14 }}>
          {[
          { t: 'Free for individual clinicians' },
          { t: '90 seconds to set up' },
          { t: 'EHR-agnostic' },
          { t: 'Your patient data, protected by BAA, is always private' }].
          map((x, i) =>
          <li key={i} style={{ display: 'flex', gap: 14, alignItems: 'flex-start' }}>
              <div style={{
              width: 22, height: 22, borderRadius: 999, marginTop: 2,
              background: 'var(--accent-tint)', color: 'var(--accent-ink)',
              display: 'flex', alignItems: 'center', justifyContent: 'center'
            }}><Check size={12} /></div>
              <div>
                <div style={{ fontSize: 15, fontWeight: 500 }}>{x.t}</div>
              </div>
            </li>
          )}
        </ul>
      </div>

      <form className="card" style={{ padding: 32 }} onSubmit={async (e) => {
        e.preventDefault();
        if (busy) return;
        setBusy(true); setError(null);
        const r = await submitLead('physician_signup', e.currentTarget);
        setBusy(false);
        if (r.ok) onSubmit(r); else { setError(r.error); resetTurnstileIn(e.currentTarget); }
      }}>
        <Honeypot />
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 4 }}>
          <h3 className="h-3">Join the waitlist</h3>
          <span className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.06em' }}>LIVE IN AUGUST</span>
        </div>
        <p style={{ fontSize: 13, color: 'var(--ink-3)', margin: '0 0 20px' }}>
          Physicians and APPs only. We verify against NPPES.
        </p>

        <div className="grid-2" style={{ gap: 14 }}>
          <div>
            <label className="label">First name</label>
            <input className={'input' + (errs.first_name ? ' is-invalid' : '')} name="first_name"
              autoComplete="given-name" inputMode="text" required onBlur={check} onChange={clearErr} />
            <FieldError msg={errs.first_name} />
          </div>
          <div>
            <label className="label">Last name</label>
            <input className={'input' + (errs.last_name ? ' is-invalid' : '')} name="last_name"
              autoComplete="family-name" inputMode="text" required onBlur={check}
              onChange={(e) => { setLastName(e.target.value); clearErr(e); }} />
            <FieldError msg={errs.last_name} />
          </div>
        </div>

        <div style={{ marginTop: 14 }}>
          <label className="label">Work email</label>
          <input className={'input' + (errs.email ? ' is-invalid' : '')} type="email" name="email"
            inputMode="email" autoComplete="email" required onBlur={check} onChange={clearErr} />
          <FieldError msg={errs.email} />
        </div>

        <div style={{ marginTop: 14 }}>
          <label className="label">Mobile phone</label>
          <input className="input" type="tel" name="phone" inputMode="tel"
            autoComplete="tel" placeholder="(555) 555-5555" required />
        </div>

        <div style={{ marginTop: 14 }}>
          <label className="label">Role</label>
          <select className="select" name="role" required>
            <option>Physician (MD / DO)</option>
            <option>Nurse practitioner (NP)</option>
            <option>Physician assistant (PA)</option>
            <option>Other licensed APP</option>
          </select>
        </div>

        <div style={{ marginTop: 14 }}>
          <label className="label">NPI</label>
          <input
            className={'input mono' + (errs.npi ? ' is-invalid' : '')}
            name="npi"
            inputMode="numeric"
            autoComplete="off"
            pattern="\d{10}"
            title="Your 10-digit NPI number"
            value={npi}
            onChange={(e) => {
              const digits = e.target.value.replace(/\D/g, '').slice(0, 10);
              setNpi(digits);
              if (errs.npi && /^\d{10}$/.test(digits)) setErrs((er) => ({ ...er, npi: null }));
            }}
            onBlur={check}
            required
            style={{ letterSpacing: '.04em' }} />
          <FieldError msg={errs.npi} />
          <NpiLiveStatus status={npiLive} />
        </div>

        <div style={{ marginTop: 14 }}>
          <label className="label">Practice or organization</label>
          <input className={'input' + (errs.organization ? ' is-invalid' : '')} name="organization"
            autoComplete="organization" required onBlur={check} onChange={clearErr} />
          <FieldError msg={errs.organization} />
        </div>

        <div className="grid-2" style={{ gap: 14, marginTop: 14 }}>
          <div>
            <label className="label">City of primary practice</label>
            <input className="input" name="practice_city" autoComplete="address-level2" required />
          </div>
          <div>
            <label className="label">State of primary practice</label>
            <select className="select" name="practice_state" required defaultValue="">
              <option value="" disabled>Select…</option>
              {US_STATES.map((st) => <option key={st}>{st}</option>)}
            </select>
          </div>
        </div>

        <div style={{ marginTop: 14 }}>
          <label className="label">Do you personally practice in more than one state routinely?</label>
          <div style={{ display: 'flex', gap: 8, marginTop: 6 }}>
            {['No', 'Yes'].map((opt) => {
              const on = multiState === opt;
              return (
                <button key={opt} type="button" onClick={() => setMultiState(opt)} aria-pressed={on}
                className="pick-pill" style={{
                  appearance: 'none', font: 'inherit', cursor: 'pointer',
                  padding: '8px 22px', borderRadius: 999, border: '1px solid',
                  borderColor: on ? 'var(--accent)' : 'var(--line)',
                  background: on ? 'var(--accent-tint)' : '#fff',
                  color: on ? 'var(--accent-ink)' : 'var(--ink-2)',
                  fontSize: 14, fontWeight: on ? 600 : 400,
                  display: 'inline-flex', alignItems: 'center', gap: 7
                }}>
                  {on && <Check size={11} />}{opt}
                </button>
              );
            })}
          </div>
          <input type="hidden" name="multi_state_practice" value={multiState} />
          {multiState === 'Yes' &&
          <div style={{ marginTop: 10 }}>
            <label className="label" style={{ fontWeight: 400, color: 'var(--ink-3)' }}>
              Select every state you routinely practice in (including your primary)
            </label>
            <StateMultiPick />
          </div>
          }
        </div>

        <label style={{ display: 'flex', gap: 10, marginTop: 18, fontSize: 12, color: 'var(--ink-3)', lineHeight: 1.5 }}>
          <input type="checkbox" name="consent" required style={{ marginTop: 2 }} />
          <span>I agree to the <a href="/terms" onClick={(e) => { e.preventDefault(); go('terms'); }} style={{ color: 'var(--accent)' }}>terms</a> and the <a href="/privacy" onClick={(e) => { e.preventDefault(); go('privacy'); }} style={{ color: 'var(--accent)' }}>privacy policy</a>, and I confirm I am a licensed clinician.</span>
        </label>

        {error && <FormFallback error={error} subject="Insurify free account request" />}
        <TurnstileBox />
        <button type="submit" disabled={busy || !captchaReady} className="btn btn-lg btn-primary btn-arrow" style={{ marginTop: 18, width: '100%', opacity: busy || !captchaReady ? 0.65 : 1 }}>
          {busy ? <React.Fragment><span className="btn-spinner" aria-hidden="true" /> Verifying your NPI…</React.Fragment> : <React.Fragment>Join the waitlist <ArrowRight /></React.Fragment>}
        </button>
        <p style={{ fontSize: 12, color: 'var(--ink-3)', textAlign: 'center', marginTop: 12, marginBottom: 0 }}>
          No credit card. Waitlist members get priority access when Insurify goes live in August.
        </p>
      </form>
    </div>);

}

function PracticeDemo({ onSubmit }) {
  const [busy, setBusy] = React.useState(false);
  const [error, setError] = React.useState(null);
  const [prodErr, setProdErr] = React.useState(null);
  const [multiState, setMultiState] = React.useState('No');
  const captchaReady = useTurnstileReady();
  const [errs, setErrs] = React.useState({});
  const check = (e) => {
    const { name, value } = e.target;
    setErrs((er) => ({ ...er, [name]: fieldMsg(name, value) }));
  };
  const clearErr = (e) => {
    const { name, value } = e.target;
    if (errs[name] && !fieldMsg(name, value)) setErrs((er) => ({ ...er, [name]: null }));
  };
  return (
    <div className="access-split" style={{ gap: 56, alignItems: 'flex-start' }}>
      <div>
        <div className="card card-pad">
          <div style={{ display: 'flex', gap: 8, marginBottom: 14 }}>
            <span className="pill pill-neutral">Practice & enterprise</span>
            <span className="pill pill-neutral">Paid platform</span>
          </div>
          <div style={{ fontSize: 20, fontWeight: 500 }}>A demo scoped to your practice.</div>
          <p style={{ fontSize: 14, color: 'var(--ink-3)', marginTop: 8, marginBottom: 0, lineHeight: 1.55 }}>
            Walk through Insurify against your real payer mix, see Authorization Desk and the rest of the roadmap, and scope a pilot. Direct access to the founding team.
          </p>
        </div>

        <div style={{ marginTop: 28 }}>
          <div className="eyebrow" style={{ marginBottom: 8 }}>What a pilot typically covers</div>
          <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 14 }}>
            {[
            { t: '45-minute scoping call', s: 'We map your payer mix, EHR, current denial patterns, and bottlenecks.' },
            { t: 'Custom demo', s: 'Insurify run against your actual procedures and payers; preview of paid products as they come online.' },
            { t: '60–90 day pilot', s: 'Hands-on with a defined cohort. Co-defined success metrics.' },
            { t: 'Pilot pricing', s: 'Scoped only after we agree on success metrics. No charge during the pilot period.' }].
            map((x, i) =>
            <li key={i} style={{ display: 'flex', gap: 14, alignItems: 'flex-start' }}>
                <span className="mono" style={{
                width: 22, height: 22, borderRadius: 999, background: 'var(--accent-tint)',
                color: 'var(--accent-ink)', display: 'flex', alignItems: 'center', justifyContent: 'center',
                fontSize: 12, marginTop: 2, flexShrink: 0
              }}>{String(i + 1).padStart(2, '0')}</span>
                <div>
                  <div style={{ fontSize: 15, fontWeight: 500 }}>{x.t}</div>
                  <div style={{ fontSize: 13, color: 'var(--ink-3)' }}>{x.s}</div>
                </div>
              </li>
            )}
          </ul>
        </div>
      </div>

      <form className="card" style={{ padding: 32 }} onSubmit={async (e) => {
        e.preventDefault();
        if (busy) return;
        const fd = new FormData(e.currentTarget);
        if (!fd.getAll('products').length) {
          setProdErr('Please select at least one product.');
          return;
        }
        setProdErr(null);
        setBusy(true); setError(null);
        const r = await submitLead('demo_request', e.currentTarget);
        setBusy(false);
        if (r.ok) onSubmit(); else { setError(r.error); resetTurnstileIn(e.currentTarget); }
      }}>
        <Honeypot />
        <h3 className="h-3" style={{ marginBottom: 4 }}>Request a practice demo</h3>
        <p style={{ fontSize: 13, color: 'var(--ink-3)', margin: '0 0 20px' }}>
          We respond within two business days.
        </p>

        <div className="grid-2" style={{ gap: 14 }}>
          <div>
            <label className="label">First name</label>
            <input className={'input' + (errs.first_name ? ' is-invalid' : '')} name="first_name"
              autoComplete="given-name" inputMode="text" required onBlur={check} onChange={clearErr} />
            <FieldError msg={errs.first_name} />
          </div>
          <div><label className="label">Last name</label><input className="input" name="last_name" autoComplete="family-name" /></div>
        </div>
        <div style={{ marginTop: 14 }}>
          <label className="label">Work email</label>
          <input className={'input' + (errs.email ? ' is-invalid' : '')} type="email" name="email"
            inputMode="email" autoComplete="email" placeholder="dana@your-practice.com" required
            onBlur={check} onChange={clearErr} />
          <FieldError msg={errs.email} />
        </div>
        <div className="grid-2" style={{ gap: 14, marginTop: 14 }}>
          <div>
            <label className="label">Organization</label>
            <input className={'input' + (errs.organization ? ' is-invalid' : '')} name="organization"
              autoComplete="organization" placeholder="Practice or health system" required
              onBlur={check} onChange={clearErr} />
            <FieldError msg={errs.organization} />
          </div>
          <div>
            <label className="label">Role</label>
            <select className="select" name="role">
              <option>Practice administrator</option>
              <option>Executive / owner</option>
              <option>Revenue cycle leader</option>
              <option>CIO / IT</option>
              <option>Investor / partner</option>
              <option>Other</option>
            </select>
          </div>
        </div>
        <div className="grid-2" style={{ gap: 14, marginTop: 14 }}>
          <div>
            <label className="label">Clinicians in organization</label>
            <select className="select" name="physician_count">
              <option>1 (solo)</option>
              <option>2–5</option>
              <option>6–15</option>
              <option>16–50</option>
              <option>51+</option>
            </select>
          </div>
          <div>
            <label className="label">Specialty focus</label>
            <select className="select" name="specialty">
              <option>Interventional pain</option>
              <option>Orthopedics / spine</option>
              <option>Multispecialty</option>
              <option>Other</option>
            </select>
          </div>
        </div>
        <div style={{ marginTop: 14 }}>
          <label className="label">Does your practice provide clinical care in more than one state?</label>
          <div style={{ display: 'flex', gap: 8, marginTop: 6 }}>
            {['No', 'Yes'].map((opt) => {
              const on = multiState === opt;
              return (
                <button key={opt} type="button" onClick={() => setMultiState(opt)} aria-pressed={on}
                className="pick-pill" style={{
                  appearance: 'none', font: 'inherit', cursor: 'pointer',
                  padding: '8px 22px', borderRadius: 999, border: '1px solid',
                  borderColor: on ? 'var(--accent)' : 'var(--line)',
                  background: on ? 'var(--accent-tint)' : '#fff',
                  color: on ? 'var(--accent-ink)' : 'var(--ink-2)',
                  fontSize: 14, fontWeight: on ? 600 : 400,
                  display: 'inline-flex', alignItems: 'center', gap: 7
                }}>
                  {on && <Check size={11} />}{opt}
                </button>
              );
            })}
          </div>
          <input type="hidden" name="multi_state_practice" value={multiState} />
          {multiState === 'Yes' ?
          <div style={{ marginTop: 10 }}>
            <label className="label" style={{ fontWeight: 400, color: 'var(--ink-3)' }}>
              Select every state where the practice provides care
            </label>
            <StateMultiPick name="practice_states" />
          </div> :
          <div style={{ marginTop: 10 }}>
            <label className="label">Practice state</label>
            <select className="select" name="practice_states" required defaultValue="">
              <option value="" disabled>Select…</option>
              {US_STATES.map((st) => <option key={st}>{st}</option>)}
            </select>
          </div>
          }
        </div>
        <div style={{ marginTop: 14 }}>
          <label className="label">Which products interest you most? <span style={{ color: 'var(--ink-4)' }}>(select at least one)</span></label>
          <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8, marginTop: 6 }}>
            {['Insurify', 'Authorization Desk', 'RCM Intelligence', 'Denial Analytics', 'Payer Policy Monitor'].map((p, i) =>
            <ProductChip key={p} label={p} initial={i === 0} onAnyChange={() => setProdErr(null)} />
            )}
          </div>
          <FieldError msg={prodErr} />
        </div>
        <div style={{ marginTop: 14 }}>
          <label className="label">What's the most important thing to solve? <span style={{ color: 'var(--ink-4)' }}>(optional)</span></label>
          <textarea className="textarea" name="message" placeholder="e.g. Our Aetna MBB denial rate is 22% and we don't have visibility into which physicians or what gaps drive it…" />
        </div>
        {error && <FormFallback error={error} subject="Practice demo request" />}
        <TurnstileBox />
        <button type="submit" disabled={busy || !captchaReady} className="btn btn-lg btn-primary btn-arrow" style={{ marginTop: 18, width: '100%', opacity: busy || !captchaReady ? 0.65 : 1 }}>
          {busy ? <React.Fragment><span className="btn-spinner" aria-hidden="true" /> Sending your request…</React.Fragment> : <React.Fragment>Request demo <ArrowRight /></React.Fragment>}
        </button>
      </form>
    </div>);

}

function ProductChip({ label, initial, onAnyChange }) {
  const [on, setOn] = React.useState(!!initial);
  return (
    <React.Fragment>
      <button type="button" onClick={() => { setOn(!on); if (onAnyChange) onAnyChange(); }} aria-pressed={on}
        className="pick-pill" style={{
        appearance: 'none', fontFamily: 'inherit', fontSize: 12, padding: '6px 12px',
        borderRadius: 999, border: '1px solid ' + (on ? 'var(--accent)' : 'var(--line)'),
        background: on ? 'var(--accent-tint)' : '#fff',
        color: on ? 'var(--accent-ink)' : 'var(--ink-2)',
        display: 'inline-flex', gap: 6, alignItems: 'center', cursor: 'pointer'
      }}>
        {on && <Check size={10} />}
        {label}
      </button>
      {on && <input type="hidden" name="products" value={label} />}
    </React.Fragment>);

}

function AccessSent({ kind, verified, go, reset }) {
  const physician = kind === 'physician';
  const physicianLede =
    verified === true ? 'Your NPI was instantly verified against the NPPES registry — you\u2019re all set. Insurify goes live in August; watch your email for your priority activation invite.' :
    verified === false ? 'You\u2019re on the list. We couldn\u2019t instantly match your NPI, so our team will verify it manually — no action needed. Watch your email for confirmation and your activation invite.' :
    'Insurify goes live in August. Waitlist members get priority access at rollout — watch your email for your activation invite.';
  return (
    <section className="section" data-screen-label="04 Access — submitted">
      <div className="cmd-container" style={{ maxWidth: 640, textAlign: 'center' }}>
        <div style={{
          width: 64, height: 64, borderRadius: 999, background: 'var(--accent-tint)',
          border: '1px solid var(--accent-tint-2)',
          display: 'inline-flex', alignItems: 'center', justifyContent: 'center', color: 'var(--accent)'
        }}>
          <svg className="cmd-check-draw" width="28" height="28" viewBox="0 0 16 16" fill="none" aria-hidden="true">
            <path d="M3.5 8.5l3 3 6-7" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" />
          </svg>
        </div>
        <h1 className="h-1" style={{ marginTop: 22 }}>
          {physician ?
          <>You're on{' '}<span style={{ color: 'var(--accent)' }}>the list.</span></> :
          <>Request{' '}<span style={{ color: 'var(--accent)' }}>received.</span></>
          }
        </h1>
        {physician && verified === true &&
        <div style={{
          display: 'inline-flex', alignItems: 'center', gap: 8, marginTop: 14,
          padding: '6px 14px', borderRadius: 999, fontSize: 13, fontWeight: 500,
          background: 'var(--accent-tint)', border: '1px solid var(--accent-tint-2)',
          color: 'var(--accent-ink)'
        }}>
          <Check size={12} /> NPI verified via NPPES
        </div>
        }
        <p className="lede" style={{ margin: '14px auto 28px' }}>
          {physician ? physicianLede :
          "We'll reply within two business days to schedule your 45-minute scoping call."}
        </p>
        <div style={{ display: 'flex', gap: 12, justifyContent: 'center', flexWrap: 'wrap' }}>
          {physician ?
          <button className="btn btn-lg btn-primary btn-arrow" onClick={() => go('insurify')}>
            See what Insurify does <ArrowRight />
          </button> :
          <button className="btn btn-lg btn-primary" onClick={() => go('home')}>Back to home</button>
          }
        </div>
      </div>
    </section>);

}

// ─── ABOUT · EXECUTIVE LEADERSHIP ───────────────────────────────────────────
// The About page is now the Executive Leadership page: founders only.
// Advisory boards live on their own routes (physician-board, general-board).
function AboutPage({ go }) {
  return (
    <div data-screen-label="05 Executive Leadership">
      <section style={{ paddingTop: 28, paddingBottom: 16 }}>
        <div className="cmd-container">
          <div style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto' }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>Executive Leadership</div>
            <h1 className="h-display about-h1" style={{
              fontSize: 'clamp(30px, 3.4vw, 48px)',
              lineHeight: 1.05, letterSpacing: '-0.025em',
              textWrap: 'balance', margin: 0
            }}>
              A physician-led company,<br className="about-h1-br" style={{ display: 'none' }} />{' '}
              <span style={{ color: 'var(--accent)' }}>built with AI experts.</span>
            </h1>
            <p className="about-sub-d" style={{
              fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
            }}>CriterionMD was founded by a team of AI and revenue-cycle-management experts, with physician leadership involved from day one, guiding the company with clinical judgment and a patient-first mentality. We build with active input from physicians across the country.



            </p>
            <p className="about-sub-m" style={{ display: 'none' }}>
              Founded by AI and revenue-cycle-management experts, with physician leadership from day one, guiding the company with clinical judgment and a patient-first mentality.
            </p>
          </div>
        </div>
      </section>

      {/* Founders */}
      <section className="section-divider band-warm" style={{ padding: '48px 0' }}>
        <div className="cmd-container">
          <div className="grid-2" style={{ gap: 28, maxWidth: 1180, margin: '0 auto' }}>
            <FounderCard
              n="Farhan Mustafa"
              r="Chief Executive Officer"
              b="Product leader with over a decade across analytics, ML, AI, and natural-language search. Previously Director of Product at Tableau and co-founder/CEO of Grafiti, both successful exits. He builds software with physicians, not at them."
              img={typeof window !== 'undefined' && window.__resources && window.__resources.farhanPhoto || "assets/team/farhan-mustafa.webp"}
              i="FM" />
            <FounderCard
              n="Nasir Khatri, MD"
              r="President & Chief Medical Officer"
              b="Board-certified anesthesiologist and interventional pain specialist; Director of Neuromodulation at Insight Health Systems. He owns the clinical model behind every product on the platform, and still sees patients every week."
              img={typeof window !== 'undefined' && window.__resources && window.__resources.nasirPhoto || "assets/team/nasir-khatri.jpeg"}
              i="NK" />
          </div>
        </div>
      </section>

      {/* Physician-led conviction band */}
      <section className="section section-divider">
        <div className="cmd-container">
          <div style={{
            position: 'relative', overflow: 'hidden',
            borderRadius: 18, padding: '44px 48px',
            background: 'linear-gradient(155deg, var(--accent) 0%, var(--accent-ink) 100%)',
            color: '#fff',
            boxShadow: '0 1px 0 rgba(15,20,20,.04), 0 30px 80px -28px rgba(31,92,61,.45)'
          }} className="plb-card">
            <div style={{
              position: 'absolute', inset: 0, opacity: 0.07,
              backgroundImage: 'linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px)',
              backgroundSize: '36px 36px', pointerEvents: 'none'
            }} />
            <div style={{ position: 'relative', zIndex: 1, maxWidth: 820 }}>
              <div className="mono" style={{
                fontSize: 12, letterSpacing: '.18em', opacity: 0.8, marginBottom: 14
              }}>PHYSICIAN-LED, BY DESIGN</div>
              <h2 className="h-2 plb-title" style={{
                color: '#fff', textWrap: 'balance', margin: 0,
                fontSize: 'clamp(24px, 2.2vw, 34px)'
              }}>
                The clinical judgment comes first.<br className="plb-br" />{' '}
                <span style={{ color: 'var(--accent-tint-2)' }}>The software follows.</span>
              </h2>
              <p className="plb-sub" style={{
                marginTop: 16, marginBottom: 0, fontSize: 17, lineHeight: 1.6,
                color: 'rgba(255,255,255,0.88)'
              }}>
                Every product decision runs through practicing physicians, from the founder who owns
                the clinical model to the advisory boards guiding the platform.
              </p>
              <div className="plb-ctas" style={{ display: 'flex', gap: 10, marginTop: 26, flexWrap: 'wrap' }}>
                <button className="btn btn-lg btn-arrow"
                style={{ background: '#fff', color: 'var(--accent-ink)' }}
                onClick={() => go('physician-board')}>
                  Physician Advisory Board <ArrowRight />
                </button>
                <button className="btn btn-lg btn-outline"
                onClick={() => go('general-board')}
                style={{ background: 'transparent', color: '#fff', borderColor: 'rgba(255,255,255,0.3)' }}>
                  Advisory Board
                </button>
              </div>
            </div>
          </div>
        </div>
      </section>

    </div>);

}

// ─── ABOUT · PHYSICIAN ADVISORY BOARD ───────────────────────────────────────
function PhysicianBoardPage({ go }) {
  return (
    <div data-screen-label="05 Physician Advisory Board">
      <section style={{ paddingTop: 28, paddingBottom: 16 }}>
        <div className="cmd-container">
          <div style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto' }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>Physician Advisory Board</div>
            <h1 className="h-display" style={{
              fontSize: 'clamp(30px, 3.4vw, 48px)',
              lineHeight: 1.05, letterSpacing: '-0.025em',
              textWrap: 'balance', margin: 0
            }}>
              Guided by physicians who{' '}
              <span style={{ color: 'var(--accent)' }}>still see patients.</span>
            </h1>
            <p className="pab-sub-d" style={{
              fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
            }}>
              CriterionMD is physician-led. Our advisory board brings active clinical input from
              specialists across the country, so every product reflects how medicine is actually delivered.
            </p>
            <p className="pab-sub-m" style={{ display: 'none' }}>
              Active clinical input from specialists across the country shapes every product we build.
            </p>
          </div>
        </div>
      </section>

      <section className="section-divider band-warm" style={{ padding: '48px 0' }}>
        <div className="cmd-container">
          {/* Chair on top, centered */}
          <div style={{ maxWidth: 380, margin: '0 auto' }}>
            <PersonCard
              n="Nasir Khatri, MD"
              r="Board Certified Interventional Pain Physician"
              tag="Chief Medical Officer"
              img={typeof window !== 'undefined' && window.__resources && window.__resources.nasirPhoto || "assets/team/nasir-khatri.jpeg"}
              i="NK"
              accent />
          </div>
          {/* Remaining advisors below */}
          <div className="grid-2" style={{ gap: 20, maxWidth: 760, margin: '20px auto 0' }}>
            <PersonCard
              n="Brian Kim, MD"
              r="Board Certified Interventional Pain Medicine Physician"
              img={typeof window !== 'undefined' && window.__resources && window.__resources.brianPhoto || "assets/team/brian-kim.webp"}
              i="BK" />
            <PersonCard
              n="Ty Concannon, MD"
              r="Board Certified Interventional Pain Medicine Physician"
              img={typeof window !== 'undefined' && window.__resources && window.__resources.tyPhoto || "assets/team/ty-concannon.webp"}
              i="TC" />
          </div>
          <div style={{
            maxWidth: 560, margin: '28px auto 0',
            padding: 24, border: '1px dashed var(--line)', borderRadius: 14,
            background: 'var(--paper-2)', textAlign: 'center'
          }}>
            <div className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.08em', marginBottom: 8 }}>
              MORE TO COME
            </div>
            <p style={{ fontSize: 14, color: 'var(--ink-3)', margin: 0, lineHeight: 1.55 }}>
              A working group of physician advisors is already active across additional
              specialties. We announce each advisor's name and involvement when we launch
              a product in their specialty.
            </p>
          </div>
        </div>
      </section>

      {/* Built with clinicians */}
      <HomeTrustBar />
    </div>);

}

// ─── ABOUT · GENERAL ADVISORY BOARD ─────────────────────────────────────────
function GeneralBoardPage({ go }) {
  return (
    <div data-screen-label="05 Advisory Board">
      <section style={{ paddingTop: 28, paddingBottom: 16 }}>
        <div className="cmd-container">
          <div style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto' }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>Advisory Board</div>
            <h1 className="h-display" style={{
              fontSize: 'clamp(30px, 3.4vw, 48px)',
              lineHeight: 1.05, letterSpacing: '-0.025em',
              textWrap: 'balance', margin: 0
            }}>
              The advisors behind{' '}
              <span style={{ color: 'var(--accent)' }}>the build.</span>
            </h1>
            <p className="gab-sub-d" style={{
              fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
            }}>
              A broad bench of advisors guides our operations, practice management, and legal and ethical
              compliance. Each one brings real-world experience in healthcare to the decisions we make.
            </p>
            <p className="gab-sub-m" style={{ display: 'none' }}>
              A broad bench of advisors guides our operations, practice management, and compliance.
            </p>
          </div>
        </div>
      </section>

      <section className="section-divider band-warm" style={{ padding: '48px 0' }}>
        <div className="cmd-container">
          <div className="grid-3" style={{ gap: 20 }}>
            <div style={{
              padding: 24, border: '1px dashed var(--line)', borderRadius: 14,
              background: 'var(--paper-2)', display: 'flex', flexDirection: 'column',
              justifyContent: 'center', alignItems: 'flex-start', gap: 8
            }}>
              <div className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.08em' }}>
                BUILDING IN STEALTH
              </div>
              <p style={{ fontSize: 14, color: 'var(--ink-3)', margin: 0, lineHeight: 1.55 }}>
                A team of experienced healthcare executives, AI experts, and other advisors is
                officially involved today, working in a stealth capacity. Challenging the status
                quo means building quietly. We'll introduce them soon.
              </p>
            </div>
            <div style={{ display: 'none' }} />
          </div>
        </div>
      </section>

      <BoardCTA go={go} other="physician" />
    </div>);

}

// Shared CTA used by both board pages — always reinforces physician leadership
// and cross-links to the other board.
function BoardCTA({ go, other }) {
  const toPhysician = other === 'physician';
  return (
    <section className="section section-divider">
      <div className="cmd-container">
        <div style={{ textAlign: 'center', maxWidth: 760, margin: '0 auto' }}>
          <h2 className="h-2">
            Built{' '}<span style={{ color: 'var(--accent)' }}>with physicians,</span>{' '}not at them.
          </h2>
          <p className="lede" style={{ margin: '20px auto 32px' }}>
            Active clinical input from physicians across the country shapes every product we ship.
          </p>
          <div style={{ display: 'flex', gap: 12, justifyContent: 'center', flexWrap: 'wrap' }}>
            <button className="btn btn-lg btn-primary btn-arrow"
            onClick={() => go(toPhysician ? 'physician-board' : 'general-board')}>
              {toPhysician ? 'Physician Advisory Board' : 'Advisory Board'} <ArrowRight />
            </button>
            <button className="btn btn-lg btn-outline" onClick={() => go('about')}>
              Executive Leadership
            </button>
          </div>
        </div>
      </div>
    </section>);

}

// Member card — vertical layout (circular photo or initials at top), used on
// the advisory board pages.
function PersonCard({ n, r, b, i, img, tag, accent }) {
  const avatarSize = 168;
  return (
    <div className="card card-pad person-card" style={{
      display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center',
      ...(accent ? { background: 'var(--accent-tint)', borderColor: 'var(--accent-tint-2)' } : {})
    }}>
      {img ?
      <img src={img} alt={n} loading="lazy" style={{
        width: avatarSize, height: avatarSize, borderRadius: 999,
        objectFit: 'cover', objectPosition: 'center top',
        marginBottom: 20, flexShrink: 0,
        border: '1px solid var(--line)'
      }} /> :

      <div style={{
        width: avatarSize, height: avatarSize, borderRadius: 999,
        background: accent ? '#fff' : 'var(--accent-tint)', color: 'var(--accent-ink)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        fontSize: 44, fontWeight: 500, letterSpacing: '.02em',
        marginBottom: 20, flexShrink: 0
      }}>{i}</div>
      }
      {tag &&
      <span className="mono" style={{
        fontSize: 10.5, letterSpacing: '.14em', fontWeight: 500,
        padding: '4px 10px', borderRadius: 999, marginBottom: 10,
        background: accent ? '#fff' : 'var(--accent-tint)', color: 'var(--accent-ink)',
        border: '1px solid var(--accent-tint-2)', textTransform: 'uppercase'
      }}>{tag}</span>
      }
      <div className="pc-name" style={{ fontSize: 18, fontWeight: 500, letterSpacing: '-0.015em' }}>{n}</div>
      <div className="pc-role" style={{ fontSize: 15, color: 'var(--accent)', marginTop: 4, marginBottom: b ? 14 : 0, fontWeight: 500 }}>{r}</div>
      {b && <p className="pc-bio" style={{ fontSize: 14, color: 'var(--ink-2)', margin: 0, lineHeight: 1.6 }}>{b}</p>}
    </div>);

}

// Founder card — vertical layout, large circular photo at top.
function FounderCard({ n, r, b, i, img }) {
  const avatarSize = 240;
  return (
    <div className="card card-pad founder-card" style={{
      display: 'flex', flexDirection: 'column', alignItems: 'center',
      textAlign: 'center', padding: '40px 36px'
    }}>
      {img ?
      <img src={img} alt={n} loading="lazy" style={{
        width: avatarSize, height: avatarSize, borderRadius: 999,
        objectFit: 'cover', objectPosition: 'center top',
        marginBottom: 24, flexShrink: 0,
        border: '1px solid var(--line)'
      }} /> :

      <div style={{
        width: avatarSize, height: avatarSize, borderRadius: 999,
        background: 'var(--accent-tint)', color: 'var(--accent-ink)',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        fontSize: 64, fontWeight: 500, letterSpacing: '.02em',
        marginBottom: 24, flexShrink: 0
      }}>{i}</div>
      }
      <div className="fc-name" style={{ fontSize: 24, fontWeight: 500, letterSpacing: '-0.015em' }}>{n}</div>
      <div className="fc-role" style={{ fontSize: 16, color: 'var(--accent)', marginTop: 6, marginBottom: 18, fontWeight: 500 }}>{r}</div>
      <p className="fc-bio" style={{ fontSize: 15, color: 'var(--ink-2)', margin: 0, lineHeight: 1.6, textWrap: 'pretty' }}>{b}</p>
    </div>);

}

// ─── PRESS RELEASES ──────────────────────────────────────────────────────────
// Templated press/news page. Empty for now — drop entries into PRESS_ITEMS
// (external coverage) and BLOG_ITEMS (our own posts) and the page fills in.
// Each press item: { date, source, title, href, summary }.
const PRESS_ITEMS = [
  // { date: 'May 2026', source: 'MedCity News', title: 'Headline goes here',
  //   href: 'https://…', summary: 'One or two lines of context.' },
];
// Each blog item: { date, title, href, summary }.
// Items with a `route` open a full article page in-app instead of an external link.
const BLOG_ITEMS = [
  {
    date: 'July 16, 2026',
    route: 'press-insurify-launch',
    title: 'CriterionMD Launches Insurify at ASPN 2026, Bringing Free Prior-Authorization Intelligence to Physicians',
    summary: 'CriterionMD announces the public launch of Insurify™ at the ASPN 2026 Annual Conference — free for NPI-verified physicians and APPs, with no credit card and no usage limits.',
  },
  {
    date: 'June 5, 2026',
    route: 'press-advisors',
    title: 'CriterionMD Welcomes Two New Members to the Physician Advisory Board',
    summary: 'CriterionMD adds its first two physician advisors, both practicing interventional pain physicians, to keep its products grounded in the realities of clinical workflow.',
  },
  {
    date: 'May 4, 2026',
    route: 'press-pilot',
    title: 'CriterionMD Launches First Pilot Across Michigan Clinical and Surgical Sites',
    summary: 'CriterionMD launches its first pilot across Insight Health System, Southeast Michigan Surgical Hospital, and Charter Surgery Center, testing physician-led documentation and medical necessity support in live clinical and surgical settings.',
  },
];

function PressPage({ go }) {
  const hasPress = PRESS_ITEMS.length > 0;
  const hasBlog = BLOG_ITEMS.length > 0;
  return (
    <div data-screen-label="07 Press Releases">
      <section style={{ paddingTop: 28, paddingBottom: 16 }}>
        <div className="cmd-container">
          <div style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto' }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>About Us · Press Releases</div>
            <h1 className="h-display" style={{
              fontSize: 'clamp(30px, 3.4vw, 48px)',
              lineHeight: 1.05, letterSpacing: '-0.025em',
              textWrap: 'balance', margin: 0
            }}>
              News &amp; company{' '}
              <span style={{ color: 'var(--accent)' }}>updates.</span>
            </h1>
            <p style={{
              fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
            }}>
              Coverage of CriterionMD and posts from our team, as we build payer-aware solutions for physicians, by physicians.
            </p>
          </div>
        </div>
      </section>

      {/* In the news */}
      <section className="section-divider band-warm" style={{ padding: '48px 0' }}>
        <div className="cmd-container">
          <div style={{
            display: 'flex', alignItems: 'center', gap: 12, marginBottom: 24
          }}>
            <span className="eyebrow" style={{ margin: 0 }}>In the news</span>
            <span style={{ flex: 1, height: 1, background: 'var(--line)' }} />
          </div>
          {hasPress ?
          <div style={{ display: 'flex', flexDirection: 'column', gap: 14 }}>
              {PRESS_ITEMS.map((item, i) =>
            <PressRow key={i} item={item} external />
            )}
            </div> :

          <PressEmptyState
            kind="coverage"
            go={go} />
          }
        </div>
      </section>

      {/* From the team */}
      <section className="section-divider" style={{ padding: '48px 0' }}>
        <div className="cmd-container">
          <div style={{
            display: 'flex', alignItems: 'center', gap: 12, marginBottom: 24
          }}>
            <span className="eyebrow" style={{ margin: 0 }}>From the team</span>
            <span style={{ flex: 1, height: 1, background: 'var(--line)' }} />
          </div>
          {hasBlog ?
          <div className="grid-3" style={{ gap: 20 }}>
              {BLOG_ITEMS.map((item, i) =>
            <BlogCard key={i} item={item} go={go} />
            )}
            </div> :

          <PressEmptyState kind="posts" go={go} />
          }
        </div>
      </section>

      {/* Media contact */}
      <section className="section section-divider">
        <div className="cmd-container">
          <div className="cols" style={{
            background: 'var(--paper)', border: '1px solid var(--line-2)',
            boxShadow: 'var(--shadow-card-lg)', borderRadius: 18, padding: '36px 40px',
            '--cols': '1.4fr 1fr', gap: 40, alignItems: 'center'
          }}>
            <div>
              <div className="eyebrow" style={{ marginBottom: 8 }}>Media inquiries</div>
              <h2 className="h-2" style={{ margin: 0, fontSize: 'clamp(24px, 2.2vw, 34px)' }}>
                Writing about{' '}<span style={{ color: 'var(--accent)' }}>CriterionMD?</span>
              </h2>
              <p style={{ fontSize: 15, color: 'var(--ink-2)', marginTop: 12, marginBottom: 0, lineHeight: 1.55 }}>
                For interviews, founder bios, logos, and product imagery, reach the team directly.
              </p>
            </div>
            <div style={{ textAlign: 'left' }}>
              <div className="mono" style={{ fontSize: 11, letterSpacing: '.16em', color: 'var(--ink-3)', marginBottom: 8 }}>
                PRESS CONTACT
              </div>
              <a href="mailto:press@criterionmd.com"
              style={{
                color: 'var(--accent)', fontSize: 18, fontWeight: 500,
                borderBottom: '1px solid var(--accent-tint-2)', paddingBottom: 3
              }}>
                press@criterionmd.com
              </a>
            </div>
          </div>
        </div>
      </section>
    </div>);

}

function PressRow({ item, external }) {
  return (
    <a href={item.href || '#'}
    target={external ? '_blank' : undefined}
    rel={external ? 'noopener noreferrer' : undefined}
    className="card"
    style={{
      display: 'grid', gridTemplateColumns: '160px 1fr auto', gap: 24,
      alignItems: 'center', padding: '20px 24px', textDecoration: 'none'
    }}>
      <div className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.06em' }}>
        {item.date}{item.source ? ` · ${item.source}` : ''}
      </div>
      <div>
        <div style={{ fontSize: 20, fontWeight: 500, color: 'var(--ink)', letterSpacing: '-0.01em' }}>
          {item.title}
        </div>
        {item.summary &&
        <p style={{ fontSize: 14, color: 'var(--ink-2)', margin: '6px 0 0', lineHeight: 1.5 }}>
            {item.summary}
          </p>
        }
      </div>
      <span style={{ color: 'var(--accent)', display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 14, fontWeight: 500 }}>
        Read <ArrowRight />
      </span>
    </a>);

}

function BlogCard({ item, go }) {
  const internal = !!item.route;
  return (
    <a href={item.href || '#'}
    onClick={internal ? (e) => { e.preventDefault(); go(item.route); } : undefined}
    className="card card-pad" style={{
      display: 'flex', flexDirection: 'column', gap: 10, textDecoration: 'none', minHeight: 180
    }}>
      <div className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.06em' }}>
        {item.date}
      </div>
      <div style={{ fontSize: 20, fontWeight: 500, color: 'var(--ink)', letterSpacing: '-0.015em', lineHeight: 1.25 }}>
        {item.title}
      </div>
      {item.summary &&
      <p style={{ fontSize: 14, color: 'var(--ink-2)', margin: 0, lineHeight: 1.55, flex: 1 }}>
          {item.summary}
        </p>
      }
      <span style={{ color: 'var(--accent)', display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 14, fontWeight: 500, marginTop: 4 }}>
        Read post <ArrowRight />
      </span>
    </a>);

}

function PressEmptyState({ kind, go }) {
  const copy = kind === 'coverage' ?
  { title: 'No coverage to share yet.', body: 'When CriterionMD is featured in the press, the articles will be linked here.' } :
  { title: 'No posts yet.', body: 'Company updates and notes from the team will appear here as we publish them.' };
  return (
    <div style={{
      border: '1px dashed var(--line)', borderRadius: 14, background: 'var(--paper-2)',
      padding: '40px 32px', textAlign: 'center'
    }}>
      <div style={{
        width: 40, height: 40, borderRadius: 10, margin: '0 auto 16px',
        background: 'var(--paper)', border: '1px solid var(--line)',
        color: 'var(--ink-3)', display: 'flex', alignItems: 'center', justifyContent: 'center'
      }}>
        <svg width="18" height="18" viewBox="0 0 18 18" fill="none">
          <path d="M4 3h7l3 3v9H4V3Z" stroke="currentColor" strokeWidth="1.4" strokeLinejoin="round" />
          <path d="M10.5 3v3.5H14M6 9h6M6 11.5h6" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" />
        </svg>
      </div>
      <div style={{ fontSize: 20, fontWeight: 500, color: 'var(--ink)', letterSpacing: '-0.01em' }}>
        {copy.title}
      </div>
      <p style={{ fontSize: 14.5, color: 'var(--ink-3)', margin: '8px auto 0', maxWidth: 44 + 'ch', lineHeight: 1.55 }}>
        {copy.body}
      </p>
    </div>);

}

// ─── PRESS ARTICLE: Insurify launch (ASPN 2026) ──────────────────────────────
const INSURIFY_LAUNCH_RELEASE = {
  date: 'July 16, 2026',
  kicker: 'Press Release · For Immediate Release',
  screenLabel: '07 Press Release · Insurify Launch',
  title: 'CriterionMD Launches Insurify at ASPN 2026, Bringing Free Prior-Authorization Intelligence to Physicians',
  dek: 'The physician-founded company\u2019s flagship tool reads the clinical note as it\u2019s written and shows what the payer requires — before the prior authorization goes out.',
  body: [
    { type: 'p', text: 'NORTHVILLE, Mich. — July 16, 2026 — CriterionMD, Inc., a physician-founded healthcare software company, today announced the public launch of Insurify\u2122 at the American Society of Pain and Neuroscience (ASPN) 2026 Annual Conference. Insurify reads the clinical note in real time, maps it against the payer\u2019s published medical-necessity criteria, and flags documentation gaps while the patient is still in the room — before the prior authorization is submitted.' },
    { type: 'p', text: 'Physicians consistently rank prior authorization among the heaviest administrative burdens in medicine. Denied and delayed authorizations postpone patient care, generate hours of rework, and drain practice revenue — and most of the damage is preventable at the moment of documentation.' },
    { type: 'p', text: 'In a design-partner pilot at Southeast Michigan Surgical Hospital, a multi-specialty surgical facility, CriterionMD\u2019s approach reduced procedure authorization time by 10 days and recovered $83,000 in denial revenue in the first 90 days.' },
    { type: 'quote', text: 'Every practice I\u2019ve run has had five vendors that sort of solve five different pieces of the same problem. CriterionMD is the first thing I\u2019ve seen that connects them, and starts where the money actually leaks.', attrib: 'Husban Khan', role: 'Clinical Administrator, Southeast Michigan Surgical Hospital' },
    { type: 'quote', text: 'Physicians didn\u2019t create the prior-authorization maze, but we\u2019re the ones who lose our afternoons to it. Insurify puts the payer\u2019s own criteria in front of the clinician at the moment of documentation. The denial gets prevented in the visit — not appealed three weeks later.', attrib: 'Nasir Khatri, MD', role: 'Co-founder, President and Chief Medical Officer, CriterionMD · practicing interventional pain physician' },
    { type: 'quote', text: 'We built Insurify with physicians, not at them. It works the way clinicians already document — no templates, no dropdowns — and it\u2019s free for individual physicians and APPs, because the people carrying the burden shouldn\u2019t also carry the bill.', attrib: 'Farhan Mustafa', role: 'Co-founder and Chief Executive Officer, CriterionMD' },
    { type: 'p', text: 'Insurify is available today at criterionmd.com, free for NPI-verified physicians and advanced practice providers, with no credit card and no usage limits. Practices and health organizations can request a demonstration of the broader CriterionMD platform, currently in development with a design-partner cohort.' },
    { type: 'lead', text: 'About CriterionMD' },
    { type: 'p', text: 'CriterionMD, Inc. is a physician-founded healthcare software company building payer-aware solutions for physicians, by physicians. CriterionMD unifies clinical documentation, provider rationale, and payer intelligence so that care gets authorized, delivered, and paid the first time. The company is headquartered in Michigan.' },
    { type: 'p', text: 'Media contact: press@criterionmd.com' },
  ],
};

// ─── PRESS ARTICLE: Physician advisors ───────────────────────────────────────
const ADVISOR_RELEASE = {
  date: 'June 5, 2026',
  kicker: 'Press Release',
  screenLabel: '07 Press Release · Physician Advisors',
  title: 'CriterionMD Welcomes Two New Members to the Physician Advisory Board',
  dek: 'Brian Kim, MD and Ty Concannon, MD join as the most recent additions to the company\u2019s growing Physician Advisory team. Both practicing interventional pain physicians, they bring direct clinical experience and procedural expertise to CriterionMD\u2019s physician-led product work.',
  body: [
    { type: 'p', text: 'CriterionMD is pleased to announce the addition of its first two physician advisors, Brian Kim, MD and Ty Concannon, MD. Both are practicing interventional pain physicians who bring direct clinical experience, procedural expertise, and practical insight into the real-world challenges facing physicians, APPs, practices, and health systems.' },
    { type: 'p', text: 'Dr. Kim practices in Overland Park, Kansas at College Park Medical Group, where he serves as Medical Director of Pain Management. Dr. Concannon is an interventional pain physician at Saint Luke\u2019s, part of BJC Health System. Their addition marks an important step in CriterionMD\u2019s mission to build physician-led technology for the clinical and administrative realities of modern medical practice.' },
    { type: 'p', text: 'CriterionMD was founded on a simple premise: the healthcare system is built around the work of physicians and clinical teams, but most healthcare technology is not built from their point of view. In pain medicine, this gap is obvious. Physicians are expected to deliver high-quality care, document complex clinical reasoning, satisfy payer rules, support staff workflows, reduce denials, and protect revenue integrity, often while using tools that were never designed around how physicians actually think or work.' },
    { type: 'lead', text: 'CriterionMD is being built to close that gap.' },
    { type: 'p', text: 'The company\u2019s first products focus on the intersection of clinical documentation, payer policy, medical necessity, and physician workflow. These are not abstract administrative problems. They affect whether patients receive the procedures they need, whether practices are paid for the work they perform, and whether physicians can spend their time on patient care rather than endless documentation cleanup, authorization friction, and denial management.' },
    { type: 'p', text: 'The addition of Dr. Kim and Dr. Concannon gives CriterionMD early access to two physicians who understand these issues at the point of care. As interventional pain physicians, they work in a specialty where documentation quality, payer-specific medical necessity rules, procedural decision-making, and revenue cycle performance are tightly linked. Their experience will help CriterionMD stay grounded in the realities of the exam room, the procedure suite, and the practice back office.' },
    { type: 'quote', text: 'CriterionMD is intentionally physician-led because the deepest workflow problems in healthcare cannot be solved from the outside looking in. Dr. Kim and Dr. Concannon understand the day-to-day pressure physicians face. They know what it means to make clinical decisions, document them correctly, support a team, and deal with payer requirements that often fail to match the pace of clinical care. Their guidance will help us build products that are useful, practical, and credible.', attrib: 'Nasir Khatri, MD', role: 'Co-Founder & Chief Medical Officer, CriterionMD' },
    { type: 'p', text: 'Dr. Kim and Dr. Concannon will advise CriterionMD on physician workflow, interventional pain documentation, payer-facing medical necessity logic, clinical usability, and product strategy. Their role will be especially important as CriterionMD develops tools designed to help physicians and practices identify documentation gaps before they become authorization delays, denials, or revenue leakage.' },
    { type: 'p', text: 'This advisor group is also a signal of how CriterionMD intends to build. The company is not approaching healthcare as a generic software market. It is starting with a specific, high-friction clinical domain where physicians feel the problem every day. Interventional pain medicine is procedure-heavy, documentation-sensitive, payer-dependent, and operationally complex. That makes it an ideal first proving ground for technology that can later expand into other specialties facing similar clinical and administrative pressure.' },
    { type: 'p', text: 'CriterionMD\u2019s goal is not to add another layer of software to the physician\u2019s day. The goal is to remove unnecessary friction from the work that already exists. That means helping physicians document more effectively, helping practices prepare stronger authorizations, helping administrators see risk earlier, and helping the entire clinical operation function with less waste.' },
    { type: 'p', text: 'The company believes the best healthcare technology will not simply automate tasks. It will understand clinical intent, payer expectations, workflow timing, and the economic reality of medical practice. That requires physicians to be involved from the beginning, not brought in at the end as validators.' },
    { type: 'p', text: 'By adding Dr. Kim and Dr. Concannon as physician advisors, CriterionMD is strengthening its connection to the physicians it intends to serve. Their guidance will help ensure that the company\u2019s products remain practical, clinically relevant, and aligned with the daily needs of interventional pain practices.' },
    { type: 'p', text: 'This is an early milestone for CriterionMD, but an important one. The company is building around a core belief: healthcare technology should respect the physician\u2019s role, reduce unnecessary administrative burden, and support better care without forcing clinicians to work around poorly designed systems.' },
    { type: 'p', text: 'CriterionMD welcomes Dr. Brian Kim and Dr. Ty Concannon and looks forward to working with them as the company continues developing physician-centered tools for modern medical practice.' },
  ],
  advisors: [
    { name: 'Brian Kim, MD', role: 'Medical Director of Pain Management', org: 'College Park Medical Group · Overland Park, KS' },
    { name: 'Ty Concannon, MD', role: 'Interventional Pain Physician', org: 'Saint Luke\u2019s · BJC Health System' },
  ],
};

// ─── PRESS ARTICLE: Michigan pilot ───────────────────────────────────────────
const MICHIGAN_RELEASE = {
  date: 'May 4, 2026',
  kicker: 'Press Release',
  screenLabel: '07 Press Release · Michigan Pilot',
  title: 'CriterionMD Launches First Pilot Across Michigan Clinical and Surgical Sites',
  dek: 'CriterionMD launches its first pilot across Insight Health System, Southeast Michigan Surgical Hospital, and Charter Surgery Center, putting physician-led documentation and medical necessity support to work in live clinical and surgical settings.',
  body: [
    { type: 'p', text: 'CriterionMD has launched its first pilot across multiple clinical and surgical sites in Michigan, marking an important step in the company\u2019s mission to build physician-led technology for real clinical workflows.' },
    { type: 'p', text: 'The pilot includes Insight Health System locations in Dearborn, Flint, Warren, Coldwater, and Novi, along with Southeast Michigan Surgical Hospital in Warren and Charter Surgery Center in Flint. The launch gives CriterionMD the opportunity to evaluate its platform across a broad range of care settings, including outpatient clinics, hospital-based environments, and ambulatory surgery centers.' },
    { type: 'p', text: 'CriterionMD was created to solve a specific problem in healthcare: physicians and clinical teams are being asked to deliver care, document medical necessity, satisfy payer requirements, support authorization workflows, and protect revenue integrity while using systems that were not built around how physicians actually practice.' },
    { type: 'p', text: 'This pilot is designed to test CriterionMD in the real world, where documentation quality, payer policy, clinical decision-making, and operational workflow all intersect.' },
    { type: 'p', text: 'The first phase of the pilot will focus on interventional pain management, a specialty where the need is immediate and measurable. Interventional pain physicians routinely manage complex patients, procedure-heavy treatment plans, payer-specific medical necessity rules, and authorization requirements that vary across insurers. A small documentation gap can lead to a delayed authorization, a denial, a peer-to-peer review, a cancelled procedure, or unnecessary administrative work for staff and physicians.' },
    { type: 'lead', text: 'CriterionMD is being developed to identify those issues earlier in the workflow.' },
    { type: 'p', text: 'The platform is designed to help physicians and practices evaluate whether documentation supports the recommended procedure, whether key medical necessity elements are present, and whether the clinical note is aligned with payer expectations before the case enters the authorization process. The goal is not to add more work to the physician\u2019s day. The goal is to reduce avoidable friction, improve documentation quality, and help practices move from reactive denial management to proactive workflow support.' },
    { type: 'quote', text: 'Launching our first pilot in live clinical environments is a major milestone for CriterionMD. Healthcare technology often fails because it is built too far away from the physician workflow. We are starting at the point where the problem actually lives: the clinical encounter, the documentation, the payer requirement, and the operational handoff that follows.', attrib: 'Farhan Mustafa', role: 'Co-Founder & Chief Executive Officer, CriterionMD' },
    { type: 'p', text: 'The participating sites give CriterionMD a meaningful testing environment across several types of care delivery. Insight Health System\u2019s Michigan locations provide exposure to multi-site clinical operations across Dearborn, Flint, Warren, Coldwater, and Novi. Southeast Michigan Surgical Hospital and Charter Surgery Center allow the company to evaluate how the platform may support procedural workflows, authorization readiness, and documentation alignment in surgical settings.' },
    { type: 'p', text: 'For CriterionMD, the pilot is not only a product test. It is a proof point for the company\u2019s broader thesis that physician-centered technology can create value for multiple stakeholders at once.' },
    { type: 'p', text: 'When physicians document more effectively, patients may experience fewer delays. When practices identify documentation gaps earlier, staff spend less time chasing missing information. When authorizations are cleaner, administrators have better visibility into avoidable revenue leakage. When workflows are designed around clinical reality, the entire system functions with less waste.' },
    { type: 'lead', text: 'CriterionMD believes this is where healthcare technology should be focused.' },
    { type: 'p', text: 'The company is not building generic automation for healthcare. It is building tools that understand the relationship between clinical intent, documentation, medical necessity, payer policy, and practice economics. That requires close partnership with physicians, clinical staff, administrators, and real practice environments.' },
    { type: 'p', text: 'This first pilot will allow CriterionMD to collect practical feedback from the people who live inside these workflows every day. The company will use that feedback to refine product design, improve usability, strengthen payer logic, and ensure that the platform supports clinical teams without disrupting patient care.' },
    { type: 'p', text: 'The launch also reflects CriterionMD\u2019s commitment to building from the ground up with physicians and operators, rather than designing in isolation and asking practices to adapt later. The company\u2019s long-term vision is to create a suite of physician-centered tools that help medical practices operate with more clarity, less administrative drag, and stronger alignment between patient care and financial performance.' },
    { type: 'p', text: 'The first pilot across Insight Health System, Southeast Michigan Surgical Hospital, and Charter Surgery Center represents the beginning of that work.' },
    { type: 'p', text: 'CriterionMD will continue expanding its platform in close collaboration with clinical partners as it develops technology for the next generation of physician workflow, documentation intelligence, and medical necessity support.' },
  ],
  sites: [
    { name: 'Insight Health System', role: 'Multi-site clinical operations', org: 'Dearborn · Flint · Warren · Coldwater · Novi, MI' },
    { name: 'Southeast Michigan Surgical Hospital', role: 'Hospital-based surgical setting', org: 'Warren, MI' },
    { name: 'Charter Surgery Center', role: 'Ambulatory surgery center', org: 'Flint, MI' },
  ],
};

function PressArticlePage({ go, release }) {  const r = release || ADVISOR_RELEASE;
  return (
    <div data-screen-label={r.screenLabel || '07 Press Release'}>
      {/* Article header */}
      <section style={{ paddingTop: 24, paddingBottom: 8 }}>
        <div className="cmd-container" style={{ maxWidth: 'none', paddingLeft: 'clamp(20px, 8vw, 120px)', paddingRight: 'clamp(20px, 8vw, 120px)' }}>
          <button onClick={() => go('press')}
            style={{
              appearance: 'none', font: 'inherit', cursor: 'pointer', background: 'transparent',
              border: 0, padding: 0, color: 'var(--ink-3)', fontSize: 13.5,
              display: 'inline-flex', alignItems: 'center', gap: 7, marginBottom: 28
            }}>
            <svg width="14" height="14" viewBox="0 0 14 14" fill="none" style={{ transform: 'rotate(180deg)' }}>
              <path d="M3 7h8M8 4l3 3-3 3" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
            Press Releases
          </button>
          <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 18 }}>
            <span className="eyebrow" style={{ margin: 0 }}>{r.kicker}</span>
            <span style={{ width: 4, height: 4, borderRadius: 999, background: 'var(--line)' }} />
            <span className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.06em' }}>{r.date}</span>
          </div>
          <h1 className="h-display" style={{
            fontSize: 'clamp(30px, 3.4vw, 48px)', lineHeight: 1.08, letterSpacing: '-0.025em',
            textAlign: 'center', margin: '0 auto',
            textWrap: 'balance'
          }}>
            {r.title}
          </h1>
          <p style={{
            fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55, fontWeight: 400,
            margin: '20px 0 0', textWrap: 'pretty', textAlign: 'center'
          }}>
            {r.dek}
          </p>
        </div>
      </section>

      <div className="cmd-container" style={{ maxWidth: 'none', paddingLeft: 'clamp(20px, 8vw, 120px)', paddingRight: 'clamp(20px, 8vw, 120px)' }}>
        <span style={{ display: 'block', height: 1, background: 'var(--line)', margin: '28px 0' }} />
      </div>

      {/* Article body */}
      <section style={{ paddingTop: 8, paddingBottom: 40 }}>
        <div className="cmd-container" style={{ maxWidth: 'none', paddingLeft: 'clamp(20px, 8vw, 120px)', paddingRight: 'clamp(20px, 8vw, 120px)' }}>
          <article style={{ display: 'flex', flexDirection: 'column', gap: 22 }}>
            {r.body.map((b, i) => {
              if (b.type === 'lead') {
                return (
                  <p key={i} style={{
                    fontSize: 20, fontWeight: 500, color: 'var(--ink)', lineHeight: 1.4,
                    letterSpacing: '-0.015em', margin: '6px 0', textWrap: 'pretty'
                  }}>{b.text}</p>
                );
              }
              if (b.type === 'quote') {
                return (
                  <figure key={i} style={{
                    margin: '12px 0', padding: '28px 32px', borderRadius: 16,
                    background: 'var(--accent-tint)', border: '1px solid var(--accent-tint-2)'
                  }}>
                    <blockquote style={{
                      margin: 0, fontSize: 20, lineHeight: 1.5, color: 'var(--accent-ink)',
                      fontWeight: 450, letterSpacing: '-0.01em', textWrap: 'pretty'
                    }}>
                      &ldquo;{b.text}&rdquo;
                    </blockquote>
                    <figcaption style={{ marginTop: 18, display: 'flex', flexDirection: 'column', gap: 2 }}>
                      <span style={{ fontSize: 15, fontWeight: 600, color: 'var(--ink)' }}>{b.attrib}</span>
                      <span style={{ fontSize: 13.5, color: 'var(--ink-2)' }}>{b.role}</span>
                    </figcaption>
                  </figure>
                );
              }
              return (
                <p key={i} style={{
                  fontSize: 16, lineHeight: 1.65, color: 'var(--ink-2)', margin: 0, textWrap: 'pretty'
                }}>{b.text}</p>
              );
            })}
          </article>

          {/* Every press release ends with the signup CTA */}
          <div style={{
            marginTop: 40, padding: '26px 30px', borderRadius: 16,
            background: 'var(--paper-2)', border: '1px solid var(--line)',
            display: 'flex', flexWrap: 'wrap', alignItems: 'center',
            justifyContent: 'space-between', gap: 16
          }}>
            <div>
              <div style={{ fontSize: 18, fontWeight: 500 }}>Insurify is free for NPI-verified physicians and APPs.</div>
              <div style={{ fontSize: 14, color: 'var(--ink-3)', marginTop: 4 }}>No credit card, no usage limits.</div>
            </div>
            <button className="btn btn-lg btn-primary btn-arrow" onClick={() => go('access')}>
              Get Insurify free <ArrowRight />
            </button>
          </div>

          {/* Advisor cards */}
          {r.advisors && r.advisors.length > 0 &&
          <div style={{ marginTop: 40 }}>
            <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 18 }}>
              <span className="eyebrow" style={{ margin: 0 }}>The advisors</span>
              <span style={{ flex: 1, height: 1, background: 'var(--line)' }} />
            </div>
            <div className="grid-2" style={{ gap: 16 }}>
              {r.advisors.map((a, i) => (
                <div key={i} className="card card-pad" style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
                  <div style={{ fontSize: 18, fontWeight: 600, color: 'var(--ink)', letterSpacing: '-0.015em' }}>{a.name}</div>
                  <div style={{ fontSize: 14.5, color: 'var(--accent)', fontWeight: 500 }}>{a.role}</div>
                  <div style={{ fontSize: 13.5, color: 'var(--ink-3)', lineHeight: 1.5 }}>{a.org}</div>
                </div>
              ))}
            </div>
          </div>
          }

          {/* Pilot sites */}
          {r.sites && r.sites.length > 0 &&
          <div style={{ marginTop: 40 }}>
            <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 18 }}>
              <span className="eyebrow" style={{ margin: 0 }}>The pilot sites</span>
              <span style={{ flex: 1, height: 1, background: 'var(--line)' }} />
            </div>
            <div className="cols" style={{ '--cols': 'repeat(3, 1fr)', gap: 16 }}>
              {r.sites.map((a, i) => (
                <div key={i} className="card card-pad" style={{ display: 'flex', flexDirection: 'column', gap: 6 }}>
                  <div style={{ fontSize: 17, fontWeight: 600, color: 'var(--ink)', letterSpacing: '-0.015em', textWrap: 'balance' }}>{a.name}</div>
                  <div style={{ fontSize: 14.5, color: 'var(--accent)', fontWeight: 500 }}>{a.role}</div>
                  <div style={{ fontSize: 13.5, color: 'var(--ink-3)', lineHeight: 1.5 }}>{a.org}</div>
                </div>
              ))}
            </div>
          </div>
          }
          <div style={{
            marginTop: 36, paddingTop: 24, borderTop: '1px solid var(--line)',
            display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'space-between', gap: 16
          }}>
            <div className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.06em' }}>
              MEDIA CONTACT ·{' '}
              <a href="mailto:press@criterionmd.com" style={{ color: 'var(--accent)' }}>press@criterionmd.com</a>
            </div>
            <button onClick={() => go('press')} className="btn btn-outline">
              All press releases
            </button>
          </div>
        </div>
      </section>
    </div>);

}

// ─── CONTACT ─────────────────────────────────────────────────────────────────
// Each Contact Us dropdown section is its own focused page: a short audience-
// specific intro, a message form, and the ONE email address for that audience.
// No generic / catch-all contact info.
const CONTACT_AUDIENCES = {
  demos: {
    screen: '06 Contact · Demos & Pilots',
    eyebrow: 'Product Demos & Pilots',
    title: ['Book a demo, or scope a ', 'pilot.'],
    introShort: 'See the platform against your real payer mix and patient panel.',
    intro: "Walk through the platform against your real payer mix and patient panel. Best for physicians, practices, and health systems ready to see specifics.",
    email: 'pilots@criterionmd.com',
    emailNote: 'Goes straight to the founding team. We usually reply within one business day.',
    formTitle: 'Request a demo or pilot',
    formNote: 'Tell us about your practice and what you want to see.',
    orgLabel: 'Practice / organization',
    topics: ['Product demo', 'Pilot scoping', 'Onboarding question'],
    points: [
    'Demos are run by the founders, not a sales team',
    'Bring your real payer mix and we will map it live',
    'Pilots scoped cohort by cohort']

  },
  media: {
    screen: '06 Contact · Media',
    eyebrow: 'Media Inquiries',
    title: ['For press and ', 'editorial.'],
    introShort: 'Interviews, founder bios, logos, and product imagery. We respond quickly.',
    intro: 'Interviews, founder bios, logos, and product imagery. We respond to journalists and editors quickly.',
    email: 'press@criterionmd.com',
    emailNote: 'Monitored by the team for media requests. Include your outlet and deadline.',
    formTitle: 'Media inquiry',
    formNote: 'Tell us your outlet, angle, and any deadline.',
    orgLabel: 'Outlet / publication',
    topics: ['Interview request', 'Press kit / assets', 'Fact check', 'Other'],
    points: [
    'Founder interviews available on request',
    'Logos and product imagery in our press kit',
    'We work to your deadline where we can']

  },
  investors: {
    screen: '06 Contact · Investor Relations',
    eyebrow: 'Investor Relations',
    title: ['Investor ', 'relations.'],
    introShort: 'Not actively raising, but always glad to talk with aligned investors.',
    intro: 'We are not actively raising, but we are always glad to keep the conversation going with aligned investors.',
    email: 'investors@criterionmd.com',
    emailNote: 'Read by the CEO. A short note about your fund and thesis is the best start.',
    formTitle: 'Investor inquiry',
    formNote: 'A little about your fund and what draws you to the space.',
    orgLabel: 'Fund / firm',
    topics: ['Introduction', 'Updates & materials', 'Other'],
    points: [
    'Not actively raising today',
    'Happy to share periodic updates',
    'Physician-led, building deliberately']

  },
  development: {
    screen: '06 Contact · Product Development',
    eyebrow: 'Product Development',
    title: ['Build it ', 'with us.'],
    introShort: 'We build new products with practicing clinicians. Have a real problem? Tell us.',
    intro: "We are actively developing new products with practicing physicians, practices, and health systems. If you have a real problem you want solved, tell us.",
    email: 'develop@criterionmd.com',
    emailNote: 'We read every note and route it to the founder closest to the problem.',
    formTitle: 'Tell us what to build',
    formNote: 'Describe the workflow or problem you would like solved.',
    orgLabel: 'Practice / specialty',
    topics: ['Co-development idea', 'Feature request', 'Workflow problem', 'Other'],
    points: [
    'Co-develop directly with our team',
    'Shaped around real clinical workflows',
    'Physician feedback drives the roadmap']

  },
  careers: {
    screen: '06 Contact · Careers',
    eyebrow: 'Careers',
    title: ['Come ', 'build with us.'],
    introShort: 'A small, physician-led team building payer-aware solutions. Sound like you? Get in touch.',
    intro: 'We are a small, physician-led team building payer-aware solutions for physicians, by physicians. If that sounds like your kind of problem, get in touch.',
    email: 'careers@criterionmd.com',
    emailNote: 'Send a note and your resume or a link to your work. A real person reads it.',
    formTitle: 'Introduce yourself',
    formNote: 'Tell us what you would want to work on, and link your work.',
    orgLabel: 'Current role / company',
    topics: ['Engineering', 'Product / design', 'Clinical', 'Operations', 'General interest'],
    points: [
    'Small team, real ownership',
    'Physician-led, clinically grounded',
    'Remote-friendly, NYC roots']

  }
};

function ContactAudiencePage({ go, cfg }) {
  return (
    <div data-screen-label={cfg.screen}>
      <section style={{ paddingTop: 28, paddingBottom: 16 }}>
        <div className="cmd-container">
          <div style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto' }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>{cfg.eyebrow}</div>
            <h1 className="h-display" style={{
              fontSize: 'clamp(30px, 3.4vw, 48px)',
              lineHeight: 1.05, letterSpacing: '-0.025em',
              textWrap: 'balance', margin: 0
            }}>
              {cfg.title[0]}<span style={{ color: 'var(--accent)' }}>{cfg.title[1]}</span>
            </h1>
            <p className="ct-sub-d" style={{
              fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
            }}>
              {cfg.intro}
            </p>
            <p className="ct-sub-m" style={{ display: 'none' }}>
              {cfg.introShort || cfg.intro}
            </p>
          </div>
        </div>
      </section>

      <ContactFormSection cfg={cfg} />
      <div style={{ height: 24 }}></div>
    </div>);

}

// The form + audience-specific email/context block. Reused by the audience
// contact pages and by the Careers page (at the bottom).
function ContactFormSection({ cfg, heading, sub }) {
  const captchaReady = useTurnstileReady();
  const [busy, setBusy] = React.useState(false);
  const [error, setError] = React.useState(null);
  const [sent, setSent] = React.useState(false);
  return (
    <section className="section-divider" style={{ padding: '40px 0 24px' }}>
      <div className="cmd-container">
        {heading &&
        <div style={{ maxWidth: 1040, margin: '0 auto 24px' }}>
            <h2 className="h-2" style={{ margin: 0, fontSize: 'clamp(24px, 2.2vw, 34px)' }}>{heading}</h2>
            {sub && <p style={{ fontSize: 16, color: 'var(--ink-2)', marginTop: 10, marginBottom: 0, lineHeight: 1.55 }}>{sub}</p>}
          </div>
        }
        <div className="cols" style={{
          '--cols': '1.2fr 1fr', gap: 32,
          maxWidth: 1040, margin: '0 auto', alignItems: 'start'
        }}>
          {/* Form */}
          <form className="card contact-form-card" style={{ padding: 32 }} onSubmit={async (e) => {
            e.preventDefault();
            if (busy || sent) return;
            setBusy(true); setError(null);
            const r = await submitLead('contact', e.currentTarget);
            setBusy(false);
            if (r.ok) setSent(true); else { setError(r.error); resetTurnstileIn(e.currentTarget); }
          }}>
            <Honeypot />
            <input type="hidden" name="audience" value={cfg.email} />
            <h3 className="h-3" style={{ marginBottom: 4 }}>{cfg.formTitle}</h3>
            <p style={{ fontSize: 14, color: 'var(--ink-3)', margin: '0 0 20px' }}>
              {cfg.formNote}
            </p>
            <div className="grid-2" style={{ gap: 14 }}>
              <div><label className="label">Name</label><input className="input" name="name" autoComplete="name" required /></div>
              <div><label className="label">Email</label><input className="input" type="email" name="email" autoComplete="email" required /></div>
            </div>
            <div style={{ marginTop: 14 }}>
              <label className="label">{cfg.orgLabel}</label>
              <input className="input" name="organization" />
            </div>
            {cfg.topics &&
            <div style={{ marginTop: 14 }}>
                <label className="label">Topic</label>
                <select className="select" name="topic">
                  {cfg.topics.map((t) => <option key={t}>{t}</option>)}
                </select>
              </div>
            }
            <div style={{ marginTop: 14 }}>
              <label className="label">Message</label>
              <textarea className="textarea" name="message" rows={5} placeholder="A few sentences is plenty…" required />
            </div>
            {error && <FormFallback error={error} email={cfg.email} subject={cfg.formTitle || 'Message from criterionmd.com'} />}
            {sent ?
            <div style={{
              marginTop: 20, padding: '14px 16px', borderRadius: 10,
              background: 'var(--accent-tint)', border: '1px solid var(--accent-tint-2)',
              fontSize: 14, color: 'var(--accent-ink)',
              display: 'flex', gap: 10, alignItems: 'center'
            }}>
              <Check size={14} /> Message sent. A real person will get back to you.
            </div> :
            <button type="submit" disabled={busy || !captchaReady} className="btn btn-lg btn-primary btn-arrow" style={{ marginTop: 20, width: '100%', opacity: busy || !captchaReady ? 0.65 : 1 }}>
              {busy ? 'Sending…' : <React.Fragment>Send <ArrowRight /></React.Fragment>}
            </button>
            }
          </form>

          {/* Audience-specific email + context */}
          <div style={{ display: 'flex', flexDirection: 'column', gap: 20 }}>
            <div className="card card-pad" style={{
              background: 'var(--accent-tint)', borderColor: 'var(--accent-tint-2)'
            }}>
              <div className="mono" style={{
                fontSize: 11, letterSpacing: '.16em', color: 'var(--accent-ink)', opacity: 0.75
              }}>
                EMAIL US DIRECTLY
              </div>
              <a href={`mailto:${cfg.email}`} style={{
                display: 'inline-block', marginTop: 10,
                fontSize: 20, fontWeight: 500, color: 'var(--accent-ink)',
                letterSpacing: '-0.015em',
                borderBottom: '1px solid var(--accent-tint-2)', paddingBottom: 3,
                wordBreak: 'break-all'
              }}>
                {cfg.email}
              </a>
              <p style={{
                fontSize: 13.5, color: 'var(--accent-ink)', opacity: 0.85,
                marginTop: 12, marginBottom: 0, lineHeight: 1.55
              }}>
                {cfg.emailNote}
              </p>
            </div>
            <div className="card card-pad">
              <ul style={{
                listStyle: 'none', padding: 0, margin: 0,
                display: 'flex', flexDirection: 'column', gap: 12
              }}>
                {cfg.points.map((p, i) =>
                <li key={i} style={{
                  display: 'flex', gap: 10, alignItems: 'flex-start',
                  fontSize: 15, color: 'var(--ink-2)', lineHeight: 1.5
                }}>
                    <span style={{
                    flexShrink: 0, marginTop: 3,
                    width: 18, height: 18, borderRadius: 999,
                    background: 'var(--accent-tint)', color: 'var(--accent-ink)',
                    display: 'inline-flex', alignItems: 'center', justifyContent: 'center'
                  }}><Check size={10} /></span>
                    <span>{p}</span>
                  </li>
                )}
              </ul>
            </div>
          </div>
        </div>
      </div>
    </section>);

}

// Thin per-audience wrappers (one route each)
function DemosPage({ go }) {return <ContactAudiencePage go={go} cfg={CONTACT_AUDIENCES.demos} />;}
function MediaPage({ go }) {return <ContactAudiencePage go={go} cfg={CONTACT_AUDIENCES.media} />;}
function InvestorsPage({ go }) {return <ContactAudiencePage go={go} cfg={CONTACT_AUDIENCES.investors} />;}
function DevelopmentPage({ go }) {return <ContactAudiencePage go={go} cfg={CONTACT_AUDIENCES.development} />;}

// ─── CAREERS ─────────────────────────────────────────────────────────────────
// Open positions on top, then the same contact block at the bottom.
// Edit JOB_POSTINGS to add / change / remove roles.
const JOB_POSTINGS = [
{
  title: 'Software Engineer',
  type: 'Part-time',
  location: 'Remote-friendly',
  team: 'Engineering',
  blurb: "Build the core of a physician-led platform that sits between clinical documentation and payers. You'll work directly with the founders on real product, shipping into the hands of practicing physicians.",
  responsibilities: [
  'Design and build product features across the stack, from clinical-document ingestion to payer-policy logic',
  'Work hands-on with applied AI / LLM systems in a production setting',
  'Partner directly with the founding team and practicing physicians on what to build',
  'Own features end to end in a small, fast-moving team'],

  requirements: [
  'Minimum 5 years of professional software engineering experience',
  'Demonstrated, hands-on experience building with AI / ML / LLM systems',
  'Healthcare or health-tech experience strongly preferred',
  'Comfort with ambiguity and a bias toward shipping',
  'Care about clinical accuracy and patient trust'],

  comp: 'Compensation not disclosed; will be competitive and commensurate with experience.'
},
{
  title: 'In-House Counsel',
  type: 'Part-time',
  location: 'Remote-friendly',
  team: 'Legal & Compliance',
  blurb: "Help a physician-led healthcare-AI company build responsibly. You'll advise on the medical-legal and technology questions that shape both the product and the company.",
  responsibilities: [
  'Advise on medical-legal, regulatory, and compliance questions across the platform',
  'Guide privacy and data-handling practices (HIPAA and related frameworks)',
  'Review and structure commercial, partner, and vendor agreements',
  'Advise on the legal and ethical dimensions of healthcare AI',
  'Partner with the founders to keep compliance built in by design'],

  requirements: [
  'Minimum 5 years of relevant legal experience',
  'Working knowledge of medical-legal and healthcare regulatory matters',
  'Familiarity with AI / technology law and data privacy',
  'Licensed and in good standing',
  'Comfortable operating as a generalist in an early-stage company'],

  comp: 'Compensation not disclosed; will be competitive and commensurate with experience.'
}];


function JobPosting({ job }) {
  const [open, setOpen] = React.useState(false);
  return (
    <div className="card" style={{ padding: 0, overflow: 'hidden' }}>
      <button
        onClick={() => setOpen((o) => !o)}
        aria-expanded={open}
        className="job-head"
        style={{
          appearance: 'none', font: 'inherit', cursor: 'pointer', width: '100%',
          background: 'transparent', border: 0, textAlign: 'left',
          display: 'grid', gridTemplateColumns: '1fr auto', gap: 20,
          alignItems: 'center', padding: '24px 28px'
        }}>
        <div>
          <div style={{ fontSize: 20, fontWeight: 500, color: 'var(--ink)', letterSpacing: '-0.015em' }}>
            {job.title}
          </div>
          <div className="job-meta" style={{ display: 'flex', gap: 8, marginTop: 10, flexWrap: 'wrap' }}>
            {[job.team, job.type, job.location].map((m, i) =>
            <span key={i} className="job-meta-pill" style={{
              fontFamily: 'var(--font-mono)', fontSize: 11.5, letterSpacing: '.04em',
              padding: '4px 10px', borderRadius: 999,
              background: 'var(--bg)', color: 'var(--ink-2)', border: '1px solid var(--line)'
            }}>{m}</span>
            )}
          </div>
        </div>
        <span className="job-view" style={{
          display: 'inline-flex', alignItems: 'center', gap: 8,
          color: 'var(--accent)', fontSize: 14, fontWeight: 500, whiteSpace: 'nowrap'
        }}>
          {open ? 'Hide' : 'View role'}
          <svg width="12" height="12" viewBox="0 0 12 12" fill="none"
          style={{ transition: 'transform var(--spring-snap)', transform: open ? 'rotate(180deg)' : 'rotate(0deg)' }}>
            <path d="M3 4.5l3 3 3-3" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" />
          </svg>
        </span>
      </button>

      {open &&
      <div className="job-body" style={{
        padding: '4px 28px 28px',
        animation: 'psPaneIn .3s cubic-bezier(.2,.7,.2,1) both'
      }}>
          <div style={{ height: 1, background: 'var(--line)', marginBottom: 22 }} />
          <p style={{ fontSize: 15.5, color: 'var(--ink-2)', margin: '0 0 22px', lineHeight: 1.6, maxWidth: 76 + 'ch' }}>
            {job.blurb}
          </p>
          <div className="grid-2" style={{ gap: 32 }}>
            <div>
              <div className="eyebrow" style={{ marginBottom: 8 }}>What you'll do</div>
              <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 10 }}>
                {job.responsibilities.map((r, i) =>
              <li key={i} style={{ display: 'flex', gap: 10, alignItems: 'flex-start', fontSize: 15, color: 'var(--ink-2)', lineHeight: 1.5 }}>
                    <span style={{ flexShrink: 0, marginTop: 4, width: 16, height: 16, borderRadius: 999, background: 'var(--accent-tint)', color: 'var(--accent-ink)', display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }}><Check size={9} /></span>
                    <span>{r}</span>
                  </li>
              )}
              </ul>
            </div>
            <div>
              <div className="eyebrow" style={{ marginBottom: 8 }}>What we're looking for</div>
              <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 10 }}>
                {job.requirements.map((r, i) =>
              <li key={i} style={{ display: 'flex', gap: 10, alignItems: 'flex-start', fontSize: 15, color: 'var(--ink-2)', lineHeight: 1.5 }}>
                    <span style={{ flexShrink: 0, marginTop: 4, width: 16, height: 16, borderRadius: 999, background: 'var(--accent-tint)', color: 'var(--accent-ink)', display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }}><Check size={9} /></span>
                    <span>{r}</span>
                  </li>
              )}
              </ul>
            </div>
          </div>
          <div className="job-apply" style={{
          marginTop: 22, paddingTop: 18, borderTop: '1px solid var(--line)',
          display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: 20, flexWrap: 'wrap'
        }}>
            <div style={{ fontSize: 13.5, color: 'var(--ink-3)', lineHeight: 1.5, maxWidth: 64 + 'ch' }}>
              {job.comp}
            </div>
            <a className="btn btn-primary btn-arrow"
          href={`mailto:careers@criterionmd.com?subject=${encodeURIComponent('Application · ' + job.title)}`}>
              Apply for this role <ArrowRight />
            </a>
          </div>
        </div>
      }
    </div>);

}

function CareersPage({ go }) {
  const cfg = CONTACT_AUDIENCES.careers;
  return (
    <div data-screen-label="06 Contact · Careers">
      <section style={{ paddingTop: 28, paddingBottom: 16 }}>
        <div className="cmd-container">
          <div style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto' }}>
            <div className="eyebrow" style={{ marginBottom: 8 }}>{cfg.eyebrow}</div>
            <h1 className="h-display" style={{
              fontSize: 'clamp(30px, 3.4vw, 48px)',
              lineHeight: 1.05, letterSpacing: '-0.025em',
              textWrap: 'balance', margin: 0
            }}>
              {cfg.title[0]}<span style={{ color: 'var(--accent)' }}>{cfg.title[1]}</span>
            </h1>
            <p className="careers-sub-d" style={{
              fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
            }}>
              {cfg.intro}
            </p>
            <p className="careers-sub-m" style={{ display: 'none' }}>
              A small, physician-led team building payer-aware solutions. If that sounds like your kind of problem, get in touch.
            </p>
          </div>
        </div>
      </section>

      {/* Open positions */}
      <section className="section-divider band-warm" style={{ padding: '48px 0' }}>
        <div className="cmd-container">
          <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 24 }}>
            <span className="eyebrow" style={{ margin: 0 }}>Open positions</span>
            <span style={{ flex: 1, height: 1, background: 'var(--line)' }} />
            <span className="mono" style={{ fontSize: 12, color: 'var(--ink-3)', letterSpacing: '.06em' }}>
              {JOB_POSTINGS.length} OPEN
            </span>
          </div>
          <div style={{ display: 'flex', flexDirection: 'column', gap: 14, maxWidth: 960, margin: '0 auto' }}>
            {JOB_POSTINGS.map((job, i) => <JobPosting key={i} job={job} />)}
          </div>
        </div>
      </section>

      {/* Contact at the bottom */}
      <ContactFormSection
        cfg={cfg}
        heading="Don't see your role?"
        sub="We're a small team and always glad to meet sharp people. Send a note and tell us what you'd want to work on." />
      <div style={{ height: 24 }}></div>
    </div>);

}

// Contact hub — routes visitors to the right focused page. No generic catch-all.
const CONTACT_HUB_ITEMS = [
{ route: 'contact-demos', label: 'Product Demos & Pilots', sub: 'See the platform against your real payer mix.', email: 'pilots@criterionmd.com' },
{ route: 'contact-media', label: 'Media Inquiries', sub: 'Interviews, bios, logos, and product imagery.', email: 'press@criterionmd.com' },
{ route: 'contact-investors', label: 'Investor Relations', sub: 'Keep the conversation going.', email: 'investors@criterionmd.com' },
{ route: 'contact-development', label: 'Product Development', sub: 'Co-develop a workflow with our team.', email: 'develop@criterionmd.com' },
{ route: 'contact-careers', label: 'Careers', sub: 'Build with a physician-led team.', email: 'careers@criterionmd.com' }];


function ContactPage({ go }) {
  return (
    <div data-screen-label="06 Contact">
      <section style={{ paddingTop: 28, paddingBottom: 16 }}>
        <div className="cmd-container">
          <div style={{ textAlign: 'center', maxWidth: 1080, margin: '0 auto' }}>
            <h1 className="h-display" style={{
              fontSize: 'clamp(30px, 3.4vw, 48px)',
              lineHeight: 1.05, letterSpacing: '-0.025em',
              textWrap: 'balance', margin: 0
            }}>
              Let's find the{' '}
              <span style={{ color: 'var(--accent)' }}>right person.</span>
            </h1>
            <p style={{
              fontSize: 18, color: 'var(--ink-2)', lineHeight: 1.55,
              maxWidth: 84 + 'ch', margin: '12px auto 0', fontWeight: 400
            }}>
              Pick what you're reaching out about and you'll land with the person who can actually help.
            </p>
          </div>
        </div>
      </section>

      <section className="section-divider band-warm" style={{ padding: '48px 0' }}>
        <div className="cmd-container">
          <div style={{ display: 'flex', flexDirection: 'column', gap: 12, maxWidth: 880, margin: '0 auto' }}>
            {CONTACT_HUB_ITEMS.map((item) =>
            <button key={item.route}
            onClick={() => go(item.route)}
            className="card"
            style={{
              appearance: 'none', font: 'inherit', cursor: 'pointer', textAlign: 'left',
              display: 'grid', gridTemplateColumns: '1fr auto', gap: 20,
              alignItems: 'center', padding: '22px 26px', width: '100%'
            }}>
                <div>
                  <div style={{ fontSize: 20, fontWeight: 500, color: 'var(--ink)', letterSpacing: '-0.015em' }}>
                    {item.label}
                  </div>
                  <div style={{ fontSize: 14.5, color: 'var(--ink-2)', marginTop: 4, lineHeight: 1.5 }}>
                    {item.sub}
                  </div>
                  <div className="mono" style={{ fontSize: 12.5, color: 'var(--ink-3)', marginTop: 8, letterSpacing: '.02em' }}>
                    {item.email}
                  </div>
                </div>
                <span style={{ color: 'var(--accent)', display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 14, fontWeight: 500 }}>
                  Go <ArrowRight />
                </span>
              </button>
            )}
          </div>
        </div>
      </section>
      <div style={{ height: 24 }}></div>
    </div>);

}

function ContactCoDevelopmentCallout() {
  return (
    <div className="cols" style={{
      marginTop: 48, position: 'relative', overflow: 'hidden',
      borderRadius: 18, padding: '40px 44px',
      background: 'linear-gradient(155deg, var(--accent) 0%, var(--accent-ink) 100%)',
      color: '#fff',
      boxShadow: '0 1px 0 rgba(15,20,20,.04), 0 30px 80px -28px rgba(31,92,61,.45)',
      '--cols': '1.2fr 1fr', gap: 40, alignItems: 'center'
    }}>
      <div style={{
        position: 'absolute', inset: 0, opacity: 0.07,
        backgroundImage: 'linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px)',
        backgroundSize: '36px 36px', pointerEvents: 'none'
      }} />
      <div style={{ position: 'relative', zIndex: 1 }}>
        <div className="mono" style={{
          fontSize: 12, letterSpacing: '.18em', opacity: 0.8, marginBottom: 12
        }}>BUILD WITH US</div>
        <h2 className="h-2" style={{
          color: '#fff', textWrap: 'balance', margin: 0,
          fontSize: 'clamp(24px, 2.2vw, 34px)'
        }}>
          Have a workflow we should be{' '}
          <span style={{ color: 'var(--accent-tint-2)' }}>solving for?</span>
        </h2>
        <p style={{
          marginTop: 14, marginBottom: 0,
          fontSize: 16, lineHeight: 1.55,
          color: 'rgba(255,255,255,0.88)', maxWidth: 58 + 'ch'
        }}>
          We're actively developing new products with practicing physicians, practices,
          and health systems. If you're a doctor or a practice with a real problem you'd
          like to see solved, talk to us. We'll co-develop with you.
        </p>
      </div>
      <div style={{
        position: 'relative', zIndex: 1,
        background: 'rgba(255,255,255,0.08)',
        border: '1px solid rgba(255,255,255,0.2)',
        borderRadius: 14, padding: '22px 24px',
        backdropFilter: 'blur(6px)'
      }}>
        <div className="mono" style={{
          fontSize: 11, letterSpacing: '.16em',
          color: 'rgba(255,255,255,0.7)', marginBottom: 10
        }}>EMAIL THE DEVELOPMENT TEAM</div>
        <a href="mailto:develop@criterionmd.com"
        style={{
          color: '#fff', fontSize: 19, fontWeight: 500,
          letterSpacing: '-0.015em', display: 'inline-block',
          borderBottom: '1px solid rgba(255,255,255,0.4)',
          paddingBottom: 4, wordBreak: 'break-all'
        }}>
          develop@criterionmd.com
        </a>
        <p style={{
          marginTop: 14, marginBottom: 0,
          fontSize: 13.5, color: 'rgba(255,255,255,0.78)', lineHeight: 1.55
        }}>
          Tell us what you're stuck on. We read every note, and route it to the founder
          closest to the problem.
        </p>
      </div>
    </div>);

}

function ContactCard({ audience, email, body }) {
  return (
    <div className="card card-pad">
      <div className="eyebrow" style={{ marginBottom: 10 }}>{audience}</div>
      <div className="mono" style={{ fontSize: 17, color: 'var(--ink)', fontWeight: 500 }}>{email}</div>
      <p style={{ fontSize: 16, color: 'var(--ink-2)', marginTop: 14, marginBottom: 0, lineHeight: 1.55 }}>{body}</p>
    </div>);

}

Object.assign(window, { HomePage, SolutionsPage, InsurifyPage, AccessPage, AboutPage, PhysicianBoardPage, GeneralBoardPage, PressPage, PressArticlePage, ContactPage, DemosPage, MediaPage, InvestorsPage, DevelopmentPage, CareersPage, ProductMark, PRODUCT_COLORS, MICHIGAN_RELEASE, INSURIFY_LAUNCH_RELEASE });