import type { CSSProperties, ReactNode } from "react"; import Link from "next/link"; import GlobeCanvas from "@/components/globe-canvas"; import StatCounter from "@/components/stat-counter"; import RevealObserver from "@/components/reveal-observer"; import ContactForm from "./contact-form"; import type { Item, Page, Section } from "@/lib/pages"; import { SITE_URL, hrefFor } from "@/lib/routes"; type Vars = CSSProperties & Record<`--${string}`, string | number>; const delay = (ms: number) => ({ "--d": `${ms}ms` }) as Vars; const pad = (n: number) => String(n).padStart(2, "0"); export type Crumb = { name: string; href: string }; const Arrow = () => →; function Eyebrow({ index, children }: { index?: string; children: ReactNode }) { return (

{index && {index}} {children}

); } /** "> " marks a sentence that was bold in the copy deck. */ function Para({ text, className }: { text: string; className?: string }) { if (text.startsWith("> ")) return

{text.slice(2)}

; return

{text}

; } function Paras({ items, firstClass }: { items: string[]; firstClass?: string }) { return ( <> {items.map((t, i) => ( ))} ); } function CtaLinks({ ctas, path }: { ctas: string[]; path: string }) { if (!ctas.length) return null; return (
{ctas.map((c) => ( {c} ))}
); } function SectionHead({ section, index }: { section: Section; index: number }) { const isFaq = section.kind === "faq"; const eyebrow = isFaq && !section.title ? null : section.eyebrow; const title = section.title ?? (isFaq ? "Frequently Asked Questions" : null); return (
{eyebrow && {eyebrow}} {title &&

{title}

}
); } function Intro({ section }: { section: Section }) { const { intro } = section; if (!intro.length) return null; if (intro.length === 1) { return (
); } return (
); } function Outro({ section, path }: { section: Section; path: string }) { if (!section.outro.length && !section.ctas.length) return null; return (
{section.outro.length > 0 && (
)}
); } function ItemList({ list }: { list: string[] }) { if (!list.length) return null; return ( ); } function columnsFor(items: Item[]) { const n = items.length; const avg = items.reduce((a, it) => a + it.body.join(" ").length, 0) / Math.max(n, 1); if (n === 2 || (n === 4 && avg > 240)) return 2; if (n === 4) return 4; return 3; } /* ───────────── Section variants ───────────── */ function TextSection({ section, path }: { section: Section; path: string }) { return ( <> {section.ctas.length > 0 && (
)} ); } function CardsSection({ section, path }: { section: Section; path: string }) { const cols = columnsFor(section.items); return ( <>
{section.items.map((it, i) => (
{pad(i + 1)}

{it.title}

{it.subtitle &&

{it.subtitle}

} {it.body.length > 0 && (
)} {it.cta && ( {it.cta} )}
))}
); } function StepsSection({ section, path }: { section: Section; path: string }) { return ( <>
    {section.items.map((it, i) => (
  1. {it.num ?? pad(i + 1)}

    {it.title}

  2. ))}
); } function FaqSection({ section, path }: { section: Section; path: string }) { return ( <>
{section.items.map((it, i) => (
{it.title}