// homepage.jsx — Every Man's Health, unified homepage.
// "The Practice" base (clinical-modern editorial, deep navy + warm cream,
// restrained gold) borrowing "Signal"'s lab/data fluency — biomarker
// dashboard, AI-context callout, longitudinal tracking — but framed as
// the *physician's view* during care, not a consumer optimization app.
//
// Responsive: a shared useViewport() tier hook (from shared.jsx) drives all
// breakpoint logic. Above 1024px every value equals the original desktop
// design. PX(vp) = horizontal section padding; SY(vp, n) = scaled vertical
// padding. Both collapse multi-column grids and stack the hero on mobile.

const PX = (vp) => vp.pad;                       // 72 / 40 / 24 / 20
const SY = (vp, n) => Math.round(n * (vp.isPhone ? 0.5 : vp.isMobile ? 0.6 : vp.isTablet ? 0.8 : 1));

function Homepage() {
  const [t, setTweak] = useTweaks(window.TWEAK_DEFAULTS);
  const vp = useViewport();
  const p = PALETTES[t.palette];
  const T = TYPES[t.typePair];
  const hero = HERO_COPY[t.heroCopy].a;
  const tc = toneCopy(t.tone);

  const S = {
    base: { background: p.cream, color: p.ink, fontFamily: T.body, fontSize: 15.5, lineHeight: 1.55, letterSpacing: '-0.005em' },
    display: { fontFamily: T.display, fontWeight: T.displayWeight, letterSpacing: T.displayTracking, color: p.ink },
    mono: { fontFamily: T.mono, letterSpacing: '0.14em', textTransform: 'uppercase' },
    container: { padding: `0 ${PX(vp)}px`, position: 'relative', maxWidth: 1440, margin: '0 auto' },
  };

  return (
    <div style={S.base}>
      <Nav p={p} T={T} S={S} tc={tc} vp={vp} />
      <Hero p={p} T={T} S={S} hero={hero} tc={tc} vp={vp} />
      <Intro p={p} T={T} S={S} vp={vp} />
      <TrustStrip p={p} T={T} S={S} vp={vp} />
      <Services p={p} T={T} S={S} vp={vp} />
      <Record p={p} T={T} S={S} vp={vp} />
      <HowItWorks p={p} T={T} S={S} tc={tc} vp={vp} />
      <LifeStages p={p} T={T} S={S} vp={vp} />
      <Physicians p={p} T={T} S={S} vp={vp} />
      <Principles p={p} T={T} S={S} vp={vp} />
      <CTABand p={p} T={T} S={S} tc={tc} vp={vp} />
      <Footer p={p} T={T} S={S} vp={vp} />

      <TweaksPanel title="Tweaks">
        <TweakSection label="Palette">
          <TweakColor label="Theme" value={t.palette}
            options={[
              ['#0E1E3A', '#F2EBDD', '#B8965B'],
              ['#0A1628', '#ECE6D9', '#3FB6C2'],
              ['#142244', '#EFE4D0', '#7A8F6E'],
            ]}
            onChange={(v) => {
              const map = { '["#0e1e3a","#f2ebdd","#b8965b"]': 'marine',
                            '["#0a1628","#ece6d9","#3fb6c2"]': 'graphite',
                            '["#142244","#efe4d0","#7a8f6e"]': 'atlantic' };
              setTweak('palette', map[JSON.stringify(v).toLowerCase()] || 'marine');
            }} />
        </TweakSection>
        <TweakSection label="Typography">
          <TweakRadio label="Pairing" value={t.typePair}
            options={[{ value: 'editorial', label: 'Editorial' },
                     { value: 'clinical',  label: 'Clinical' },
                     { value: 'technical', label: 'Technical' }]}
            onChange={(v) => setTweak('typePair', v)} />
        </TweakSection>
        <TweakSection label="Hero copy">
          <TweakSelect label="Variant" value={t.heroCopy}
            options={[{ value: 'optimize', label: 'Optimize the years you have' },
                     { value: 'practice', label: 'A modern practice for men' },
                     { value: 'numbers',  label: 'Every man should know his numbers' }]}
            onChange={(v) => setTweak('heroCopy', v)} />
        </TweakSection>
        <TweakSection label="Tone">
          <TweakSlider label="Clinical ↔ Consumer" value={t.tone}
            min={1} max={10} step={1}
            onChange={(v) => setTweak('tone', v)} />
        </TweakSection>
      </TweaksPanel>
    </div>
  );
}

// ── NAV ─────────────────────────────────────────────────────────────────
function Nav({ p, T, S, tc, vp }) {
  const [hover, setHover] = React.useState(null);
  const [open, setOpen] = React.useState(false);
  const items = [
    { label: 'The Practice', href: 'EMH_05_The_Practice.html' },
    { label: 'Care Model',   href: 'EMH_03_Care_Model.html' },
    { label: 'Membership',   href: 'EMH_04_Membership.html' },
    { label: 'Insights',     href: 'EMH_13_Insights.html' },
  ];
  const applyBtn = (label) => (
    <a href="EMH_06_Apply_For_Membership.html" style={{ fontFamily: T.body, fontSize: 13.5, fontWeight: 500, padding: '10px 18px', background: p.ink, color: p.cream, border: 'none', borderRadius: 2, cursor: 'pointer', whiteSpace: 'nowrap', textDecoration: 'none', display: 'inline-block' }}>{label}</a>
  );

  if (vp.isMobile) {
    // Compact disclosure toggle: logo · Menu ▾ · Apply. Links drop into a
    // stacked panel below the bar.
    return (
      <div style={{ position: 'sticky', top: 0, zIndex: 20, background: `${p.cream}f5`, backdropFilter: 'blur(10px)', borderBottom: `1px solid ${p.ink}1a` }}>
        <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: `14px ${PX(vp)}px`, gap: 14 }}>
          <a href="EMH_02_Florida_Concierge_Homepage_Current.html" style={{ display: 'flex', alignItems: 'center', gap: 10, textDecoration: 'none', color: 'inherit', minWidth: 0 }}>
            <EMHMark color={p.ink} size={24} />
            <div style={{ fontFamily: T.display, fontWeight: 500, fontSize: 15.5, letterSpacing: '-0.012em', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>Every Man's Health</div>
          </a>
          <div style={{ display: 'flex', alignItems: 'center', gap: 10, flexShrink: 0 }}>
            <button onClick={() => setOpen((o) => !o)} aria-expanded={open} aria-label="Menu"
              style={{ fontFamily: T.body, fontSize: 13, fontWeight: 500, padding: '9px 12px', background: 'transparent', color: p.ink, border: `1px solid ${p.ink}33`, borderRadius: 2, cursor: 'pointer', display: 'inline-flex', alignItems: 'center', gap: 6 }}>
              Menu
              <span style={{ display: 'inline-block', transform: open ? 'rotate(180deg)' : 'none', transition: 'transform .18s', fontSize: 9 }}>▾</span>
            </button>
            {!vp.isPhone && applyBtn('Apply for membership')}
          </div>
        </div>
        {open && (
          <div style={{ borderTop: `1px solid ${p.ink}14`, padding: `8px ${PX(vp)}px 16px`, display: 'flex', flexDirection: 'column' }}>
            {items.map(({ label, href }) => (
              <a key={label} href={href} onClick={() => setOpen(false)}
                 style={{ fontSize: 15, color: p.ink, textDecoration: 'none', padding: '13px 0', borderBottom: `1px solid ${p.ink}10` }}>
                {label}
              </a>
            ))}
            <a href="https://www.yourhealthfile.com/portal/login.jsp" target="_blank" rel="noopener noreferrer" style={{ fontSize: 15, color: p.inkSoft, textDecoration: 'none', padding: '13px 0' }}>Patient Portal</a>
            <div style={{ marginTop: 10 }}>{applyBtn('Apply for membership')}</div>
          </div>
        )}
      </div>
    );
  }

  return (
    <div style={{ position: 'sticky', top: 0, zIndex: 10, background: `${p.cream}f0`, backdropFilter: 'blur(10px)', borderBottom: `1px solid ${p.ink}1a` }}>
      <div style={{ ...S.container, display: 'flex', alignItems: 'center', padding: `20px ${PX(vp)}px`, gap: vp.isTablet ? 24 : 40 }}>
        <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}>
          <EMHMark color={p.ink} size={26} />
          <div style={{ fontFamily: T.display, fontWeight: 500, fontSize: 17, letterSpacing: '-0.012em', whiteSpace: 'nowrap' }}>Every Man's Health</div>
        </div>
        <div style={{ flex: 1, display: 'flex', justifyContent: 'center', gap: vp.isTablet ? 22 : 32 }}>
          {items.map(({ label, href }) => (
            <a key={label} href={href} onMouseEnter={() => setHover(label)} onMouseLeave={() => setHover(null)}
               style={{ fontSize: 13.5, color: hover === label ? p.ink : p.inkSoft, textDecoration: 'none', transition: 'color .12s', position: 'relative', padding: '4px 0', whiteSpace: 'nowrap' }}>
              {label}
              {hover === label && <span style={{ position: 'absolute', left: 0, right: 0, bottom: -2, height: 1, background: p.accent }} />}
            </a>
          ))}
        </div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 18 }}>
          {!vp.isTablet && <a href="https://www.yourhealthfile.com/portal/login.jsp" target="_blank" rel="noopener noreferrer" style={{ fontSize: 13.5, color: p.inkSoft, textDecoration: 'none', whiteSpace: 'nowrap' }}>Patient Portal</a>}
          {applyBtn('Apply for membership')}
        </div>
      </div>
    </div>
  );
}

// ── HERO ────────────────────────────────────────────────────────────────
function Hero({ p, T, S, hero, tc, vp }) {
  const h1Size = vp.isPhone ? 38 : vp.isMobile ? 48 : vp.isTablet ? 58 : 68;
  return (
    <section style={{ ...S.container, padding: `${SY(vp, 88)}px ${PX(vp)}px ${SY(vp, 112)}px`, borderBottom: `1px solid ${p.ink}14` }}>
      <div style={{ display: 'grid', gridTemplateColumns: vp.isMobile ? '1fr' : '1.05fr 1fr', gap: vp.isMobile ? 48 : 72, alignItems: 'start' }}>
        <div>
          <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: vp.isMobile ? 22 : 28, display: 'inline-flex', alignItems: 'center', gap: 10 }}>
            <span style={{ width: 5, height: 5, borderRadius: 3, background: p.accent }} />
            {tc.hookEyebrow}
          </div>
          <h1 style={{ ...S.display, fontSize: h1Size, lineHeight: 1.04, margin: 0, marginBottom: 30, textWrap: 'balance' }}>
            {hero.h[0]}<br />
            <span style={{ fontStyle: T.name === 'Editorial' ? 'italic' : 'normal', color: p.inkSoft }}>{hero.h[1]}</span>
          </h1>
          <p style={{ fontSize: vp.isPhone ? 16 : 18, lineHeight: 1.55, color: p.inkSoft, maxWidth: 540, margin: 0, marginBottom: 36 }}>{hero.sub}</p>
          <div style={{ display: 'flex', gap: 14, alignItems: 'stretch', marginBottom: 48, flexWrap: 'wrap', flexDirection: vp.isPhone ? 'column' : 'row' }}>
            <a href="EMH_06_Apply_For_Membership.html" style={{ fontFamily: T.body, fontSize: 14.5, fontWeight: 500, padding: '15px 26px', background: p.ink, color: p.cream, border: 'none', borderRadius: 2, cursor: 'pointer', textDecoration: 'none', display: 'inline-block', textAlign: 'center' }}>{tc.ctaPrimary} →</a>
            <button style={{ fontFamily: T.body, fontSize: 14.5, fontWeight: 500, padding: '15px 24px', background: 'transparent', color: p.ink, border: `1px solid ${p.ink}44`, borderRadius: 2, cursor: 'pointer' }}>{tc.ctaSecondary}</button>
          </div>
          <div style={{ display: 'grid', gridTemplateColumns: vp.isPhone ? '1fr 1fr' : 'repeat(3, auto)', gap: vp.isPhone ? 20 : 36, paddingTop: 26, borderTop: `1px solid ${p.ink}1f`, maxWidth: 540 }}>
            {[['Physician-led', 'In-person + telehealth'],
              ['Florida-based', 'Concierge practice, limited panel'],
              ['Lab-guided care', 'Coordinated through trusted partners']].map(([k, v]) => (
              <div key={k}>
                <div style={{ fontFamily: T.display, fontSize: 15, color: p.ink, marginBottom: 4, fontWeight: T.displayWeight }}>{k}</div>
                <div style={{ ...S.mono, fontSize: 9.5, color: p.muted }}>{v}</div>
              </div>
            ))}
          </div>
        </div>
        <HeroPortraitWithCard p={p} T={T} S={S} vp={vp} />
      </div>
    </section>
  );
}

function HeroPortraitWithCard({ p, T, S, vp }) {
  // Desktop: card floats off the lower-left of the portrait. Mobile: the
  // negative offsets would cause horizontal overflow, so the card sits in
  // normal flow beneath the portrait.
  const floating = !vp.isMobile;
  return (
    <div style={{ position: 'relative', marginBottom: floating ? 0 : 0 }}>
      <AbstractPanel label="LONGITUDINAL HEALTH RECORD" tag="physician's view" variant="record" w="100%" h={vp.isPhone ? 380 : vp.isMobile ? 460 : 580} tone={p.ink} cream={p.cream} accent={p.accent} mono={T.mono} dark />
      <div style={floating
        ? { position: 'absolute', bottom: -36, left: -40, width: 320, background: p.paper, border: `1px solid ${p.ink}22`, padding: '18px 20px 20px', boxShadow: `0 18px 48px ${p.ink}1a` }
        : { position: 'relative', width: '100%', background: p.paper, border: `1px solid ${p.ink}22`, padding: '18px 20px 20px', marginTop: 16, boxShadow: `0 18px 48px ${p.ink}1a`, boxSizing: 'border-box' }}>
        <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'baseline', marginBottom: 14 }}>
          <div style={{ ...S.mono, fontSize: 9.5, color: p.muted }}>FROM HIS PHYSICIAN'S RECORD</div>
          <div style={{ ...S.mono, fontSize: 9.5, color: p.accent }}>M·18</div>
        </div>
        <MiniSpark p={p} T={T} />
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 12, marginTop: 14 }}>
          {[['TT', '718', '+12%'], ['ApoB', '78', '−9%'], ['hs-CRP', '0.6', '−40%']].map(([k, v, d]) => (
            <div key={k} style={{ borderTop: `1px solid ${p.ink}18`, paddingTop: 8 }}>
              <div style={{ ...S.mono, fontSize: 8.5, color: p.muted, marginBottom: 3 }}>{k}</div>
              <div style={{ fontFamily: T.display, fontSize: 16, color: p.ink, fontWeight: T.displayWeight }}>{v}</div>
              <div style={{ ...S.mono, fontSize: 8.5, color: p.accent }}>{d}</div>
            </div>
          ))}
        </div>
      </div>
    </div>
  );
}

function MiniSpark({ p, T }) {
  const data = [380, 412, 447, 489, 523, 556, 612, 648, 671, 689, 702, 718];
  const W = 280, H = 56, pT = 4, pB = 6;
  const min = 350, max = 750;
  const xs = (i) => (i / (data.length - 1)) * W;
  const ys = (v) => pT + (1 - (v - min) / (max - min)) * (H - pT - pB);
  const path = data.map((v, i) => `${i === 0 ? 'M' : 'L'} ${xs(i).toFixed(1)} ${ys(v).toFixed(1)}`).join(' ');
  const last = data.length - 1;
  return (
    <div>
      <div style={{ display: 'flex', justifyContent: 'space-between', fontFamily: T.mono, fontSize: 9, letterSpacing: '0.14em', color: p.muted, textTransform: 'uppercase', marginBottom: 4 }}>
        <span>Total testosterone · 18mo trend</span><span>ng/dL</span>
      </div>
      <svg viewBox={`0 0 ${W} ${H}`} width="100%" height={H} style={{ display: 'block' }}>
        <path d={`${path} L ${W} ${H - pB} L 0 ${H - pB} Z`} fill={p.accent} fillOpacity="0.10" />
        <path d={path} fill="none" stroke={p.accent} strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round" />
        <circle cx={xs(last)} cy={ys(data[last])} r="3" fill={p.accent} />
      </svg>
    </div>
  );
}

// ── INTRO — what EMH is ─────────────────────────────────────────────────
function Intro({ p, T, S, vp }) {
  return (
    <section style={{ ...S.container, padding: `${SY(vp, 120)}px ${PX(vp)}px ${SY(vp, 96)}px`, borderBottom: `1px solid ${p.ink}14` }}>
      <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 36 }}>What we are</div>
      <div style={{ display: 'grid', gridTemplateColumns: vp.isMobile ? '1fr' : '1.4fr 1fr', gap: vp.isMobile ? 36 : 80 }}>
        <p style={{ ...S.display, fontSize: vp.isPhone ? 25 : vp.isMobile ? 30 : 36, lineHeight: 1.22, margin: 0, color: p.ink, fontWeight: T.displayWeight, letterSpacing: T.displayTracking, textWrap: 'pretty' }}>
          Every Man's Health is a regional Florida concierge practice for men — <em style={{ color: p.inkSoft, fontStyle: T.name === 'Editorial' ? 'italic' : 'normal' }}>physician-led, lab-guided, and data-informed</em> — built around an in-person physician relationship and the way a man's body actually changes from his thirties through the rest of his life.
        </p>
        <div>
          <p style={{ fontSize: 16, lineHeight: 1.65, color: p.inkSoft, margin: 0, marginBottom: 18 }}>
            Membership is by application and intentionally limited. Care begins with a comprehensive in-person evaluation at our Florida practice — physical exam, coordinated laboratory testing, and a long conversation with the physician who will know your file for years.
          </p>
          <p style={{ fontSize: 16, lineHeight: 1.65, color: p.inkSoft, margin: 0 }}>
            From there, ongoing care is delivered through scheduled in-person visits and telehealth follow-up between them — supported by longitudinal monitoring and AI-assisted organization of your laboratory and health data. Physician-guided, not medication-first. Your record belongs to you.
          </p>
        </div>
      </div>
    </section>
  );
}

// ── TRUST ──────────────────────────────────────────────────────────────
function TrustStrip({ p, T, S, vp }) {
  const items = [
    ['Physician-led', 'Plans authored and signed by your physician — not by a chatbot or a sales script.'],
    ['In-person + telehealth', 'Initial evaluation at our Florida practice. Ongoing care continues between visits.'],
    ['Coordinated labs', 'Routine blood and biomarker testing coordinated through trusted laboratory partners.'],
    ['Limited panel', 'Concierge membership by application. We commit to fewer members so we can know each one.'],
  ];
  const cols = vp.isPhone ? 1 : vp.isMobile ? 2 : 4;
  return (
    <section style={{ borderBottom: `1px solid ${p.ink}14`, background: p.paper }}>
      <div style={{ ...S.container, display: 'grid', gridTemplateColumns: `repeat(${cols}, 1fr)`, padding: `40px ${PX(vp)}px`, gap: vp.isMobile ? 24 : 40 }}>
        {items.map(([k, v], i) => {
          const atRowStart = i % cols === 0;
          return (
            <div key={k} style={{
              paddingLeft: atRowStart ? 0 : 28,
              borderLeft: atRowStart ? 'none' : `1px solid ${p.ink}1a`,
            }}>
              <div style={{ ...S.mono, fontSize: 10.5, color: p.accent, marginBottom: 8 }}>{String(i + 1).padStart(2, '0')} · {k.toUpperCase()}</div>
              <div style={{ fontSize: 13.5, color: p.inkSoft, lineHeight: 1.5 }}>{v}</div>
            </div>
          );
        })}
      </div>
    </section>
  );
}

// ── SERVICES ───────────────────────────────────────────────────────────
function Services({ p, T, S, vp }) {
  const cols = vp.isPhone ? 1 : vp.isMobile ? 2 : 3;
  return (
    <section style={{ ...S.container, padding: `${SY(vp, 128)}px ${PX(vp)}px`, borderBottom: `1px solid ${p.ink}14` }}>
      <div style={{ display: 'grid', gridTemplateColumns: vp.isMobile ? '1fr' : '320px 1fr', gap: vp.isMobile ? 28 : 80, marginBottom: vp.isMobile ? 40 : 60 }}>
        <div>
          <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 20 }}>Care · Six clinical domains</div>
          <h2 style={{ ...S.display, fontSize: vp.isPhone ? 32 : vp.isMobile ? 38 : 46, lineHeight: 1.04, margin: 0, textWrap: 'balance' }}>
            One practice. Every system that matters.
          </h2>
        </div>
        <p style={{ fontSize: 17, lineHeight: 1.6, color: p.inkSoft, margin: 0, marginTop: 8, maxWidth: 580 }}>
          We treat men's health as a connected whole. Hormones don't sit apart from cardiometabolic risk; sleep, mood, and cognition belong in the same conversation. Each domain is supported by the same physicians, the same record, the same data.
        </p>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: `repeat(${cols}, 1fr)`, borderTop: `1px solid ${p.ink}1a` }}>
        {SERVICES.map((s, i) => (
          <ServiceCard key={s.id} s={s} p={p} T={T} S={S} idx={i} cols={cols} total={SERVICES.length} />
        ))}
      </div>
    </section>
  );
}

function ServiceCard({ s, p, T, S, idx, cols, total }) {
  const [hover, setHover] = React.useState(false);
  const colInRow = idx % cols;
  const lastRowStart = total - (total % cols || cols);
  return (
    <div onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)}
         style={{ padding: '34px 30px 38px', borderRight: colInRow < cols - 1 ? `1px solid ${p.ink}1a` : 'none',
                  borderBottom: idx < lastRowStart ? `1px solid ${p.ink}1a` : 'none',
                  background: hover ? p.paper : 'transparent', transition: 'background .15s', cursor: 'pointer' }}>
      <div style={{ ...S.mono, fontSize: 10.5, color: p.accent, marginBottom: 16 }}>{s.label}</div>
      <h3 style={{ ...S.display, fontSize: 24, margin: 0, marginBottom: 12, lineHeight: 1.18 }}>{s.title}</h3>
      <p style={{ fontSize: 14.5, lineHeight: 1.55, color: p.inkSoft, margin: 0 }}>{s.body}</p>
      <div style={{ marginTop: 24, fontSize: 13, color: hover ? p.accent : p.muted, transition: 'color .15s', display: 'inline-flex', alignItems: 'center', gap: 6 }}>
        Read about this domain <span style={{ transform: hover ? 'translateX(3px)' : 'none', transition: 'transform .15s' }}>→</span>
      </div>
    </div>
  );
}

// ── THE RECORD — physician-view dashboard, AI context ──────────────────
function Record({ p, T, S, vp }) {
  return (
    <section style={{ ...S.container, padding: `${SY(vp, 128)}px ${PX(vp)}px`, borderBottom: `1px solid ${p.ink}14`, background: p.paper }}>
      <div style={{ display: 'grid', gridTemplateColumns: vp.isMobile ? '1fr' : '0.95fr 1.4fr', gap: vp.isMobile ? 40 : 80, alignItems: 'center' }}>
        <div>
          <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 20 }}>The longitudinal record</div>
          <h2 style={{ ...S.display, fontSize: vp.isPhone ? 30 : 42, lineHeight: 1.06, margin: 0, marginBottom: 22, textWrap: 'balance' }}>
            What your physician sees, you see too.
          </h2>
          <p style={{ fontSize: 16.5, lineHeight: 1.65, color: p.inkSoft, marginBottom: 20 }}>
            Every lab panel is read against the panel before it. Technology helps organize, trend, and contextualize your record — making patterns easier to notice. Your physician interprets what they mean. The same record is open in both windows during your visit; nothing is hidden behind a portal.
          </p>
          <p style={{ fontSize: 16.5, lineHeight: 1.65, color: p.inkSoft, marginBottom: 28 }}>
            Patterns emerge in months. Decisions become considered. Your record is yours, longitudinal, and exportable.
          </p>
          <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
            {[['60+', 'biomarkers tracked'],
              ['Coordinated', 'through trusted lab partners'],
              ['Quarterly', 'physician review cadence'],
              ['Yours', 'exportable, portable']].map(([k, v]) => (
              <div key={v} style={{ borderTop: `1px solid ${p.ink}22`, paddingTop: 12 }}>
                <div style={{ fontFamily: T.display, fontSize: 22, color: p.ink, marginBottom: 4, fontWeight: T.displayWeight }}>{k}</div>
                <div style={{ ...S.mono, fontSize: 10, color: p.muted }}>{v}</div>
              </div>
            ))}
          </div>
        </div>
        <PhysicianRecordPanel p={p} T={T} S={S} vp={vp} />
      </div>
    </section>
  );
}

function PhysicianRecordPanel({ p, T, S, vp }) {
  const [tick, setTick] = React.useState(0);
  const [hl, setHl] = React.useState(0);
  React.useEffect(() => {
    let raf, t0 = performance.now();
    const loop = (t) => { setTick((t - t0) / 1000); raf = requestAnimationFrame(loop); };
    raf = requestAnimationFrame(loop);
    const swap = setInterval(() => setHl((h) => (h + 1) % 4), 3200);
    return () => { cancelAnimationFrame(raf); clearInterval(swap); };
  }, []);

  const series = [
    { k: 'TT',    l: 'Total testosterone',  unit: 'ng/dL', val: 718, dlt: '+12%', color: p.accent,  base: [380,412,447,489,523,556,612,648,671,689,702,718] },
    { k: 'HOMA',  l: 'HOMA-IR',             unit: '',      val: 1.4, dlt: '−18%', color: p.signal,  base: [2.4,2.3,2.2,2.1,2.0,1.9,1.8,1.7,1.6,1.5,1.45,1.4] },
    { k: 'ApoB',  l: 'ApoB',                unit: 'mg/dL', val: 78,  dlt: '−9%',  color: '#9DA9C4', base: [98,96,94,92,90,88,86,84,82,80,79,78] },
    { k: 'hsCRP', l: 'hs-CRP',              unit: 'mg/L',  val: 0.6, dlt: '−40%', color: '#C8A765', base: [1.4,1.3,1.2,1.1,1.0,0.95,0.9,0.82,0.74,0.68,0.63,0.6] },
  ];
  const W = 720, H = 260, padL = 56, padR = 24, padT = 22, padB = 30;
  const innerW = W - padL - padR, innerH = H - padT - padB;
  const xs = (i, n) => padL + (i / (n - 1)) * innerW;
  const norm = (arr) => { const mn = Math.min(...arr), mx = Math.max(...arr), sp = mx - mn || 1; return arr.map((v) => (v - mn) / sp); };
  const months = ['M01', 'M03', 'M06', 'M09', 'M12', 'M15', 'M18'];
  const railCols = vp.isPhone ? 2 : 4;

  return (
    <div style={{ background: p.cream, border: `1px solid ${p.ink}22`, boxShadow: `0 30px 80px ${p.ink}14` }}>
      {/* header — clinical chrome, not consumer dashboard */}
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', padding: '14px 22px', borderBottom: `1px solid ${p.ink}1a`, gap: 12, flexWrap: 'wrap' }}>
        <div style={{ display: 'flex', alignItems: 'baseline', gap: 12, flexWrap: 'wrap' }}>
          <span style={{ fontFamily: T.display, fontSize: 15, color: p.ink, fontWeight: T.displayWeight }}>Patient record · Sample</span>
          <span style={{ ...S.mono, fontSize: 9.5, color: p.muted }}>LONGITUDINAL RECORD · LAB-GUIDED</span>
        </div>
        <span style={{ ...S.mono, fontSize: 9.5, color: p.muted, display: 'flex', alignItems: 'center', gap: 8 }}>
          <span style={{ width: 5, height: 5, borderRadius: 3, background: p.accent }} />
          Physician view
        </span>
      </div>

      {/* biomarker rail */}
      <div style={{ display: 'grid', gridTemplateColumns: `repeat(${railCols}, 1fr)` }}>
        {series.map((s, i) => {
          const colInRow = i % railCols;
          return (
          <button key={s.k} onClick={() => setHl(i)}
            style={{ background: hl === i ? `${p.ink}06` : 'transparent', border: 'none',
                     borderRight: colInRow < railCols - 1 ? `1px solid ${p.ink}14` : 'none',
                     borderBottom: `1px solid ${p.ink}1a`,
                     padding: '16px 18px', textAlign: 'left', color: 'inherit', cursor: 'pointer', transition: 'background .12s', fontFamily: 'inherit' }}>
            <div style={{ ...S.mono, fontSize: 9.5, color: s.color, marginBottom: 8 }}>{s.k}</div>
            <div style={{ fontFamily: T.display, fontSize: 22, color: p.ink, lineHeight: 1, marginBottom: 4, fontWeight: T.displayWeight }}>
              {s.val}<span style={{ fontSize: 10, fontFamily: T.mono, color: p.muted, marginLeft: 4 }}>{s.unit}</span>
            </div>
            <div style={{ display: 'flex', justifyContent: 'space-between', fontFamily: T.mono, fontSize: 9, letterSpacing: '0.1em' }}>
              <span style={{ color: p.muted }}>{s.l}</span>
              <span style={{ color: s.color }}>{s.dlt}</span>
            </div>
          </button>
        );})}
      </div>

      {/* chart */}
      <div style={{ padding: '16px 18px 12px' }}>
        <svg viewBox={`0 0 ${W} ${H}`} width="100%" height={H} style={{ display: 'block' }}>
          {[0, 0.25, 0.5, 0.75, 1].map((g) => (
            <line key={g} x1={padL} x2={W - padR} y1={padT + g * innerH} y2={padT + g * innerH}
                  stroke={p.muted} strokeOpacity={g === 1 ? 0.32 : 0.14} strokeDasharray={g === 1 ? '0' : '2 4'} />
          ))}
          {['HIGH', 'MID', 'LOW'].map((l, i) => (
            <text key={l} x={padL - 10} y={padT + (i * innerH) / 2 + 4} fontFamily={T.mono} fontSize="9" fill={p.muted} textAnchor="end" letterSpacing="0.14em">{l}</text>
          ))}
          {months.map((m, i) => (
            <text key={m} x={padL + (i / (months.length - 1)) * innerW} y={H - 10} fontFamily={T.mono} fontSize="9" fill={p.muted} textAnchor="middle" letterSpacing="0.14em">{m}</text>
          ))}
          {series.map((s, i) => {
            const n = norm(s.base);
            const ys = n.map((v) => padT + (1 - (i === 0 ? v : 1 - v)) * innerH);
            const path = ys.map((y, j) => `${j === 0 ? 'M' : 'L'} ${xs(j, n.length).toFixed(1)} ${y.toFixed(1)}`).join(' ');
            const active = hl === i;
            return (
              <g key={s.k} opacity={active ? 1 : 0.28}>
                <path d={path} fill="none" stroke={s.color} strokeWidth={active ? 2 : 1.2} strokeLinecap="round" strokeLinejoin="round" />
                {active && ys.map((y, j) => <circle key={j} cx={xs(j, n.length)} cy={y} r={j === ys.length - 1 ? 4 : 2} fill={s.color} />)}
                {active && (
                  <circle cx={xs(ys.length - 1, ys.length)} cy={ys[ys.length - 1]}
                          r={6 + (Math.sin(tick * 2.4) + 1) * 4} fill="none" stroke={s.color}
                          strokeOpacity={0.5 - (Math.sin(tick * 2.4) + 1) * 0.22} strokeWidth="1.2" />
                )}
              </g>
            );
          })}
        </svg>
      </div>

      {/* AI-context — clinical framing */}
      <div style={{ borderTop: `1px solid ${p.ink}1a`, padding: '14px 20px', display: 'grid', gridTemplateColumns: vp.isPhone ? '1fr' : '1fr auto', gap: vp.isPhone ? 14 : 24, alignItems: 'center', background: p.paper }}>
        <div style={{ display: 'flex', alignItems: 'flex-start', gap: 14 }}>
          <div style={{ marginTop: 2, fontFamily: T.mono, fontSize: 9, letterSpacing: '0.16em', padding: '3px 6px', border: `1px solid ${p.accent}66`, color: p.accent, flexShrink: 0 }}>AI-ASSISTED · CONTEXT</div>
          <p style={{ fontSize: 12.5, lineHeight: 1.55, color: p.inkSoft, margin: 0 }}>
            Organized for physician review — not a clinical recommendation. hs-CRP returning to a healthy range tracks alongside the metabolic improvements over the last nine months. Flagged for your physician at the next visit.
          </p>
        </div>
        <button style={{ fontFamily: T.mono, fontSize: 10, letterSpacing: '0.14em', textTransform: 'uppercase', padding: '8px 12px', background: 'transparent', color: p.ink, border: `1px solid ${p.ink}33`, borderRadius: 2, cursor: 'pointer', justifySelf: vp.isPhone ? 'start' : 'auto' }}>Open record →</button>
      </div>
    </div>
  );
}

// ── HOW IT WORKS — telehealth, lab, physician, plan ────────────────────
function HowItWorks({ p, T, S, tc, vp }) {
  const steps = [
    { n: '01', t: 'Application & membership consultation', body: 'Concierge membership is by application. A brief conversation about fit, goals, and what you want from a long-term physician relationship — followed by scheduling your in-person evaluation.', tag: 'By application' },
    { n: '02', t: 'In-person evaluation in Florida', body: 'A long first visit at our Florida practice — medical history, physical exam, the laboratory work needed to ground your plan, and a conversation with the physician who will know your file for years. No rushed twelve-minute appointments.', tag: 'In-person · Florida' },
    { n: '03', t: 'Coordinated labs & physician interpretation', body: 'Routine blood and biomarker testing is coordinated through trusted laboratory partners for your convenience. Longitudinal review — supported by AI-assisted organization of your data — helps surface patterns and outliers. Your physician interprets them with you, in person or by video.', tag: 'Lab-guided · Physician-interpreted' },
    { n: '04', t: 'Personalized plan & ongoing care', body: 'Lifestyle, monitoring cadence, and — where clinically appropriate — prescriptions or 503A compounded therapies. Telehealth follow-up between visits; scheduled in-person check-ins quarterly or annually as fits your plan.', tag: 'In-person + telehealth follow-up' },
  ];
  const cols = vp.isPhone ? 1 : vp.isMobile ? 2 : 4;
  return (
    <section style={{ ...S.container, padding: `${SY(vp, 128)}px ${PX(vp)}px`, borderBottom: `1px solid ${p.ink}14` }}>
      <div style={{ display: 'flex', alignItems: vp.isMobile ? 'flex-start' : 'baseline', justifyContent: 'space-between', marginBottom: vp.isMobile ? 40 : 60, gap: vp.isMobile ? 16 : 40, flexDirection: vp.isMobile ? 'column' : 'row' }}>
        <div>
          <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 20 }}>How the program works</div>
          <h2 style={{ ...S.display, fontSize: vp.isPhone ? 32 : vp.isMobile ? 38 : 46, lineHeight: 1.04, margin: 0, textWrap: 'balance' }}>An in-person beginning. A long relationship after.</h2>
        </div>
        <div style={{ ...S.mono, fontSize: 10.5, color: p.muted, alignSelf: vp.isMobile ? 'flex-start' : 'flex-end', flexShrink: 0 }}>Four steps · In-person + telehealth follow-up</div>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: `repeat(${cols}, 1fr)`, borderTop: `1px solid ${p.ink}22` }}>
        {steps.map((s, i) => {
          const colInRow = i % cols;
          return (
          <div key={s.n} style={{ padding: '32px 28px 36px', borderRight: colInRow < cols - 1 ? `1px solid ${p.ink}1a` : 'none', borderBottom: vp.isMobile ? `1px solid ${p.ink}14` : 'none' }}>
            <div style={{ ...S.mono, fontSize: 10.5, color: p.accent, marginBottom: 22 }}>{s.n}</div>
            <h3 style={{ ...S.display, fontSize: 21, margin: 0, marginBottom: 14, lineHeight: 1.2 }}>{s.t}</h3>
            <p style={{ fontSize: 14, lineHeight: 1.6, color: p.inkSoft, margin: 0, marginBottom: 18 }}>{s.body}</p>
            <div style={{ ...S.mono, fontSize: 9.5, color: p.muted, paddingTop: 12, borderTop: `1px solid ${p.ink}14` }}>{s.tag}</div>
          </div>
        );})}
      </div>
      <div style={{ marginTop: 36, display: 'flex', alignItems: vp.isMobile ? 'flex-start' : 'center', justifyContent: 'space-between', gap: 24, flexDirection: vp.isMobile ? 'column' : 'row' }}>
        <p style={{ fontSize: 14, color: p.muted, margin: 0, maxWidth: 640 }}>
          After the first cycle, the rhythm continues — recurring labs, scheduled physician visits in Florida, and telehealth check-ins between them. The record keeps getting sharper.
        </p>
        <a href="EMH_06_Apply_For_Membership.html" style={{ fontFamily: T.body, fontSize: 14, fontWeight: 500, padding: '13px 22px', background: p.ink, color: p.cream, border: 'none', borderRadius: 2, cursor: 'pointer', flexShrink: 0, textDecoration: 'none', display: 'inline-block' }}>{tc.ctaPrimary} →</a>
      </div>
    </section>
  );
}

// ── LIFE STAGES ────────────────────────────────────────────────────────
function LifeStages({ p, T, S, vp }) {
  return (
    <section style={{ ...S.container, padding: `${SY(vp, 128)}px ${PX(vp)}px`, borderBottom: `1px solid ${p.ink}14`, background: p.paper }}>
      <div style={{ display: 'grid', gridTemplateColumns: vp.isMobile ? '1fr' : '320px 1fr', gap: vp.isMobile ? 28 : 80, marginBottom: vp.isMobile ? 40 : 56 }}>
        <div>
          <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 20 }}>Personalization</div>
          <h2 style={{ ...S.display, fontSize: vp.isPhone ? 32 : 42, lineHeight: 1.06, margin: 0, textWrap: 'balance' }}>The plan changes as you do.</h2>
        </div>
        <p style={{ fontSize: 17, lineHeight: 1.6, color: p.inkSoft, marginTop: 8, maxWidth: 560 }}>
          A man at 34 and a man at 64 are answering different questions about the same body. We meet you where you are — and stay with you as the questions change.
        </p>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: vp.isMobile ? '1fr' : 'repeat(3, 1fr)', gap: vp.isMobile ? 16 : 28 }}>
        {LIFE_STAGES.map((s) => (
          <div key={s.range} style={{ background: p.cream, border: `1px solid ${p.ink}1f`, padding: '32px 28px 36px', position: 'relative' }}>
            <div style={{ ...S.mono, fontSize: 10, color: p.muted, marginBottom: 12 }}>AGE</div>
            <div style={{ fontFamily: T.display, fontSize: 46, color: p.ink, lineHeight: 1, marginBottom: 18, fontWeight: T.displayWeight, letterSpacing: T.displayTracking }}>{s.range}</div>
            <div style={{ ...S.mono, fontSize: 10.5, color: p.accent, marginBottom: 14 }}>{s.focus}</div>
            <p style={{ fontSize: 14, lineHeight: 1.6, color: p.inkSoft, margin: 0 }}>{s.body}</p>
          </div>
        ))}
      </div>
    </section>
  );
}

// ── PHYSICIANS / PRACTICE ──────────────────────────────────────────────
function Physicians({ p, T, S, vp }) {
  return (
    <section style={{ ...S.container, padding: `${SY(vp, 128)}px ${PX(vp)}px`, borderBottom: `1px solid ${p.ink}14` }}>
      <div style={{ display: 'grid', gridTemplateColumns: vp.isMobile ? '1fr' : '1fr 1.05fr', gap: vp.isMobile ? 40 : 80, alignItems: 'center' }}>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
          <AbstractPanel label="LONGITUDINAL RECORD" variant="record" w="100%" h={300} tone={p.ink} cream={p.cream} accent={p.accent} mono={T.mono} />
          <AbstractPanel label="BIOMARKER PATTERN" variant="signal" w="100%" h={300} tone={p.ink} cream={p.cream} accent={p.accent} mono={T.mono} />
          <AbstractPanel label="COORDINATED CARE" variant="grid" w="100%" h={220} tone={p.ink} cream={p.cream} accent={p.accent} mono={T.mono} />
          <AbstractPanel label="LABORATORY COORDINATION" variant="signal" w="100%" h={220} tone={p.ink} cream={p.cream} accent={p.accent} mono={T.mono} />
        </div>
        <div>
          <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 20, marginTop: vp.isMobile ? 8 : 0 }}>The care team</div>
          <h2 style={{ ...S.display, fontSize: vp.isPhone ? 32 : 42, lineHeight: 1.06, margin: 0, marginBottom: 22, textWrap: 'balance' }}>
            A physician relationship, made portable.
          </h2>
          <p style={{ fontSize: 16.5, lineHeight: 1.65, color: p.inkSoft, marginBottom: 18 }}>
            Concierge medicine, brought up to date. Your physician sees you in person at our Florida practice, knows your file by name, and is available between visits through scheduled telehealth follow-up — not a triage queue.
          </p>
          <p style={{ fontSize: 16.5, lineHeight: 1.65, color: p.inkSoft, marginBottom: 28 }}>
            Our panel is intentionally small. The physician who meets you at your first visit is the physician who knows you in year three. Nothing here is medication-first; the relationship comes before the prescription.
          </p>
          <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
            <button style={{ fontFamily: T.body, fontSize: 14, fontWeight: 500, padding: '13px 22px', background: p.ink, color: p.cream, border: 'none', borderRadius: 2, cursor: 'pointer' }}>Meet the care team</button>
            <button style={{ fontFamily: T.body, fontSize: 14, fontWeight: 500, padding: '13px 22px', background: 'transparent', color: p.ink, border: `1px solid ${p.ink}44`, borderRadius: 2, cursor: 'pointer' }}>Read our practice notes</button>
          </div>
        </div>
      </div>
    </section>
  );
}

// ── PRINCIPLES ─────────────────────────────────────────────────────────
function Principles({ p, T, S, vp }) {
  const cols = vp.isPhone ? 1 : 2;
  return (
    <section style={{ padding: `${SY(vp, 120)}px ${PX(vp)}px`, borderBottom: `1px solid ${p.ink}14`, background: p.ink, color: p.cream }}>
      <div style={{ maxWidth: 1440, margin: '0 auto' }}>
        <div style={{ display: 'grid', gridTemplateColumns: vp.isMobile ? '1fr' : '320px 1fr', gap: vp.isMobile ? 28 : 80, marginBottom: 48 }}>
          <div>
            <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 20 }}>Operating principles</div>
            <h2 style={{ fontFamily: T.display, fontWeight: T.displayWeight, letterSpacing: T.displayTracking, fontSize: vp.isPhone ? 30 : 38, lineHeight: 1.08, margin: 0, color: p.cream, textWrap: 'balance' }}>
              How we do business.
            </h2>
          </div>
          <p style={{ fontSize: 16.5, lineHeight: 1.6, opacity: 0.78, maxWidth: 580 }}>
            Direct-pay men's health attracts a particular kind of marketing. We hold ourselves to a different standard — rooted in the physician-patient relationship, not in conversion funnels.
          </p>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: `repeat(${cols}, 1fr)`, borderTop: `1px solid ${p.cream}22` }}>
          {PRINCIPLES.map(([k, v], i) => {
            const colInRow = i % cols;
            return (
            <div key={k} style={{ paddingTop: vp.isPhone ? 28 : 32, paddingRight: vp.isPhone ? 0 : 36, paddingBottom: vp.isPhone ? 28 : 36, paddingLeft: (!vp.isPhone && colInRow === 1) ? 36 : 0,
              borderRight: (!vp.isPhone && colInRow === 0) ? `1px solid ${p.cream}22` : 'none',
              borderBottom: i < PRINCIPLES.length - cols ? `1px solid ${p.cream}22` : 'none' }}>
              <div style={{ ...S.mono, fontSize: 10, color: p.accent, marginBottom: 12 }}>P / {String(i + 1).padStart(2, '0')}</div>
              <h3 style={{ fontFamily: T.display, fontSize: 22, margin: 0, marginBottom: 12, fontWeight: T.displayWeight }}>{k}</h3>
              <p style={{ fontSize: 14.5, lineHeight: 1.6, opacity: 0.82, margin: 0 }}>{v}</p>
            </div>
          );})}
        </div>
      </div>
    </section>
  );
}

// ── CTA ────────────────────────────────────────────────────────────────
function CTABand({ p, T, S, tc, vp }) {
  return (
    <section style={{ ...S.container, padding: `${SY(vp, 96)}px ${PX(vp)}px`, borderBottom: `1px solid ${p.ink}14` }}>
      <div style={{ display: 'flex', alignItems: vp.isMobile ? 'flex-start' : 'center', justifyContent: 'space-between', gap: vp.isMobile ? 28 : 48, flexDirection: vp.isMobile ? 'column' : 'row' }}>
        <div>
          <div style={{ ...S.mono, fontSize: 11, color: p.accent, marginBottom: 16 }}>Begin</div>
          <h2 style={{ ...S.display, fontSize: vp.isPhone ? 32 : 46, lineHeight: 1.04, margin: 0, textWrap: 'balance' }}>Begin with an in-person evaluation.</h2>
          <p style={{ fontSize: 17, color: p.inkSoft, marginTop: 14, marginBottom: 0, maxWidth: 600 }}>
            A long first visit at our Florida practice, laboratory work coordinated for you, and the start of a long-term physician relationship. Concierge membership is by application; our panel is intentionally limited.
          </p>
        </div>
        <div style={{ display: 'flex', gap: 12, flexShrink: 0, width: vp.isPhone ? '100%' : 'auto' }}>
          <a href="EMH_06_Apply_For_Membership.html" style={{ fontFamily: T.body, fontSize: 15, fontWeight: 500, padding: '16px 28px', background: p.ink, color: p.cream, border: 'none', borderRadius: 2, cursor: 'pointer', textDecoration: 'none', display: 'inline-block', textAlign: 'center', width: vp.isPhone ? '100%' : 'auto' }}>{tc.ctaPrimary} →</a>
        </div>
      </div>
    </section>
  );
}

// ── FOOTER ─────────────────────────────────────────────────────────────
function Footer({ p, T, S, vp }) {
  const cols = [
    ['Practice', ['Approach', 'Care team', 'Membership', 'Insights']],
    ['Care', ['Preventive', 'Hormone', 'Metabolic', 'Sexual', 'Cognitive', 'Longevity']],
    ['Resources', ['How it works', 'Membership', 'Lab partner', 'FAQ']],
    ['Company', ['About', 'Careers', 'Press', 'Contact']],
  ];
  const gridCols = vp.isPhone ? '1fr 1fr' : vp.isMobile ? 'repeat(3, 1fr)' : '1.4fr repeat(4, 1fr)';
  return (
    <footer style={{ background: p.cream, padding: `${SY(vp, 72)}px ${PX(vp)}px 36px`, maxWidth: 1440, margin: '0 auto' }}>
      <div style={{ display: 'grid', gridTemplateColumns: gridCols, gap: vp.isMobile ? 32 : 48, marginBottom: vp.isMobile ? 40 : 60 }}>
        <div style={{ gridColumn: vp.isMobile ? '1 / -1' : 'auto' }}>
          <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 18 }}>
            <EMHMark color={p.ink} size={26} />
            <span style={{ fontFamily: T.display, fontSize: 17, fontWeight: 500 }}>Every Man's Health</span>
          </div>
          <p style={{ fontSize: 13.5, lineHeight: 1.6, color: p.inkSoft, maxWidth: 280, margin: 0 }}>
            A Florida concierge men's health practice. Physician-led, lab-guided, data-informed — by application.
          </p>
          <div style={{ marginTop: 18, fontSize: 12.5, lineHeight: 1.7, color: p.inkSoft }}>
            9401 SW Highway 200, STE 502<br />Ocala, FL 34481-9650<br />
            <span style={{ color: p.muted }}>Tel</span> (352) 861-2115 &nbsp;·&nbsp; <span style={{ color: p.muted }}>Fax</span> (352) 854-5726<br />
            <span style={{ color: p.muted }}>Mon–Thu</span> 8:00 AM – 3:30 PM<br />
            <a href="mailto:membership@everymanshealth.com" style={{ color: 'inherit', textDecoration: 'none' }}>membership@everymanshealth.com</a>
          </div>
        </div>
        {cols.map(([title, items]) => (
          <div key={title}>
            <div style={{ ...S.mono, fontSize: 10, color: p.muted, marginBottom: 14 }}>{title}</div>
            <ul style={{ listStyle: 'none', padding: 0, margin: 0, display: 'flex', flexDirection: 'column', gap: 8 }}>
              {items.map((i) => <li key={i} style={{ fontSize: 13.5, color: p.inkSoft }}>{i}</li>)}
            </ul>
          </div>
        ))}
      </div>
      <div style={{ borderTop: `1px solid ${p.ink}1a`, paddingTop: 24, display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', gap: 32, flexDirection: vp.isMobile ? 'column' : 'row' }}>
        <p style={{ fontSize: 11.5, lineHeight: 1.55, color: p.muted, margin: 0, maxWidth: 760 }}>
          Information presented on this site is for educational purposes and does not constitute medical advice. Routine blood and biomarker testing is coordinated through trusted laboratory partners; specialized pathology and molecular diagnostic testing may be supported through affiliated CAP/CLIA laboratory infrastructure when clinically indicated. Technology, including AI-assisted organization of laboratory and health data, supports physician review; clinical interpretation and treatment decisions are made by licensed physicians on a case-by-case basis. Compounded medications, when used, are dispensed by 503A pharmacies in compliance with applicable regulations. Practice based in Florida; telehealth follow-up available where licensed.
        </p>
        <div style={{ ...S.mono, fontSize: 10, color: p.muted, textAlign: vp.isMobile ? 'left' : 'right' }}>
          © 2026 Every Man's Health. All rights reserved.<br /><a href="EMH_07_Privacy_Policy.html" style={{ color: 'inherit', textDecoration: 'none' }}>Privacy Policy</a> · <a href="EMH_08_Terms_Of_Use.html" style={{ color: 'inherit', textDecoration: 'none' }}>Terms of Use</a> · <a href="EMH_09_HIPAA_Notice.html" style={{ color: 'inherit', textDecoration: 'none' }}>HIPAA Notice</a><br /><a href="EMH_10_Accessibility_Statement.html" style={{ color: 'inherit', textDecoration: 'none' }}>Accessibility</a> · <a href="EMH_11_Website_Disclaimer.html" style={{ color: 'inherit', textDecoration: 'none' }}>Website Disclaimer</a> · <a href="EMH_12_Electronic_Communications.html" style={{ color: 'inherit', textDecoration: 'none' }}>Electronic Communications</a>
        </div>
      </div>
    </footer>
  );
}

// Wait for shared/tweaks globals before mounting.
function __mount() {
  if (window.PALETTES && window.TYPES && window.useTweaks && window.TweaksPanel && window.Placeholder && window.EMHMark && window.useViewport) {
    try {
      ReactDOM.createRoot(document.getElementById('root')).render(<Homepage />);
    } catch (e) {
      document.getElementById('root').innerHTML = '<pre style="padding:24px;color:#900;white-space:pre-wrap;font:12px ui-monospace">'+(e && e.stack || e)+'</pre>';
      throw e;
    }
  } else { setTimeout(__mount, 30); }
}
__mount();
