import { pageMetadata } from '@/lib/seo';

export const metadata = pageMetadata({
  title: 'Terms',
  description:
    'BuildMyMCPServer terms of service — the agreement that governs use of the platform.',
  path: '/terms',
});

const SECTIONS = [
  {
    h: '1. The service',
    p: 'BuildMyMCPServer ("we", "us") lets you turn natural-language prompts into hosted Model Context Protocol (MCP) servers. You ("you") are the customer.',
  },
  {
    h: '2. Acceptable use',
    p: 'You will not use the service to build servers that violate applicable law, infringe third-party rights, or facilitate abuse. You retain responsibility for what your servers do with the credentials you provide to them.',
  },
  {
    h: '3. Generated code',
    p: 'Code we generate on your behalf is yours. You may export, modify, or self-host it. You also accept that LLM-generated code may contain bugs, and you are responsible for reviewing it before relying on it for critical workloads.',
  },
  {
    h: '4. Your credentials',
    p: 'Any API keys or secrets you upload are encrypted at rest and used only to run your servers. You warrant you have the right to use the credentials you upload.',
  },
  {
    h: '5. Service availability',
    p: 'Free and Pro plans are best-effort. Team plan carries a 99.9% monthly uptime SLA with service credits as the sole remedy. Enterprise SLAs are negotiated separately.',
  },
  {
    h: '6. Billing',
    p: 'Paid plans bill monthly via Stripe in advance. Metered overage bills the month following accrual. You can cancel any time; refunds are pro-rated only for service outages we acknowledge.',
  },
  {
    h: '7. Termination',
    p: 'Either party may terminate for material breach with 30 days written notice. We may suspend without notice for security incidents, payment failures over 14 days, or violations of section 2.',
  },
  {
    h: '8. Liability',
    p: 'To the maximum extent permitted by law, our aggregate liability is capped at the fees you paid us in the 12 months preceding the event. Neither party is liable for indirect or consequential damages.',
  },
  {
    h: '9. Changes',
    p: 'We may update these terms; we will notify you 30 days before a material change takes effect. Your continued use after that date constitutes acceptance.',
  },
  {
    h: '10. Governing law',
    p: 'These terms are governed by the laws of Germany. Exclusive jurisdiction is Berlin.',
  },
];

export default function Terms() {
  return (
    <div className="mx-auto max-w-3xl px-6 py-16">
      <header className="mb-12">
        <div className="text-[11px] uppercase tracking-[0.16em] text-[--color-fg-subtle]">
          Terms of service
        </div>
        <h1 className="mt-2 text-[32px] font-semibold tracking-tight">Terms</h1>
        <p className="mt-3 text-[14px] leading-relaxed text-[--color-fg-muted]">
          Boring on purpose. Last updated 2026-05-19.
        </p>
      </header>

      <div className="space-y-7">
        {SECTIONS.map((s) => (
          <section key={s.h}>
            <h2 className="text-[15px] font-semibold tracking-tight">{s.h}</h2>
            <p className="mt-2 text-[13.5px] leading-relaxed text-[--color-fg-muted]">{s.p}</p>
          </section>
        ))}
        <section>
          <h2 className="text-[15px] font-semibold tracking-tight">Questions</h2>
          <p className="mt-2 text-[13.5px] leading-relaxed text-[--color-fg-muted]">
            <a className="text-[--color-accent] underline" href="mailto:legal@buildmymcpserver.com">
              legal@buildmymcpserver.com
            </a>
          </p>
        </section>
      </div>
    </div>
  );
}
