// Fin45 — Legal pages (legal · privacy · terms)
// One file, three exported pages with shared sidebar nav.

function LegalShell({ active, children }) {
  return (
    <main className="page" style={{ paddingTop: 48, paddingBottom: 64 }}>
      <div style={{ display: 'grid', gridTemplateColumns: '240px 1fr', gap: 56, alignItems: 'start' }}>
        <aside style={{ position: 'sticky', top: 96, fontFamily: 'JetBrains Mono, monospace', fontSize: 12, letterSpacing: '0.04em' }}>
          <div style={{ fontSize: 10, letterSpacing: '0.18em', color: 'var(--text-muted)', textTransform: 'uppercase', marginBottom: 16 }}>
            Legal
          </div>
          <div style={{ display: 'flex', flexDirection: 'column' }}>
            <a href="#/legal"    className={active === 'legal'   ? 'legal-nav-on' : 'legal-nav'} style={legalLinkStyle(active === 'legal')}>Disclaimers</a>
            <a href="#/privacy"  className={active === 'privacy' ? 'legal-nav-on' : 'legal-nav'} style={legalLinkStyle(active === 'privacy')}>Privacy policy</a>
            <a href="#/terms"    className={active === 'terms'   ? 'legal-nav-on' : 'legal-nav'} style={legalLinkStyle(active === 'terms')}>Terms of service</a>
          </div>
          <div style={{ marginTop: 32, fontSize: 11, color: 'var(--text-muted)', lineHeight: 1.5 }}>
            © 2026 Zagoso LLC.<br />Bend, Oregon.<br /><br />Updated May 16, 2026
          </div>
        </aside>
        <article className="prose" style={{ maxWidth: '64ch' }}>
          {children}
        </article>
      </div>
    </main>
  );
}

function legalLinkStyle(on) {
  return {
    padding: '10px 0',
    borderBottom: '1px solid var(--border)',
    color: on ? 'var(--accent)' : 'var(--text-body)',
    fontWeight: on ? 600 : 400,
    letterSpacing: '0.04em',
  };
}

// ── Legal / disclaimers ────────────────────────────────────────
function PageLegal() {
  return (
    <LegalShell active="legal">
      <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 11, letterSpacing: '0.18em', color: 'var(--accent)', textTransform: 'uppercase', marginBottom: 14 }}>
        Legal · disclaimers
      </div>
      <h1 style={{ fontFamily: 'var(--serif)', fontWeight: 500, fontSize: 52, letterSpacing: '-0.025em', lineHeight: 1, margin: '0 0 24px' }}>
        This is not financial advice.
      </h1>
      <p className="lead">
        Fin45 is an educational documentary about an autonomous AI agent that trades a paper-money account. The site, the newsletter, and every page on this domain are published for informational and entertainment purposes only.
      </p>

      <h2>Nothing on this site is investment advice.</h2>
      <p>The trades, signals, and commentary you read are decisions made by an autonomous software system operating against a simulated $100,000 brokerage account. They are not recommendations. They are not solicitations. You should not buy, sell, hold, hedge, short, or otherwise take a financial position based on anything published here.</p>

      <h2>The trades are paper.</h2>
      <p>The portfolio is simulated. Beginning Month 2 of the experiment, a parallel real-money account funded with personal capital will mirror every paper trade so that execution friction (slippage, fees, partial fills, market impact) is real. The published portfolio remains the paper book unless otherwise marked.</p>

      <h2>Past performance does not predict future results.</h2>
      <p>This is true of every investment system, agent, human, hedge fund, and index fund ever measured. It is especially true of a public AI experiment with a one-year sample size. Treat the published returns as a documentary record, not a track record.</p>

      <h2>The narrator is not a registered investment advisor.</h2>
      <p>Andrew McGuire is the editorial voice of Fin45 and operator of the agent. He is not a Registered Investment Advisor (RIA), broker-dealer, or licensed financial professional. He does not provide individualized investment advice and will not do so via email, social, or any other channel.</p>

      <h2>The agent is not your fiduciary.</h2>
      <p>The Fin45 agent is software, and software does not owe you a duty of care, loyalty, or prudence under any state or federal fiduciary standard. The agent is making decisions on behalf of a paper account that exists in our database. It is not making decisions on your behalf, and reading about its decisions does not create any advisor-client relationship.</p>

      <h2>Consult a licensed professional.</h2>
      <p>Before making investment decisions, consult a Registered Investment Advisor, Certified Financial Planner, or similarly licensed professional who can evaluate your individual financial situation, risk tolerance, and goals.</p>

      <h2>Risk of loss.</h2>
      <p>All trading and investing involves risk, including the risk of total loss of principal. The strategies you read about on Fin45 are not appropriate for many investors and may result in losses if implemented. Options, leverage, and concentrated positions carry additional risks.</p>

      <h2>No guarantees.</h2>
      <p>Fin45 does not guarantee accuracy, completeness, or timeliness of any content. Source data is aggregated from third-party feeds (SEC EDGAR, congressional disclosure databases, public earnings transcripts, market data vendors). Errors are possible. Corrections are published in the next edition.</p>

      <h2>Forward-looking statements.</h2>
      <p>Statements about the agent's targets (e.g. 10% net monthly), publishing cadence, future features, or any "we will" / "we plan to" statements are forward-looking and subject to change. The experiment may be paused, restructured, or concluded at the operator's sole discretion.</p>

      <p style={{ marginTop: 40, fontFamily: 'var(--mono)', fontSize: 12, color: 'var(--text-muted)', letterSpacing: '0.04em' }}>
        Questions about anything on this page → <a href="mailto:legal@fin45.ai" style={{ color: 'var(--accent)' }}>legal@fin45.ai</a>
      </p>
    </LegalShell>
  );
}

// ── Privacy ────────────────────────────────────────────────────
function PagePrivacy() {
  return (
    <LegalShell active="privacy">
      <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 11, letterSpacing: '0.18em', color: 'var(--accent)', textTransform: 'uppercase', marginBottom: 14 }}>
        Legal · privacy policy
      </div>
      <h1 style={{ fontFamily: 'var(--serif)', fontWeight: 500, fontSize: 52, letterSpacing: '-0.025em', lineHeight: 1, margin: '0 0 24px' }}>
        We keep what we need. Nothing more.
      </h1>
      <p className="lead">
        Fin45 is a newsletter. To deliver it, we need an email address. That is the entirety of the personal data we collect from readers, and we treat it as if our reputation depended on not abusing it — because it does.
      </p>

      <h2>What we collect</h2>
      <p>If you subscribe, we collect the email address you submit and the date you subscribed. We may also collect open / click data on emails we send, which our delivery provider records by default. If you visit the site without subscribing, we collect anonymized aggregate page-view counts via privacy-respecting analytics (no cookies, no fingerprinting, no IP storage).</p>

      <h2>What we do with it</h2>
      <p>We send you Fin45 editions. That's the entire deal. We use your email to deliver the newsletter, to send you transactional messages tied to your subscription, and — if you opt in — to send occasional product announcements. We do not sell, rent, or share your email with any third party for marketing purposes.</p>

      <h2>Where it lives</h2>
      <p>Subscriber data is stored at our email service provider (industry-standard, SOC 2 Type II compliant). Site analytics live at our analytics provider. Backups are encrypted at rest. We retain your data for as long as you're subscribed and 90 days after unsubscribe, after which it's permanently deleted.</p>

      <h2>What we never do</h2>
      <p>We never sell your email. We never share your email with third parties for their own marketing. We never use your reading behavior to construct an advertising profile. We never give your email to "partners" in exchange for cross-promotion. The only people who see your email are Andrew, our email delivery provider, and you.</p>

      <h2>Your rights</h2>
      <p>You can unsubscribe in one click from any email. You can ask us to delete your data by emailing privacy@fin45.ai — we'll do it within 30 days and confirm. If you're in the EU, UK, California, or any other jurisdiction with data-rights laws, you have the full slate of access / correction / deletion / portability rights, and we'll honor them.</p>

      <h2>Cookies</h2>
      <p>The marketing site uses zero cookies. The subscription form sets a single session-scoped flag to remember if you've already subscribed. That's it. No tracking cookies, no advertising pixels, no third-party tags.</p>

      <h2>Changes</h2>
      <p>If we ever change this policy, we'll email subscribers before the change takes effect and update the "Updated" date in the sidebar. Material changes (e.g. new data collection) require affirmative opt-in.</p>

      <p style={{ marginTop: 40, fontFamily: 'var(--mono)', fontSize: 12, color: 'var(--text-muted)', letterSpacing: '0.04em' }}>
        Privacy questions / data requests → <a href="mailto:privacy@fin45.ai" style={{ color: 'var(--accent)' }}>privacy@fin45.ai</a>
      </p>
    </LegalShell>
  );
}

// ── Terms ──────────────────────────────────────────────────────
function PageTerms() {
  return (
    <LegalShell active="terms">
      <div style={{ fontFamily: 'JetBrains Mono, monospace', fontSize: 11, letterSpacing: '0.18em', color: 'var(--accent)', textTransform: 'uppercase', marginBottom: 14 }}>
        Legal · terms of service
      </div>
      <h1 style={{ fontFamily: 'var(--serif)', fontWeight: 500, fontSize: 52, letterSpacing: '-0.025em', lineHeight: 1, margin: '0 0 24px' }}>
        The rules of the road.
      </h1>
      <p className="lead">
        By accessing fin45.ai or subscribing to the Fin45 newsletter you agree to these terms. They are written in plain English. If anything is unclear, email us.
      </p>

      <h2>Service</h2>
      <p>"The Service" is the fin45.ai website, the Fin45 daily newsletter, the Fin45 Pro newsletter when launched, and any related communications. The Service is operated by Zagoso LLC, an Oregon limited liability company based in Bend.</p>

      <h2>Eligibility</h2>
      <p>You must be at least 13 to subscribe to the free newsletter and at least 18 to subscribe to any paid plan. By subscribing you represent that you meet these requirements.</p>

      <h2>Content</h2>
      <p>All content published on the Service — articles, charts, code, graphics, mascot, brand assets — is owned by Zagoso LLC or its licensors and protected by U.S. and international copyright. You may share excerpts with attribution. You may not republish, reproduce, or redistribute the full text of any edition without written permission.</p>

      <h2>Not investment advice</h2>
      <p>The Service is published for informational and educational purposes only. Nothing on the Service constitutes investment advice, an offer, or a solicitation. See <a href="#/legal">/legal</a> for the full disclaimer.</p>

      <h2>Paid subscriptions (forthcoming)</h2>
      <p>If you subscribe to Fin45 Pro, you'll be billed by our payment processor on a recurring monthly basis at the rate disclosed at the time of subscription. You can cancel at any time from your account page; cancellations take effect at the end of the current billing period. No refunds for partial periods. Pricing may change with 30 days' notice to existing subscribers.</p>

      <h2>Acceptable use</h2>
      <p>You agree not to: scrape the site at unreasonable rates, automate subscriptions or unsubscribes, impersonate the Service or its operator, attempt to access non-public portions of the Service, or use the Service to harass any individual covered in editorial content.</p>

      <h2>Disclaimer of warranties</h2>
      <p>The Service is provided "as is" and "as available," without warranties of any kind, express or implied. We do not warrant that the Service will be uninterrupted, accurate, or error-free.</p>

      <h2>Limitation of liability</h2>
      <p>To the maximum extent permitted by law, Zagoso LLC will not be liable for any indirect, incidental, consequential, or special damages arising out of or in connection with the Service or any investment decisions made in reliance on Service content. Our aggregate liability for any direct damages is limited to the amount you've paid us in the twelve months preceding the claim (which, for free subscribers, is zero).</p>

      <h2>Governing law</h2>
      <p>These terms are governed by the laws of the State of Oregon, without regard to conflict of law principles. Any disputes will be resolved in the state or federal courts located in Deschutes County, Oregon.</p>

      <h2>Changes</h2>
      <p>We may update these terms. If we do, we'll email subscribers and update the "Updated" date. Continued use of the Service after a change constitutes acceptance.</p>

      <p style={{ marginTop: 40, fontFamily: 'var(--mono)', fontSize: 12, color: 'var(--text-muted)', letterSpacing: '0.04em' }}>
        Questions → <a href="mailto:legal@fin45.ai" style={{ color: 'var(--accent)' }}>legal@fin45.ai</a>
      </p>
    </LegalShell>
  );
}

window.PageLegal = PageLegal;
window.PagePrivacy = PagePrivacy;
window.PageTerms = PageTerms;
