/* ============================================================
   OMNIO sections — exported to window for app.jsx to consume
   ============================================================ */
const { useState, useEffect, useRef, useMemo } = React;

/* ---------- COUNTDOWN ---------- */
// ADLM 2026 unveiling: July 28, 2026 at 2:00 PM Pacific (Anaheim)
const UNVEIL_TARGET = new Date("2026-07-28T14:00:00-07:00").getTime();

function useCountdown(target = UNVEIL_TARGET) {
  const [now, setNow] = useState(() => Date.now());
  useEffect(() => {
    const id = setInterval(() => setNow(Date.now()), 1000);
    return () => clearInterval(id);
  }, []);
  const diff = Math.max(0, target - now);
  const days = Math.floor(diff / 86400000);
  const hours = Math.floor(diff % 86400000 / 3600000);
  const minutes = Math.floor(diff % 3600000 / 60000);
  const seconds = Math.floor(diff % 60000 / 1000);
  return { days, hours, minutes, seconds, done: diff === 0 };
}

function CountdownUnits({ tone = "light" }) {
  const { days, hours, minutes, seconds, done } = useCountdown();
  const fg = tone === "light" ? "rgba(245,239,231,0.96)" : "var(--ink)";
  const labelFg = tone === "light" ? "rgba(245,239,231,0.55)" : "var(--ink-mute)";
  const sep = tone === "light" ? "rgba(245,239,231,0.25)" : "var(--line-strong)";
  if (done) {
    return (
      <div style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: 22, letterSpacing: "-0.01em", color: fg }}>
        Now unveiled.
      </div>);

  }
  const pad = (n) => String(n).padStart(2, "0");
  const units = [
  { v: days, l: "Days" },
  { v: pad(hours), l: "Hours" },
  { v: pad(minutes), l: "Min" },
  { v: pad(seconds), l: "Sec" }];

  return (
    <div style={{ display: "flex", alignItems: "flex-end", gap: 14 }}>
      {units.map((u, i) =>
      <React.Fragment key={u.l}>
          <div style={{ display: "flex", flexDirection: "column", alignItems: "flex-start", lineHeight: 1 }}>
            <div style={{ fontFamily: "var(--display)", fontWeight: 300, fontSize: "clamp(28px, 3.4vw, 44px)", letterSpacing: "-0.02em", color: fg, fontVariantNumeric: "tabular-nums" }}>
              {u.v}
            </div>
            <div style={{ fontFamily: "var(--mono)", fontWeight: 200, fontSize: 10, letterSpacing: "0.22em", textTransform: "uppercase", color: labelFg, marginTop: 8 }}>
              {u.l}
            </div>
          </div>
          {i < units.length - 1 &&
        <div style={{ fontFamily: "var(--display)", fontWeight: 200, fontSize: "clamp(24px, 3vw, 36px)", color: sep, transform: "translateY(-8px)" }}>:</div>
        }
        </React.Fragment>
      )}
    </div>);

}

/* ---------- shared ---------- */
function Logo({ height = 22, color = "#30354b", dot = "#e921b2" }) {
  return (
    <svg viewBox="0 0 124.18 31.91" style={{ height, width: "auto", display: "block" }} aria-label="Omnio">
      <circle cx="4.25" cy="13.15" r="1.98" fill={dot} />
      <path fill={color} d="M58.46,31.32h-.87c-.81,0-1.47-.66-1.47-1.47v-13.47c0-3.01-1.97-5.25-5.02-5.25s-5.03,2.24-5.03,5.25v13.47c0,.81-.66,1.47-1.47,1.47h-.87c-.81,0-1.47-.66-1.47-1.47v-13.47c0-3.01-1.97-5.25-5.03-5.25s-5.02,2.24-5.02,5.25v13.47c0,.81-.66,1.47-1.47,1.47h-.87c-.81,0-1.47-.66-1.47-1.47v-13.33c0-5.03,3.63-8.88,8.84-8.88,3.14,0,5.56,1.48,6.91,3.81,1.39-2.33,3.81-3.81,6.96-3.81,5.25,0,8.84,3.86,8.84,8.88v13.33c0,.81-.66,1.47-1.47,1.47" />
      <path fill={color} d="M93.88,31.32h-.87c-.81,0-1.47-.66-1.47-1.47V9.68c0-.81.66-1.47,1.47-1.47h.87c.81,0,1.47.66,1.47,1.47v20.16c0,.81-.66,1.47-1.47,1.47" />
      <circle cx="93.44" cy="2.36" r="2.36" fill={color} />
      <circle cx="119.94" cy="26.38" r="1.98" fill={color} />
      <path fill={color} d="M86.3,17.95c.05-5.71-5.12-10.44-10.75-10.32-5.62-.12-10.79,4.61-10.74,10.32v12.01c0,.75.61,1.36,1.37,1.36h1.03c.75,0,1.37-.61,1.37-1.36v-12.01c-.1-3.7,3.33-6.74,6.98-6.67,3.65-.06,7.07,2.98,6.97,6.67v12.01c0,.75.61,1.36,1.37,1.36h1.04c.75,0,1.37-.61,1.37-1.36v-12.01Z" />
      <path fill={color} d="M124.18,19.77c0-6.71-5.44-12.15-12.15-12.15s-12.14,5.44-12.14,12.15,5.44,12.15,12.14,12.15c1.27,0,2.49-.2,3.64-.56.73-.23,1.26-.91,1.26-1.71,0-.99-.8-1.79-1.79-1.79-.29,0-.54.08-.54.08-.81.27-1.67.42-2.57.42-4.6,0-8.33-3.84-8.33-8.58s3.73-8.58,8.33-8.58,8.33,3.84,8.33,8.58c0,.34-.02.67-.06,1,0,0,0,.15,0,.22,0,1.05.85,1.91,1.91,1.91.97,0,1.77-.73,1.89-1.67.06-.48.09-.96.09-1.45" />
      <path fill={color} d="M0,19.77c0,6.71,5.44,12.15,12.15,12.15s12.15-5.44,12.15-12.15-5.44-12.15-12.15-12.15c-1.27,0-2.49.2-3.64.56-.73.23-1.26.91-1.26,1.71,0,.99.8,1.79,1.79,1.79.29,0,.54-.08.54-.08.81-.27,1.67-.42,2.57-.42,4.6,0,8.33,3.84,8.33,8.58s-3.73,8.58-8.33,8.58-8.33-3.84-8.33-8.58c0-.34.02-.67.06-1,0,0,0-.15,0-.22,0-1.05-.85-1.91-1.91-1.91-.97,0-1.77.73-1.89,1.67-.06.48-.09.96-.09,1.45" />
    </svg>);

}

/* The Omnio "O" — broken ring + offset dot. Rotatable. Symmetric standalone version. */
function OmnioO({ size = 200, rotation = 0, color = "#30354b", dot = "#e921b2", thick = false, glow = false }) {
  return (
    <svg viewBox="0 0 976.66 976.66" style={{ width: size, height: size, display: "block", overflow: "visible" }}>
      <g style={{ transformOrigin: "488.33px 488.33px", transform: `rotate(${rotation}deg)`, transition: "transform 1.2s cubic-bezier(.7,.05,.2,1)" }}>
        {glow && <circle cx="171.49" cy="223.26" r="130" fill={dot} opacity="0.35" style={{ filter: "blur(28px)" }} />}
        <circle cx="171.49" cy="223.26" r="75.45" fill={dot} />
        <path fill={color} d="M488.33,976.66c-65.89,0-129.85-12.92-190.1-38.41-58.16-24.6-110.38-59.8-155.2-104.62-44.82-44.82-80.02-97.04-104.62-155.2C12.92,618.18,0,554.22,0,488.33c0-20.2,1.25-40.54,3.71-60.47,4.64-37.51,36.6-65.8,74.34-65.8,3.09,0,6.22.19,9.3.58,19.88,2.46,37.62,12.51,49.93,28.31,12.32,15.8,17.75,35.45,15.29,55.33-1.71,13.84-2.58,27.99-2.58,42.06,0,90.37,35.19,175.33,99.1,239.24s148.87,99.09,239.24,99.09,175.33-35.19,239.24-99.09,99.09-148.87,99.09-239.24-35.19-175.33-99.09-239.24c-63.9-63.9-148.87-99.1-239.24-99.1-34.35,0-68.21,5.11-100.64,15.2-7.26,2.26-14.76,3.4-22.3,3.4-33.01,0-61.78-21.19-71.59-52.74-12.28-39.49,9.85-81.61,49.34-93.89C390.01,7.39,438.86,0,488.33,0c65.89,0,129.85,12.92,190.1,38.41,58.16,24.6,110.38,59.8,155.2,104.62,44.82,44.82,80.02,97.04,104.62,155.2,25.48,60.25,38.41,124.21,38.41,190.1s-12.92,129.85-38.41,190.1c-24.6,58.16-59.8,110.38-104.62,155.2-44.82,44.82-97.04,80.02-155.2,104.62-60.25,25.48-124.21,38.41-190.1,38.41Z" />
      </g>
    </svg>);

}

/* ---------- NAV ---------- */
function Nav() {
  // If we're not on the home page, anchor links must route back to index.html#anchor
  const path = typeof window !== "undefined" ? window.location.pathname : "/";
  const isHome = /(^\/$)|(\/index\.html$)/.test(path) || path === "" || path === "/";
  const home = (hash) => isHome ? hash : "index.html" + hash;

  return (
    <nav className="nav">
      <div className="container nav-inner">
        <a href={home("#top")} style={{ display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 4 }}>
          <Logo height={34} />
          <span style={{ fontFamily: "var(--mono)", fontSize: 10, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--ink)", opacity: 0.6 }}>by Cubit Diagnostics</span>
        </a>
        <div className="nav-links">
          <a href={home("#platform")}>Platform</a>
          <a href={home("#applications")}>Applications</a>
          <a href={home("#team")}>Team</a>
          <a href="blog.html">Blog</a>
          <a href="contact.html">Contact</a>
        </div>
        <a className="nav-cta" href="contact.html">
          Get in touch
          <span style={{ fontSize: 14 }}>→</span>
        </a>
      </div>
    </nav>);

}

/* ---------- HERO ---------- */
function Hero({ variant = "A" }) {
  return (
    <section className="section dense" id="top" style={{ paddingTop: 80, paddingBottom: 40 }}>
      <div className="container">
        <div style={{ display: "flex", alignItems: "center", gap: 12, marginBottom: 36 }}>
          <span className="eyebrow">CUBIT DIAGNOSTICS PLATFORM</span>
        </div>

        {variant === "A" &&
        <>
            <h1 className="display-xl" style={{ maxWidth: "14ch" }}>
              One Platform.<br />
              Two Modalities.<br />
              <span style={{ position: "relative", display: "inline-block" }}>
                Expanding Reach<span style={{ color: "rgb(48, 53, 75)" }}>.</span>
              </span>
            </h1>
          </>
        }

        {variant === "B" &&
        <>
            <h1 className="display-xl" style={{ maxWidth: "14ch" }}>
              A multimodal <br />
              <span style={{ color: "var(--magenta)" }}>diagnostic</span> platform.
            </h1>
            <p className="lede" style={{ marginTop: 40, maxWidth: "50ch" }}>
              One Platform. Two Modalities. Expanding Reach. Cubit is developing a next-generation,
              point-of-care platform capable of both molecular and immunoassay-based testing on a single system.
            </p>
          </>
        }
      </div>

      {/* reveal image */}
      <div style={{ marginTop: 80, position: "relative" }}>
        <div style={{ aspectRatio: "16/9", width: "100%", maxHeight: 720, overflow: "hidden", background: "#000", position: "relative" }}>
          <video
            src="assets/omnio-led-ring.mp4"
            poster="assets/reveal-main.jpg"
            autoPlay
            loop
            muted
            playsInline
            aria-label="Omnio platform — LED ring"
            style={{ width: "100%", height: "100%", objectFit: "cover", objectPosition: "center" }} />
          <div style={{ position: "absolute", inset: 0, background: "linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 65%)" }} />
          <div style={{ position: "absolute", left: 0, right: 0, top: 40, display: "flex", justifyContent: "center", padding: "0 24px" }}>
            <div style={{ color: "rgba(245,239,231,0.95)", fontFamily: "var(--mono)", fontSize: 12, letterSpacing: "0.22em", textTransform: "uppercase", textAlign: "center", lineHeight: 1.7 }}>
              <div style={{ fontWeight: 500 }}>CUBIT PLATFORM PREVIEW</div>
              <div style={{ fontWeight: 200, opacity: 0.85 }}>ADLM 2026 &middot; Anaheim, CA</div>
            </div>
          </div>
        </div>
      </div>
    </section>);

}

/* ---------- MISSION BAND ---------- */
function Mission() {
  return (
    <section className="section tight" id="mission" style={{ borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)", background: "var(--cream)" }}>
      <div className="container">
        <div style={{ display: "grid", gridTemplateColumns: "minmax(160px, 220px) 1fr", gap: 56, alignItems: "start" }} className="mission-grid">
          <div style={{ display: "flex", flexDirection: "column", gap: 14 }}>
            <span className="eyebrow">Mission</span>
          </div>
          <div>
            <p style={{ fontFamily: "var(--display)", fontWeight: 600, fontSize: "clamp(26px, 3vw, 44px)", lineHeight: 1.15, letterSpacing: "-0.02em", color: "var(--ink)", margin: 0, maxWidth: "26ch" }}>
              To enable healthcare providers to screen, diagnose, and treat their patients
              <span style={{ color: "var(--magenta)" }}> in a single visit</span>.
            </p>
          </div>
        </div>
        <style>{`@media (max-width: 760px) { .mission-grid { grid-template-columns: 1fr !important; gap: 28px !important; } }`}</style>
      </div>
    </section>);

}

/* ---------- FULL-BLEED IMAGE BAND ---------- */
function ImageBand({ src, alt, caption, eyebrow, height = "62vh", maxHeight = 760, minHeight = 420, align = "left", dark = true }) {
  const sectionRef = useRef(null);
  const imgRef = useRef(null);
  useEffect(() => {
    if (window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
    let raf = 0;
    const update = () => {
      raf = 0;
      const sec = sectionRef.current, img = imgRef.current;
      if (!sec || !img) return;
      const r = sec.getBoundingClientRect();
      const vh = window.innerHeight || document.documentElement.clientHeight;
      if (r.bottom < 0 || r.top > vh) return;
      const center = r.top + r.height / 2;
      const prog = (center - vh / 2) / (vh / 2 + r.height / 2); // ~ -1..1
      const shift = Math.max(-1, Math.min(1, prog)) * -6; // percent
      img.style.transform = "translateY(" + shift.toFixed(2) + "%) scale(1.12)";
    };
    const onScroll = () => { if (!raf) raf = requestAnimationFrame(update); };
    update();
    window.addEventListener("scroll", onScroll, { passive: true });
    window.addEventListener("resize", onScroll);
    return () => {
      window.removeEventListener("scroll", onScroll);
      window.removeEventListener("resize", onScroll);
      if (raf) cancelAnimationFrame(raf);
    };
  }, []);
  return (
    <section ref={sectionRef} style={{ position: "relative", width: "100%", height, maxHeight, minHeight, overflow: "hidden", background: "#000" }}>
      <img ref={imgRef} src={src} alt={alt} style={{ width: "100%", height: "100%", objectFit: "cover", objectPosition: "center", transform: "scale(1.12)", willChange: "transform" }} />
      {(caption || eyebrow) &&
      <div style={{ position: "absolute", inset: 0, background: dark ? "linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 100%)" : "none", display: "flex", alignItems: "flex-end", padding: "var(--gutter)" }}>
          <div style={{ maxWidth: 720, color: "rgba(245,239,231,0.95)", display: "flex", flexDirection: "column", gap: 12, textAlign: align }}>
            {eyebrow &&
          <div style={{ fontFamily: "var(--mono)", fontSize: 14, letterSpacing: "0.18em", textTransform: "uppercase", color: "rgba(245,239,231,0.75)", display: "flex", alignItems: "center", gap: 10, justifyContent: align === "center" ? "center" : "flex-start" }}>
                <span style={{ width: 6, height: 6, borderRadius: "50%", background: "var(--eyebrow-dot, var(--magenta))" }} />
                {eyebrow}
              </div>
          }
            {caption &&
          <p style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: "clamp(22px, 2.6vw, 38px)", lineHeight: 1.1, letterSpacing: "-0.02em", margin: 0, maxWidth: "22ch" }}>
                {caption}
              </p>
          }
          </div>
        </div>
      }
    </section>);

}

/* ---------- BY THE NUMBERS ---------- */
function Numbers() {
  const stats = [
  { metric: "100+", unit: "yrs combined experience", note: "Leadership across diagnostics & healthcare" },
  { metric: "Minimal", unit: "hands-on time", note: "Simplified user workflow" },
  { metric: "8", unit: "targets per test", note: "Multiplexing capability" },
  { metric: "15–20", unit: "min molecular TAT", note: "Targeted turnaround" },
  { metric: "2", unit: "modalities, one platform", note: "Molecular + immunoassay" }];

  return (
    <section className="section tight" id="numbers" style={{ background: "var(--cream-2)", borderBottom: "1px solid var(--line)" }}>
      <div className="container">
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 40, gap: 24, flexWrap: "wrap" }}>
          <span className="eyebrow teal">By the Numbers</span>
          <span style={{ fontFamily: "var(--mono)", fontSize: 13, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--ink-mute)" }}>
            Platform · in development
          </span>
        </div>
        <div style={{ display: "grid", gridTemplateColumns: "repeat(5, 1fr)", gap: 1, background: "var(--line)", border: "1px solid var(--line)" }} className="numbers-grid">
          {stats.map((s, i) =>
          <div key={i} style={{ background: "var(--cream)", padding: "32px 24px 28px", minHeight: 200, display: "flex", flexDirection: "column", justifyContent: "space-between", gap: 18 }}>
              <div style={{ fontFamily: "var(--mono)", fontSize: 13, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--ink-mute)" }}>
                0{i + 1}
              </div>
              <div>
                <div style={{ fontFamily: "var(--display)", fontWeight: 800, fontSize: "clamp(36px, 3.4vw, 56px)", lineHeight: 0.9, letterSpacing: "-0.035em", color: i === 1 ? "var(--magenta)" : i === 3 ? "var(--teal-deep)" : "var(--ink)", marginBottom: 10 }}>
                  {s.metric}
                </div>
                <div style={{ fontFamily: "var(--display)", fontWeight: 600, fontSize: 14, color: "var(--ink)", lineHeight: 1.25, marginBottom: 8, letterSpacing: "-0.005em" }}>
                  {s.unit}
                </div>
                <div style={{ fontSize: 12.5, color: "var(--ink-soft)", lineHeight: 1.45 }}>
                  {s.note}
                </div>
              </div>
            </div>
          )}
        </div>
        <style>{`
          @media (max-width: 1000px) { .numbers-grid { grid-template-columns: repeat(2, 1fr) !important; } }
          @media (max-width: 560px) { .numbers-grid { grid-template-columns: 1fr !important; } }
        `}</style>
      </div>
    </section>);

}

/* ---------- PILLARS (3-up) ---------- */
function Pillars() {
  const pillars = [
  {
    kicker: "01",
    category: "Multimodal Testing",
    lead: "Molecular + Immunoassay Testing on One Platform.",
    body: "A multimodal, multiplexing foundation built to support broad future applications across care settings.",
    bg: "var(--cream-2)",
    fg: "var(--ink)",
    accent: "var(--teal)",
    accentSoft: "var(--teal-deep)"
  },
  {
    kicker: "02",
    category: "Reliable High Performance",
    lead: "Reliable High Performance.",
    body: "Engineered for high analytical performance using proprietary extraction technologies.",
    bg: "var(--ink-2)",
    fg: "var(--cream)",
    accent: "var(--teal)",
    accentSoft: "var(--teal)"
  },
  {
    kicker: "03",
    category: "Broad Clinical Applications",
    lead: "Simplified  Workflow.",
    body: "One consistent workflow, a few simple steps, and no specialized training — designed for efficiency at the point of care.",
    bg: "var(--cream-2)",
    fg: "var(--ink)",
    accent: "var(--teal)",
    accentSoft: "var(--teal-deep)"
  }];


  return (
    <section className="section" id="pillars">
      <div className="container">
        <div style={{ marginBottom: 56 }}>
          <span className="eyebrow" style={{ fontFamily: "\"Plus Jakarta Sans\"", fontWeight: "100" }}>Why Omnio</span>
          <h2 className="display-lg" style={{ marginTop: 18, maxWidth: "20ch" }}>
            Designed to expand near&#8209;patient testing through streamlined workflow.
          </h2>
        </div>

        <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 1, background: "var(--line)" }} className="pillars-grid">
          {pillars.map((p, i) => {
            const subdued = p.fg === "var(--cream)" ? "rgba(245,239,231,0.55)" : "var(--ink-mute)";
            const body = p.fg === "var(--cream)" ? "rgba(245,239,231,0.7)" : "var(--ink-soft)";
            const leadCore = p.lead.replace(/\.$/, "");
            return (
              <div key={i} style={{ background: p.bg, color: p.fg, padding: "44px 36px", minHeight: 460, display: "flex", flexDirection: "column", position: "relative" }}>
                <div style={{ display: "flex", alignItems: "center", gap: 10, fontFamily: "var(--mono)", fontSize: 14, letterSpacing: "0.14em", color: subdued }}>
                  <span style={{ width: 6, height: 6, borderRadius: "50%", background: p.accent }} />
                  {p.kicker}
                </div>
                <div style={{ marginTop: 60, display: "flex", flexDirection: "column", gap: 18 }}>
                  <h3 style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: "clamp(28px, 2.4vw, 34px)", lineHeight: 1.1, letterSpacing: "-0.02em", margin: 0, color: p.fg, minHeight: "2.2em", display: "flex", alignItems: "flex-end" }}>
                    <span>{leadCore}<span style={{ color: p.accent }}>.</span></span>
                  </h3>
                  <p style={{ fontSize: 15.5, lineHeight: 1.55, color: body, margin: 0 }}>
                    {p.body}
                  </p>
                </div>
              </div>);

          })}
        </div>
        <style>{`
          @media (max-width: 820px) {
            .pillars-grid { grid-template-columns: 1fr !important; }
          }
        `}</style>
      </div>
    </section>);

}

/* ---------- ROTARY VALVE / MULTI-MODAL ---------- */
function RotaryValve() {
  const [mode, setMode] = useState("molecular"); // 'molecular' | 'immunoassay'
  const rotation = mode === "molecular" ? 0 : 180;

  const modes = {
    molecular: {
      label: "Molecular",
      sub: "PCR-based testing",
      tat: "~15–20 min",
      bullets: [
      "Proprietary sample processing",
      "Target amplification",
      "Detection",
      "View and manage results"]

    },
    immunoassay: {
      label: "Immunoassay",
      sub: "Antigen / antibody testing",
      tat: "~<10 min",
      bullets: [
      "Proprietary sample processing",
      "Capture and label",
      "Detection",
      "View and manage results"]

    }
  };

  return (
    <section className="section dark" id="platform">
      <div className="container">
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-end", marginBottom: 64, gap: 40, flexWrap: "wrap" }}>
          <div>
            <span className="eyebrow teal">The Platform</span>
            <h2 className="display-lg" style={{ marginTop: 18, maxWidth: "16ch" }}>
              One platform. <span style={{ color: "var(--magenta)" }}>Two modalities.</span>
            </h2>
          </div>
          <p className="lede" style={{ maxWidth: "44ch" }}>
            The platform is being designed to enable sample processing, target amplification, and detection
            for a range of sample types, while aiming to simplify the user workflow. Switch below to explore each modality.
          </p>
        </div>

        {/* toggle */}
        <div style={{ display: "flex", justifyContent: "center", marginBottom: 56 }}>
          <div role="tablist" style={{ display: "inline-flex", padding: 4, background: "rgba(245,239,231,0.06)", borderRadius: 999, border: "1px solid rgba(245,239,231,0.12)" }}>
            {["molecular", "immunoassay"].map((k) =>
            <button key={k} role="tab" aria-selected={mode === k} onClick={() => setMode(k)}
            style={{
              padding: "10px 24px",
              fontSize: 13,
              fontWeight: 600,
              fontFamily: "var(--body)",
              border: "none",
              borderRadius: 999,
              background: mode === k ? "var(--cream)" : "transparent",
              color: mode === k ? "var(--ink)" : "rgba(245,239,231,0.7)",
              transition: "all 0.3s",
              letterSpacing: "0.01em"
            }}>
                {modes[k].label}
              </button>
            )}
          </div>
        </div>

        <div style={{ display: "grid", gridTemplateColumns: "1fr 1.4fr 1fr", gap: 48, alignItems: "center" }} className="valve-grid">
          {/* left description */}
          <div style={{ textAlign: "right" }} className="valve-side">
            <div style={{ fontFamily: "var(--mono)", fontSize: 11, letterSpacing: "0.14em", textTransform: "uppercase", color: "rgba(245,239,231,0.55)", marginBottom: 14 }}>
              Active modality
            </div>
            <div style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: 36, lineHeight: 1, letterSpacing: "-0.02em", color: "var(--cream)" }}>
              {modes[mode].label}
            </div>
            <div style={{ marginTop: 8, color: "rgba(245,239,231,0.6)", fontSize: 14 }}>
              {modes[mode].sub}
            </div>
            <div style={{ marginTop: 28, paddingTop: 24, borderTop: "1px solid rgba(245,239,231,0.12)" }}>
              <div style={{ fontFamily: "var(--mono)", fontSize: 11, letterSpacing: "0.14em", textTransform: "uppercase", color: "rgba(245,239,231,0.45)", marginBottom: 6 }}>
                Targeted TAT
              </div>
              <div style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: 28, color: "var(--magenta)" }}>
                {modes[mode].tat}
              </div>
            </div>
          </div>

          {/* center valve */}
          <div style={{ position: "relative", aspectRatio: "1/1", maxWidth: 460, margin: "0 auto", width: "100%" }}>
            {/* outer ticks */}
            <svg viewBox="-50 -50 100 100" style={{ position: "absolute", inset: 0, width: "100%", height: "100%" }}>
              {Array.from({ length: 60 }).map((_, i) => {
                const a = i / 60 * Math.PI * 2;
                const isMajor = i % 5 === 0;
                const r1 = isMajor ? 44 : 46;
                const r2 = 48;
                return (
                  <line key={i}
                  x1={Math.cos(a) * r1} y1={Math.sin(a) * r1}
                  x2={Math.cos(a) * r2} y2={Math.sin(a) * r2}
                  stroke="rgba(245,239,231,0.25)"
                  strokeWidth={isMajor ? 0.4 : 0.2} />);

              })}
              {/* port markers removed */}
            </svg>
            {/* the O */}
            <div style={{ position: "absolute", inset: "10%", display: "flex", alignItems: "center", justifyContent: "center" }}>
              <OmnioO size="100%" rotation={rotation} color="#f5efe7" dot="#e921b2" glow />
            </div>
            {/* hint */}
            <div style={{ position: "absolute", left: "50%", bottom: -32, transform: "translateX(-50%)", fontFamily: "var(--mono)", fontSize: 10, letterSpacing: "0.18em", textTransform: "uppercase", color: "rgba(245,239,231,0.35)" }}>
              {rotation}° · {mode}
            </div>
          </div>

          {/* right description */}
          <div className="valve-side">
            <div style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: 36, lineHeight: 1, letterSpacing: "-0.02em", color: "var(--cream)", marginBottom: 24 }}>
              Flow path
            </div>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 12 }}>
              {modes[mode].bullets.map((b, i) => {
                const isModalitySpecific = i === 1;
                return (
                  <li key={b + i} style={{ display: "flex", gap: 14, alignItems: "flex-start", fontSize: 14.5, color: isModalitySpecific ? "var(--magenta)" : "rgba(245,239,231,0.82)", paddingBottom: 12, borderBottom: "1px solid rgba(245,239,231,0.08)" }}>
                    <span style={{ fontFamily: "var(--mono)", fontSize: 11, color: "var(--magenta)", marginTop: 3, minWidth: 18 }}>0{i + 1}</span>
                    <span style={{ display: "inline-flex", alignItems: "baseline", gap: 4 }}>
                      {b}
                      {isModalitySpecific &&
                      <span aria-hidden="true" style={{ color: "var(--magenta)", fontSize: 12 }}>*</span>
                      }
                    </span>
                  </li>);

              })}
            </ul>
            <div style={{ marginTop: 18, display: "flex", alignItems: "flex-start", gap: 8, fontFamily: "var(--mono)", fontWeight: 200, fontSize: 10.5, letterSpacing: "0.14em", textTransform: "uppercase", color: "var(--magenta)" }}>
              <span aria-hidden="true">*</span>
              <span>MODALITY-SPECIFIC</span>
            </div>
          </div>
        </div>

        <style>{`
          @media (max-width: 900px) {
            .valve-grid { grid-template-columns: 1fr !important; }
            .valve-side { text-align: left !important; }
          }
        `}</style>
      </div>
    </section>);

}

/* ---------- WORKFLOW ---------- */
function Workflow() {
  const steps = [
  { n: "01", title: "Add sample", body: "Add swab or liquid sample. Designed to accommodate a range of sample types.", img: "assets/workflow-sample.jpg" },
  { n: "02", title: "Insert cartridge & run test", body: "The cartridge slots into the instrument. Minimal hands-on time, start to finish.", img: "assets/workflow-run.jpg" },
  { n: "03", title: "View & manage results", body: "Review results on-device and route to LIS, EMR, or care teams.", img: "assets/workflow-results.jpg" }];

  const DURATION = 5500;
  const [active, setActive] = useState(0);
  const [paused, setPaused] = useState(false);

  useEffect(() => {
    if (paused) return undefined;
    const id = setTimeout(() => setActive((a) => (a + 1) % steps.length), DURATION);
    return () => clearTimeout(id);
  }, [active, paused]);

  const select = (i) => {setPaused(true);setActive(i);};

  return (
    <section className="section">
      <div className="container">
        <div style={{ marginBottom: 56 }}>
          <span className="eyebrow teal">Workflow</span>
          <h2 className="display-lg" style={{ marginTop: 18, maxWidth: "22ch" }}>
            A simple workflow.
          </h2>
        </div>
        <div className="workflow-stepper" style={{ display: "grid", gridTemplateColumns: "0.82fr 1.18fr", gap: 56, alignItems: "center" }}>
          <div>
            {steps.map((s, i) => {
              const on = i === active;
              return (
                <button
                  key={s.n}
                  onClick={() => select(i)}
                  aria-current={on ? "true" : undefined}
                  style={{ width: "100%", textAlign: "left", background: "none", border: "none", borderTop: i === 0 ? "1px solid var(--line)" : "none", borderBottom: "1px solid var(--line)", cursor: "pointer", font: "inherit", color: "inherit", display: "block", padding: "26px 0" }}>
                  <div style={{ display: "flex", alignItems: "baseline", gap: 18 }}>
                    <span style={{ fontFamily: "var(--mono)", fontWeight: "var(--mono-weight)", fontSize: 14, letterSpacing: "0.14em", textTransform: "uppercase", color: "var(--eyebrow-color, var(--ink-soft))" }}>{s.n}</span>
                    <div style={{ flex: 1, minWidth: 0 }}>
                      <h3 style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: "clamp(20px, 2vw, 26px)", lineHeight: 1.15, margin: 0, color: on ? "var(--ink)" : "var(--ink-mute)", transition: "color .3s" }}>
                        {s.title}
                      </h3>
                      <div style={{ display: "grid", gridTemplateRows: on ? "1fr" : "0fr", transition: "grid-template-rows .45s cubic-bezier(.7,0,.2,1)" }}>
                        <div style={{ overflow: "hidden", minHeight: 0 }}>
                          <p style={{ fontSize: 15, lineHeight: 1.6, color: "var(--ink-soft)", margin: "12px 0 0", maxWidth: "46ch" }}>
                            {s.body}
                          </p>
                        </div>
                      </div>
                    </div>
                  </div>
                </button>);

            })}
          </div>
          <div className="workflow-media" style={{ position: "relative", width: "100%", aspectRatio: "1920 / 1201", overflow: "hidden", background: "#0c1c1e" }}>
            {steps.map((s, i) =>
            <img
              key={s.n}
              src={s.img}
              alt={s.title}
              style={{ position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: i === active ? 1 : 0, transform: i === active ? "scale(1)" : "scale(1.04)", transition: "opacity .7s ease, transform 1.3s cubic-bezier(.7,0,.2,1)" }} />
            )}
          </div>
        </div>
        <style>{`
          @media (max-width: 860px) {
            .workflow-stepper { grid-template-columns: 1fr !important; gap: 28px !important; }
            .workflow-media { order: -1; }
          }
        `}</style>
      </div>
    </section>);

}

/* ---------- HIGHLIGHTS — interactive pill row ---------- */
function ClockIcon({ size = 36, color = "currentColor", accent = "var(--magenta)" }) {
  return (
    <svg width={size} height={size} viewBox="0 0 36 36" fill="none" aria-hidden="true">
      <circle cx="18" cy="18" r="15.5" stroke={color} strokeWidth="1.25" />
      {/* Tick marks */}
      {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((i) => {
        const a = i / 12 * Math.PI * 2;
        const major = i % 3 === 0;
        const r1 = major ? 13 : 14.2;
        const r2 = 15;
        const x1 = 18 + Math.sin(a) * r1;
        const y1 = 18 - Math.cos(a) * r1;
        const x2 = 18 + Math.sin(a) * r2;
        const y2 = 18 - Math.cos(a) * r2;
        return <line key={i} x1={x1} y1={y1} x2={x2} y2={y2} stroke={color} strokeWidth={major ? 1.1 : 0.6} strokeLinecap="round" />;
      })}
      {/* Hour hand */}
      <line x1="18" y1="18" x2="18" y2="10.5" stroke={color} strokeWidth="1.6" strokeLinecap="round" />
      {/* Minute hand (magenta) */}
      <line x1="18" y1="18" x2="25" y2="14" stroke={accent} strokeWidth="1.6" strokeLinecap="round" />
      {/* Center dot */}
      <circle cx="18" cy="18" r="1.4" fill={accent} />
    </svg>);

}

function Highlights() {
  const items = [
  { label: "Expanded Panels", title: "Expanded panels", body: "Detect multiple targets simultaneously in a single assay.", metric: "Multiplex", unit: "Multiple targets" },
  { label: "Workflow", title: "Automated workflow", body: "Minimal hands-on time with a simplified workflow, designed to reduce operator burden.", metric: "Minimal", unit: "hands-on time" },
  { label: "Performance", title: "High analytical performance", body: "High analytical performance using proprietary extraction technologies.", metric: "Lab level", unit: "analytical performance" },
  { label: "Connectivity", title: "Connectivity", body: "Seamless integration with LIS and telemedicine systems.", metric: "LIS", unit: "+ telemedicine" },
  { label: "Turn around time", title: "Fast turnaround time", body: "Targeting fast turnaround for both modalities — molecular in 15–20 minutes and immunoassay in under 10 minutes.", dual: true, dualMetrics: [{ kind: "Molecular", metric: "15–20", unit: "min" }, { kind: "Immunoassay", metric: "<10", unit: "min" }] },
  { label: "Affordable", title: "Affordable", body: "High margin economics, low costs and established reimbursement pathways.", metric: "High margin", unit: "economics" },
  { label: "Menu Breadth", title: "Menu breadth", body: "Supports a wide array of menu options due to diverse sample types & dual modality capability.", metric: "Expansive", metricFontSize: "clamp(44px, 4.6vw, 72px)", unit: "menu options" },
  { label: "Scalable", title: "Compact and Stackable", body: "Designed to fit clinical environments — stack multiple units to scale throughput on demand with minimal footprint.", metric: "Increased throughput", metricFontSize: "clamp(40px, 4.6vw, 66px)", metricLine: 1.02 }];

  const [active, setActive] = useState(0);
  const a = items[active];

  return (
    <section className="section" id="highlights">
      <div className="container">
        <div style={{ marginBottom: 48 }}>
          <span className="eyebrow teal">PLATFORM DESIGN HIGHLIGHTS</span>
          <h2 className="display-lg" style={{ marginTop: 18, maxWidth: "20ch" }}>
            What sets the platform apart.
          </h2>
        </div>

        {/* Pill row */}
        <div role="tablist" style={{ display: "flex", gap: 7, flexWrap: "wrap", marginBottom: 48 }}>
          {items.map((it, i) => {
            const on = active === i;
            return (
              <button
                key={it.label}
                role="tab"
                aria-selected={on}
                onClick={() => setActive(i)}
                style={{
                  padding: "11px 17px",
                  borderRadius: 999,
                  fontFamily: "var(--mono)",
                  fontWeight: 200,
                  fontSize: 12,
                  letterSpacing: "0.12em",
                  textTransform: "uppercase",
                  border: `1px solid ${on ? "var(--ink)" : "var(--line-strong)"}`,
                  background: on ? "var(--ink)" : "transparent",
                  color: on ? "var(--cream)" : "var(--ink)",
                  cursor: "pointer",
                  transition: "background 0.25s, color 0.25s, border-color 0.25s",
                  whiteSpace: "nowrap"
                }}>
                
                {it.label}
                {it.wip && <span aria-hidden="true" style={{ color: "var(--magenta)", marginLeft: 4 }}>*</span>}
              </button>);

          })}
        </div>

        {/* Detail panel */}
        <div style={{ display: "grid", gridTemplateColumns: "1.15fr 1fr", gap: 1, background: "var(--line)", border: "1px solid var(--line)", minHeight: 460 }} className="hl-detail">
          {/* left: text */}
          <div style={{ background: "var(--cream)", padding: "clamp(36px, 4vw, 64px)", display: "flex", flexDirection: "column", gap: 28, justifyContent: "flex-start", paddingTop: "clamp(48px, 6vw, 96px)" }}>
            <div style={{ fontFamily: "var(--mono)", fontWeight: 200, fontSize: 12, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--ink-mute)", display: "flex", alignItems: "center", gap: 10 }}>
              <span style={{ width: 6, height: 6, borderRadius: "50%", background: "var(--magenta)" }} />
              0{active + 1} <span style={{ opacity: 0.4 }}>/ 0{items.length}</span>
            </div>
            <h3 key={`title-${active}`} style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: "clamp(34px, 3.6vw, 52px)", lineHeight: 1.05, letterSpacing: "-0.025em", margin: 0, color: "var(--ink)", animation: "fade-up 0.45s ease", minHeight: "2.1em" }}>
              {a.title}
            </h3>
            <p key={`body-${active}`} style={{ fontSize: 17, lineHeight: 1.55, color: "var(--ink-soft)", margin: 0, maxWidth: "42ch", animation: "fade-up 0.55s ease" }}>
              {a.body}
            </p>
            {a.wip &&
            <div key={`wip-${active}`} style={{ marginTop: 4, display: "flex", alignItems: "flex-start", gap: 8, fontFamily: "var(--mono)", fontWeight: 200, fontSize: 10.5, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--magenta)", animation: "fade-up 0.65s ease" }}>
                <span aria-hidden="true">*</span>
                <span>Functionality under development</span>
              </div>
            }
          </div>
          {/* right: metric panel */}
          <div style={{ background: "var(--ink-2)", color: "var(--cream)", padding: "clamp(36px, 4vw, 64px)", display: "flex", flexDirection: "column", justifyContent: "center", position: "relative", overflow: "hidden" }}>
            {/* watermark O */}
            <div style={{ position: "absolute", right: -80, top: -80, opacity: 0.06, pointerEvents: "none", transition: "transform 0.8s cubic-bezier(.7,.05,.2,1)", transform: `rotate(${active * 60}deg)` }}>
              <OmnioO size={480} color="#f5efe7" dot="#e921b2" />
            </div>
            <div style={{ position: "relative", zIndex: 1, display: "flex", flexDirection: "column", gap: 18 }}>
              <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", gap: 12 }}>
                <div style={{ fontFamily: "var(--mono)", fontWeight: 200, fontSize: 11, letterSpacing: "0.2em", textTransform: "uppercase", color: "rgba(245,239,231,0.55)" }}>
                  Metric
                </div>
                {a.dual &&
                <ClockIcon size={36} color="rgba(245,239,231,0.55)" accent="var(--magenta)" />
                }
              </div>

              {a.dual ?
              <div key={`dual-${active}`} style={{ display: "flex", flexDirection: "column", gap: 0, animation: "fade-up 0.5s ease" }}>
                  {a.dualMetrics.map((m, mi) =>
                <div key={m.kind} style={{
                  paddingBottom: mi === 0 ? 24 : 0,
                  paddingTop: mi === 1 ? 24 : 0,
                  borderBottom: mi === 0 ? "1px solid rgba(245,239,231,0.14)" : "none",
                  display: "flex",
                  flexDirection: "column",
                  gap: 8
                }}>
                      <div style={{ fontFamily: "var(--mono)", fontWeight: 200, fontSize: 10.5, letterSpacing: "0.2em", textTransform: "uppercase", color: "rgba(245,239,231,0.5)" }}>
                        {m.kind}
                      </div>
                      <div style={{ display: "flex", alignItems: "baseline", gap: 14, whiteSpace: "nowrap" }}>
                        <span style={{ fontFamily: "var(--display)", fontWeight: 800, fontSize: "clamp(44px, 5vw, 76px)", lineHeight: 0.95, letterSpacing: "-0.04em", color: "var(--magenta)" }}>
                          {m.metric}
                        </span>
                        <span style={{ fontFamily: "var(--display)", fontWeight: 500, fontSize: 16, color: "var(--cream)" }}>
                          {m.unit}
                        </span>
                      </div>
                    </div>
                )}
                </div> :

              <>
                  <div key={`metric-${active}`} style={{ fontFamily: "var(--display)", fontWeight: 800, fontSize: a.metricFontSize || "clamp(60px, 7vw, 108px)", lineHeight: a.metricLine || 0.92, letterSpacing: "-0.04em", color: "var(--magenta)", animation: "fade-up 0.5s ease", maxWidth: "100%", overflowWrap: "break-word" }}>
                    {a.metric}
                  </div>
                  {a.unit &&
                <div key={`unit-${active}`} style={{ fontFamily: "var(--display)", fontWeight: 500, fontSize: 18, color: "var(--cream)", animation: "fade-up 0.6s ease" }}>
                    {a.unit}
                  </div>
                }
                  {a.sub &&
                <div key={`sub-${active}`} style={{ marginTop: 4, fontFamily: "var(--mono)", fontWeight: 200, fontSize: 12, letterSpacing: "0.14em", textTransform: "uppercase", color: "rgba(245,239,231,0.55)", animation: "fade-up 0.7s ease" }}>
                      {a.sub}
                    </div>
                }
                </>
              }
            </div>
          </div>
        </div>

        <style>{`
          @media (max-width: 900px) {
            .hl-detail { grid-template-columns: 1fr !important; min-height: auto !important; }
          }
        `}</style>
      </div>
    </section>);

}

/* ---------- MARQUEE STATEMENT ---------- */
function MarqueeStatement({ mode = "scroll" }) {
  const phrases = ["One Platform.", "Two Modalities.", "Expanding Reach."];
  const [idx, setIdx] = useState(0);

  useEffect(() => {
    if (mode !== "flash") return;
    const id = setInterval(() => setIdx((i) => (i + 1) % phrases.length), 1600);
    return () => clearInterval(id);
  }, [mode]);

  return (
    <section style={{ padding: "96px 0 120px", overflow: "hidden", borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)" }}>
      {mode === "flash" &&
      <div className="container" style={{ marginBottom: 24, display: "flex", justifyContent: "flex-end", alignItems: "center", gap: 16, flexWrap: "wrap" }}>
        <div style={{ display: "flex", gap: 6 }}>
            {phrases.map((_, i) =>
          <span key={i} style={{
            width: i === idx ? 24 : 6,
            height: 6,
            borderRadius: 999,
            background: i === idx ? "var(--magenta)" : "var(--line-strong)",
            transition: "all 0.5s cubic-bezier(.7,.05,.2,1)"
          }} />
          )}
          </div>
      </div>
      }

      {mode === "scroll" &&
      <div style={{ whiteSpace: "nowrap", display: "flex", paddingBlock: "0.12em" }}>
          {[0, 1].map((k) =>
        <div key={k} aria-hidden={k === 1} style={{
          flex: "0 0 auto",
          display: "inline-flex",
          gap: "0.7em",
          fontFamily: "var(--display)",
          fontWeight: 800,
          fontSize: "clamp(60px, 9vw, 160px)",
          lineHeight: 1.3,
          letterSpacing: "-0.035em",
          color: "var(--magenta)",
          animation: "marquee 32s linear infinite",
          paddingRight: "0.7em"
        }}>
              <span>One Platform.</span>
              <span>Two Modalities.</span>
              <span>Expanding Reach.</span>
            </div>
        )}
        </div>
      }

      {mode === "flash" &&
      <div className="container" style={{ display: "flex", alignItems: "center", justifyContent: "center", minHeight: "clamp(140px, 16vw, 240px)", position: "relative" }}>
          {phrases.map((p, i) =>
        <div key={i} style={{
          position: "absolute",
          fontFamily: "var(--display)",
          fontWeight: 800,
          fontSize: "clamp(60px, 9vw, 160px)",
          lineHeight: 1.0,
          letterSpacing: "-0.035em",
          color: "var(--magenta)",
          opacity: i === idx ? 1 : 0,
          transform: i === idx ? "translateY(0) scale(1)" : i < idx || idx === 0 && i === phrases.length - 1 ? "translateY(-12px) scale(0.98)" : "translateY(12px) scale(0.98)",
          transition: "opacity 0.5s cubic-bezier(.7,.05,.2,1), transform 0.7s cubic-bezier(.7,.05,.2,1)",
          whiteSpace: "nowrap",
          textAlign: "center"
        }}>
              {p}
            </div>
        )}
        </div>
      }

      <style>{`@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }`}</style>
    </section>);

}

/* ---------- APPLICATIONS / MENU ---------- */
function Applications() {
  const areas = [
  { title: "Infectious Disease", body: "Area of focus.", state: "focus area" },
  { title: "Women's Health", body: "Area of focus.", state: "focus area" },
  { title: "Future applications", body: "Multimodal & multiplexing is being designed to enable broad future applications across care settings.", state: "future" }];

  return (
    <section className="section" id="applications" style={{ background: "var(--cream-2)" }}>
      <div className="container">
        <div style={{ marginBottom: 56 }}>
          <span className="eyebrow teal">Applications</span>
          <h2 className="display-lg" style={{ marginTop: 18, maxWidth: "22ch" }}>
            Testing <span style={{ color: "var(--magenta)" }}>where care happens</span>.
          </h2>
        </div>

        <ul style={{ listStyle: "none", padding: 0, margin: 0, borderTop: "1px solid var(--line-strong)" }}>
          {areas.map((a, i) =>
          <li key={a.title} style={{ display: "grid", gridTemplateColumns: "60px 1fr auto", gap: 32, alignItems: "center", padding: "32px 0", borderBottom: "1px solid var(--line-strong)", cursor: "pointer", transition: "background 0.2s" }}
          onMouseEnter={(e) => e.currentTarget.style.background = "rgba(48,53,75,0.04)"}
          onMouseLeave={(e) => e.currentTarget.style.background = "transparent"}>
              <span style={{ fontFamily: "var(--mono)", fontSize: 11, color: "var(--ink-mute)" }}>0{i + 1}</span>
              <span style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: 28, color: "var(--ink)", letterSpacing: "-0.01em" }}>
                {a.title}
              </span>
              <span style={{ fontFamily: "var(--mono)", fontWeight: 500, fontSize: 13, letterSpacing: "0.18em", textTransform: "uppercase", padding: "10px 20px", border: "1.5px solid var(--line-strong)", borderRadius: 999, color: a.state === "focus area" ? "var(--magenta)" : "var(--ink-mute)", whiteSpace: "nowrap" }}>
                {a.state}
              </span>
            </li>
          )}
        </ul>
      </div>
    </section>);

}

/* ---------- TEAM ---------- */
function Team() {
  const advisors = [
  {
    who: "Robert Bujarski",
    role: "Board Member",
    body: "Cubit is addressing a set of challenges that anyone who has operated in diagnostics will immediately recognize — fragmented workflows, delayed answers, and increasing pressure on healthcare systems. What stands out to me is the team's focus on building something practical and scalable, while also innovative."
  },
  {
    who: "Mark Paiz",
    role: "Board Member",
    body: "The innovation is clear, but what really matters at this stage is the discipline in driving it forward. I believe in the people leading this effort and the vision they are advancing."
  }];

  return (
    <section className="section" id="team">
      <div className="container">
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "flex-end", marginBottom: 64, gap: 40, flexWrap: "wrap" }}>
          <div>
            <span className="eyebrow teal">Leadership</span>
            <h2 className="display-lg" style={{ marginTop: 18, maxWidth: "20ch" }}>
              100+ years of combined experience — building, operating, scaling.
            </h2>
          </div>
          <p className="lede" style={{ maxWidth: "44ch" }}>
            Our leadership team has supported multiple product launches from early development through commercialization —
            spanning R&D, operations, and go-to-market execution. Built to accelerate growth, advance innovation,
            and deliver meaningful impact in healthcare.
          </p>
        </div>

        {/* CEO feature card */}
        <div style={{ background: "var(--ink-2)", color: "var(--cream)", padding: "clamp(40px, 5vw, 72px)", marginBottom: 24, display: "grid", gridTemplateColumns: "0.7fr 2fr", gap: 32, alignItems: "center", position: "relative", overflow: "hidden" }} className="ceo-card">
          <div style={{ position: "absolute", top: -40, right: -40, opacity: 0.06 }}>
            <OmnioO size={320} rotation={-25} color="#f5efe7" dot="#e921b2" />
          </div>
          <div style={{ position: "relative" }}>
            <div style={{ fontFamily: "var(--mono)", fontSize: 14, letterSpacing: "0.18em", textTransform: "uppercase", color: "rgba(245,239,231,0.55)", marginBottom: 18, display: "flex", alignItems: "center", gap: 10 }}>
              <span style={{ width: 6, height: 6, borderRadius: "50%", background: "var(--magenta)" }} />
              Founder Note
            </div>
            <div style={{ fontFamily: "var(--display)", fontWeight: 700, fontSize: 22, color: "var(--cream)", letterSpacing: "-0.01em", marginTop: 28 }}>
              Kunal Sur
            </div>
            <div style={{ fontFamily: "var(--mono)", fontSize: 11, letterSpacing: "0.14em", textTransform: "uppercase", color: "rgba(245,239,231,0.55)", marginTop: 6 }}>
              Founder &amp; CEO
            </div>
          </div>
          <div style={{ position: "relative" }}>
            <span style={{ fontFamily: "var(--display)", fontSize: 96, lineHeight: 0.5, color: "var(--magenta)", fontWeight: 800, display: "block", marginBottom: 24 }}>“</span>
            <blockquote style={{ margin: 0, fontFamily: "var(--display)", fontWeight: 600, fontSize: "clamp(22px, 2.2vw, 32px)", lineHeight: 1.25, color: "var(--cream)", letterSpacing: "-0.015em", marginBottom: 28 }}>
              We have the right team, a clear path forward, and the capital to achieve the next key milestones.
            </blockquote>
            <p style={{ margin: 0, fontSize: 16.5, lineHeight: 1.55, color: "rgba(245,239,231,0.78)", maxWidth: "52ch" }}>
              Putting molecular and immunoassay into one platform is novel and compelling, and we're incredibly excited about the progress we continue to make.
            </p>
          </div>
        </div>

        {/* Advisor quotes */}
        <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 24 }} className="team-grid">
          {advisors.map((q) =>
          <figure key={q.who} style={{ margin: 0, padding: "36px 32px", background: "var(--cream)", border: "1px solid var(--line)", display: "flex", flexDirection: "column", gap: 22, minHeight: 280 }}>
              <span style={{ fontFamily: "var(--display)", fontSize: 56, lineHeight: 0.6, color: "var(--magenta)", fontWeight: 800 }}>“</span>
              <blockquote style={{ margin: 0, fontFamily: "var(--display)", fontWeight: 500, fontSize: 18, lineHeight: 1.4, color: "var(--ink)", flex: 1, letterSpacing: "-0.005em" }}>
                {q.body}
              </blockquote>
              <figcaption style={{ borderTop: "1px solid var(--line)", paddingTop: 18 }}>
                <div style={{ fontWeight: 600, fontSize: 14, color: "var(--ink)" }}>{q.who}</div>
                <div style={{ fontFamily: "var(--mono)", fontSize: 11, letterSpacing: "0.1em", textTransform: "uppercase", color: "var(--ink-mute)", marginTop: 4 }}>{q.role}</div>
              </figcaption>
            </figure>
          )}
        </div>
        <style>{`
          @media (max-width: 900px) {
            .team-grid { grid-template-columns: 1fr !important; }
            .ceo-card { grid-template-columns: 1fr !important; }
          }
        `}</style>
      </div>
    </section>);

}

/* ---------- CTA + FOOTER ---------- */
function CTA() {
  return (
    <section className="section" style={{ background: "var(--cream)", borderTop: "1px solid var(--line)" }}>
      <div className="container" style={{ display: "grid", gridTemplateColumns: "1.4fr 1fr", gap: 64, alignItems: "center" }}>
        <h2 className="display-lg" style={{ maxWidth: "18ch" }}>
          More to come<span style={{ color: "var(--magenta)" }}>.</span>
        </h2>
        <div style={{ display: "flex", flexDirection: "column", gap: 18, alignItems: "flex-start" }}>
          <p className="lede" style={{ maxWidth: "36ch" }}>
            Follow our progress on the blog, or get in touch to discuss collaborations and partnerships.
          </p>
          <div style={{ display: "flex", gap: 12 }}>
            <a className="btn" href="contact.html">Get in touch</a>
            <a className="btn ghost" href="blog.html">Read the blog</a>
          </div>
        </div>
      </div>
    </section>);

}

function Footer() {
  const path = typeof window !== "undefined" ? window.location.pathname : "/";
  const isHome = /(^\/$)|(\/index\.html$)/.test(path) || path === "" || path === "/";
  const home = (hash) => isHome ? hash : "index.html" + hash;

  return (
    <footer className="site-footer">
      <div className="container">
        <div className="foot-grid">
          <div>
            <Logo height={26} color="#f5efe7" dot="#e921b2" />
            <p style={{ fontSize: 13.5, lineHeight: 1.55, color: "rgba(245,239,231,0.7)", marginTop: 24, maxWidth: "30ch" }}>
              Omnio is the diagnostic platform developed by Cubit — bringing molecular and immunoassay testing
              onto a single point-of-care system.
            </p>
          </div>
          <div>
            <h5>Platform</h5>
            <ul>
              <li><a href={home("#platform")}>Technology</a></li>
              <li><a href={home("#applications")}>Applications</a></li>
              <li><a href={home("#pillars")}>Highlights</a></li>
            </ul>
          </div>
          <div>
            <h5>Company</h5>
            <ul>
              <li><a href={home("#team")}>Team</a></li>
              <li><a href="blog.html">Blog</a></li>
              <li><a href="contact.html">Contact</a></li>
              <li><a href="contact.html">Careers</a></li>
            </ul>
          </div>
          <div>
            <h5>Connect</h5>
            <ul>
              <li><a href="https://www.linkedin.com/company/cubitdx/" target="_blank" rel="noopener noreferrer">LinkedIn</a></li>
              <li><a href="contact.html">Press inquiries</a></li>
              <li><a href="contact.html">Investor relations</a></li>
            </ul>
          </div>
        </div>

        <div style={{ marginTop: 80, paddingTop: 32, borderTop: "1px solid rgba(245,239,231,0.12)" }}>
          <div style={{ fontFamily: "var(--mono)", fontSize: 10, letterSpacing: "0.18em", textTransform: "uppercase", color: "rgba(245,239,231,0.5)", marginBottom: 14 }}>
            Regulatory Disclaimer
          </div>
          <p className="disclaimer">
            The Omnio platform is currently in development and is shown for informational purposes only.
            It has not been cleared or approved by the U.S. Food and Drug Administration and is not available for sale.
            Features, specifications, and availability are subject to change and to applicable regulatory clearance or approval.
          </p>
        </div>

        <div className="foot-bottom">
          <span>© 2026 Cubit Biosciences</span>
          <span>Built for the future of diagnostics</span>
        </div>
      </div>
    </footer>);

}

Object.assign(window, { Nav, Hero, Mission, ImageBand, Numbers, Pillars, RotaryValve, Workflow, Highlights, MarqueeStatement, Applications, Team, CTA, Footer, Logo, OmnioO, ClockIcon });