//  File:    page.tsx
//  Path:    apps/web/app/privacy/page.tsx
//  Project: AI Risk Index — airiskindex.io
//  Author:  Simon-Pierre Boucher
//  Contact: contact@spboucher.ai
//  Copyright © 2026 Simon-Pierre Boucher. All rights reserved.
//
//  Description: Privacy Policy.

export const metadata = {
  title: "Privacy Policy — AI Risk Index",
};

function Section({ title, children }: { title: string; children: React.ReactNode }): JSX.Element {
  return (
    <section className="mt-8">
      <h2 className="text-xl font-semibold tracking-tight">{title}</h2>
      <div className="mt-3 space-y-3 leading-relaxed text-[var(--ink-2)]">{children}</div>
    </section>
  );
}

export default function PrivacyPage(): JSX.Element {
  return (
    <main className="mx-auto max-w-3xl px-4 py-10 sm:px-6 sm:py-14">
      <h1 className="text-4xl font-bold tracking-tight">Privacy Policy</h1>
      <p className="mt-3 text-sm text-[var(--muted)]">Effective date: August 5, 2026</p>
      <p className="mt-4 leading-relaxed text-[var(--ink-2)]">
        This policy describes how the AI Risk Index (www.airiskindex.io), operated by{" "}
        <strong className="text-[var(--ink)]">Simon-Pierre Boucher</strong>, handles personal
        information. The short version: the site works without an account, we collect almost
        nothing, we track nobody, and we sell nothing.
      </p>

      <Section title="1. What we collect">
        <ul className="list-inside list-disc space-y-2">
          <li>
            <strong className="text-[var(--ink)]">Server and access logs</strong> — IP address,
            user agent, requested URL and timestamp, kept for security, debugging and rate
            limiting, and routinely deleted within 30 days.
          </li>
          <li>
            <strong className="text-[var(--ink)]">API keys</strong> — if you request one, we store
            your contact email and a hashed key. We never store keys in plaintext.
          </li>
          <li>
            <strong className="text-[var(--ink)]">Email</strong> — if you write to us, we keep the
            correspondence for as long as needed to handle it.
          </li>
        </ul>
        <p>
          We do not use advertising trackers or third-party analytics, we set no cookies for
          browsing, and we do not profile visitors. Occupation pages you view are not linked to
          you.
        </p>
      </Section>

      <Section title="2. What we don't do">
        <p>
          We do not sell, rent or share personal information with third parties for their own
          purposes. We do not use your data to train models. Occupation scores are computed from
          public occupational data — never from visitor data.
        </p>
      </Section>

      <Section title="3. Infrastructure providers">
        <p>
          Traffic to the site transits through our tunnel/edge provider (ngrok) to our servers;
          their systems process connection metadata as any network carrier does. No visitor data
          is sent to AI model providers — model APIs are used only to rate public occupational
          task statements.
        </p>
      </Section>

      <Section title="4. Your rights">
        <p>
          Under Québec's Act respecting the protection of personal information in the private
          sector (Law 25), the GDPR where it applies, and similar laws, you may request access to,
          correction of, or deletion of personal information we hold about you (in practice: log
          entries, an API key record, or email correspondence). Write to{" "}
          <a href="mailto:contact@spboucher.ai" className="underline">
            contact@spboucher.ai
          </a>{" "}
          and we will respond within 30 days.
        </p>
      </Section>

      <Section title="5. Data location and security">
        <p>
          Data is processed on servers under our control (Canada) and protected by access
          controls, key hashing and encrypted transport (HTTPS). No system is perfectly secure; we
          keep the collected surface deliberately minimal so there is little to lose.
        </p>
      </Section>

      <Section title="6. Changes">
        <p>
          Material changes to this policy are indicated by the effective date above. The person
          responsible for the protection of personal information is Simon-Pierre Boucher —{" "}
          <a href="mailto:contact@spboucher.ai" className="underline">
            contact@spboucher.ai
          </a>
          .
        </p>
      </Section>
    </main>
  );
}
