---
name: storefront-churn
description: Restyle the openb2b storefront to the Churn design, the farm store of a farmer-owned dairy co-operative in New Zealand, with the member price on every product, pooled group orders with closing dates, a dividend estimator, member notices and votes, and a season dial for the dairy year. Use when asked to apply the Churn design to the storefront.
---

Read storefront/AGENTS.md and the "Folders and the storefront rule" and "Styling" sections of docs/code.md first.

Rebuild the storefront as the "Churn" design. The finished store must look and behave like the preview at https://openb2bshop.com/preview/churn: open it, take screenshots at 1440px and 390px, and use them with the description below as the reference. Churn is the farm store of a farmer-owned dairy co-operative in New Zealand, with the member price on every product, pooled group orders with closing dates, a dividend estimator, member notices and votes, and a season dial for the dairy year.

## Colours

Set these as the storefront's colour tokens in storefront/styles.css, and give the dark theme the same values so the store looks the same in both:

- Page background (--color-background): #f6f9fc
- Text (--color-foreground): #0f2a44
- Secondary text (--color-muted-foreground): #566b80
- Surfaces such as cards, fields and the trade terms band (--color-card, --color-muted): #ffffff
- Main buttons, icons and active pills (--color-primary): #2f7d3b, with text in #ffffff (--color-primary-foreground)
- Hairlines, where the design draws one: #d3e1ed

## Type

- Titles: Newsreader from Google Fonts.
- Text, buttons and labels: Manrope from Google Fonts.
- Load the fonts in storefront/fonts.ts and point --font-display and --font-sans at them.
- Titles keep tight letter-spacing (about -0.02em).
- Keep the type scale's token names; change only the faces.

## Shape

- Buttons, pills and the header's login button: 16px corners.
- Cards, panels and pictures: 16px corners.

## Home page, top to bottom

The home page tells the buyer these things in order, one per section:

1. The co-operative's farm store sells supplies to its member farms at the member price.
2. The summer liner change, the calving order for 2027 and the vote on the calf milk plant.
3. The open group orders with their fill and closing dates.
4. A saved list repeats the monthly shed supplies.
5. The dividend estimator turns a season's spending into the member saving and the dividend.
6. A pinned season dial shows the supplies for each part of the dairy year and ends with the next group order.

The main action is 'Shop the farm store', a filled green button in the hero and in the closing band. 'Open group orders' is the text link beside it.

1. Colours: the page is #f6f9fc, text #0f2a44 with secondary text #566b80, cards #ffffff, alternate sections #e6f0f8, hairlines #d3e1ed. #2f7d3b is the only brand colour (buttons, the chosen option's 2px border, links), with #dcefdd as its tint for the current price break and chips; the dark band is #0f2a44. Titles are Newsreader at weight 500 in sentence case, at most 58px in a hero and 42px on a page; text is Manrope at 15px. Corners are 16px on cards and 12px on buttons.
2. Header on every page: three rows: a strip in the accent tint with the notice; a row 72px tall with the phone number and opening hours on the left, the wordmark with its tagline in the middle, and the buyer's company with a filled cart button on the right; and a centred row 44px tall under a hairline with the pages and 'Request a quote' in the accent colour. The pages are Farm store, Group orders, Membership, About us, Stores, Contact. Below 1024px a menu button opens them as a list.
3. Footer on every page: the soft ground as a colophon: on the left the wordmark set at 32px, one sentence, the phone in the display face and the email; on the right labelled rows under hairlines with the label in a narrow column (address, opening hours, standards, and each group of links as one row).
4. Geometry: content is at most 64rem wide with a roomy gutter; section spacing is regular; product cards run 3 in a row from 1024px with pictures at 1 / 1; headings are large in scale; section heads are left-aligned; sections are separated by space alone.
5. Controls: option buttons and fields are filled; specification and break tables are ruled; chips are pills; tabs are pills; the main button is raised; cards are lifted by a soft shadow; rows are airy in spacing.
6. Drawings: woven feed bags with a coloured band and their content spilled in front (calf milk, calf meal, minerals, palm kernel), tubs and teats, a ten-teat calf feeder, a calf cover, 20 and 200 litre drums and a molasses pod in its cage, boxes of filter socks and gloves, milking liners and a claw, tube rolls, numbered ear tags and gumboots. A milk vat on its stand fills to a level with its temperature and litres on a gauge.
7. Hero (bespoke): serif title with an italic green accent, text and the action on the left; on the right the milk vat that fills with the scroll, a glass card with the member price against the struck list price and another with the dividend, over a soft green glow.
8. Campaigns (kit: Campaigns).
9. Group orders (kit: PoolsTeaser): three open pools with closing dates, pooled price and fill bars.
10. Order again (kit: ReorderStrip).
11. Dividend estimator (bespoke): a spending slider; a card with the member saving and the dividend at 32px, a sentence with the band and the share holding, and an outlined link to the membership page.
12. Season stage (bespoke, pinned): a ring of twelve months with four season arcs that turns so the season sits at the top, with its drawing in the middle, beside the season name, text and three product links, ending with the next group order and its fill bar.
13. Closing band (kit: CtaBand) on navy.

## The other pages

The preview is a whole storefront. Open each page at https://openb2bshop.com/preview/churn/<path>, take screenshots at 1440px and 390px, and build the store's page to match. Every page tells the buyer a few things in a fixed order, one per section, and has one main action. Don't add a section that isn't in the page's list, and don't add a second filled button beside the main action.

### Catalogue (/products)

1. Churn lists 30 products in 5 collections at the buyer's trade price.
2. A buyer narrows the list by collection, by stock or by a search from the header.
3. A line of 10 or more costs 4% less, and each product shows its own breaks.

The main action is 'Add to order' on a product, an outlined button that puts the product's minimum quantity in the order and reads 'Added' for two seconds.

Two columns from 1024px: a pinned list of the collections with their counts (the chosen one is a white bordered pill), the stock toggle and the sort order; on the right each collection's numbered name above its products as short horizontal cards two in a row (a square drawing, name, key fact, price and add button).

### Product page (/products/calf-milk)

1. Calf milk replacer, 20 kg: A whole-milk replacer made at our own plant from members' milk, with 24% protein and 18% fat. Mix 150 g in 1 litre of warm water; one bag rears a calf for about four weeks.
2. Every option group has a label with its current value, and the drawing follows the choice.
3. The quantity shows its price breaks, and the total follows it.
4. The specification, the delivery facts and the products that go with it come under the first screen.

The main action is 'Add to order', the filled button in the pinned buy area. After a click it reads 'Added' and a link to the order appears beside the total.

Own arrangement like a member statement: the drawing sticky on the left; on the right the name and stock, a shadowed card with three figures (member price, list price struck through, dividend on this line), a soft card with the open group order for the product (closing date, pooled price, fill bar, a link to commit), the options and the buy box. A soft band follows with the specification beside how members pay. On a phone the drawing is pinned at the top at 36% of the height, the options scroll under it and the buy bar is pinned at the bottom. Below: specification rows beside the description, three delivery facts, related products.

### Collections (/collections)

1. Churn groups its catalogue into 5 collections.
2. Each collection has a page with its own text and its products.

The main action is 'Browse the catalogue' in the page head; each collection is a link.

Cards two in a row: the collection's drawing in a frame, its number and name, one sentence and its product count.

### Collection page (/collections/calf-rearing)

1. Calf milk replacer from members' milk, calf meal, feeders, teats and covers.
2. Our calf milk replacer is made at our own plant from members' milk, so it comes back to the farm at the member price.
3. Order before calving through the group order, which closes at the end of February.

The main action is 'Add to order' on a product.

A soft band with the name, one sentence and three figures (products, in stock, dispatch from) beside the collection's drawing; the collection's paragraphs beside a small title; its products in the catalogue's card or table shape; a link to the next collection.

### The order (/cart)

1. The order lists each line with its options and the break it has reached.
2. Delivery costs NZ$18.00 and is free over NZ$500.00; the smallest order is NZ$50.00.
3. A buyer who needs a price on paper sends the lines as a quote request.

The main action is 'Check out', a full-width filled button in the summary. 'Request a quote' is the text link under it.

Two columns from 1024px: the lines as one card per line with its drawing, options, stepper, the break it has reached, a field for the buyer's reference and the line total, and a pinned summary with goods, quantity breaks, delivery, GST and the total. Empty, the page says so, links to the catalogue and shows three products.

### Checkout (/checkout)

1. The buyer chooses the delivery address and the day.
2. Payment is on account (charged to your milk payment on the 20th of the following month), by card or by bank transfer, with a purchase order number.
3. Placing the order shows its number and puts it first on the account page.

The main action is 'Place the order'.

Four numbered blocks on one page (delivery address, delivery day, payment, reference), each with its current value beside its title, and the order summary pinned on the right with 'Place the order'.

### Account (/account)

1. Matai Farm Partnership sees its orders, quotes, invoices and saved lists.
2. An order opens to its lines, a quote row opens the quote's page and an invoice can be paid.
3. The Messages tab lists the threads with the supplier about an order, a quote or a general question; a reply typed in the box joins the thread.
4. A saved list goes into the order in one click.

The main action is 'Start a new order' in the page head.

A row of four figures (open balance, free credit, terms, orders this year), then tabs for orders, quotes, invoices, saved lists and company.

### Quotes (/quotes)

1. Matai Farm Partnership sees every quote the supplier has prepared.
2. A row shows the number, the title, the date until which the prices are valid, the status and the total, and opens the quote.

The main action is 'Request a quote' in the page head.

The quotes as rows under hairlines; each row is a link to the quote's page.

### Quote (/quotes/q-1187)

1. Silicone liners for the whole shed.
2. The buyer reads the lines with quantity, price of one and line total, and the date until which the prices are valid.
3. Accepting the quote turns it into an order.
4. The buyer can write to the supplier about the quote, and the reply joins the thread.

The main action is 'Accept and convert to order' in the summary box.

Two columns from 1024px: on the left the number with a status chip, the title, the lines as a table and under it the messages about the quote with a reply box; on the right a pinned bordered box with goods, tax and total, the validity and payment terms, the accept button and a link to request a changed quote. After accepting, the button is replaced by a tinted note with the new order number.

### Sign in (/login)

1. Churn sells to trade customers.
2. A buyer signs in, or applies for an account in the second tab.

The main action is 'Sign in', and 'Send the application' in the second tab.

Two columns: the title, one sentence, a picture and four rows of terms on the left; a card with the two tabs and their forms on the right.

### About us (/about)

1. Churn began in 1946, when 62 farmers near Hamilton built a butter factory together so that they could sell their cream at a fair price. The co-operative still belongs to the farms that supply its milk.
2. Today 1,140 member farms supply about 520 million litres of milk a year. We make butter, milk powder and calf milk replacer, and the farm store sells members the supplies they need for the season.
3. Members pay 6% less than the list price on every farm store product and can charge purchases to their monthly milk payment. Group orders buy large quantities ahead of each season at a lower price.
4. At the end of each season, the surplus of the farm store goes back to members as a dividend on what they bought. For the 2025/26 season the dividend was 3.2% for most farms.

The main action is 'Browse the catalogue' in the closing band.

A wide picture, the history in one reading column with the dated events beside it, four figures between hairlines, the people as cards with initials, the certificates as four boxes.

### Our process (/process)

1. We plan with members: Before each season we ask members what they need, from calf milk replacer before calving to liners before the summer change.
2. We open a group order: Members commit quantities online before a closing date. The more members join, the lower the price for everyone.
3. We buy in bulk: When the order closes, we buy the whole quantity in one contract and pass the saving on at the pooled price.
4. We make calf milk replacer: Our own plant turns members' milk into calf milk replacer, which comes back to the farms at the member price.
5. We deliver to the farm: Our trucks deliver to the farm or to one of our three stores, on the day you choose.
6. We pay the dividend: At the end of the season, the farm store surplus goes back to members in proportion to what they bought.

The main action is 'Browse the catalogue' in the closing band.

One line down the page with a numbered round stop for each step, its title, text and a chip with its figure. A picture above, and the lead times as rows below.

### Contact (/contact)

1. Each department has its own number and address.
2. A message goes to the chosen department and is answered within one working day.

The main action is 'Send the message'.

The departments as selectable rows with the address and the opening hours under them on the left; the form on the right, whose title names the chosen department.

### Questions and answers (/faq)

1. Who can become a member?
2. How is the dividend worked out?
3. How do group orders work?
4. What is the minimum order?

The main action is 'Contact the sales desk' in the box under the questions.

The questions grouped by subject, each group with its name on the left and an accordion on the right in which one answer is open at a time.

### Delivery and terms (/terms)

1. Prices and member price: Prices are in New Zealand dollars and exclude GST at 15%. Members pay 6% less than the list price on every product, before quantity breaks.
2. Group orders: Members commit quantities online before the closing date. The pooled price applies to everyone in the group order and is lower when more members join.
3. Delivery and collection: Orders placed by 3 p.m. are delivered to the farm the next working day in the Waikato. Farm delivery costs NZ$18.00 and is free on orders over NZ$500.00.
4. Payment: Members charge purchases to their milk payment, and the amount is deducted on the 20th of the following month.
5. Returns and the dividend: You can return unopened products within 30 days for a full credit. Opened chemicals and calf milk replacer cannot be returned.

The main action is 'Browse the catalogue' at the end.

Four figures in a box, the delivery zones as a table beside the quantity breaks and lead times, then the numbered sections of the terms.

### Quote request (/quote)

1. A buyer describes the job or sends the lines already in the cart.
2. The sales desk replies within one working day, and an accepted quote becomes an order.

The main action is 'Send the quote request'.

The form on the left (project name, needed by, description) and the cart's lines with their total on the right.

### Journal (/journal)

1. When to change milking liners: Worn liners slow milking and raise cell counts. This is how to work out your change date.
2. Planning calf milk replacer for the season: Order calf milk replacer before calving through the group order and store it dry.
3. Filling the summer feed gap: Dry summers cut pasture growth. Plan supplements now to keep cows in milk.

Each entry is a link; an entry page ends in 'Browse the catalogue'.

Three entries in a row with a drawing, the date and author, the title and the excerpt; an entry page is one reading column.

### Locations (/locations)

1. Hamilton farm store (Store and head office): The full farm store range and calf milk replacer from our plant.
2. Morrinsville store (Store): Shed hygiene, rubberware, calf rearing and nutrition.
3. Te Awamutu store (Store): Shed hygiene, rubberware and calf rearing.

The main action is 'Contact the sales desk' in the page head; a pin or a card's title selects a site.

Two columns from 1024px: a pinned drawn map (a river, roads and blocks in the theme's tones) with a numbered round pin for each site and the chosen site's name and note under it; on the right one bordered card per site with its number, name, kind as a chip, address, direct line, opening hours and the stock held there.

### Trade shows (/events)

1. National Agricultural Field Days, Hamilton, 9 to 12 June 2027: Dairy pavilion, Site D45.
2. Dairy Farmers Conference, Rotorua, 16 to 17 March 2027: Hall 2, Stand 18.
3. Calf Rearing Day, Cambridge, 24 June 2027: Main shed, Stand 4.

The main action is 'Book a meeting at the stand' in the page head, which opens the contact page; each show has an outlined 'Book a meeting' button.

The shows as rows under hairlines: the dates with a calendar icon, the name with the city and two sentences, and a small table with the hall and the stand above the button. Under them, on the soft ground, the awards as rows with the year, the title and the body that gave it; the same rows close the About page.

### Membership (/membership)

1. Churn belongs to the farms that supply its milk. A member holds NZ$1,000.00 of shares, pays the member price on every farm store product, joins the group orders and receives a dividend on what the farm buys.
2. Each member farm has one vote at the annual meeting, whatever the size of the herd. The seven board members are farmers elected for three-year terms.
3. The farm store's surplus after costs and reserves goes back to members each August in proportion to their purchases.

The main action is 'Apply for membership' in the page head.

Four figures in a box (share capital, member price, dividend, one vote), the benefits in two columns, the dividend bands as three boxes with large percentages, the board's notices beside the open votes, where choosing an option shows the count of each.

### Group orders (/group-orders)

1. Rubber liners for the summer change: NZ$36.90 per set against a list price of NZ$42.90, closing 4 December 2026.
2. Teat spray in 200-litre drums: NZ$789.00 per drum against a list price of NZ$899.00, closing 11 December 2026.
3. Calf milk replacer for the 2027 calving: NZ$129.00 per bag against a list price of NZ$149.00, closing 26 February 2027.

The main action is 'Join the order' on a group order, beside a quantity stepper.

One wide card per group order: the product's drawing, the closing date and delivery months, the text, a bar that shows the committed quantity with the buyer's own share in the accent colour, and the pooled price with the stepper and the button. Then four rows on how a group order runs.


## Interactions

- A product added on any page is in the order on the next page, and the header's count follows it. The order starts empty.
- Product page: an option changes the price of one, a colour repaints the drawing and a size reshapes it. The stepper follows the product's minimum and step, the current break cell is tinted and the total rolls to its new value.
- Cart: a stepper changes the line total, the break note under the line, the delivery charge and the total. Under the minimum order the page says how much is missing and 'Check out' is disabled.
- Checkout: choosing an address, a day or a payment moves the accent border. 'Place the order' empties the cart and shows the confirmation; the order is then the first row on the account page.
- Account: the tabs swap the section; an order row opens and closes its lines; accepting a quote and paying an invoice change the row's chip; a saved list adds its lines to the cart.
- The search field in the header (where the header has one) opens the catalogue with the matching products and a line that clears the search.
- Contact, quote request and the trade application show a confirmation in place of the form after sending.
- Motion is limited to transform and opacity: sections and cards rise in once, amounts roll, and no page has an idle loop.
- Hero: the vat fills and its litre reading rises while the page scrolls.
- Dividend estimator: the slider recalculates the saving, the band and the dividend.
- Season stage: the dial turns to each season and the text and products change; the last panel shows the next group order.
- Product page: the dividend on the line follows the quantity.

Build each part as a component in storefront/home or storefront/pages, and read every product, price, category and stock figure from kit/ in the route file. The names, products and numbers in the preview are sample content.

## The rest of the storefront

Carry the design through the category, product, cart, checkout, quote and account pages: the same colours, fonts, corners, buttons, cards and motion, so every page belongs to the same store.

## How to build it

This is how earlier redesigns of this storefront were done (see `git log` for "The homepage follows the Horizone template" and "The storefront moves like the template"). Do it the same way.

- Home page sections are blocks staff edit. The home route renders `<PageBlocks pageKey="home" />` (storefront/page-blocks.tsx), which draws the blocks arranged under Marketing → Page layout. Restyle the existing blocks to this design. For a section the store has no block for, add a section layout or a block: its schema in lib/homepage-blocks.ts, its component in storefront/home, its case in storefront/page-blocks.tsx, its form in admin/marketing (home-section-form.tsx, blocks.tsx, block-thumbnail.tsx), its labels in messages/en and messages/zh-CN, and its cases in lib/homepage-blocks.test.ts. Anything it reads from the store comes through kit/.
- The store starts with this design. Put the homepage's blocks, texts and pictures into prisma/seed-store.ts and public/seed, so a new store opens with this homepage, and set the same homepage on the local store.
- Restyle the whole storefront: the header and footer (storefront/site, storefront/layout), the product card, catalog, cart, checkout and account components (storefront/store), and the page bodies (storefront/pages).
- Colours, fonts, corners and the type and spacing scale are tokens in storefront/styles.css. Set them for the light theme and for `.dark`. When you change the scale, change its lists in scripts/lint/styling.mjs with it.
- Keep the store light. Motion is an accent: a short entrance, sections rising in, quick state changes and at most two small idle loops per page. Animate only opacity, translate and scale. No blur or backdrop filters on large areas, no SVG filters, no canvas, no video backgrounds, no parallax and no scroll or pointer handlers that re-render the page. Don't add an animation library.
- Motion is CSS in storefront/motion.css: entrances on load, sections and cards rising in on scroll with a stagger, hover lifts and state changes, with opacity, translate and scale only, and nothing under reduced motion. Keep the state itself in React.
- Icons are files in ui/store-icons, one per icon. Product and category pictures come from the catalog; a scene or a diagram is an SVG component in storefront/.
- If you change a shared ui/ component's markup, delete its entry in tests/ui-markup/fixtures and run `WRITE_MARKUP=1 bun test tests/ui-markup`.
- If the store has a design published through the MCP design tools, clear its colour, font and radius tokens, because they override storefront/styles.css.

## Rules

A storefront file reaches the rest of the app only through kit/: don't import from server/, admin/, services/ or lib/auth, and don't send or calculate a price in the browser. Show `yourPrice` and the totals the kit returns. Keep these working: add to cart stays on the page and shows the "Added" notice, checkout asks for the address before it shows shipping methods, and a guest can check out. Nothing scrolls sideways at 390px or 1440px.

## Finish

Run `bun run lint`, `bun test ./tests/architecture`, `bun test ./storefront ./lib/homepage-blocks.test.ts` and `bun test tests/ui-markup`, and fix what they report. Start the store with `bun run dev`, take screenshots of your home, catalog, product and checkout pages at 1440px and 390px, and compare the home page with the preview's screenshots section by section: layout, colours, fonts, spacing, corners and motion. Keep changing the storefront until they match. Then write the commit message the way this repository does, as sentences that say what the storefront now shows, and list the files you changed.
