import type { Metadata } from "next";
import Link from "next/link";

export const metadata: Metadata = {
  title: "t2000 — Terms of Service",
  description: "Terms of Service for the t2000 platform.",
};

export default function TermsPage() {
  return (
    <main className="min-h-screen bg-background text-foreground relative z-10">
      <div className="max-w-3xl mx-auto px-4 sm:px-6 py-12 sm:py-20">
        <header className="mb-12">
          <Link
            href="/"
            className="inline-block text-muted hover:text-accent font-mono text-[10px] tracking-[0.12em] uppercase mb-8 transition-colors"
          >
            ← t2000.ai
          </Link>
          <h1 className="text-3xl sm:text-4xl font-serif italic text-foreground tracking-tight mb-2">
            Terms of Service
          </h1>
          <p className="text-sm text-muted font-mono">
            Last updated: April 2026
          </p>
        </header>

        <div className="prose prose-invert prose-sm max-w-none space-y-8 text-muted leading-relaxed text-[13.5px]">
          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              1. Acceptance
            </h2>
            <p>
              By using t2000 software (&quot;the Service&quot;), including the consumer
              web app, CLI, SDK, MCP tools, API, and website, you agree to these
              Terms of Service. If you do not agree, do not use the Service.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              2. Description of Service
            </h2>
            <p>
              t2000 is a financial infrastructure platform built on the Sui
              blockchain. It provides an SDK, CLI, MCP tools, and agent engine
              that power financial applications. The consumer-facing product is{" "}
              <a
                href="https://audric.ai"
                target="_blank"
                rel="noopener noreferrer"
                className="text-accent hover:underline"
              >
                Audric
              </a>
              {" "}(audric.ai), an AI-powered assistant for managing savings,
              yield, token swaps, sends, borrowing, and on-chain services.
              Audric users are also subject to the{" "}
              <a
                href="https://audric.ai/terms"
                target="_blank"
                rel="noopener noreferrer"
                className="text-accent hover:underline"
              >
                Audric Terms of Service
              </a>
              . The Service is provided as-is and is currently in{" "}
              <strong className="text-amber-400">beta</strong>.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              3. Authentication and Wallet
            </h2>
            <p>
              The consumer web app uses zkLogin via Google sign-in, powered by
              Mysten Labs Enoki. Your wallet is derived from your Google
              session — no seed phrases, passwords, or local key files are
              involved. Your wallet address is deterministic based on your
              Google account. t2000 never has access to your private keys.
            </p>
            <p className="mt-2">
              For the CLI and SDK, private keys are generated and stored locally
              on your device, encrypted with your PIN. You are solely
              responsible for securing your keys.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              4. No Financial Advice
            </h2>
            <p>
              Nothing provided by the Service constitutes financial, investment,
              tax, or legal advice. The AI assistant provides information and
              executes actions on your behalf, but its analysis (including yield
              comparisons, risk assessments, and rebalancing suggestions) is
              generated by a language model and may contain errors. DeFi
              interactions carry inherent risks including smart contract risk,
              impermanent loss, and liquidation. You are solely responsible for
              evaluating these risks and making your own decisions.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              5. Third-Party Protocols and Services
            </h2>
            <p>
              t2000 integrates with third-party services including:
            </p>
            <ul className="list-disc pl-5 space-y-1.5 mt-2">
              <li>
                <strong className="text-foreground">DeFi protocols</strong>{" "}
                (NAVI) — via on-chain smart contracts
              </li>
              <li>
                <strong className="text-foreground">Physical mail</strong>{" "}
                (Lob) — postcards and letters delivered by postal service
              </li>
              <li>
                <strong className="text-foreground">Merchandise</strong>{" "}
                (Printful) — on-demand print and ship
              </li>
              <li>
                <strong className="text-foreground">AI and search</strong>{" "}
                (Anthropic, SerpAPI, Brave, and others) — for the assistant
                and information retrieval
              </li>
            </ul>
            <p className="mt-2">
              We do not control, audit, or guarantee the availability, quality,
              or security of third-party services. Physical mail delivery times depend on postal services.
              Use of third-party services is at your own risk.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              6. Pricing and Fees
            </h2>
            <p>
              t2000 uses a pay-per-request model. Services are paid in USDC on
              the Sui blockchain via the Micropayment Protocol (MPP). There is
              no subscription or monthly fee.
            </p>
            <ul className="list-disc pl-5 space-y-1.5 mt-2">
              <li>
                <strong className="text-foreground">Read operations</strong>{" "}
                (balance, rates, positions) — free
              </li>
              <li>
                <strong className="text-foreground">
                  Information services
                </strong>{" "}
                (web search, translate, crypto prices, news) — $0.005 USDC per
                request
              </li>
              <li>
                <strong className="text-foreground">AI and compute</strong>{" "}
                (image generation, code execution, flights) — $0.01–$0.03 USDC
                per request
              </li>
              <li>
                <strong className="text-foreground">Physical mail</strong> —
                postcards ~$1.00, letters ~$1.50 USDC
              </li>
              <li>
                <strong className="text-foreground">Merchandise</strong> —
                estimated cost plus a 5% service fee
              </li>
            </ul>
            <p className="mt-2">
              The AI assistant itself (chat messages, analysis, recommendations)
              is currently free. This may change in the future.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              7. Spending Limits
            </h2>
            <p>
              To protect users, the consumer app enforces spending limits on
              service purchases: $50 USD per day and $500 USD per month per
              wallet address. These limits may be adjusted without notice. DeFi
              operations (deposits, withdrawals) are not subject to these
              limits.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              8. Purchases and Refunds
            </h2>
            <p>
              Service payments are on-chain USDC transfers and are final.
              Physical mail, once submitted for delivery, cannot be recalled.
              Merchandise orders, once placed, follow the provider&apos;s cancellation policy. If a service fails to
              deliver after payment, contact us at{" "}
              <span className="text-foreground">support@t2000.ai</span> and we
              will investigate on a case-by-case basis.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              9. Tax Responsibility
            </h2>
            <p>
              Spending cryptocurrency (including stablecoins like USDC) may be a
              taxable event in your jurisdiction. You are solely responsible for
              understanding and complying with applicable tax laws, including
              reporting obligations for crypto-to-goods transactions. t2000 does
              not provide tax advice and does not report to tax authorities on
              your behalf.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              10. Gas Sponsorship
            </h2>
            <p>
              t2000 sponsors gas fees for transactions in the consumer web app
              via Mysten Labs Enoki. This is a convenience feature and may be
              modified, rate-limited, or discontinued at any time without
              notice.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              11. AI Assistant
            </h2>
            <p>
              The AI assistant is powered by large language models. It can make
              mistakes, misinterpret requests, or provide inaccurate financial
              analysis. Always verify important information before acting on it.
              The assistant will ask for confirmation before executing
              transactions, but you are ultimately responsible for approving
              each action.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              12. Beta Software
            </h2>
            <p>
              t2000 is currently in beta. The software may contain bugs, errors,
              or vulnerabilities. We do not guarantee the software will function
              without interruption or error. Use with significant funds is at
              your own risk.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              13. Limitation of Liability
            </h2>
            <p>
              TO THE MAXIMUM EXTENT PERMITTED BY LAW, t2000 AND ITS
              CONTRIBUTORS SHALL NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
              SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF
              PROFITS, DATA, OR FUNDS, WHETHER IN CONTRACT, TORT, OR OTHERWISE,
              ARISING OUT OF OR IN CONNECTION WITH YOUR USE OF THE SERVICE.
              THIS INCLUDES BUT IS NOT LIMITED TO LOSSES FROM AI RECOMMENDATIONS,
              FAILED SERVICE DELIVERIES, DEFI PROTOCOL INTERACTIONS, AND
              THIRD-PARTY SERVICE FAILURES.
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              14. Open Source
            </h2>
            <p>
              t2000 is open-source software licensed under the MIT License. The
              source code is available at{" "}
              <a
                href="https://github.com/mission69b/t2000"
                target="_blank"
                rel="noopener noreferrer"
                className="text-accent hover:underline"
              >
                github.com/mission69b/t2000
              </a>
              .
            </p>
          </section>

          <section>
            <h2 className="text-foreground text-lg font-serif italic mb-3">
              15. Changes
            </h2>
            <p>
              We may update these Terms at any time. Continued use of the
              Service after changes constitutes acceptance of the updated Terms.
            </p>
          </section>
        </div>

        <footer className="mt-16 pt-8 border-t border-border text-xs text-dim font-mono flex gap-6">
          <Link href="/privacy" className="hover:text-muted transition-colors">
            Privacy
          </Link>
          <Link
            href="/disclaimer"
            className="hover:text-muted transition-colors"
          >
            Disclaimer
          </Link>
          <Link href="/security" className="hover:text-muted transition-colors">
            Security
          </Link>
        </footer>
      </div>
    </main>
  );
}
