// VELOUR marketing — Privacy and Terms.
//
// DRAFTS. NOT LEGAL ADVICE, AND NOT REVIEWED BY A LAWYER. Written from the actual
// system rather than from a template, which is the part a generic policy gets
// wrong: every claim below was checked against the code it describes, and each one
// carries a note saying where. That makes it useful to hand an attorney and
// dangerous to publish unread.
//
// THE THREE BLANKS ARE FILLED. VELOUR APP LLC was formed in Florida on 24 August
// 2026, document number L26000445539, and the values in the LEGAL object below are
// transcribed from the filed Articles of Organization rather than typed from
// memory. There is now a real counterparty for these documents to bind, which is
// the thing that was missing. See docs/GO_LIVE_CHECKLIST.md §2.
//
// The state records the name in capitals as VELOUR APP LLC; that is Florida's
// house style for the register, not a styling of the name, so it reads as "Velour
// App LLC" in prose here. The BRAND is unaffected either way — the product is
// VELOUR, and the terms say the entity "operates VELOUR", which is the ordinary
// shape for a company whose legal and trading names differ.
//
// The address is the registered agent's office (Northwest Registered Agent), which
// is what the state holds as the principal address. It is already public on the
// Florida register, so publishing it discloses nothing new.
//
// STILL TRUE, AND THE REASON THIS FILE IS NOT DONE: nothing here has been read by
// a lawyer. Naming the entity makes these documents bind something real, which
// raises the cost of a mistake rather than lowering it.

// Moves whenever the DOCUMENTS change, not whenever the file does. Naming the
// counterparty is a change to what these terms say, so it moves now.
//
// IT IS ALSO THE VERSION MEMBERS ARE RECORDED AS HAVING ACCEPTED, as of 2 Sep
// 2026. api/signup.js holds TERMS_VERSION with the same string and writes it into
// public.users.terms_version at signup (migration 016). MOVE BOTH TOGETHER: this
// value drifting ahead of the server's means members are recorded as agreeing to
// a version of the text they were never shown, which is worse than holding no
// record at all — the whole point of the column is that it can be trusted.
const LEGAL_UPDATED = "15 September 2026";

// THE THREE BLANKS, IN ONE PLACE. They appear five times across the two documents,
// so filling them in should be three edits here rather than five hunts through
// prose — a half-filled legal page is worse than an obviously empty one.
//
// Leave a value null and it renders as a loud terracotta placeholder. Set it to a
// string and it becomes ordinary text everywhere it appears, in both documents, at
// once.
//
// The entity is NOT expected to be "VELOUR LLC": that name is taken, and the working
// answer is "Velour App LLC". THE BRAND DOES NOT CHANGE. The product is VELOUR and
// the terms already say the entity "operates VELOUR", which is the normal and honest
// shape for a company whose legal name and trading name differ.
// Each value is written to fit the sentence it lands in, so read those before
// editing one — the prose supplies the connecting words, not these strings:
//   "VELOUR is operated by {entity}, of {address}."
//   "These terms are between you and {entity}, of {address}, which operates VELOUR."
//   "These terms are governed by the laws of {law}."
const LEGAL = {
  entity: "Velour App LLC",
  address: "7901 4th St N, Ste 300, St. Petersburg, FL 33702",
  law: "the State of Florida",
};

// A blank that shouts. Deliberately ugly: a placeholder that blends in is a
// placeholder that ships.
function TBD({ field, children }) {
  const filled = field && LEGAL[field];
  if (filled) return <React.Fragment>{filled}</React.Fragment>;
  return (
    <mark style={{ background: "var(--terracotta-fill, #F6E7DE)", color: "var(--terracotta-text, #8A4B28)", padding: "1px 7px", borderRadius: 5, fontWeight: 600, fontFamily: "var(--font-sans)", fontSize: "0.92em", whiteSpace: "nowrap" }}>
      [{children}]
    </mark>
  );
}

function LegalShell({ eyebrow, title, lede, children }) {
  return (
    <article>
      <window.Section pad={84} style={{ paddingBottom: 0 }}>
        <div style={{ maxWidth: 760, margin: "0 auto" }}>
          <window.Eyebrow>{eyebrow}</window.Eyebrow>
          <h1 style={{ fontFamily: "var(--font-serif)", fontWeight: 500, fontSize: 52, lineHeight: 1.1, letterSpacing: "-0.02em", color: "var(--text-primary)", margin: "20px 0 0", textWrap: "balance" }}>{title}</h1>
          <p style={{ fontFamily: "var(--font-sans)", fontSize: 18.5, lineHeight: 1.7, color: "var(--text-secondary)", margin: "22px 0 0" }}>{lede}</p>
          <p style={{ fontSize: 13.5, color: "var(--text-tertiary)", margin: "18px 0 0" }}>Last updated {LEGAL_UPDATED}</p>
        </div>
      </window.Section>
      <window.Section pad={56} style={{ paddingTop: 40 }}>
        <div style={{ maxWidth: 760, margin: "0 auto", fontFamily: "var(--font-sans)", fontSize: 16.5, lineHeight: 1.75, color: "var(--text-secondary)" }}>
          {children}
        </div>
      </window.Section>
    </article>
  );
}

function H({ children }) {
  return <h2 style={{ fontFamily: "var(--font-serif)", fontWeight: 500, fontSize: 25, lineHeight: 1.25, letterSpacing: "-0.01em", color: "var(--text-primary)", margin: "44px 0 14px" }}>{children}</h2>;
}
function P({ children }) { return <p style={{ margin: "0 0 18px" }}>{children}</p>; }
function LI({ children }) { return <li style={{ margin: "0 0 10px" }}>{children}</li>; }
function UL({ children }) { return <ul style={{ margin: "0 0 18px", paddingLeft: 22 }}>{children}</ul>; }

function PrivacyPage() {
  return (
    <LegalShell
      eyebrow="Privacy"
      title="What we hold, and what we don't."
      lede="Written from the system rather than from a template. Everything below describes what VELOUR actually does today."
    >
      <P>VELOUR is operated by <TBD field="entity">legal entity</TBD>, of <TBD field="address">registered address</TBD>. If anything here is unclear, write to <a href="mailto:admin@tryvelour.com" style={{ color: "var(--text-primary)" }}>admin@tryvelour.com</a>.</P>

      <H>What we collect</H>
      <UL>
        <LI><strong>Your email address</strong>, because it is how you sign in. VELOUR has no passwords — we send a one-time link instead — so your address is the account.</LI>
        <LI><strong>Your first name and your onboarding answers</strong>: what you want to tend to, how you want the product to feel, and the first ritual you choose.</LI>
        <LI><strong>Your timezone</strong>, taken from your browser at signup, so that dates we print match the day you are actually living in.</LI>
        <LI><strong>What you log</strong>: rituals, wellness entries, the pieces in your wardrobe and what you paid for them, and what you spend.</LI>
        <LI><strong>A payment reference</strong> if you subscribe. Card details are handled by our payment processor and never reach us.</LI>
      </UL>

      <H>Photographs, and the one switch that moves them</H>
      <P>Wardrobe photographs are stored in your browser, on the device that took them. They are not uploaded to us unless you turn photo sync on, and it is off until you do — enforced by the database itself rather than by our code remembering to check.</P>
      <P><strong>If you do turn it on</strong>, copies of your photographs are kept in our storage so that your closet reaches your other devices. Turning it back off deletes those copies. That is the whole of what the switch does, in both directions.</P>
      <P><strong>One more exception, and it is a real one.</strong> If you ask VELOUR to identify a garment from a picture, that picture is sent to an outside AI service to be analysed, whatever the sync switch says, and the answer comes back to you. We do not keep the image. "Your photographs never leave your device" would be false, so we do not say it.</P>

      <H>Who else touches your data</H>
      <P>VELOUR is a small product built on other people's infrastructure. We are not going to pretend otherwise, so here is what runs underneath it:</P>
      <UL>
        <LI><strong>A cloud database and sign-in provider</strong>, in the United States. Your account and everything you log live here.</LI>
        <LI><strong>A hosting provider</strong>, in the United States, which serves the site and runs the code that answers your requests.</LI>
        <LI><strong>A payment processor</strong>, if you subscribe. They hold your card; we hold a reference.</LI>
        <LI><strong>An email provider</strong>, for the sign-in links and receipts we send you.</LI>
        <LI><strong>An AI provider</strong>, for the stylist, the budget advisor and photo identification. What is sent is only what the feature needs: the occasion and your closet, your budget and your closet, or the single image you asked about.</LI>
        <LI><strong>A newsletter provider</strong>, only if you joined the waitlist. Separate from your VELOUR account.</LI>
      </UL>
      <P>Each of them is bound to protect your data to the standard described on this page, and none of them may use it for their own purposes.</P>
      <P>We do not sell your data, and we do not run advertising or third-party analytics against it.</P>
      <P>If you want to know exactly which companies these are, ask us at <a href="mailto:admin@tryvelour.com" style={{ color: "var(--text-primary)" }}>admin@tryvelour.com</a> and we will name them.</P>

      <H>Two things we deliberately do not keep</H>
      <UL>
        <LI><strong>Your IP address.</strong> We use it to stop abuse, but we never store it. It is put through a one-way keyed hash first, and only that hash is kept.</LI>
        <LI><strong>What you asked the AI.</strong> We record that a request happened, on which day, to which feature — enough to count usage against a daily limit. The contents are not stored.</LI>
      </UL>

      <H>Your data is yours</H>
      <P>Ask us for a copy and we will send you one. Ask us to delete your account and we will delete it, along with everything attached to it. Either request goes to <a href="mailto:admin@tryvelour.com" style={{ color: "var(--text-primary)" }}>admin@tryvelour.com</a>. Photographs are the most literally yours: clearing your browser removes the copies on your device without asking us, and if you have photo sync on, turning it off deletes the copies we hold.</P>

      <H>Children</H>
      <P>VELOUR is not for people under 16, and we do not knowingly collect anything from them.</P>

      <H>Changes</H>
      <P>If this changes in a way that matters, we will tell you by email rather than quietly updating the date at the top.</P>
    </LegalShell>
  );
}

function TermsPage() {
  return (
    <LegalShell
      eyebrow="Terms"
      title="The agreement, in plain words."
      lede="Short, because the product is small and the arrangement is simple."
    >
      <P>These terms are between you and <TBD field="entity">legal entity</TBD>, of <TBD field="address">registered address</TBD>, which operates VELOUR. Using VELOUR means you accept them.</P>

      <H>Your account</H>
      <P>You sign in with a one-time link sent to your email address, so keeping that mailbox secure is what keeps your account secure. One account is for one person. You are responsible for what happens under yours.</P>

      <H>What you get</H>
      <P>A free account, with a limit on how many rituals you can keep at once. A paid membership removes that limit and adds the stylist, the budget advisor, photo identification and the monthly letter. We may change what is included, and if we reduce it in a way that matters we will tell you first.</P>

      <H>Paying, and stopping</H>
      <UL>
        <LI><strong>Monthly</strong> renews every month until you stop it.</LI>
        <LI><strong>Annual</strong> is a single charge covering twelve months. It is not twelve monthly payments.</LI>
        <LI><strong>You can cancel at any time</strong>, from Manage membership on the pricing page. No email required, no conversation, no retention offer.</LI>
        <LI><strong>If you cancel an annual membership partway through, we refund the months you have not used.</strong> Monthly memberships run to the end of the period you have paid for and are not renewed.</LI>
      </UL>
      <P>Prices can change, but never for a period you have already paid for, and we will tell you before a renewal at a new price.</P>

      <H>Your content is yours</H>
      <P>Everything you put into VELOUR — your rituals, your wellness notes, your wardrobe, your photographs — belongs to you. We do not claim ownership of it and we do not use it to train anything. We store it so we can show it back to you, and we delete it when you ask.</P>

      <H>What VELOUR is not</H>
      <P>VELOUR is not medical, financial or professional advice. The wellness features are a place to keep notes, not a clinician. The budget advisor and cost-per-wear figures are arithmetic on numbers you entered, not financial guidance. The stylist has opinions, and they are only opinions. Decisions that matter should involve someone qualified.</P>

      <H>AI features</H>
      <P>The stylist, the budget advisor and photo identification are generated by a language model. They are sometimes wrong. Read them as suggestions from something that has never seen you, because that is what they are. There is a daily limit on how many you can request, which exists to keep the cost of the product sane.</P>

      <H>Fair use</H>
      <P>Do not attempt to break the service, get around its limits, resell it, or use it to do something illegal. We can close an account that does, and we will refund anything unused if we do.</P>

      <H>The unglamorous part</H>
      <P>VELOUR is provided as it is. We work hard to keep it running and your data safe, but we cannot promise it will never be unavailable or never lose anything — which is exactly why the app can export a copy of your data, and why you should keep one. To the extent the law allows, our liability is limited to what you have paid us in the last twelve months.</P>
      <P>Photographs are the one thing we cannot restore for you, because they never leave your device. If they matter, keep a copy somewhere else too.</P>

      <H>Governing law</H>
      <P>These terms are governed by the laws of <TBD field="law">jurisdiction</TBD>.</P>

      <H>Talking to us</H>
      <P>Questions about a charge go to <a href="mailto:billing@tryvelour.com" style={{ color: "var(--text-primary)" }}>billing@tryvelour.com</a>. Everything else goes to <a href="mailto:admin@tryvelour.com" style={{ color: "var(--text-primary)" }}>admin@tryvelour.com</a>. A person reads both.</P>
    </LegalShell>
  );
}

window.PrivacyPage = PrivacyPage;
window.TermsPage = TermsPage;
