Coffee roaster subscription page
A warm roaster site where picking a roast lifts its bag off the shelf, morphs a taste chart and rolls the price.
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./coffee-page.css";
/**
* CoffeePage: a warm one-page site for a small roaster ("Tarn Coffee").
* Its signature is the subscription builder: pick a roast and the bag lifts off
* the shelf, the taste chart morphs to the new coffee, and the price rolls.
* It is a demo: connect `onSubscribe` to your shop.
*/
type Taste = [number, number, number, number, number];
const AXES = ["Acidity", "Sweetness", "Body", "Bitterness", "Aroma"];
const ROASTS: {
id: string;
name: string;
origin: string;
notes: string[];
brew: string;
taste: Taste;
image: string;
alt: string;
tone: string;
}[] = [
{
id: "bright",
name: "Bright",
origin: "Huila, Colombia",
notes: ["Red apple", "Panela", "Lime zest"],
brew: "Best as filter or AeroPress",
taste: [0.92, 0.62, 0.34, 0.14, 0.82],
image: "/images/landing-coffee-bag-02.jpg",
alt: "A kraft coffee bag with a burnt-orange band on pale stone, light roasted beans at its base",
tone: "#c9652e",
},
{
id: "balanced",
name: "Balanced",
origin: "Sidama, Ethiopia",
notes: ["Milk chocolate", "Apricot", "Black tea"],
brew: "Great as filter, espresso or with milk",
taste: [0.6, 0.78, 0.6, 0.3, 0.7],
image: "/images/landing-coffee-bag-03.jpg",
alt: "The same kraft bag with a deep green band and medium roasted beans",
tone: "#35513b",
},
{
id: "dark",
name: "Dark",
origin: "Cerrado, Brazil",
notes: ["Cocoa nib", "Molasses", "Toasted almond"],
brew: "Made for espresso and moka pots",
taste: [0.24, 0.66, 0.92, 0.66, 0.6],
image: "/images/landing-coffee-bag-04.jpg",
alt: "The same kraft bag with a near-black band, dark oily beans and a brass scoop",
tone: "#2b2522",
},
];
const SIZES = [
{ id: "250", label: "250 g", cups: "about 16 cups", price: 11 },
{ id: "500", label: "500 g", cups: "about 33 cups", price: 20 },
{ id: "1000", label: "1 kg", cups: "about 66 cups", price: 36 },
];
const EVERY = [2, 3, 4];
/* ------------------------------------------------------------------ */
/** Photo with a toned stand-in underneath until the file exists. */
function Photo({
src,
alt,
tone,
className = "",
eager = false,
}: {
src: string;
alt: string;
tone: string;
className?: string;
eager?: boolean;
}) {
const img = useRef<HTMLImageElement>(null);
const [missing, setMissing] = useState(false);
useEffect(() => {
const el = img.current;
if (el && el.complete && el.naturalWidth === 0) setMissing(true);
}, []);
return (
<div
className={`gu-tarn__photo ${className}`}
style={{ "--tone": tone } as CSSProperties}
>
{!missing && (
<img
ref={img}
src={src}
alt={alt}
loading={eager ? "eager" : "lazy"}
onError={() => setMissing(true)}
/>
)}
</div>
);
}
/** Digits roll like a counter on a till instead of jumping. */
function Rolling({ value }: { value: string }) {
return (
<span className="gu-tarn__roll" aria-hidden="true">
{value.split("").map((ch, i) =>
/\d/.test(ch) ? (
<span key={`${value.length}-${i}`} className="gu-tarn__roll-col">
<span
className="gu-tarn__roll-strip"
style={{ "--d": Number(ch) } as CSSProperties}
>
{"0123456789".split("").map((n) => (
<span key={n}>{n}</span>
))}
</span>
</span>
) : (
<span key={`${value.length}-${i}`}>{ch}</span>
),
)}
</span>
);
}
/** A five-axis taste chart that morphs between coffees. */
function TasteChart({ taste, label }: { taste: Taste; label: string }) {
const [shape, setShape] = useState<Taste>(taste);
const from = useRef<Taste>(taste);
useEffect(() => {
const start = from.current;
const dur = window.matchMedia("(prefers-reduced-motion: reduce)").matches
? 1
: 750;
let raf = 0;
let t0 = 0;
const tick = (now: number) => {
if (!t0) t0 = now;
const p = Math.min(1, (now - t0) / dur);
// ease-out-back: a little overshoot, like a needle settling
const e = 1 + 2.2 * Math.pow(p - 1, 3) + 1.2 * Math.pow(p - 1, 2);
const next = start.map((v, i) => v + (taste[i] - v) * e) as Taste;
from.current = next;
setShape(next);
if (p < 1) raf = requestAnimationFrame(tick);
};
raf = requestAnimationFrame(tick);
return () => cancelAnimationFrame(raf);
}, [taste]);
const R = 92;
const pt = (i: number, v: number) => {
const a = -Math.PI / 2 + (i * 2 * Math.PI) / 5;
return [120 + Math.cos(a) * R * v, 120 + Math.sin(a) * R * v];
};
const ring = (v: number) => AXES.map((_, i) => pt(i, v).join(",")).join(" ");
return (
<figure className="gu-tarn__chart">
<svg viewBox="0 0 240 240" role="img" aria-label={label}>
{[0.25, 0.5, 0.75, 1].map((v) => (
<polygon key={v} points={ring(v)} className="gu-tarn__chart-grid" />
))}
{AXES.map((a, i) => {
const [x, y] = pt(i, 1);
const [lx, ly] = pt(i, 1.2);
return (
<g key={a}>
<line
x1="120"
y1="120"
x2={x}
y2={y}
className="gu-tarn__chart-grid"
/>
<text x={lx} y={ly} className="gu-tarn__chart-label">
{a}
</text>
</g>
);
})}
<polygon
points={shape.map((v, i) => pt(i, v).join(",")).join(" ")}
className="gu-tarn__chart-shape"
/>
{shape.map((v, i) => {
const [x, y] = pt(i, v);
return (
<circle
key={i}
cx={x}
cy={y}
r="4"
className="gu-tarn__chart-dot"
/>
);
})}
</svg>
</figure>
);
}
/** Counts down to the next Monday roast at 8:00. */
function useNextRoast() {
const [left, setLeft] = useState<string | null>(null);
useEffect(() => {
const update = () => {
const now = new Date();
const next = new Date(now);
next.setHours(8, 0, 0, 0);
const add = (8 - now.getDay()) % 7;
next.setDate(now.getDate() + add);
if (next <= now) next.setDate(next.getDate() + 7);
const ms = next.getTime() - now.getTime();
const d = Math.floor(ms / 864e5);
const h = Math.floor((ms % 864e5) / 36e5);
const m = Math.floor((ms % 36e5) / 6e4);
setLeft(`${d}d ${h}h ${String(m).padStart(2, "0")}m`);
};
update();
const id = setInterval(update, 30000);
return () => clearInterval(id);
}, []);
return left;
}
/** Adds `is-in` once an element scrolls into view (pass the setter as a ref). */
function useReveal<T extends Element>() {
const [node, setNode] = useState<T | null>(null);
const [inView, setInView] = useState(false);
useEffect(() => {
if (!node) return;
const io = new IntersectionObserver(
([e]) => {
if (e.isIntersecting) {
setInView(true);
io.disconnect();
}
},
{ threshold: 0.35 },
);
io.observe(node);
return () => io.disconnect();
}, [node]);
return [setNode, inView] as const;
}
/* ------------------------------------------------------------------ */
function Builder({
onSubscribe,
}: {
onSubscribe?: (order: { roast: string; size: string; weeks: number }) => void;
}) {
const [roast, setRoast] = useState(0);
const [size, setSize] = useState(0);
const [weeks, setWeeks] = useState(1);
const [done, setDone] = useState(false);
const r = ROASTS[roast];
const s = SIZES[size];
const perCup = (s.price / Number(s.cups.replace(/\D/g, ""))).toFixed(2);
return (
<section
className="gu-tarn__builder"
id="tarn-coffee"
aria-labelledby="tarn-b-title"
>
<div
className="gu-tarn__shelf"
style={{ "--band": r.tone } as CSSProperties}
>
{ROASTS.map((x, i) => (
<div
key={x.id}
className="gu-tarn__bag"
data-state={i === roast ? "on" : i < roast ? "before" : "after"}
aria-hidden={i !== roast}
>
<Photo src={x.image} alt={x.alt} tone={x.tone} />
</div>
))}
<span className="gu-tarn__shelf-shadow" aria-hidden="true" />
<p className="gu-tarn__origin-tag">
<span aria-hidden="true">●</span> {r.origin}
</p>
</div>
<div className="gu-tarn__panel">
<h2 id="tarn-b-title" className="gu-tarn__h2">
Pick your roast.
</h2>
{done ? (
<div className="gu-tarn__done" role="status">
<p className="gu-tarn__done-big">You're in.</p>
<p>
{s.label} of {r.name} ({r.origin}) every {EVERY[weeks]} weeks.
Your first bag is roasted on Monday and ships the next day.
</p>
<button
type="button"
className="gu-tarn__link"
onClick={() => setDone(false)}
>
Change the order
</button>
</div>
) : (
<form
onSubmit={(e) => {
e.preventDefault();
setDone(true);
onSubscribe?.({ roast: r.id, size: s.id, weeks: EVERY[weeks] });
}}
>
<fieldset className="gu-tarn__roasts">
<legend className="gu-tarn__legend">Roast</legend>
{ROASTS.map((x, i) => (
<label
key={x.id}
className="gu-tarn__roast"
style={{ "--band": x.tone } as CSSProperties}
>
<input
type="radio"
name="tarn-roast"
checked={roast === i}
onChange={() => setRoast(i)}
/>
<span className="gu-tarn__roast-dot" aria-hidden="true" />
{x.name}
</label>
))}
</fieldset>
<div className="gu-tarn__taste">
<TasteChart
taste={r.taste}
label={`Taste of ${r.name}: ${AXES.map((a, i) => `${a} ${Math.round(r.taste[i] * 10)} of 10`).join(", ")}`}
/>
<div>
<p className="gu-tarn__legend">Tastes like</p>
<ul className="gu-tarn__notes" key={r.id}>
{r.notes.map((n, i) => (
<li key={n} style={{ "--i": i } as CSSProperties}>
{n}
</li>
))}
</ul>
<p className="gu-tarn__brew">{r.brew}</p>
</div>
</div>
<fieldset className="gu-tarn__seg">
<legend className="gu-tarn__legend">Bag size</legend>
{SIZES.map((x, i) => (
<label key={x.id}>
<input
type="radio"
name="tarn-size"
checked={size === i}
onChange={() => setSize(i)}
/>
<span>
<strong>{x.label}</strong>
<small>{x.cups}</small>
</span>
</label>
))}
</fieldset>
<fieldset className="gu-tarn__seg">
<legend className="gu-tarn__legend">Delivered every</legend>
{EVERY.map((w, i) => (
<label key={w}>
<input
type="radio"
name="tarn-every"
checked={weeks === i}
onChange={() => setWeeks(i)}
/>
<span>
<strong>{w} weeks</strong>
</span>
</label>
))}
</fieldset>
<div className="gu-tarn__total">
<p>
<span className="gu-tarn__price">
€<Rolling value={String(s.price)} />
</span>
<span className="sr-only">€{s.price}</span>
<span className="gu-tarn__per">
per bag, €{perCup} a cup. Free delivery, skip or stop any
time.
</span>
</p>
<button type="submit" className="gu-tarn__cta">
Start my subscription
</button>
</div>
</form>
)}
</div>
</section>
);
}
export function CoffeePage({
onSubscribe,
}: {
onSubscribe?: (order: { roast: string; size: string; weeks: number }) => void;
}) {
const nextRoast = useNextRoast();
const [stepsRef, stepsIn] = useReveal<HTMLOListElement>();
return (
<div className="gu-tarn">
<header className="gu-tarn__hero">
<Photo
src="/images/landing-coffee-hero-01.jpg"
alt="A barista's hands pouring water from a black kettle into a glass pour-over dripper in a dim café"
tone="#2a1a12"
className="gu-tarn__hero-photo"
eager
/>
<svg
className="gu-tarn__steam"
viewBox="0 0 200 300"
aria-hidden="true"
>
<path d="M100 290 C 70 240, 130 200, 100 150 S 70 60, 100 10" />
<path d="M80 290 C 55 245, 110 205, 82 160 S 55 80, 84 30" />
<path d="M120 290 C 145 240, 95 200, 122 150 S 150 70, 118 20" />
</svg>
<nav className="gu-tarn__nav" aria-label="Main">
<a href="#" className="gu-tarn__logo">
Tarn<span>coffee</span>
</a>
<div className="gu-tarn__links">
<a href="#tarn-coffee">Coffee</a>
<a href="#tarn-origin">Origin</a>
<a href="#tarn-how">How it works</a>
</div>
<a href="#tarn-coffee" className="gu-tarn__pill">
Subscribe
</a>
</nav>
<div className="gu-tarn__hero-copy">
<p className="gu-tarn__kicker">
Small-batch roaster
{nextRoast && (
<span className="gu-tarn__chip">
<span className="gu-tarn__live" aria-hidden="true" />
Next roast in {nextRoast}
</span>
)}
</p>
<h1 className="gu-tarn__h1">
Roasted on Monday.
<br />
In your cup by Thursday.
</h1>
<p className="gu-tarn__lede">
Three coffees, roasted in batches of 12 kilos and sent within a day,
so every bag arrives at its best.
</p>
<a href="#tarn-coffee" className="gu-tarn__cta">
Pick your roast
</a>
</div>
</header>
<Builder onSubscribe={onSubscribe} />
<section
className="gu-tarn__origin"
id="tarn-origin"
aria-labelledby="tarn-o-title"
>
<Photo
src="/images/landing-coffee-farm-05.jpg"
alt="A farmer's hand holding a coffee branch heavy with ripe red cherries on a misty hillside"
tone="#4a2a1c"
className="gu-tarn__origin-photo"
/>
<div>
<h2 id="tarn-o-title" className="gu-tarn__h2">
We know every farm by name.
</h2>
<p className="gu-tarn__body">
We buy from five farms we visit every harvest, and we pay well above
the market price so they can keep growing great coffee.
</p>
<dl className="gu-tarn__facts">
<div>
<dt>Grown at</dt>
<dd>1,750 m</dd>
</div>
<div>
<dt>Picked</dt>
<dd>By hand</dd>
</div>
<div>
<dt>We pay</dt>
<dd>2.1× market</dd>
</div>
</dl>
</div>
</section>
<section
className="gu-tarn__how"
id="tarn-how"
aria-labelledby="tarn-h-title"
>
<h2 id="tarn-h-title" className="gu-tarn__h2">
From our roaster to your cup in four days.
</h2>
<ol
ref={stepsRef}
className={`gu-tarn__steps ${stepsIn ? "is-in" : ""}`}
>
{[
[
"Monday",
"We roast",
"Every order of the week goes into Monday's batches.",
],
[
"Tuesday",
"We pack and send",
"Bags rest overnight, then leave with the morning post.",
],
[
"Thursday",
"You brew",
"Your coffee arrives three days off roast, right when it opens up.",
],
].map(([day, title, text], i) => (
<li key={day} style={{ "--i": i } as CSSProperties}>
<span className="gu-tarn__day">{day}</span>
<h3>{title}</h3>
<p>{text}</p>
</li>
))}
</ol>
</section>
<footer className="gu-tarn__foot">
<p className="gu-tarn__logo">
Tarn<span>coffee</span>
</p>
<p>Roastery open Saturdays, 9 to 13. Come smell Monday's batch.</p>
</footer>
</div>
);
}
Paste this into ChatGPT, Claude, Cursor, v0, Lovable or Bolt. It describes the layout, motion, colors and accessibility and includes the code, so the AI can rebuild it in any framework.
# Build this UI piece: Coffee roaster subscription page
You are a senior front-end engineer. Recreate the piece below in my project. If I don't say which framework I use, ask once, then build it in that framework (React, Vue, Svelte, Angular, Astro, plain HTML/CSS/JS or anything else). Keep the behavior, motion, colors, spacing and accessibility exactly as described. Keep the code clean and commented for beginners.
## What it is
A warm one-page site for a small specialty coffee roaster ("Tarn Coffee"). Its signature is a subscription builder: choose one of three roasts and the bag on the shelf swings away while the new one lifts into place, a five-axis taste chart morphs to the new coffee, tasting notes pop in, and the price rolls like a till counter. Sections: a dark photo hero with live steam and a "Next roast in 2d 14h" countdown, the builder, an origin band with farm facts, a three-day "Monday, Tuesday, Thursday" timeline that draws itself, and a footer.
## Palette
Background #f3eee3, paper #ebe3d3, ink #1b1512, muted #6e6257, lines rgba(27,21,18,0.14), accent #e2561d (CTA, chart, timeline), focus ring #2b35ff. Each roast has its own band colour: bright #c9652e, balanced #35513b, dark #2b2522. Headings use a serif stack ("Iowan Old Style", "Palatino Linotype", Palatino, Georgia); everything else uses system-ui.
## Layout
- The root uses container queries; side padding is 5%.
- Hero: at least 680px tall, with the photo covering it under a left-to-right dark gradient. Nav: serif italic logo, three links (hidden under 760px) and an outlined "Subscribe" pill. Copy sits bottom left: a kicker line with a live countdown chip, a serif headline up to 6rem, a lede and an orange CTA. Three SVG steam paths rise over the right side.
- Builder: at 860px and wider, two columns. The left one is a sticky 4:5 "shelf" with three stacked bag photos and an origin tag; the right one is the form.
- Roast: pill radios with a coloured dot. The checked pill fills ink.
- A taste card: an SVG radar chart (acidity, sweetness, body, bitterness, aroma) beside the tasting notes as italic serif chips and a brewing tip.
- Bag size (250 g, 500 g, 1 kg with a cup count) and frequency (2, 3, 4 weeks) as three-column tiles.
- The total: a big serif price with rolling digits, the cost per cup, and "Start my subscription". After submitting, the form becomes a confirmation card with an orange border and a "Change the order" link.
- Origin: an ink band with a 4:3 farm photo beside a heading, a paragraph and three facts in a definition list.
- How it works: a heading, then three steps on a line that draws from left to right when it scrolls into view, each with a dot.
## Images
- landing-coffee-hero-01.jpg (16:9): the pour-over hero.
- landing-coffee-bag-02/03/04.jpg (4:5): the same bag with an orange, green and black band.
- landing-coffee-farm-05.jpg (4:3): the coffee farm.
Until a file exists, each frame shows a toned gradient.
## Motion
- The hero photo settles from 1.08 to 1 while brightening. The hero copy rises in 120ms steps and the steam paths loop.
- Bags swing out sideways with a rotation and blur, and the chosen bag lifts with a small overshoot.
- The chart tweens over 750ms with a slight overshoot.
- Notes pop in 80ms apart, and the price digits roll.
- The timeline line draws over 1.6s and the steps follow 0.4s apart.
## Accessibility
- The builder is a real form with radio groups in fieldsets with legends.
- The chart has role="img" and a label that reads every value.
- The price is read once as plain text, while the rolling digits are hidden from screen readers.
- The confirmation has role="status", and every control shows a visible focus ring.
- prefers-reduced-motion: no zoom, steam, swing, morph, roll or reveal.
## Reference implementation
The original is written in React with one plain CSS file. Dependencies: none (plain React and CSS). Translate it faithfully; do not add new libraries unless my framework needs them.
### CoffeePage.tsx
```tsx
"use client";
import { useEffect, useRef, useState, type CSSProperties } from "react";
import "./coffee-page.css";
/**
* CoffeePage: a warm one-page site for a small roaster ("Tarn Coffee").
* Its signature is the subscription builder: pick a roast and the bag lifts off
* the shelf, the taste chart morphs to the new coffee, and the price rolls.
* It is a demo: connect `onSubscribe` to your shop.
*/
type Taste = [number, number, number, number, number];
const AXES = ["Acidity", "Sweetness", "Body", "Bitterness", "Aroma"];
const ROASTS: {
id: string;
name: string;
origin: string;
notes: string[];
brew: string;
taste: Taste;
image: string;
alt: string;
tone: string;
}[] = [
{
id: "bright",
name: "Bright",
origin: "Huila, Colombia",
notes: ["Red apple", "Panela", "Lime zest"],
brew: "Best as filter or AeroPress",
taste: [0.92, 0.62, 0.34, 0.14, 0.82],
image: "/images/landing-coffee-bag-02.jpg",
alt: "A kraft coffee bag with a burnt-orange band on pale stone, light roasted beans at its base",
tone: "#c9652e",
},
{
id: "balanced",
name: "Balanced",
origin: "Sidama, Ethiopia",
notes: ["Milk chocolate", "Apricot", "Black tea"],
brew: "Great as filter, espresso or with milk",
taste: [0.6, 0.78, 0.6, 0.3, 0.7],
image: "/images/landing-coffee-bag-03.jpg",
alt: "The same kraft bag with a deep green band and medium roasted beans",
tone: "#35513b",
},
{
id: "dark",
name: "Dark",
origin: "Cerrado, Brazil",
notes: ["Cocoa nib", "Molasses", "Toasted almond"],
brew: "Made for espresso and moka pots",
taste: [0.24, 0.66, 0.92, 0.66, 0.6],
image: "/images/landing-coffee-bag-04.jpg",
alt: "The same kraft bag with a near-black band, dark oily beans and a brass scoop",
tone: "#2b2522",
},
];
const SIZES = [
{ id: "250", label: "250 g", cups: "about 16 cups", price: 11 },
{ id: "500", label: "500 g", cups: "about 33 cups", price: 20 },
{ id: "1000", label: "1 kg", cups: "about 66 cups", price: 36 },
];
const EVERY = [2, 3, 4];
/* ------------------------------------------------------------------ */
/** Photo with a toned stand-in underneath until the file exists. */
function Photo({
src,
alt,
tone,
className = "",
eager = false,
}: {
src: string;
alt: string;
tone: string;
className?: string;
eager?: boolean;
}) {
const img = useRef<HTMLImageElement>(null);
const [missing, setMissing] = useState(false);
useEffect(() => {
const el = img.current;
if (el && el.complete && el.naturalWidth === 0) setMissing(true);
}, []);
return (
<div
className={`gu-tarn__photo ${className}`}
style={{ "--tone": tone } as CSSProperties}
>
{!missing && (
<img
ref={img}
src={src}
alt={alt}
loading={eager ? "eager" : "lazy"}
onError={() => setMissing(true)}
/>
)}
</div>
);
}
/** Digits roll like a counter on a till instead of jumping. */
function Rolling({ value }: { value: string }) {
return (
<span className="gu-tarn__roll" aria-hidden="true">
{value.split("").map((ch, i) =>
/\d/.test(ch) ? (
<span key={`${value.length}-${i}`} className="gu-tarn__roll-col">
<span
className="gu-tarn__roll-strip"
style={{ "--d": Number(ch) } as CSSProperties}
>
{"0123456789".split("").map((n) => (
<span key={n}>{n}</span>
))}
</span>
</span>
) : (
<span key={`${value.length}-${i}`}>{ch}</span>
),
)}
</span>
);
}
/** A five-axis taste chart that morphs between coffees. */
function TasteChart({ taste, label }: { taste: Taste; label: string }) {
const [shape, setShape] = useState<Taste>(taste);
const from = useRef<Taste>(taste);
useEffect(() => {
const start = from.current;
const dur = window.matchMedia("(prefers-reduced-motion: reduce)").matches
? 1
: 750;
let raf = 0;
let t0 = 0;
const tick = (now: number) => {
if (!t0) t0 = now;
const p = Math.min(1, (now - t0) / dur);
// ease-out-back: a little overshoot, like a needle settling
const e = 1 + 2.2 * Math.pow(p - 1, 3) + 1.2 * Math.pow(p - 1, 2);
const next = start.map((v, i) => v + (taste[i] - v) * e) as Taste;
from.current = next;
setShape(next);
if (p < 1) raf = requestAnimationFrame(tick);
};
raf = requestAnimationFrame(tick);
return () => cancelAnimationFrame(raf);
}, [taste]);
const R = 92;
const pt = (i: number, v: number) => {
const a = -Math.PI / 2 + (i * 2 * Math.PI) / 5;
return [120 + Math.cos(a) * R * v, 120 + Math.sin(a) * R * v];
};
const ring = (v: number) => AXES.map((_, i) => pt(i, v).join(",")).join(" ");
return (
<figure className="gu-tarn__chart">
<svg viewBox="0 0 240 240" role="img" aria-label={label}>
{[0.25, 0.5, 0.75, 1].map((v) => (
<polygon key={v} points={ring(v)} className="gu-tarn__chart-grid" />
))}
{AXES.map((a, i) => {
const [x, y] = pt(i, 1);
const [lx, ly] = pt(i, 1.2);
return (
<g key={a}>
<line
x1="120"
y1="120"
x2={x}
y2={y}
className="gu-tarn__chart-grid"
/>
<text x={lx} y={ly} className="gu-tarn__chart-label">
{a}
</text>
</g>
);
})}
<polygon
points={shape.map((v, i) => pt(i, v).join(",")).join(" ")}
className="gu-tarn__chart-shape"
/>
{shape.map((v, i) => {
const [x, y] = pt(i, v);
return (
<circle
key={i}
cx={x}
cy={y}
r="4"
className="gu-tarn__chart-dot"
/>
);
})}
</svg>
</figure>
);
}
/** Counts down to the next Monday roast at 8:00. */
function useNextRoast() {
const [left, setLeft] = useState<string | null>(null);
useEffect(() => {
const update = () => {
const now = new Date();
const next = new Date(now);
next.setHours(8, 0, 0, 0);
const add = (8 - now.getDay()) % 7;
next.setDate(now.getDate() + add);
if (next <= now) next.setDate(next.getDate() + 7);
const ms = next.getTime() - now.getTime();
const d = Math.floor(ms / 864e5);
const h = Math.floor((ms % 864e5) / 36e5);
const m = Math.floor((ms % 36e5) / 6e4);
setLeft(`${d}d ${h}h ${String(m).padStart(2, "0")}m`);
};
update();
const id = setInterval(update, 30000);
return () => clearInterval(id);
}, []);
return left;
}
/** Adds `is-in` once an element scrolls into view (pass the setter as a ref). */
function useReveal<T extends Element>() {
const [node, setNode] = useState<T | null>(null);
const [inView, setInView] = useState(false);
useEffect(() => {
if (!node) return;
const io = new IntersectionObserver(
([e]) => {
if (e.isIntersecting) {
setInView(true);
io.disconnect();
}
},
{ threshold: 0.35 },
);
io.observe(node);
return () => io.disconnect();
}, [node]);
return [setNode, inView] as const;
}
/* ------------------------------------------------------------------ */
function Builder({
onSubscribe,
}: {
onSubscribe?: (order: { roast: string; size: string; weeks: number }) => void;
}) {
const [roast, setRoast] = useState(0);
const [size, setSize] = useState(0);
const [weeks, setWeeks] = useState(1);
const [done, setDone] = useState(false);
const r = ROASTS[roast];
const s = SIZES[size];
const perCup = (s.price / Number(s.cups.replace(/\D/g, ""))).toFixed(2);
return (
<section
className="gu-tarn__builder"
id="tarn-coffee"
aria-labelledby="tarn-b-title"
>
<div
className="gu-tarn__shelf"
style={{ "--band": r.tone } as CSSProperties}
>
{ROASTS.map((x, i) => (
<div
key={x.id}
className="gu-tarn__bag"
data-state={i === roast ? "on" : i < roast ? "before" : "after"}
aria-hidden={i !== roast}
>
<Photo src={x.image} alt={x.alt} tone={x.tone} />
</div>
))}
<span className="gu-tarn__shelf-shadow" aria-hidden="true" />
<p className="gu-tarn__origin-tag">
<span aria-hidden="true">●</span> {r.origin}
</p>
</div>
<div className="gu-tarn__panel">
<h2 id="tarn-b-title" className="gu-tarn__h2">
Pick your roast.
</h2>
{done ? (
<div className="gu-tarn__done" role="status">
<p className="gu-tarn__done-big">You're in.</p>
<p>
{s.label} of {r.name} ({r.origin}) every {EVERY[weeks]} weeks.
Your first bag is roasted on Monday and ships the next day.
</p>
<button
type="button"
className="gu-tarn__link"
onClick={() => setDone(false)}
>
Change the order
</button>
</div>
) : (
<form
onSubmit={(e) => {
e.preventDefault();
setDone(true);
onSubscribe?.({ roast: r.id, size: s.id, weeks: EVERY[weeks] });
}}
>
<fieldset className="gu-tarn__roasts">
<legend className="gu-tarn__legend">Roast</legend>
{ROASTS.map((x, i) => (
<label
key={x.id}
className="gu-tarn__roast"
style={{ "--band": x.tone } as CSSProperties}
>
<input
type="radio"
name="tarn-roast"
checked={roast === i}
onChange={() => setRoast(i)}
/>
<span className="gu-tarn__roast-dot" aria-hidden="true" />
{x.name}
</label>
))}
</fieldset>
<div className="gu-tarn__taste">
<TasteChart
taste={r.taste}
label={`Taste of ${r.name}: ${AXES.map((a, i) => `${a} ${Math.round(r.taste[i] * 10)} of 10`).join(", ")}`}
/>
<div>
<p className="gu-tarn__legend">Tastes like</p>
<ul className="gu-tarn__notes" key={r.id}>
{r.notes.map((n, i) => (
<li key={n} style={{ "--i": i } as CSSProperties}>
{n}
</li>
))}
</ul>
<p className="gu-tarn__brew">{r.brew}</p>
</div>
</div>
<fieldset className="gu-tarn__seg">
<legend className="gu-tarn__legend">Bag size</legend>
{SIZES.map((x, i) => (
<label key={x.id}>
<input
type="radio"
name="tarn-size"
checked={size === i}
onChange={() => setSize(i)}
/>
<span>
<strong>{x.label}</strong>
<small>{x.cups}</small>
</span>
</label>
))}
</fieldset>
<fieldset className="gu-tarn__seg">
<legend className="gu-tarn__legend">Delivered every</legend>
{EVERY.map((w, i) => (
<label key={w}>
<input
type="radio"
name="tarn-every"
checked={weeks === i}
onChange={() => setWeeks(i)}
/>
<span>
<strong>{w} weeks</strong>
</span>
</label>
))}
</fieldset>
<div className="gu-tarn__total">
<p>
<span className="gu-tarn__price">
€<Rolling value={String(s.price)} />
</span>
<span className="sr-only">€{s.price}</span>
<span className="gu-tarn__per">
per bag, €{perCup} a cup. Free delivery, skip or stop any
time.
</span>
</p>
<button type="submit" className="gu-tarn__cta">
Start my subscription
</button>
</div>
</form>
)}
</div>
</section>
);
}
export function CoffeePage({
onSubscribe,
}: {
onSubscribe?: (order: { roast: string; size: string; weeks: number }) => void;
}) {
const nextRoast = useNextRoast();
const [stepsRef, stepsIn] = useReveal<HTMLOListElement>();
return (
<div className="gu-tarn">
<header className="gu-tarn__hero">
<Photo
src="/images/landing-coffee-hero-01.jpg"
alt="A barista's hands pouring water from a black kettle into a glass pour-over dripper in a dim café"
tone="#2a1a12"
className="gu-tarn__hero-photo"
eager
/>
<svg
className="gu-tarn__steam"
viewBox="0 0 200 300"
aria-hidden="true"
>
<path d="M100 290 C 70 240, 130 200, 100 150 S 70 60, 100 10" />
<path d="M80 290 C 55 245, 110 205, 82 160 S 55 80, 84 30" />
<path d="M120 290 C 145 240, 95 200, 122 150 S 150 70, 118 20" />
</svg>
<nav className="gu-tarn__nav" aria-label="Main">
<a href="#" className="gu-tarn__logo">
Tarn<span>coffee</span>
</a>
<div className="gu-tarn__links">
<a href="#tarn-coffee">Coffee</a>
<a href="#tarn-origin">Origin</a>
<a href="#tarn-how">How it works</a>
</div>
<a href="#tarn-coffee" className="gu-tarn__pill">
Subscribe
</a>
</nav>
<div className="gu-tarn__hero-copy">
<p className="gu-tarn__kicker">
Small-batch roaster
{nextRoast && (
<span className="gu-tarn__chip">
<span className="gu-tarn__live" aria-hidden="true" />
Next roast in {nextRoast}
</span>
)}
</p>
<h1 className="gu-tarn__h1">
Roasted on Monday.
<br />
In your cup by Thursday.
</h1>
<p className="gu-tarn__lede">
Three coffees, roasted in batches of 12 kilos and sent within a day,
so every bag arrives at its best.
</p>
<a href="#tarn-coffee" className="gu-tarn__cta">
Pick your roast
</a>
</div>
</header>
<Builder onSubscribe={onSubscribe} />
<section
className="gu-tarn__origin"
id="tarn-origin"
aria-labelledby="tarn-o-title"
>
<Photo
src="/images/landing-coffee-farm-05.jpg"
alt="A farmer's hand holding a coffee branch heavy with ripe red cherries on a misty hillside"
tone="#4a2a1c"
className="gu-tarn__origin-photo"
/>
<div>
<h2 id="tarn-o-title" className="gu-tarn__h2">
We know every farm by name.
</h2>
<p className="gu-tarn__body">
We buy from five farms we visit every harvest, and we pay well above
the market price so they can keep growing great coffee.
</p>
<dl className="gu-tarn__facts">
<div>
<dt>Grown at</dt>
<dd>1,750 m</dd>
</div>
<div>
<dt>Picked</dt>
<dd>By hand</dd>
</div>
<div>
<dt>We pay</dt>
<dd>2.1× market</dd>
</div>
</dl>
</div>
</section>
<section
className="gu-tarn__how"
id="tarn-how"
aria-labelledby="tarn-h-title"
>
<h2 id="tarn-h-title" className="gu-tarn__h2">
From our roaster to your cup in four days.
</h2>
<ol
ref={stepsRef}
className={`gu-tarn__steps ${stepsIn ? "is-in" : ""}`}
>
{[
[
"Monday",
"We roast",
"Every order of the week goes into Monday's batches.",
],
[
"Tuesday",
"We pack and send",
"Bags rest overnight, then leave with the morning post.",
],
[
"Thursday",
"You brew",
"Your coffee arrives three days off roast, right when it opens up.",
],
].map(([day, title, text], i) => (
<li key={day} style={{ "--i": i } as CSSProperties}>
<span className="gu-tarn__day">{day}</span>
<h3>{title}</h3>
<p>{text}</p>
</li>
))}
</ol>
</section>
<footer className="gu-tarn__foot">
<p className="gu-tarn__logo">
Tarn<span>coffee</span>
</p>
<p>Roastery open Saturdays, 9 to 13. Come smell Monday's batch.</p>
</footer>
</div>
);
}
```
### coffee-page.css
```css
/* Tarn Coffee: warm cream page, roasted browns, one burnt-orange accent. */
.gu-tarn {
--bg: #f3eee3;
--paper: #ebe3d3;
--ink: #1b1512;
--muted: #6e6257;
--line: rgb(27 21 18 / 0.14);
--accent: #e2561d;
--focus: #2b35ff;
--serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
container-type: inline-size;
background: var(--bg);
color: var(--ink);
font-family:
system-ui,
-apple-system,
"Segoe UI",
sans-serif;
line-height: 1.5;
}
.gu-tarn *,
.gu-tarn *::before,
.gu-tarn *::after {
box-sizing: border-box;
}
.gu-tarn a {
color: inherit;
}
.gu-tarn :focus-visible {
outline: 3px solid var(--focus);
outline-offset: 3px;
}
.gu-tarn .sr-only {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.gu-tarn__h2 {
margin: 0;
font-family: var(--serif);
font-weight: 600;
font-size: clamp(2.2rem, 5cqi, 3.8rem);
line-height: 1;
letter-spacing: -0.02em;
text-wrap: balance;
}
.gu-tarn__body {
max-width: 46ch;
color: var(--muted);
font-size: 1.08rem;
}
.gu-tarn__cta {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 52px;
padding: 0 26px;
border: 0;
border-radius: 999px;
background: var(--accent);
color: #fff8ef;
font: inherit;
font-weight: 700;
text-decoration: none;
cursor: pointer;
transition:
transform 0.3s var(--ease),
background-color 0.3s;
}
.gu-tarn__cta:hover {
background: #c94713;
transform: translateY(-2px);
}
.gu-tarn__cta:active {
transform: scale(0.97);
}
/* ---------- Photos ---------- */
.gu-tarn__photo {
position: relative;
overflow: hidden;
background:
radial-gradient(
70% 60% at 65% 35%,
color-mix(in srgb, var(--tone) 55%, #f3c79a),
transparent 70%
),
linear-gradient(
160deg,
color-mix(in srgb, var(--tone) 80%, #000),
var(--tone)
);
}
.gu-tarn__photo img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
/* ---------- Hero ---------- */
.gu-tarn__hero {
position: relative;
display: flex;
flex-direction: column;
min-height: 680px;
padding: 22px 5% 64px;
color: #f6efe4;
overflow: hidden;
isolation: isolate;
}
.gu-tarn__hero-photo {
position: absolute;
inset: 0;
z-index: -2;
}
.gu-tarn__hero-photo img {
animation: gu-tarn-settle 2.6s var(--ease) both;
}
.gu-tarn__hero-photo::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(
90deg,
rgb(18 12 9 / 0.86) 0%,
rgb(18 12 9 / 0.55) 45%,
transparent 80%
);
}
@keyframes gu-tarn-settle {
from {
transform: scale(1.08);
filter: brightness(0.6);
}
}
.gu-tarn__steam {
position: absolute;
right: 14%;
top: 6%;
width: min(220px, 22cqi);
z-index: -1;
fill: none;
stroke: rgb(255 244 230 / 0.5);
stroke-width: 3;
stroke-linecap: round;
filter: blur(3px);
}
.gu-tarn__steam path {
stroke-dasharray: 120 400;
animation: gu-tarn-steam 4.2s linear infinite;
}
.gu-tarn__steam path:nth-child(2) {
animation-delay: -1.4s;
animation-duration: 5s;
}
.gu-tarn__steam path:nth-child(3) {
animation-delay: -2.8s;
animation-duration: 4.6s;
}
@keyframes gu-tarn-steam {
0% {
stroke-dashoffset: 120;
opacity: 0;
}
20% {
opacity: 1;
}
100% {
stroke-dashoffset: -400;
opacity: 0;
}
}
.gu-tarn__nav {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.gu-tarn__logo {
margin: 0;
font-family: var(--serif);
font-size: 1.7rem;
font-weight: 700;
font-style: italic;
text-decoration: none;
letter-spacing: -0.02em;
}
.gu-tarn__logo span {
margin-left: 6px;
font-family: system-ui, sans-serif;
font-style: normal;
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.04em;
opacity: 0.7;
}
.gu-tarn__links {
display: none;
gap: 28px;
font-weight: 600;
}
.gu-tarn__links a {
text-decoration: none;
opacity: 0.85;
}
.gu-tarn__links a:hover {
opacity: 1;
text-decoration: underline;
text-underline-offset: 6px;
}
@container (min-width: 760px) {
.gu-tarn__links {
display: flex;
}
}
.gu-tarn__pill {
display: inline-flex;
align-items: center;
min-height: 44px;
padding: 0 18px;
border: 1px solid rgb(246 239 228 / 0.4);
border-radius: 999px;
font-weight: 700;
text-decoration: none;
backdrop-filter: blur(8px);
transition: background-color 0.3s;
}
.gu-tarn__pill:hover {
background: rgb(246 239 228 / 0.14);
}
.gu-tarn__hero-copy {
margin-top: auto;
max-width: min(1000px, 86cqi);
padding-top: 120px;
}
.gu-tarn__hero-copy > * {
animation: gu-tarn-rise 0.9s var(--ease) both;
}
.gu-tarn__hero-copy > :nth-child(2) {
animation-delay: 0.12s;
}
.gu-tarn__hero-copy > :nth-child(3) {
animation-delay: 0.24s;
}
.gu-tarn__hero-copy > :nth-child(4) {
animation-delay: 0.36s;
}
@keyframes gu-tarn-rise {
from {
opacity: 0;
transform: translateY(24px);
}
}
.gu-tarn__kicker {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
margin: 0 0 18px;
font-weight: 600;
opacity: 0.9;
}
.gu-tarn__chip {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 5px 12px;
border-radius: 999px;
background: rgb(246 239 228 / 0.12);
font-size: 0.85rem;
font-variant-numeric: tabular-nums;
backdrop-filter: blur(6px);
}
.gu-tarn__live {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--accent);
box-shadow: 0 0 0 0 var(--accent);
animation: gu-tarn-pulse 2s infinite;
}
@keyframes gu-tarn-pulse {
70% {
box-shadow: 0 0 0 8px transparent;
}
100% {
box-shadow: 0 0 0 0 transparent;
}
}
.gu-tarn__h1 {
margin: 0;
font-family: var(--serif);
font-weight: 600;
font-size: clamp(2.8rem, 7.4cqi, 6rem);
line-height: 0.95;
letter-spacing: -0.03em;
}
.gu-tarn__lede {
max-width: 44ch;
margin: 22px 0 30px;
font-size: 1.12rem;
opacity: 0.85;
}
/* ---------- Builder ---------- */
.gu-tarn__builder {
display: grid;
gap: 40px;
padding: 96px 5%;
}
@container (min-width: 860px) {
.gu-tarn__builder {
grid-template-columns: 0.9fr 1.1fr;
align-items: start;
gap: 64px;
}
.gu-tarn__shelf {
position: sticky;
top: 24px;
}
}
.gu-tarn__shelf {
position: relative;
aspect-ratio: 4 / 5;
border-radius: 28px;
background:
radial-gradient(80% 60% at 50% 30%, #fbf7ef, transparent), var(--paper);
overflow: hidden;
perspective: 1200px;
}
.gu-tarn__shelf::before {
/* the band colour washes the shelf when the roast changes */
content: "";
position: absolute;
inset: 0;
background: radial-gradient(
60% 40% at 50% 100%,
color-mix(in srgb, var(--band) 30%, transparent),
transparent
);
transition: background 0.8s;
}
.gu-tarn__bag {
position: absolute;
inset: 8% 14% 10%;
border-radius: 18px;
overflow: hidden;
box-shadow: 0 30px 60px -30px rgb(27 21 18 / 0.5);
transition:
transform 0.9s var(--ease),
opacity 0.6s var(--ease),
filter 0.6s;
}
.gu-tarn__bag .gu-tarn__photo {
position: absolute;
inset: 0;
}
.gu-tarn__bag[data-state="before"] {
opacity: 0;
transform: translate(-60%, 6%) rotate(-14deg) scale(0.86);
filter: blur(4px);
}
.gu-tarn__bag[data-state="after"] {
opacity: 0;
transform: translate(60%, 6%) rotate(14deg) scale(0.86);
filter: blur(4px);
}
.gu-tarn__bag[data-state="on"] {
animation: gu-tarn-lift 0.9s var(--ease);
}
@keyframes gu-tarn-lift {
40% {
transform: translateY(-4%) rotate(1.5deg);
}
}
.gu-tarn__shelf-shadow {
position: absolute;
left: 22%;
right: 22%;
bottom: 6%;
height: 22px;
border-radius: 50%;
background: rgb(27 21 18 / 0.25);
filter: blur(14px);
}
.gu-tarn__origin-tag {
position: absolute;
left: 18px;
bottom: 14px;
margin: 0;
padding: 6px 12px;
border-radius: 999px;
background: rgb(255 255 255 / 0.75);
font-size: 0.85rem;
font-weight: 700;
backdrop-filter: blur(6px);
}
.gu-tarn__origin-tag span {
color: var(--band);
transition: color 0.6s;
}
.gu-tarn__panel form {
display: grid;
gap: 28px;
margin-top: 32px;
}
.gu-tarn fieldset {
margin: 0;
padding: 0;
border: 0;
min-width: 0;
}
.gu-tarn__legend {
margin: 0 0 10px;
padding: 0;
color: var(--muted);
font-size: 0.85rem;
font-weight: 700;
}
.gu-tarn__roasts {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.gu-tarn__roasts .gu-tarn__legend {
width: 100%;
}
.gu-tarn__roast {
position: relative;
display: inline-flex;
align-items: center;
gap: 10px;
min-height: 52px;
padding: 0 22px 0 16px;
border: 1.5px solid var(--line);
border-radius: 999px;
font-weight: 700;
font-size: 1.05rem;
cursor: pointer;
transition:
border-color 0.3s,
background-color 0.3s,
color 0.3s;
}
.gu-tarn input[type="radio"] {
position: absolute;
opacity: 0;
pointer-events: none;
}
.gu-tarn__roast-dot {
width: 14px;
height: 14px;
border-radius: 50%;
background: var(--band);
transition: transform 0.4s var(--ease);
}
.gu-tarn__roast:hover {
border-color: var(--ink);
}
.gu-tarn__roast:has(:checked) {
border-color: var(--ink);
background: var(--ink);
color: var(--bg);
}
.gu-tarn__roast:has(:checked) .gu-tarn__roast-dot {
transform: scale(1.3);
box-shadow: 0 0 0 2px var(--bg);
}
.gu-tarn__roast:has(:focus-visible),
.gu-tarn__seg label:has(:focus-visible) {
outline: 3px solid var(--focus);
outline-offset: 3px;
}
.gu-tarn__taste {
display: grid;
gap: 20px;
align-items: center;
padding: 18px;
border-radius: 24px;
background: var(--paper);
}
@container (min-width: 520px) {
.gu-tarn__taste {
grid-template-columns: 240px 1fr;
}
}
.gu-tarn__chart {
margin: 0;
}
.gu-tarn__chart svg {
display: block;
width: 100%;
max-width: 260px;
margin: auto;
overflow: visible;
}
.gu-tarn__chart-grid {
fill: none;
stroke: var(--line);
}
.gu-tarn__chart-label {
fill: var(--muted);
font-size: 11px;
font-weight: 600;
text-anchor: middle;
dominant-baseline: middle;
}
.gu-tarn__chart-shape {
fill: color-mix(in srgb, var(--accent) 28%, transparent);
stroke: var(--accent);
stroke-width: 2.5;
stroke-linejoin: round;
}
.gu-tarn__chart-dot {
fill: var(--bg);
stroke: var(--accent);
stroke-width: 2.5;
}
.gu-tarn__notes {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 0;
padding: 0;
list-style: none;
}
.gu-tarn__notes li {
padding: 8px 14px;
border-radius: 999px;
background: var(--bg);
font-family: var(--serif);
font-size: 1.1rem;
font-style: italic;
animation: gu-tarn-pop 0.6s var(--ease) both;
animation-delay: calc(var(--i) * 80ms + 0.15s);
}
@keyframes gu-tarn-pop {
from {
opacity: 0;
transform: translateY(10px) scale(0.9);
}
}
.gu-tarn__brew {
margin: 14px 0 0;
color: var(--muted);
font-size: 0.95rem;
}
.gu-tarn__seg {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.gu-tarn__seg .gu-tarn__legend {
grid-column: 1 / -1;
}
.gu-tarn__seg label {
position: relative;
border-radius: 16px;
cursor: pointer;
}
.gu-tarn__seg label > span {
display: grid;
place-content: center;
gap: 2px;
min-height: 60px;
padding: 8px;
border: 1.5px solid var(--line);
border-radius: 16px;
text-align: center;
transition:
border-color 0.3s,
background-color 0.3s,
transform 0.3s var(--ease);
}
.gu-tarn__seg small {
color: var(--muted);
font-size: 0.78rem;
}
.gu-tarn__seg label:hover > span {
border-color: var(--ink);
}
.gu-tarn__seg label:has(:checked) > span {
border-color: var(--accent);
background: color-mix(in srgb, var(--accent) 10%, var(--bg));
box-shadow: inset 0 0 0 1px var(--accent);
}
.gu-tarn__seg label:active > span {
transform: scale(0.97);
}
.gu-tarn__total {
display: grid;
gap: 16px;
align-items: center;
padding-top: 24px;
border-top: 1px solid var(--line);
}
@container (min-width: 520px) {
.gu-tarn__total {
grid-template-columns: 1fr auto;
}
}
.gu-tarn__total p {
margin: 0;
}
.gu-tarn__price {
display: inline-flex;
font-family: var(--serif);
font-size: 3.4rem;
font-weight: 600;
line-height: 1;
letter-spacing: -0.03em;
}
.gu-tarn__per {
display: block;
margin-top: 6px;
color: var(--muted);
font-size: 0.92rem;
}
.gu-tarn__roll {
display: inline-flex;
}
.gu-tarn__roll-col {
display: inline-block;
height: 1em;
overflow: hidden;
}
.gu-tarn__roll-strip {
display: flex;
flex-direction: column;
transform: translateY(calc(var(--d) * -1em));
transition: transform 0.8s var(--ease);
}
.gu-tarn__roll-strip span {
height: 1em;
line-height: 1;
}
.gu-tarn__done {
margin-top: 32px;
padding: 28px;
border: 2px solid var(--accent);
border-radius: 24px;
animation: gu-tarn-rise 0.6s var(--ease) both;
}
.gu-tarn__done-big {
margin: 0 0 8px;
font-family: var(--serif);
font-size: 2.4rem;
font-weight: 600;
}
.gu-tarn__link {
margin-top: 8px;
padding: 10px 0;
border: 0;
background: none;
color: inherit;
font: inherit;
font-weight: 700;
text-decoration: underline;
text-decoration-color: var(--accent);
text-decoration-thickness: 2px;
text-underline-offset: 5px;
cursor: pointer;
}
/* ---------- Origin ---------- */
.gu-tarn__origin {
display: grid;
gap: 40px;
align-items: center;
padding: 96px 5%;
background: var(--ink);
color: var(--bg);
}
.gu-tarn__origin .gu-tarn__body {
color: rgb(243 238 227 / 0.7);
}
@container (min-width: 860px) {
.gu-tarn__origin {
grid-template-columns: 1.1fr 0.9fr;
gap: 64px;
}
}
.gu-tarn__origin-photo {
aspect-ratio: 4 / 3;
border-radius: 28px;
}
.gu-tarn__facts {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
margin: 32px 0 0;
}
.gu-tarn__facts div {
padding-top: 14px;
border-top: 1px solid rgb(243 238 227 / 0.2);
}
.gu-tarn__facts dt {
color: rgb(243 238 227 / 0.6);
font-size: 0.85rem;
}
.gu-tarn__facts dd {
margin: 4px 0 0;
font-family: var(--serif);
font-size: clamp(1.15rem, 2cqi, 1.6rem);
white-space: nowrap;
font-weight: 600;
}
/* ---------- How ---------- */
.gu-tarn__how {
padding: 96px 5%;
}
.gu-tarn__how .gu-tarn__h2 {
max-width: 16ch;
}
.gu-tarn__steps {
position: relative;
display: grid;
gap: 32px;
margin: 48px 0 0;
padding: 0;
list-style: none;
}
@container (min-width: 760px) {
.gu-tarn__steps {
grid-template-columns: repeat(3, 1fr);
padding-top: 36px;
}
.gu-tarn__steps::before {
content: "";
position: absolute;
top: 7px;
left: 0;
right: 0;
height: 2px;
background: var(--accent);
transform: scaleX(0);
transform-origin: left;
transition: transform 1.6s var(--ease);
}
.gu-tarn__steps.is-in::before {
transform: scaleX(1);
}
.gu-tarn__steps li::before {
content: "";
position: absolute;
top: -36px;
left: 0;
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--bg);
border: 3px solid var(--accent);
}
}
.gu-tarn__steps li {
position: relative;
opacity: 0;
transform: translateY(20px);
transition:
opacity 0.8s var(--ease),
transform 0.8s var(--ease);
transition-delay: calc(var(--i) * 0.4s + 0.2s);
}
.gu-tarn__steps.is-in li {
opacity: 1;
transform: none;
}
.gu-tarn__day {
color: var(--accent);
font-weight: 800;
}
.gu-tarn__steps h3 {
margin: 6px 0;
font-family: var(--serif);
font-size: 1.7rem;
font-weight: 600;
}
.gu-tarn__steps p {
margin: 0;
max-width: 32ch;
color: var(--muted);
}
.gu-tarn__foot {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 16px;
padding: 40px 5%;
border-top: 1px solid var(--line);
color: var(--muted);
}
.gu-tarn__foot .gu-tarn__logo {
color: var(--ink);
}
@media (prefers-reduced-motion: reduce) {
.gu-tarn *,
.gu-tarn *::before,
.gu-tarn *::after {
animation: none !important;
transition: none !important;
}
.gu-tarn__steps li {
opacity: 1;
transform: none;
}
.gu-tarn__steam {
display: none;
}
}
```
You might also want
Next piece: Contour map 3D heroInvoicing app landing page
Landing pages, advanced
Conference page
Landing pages, intermediate
E-bike launch page with colour wipe
Landing pages, advanced




