import { Link } from 'react-router-dom'
import { usePageMeta } from '../hooks/usePageMeta'

export default function PrivacyPage() {
  usePageMeta({
    title: 'Privacy Policy | Grateful Journal',
    description: 'Grateful Journal\'s privacy policy. Your journal entries are end-to-end encrypted — we cannot read them. No ads, no tracking, no data selling.',
    canonical: 'https://gratefuljournal.online/privacy',
    ogTitle: 'Privacy Policy | Grateful Journal',
    ogDescription: 'Your journal entries are end-to-end encrypted and private. App preferences like background images are stored unencrypted. No ads, no tracking, no data selling.',
  })
  return (
    <div className="static-page">
      <header className="static-page__header">
        <Link to="/" className="static-page__logo">🌱 Grateful Journal</Link>
      </header>

      <main className="static-page__content">
        <h1>Privacy Policy</h1>
        <p className="static-page__updated">Last updated: April 14, 2026</p>

        <p>
          Grateful Journal is built on a simple promise: your journal entries are yours alone.
          We designed the app so that we cannot read your entries even if we wanted to.
        </p>

        <h2>What we collect</h2>
        <ul>
          <li><strong>Account info</strong> — your name and email address via Google Sign-In, used solely to identify your account.</li>
          <li><strong>Journal entries</strong> — stored encrypted in our database. We do not have access to the content of your entries.</li>
          <li><strong>App preferences</strong> — your display name, profile photo, background images, and theme are stored unencrypted as account settings. See the Encryption section below for the full breakdown.</li>
          <li><strong>Usage data</strong> — no analytics, no tracking pixels, no third-party advertising SDKs.</li>
        </ul>

        <h2>Encryption</h2>
        <p>
          Encryption is applied selectively based on the sensitivity of each type of data:
        </p>
        <ul>
          <li><strong>Journal entries — end-to-end encrypted.</strong> Entries are encrypted on your device using XSalsa20-Poly1305 before being sent to our servers. We store only ciphertext. Decryption happens locally in your browser using a key derived from your account. We cannot read your entries.</li>
          <li><strong>App preferences — not encrypted.</strong> Your display name, profile photo, background images, and theme setting are stored as plain data. These are appearance and account settings, not personal journal content. They are accessible to us at the database level.</li>
        </ul>
        <p>
          If you upload a personal photo as a background image, be aware that it is stored unencrypted on our servers.
          For maximum privacy, use abstract or non-personal images as backgrounds.
        </p>

        <h2>Data sharing</h2>
        <p>
          We do not sell, share, or rent your personal data to any third party.
          We use Firebase (Google) for authentication only.
        </p>

        <h2>Data deletion</h2>
        <p>
          You can delete your account and all associated data at any time from the Settings page.
          Deletion is permanent and irreversible.
        </p>

        <h2>Cookies</h2>
        <p>
          We use a single session cookie to keep you signed in. No advertising or tracking cookies are used.
        </p>

        <h2>Contact</h2>
        <p>
          Questions about this policy? Reach us at the contact details on our <Link to="/about">About page</Link>.
        </p>
      </main>

      <footer className="static-page__footer">
        <Link to="/">← Back to Grateful Journal</Link>
        <span>·</span>
        <Link to="/about">About</Link>
      </footer>
    </div>
  )
}
