diff --git a/components/Login.tsx b/components/Login.tsx index 0e4afba..ec3b1b7 100644 --- a/components/Login.tsx +++ b/components/Login.tsx @@ -436,7 +436,7 @@ export const Login: React.FC = ({ onLogin }) => {

Need Enterprise?

-

Unlimited locations + SSO + EDI

+

Unlimited locations + custom integrations

diff --git a/index.html b/index.html index 67e2f00..4d3f1a4 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + ChefCode.ai — AI Invoice Coding - - +
diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..0e8285c Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..2cf23f0 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,8 @@ +User-agent: * +Allow: / + +# The signed-in product. To a crawler it is only a login screen, and indexing +# it would put a sign-in form in search results instead of the landing page. +Disallow: /app + +Sitemap: https://www.chefcode.cc/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..cbcff60 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,9 @@ + + + https://www.chefcode.cc/weekly1.0 + https://www.chefcode.cc/setupmonthly0.6 + https://www.chefcode.cc/securitymonthly0.6 + https://www.chefcode.cc/privacyyearly0.3 + https://www.chefcode.cc/termsyearly0.3 + https://www.chefcode.cc/dpayearly0.3 + diff --git a/src/Router.tsx b/src/Router.tsx index 58a8e33..84ee7d0 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -8,10 +8,11 @@ const Privacy = lazy(() => import('./pages/Privacy')); const Terms = lazy(() => import('./pages/Terms')); const SecurityOverview = lazy(() => import('./pages/SecurityOverview')); const DataProcessing = lazy(() => import('./pages/DataProcessing')); +const NotFound = lazy(() => import('./pages/NotFound')); -// Policy pages. Longest-prefix-free: none of these is a prefix of another, and -// none collides with the landing page's #security anchor (that's a hash, not a -// path). Kept in one table so adding a page is a single line. +// Policy pages, matched exactly. None collides with the landing page's +// #security anchor — that's a hash, not a path. Kept in one table so adding a +// page is one line here plus one entry in vercel.json's rewrites. const LEGAL_ROUTES: Array<[string, React.LazyExoticComponent<() => JSX.Element>]> = [ ['/privacy', Privacy], ['/terms', Terms], @@ -33,8 +34,14 @@ export default function Router() { return () => window.removeEventListener('popstate', onNav); }, []); - // Any path starting with /app loads the existing product - if (path.startsWith('/app')) { + // Matching is exact, not prefix. With startsWith, /setupfoo or + // /security-team rendered a real page while the server (vercel.json) answered + // the same URL with a 404 — two halves of the site disagreeing about which + // pages exist. These rules must stay in step with the rewrites there. + const clean = path.length > 1 ? path.replace(/\/+$/, '') : path; + + // The product: /app, plus anything beneath it (auth redirects land on /app). + if (clean === '/app' || clean.startsWith('/app/')) { return ( }> @@ -42,8 +49,7 @@ export default function Router() { ); } - // Setup guide page - if (path.startsWith('/setup')) { + if (clean === '/setup') { return ( }> @@ -51,8 +57,7 @@ export default function Router() { ); } - // Policy pages - const legal = LEGAL_ROUTES.find(([prefix]) => path.startsWith(prefix)); + const legal = LEGAL_ROUTES.find(([route]) => clean === route); if (legal) { const Page = legal[1]; return ( @@ -62,20 +67,28 @@ export default function Router() { ); } - // Everything else shows the landing page + if (clean === '/' || clean === '/index.html') { + return ( + }> + + + ); + } + + // Anything else is not a page. return ( }> - + ); } function LoadingScreen() { return ( -
+
-
-

Loading...

+
+

Loading…

); diff --git a/src/components/landing/Features.tsx b/src/components/landing/Features.tsx index 2040167..adcc69a 100644 --- a/src/components/landing/Features.tsx +++ b/src/components/landing/Features.tsx @@ -1,16 +1,16 @@ import { - Scan, TrendingUp, BookOpen, Users, Bell, BarChart3, + Scan, TrendingUp, BookOpen, Users, CopyCheck, BarChart3, GraduationCap, Hotel, Check, } from 'lucide-react'; import { useReveal } from '../../hooks/useReveal'; const features = [ - { icon: Scan, title: 'AI invoice extraction', desc: 'Upload any format — PDF, photo, email attachment. Line items extracted in seconds with 98% accuracy.' }, - { icon: TrendingUp, title: 'Price spike detection', desc: 'Automatic alerts when a vendor raises prices above your threshold. Catch overcharges before they hit your P&L.' }, + { icon: Scan, title: 'AI invoice extraction', desc: 'Upload a PDF or snap a photo on your phone. Every line item is read and structured in seconds, ready for you to review.' }, + { icon: TrendingUp, title: 'Price change detection', desc: 'Every line is checked against what you last paid for that item. Anything more than 10% higher is flagged while you review.' }, { icon: BookOpen, title: 'Auto GL coding', desc: 'Every line item auto-categorized to your chart of accounts. No more back-and-forth with accounting.' }, { icon: Users, title: 'Role-based access', desc: 'Owner, Manager, Chef, Viewer — each role sees exactly what they need. Nothing more, nothing less.' }, - { icon: Bell, title: 'Approval workflow', desc: 'Invoices flow from upload to review to approval. Notifications keep the right people in the loop.' }, - { icon: BarChart3, title: 'Spend analytics', desc: 'Monthly spend by category, vendor, and location. Spot trends. Make data-driven purchasing decisions.' }, + { icon: CopyCheck, title: 'Duplicate detection', desc: 'Upload the same invoice twice and ChefCode catches it, so nothing gets coded — or paid — twice.' }, + { icon: BarChart3, title: 'Spend analytics', desc: 'Monthly spend broken down by GL category, with every flagged price change on one screen.' }, ]; const verticals = [ @@ -23,7 +23,7 @@ const verticals = [ 'GL code mapping for institutional accounting', 'Works alongside CBORD & Computrition', 'FERPA-safe — zero student data touched', - 'Full audit trail for compliance reviews', + 'Every invoice traceable to who processed it', ], }, { @@ -31,9 +31,9 @@ const verticals = [ title: 'Hotels & Hospitality', color: 'from-brand-600 to-brand-400', points: [ - 'Multi-property invoice consolidation', - 'Role-based access (GM, Chef, Controller)', - 'Price spike alerts across all vendors', + 'Invoices tracked per property', + 'Role-based access for GMs, chefs and controllers', + 'Price change flags across every vendor', 'Sysco, US Foods, Freshpoint pre-loaded', 'Encrypted data with SOC 2 compliant hosting', ], @@ -66,7 +66,7 @@ export default function Features() {

{f.title}

-

{f.desc}

+

{f.desc}

))}
@@ -100,7 +100,7 @@ export default function Features() { {v.points.map((pt, j) => (
  • - {pt} + {pt}
  • ))} diff --git a/src/components/landing/FinalCTA.tsx b/src/components/landing/FinalCTA.tsx index f42e724..7cb03be 100644 --- a/src/components/landing/FinalCTA.tsx +++ b/src/components/landing/FinalCTA.tsx @@ -8,7 +8,7 @@ export default function FinalCTA() { return (
    -
    +
    @@ -25,14 +25,14 @@ export default function FinalCTA() { Did you catch it? -

    +

    Start your free trial — upload your first invoice in 60 seconds. No credit card. No setup fee. No commitment.

    Start Free Trial @@ -41,7 +41,7 @@ export default function FinalCTA() { href={DEMO_BOOKING_URL} target="_blank" rel="noopener noreferrer" - className="inline-flex items-center justify-center gap-2 px-8 py-4 rounded-xl bg-white/[0.08] border border-cream/20 text-cream font-medium text-base hover:bg-white/[0.14] transition-all" + className="press inline-flex items-center justify-center gap-2 px-8 py-4 rounded-xl bg-white/[0.08] border border-cream/20 text-cream font-medium text-base hover:bg-white/[0.14]" > Book a 30-Min Demo diff --git a/src/components/landing/Footer.tsx b/src/components/landing/Footer.tsx index 7b2843d..a9337eb 100644 --- a/src/components/landing/Footer.tsx +++ b/src/components/landing/Footer.tsx @@ -57,7 +57,7 @@ export default function Footer() { ChefCode.ai -

    +

    AI-powered invoice intelligence for food service teams. Save time, catch overcharges, export clean data.

    @@ -65,7 +65,7 @@ export default function Footer() { {/* Link columns */} {columns.map((col, i) => (
    -

    {col.title}

    +

    {col.title}

      {col.links.map((link, j) => (
    • @@ -84,7 +84,7 @@ export default function Footer() {
    -

    © {new Date().getFullYear()} ChefCode.ai. All rights reserved.

    +

    © {new Date().getFullYear()} ChefCode.ai. All rights reserved.

    {[ { label: 'Privacy', href: '/privacy' }, @@ -94,7 +94,7 @@ export default function Footer() { {l.label} diff --git a/src/components/landing/Hero.tsx b/src/components/landing/Hero.tsx index 93aab59..343f0fd 100644 --- a/src/components/landing/Hero.tsx +++ b/src/components/landing/Hero.tsx @@ -1,4 +1,4 @@ -import { ArrowRight, Play, GraduationCap } from 'lucide-react'; +import { ArrowRight, ArrowDown, GraduationCap } from 'lucide-react'; import InvoiceDemo from './InvoiceDemo'; export default function Hero() { @@ -27,7 +27,7 @@ export default function Hero() { in seconds. -

    +

    ChefCode reads your supplier invoices, assigns the right GL codes, and flags vendor overcharges — automatically. In under 60 seconds, not 24 hours. @@ -37,21 +37,24 @@ export default function Hero() {

    -

    15-day free trial · no credit card

    +

    15-day free trial · no credit card

    {/* Origin story, not invented logos. This replaced a stack of four fake monograms (UC/HG/DM/RK) over @@ -67,8 +70,11 @@ export default function Hero() {
    - {/* ── Right: Invoice demo ── */} -
    + {/* ── Right: Invoice demo ── + Was `hidden lg:block`, so phone visitors never saw the product at + all — the single most persuasive element on the page was desktop + only. It stacks under the copy on small screens. */} +
    diff --git a/src/components/landing/HowItWorks.tsx b/src/components/landing/HowItWorks.tsx index 17759dd..3f307b4 100644 --- a/src/components/landing/HowItWorks.tsx +++ b/src/components/landing/HowItWorks.tsx @@ -2,9 +2,9 @@ import { Upload, Cpu, CheckCircle, ArrowRight } from 'lucide-react'; import { useReveal } from '../../hooks/useReveal'; const steps = [ - { num: '01', icon: Upload, title: 'Upload', desc: 'Snap a photo with your phone or drop a PDF. We accept any invoice format from any vendor.' }, + { num: '01', icon: Upload, title: 'Upload', desc: 'Snap a photo with your phone or drop in a PDF, from any vendor.' }, { num: '02', icon: Cpu, title: 'AI extracts', desc: 'Line items, GL codes, vendor match, product identification — all extracted in under 60 seconds.' }, - { num: '03', icon: CheckCircle, title: 'Review & export', desc: 'Approve invoices, catch price spikes, and export to QuickBooks or CSV in one click.' }, + { num: '03', icon: CheckCircle, title: 'Review & export', desc: 'Check the coded lines, catch price changes, and export a PDF summary or CSV in one click.' }, ]; export default function HowItWorks() { @@ -18,7 +18,7 @@ export default function HowItWorks() {

    Three steps. Under a minute.

    -

    +

    No training required. If your team can take a photo, they can use ChefCode.

    @@ -38,7 +38,7 @@ export default function HowItWorks() {

    {s.title}

    -

    {s.desc}

    +

    {s.desc}

    {i < steps.length - 1 && ( diff --git a/src/components/landing/InvoiceDemo.tsx b/src/components/landing/InvoiceDemo.tsx index 7155bea..e262a9e 100644 --- a/src/components/landing/InvoiceDemo.tsx +++ b/src/components/landing/InvoiceDemo.tsx @@ -22,12 +22,12 @@ export default function InvoiceDemo() { Invoice #INV-2847
    - Sysco Foods + Sysco Foods
    {/* ── Body ── */}
    -
    +
    Item Qty Price @@ -50,10 +50,10 @@ export default function InvoiceDemo() { )} {item.name}
    - {item.qty} + {item.qty}
    {item.price} - {item.spike && {item.spike}} + {item.spike && {item.spike}}
    {item.gl}
    @@ -76,7 +76,7 @@ export default function InvoiceDemo() { {/* ── Footer ── */}
    - Processed in 47 seconds + Processed in 47 seconds 98% confidence
    diff --git a/src/components/landing/Navbar.tsx b/src/components/landing/Navbar.tsx index 75dcad7..8d480f3 100644 --- a/src/components/landing/Navbar.tsx +++ b/src/components/landing/Navbar.tsx @@ -1,11 +1,15 @@ import { useState, useEffect } from 'react'; import { Menu, X } from 'lucide-react'; +// Rooted at "/" so they work from every page. As bare "#features" they only +// resolved on the homepage: on /privacy, /terms, /security, /dpa and /setup +// every one pointed at an anchor that doesn't exist there, and clicking them +// did nothing at all — including "Security" while on the Security page. const links = [ - { label: 'Features', href: '#features' }, - { label: 'How It Works', href: '#how-it-works' }, - { label: 'Security', href: '#security' }, - { label: 'Pricing', href: '#pricing' }, + { label: 'Features', href: '/#features' }, + { label: 'How It Works', href: '/#how-it-works' }, + { label: 'Security', href: '/#security' }, + { label: 'Pricing', href: '/#pricing' }, ]; export default function Navbar() { @@ -18,6 +22,21 @@ export default function Navbar() { return () => window.removeEventListener('scroll', onScroll); }, []); + // While the sheet is open the page behind it must not scroll — otherwise + // the content slides around under a menu that looks fixed. Escape closes it, + // because a panel you can open from the keyboard you must be able to leave. + useEffect(() => { + if (!mobileOpen) return; + const prev = document.body.style.overflow; + document.body.style.overflow = 'hidden'; + const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') setMobileOpen(false); }; + window.addEventListener('keydown', onKey); + return () => { + document.body.style.overflow = prev; + window.removeEventListener('keydown', onKey); + }; + }, [mobileOpen]); + return (
    - {/* ── Mobile menu ── */} - {mobileOpen && ( -
    + {/* ── Mobile menu ── + Kept mounted and toggled with classes rather than conditionally + rendered, so it animates on the way out as well as in — a panel that + slides open and then vanishes reads as broken. The scrim dims the page + behind it and closes on tap. */} +
    setMobileOpen(false)} + aria-hidden="true" + className={`md:hidden fixed inset-0 top-[72px] bg-brand-900/20 transition-opacity duration-200 ${ + mobileOpen ? 'opacity-100' : 'opacity-0 pointer-events-none' + }`} + /> +
    {links.map((l) => (
    -
    - )} +
    ); } diff --git a/src/components/landing/PainPoints.tsx b/src/components/landing/PainPoints.tsx index 324bcb5..6592c66 100644 --- a/src/components/landing/PainPoints.tsx +++ b/src/components/landing/PainPoints.tsx @@ -30,7 +30,7 @@ export default function PainPoints() {

    Your invoices are costing you more than you think

    -

    +

    Food service teams lose thousands every month to invisible inefficiencies.

    @@ -45,7 +45,7 @@ export default function PainPoints() {

    {p.title}

    -

    {p.desc}

    +

    {p.desc}

    ))} diff --git a/src/components/landing/Pricing.tsx b/src/components/landing/Pricing.tsx index 7c78df4..977e367 100644 --- a/src/components/landing/Pricing.tsx +++ b/src/components/landing/Pricing.tsx @@ -11,7 +11,7 @@ const plans = [ cta: 'Start Free Trial', href: '/app', featured: false, - items: ['1 location', '3 team members', '200 invoices / month', 'AI extraction + GL coding', 'Price spike alerts', 'CSV export', 'Email support'], + items: ['1 location', '3 team members', '200 invoices / month', 'AI extraction + GL coding', 'Price change detection', 'PDF + CSV export', 'Email support'], }, { name: 'Professional', @@ -20,7 +20,7 @@ const plans = [ cta: 'Start Free Trial', href: '/app', featured: true, - items: ['Up to 5 locations', '15 team members', '1,000 invoices / month', 'Everything in Starter', 'QuickBooks integration', 'Spend analytics dashboard', 'Approval workflows', 'Priority support'], + items: ['Up to 5 locations', '15 team members', '1,000 invoices / month', 'Everything in Starter', 'Spend analytics dashboard', 'Duplicate invoice detection', 'Per-location access control', 'Priority support'], }, { name: 'Enterprise', @@ -29,7 +29,7 @@ const plans = [ cta: 'Book a Demo', href: DEMO_BOOKING_URL, featured: false, - items: ['Unlimited locations', 'Unlimited team members', 'Unlimited invoices', 'Everything in Professional', 'SSO / SAML integration', 'API access', 'Vendor EDI connections', 'Dedicated account manager', 'Custom onboarding'], + items: ['Unlimited locations', 'Unlimited team members', 'Unlimited invoices', 'Everything in Professional', 'Custom integrations, scoped with you', 'Signed DPA + security review support', 'Dedicated account manager', 'Custom onboarding'], }, ]; @@ -43,19 +43,19 @@ export default function Pricing() {

    Pricing

    Simple pricing. No surprises.

    -

    Start free for 15 days. No credit card required.

    +

    Start free for 15 days. No credit card required.

    - Monthly + Monthly - + YearlySave 20%
    @@ -78,13 +78,13 @@ export default function Pricing() {

    {p.name}

    -

    {p.desc}

    +

    {p.desc}

    {p.price.monthly !== null ? (
    ${yearly ? p.price.yearly : p.price.monthly} - /month + /month
    ) : (
    Custom
    @@ -96,7 +96,7 @@ export default function Pricing() { {...(p.href.startsWith('http') ? { target: '_blank', rel: 'noopener noreferrer' } : {})} - className={`block w-full text-center py-3 rounded-xl text-sm font-semibold transition-all ${ + className={`press block w-full text-center py-3 rounded-xl text-sm font-semibold ${ p.featured ? 'bg-brand-600 text-cream hover:bg-brand-700 shadow-lg shadow-brand-600/25' : 'bg-brand-900 text-cream hover:bg-brand-800' }`} > @@ -107,7 +107,7 @@ export default function Pricing() { {p.items.map((item, j) => (
  • - {item} + {item}
  • ))} diff --git a/src/components/landing/Security.tsx b/src/components/landing/Security.tsx index 931e4d5..954cc60 100644 --- a/src/components/landing/Security.tsx +++ b/src/components/landing/Security.tsx @@ -19,7 +19,7 @@ export default function Security() { const ref = useReveal(); return ( -
    +
    @@ -34,7 +34,7 @@ export default function Security() {

    Your data is safer here than in a filing cabinet

    -

    +

    Built from day one for multi-tenant food service organizations that answer to auditors, controllers, and compliance teams.

    @@ -50,7 +50,7 @@ export default function Security() {

    {b.label}

    -

    {b.desc}

    +

    {b.desc}

    ))} diff --git a/src/components/landing/Stats.tsx b/src/components/landing/Stats.tsx index daa4a21..548fb7a 100644 --- a/src/components/landing/Stats.tsx +++ b/src/components/landing/Stats.tsx @@ -1,9 +1,13 @@ import { useReveal } from '../../hooks/useReveal'; +// Each of these is a fact a buyer can check, not a figure they have to trust. +// This row used to claim "98% AI extraction accuracy" and "10+ hrs saved per +// week, per team" — neither was measured, and an unsourced number is the first +// thing a careful buyer asks about and the last thing you want to defend. const stats = [ - { value: '< 60s', label: 'Invoice processing time' }, - { value: '98%', label: 'AI extraction accuracy' }, - { value: '10+ hrs', label: 'Saved per week, per team' }, + { value: '< 60s', label: 'To code a typical invoice' }, + { value: '0', label: 'Invoice images stored' }, + { value: '15 days', label: 'Free trial, no card' }, { value: '$0', label: 'Setup fee' }, ]; @@ -17,7 +21,7 @@ export default function Stats() { {stats.map((s, i) => (

    {s.value}

    -

    {s.label}

    +

    {s.label}

    ))}
    diff --git a/src/components/legal/LegalLayout.tsx b/src/components/legal/LegalLayout.tsx index 1235cbf..06d9e3a 100644 --- a/src/components/legal/LegalLayout.tsx +++ b/src/components/legal/LegalLayout.tsx @@ -2,6 +2,7 @@ import { ReactNode } from 'react'; import { Printer } from 'lucide-react'; import Navbar from '../landing/Navbar'; import Footer from '../landing/Footer'; +import { useDocumentTitle } from '../../hooks/useDocumentTitle'; // Shared chrome for the policy pages (/privacy, /terms, /security, /dpa). // One place for the measure, the type scale and the "last updated" stamp, so @@ -18,6 +19,8 @@ interface Props { } export default function LegalLayout({ eyebrow, title, updated, summary, children }: Props) { + useDocumentTitle(title); + return ( <>
    diff --git a/src/hooks/useDocumentTitle.ts b/src/hooks/useDocumentTitle.ts new file mode 100644 index 0000000..9f6c601 --- /dev/null +++ b/src/hooks/useDocumentTitle.ts @@ -0,0 +1,20 @@ +import { useEffect } from 'react'; + +const SITE = 'ChefCode.ai'; + +/** + * Sets the browser tab title for a page, and restores the previous one on + * unmount. Every route used to share index.html's title, so a reviewer with + * Privacy, Terms and the Security Overview open in three tabs saw three + * identical tabs — and a bookmark or history entry could not say which page it + * was. Pass the page name only; the site name is appended. + */ +export function useDocumentTitle(page?: string) { + useEffect(() => { + const previous = document.title; + document.title = page ? `${page} — ${SITE}` : `${SITE} — AI Invoice Coding`; + return () => { + document.title = previous; + }; + }, [page]); +} diff --git a/src/index.css b/src/index.css index 3b4dc5d..40f04a6 100644 --- a/src/index.css +++ b/src/index.css @@ -75,6 +75,60 @@ body { ::-webkit-scrollbar-thumb { background: #c7bb91; border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: #157559; } +/* ── Focus visibility ────────────────────────────── */ +/* Nothing in the site defined a focus style, so Tailwind's preflight reset + left keyboard users with no visible focus at all (outline-style computed to + `none` on every button and link). The ring colour is a variable so dark + sections can flip it to a light tone — a green ring on brand-900 is + invisible, which would have been the same bug in a different costume. */ +:root { --focus-ring: #0e4a39; } + +:focus-visible { + outline: 2px solid var(--focus-ring); + outline-offset: 2px; + border-radius: 2px; +} + +/* Dark regions: the security band and the final CTA card. */ +.on-dark { --focus-ring: #d6ebe0; } + +/* ── Press feedback ──────────────────────────────── */ +/* Feedback belongs on pointer-down, not on release. Without this a tap on a + phone gives no acknowledgement at all until the next page paints. */ +.press { + transition: transform 100ms ease-out, background-color 150ms ease-out, + border-color 150ms ease-out, color 150ms ease-out; +} +.press:active { transform: scale(0.97); } + +/* ── Reduced motion ──────────────────────────────── */ +/* Reduced motion means a gentler equivalent, not nothing: the reveal still + cross-fades so content arrival stays legible, it just stops travelling. */ +@media (prefers-reduced-motion: reduce) { + html { scroll-behavior: auto; } + + .reveal { transition: opacity 200ms ease !important; } + .reveal.reveal-ready { transform: none !important; } + + .press:active { transform: none; opacity: 0.85; } + + /* Kill decorative looping animations and any transform-based movement, + while leaving colour and opacity transitions that aid comprehension. */ + .scan-line, .animate-float, .animate-pulse-slow, .animate-scan { animation: none !important; } + .animate-fade-in-down, .animate-fade-in-up, .animate-fade-in, + .animate-slide-in-left, .animate-slide-in-right, .animate-scale-in { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + } + *, *::before, *::after { scroll-behavior: auto !important; } +} + +/* ── Reduced transparency ────────────────────────── */ +@media (prefers-reduced-transparency: reduce) { + .backdrop-blur-lg, .backdrop-blur { backdrop-filter: none !important; } + nav.bg-cream\/85 { background-color: #faf6e8 !important; } +} + /* ── Policy pages: printing / "Save as PDF" ──────── */ /* Reviewers attach these to a vendor file, so the printed copy drops the site chrome, prints black-on-white, and shows link targets inline. */ diff --git a/src/pages/DataProcessing.tsx b/src/pages/DataProcessing.tsx index d80fc60..62216be 100644 --- a/src/pages/DataProcessing.tsx +++ b/src/pages/DataProcessing.tsx @@ -59,6 +59,7 @@ export default function DataProcessing() { ['Google LLC', 'Invoice text extraction (Gemini API)', 'The uploaded invoice document only', 'United States'], ['Vercel', 'Application hosting and CDN', 'Request metadata including IP address', 'Global edge, United States origin'], ['Google LLC', 'Web font delivery', 'IP address at page load', 'Global edge'], + ['Unsplash', 'Image delivery on the sign-in screen', 'IP address when the sign-in screen loads', 'Global edge'], ]} /> diff --git a/src/pages/LandingPage.tsx b/src/pages/LandingPage.tsx index e2a430a..818f774 100644 --- a/src/pages/LandingPage.tsx +++ b/src/pages/LandingPage.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import Navbar from '../components/landing/Navbar'; import Hero from '../components/landing/Hero'; import PainPoints from '../components/landing/PainPoints'; @@ -8,8 +9,56 @@ import Security from '../components/landing/Security'; import Pricing from '../components/landing/Pricing'; import FinalCTA from '../components/landing/FinalCTA'; import Footer from '../components/landing/Footer'; +import { useDocumentTitle } from '../hooks/useDocumentTitle'; export default function LandingPage() { + useDocumentTitle(); + + // Honour the #anchor on arrival. This page is lazy-loaded, so when a visitor + // lands on /#pricing the browser attempts its native jump before the section + // exists, finds nothing, and leaves them at the top. That broke every + // "/#features"-style link from the other pages, the footer, and any link to + // a section pasted into an email. Runs once, after the sections are in the + // DOM; an instant jump is right for arrival — smooth-scrolling down from the + // hero on page load would just be motion for its own sake. + // + // Two details that matter: + // - behavior is explicit. Left out, scrollIntoView inherits the page's + // `scroll-behavior: smooth`, and a 4,700px glide needs animation frames to + // advance — so in a tab that isn't painting yet (opened in the background + // from an email) it simply never moves. + // - the jump is synchronous, not deferred to a requestAnimationFrame, for + // the same reason: frames are suspended until a tab is visible. An instant + // scroll forces layout itself and needs no frame. + // + // Web fonts can land after the jump and reflow the hero above the target, + // nudging it off position, so it re-aligns once they are ready — unless the + // visitor has started scrolling, in which case they are in control and the + // page must not be yanked out from under them. + useEffect(() => { + const id = decodeURIComponent(window.location.hash.slice(1)); + if (!id) return; + + const jump = () => + document.getElementById(id)?.scrollIntoView({ block: 'start', behavior: 'instant' }); + jump(); + + let userTookOver = false; + const takeOver = () => { userTookOver = true; }; + const intents = ['wheel', 'touchmove', 'keydown', 'pointerdown'] as const; + intents.forEach((e) => window.addEventListener(e, takeOver, { passive: true })); + + let cancelled = false; + document.fonts?.ready.then(() => { + if (!cancelled && !userTookOver) jump(); + }); + + return () => { + cancelled = true; + intents.forEach((e) => window.removeEventListener(e, takeOver)); + }; + }, []); + return ( <> diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx new file mode 100644 index 0000000..39f77e0 --- /dev/null +++ b/src/pages/NotFound.tsx @@ -0,0 +1,72 @@ +import { useEffect } from 'react'; +import { ArrowLeft } from 'lucide-react'; +import Navbar from '../components/landing/Navbar'; +import Footer from '../components/landing/Footer'; +import { useDocumentTitle } from '../hooks/useDocumentTitle'; + +// Shown for any path that is not a real page. Vercel serves this with an HTTP +// 404 status (see vercel.json and the emit-404 plugin in vite.config.ts); the +// noindex tag below is a second line of defence for anything that reaches it +// with a 200. Previously every unknown URL rendered the full landing page, +// which told a mistyped visitor nothing and gave search engines an unbounded +// number of duplicate homepages. + +const destinations = [ + { label: 'Home', href: '/', note: 'What ChefCode does' }, + { label: 'Pricing', href: '/#pricing', note: 'Plans and the free trial' }, + { label: 'Setup guide', href: '/setup', note: 'From sign-up to first invoice' }, + { label: 'Security Overview', href: '/security', note: 'For your IT or compliance review' }, +]; + +export default function NotFound() { + useDocumentTitle('Page not found'); + + useEffect(() => { + const meta = document.createElement('meta'); + meta.name = 'robots'; + meta.content = 'noindex'; + document.head.appendChild(meta); + return () => meta.remove(); + }, []); + + return ( + <> + +
    +
    +

    404

    +

    + This page doesn’t exist. +

    +

    + The address {window.location.pathname}{' '} + isn’t a page on this site. It may have been mistyped, or the link that sent you here is out of date. +

    + +
    + + + + Back to the homepage + +
    +
    +
    + + ); +} diff --git a/src/pages/Privacy.tsx b/src/pages/Privacy.tsx index 943ff3e..6896ed8 100644 --- a/src/pages/Privacy.tsx +++ b/src/pages/Privacy.tsx @@ -92,6 +92,7 @@ export default function Privacy() { ['Google (Gemini API)', 'Reads the uploaded invoice', 'The invoice image or PDF, at the moment of upload'], ['Vercel', 'Serves the website and application', 'Standard web request data, including IP address'], ['Google Fonts', 'Serves the typeface used by the site', 'Your IP address when the page loads'], + ['Unsplash', 'Serves the photograph on the sign-in screen', 'Your IP address when the sign-in screen loads'], ]} /> diff --git a/src/pages/SetupGuide.tsx b/src/pages/SetupGuide.tsx index b7c182f..dccc4ce 100644 --- a/src/pages/SetupGuide.tsx +++ b/src/pages/SetupGuide.tsx @@ -1,5 +1,6 @@ import Navbar from '../components/landing/Navbar'; import Footer from '../components/landing/Footer'; +import { useDocumentTitle } from '../hooks/useDocumentTitle'; import { MapPin, ListOrdered, Building2, Database, Download, ArrowRight } from 'lucide-react'; const gather = [ @@ -27,6 +28,8 @@ const faqs = [ ]; export default function SetupGuide() { + useDocumentTitle('Setup guide'); + return ( <> @@ -35,14 +38,14 @@ export default function SetupGuide() { {/* Header */}

    Getting started

    Setup guide

    -

    +

    From sign-up to your first coded invoice in about 20 minutes. Do the steps in order — each one builds on the last.

    {/* Gather first */}
    -

    Gather these first

    +

    Gather these first

    {gather.map((g) => (
    @@ -51,7 +54,7 @@ export default function SetupGuide() {

    {g.label}

    -

    {g.note}

    +

    {g.note}

    {g.href && ( ))}
    -

    +

    The product list matters most — it teaches the AI. The fuller it is, the better it codes on day one.

    @@ -79,7 +82,7 @@ export default function SetupGuide() {

    {s.title}

    -

    {s.body}

    +

    {s.body}

    ))} @@ -104,7 +107,7 @@ export default function SetupGuide() { {faqs.map((f) => (

    {f.q}

    -

    {f.a}

    +

    {f.a}

    ))}
    diff --git a/vercel.json b/vercel.json index 0d199b2..a3977dc 100644 --- a/vercel.json +++ b/vercel.json @@ -1,5 +1,23 @@ { + "trailingSlash": false, "rewrites": [ - { "source": "/(.*)", "destination": "/index.html" } + { "source": "/app", "destination": "/index.html" }, + { "source": "/app/:path*", "destination": "/index.html" }, + { "source": "/:page(setup|privacy|terms|security|dpa)", "destination": "/index.html" } + ], + "headers": [ + { + "source": "/(.*)", + "headers": [ + { "key": "X-Content-Type-Options", "value": "nosniff" }, + { "key": "X-Frame-Options", "value": "DENY" }, + { "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }, + { "key": "Permissions-Policy", "value": "geolocation=(), microphone=(), payment=(), usb=()" }, + { + "key": "Content-Security-Policy-Report-Only", + "value": "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: blob: https://images.unsplash.com; connect-src 'self' https://*.supabase.co wss://*.supabase.co https://generativelanguage.googleapis.com; worker-src 'self' blob:; frame-ancestors 'none'; base-uri 'self'; form-action 'self'; object-src 'none'" + } + ] + } ] } diff --git a/vite.config.ts b/vite.config.ts index 377bbe5..e0bec33 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,26 @@ import path from 'path'; -import { defineConfig, loadEnv } from 'vite'; +import fs from 'fs'; +import { defineConfig, loadEnv, type Plugin } from 'vite'; import react from '@vitejs/plugin-react'; +// Vercel serves dist/404.html, with a real HTTP 404 status, for any path that +// matches neither a static file nor a rewrite in vercel.json. Making that file +// a copy of the built index.html means the 404 page is the full app — navbar, +// brand, the router's NotFound view — rather than a bare static page. It has to +// be copied after the build, because index.html references hashed asset names +// that only exist once Vite has finished. +function emitNotFoundPage(): Plugin { + return { + name: 'emit-404', + apply: 'build', + closeBundle() { + const out = path.resolve(__dirname, 'dist'); + const index = path.join(out, 'index.html'); + if (fs.existsSync(index)) fs.copyFileSync(index, path.join(out, '404.html')); + }, + }; +} + export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), ''); const apiKey = process.env.GEMINI_API_KEY || process.env.API_KEY || env.GEMINI_API_KEY || env.API_KEY || ''; @@ -10,7 +29,7 @@ export default defineConfig(({ mode }) => { port: 3000, host: '0.0.0.0', }, - plugins: [react()], + plugins: [react(), emitNotFoundPage()], define: { 'process.env.API_KEY': JSON.stringify(apiKey), 'process.env.GEMINI_API_KEY': JSON.stringify(apiKey)