---
import BaseLayout from '../layouts/BaseLayout.astro';
---

<BaseLayout title="Privacy Policy - Zaguán Blade">
  <main>
    <!-- Hero Section -->
    <section class="privacy-hero">
      <div class="container">
        <div class="section-label">[PRIVACY]</div>
        <h1 class="section-title">Your Data,<br/>Your Control</h1>
        <p class="hero-subtitle">We take your privacy seriously. Here's exactly how we protect your information.</p>
      </div>
    </section>

    <!-- Main Content -->
    <section class="privacy-content">
      <div class="container">
        <!-- Introduction -->
        <div class="privacy-section">
          <h2>Our Commitment</h2>
          <p>
            Zaguán Blade is built with privacy as a core principle. We will <strong>never access, sell, or in any way monetize or abuse your data</strong>. 
            This is a binding commitment. Your data is yours, and we treat it with the respect it deserves.
          </p>
        </div>

        <!-- Security Infrastructure -->
        <div class="privacy-section">
          <h2>How We Protect Your Data</h2>
          
          <div class="protection-grid">
            <div class="protection-card">
              <div class="card-icon">🔒</div>
              <h3>Secure Communication</h3>
              <p>
                All data in transit is protected using industry-standard HTTPS and WebSocket Secure (WSS) encryption. 
                This means your communications with our servers are encrypted end-to-end.
              </p>
            </div>

            <div class="protection-card">
              <div class="card-icon">🗄️</div>
              <h3>Encrypted at Rest</h3>
              <p>
                Your data is encrypted when stored in our database (MariaDB). We use a single master encryption key 
                to protect all stored information, ensuring that even if the database were accessed, the data remains protected.
              </p>
            </div>

            <div class="protection-card">
              <div class="card-icon">🔑</div>
              <h3>Master Encryption Key</h3>
              <p>
                All encrypted data uses a centralized master encryption key. This key is stored securely and rotated regularly. 
                Access to this key is restricted to essential infrastructure only.
              </p>
            </div>

            <div class="protection-card">
              <div class="card-icon">🧹</div>
              <h3>Regular Data Pruning</h3>
              <p>
                We automatically prune outdated data at least once per calendar year. This minimizes the amount of personal 
                information we store and reduces risk of exposure.
              </p>
            </div>
          </div>
        </div>

        <!-- Data Collection -->
        <div class="privacy-section">
          <h2>What Data We Collect</h2>
          <p>
            We collect only the information necessary to provide our service:
          </p>
          <ul class="privacy-list">
            <li>Code and project files you work on within Zaguán Blade</li>
            <li>System information (OS version, shell, environment details)</li>
            <li>Key metrics that help the AI model work effectively</li>
            <li>Usage analytics to improve our service</li>
          </ul>
          <p style="margin-top: 1.5rem; font-size: 0.95rem;">
            <strong>Note:</strong> We do not store personal information like email addresses or account details in our database. 
            We only retain the technical data necessary for the AI to function optimally.
          </p>
        </div>

        <!-- User Rights -->
        <div class="privacy-section">
          <h2>Your Data Rights</h2>
          <p>
            You have full control over your data. You can:
          </p>
          <ul class="privacy-list">
            <li><strong>Access</strong> - Request a complete export of your data at any time</li>
            <li><strong>Delete</strong> - Request immediate deletion of your account and associated data</li>
            <li><strong>Correct</strong> - Update or correct any inaccurate information</li>
            <li><strong>Port</strong> - Download your data in a standard, portable format</li>
          </ul>
          <p style="margin-top: 1.5rem;">
            To exercise any of these rights, contact us at <a href="mailto:support@zaguanai.com">support@zaguanai.com</a> 
            with your request and proof of identity.
          </p>
        </div>

        <!-- No Third-Party Access -->
        <div class="privacy-section highlight-section">
          <h2>We Don't Share Your Data</h2>
          <p>
            Your data is not shared with third parties for marketing, analytics, or any other purpose. We don't sell your information. 
            We don't rent it. We don't use it for training models or any other monetization scheme.
          </p>
          <p>
            The only exceptions are when required by law (such as valid legal orders or regulatory compliance), 
            or when necessary for service providers who are strictly bound by confidentiality agreements.
          </p>
        </div>

        <!-- User Data Access -->
        <div class="privacy-section">
          <h2>Access Your Data</h2>
          <p>
            You can view all the data we have about you directly in your User Dashboard. This includes:
          </p>
          <ul class="privacy-list">
            <li>System metrics and environment information we've collected</li>
            <li>Usage statistics</li>
            <li>A complete history of your interactions</li>
          </ul>
          <p style="margin-top: 1.5rem;">
            Simply log in to your account and navigate to the Data section to review everything we have on record.
          </p>
        </div>

        <!-- Compliance -->
        <div class="privacy-section">
          <h2>Regulatory Compliance</h2>
          <p>
            We comply with applicable privacy regulations, including:
          </p>
          <ul class="privacy-list">
            <li><strong>GDPR</strong> - General Data Protection Regulation (EU users)</li>
            <li><strong>CCPA</strong> - California Consumer Privacy Act (California users)</li>
            <li><strong>Local Data Protection Laws</strong> - Applicable in your jurisdiction</li>
          </ul>
          <p style="margin-top: 1.5rem;">
            If you have concerns about our privacy practices or believe we're not complying with applicable laws, 
            please contact us immediately.
          </p>
        </div>

        <!-- Cookies & Analytics -->
        <div class="privacy-section">
          <h2>Cookies & Tracking</h2>
          <p>
            We do not use cookies or store tracking data. The only tracking we employ is our personal Matomo analytics instance, 
            which collects anonymous, aggregated data to help us understand how our service is used and where we can improve.
          </p>
          <p>
            This data is:
          </p>
          <ul class="privacy-list">
            <li>Completely anonymous and aggregated</li>
            <li>Not shared with any third parties</li>
            <li>Used only to inform product improvements</li>
            <li>Subject to the same privacy protections as all other data</li>
          </ul>
        </div>

        <!-- Contact & Updates -->
        <div class="privacy-section highlight-section">
          <h2>Questions or Concerns?</h2>
          <p>
            If you have any questions about our privacy practices, or if you need to exercise your data rights, 
            please contact us at:
          </p>
          <div class="contact-info">
            <p><strong>Email:</strong> <a href="mailto:support@zaguanai.com">support@zaguanai.com</a></p>
            <p><strong>Website:</strong> <a href="https://zaguanai.com" target="_blank" rel="noopener">zaguanai.com</a></p>
          </div>
        </div>

        <!-- Policy Updates -->
        <div class="privacy-section">
          <h2>Policy Updates</h2>
          <p>
            We may update this privacy policy from time to time to reflect changes in our practices or applicable law. 
            When we make material changes, we'll notify you via email and update the "Last Updated" date below.
          </p>
          <p style="margin-top: 1.5rem; font-size: 0.9rem; color: var(--color-text-secondary);">
            <strong>Last Updated:</strong> <span id="update-date">February 10, 2026</span>
          </p>
        </div>
      </div>
    </section>
  </main>
</BaseLayout>

<style>
  main {
    min-height: 100vh;
  }

  .privacy-hero {
    padding: 6rem 0 4rem;
    border-bottom: 1px solid var(--color-border);
  }

  .privacy-hero .section-label {
    display: block;
    margin-bottom: 1.5rem;
  }

  .privacy-hero .section-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 600px;
  }

  .privacy-content {
    padding: 4rem 0;
  }

  .privacy-section {
    margin-bottom: 4rem;
    padding: 0;
  }

  .privacy-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
  }

  .privacy-section p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
  }

  .privacy-section p a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid var(--color-accent);
    transition: opacity 0.2s;
  }

  .privacy-section p a:hover {
    opacity: 0.8;
  }

  .privacy-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
  }

  .privacy-list li {
    padding: 0.75rem 0 0.75rem 2rem;
    color: var(--color-text-secondary);
    position: relative;
    line-height: 1.6;
  }

  .privacy-list li:before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 700;
  }

  .protection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
  }

  .protection-card {
    padding: 2rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: all 0.3s ease;
  }

  .protection-card:hover {
    border-color: var(--color-accent);
    background: var(--color-bg-secondary);
  }

  .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  .protection-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-text-primary);
  }

  .protection-card p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
  }

  .highlight-section {
    padding: 2rem;
    background: var(--color-bg-secondary);
    border-left: 4px solid var(--color-accent);
    border-radius: 4px;
  }

  .highlight-section h2 {
    margin-top: 0;
  }

  .contact-info {
    padding: 1.5rem;
    background: var(--color-bg-tertiary);
    border-radius: 4px;
    margin-top: 1.5rem;
  }

  .contact-info p {
    margin: 0.5rem 0;
    font-size: 1rem;
  }

  .contact-info a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid var(--color-accent);
  }

  .contact-info a:hover {
    opacity: 0.8;
  }

  @media (max-width: 768px) {
    .privacy-hero .section-title {
      font-size: 2.5rem;
    }

    .privacy-section h2 {
      font-size: 1.4rem;
    }

    .protection-grid {
      grid-template-columns: 1fr;
    }
  }
</style>
