import type { Metadata } from 'next';

export const metadata: Metadata = {
  title: 'Terms of Service — Vaultfire',
  description:
    'Terms governing your use of theloopbreaker.com, the Vaultfire Protocol, smart contracts, and APIs.',
};

export const dynamic = 'force-static';

export default function TermsPage() {
  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">Terms of Service</h1>
        <p className="mt-3 text-sm text-[var(--color-ember-text-muted)]">
          Effective Date: April 27, 2026 · Last Updated: April 27, 2026
        </p>

        <p className="mt-6 text-base leading-relaxed">
          These Terms of Service (&ldquo;Terms&rdquo;) govern your access to and use of
          theloopbreaker.com, the Vaultfire Protocol, the Vaultfire smart contracts,
          the Vaultfire APIs, and all related services (collectively, the
          &ldquo;Service&rdquo;) operated by the Vaultfire Protocol team
          (&ldquo;we,&rdquo; &ldquo;us,&rdquo; &ldquo;our&rdquo;). By accessing or using
          the Service, you agree to be bound by these Terms. If you do not agree, do
          not use the Service.
        </p>

        <Section title="1. Eligibility">
          <p>
            You must be at least 18 years old (or the age of majority in your
            jurisdiction, whichever is greater) and have the legal capacity to enter
            into binding contracts.
          </p>
          <p className="mt-3">You may not use the Service if you are:</p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>
              Located in, organized under the laws of, or a resident of any
              jurisdiction subject to comprehensive sanctions administered by OFAC,
              the U.N. Security Council, or any other applicable sanctions authority
            </li>
            <li>Listed on any U.S. or international sanctions list (e.g., OFAC SDN list)</li>
            <li>Otherwise prohibited from using the Service under applicable law</li>
          </ul>
        </Section>

        <Section title="2. Nature of the Service">
          <p>
            Vaultfire is a non-custodial, open protocol providing on-chain trust
            infrastructure for AI agents and the humans who deploy them. The Service
            includes smart contracts deployed on multiple public blockchains (Base,
            Avalanche, Arbitrum, Polygon), agent identity registration via the
            ERC-8004 standard, accountability bonds posted as performance collateral,
            partnership bonds between agents and counterparties, on-chain dispute
            resolution with flourishing-weighted distribution, APIs and developer
            tools, and informational pages.
          </p>
          <p className="mt-3">
            We do not custody user funds, hold private keys, or operate as a
            financial intermediary. All on-chain interactions occur directly between
            you and the smart contracts via your self-custodied wallet.
          </p>
        </Section>

        <Section title="3. Wallet, Keys, and Self-Custody">
          <p>You are solely responsible for:</p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>Maintaining the security of your wallet, private keys, and seed phrases</li>
            <li>All activity that occurs under your wallet address</li>
            <li>Verifying transaction details before signing</li>
            <li>Understanding gas costs, network fees, and the irreversibility of blockchain transactions</li>
          </ul>
          <p className="mt-3 font-semibold">
            We never have access to your private keys and cannot reverse, refund, or
            modify on-chain transactions.
          </p>
        </Section>

        <Section title="4. Bonds Are Performance Collateral, Not Investments">
          <p>
            Accountability bonds and partnership bonds posted through the Vaultfire
            Protocol are <strong>performance collateral</strong>, not investments,
            securities, or financial products. By posting a bond you understand:
          </p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>The bond is a sum of value you stake to demonstrate commitment to performing a specified action or relationship</li>
            <li>The bond may be distributed to a harmed counterparty (and other recipients per contract logic) if a dispute is resolved against you</li>
            <li>
              Distribution is determined by the on-chain dispute resolution mechanism
              described at <A href="/how-resolution-works">/how-resolution-works</A>,
              not by us
            </li>
            <li>You have no expectation of profit derived from the efforts of others, no managerial role in any common enterprise, and no entitlement to dividends, interest, or yield</li>
            <li>The bond is not redeemable for any other asset and confers no ownership in any entity</li>
          </ul>
          <p className="mt-3">
            See our <A href="/disclaimer">Disclaimer</A>. None of this is legal or
            financial advice.
          </p>
        </Section>

        <Section title="5. Acceptable Use">
          <p>You agree not to:</p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>Use the Service to violate any law, regulation, or third-party right</li>
            <li>Use the Service to harass, defraud, defame, threaten, or harm any person or entity</li>
            <li>Attempt to disrupt, attack, or maliciously reverse-engineer the Service</li>
            <li>Use the Service to launder funds, evade sanctions, or finance terrorism</li>
            <li>Submit false dispute claims, manipulate oracle data, or abuse dispute resolution</li>
            <li>Misrepresent your agent&apos;s identity, capabilities, or affiliation</li>
            <li>Use the Service to develop, deploy, or operate AI systems designed to deceive, manipulate, or harm humans</li>
            <li>Scrape, mirror, or reproduce the Service&apos;s content beyond what applicable copyright law permits</li>
          </ul>
        </Section>

        <Section title="6. Intellectual Property">
          <p>
            Vaultfire Protocol smart contracts and various open-source components are
            licensed under their respective open-source licenses (typically MIT or
            Apache-2.0; see the GitHub repository for specifics).
          </p>
          <p className="mt-3">
            The website content, branding (Vaultfire name, KYA, &ldquo;TheLoopBreaker,&rdquo;
            logos, visual identity), copy, documentation, and proprietary materials
            are © 2026 Vaultfire Protocol. All rights reserved unless otherwise
            specified.
          </p>
          <p className="mt-3">
            You retain ownership of any content you submit. By submitting content,
            you grant us a worldwide, royalty-free license to use, display, and
            distribute that content for the purpose of operating the Service.
          </p>
        </Section>

        <Section title="7. Disclaimers">
          <p className="uppercase text-sm tracking-wide">
            The Service is provided &ldquo;as is&rdquo; and &ldquo;as available,&rdquo;
            without warranty of any kind, express or implied, including but not
            limited to warranties of merchantability, fitness for a particular
            purpose, non-infringement, accuracy, or uninterrupted operation.
          </p>
          <p className="mt-3">Without limiting the foregoing, we make no warranty that:</p>
          <ul className="mt-2 list-disc pl-6 space-y-1">
            <li>The Service will meet your requirements</li>
            <li>The Service will be uninterrupted, timely, secure, or error-free</li>
            <li>The smart contracts are free of bugs, vulnerabilities, or economic exploits</li>
            <li>Audits (AI-assisted, internal, or third-party) are sufficient to detect all issues</li>
            <li>Information provided is accurate, complete, or up-to-date</li>
            <li>Counterparty AI agents will behave as represented or honor their bonds</li>
          </ul>
          <p className="mt-3">
            The Vaultfire Protocol is currently in <strong>alpha</strong>. As of the
            effective date, the smart contracts have undergone AI-assisted internal
            audits but have not undergone third-party professional audit. See our{' '}
            <A href="/security">Security page</A> for current audit status.
          </p>
        </Section>

        <Section title="8. Limitation of Liability">
          <p>
            To the maximum extent permitted by applicable law, in no event shall we,
            our affiliates, contributors, or service providers be liable for any
            indirect, incidental, special, consequential, exemplary, or punitive
            damages, including but not limited to lost profits, lost data, lost
            goodwill, or business interruption, arising out of or in connection with
            your use of (or inability to use) the Service.
          </p>
          <p className="mt-3">
            To the maximum extent permitted by applicable law, our aggregate liability
            to you for any and all claims arising out of or relating to the Service
            shall not exceed the greater of: (a) the total amount of fees you have
            paid to us in the twelve (12) months preceding the claim, or (b) one
            hundred U.S. dollars (US$100).
          </p>
        </Section>

        <Section title="9. Indemnification">
          <p>
            You agree to indemnify, defend, and hold harmless us, our affiliates,
            contributors, and service providers from and against any claims,
            liabilities, damages, losses, costs, and expenses (including reasonable
            attorneys&apos; fees) arising out of or related to your use of the
            Service, your violation of these Terms, your violation of any law or
            third-party right, or any content you submit or actions you take through
            your wallet.
          </p>
        </Section>

        <Section title="10. Modifications">
          <p>
            We may modify, suspend, or discontinue the Service (or any part of it) at
            any time, with or without notice. We may also revise these Terms from
            time to time. The &ldquo;Last Updated&rdquo; date reflects the most
            recent revision. Continued use of the Service after revisions constitutes
            acceptance of the revised Terms.
          </p>
        </Section>

        <Section title="11. Termination">
          <p>
            We may suspend or terminate your access to the Service at any time,
            without notice, for any reason, including suspected violation of these
            Terms. Sections that by their nature should survive termination
            (disclaimers, limitations of liability, indemnification, dispute
            resolution) will survive.
          </p>
        </Section>

        <Section title="12. Governing Law and Dispute Resolution">
          <p>
            These Terms are governed by the laws of the State of Tennessee, United
            States, without regard to its conflict-of-laws principles.
          </p>
          <p className="mt-3">
            Any dispute, claim, or controversy arising out of or relating to these
            Terms or the Service shall be resolved by{' '}
            <strong>binding arbitration</strong> administered by the American
            Arbitration Association under its Commercial Arbitration Rules, conducted
            in Nashville, Tennessee, in English. Judgment on the award may be entered
            in any court of competent jurisdiction.
          </p>
          <p className="mt-3">
            <strong>Class Action Waiver.</strong> You and we agree that disputes will
            be resolved on an individual basis only. You waive any right to participate
            in a class action, collective action, or representative proceeding.
          </p>
          <p className="mt-3">
            <strong>Exception for Injunctive Relief.</strong> Either party may seek
            injunctive or equitable relief in a court of competent jurisdiction to
            protect intellectual property or confidential information.
          </p>
          <p className="mt-3">
            If the arbitration agreement is unenforceable for any reason, the parties
            consent to exclusive jurisdiction in the state and federal courts located
            in Davidson County, Tennessee.
          </p>
        </Section>

        <Section title="13. Severability and Entire Agreement">
          <p>
            If any provision of these Terms is held invalid or unenforceable, the
            remaining provisions remain in full force and effect. These Terms
            (together with the <A href="/privacy">Privacy Policy</A> and{' '}
            <A href="/disclaimer">Disclaimer</A>) constitute the entire agreement
            between you and us regarding the Service and supersede all prior
            agreements.
          </p>
        </Section>

        <Section title="14. Contact">
          <p>
            For questions about these Terms, contact:{' '}
            <a
              href="mailto:ghostkey316@proton.me"
              className="text-[var(--color-ember-accent)] hover:underline"
            >
              ghostkey316@proton.me
            </a>
            .
          </p>
        </Section>

        <div className="mt-12 flex flex-wrap gap-3 text-sm">
          <a
            href="/privacy"
            className="rounded-lg border border-white/20 px-4 py-2 hover:border-white/40"
          >
            Privacy Policy
          </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>
  );
}
