import type { Metadata } from "next";
import Link from "next/link";
import SiteHeader from "../components/SiteHeader";
import {
  SITE_URL,
  SOURCE_ARCHIVE_URL,
  SOURCE_CHECKSUM_URL,
  SOURCE_LICENSE_URL,
  SOURCE_RELEASE,
  SOURCE_REPOSITORY_URL,
} from "../lib/site";

export const metadata: Metadata = {
  title: {
    absolute: "Privacy & Public Source | Toshin Samuels",
  },
  description:
    "How ToshinSamuels.com minimizes data collection, avoids visitor tracking, publishes release source code, and explains the limits of public-source inspection.",
  alternates: { canonical: "/privacy-and-source" },
  openGraph: {
    title: "Privacy & Public Source | Toshin Samuels",
    description:
      "No accounts, no forms, no advertising, no behavioral analytics, and public release source for independent inspection.",
    url: `${SITE_URL}/privacy-and-source`,
    siteName: "Toshin Samuels",
    type: "website",
  },
  twitter: {
    card: "summary",
    title: "Privacy & Public Source | Toshin Samuels",
    description:
      "No accounts, no forms, no advertising, no behavioral analytics, and public release source for independent inspection.",
  },
};

const privacyPromises = [
  {
    title: "No visitor accounts",
    text: "You do not need to create an account, sign in, or provide a name, email address, phone number, or password to use this website.",
  },
  {
    title: "No contact forms or uploads",
    text: "This website does not ask visitors to submit messages, résumés, documents, photographs, financial details, health information, or other personal records through a first-party form.",
  },
  {
    title: "No advertising or behavioral analytics",
    text: "The published application does not intentionally include advertising pixels, behavioral profiling, session replay, browser fingerprinting, first-party analytics, or tracking cookies.",
  },
  {
    title: "No sale of visitor information",
    text: "ToshinSamuels.com does not sell visitor information or build advertising profiles about people who use these public-service resources.",
  },
];

export default function PrivacyAndSourcePage() {
  return (
    <main>
      <SiteHeader />

      <section className="privacy-source-hero">
        <div className="privacy-source-inner">
          <p className="section-label">Privacy &amp; Public Source</p>
          <h1>Public service should be inspectable.</h1>
          <p className="large-copy">
            ToshinSamuels.com is designed to provide educational information
            and public-service resources without turning visitors into a data
            product.
          </p>
        </div>
      </section>

      <section className="letter-section section">
        <article className="letter-card">
          <p className="section-label">What This Site Does Not Ask For</p>
          <h2>Use the resources without surrendering personal information.</h2>

          <div className="privacy-promise-list">
            {privacyPromises.map((promise, index) => (
              <article className="privacy-promise" key={promise.title}>
                <span aria-hidden="true">
                  {String(index + 1).padStart(2, "0")}
                </span>
                <div>
                  <h3>{promise.title}</h3>
                  <p>{promise.text}</p>
                </div>
              </article>
            ))}
          </div>

          <div className="disclosure-callout">
            <h3>Important technical limitation</h3>
            <p>
              It would be inaccurate to promise that no information is ever
              processed anywhere when a person visits a website. Hosting,
              network, security, domain, and internet-service providers may
              process limited technical information such as IP addresses,
              browser details, timestamps, requested pages, and security logs
              to deliver and protect the site. Those systems are not controlled
              entirely by ToshinSamuels.com.
            </p>
          </div>
        </article>
      </section>

      <section className="promise-section section">
        <div className="narrow">
          <p className="section-label">Public Release Source</p>
          <h2>Inspect the code behind the published site.</h2>
          <p className="large-copy">
            The application source for release {SOURCE_RELEASE} is published
            for public inspection under the MIT License. Original writing,
            books, photographs, logos, trademarks, and other non-code content
            are not placed under that software license unless separately
            stated.
          </p>

          <div className="source-action-grid">
            <a href={SOURCE_ARCHIVE_URL} className="source-action" download>
              <span>Release source</span>
              <strong>Download the source archive</strong>
            </a>
            <a href={SOURCE_CHECKSUM_URL} className="source-action" download>
              <span>Integrity record</span>
              <strong>Download the SHA-256 checksum</strong>
            </a>
            <a href={SOURCE_LICENSE_URL} className="source-action">
              <span>Software license</span>
              <strong>Read the open-source license</strong>
            </a>
            {SOURCE_REPOSITORY_URL ? (
              <a
                href={SOURCE_REPOSITORY_URL}
                target="_blank"
                rel="noopener noreferrer"
                className="source-action"
              >
                <span>Public repository</span>
                <strong>Inspect the source on GitHub ↗</strong>
              </a>
            ) : (
              <div className="source-action source-action-pending">
                <span>Public repository</span>
                <strong>GitHub mirror awaiting publication</strong>
              </div>
            )}
          </div>

          <div className="disclosure-callout">
            <h3>What public source can—and cannot—prove</h3>
            <p>
              Public source allows anyone to inspect the application code,
              dependencies, configuration, and published release materials. It
              does not prove that software is permanently free from every bug,
              vulnerable dependency, supply-chain risk, server compromise, or
              future unauthorized change. Visitors and independent reviewers
              should evaluate the source, checksum, hosting behavior, network
              requests, and release history together.
            </p>
            <p>
              The published code is not intended to contain malware, spyware,
              hidden tracking, credential theft, or other malicious behavior.
              A discovered concern should be reported through the public
              repository once it is available.
            </p>
          </div>
        </div>
      </section>

      <section className="letter-section section">
        <article className="letter-card">
          <p className="section-label">Outside Links</p>
          <h2>Another website begins when you choose to leave this one.</h2>
          <p className="large-copy">
            ToshinSamuels.com links to government agencies, nonprofit
            organizations, support services, educational providers, social
            profiles, Amazon Author Central, Overcomers Society, and other
            external destinations.
          </p>
          <p>
            Following an external link means the destination may receive the
            ordinary technical information associated with visiting its site
            and may apply its own cookies, analytics, accounts, forms, payment
            systems, and privacy policies. ToshinSamuels.com does not control
            those third-party practices.
          </p>
          <p>
            The site avoids embedded third-party advertising and behavioral
            tracking so that outside services are generally contacted only
            after a visitor deliberately follows a link.
          </p>

          <div className="privacy-page-links">
            <Link href="/" className="primary-button">
              Return to Find Help
            </Link>
            <Link href="/about" className="primary-button">
              About Toshin and This Work
            </Link>
          </div>
        </article>
      </section>

      <section className="story-transition">
        <p>Transparency is part of the public service.</p>
      </section>
    </main>
  );
}
