//  File:    page.tsx
//  Path:    apps/web/app/terms/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: Terms of Service.

export const metadata = {
  title: "Terms of Service — 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 TermsPage(): 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">Terms of Service</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)]">
        The AI Risk Index website and API (the "Service", at www.airiskindex.io) are operated by{" "}
        <strong className="text-[var(--ink)]">Simon-Pierre Boucher</strong> ("we", "us"). By
        accessing the Service you agree to these terms. Contact for any question, including
        contracts and licensing:{" "}
        <a href="mailto:contact@spboucher.ai" className="underline">
          contact@spboucher.ai
        </a>
        .
      </p>

      <Section title="1. What the Service is">
        <p>
          The Service publishes research-grade estimates of occupational exposure to AI, computed
          from public occupational data and model-based task ratings under a documented,
          versioned methodology. Scores are statistical claims with confidence intervals — they
          describe task-level pressure, not the future of any individual's job.
        </p>
      </Section>

      <Section title="2. Not professional advice">
        <p>
          Nothing on the Service is career, financial, legal, or employment advice. Scores must
          not be used as the sole basis for employment decisions about identifiable individuals —
          including hiring, dismissal, promotion, compensation, or automated screening. If you
          use the data in decision systems, you are responsible for compliance with applicable
          employment and AI regulations in your jurisdiction.
        </p>
      </Section>

      <Section title="3. Accuracy and warranties">
        <p>
          The Service is provided "as is" and "as available", without warranty of any kind,
          express or implied, including merchantability, fitness for a particular purpose, and
          non-infringement. Model-based ratings contain errors by nature; confidence intervals
          quantify part of that uncertainty, not all of it. We may correct, recompute, or
          re-version scores at any time; historical runs remain identified by version.
        </p>
      </Section>

      <Section title="4. API use">
        <p>
          The public API is rate-limited (currently 60 requests/minute unauthenticated; higher
          limits with an API key). You may not circumvent rate limits, resell raw API access, or
          misrepresent Service data as your own measurements. Breaking changes are only introduced
          under new API versions.
        </p>
      </Section>

      <Section title="5. Licenses and attribution">
        <p>
          Scores and derived datasets are licensed under{" "}
          <a href="https://creativecommons.org/licenses/by/4.0/" className="underline">
            CC BY 4.0
          </a>
          : reuse, redistribution and commercial use are permitted with attribution to "AI Risk
          Index (airiskindex.io)" and the index version. Site design and text are ©{" "}
          Simon-Pierre Boucher. The Service incorporates the O*NET® database (U.S. Department of
          Labor, Employment and Training Administration, CC BY 4.0) and BLS OEWS data; O*NET® is a
          trademark of USDOL/ETA, which has not reviewed or endorsed this Service.
        </p>
      </Section>

      <Section title="6. Acceptable use">
        <p>
          You agree not to: disrupt or overload the Service; probe or breach its security; scrape
          at rates exceeding the API limits when an API exists for the purpose; or use the Service
          to produce deceptive content that misattributes claims to us.
        </p>
      </Section>

      <Section title="7. Limitation of liability">
        <p>
          To the maximum extent permitted by law, we are not liable for indirect, incidental,
          special, consequential or punitive damages, nor for lost profits, revenues, data or
          goodwill, arising from use of the Service. Our aggregate liability for any claim is
          limited to one hundred Canadian dollars (CAD 100). Some jurisdictions do not allow
          certain exclusions; where they apply, these limits apply to the fullest extent
          permitted.
        </p>
      </Section>

      <Section title="8. Changes and termination">
        <p>
          We may modify or discontinue the Service, or update these terms, at any time; material
          changes are indicated by the effective date above. Continued use after a change
          constitutes acceptance. We may suspend access that violates these terms.
        </p>
      </Section>

      <Section title="9. Governing law">
        <p>
          These terms are governed by the laws of the Province of Québec and the federal laws of
          Canada applicable therein. Disputes are subject to the exclusive jurisdiction of the
          courts of Québec, Canada.
        </p>
      </Section>

      <Section title="10. Contact">
        <p>
          Simon-Pierre Boucher —{" "}
          <a href="mailto:contact@spboucher.ai" className="underline">
            contact@spboucher.ai
          </a>{" "}
          (including commercial licensing, data partnerships and contracts).
        </p>
      </Section>
    </main>
  );
}
