import type { Metadata } from "next";
import { InnerPage, StructuredData } from "@/components/SiteChrome";
import { breadcrumbJsonLd } from "@/lib/site";

export const metadata: Metadata = {
  title: "Privacy Policy",
  description: "What Clipwell processes when you paste a TikTok link or use the contact form, and what it does not store.",
  alternates: { canonical: "/privacy-policy" },
  openGraph: { title: "Privacy Policy", description: "How Clipwell handles links, rate-limit data, and contact messages.", url: "/privacy-policy" },
};

export default function PrivacyPage() {
  return (
    <main id="main">
      <StructuredData
        data={breadcrumbJsonLd([{ name: "Home", path: "/" }, { name: "Privacy Policy", path: "/privacy-policy" }])}
      />
      <InnerPage title="Privacy Policy" lede="This policy describes the data Clipwell handles to run the downloader and the contact form.">
        <h2>The link you paste</h2>
        <p>
          The TikTok URL is sent to this website’s server so it can be checked and, when a media service is configured, forwarded to that service. The server does not need your TikTok password. Tracking parameters such as utm tags are removed from the link before it is used.
        </p>
        <h2>Rate limiting</h2>
        <p>
          The server may use your IP address, or a shared bucket when it is not behind a trusted proxy, to limit how many requests one visitor can make. That value is kept in memory for the limit window and is not written to an account database. Clipwell does not have user accounts.
        </p>
        <h2>Files</h2>
        <p>
          Media is streamed to your browser when you choose a download. Clipwell does not keep a library of downloaded videos. Download links are signed and expire after a short time.
        </p>
        <h2>Contact form</h2>
        <p>
          If you send the contact form, the name, email, and message are delivered only when the operator has configured an inbox webhook. Otherwise the form can open your own email app, or it tells you that delivery is not configured. Messages are not stored in this application.
        </p>
        <h2>Cookies, ads, and analytics</h2>
        <p>The site does not set analytics cookies and does not include advertising scripts. A hosting provider may keep ordinary server logs.</p>
        <h2>Media service</h2>
        <p>
          By default the server sends the public TikTok link to tikwm.com, which returns file addresses for that post. Clipwell then downloads those files from TikTok’s public media hosts. It does not receive your TikTok password. If that lookup fails, the server may request the public TikTok page directly. If the operator configures a Cobalt instance instead, that service receives the link and tikwm.com is not called.
        </p>
      </InnerPage>
    </main>
  );
}
