import type { Metadata } from 'next';

export const metadata: Metadata = {
  title: 'Privacy Policy — Vaultfire',
  description:
    'How Vaultfire handles your data. Privacy over surveillance. We collect as little as possible and never sell your data.',
};

export const dynamic = 'force-static';

export default function PrivacyPage() {
  return (
    <main className="min-h-screen bg-[var(--color-ember-bg)] text-[var(--color-ember-text)] px-6 py-12">
      <div className="max-w-3xl mx-auto">
        <a
          href="/"
          className="text-sm text-[var(--color-ember-text-muted)] hover:text-white transition-colors"
        >
          ← theloopbreaker.com
        </a>

        <h1 className="mt-6 text-4xl md:text-5xl font-bold">Privacy Policy</h1>
        <p className="mt-3 text-sm text-[var(--color-ember-text-muted)]">
          Effective Date: April 27, 2026 · Last Updated: April 27, 2026
        </p>

        <div className="mt-6 rounded-xl border border-[#10B981]/40 bg-[#10B981]/5 p-5">
          <p className="text-sm text-[#34D399] font-semibold mb-2">Our stance</p>
          <p className="text-sm leading-relaxed">
            Vaultfire&apos;s mission includes &ldquo;privacy over surveillance&rdquo;
            and &ldquo;humanity over everything.&rdquo; This policy reflects that. We
            collect as little as possible, share even less, and design the Service to
            be useful without identifying you. We are the opposite of identity
            verification — we do not ask for your name, government ID, address, date
            of birth, or any identity documents.
          </p>
        </div>

        <Section title="1. What we collect">
          <h3 className="font-semibold mt-2">Information you provide directly</h3>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>
              <strong>Wallet address.</strong> When you connect a wallet, we see the
              public address. This is necessary to interact with the smart contracts.
            </li>
            <li>
              <strong>Email address (optional).</strong> Only if you contact us, opt
              into updates, or use a feature that explicitly asks for it. We do not
              require email to use the protocol.
            </li>
            <li>
              <strong>Content you submit.</strong> Anything you publish through the
              Service (agent metadata, dispute claims, profile fields).
            </li>
          </ul>

          <h3 className="font-semibold mt-4">Information collected automatically</h3>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>
              <strong>Server logs.</strong> Standard logs may record IP, user agent,
              request path, timestamp, and response code. Used for security,
              debugging, and rate-limiting. Retained ~30 days.
            </li>
            <li>
              <strong>Local browser storage.</strong> We may use{' '}
              <code>localStorage</code> for preferences (e.g., selected chain). This
              data stays on your device.
            </li>
            <li>
              <strong>Cookies.</strong> Only essential cookies for the Service to
              function. We do <strong>not</strong> use advertising cookies,
              third-party analytics, or cross-site tracking.
            </li>
          </ul>

          <h3 className="font-semibold mt-4">Information from public blockchains</h3>
          <p className="mt-2">
            The blockchains we interact with (Base, Avalanche, Arbitrum, Polygon) are
            public ledgers. Transactions involving your wallet — bond posts, dispute
            filings, registrations — are publicly visible to anyone, forever. We do
            not control this; it is an inherent property of public blockchains.
          </p>

          <h3 className="font-semibold mt-4">What we do NOT collect</h3>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>Government-issued identification</li>
            <li>Social Security numbers or tax IDs</li>
            <li>Date of birth, full legal name, or home address (unless you voluntarily provide it for support)</li>
            <li>Biometrics</li>
            <li>Browsing history outside the Service</li>
            <li>Behavioral profiles for advertising</li>
          </ul>
        </Section>

        <Section title="2. How we use information">
          <p>We use information only to:</p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>Operate, maintain, and improve the Service</li>
            <li>Respond to your inquiries and provide support</li>
            <li>Detect, prevent, and address security incidents, fraud, and abuse</li>
            <li>Comply with legal obligations</li>
            <li>
              Enforce our <A href="/terms">Terms of Service</A>
            </li>
          </ul>
          <p className="mt-3 font-semibold">
            We do not sell your personal information. We do not use your data to train
            AI models without explicit consent. We do not share your data with
            advertisers.
          </p>
        </Section>

        <Section title="3. Sharing of information">
          <p>We share information only with:</p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>
              <strong>Service providers</strong> who help us operate the Service
              (hosting, RPC providers, email delivery). Bound by confidentiality and
              data-protection obligations.
            </li>
            <li>
              <strong>Public blockchains</strong> — your on-chain interactions are
              inherently public.
            </li>
            <li>
              <strong>Legal authorities</strong> if required by valid legal process,
              and only to the minimum extent required.
            </li>
          </ul>
          <p className="mt-3">
            We do not share, sell, rent, or trade your personal information for
            marketing purposes. Period.
          </p>
        </Section>

        <Section title="4. Data retention">
          <ul className="list-disc pl-6 space-y-1">
            <li>Server logs: ~30 days</li>
            <li>Email correspondence: Retained as long as needed for support, then deleted on request</li>
            <li>On-chain data: Permanent — we cannot delete data from public blockchains</li>
            <li>Off-chain account data (if any): Retained as long as your account is active; deletable on request</li>
          </ul>
        </Section>

        <Section title="5. Your rights">
          <h3 className="font-semibold mt-2">California (CCPA / CPRA)</h3>
          <p className="mt-2">If you are a California resident, you have the right to:</p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>Know what personal information we collect, use, and share</li>
            <li>Request deletion of personal information we hold about you</li>
            <li>Opt out of &ldquo;sale&rdquo; or &ldquo;sharing&rdquo; of personal information (we do neither)</li>
            <li>Correct inaccurate personal information</li>
            <li>Limit the use of sensitive personal information</li>
            <li>Be free from discrimination for exercising your rights</li>
          </ul>
          <p className="mt-3">
            To exercise these rights, email{' '}
            <Email>ghostkey316@proton.me</Email>. We verify requests via reply and
            respond within 45 days.
          </p>

          <h3 className="font-semibold mt-4">European Economic Area / United Kingdom (GDPR)</h3>
          <p className="mt-2">If you are in the EEA or UK, you have the right to:</p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>Access your personal data</li>
            <li>Rectify inaccurate data</li>
            <li>Erase your personal data — subject to legal exceptions and the immutable nature of public blockchains</li>
            <li>Restrict processing</li>
            <li>Object to processing</li>
            <li>Data portability</li>
            <li>Withdraw consent at any time</li>
            <li>Lodge a complaint with your supervisory authority</li>
          </ul>
          <p className="mt-3">
            Legal bases for processing: (a) performance of a contract, (b) legitimate
            interests (security, fraud prevention, service improvement), and (c)
            consent (where applicable).
          </p>

          <h3 className="font-semibold mt-4">Note on blockchain data</h3>
          <p className="mt-2">
            Public blockchain transactions cannot be deleted, modified, or made
            non-public. We will honor deletion requests for any{' '}
            <strong>off-chain</strong> personal data we hold, but we cannot remove
            data from a public blockchain. Please consider this carefully before any
            on-chain action.
          </p>
        </Section>

        <Section title="6. Children">
          <p>
            The Service is not directed to children under 18. We do not knowingly
            collect personal information from children. If you believe a child has
            provided us information, contact us and we will delete it.
          </p>
        </Section>

        <Section title="7. International transfers">
          <p>
            If you access the Service from outside the United States, your information
            may be transferred to, stored, and processed in the U.S. We rely on
            appropriate safeguards (such as Standard Contractual Clauses where
            required) for international transfers from the EEA/UK.
          </p>
        </Section>

        <Section title="8. Security">
          <p>
            We use reasonable technical and organizational measures to protect
            personal information. No system is perfectly secure. You are responsible
            for keeping your wallet credentials safe — we cannot recover lost keys or
            reverse on-chain transactions.
          </p>
        </Section>

        <Section title="9. Do Not Track">
          <p>
            We do not respond to Do Not Track (&ldquo;DNT&rdquo;) browser signals
            because there is no industry-standard interpretation. Our default
            behavior already aligns with what most users expect from DNT — minimal
            tracking, no cross-site profiling, no advertising data sharing.
          </p>
        </Section>

        <Section title="10. Changes to this policy">
          <p>
            We may update this Privacy Policy from time to time. The &ldquo;Last
            Updated&rdquo; date reflects the most recent revision. For material
            changes, we will provide notice via the Service or our official channels.
          </p>
        </Section>

        <Section title="11. Contact">
          <p>
            For privacy questions or to exercise your rights, email{' '}
            <Email>ghostkey316@proton.me</Email> with subject line &ldquo;Privacy
            Request — [your request].&rdquo; We aim to respond within 30 days for
            general inquiries and within applicable legal timeframes for formal
            requests.
          </p>
        </Section>

        <div className="mt-12 flex flex-wrap gap-3 text-sm">
          <a
            href="/terms"
            className="rounded-lg border border-white/20 px-4 py-2 hover:border-white/40"
          >
            Terms of Service
          </a>
          <a
            href="/disclaimer"
            className="rounded-lg border border-white/20 px-4 py-2 hover:border-white/40"
          >
            Disclaimer
          </a>
          <a
            href="/security"
            className="rounded-lg border border-white/20 px-4 py-2 hover:border-white/40"
          >
            Security
          </a>
        </div>
      </div>
    </main>
  );
}

function Section({ title, children }: { title: string; children: React.ReactNode }) {
  return (
    <section className="mt-10">
      <h2 className="text-2xl font-bold mb-3">{title}</h2>
      <div className="text-base leading-relaxed text-[var(--color-ember-text)] space-y-1">
        {children}
      </div>
    </section>
  );
}

function A({ href, children }: { href: string; children: React.ReactNode }) {
  return (
    <a href={href} className="text-[var(--color-ember-accent)] hover:underline">
      {children}
    </a>
  );
}

function Email({ children }: { children: React.ReactNode }) {
  return (
    <a
      href={`mailto:${children}`}
      className="text-[var(--color-ember-accent)] hover:underline"
    >
      {children}
    </a>
  );
}
