# Topographic (`topographic`)

> A guide team’s route sheet as a web page: real contour lines and a red route that draws itself up to the day you are reading (scrolling down on a computer, swiping the day cards on a phone), with the profile and readout in step; everything else is plain tables, photographs and a booking form.

This is a worked example: one concept, built for one fictional client. Study how its concept turned into decisions and borrow the craft. Do not ship its surface (palette, motifs, component looks) for a different client unless your own concept, drawn from that client's world, leads to the same place.

- Chinese name: 地形制图. 把向导自己的路书做成网页：真实地形的等高线和红笔路线，日程看到第几天，路线就画到第几天（电脑上往下翻，手机上左右滑日程卡片），剖面和读数跟着走；其余是平实的表格、照片和预约表单。
- Category: Technical. Tags: Cartographic, Precise, Calm, Light, Sans-serif, Monospace, Photography, Grid, Scroll story.
- Live page: [English](/en/sites/topographic/full/) · [Chinese](/sites/topographic/full/) · [viewer with desktop and mobile views](/en/sites/topographic/)
- Built with Astro, React, TypeScript and Tailwind CSS 4, plus Motion Primitives, Motion, Paper Shaders.

## Where the concept came from

From Latse Guides’ own route sheet: the folded topographic map they put in every client’s hand before the kora, with contour lines, the route in red, numbered camps and pass heights, and the stage table, packing list and prices printed on the back.

## When it fits

Good for:
- Trekking guides, outdoor clubs and mule outfits: clients first ask how many days, how high and where they sleep.
- Trails in scenic areas and national parks, where several routes, grades and open seasons belong on one map.
- Field schools, outdoor courses and survey trips that must spell out the route, the kit and the safety rules.

Avoid when:
- Hotels and restaurants that sell an atmosphere: the density hides the comfort and the food.
- Brands without real routes or data: invented contours and profiles look fake to anyone who reads maps.
- Destinations that sell on photography alone: the map takes the first half of the page and the pictures come later.

Industry fit (1-5): Tour guide 5, Attraction 4, Education 3, Farm produce 3, Export factory 2, Hotel & homestay 2, Creative brand 2, Artisan 1, Restaurant 1.

## Adapting it to another client

Keep:
- Build the main visual from the client’s real data (terrain, route, altitudes), so the chart is the content.
- One map carries the itinerary: the route draws up to the day being read, with the profile and readout in step. On a computer the map is pinned beside the day list; on a phone it stays in the page with the day cards swiping right under it. No instructions on screen.
- Keep the concept literal on the map only; everything else is ordinary tables, lists and a form, with monospace figures reserved for map labels and tables.

Change:
- Paper, contour brown and route red are this map’s colours; ski areas, cycling routes and dive sites each have their own map palette. Buttons take the darkest tone of the client’s brand, never the route colour.
- Swap the contours for the client’s own base map: depth lines, streets, a campus plan or floor plans.
- The kora, passes, mule teams, yak pastures and these photographs belong to this guide team; another client brings its own words and pictures.

## Essentials

- **Color.** Printed like a topographic map in a few plates: paper #f0eee6, ink #1f2421, contour brown #a47c55 and grey relief. Route red #b8341d appears only on the map, its legend and the elevation profile (the route, the camp numbers, the walked part of the profile); nowhere else on the page. Every button is ink with light text or an ink outline; the booking section and footer are a solid ink field where buttons flip to a light outline. Ink on paper is 13.6:1, graphite #585c57 on paper 5.9:1.
- **Type.** Overpass variable for Latin (the open-source Highway Gothic), display at 800 with −0.035em tracking; Chinese headings in Noto Sans SC 900, body at 17px with 1.85 line height. The headline is sized to its column so it sits on one line (14cqi in Chinese, 13cqi in English); section headings are short nouns at 34–58px in Chinese and up to 62px in English. Overpass Mono is kept for the figures in map labels and tables (coordinates, contour heights, stages, prices); units and labels stay in the sans. Following Chinese topographic-map convention, settlements and camps are set in Noto Serif SC 600 and mountains and passes in sans. Latin river names are italic; Chinese ones are set vertically and letter-spaced.
- **Layout.** On phones the title block comes first and the map follows in the flow of the page, never pinned and at most 100svh − 24rem wide, so the map, its profile and one day card fit on a screen; the 11 days are a swipe row of cards right under it. The Route heading is kept for screen readers only there, and the route intro sits below the cards. From 1024px the map is pinned in the right column beside the day list, where a 3px ink bar marks the day being drawn. The map has a zebra frame graduated in true minutes of arc. A full-bleed photograph follows the route; the short treks put the inset map on the left, held in place while the text scrolls; the booking section and footer are a solid ink field. Rules appear only in tables, charts, legends and the maps, and no section heading carries a number or label above it.
- **Imagery.** The main image is the real terrain: 200 m contours, relief shading and drainage traced from SRTM elevation (Terrarium tiles), a least-cost route that follows the valleys, and the profile and daily ascent read off the same data; the inset uses 100 m contours at a larger scale. Three overcast, filmic photographs are printed onto the paper with multiply: the Nu gorge path runs full-bleed after the route, the fir camp sits beside what the price includes, and Dokar La opens the altitude rules; on phones every photo bleeds to both edges.
- **Motion.** On load the contours surface level by level from the valleys to the summit (65ms stagger, 0.85s, cubic-bezier(0.32,0.72,0,1)). The red line draws day by day, a marker walks the path, the profile fills in step and the readout shows the day, camp and altitude: on a computer as the page scrolls; on a phone as the day cards swipe, with the card at rest drawn in full and the next one drawing as it slides in. There are no instructions on screen. Elsewhere almost nothing moves except the rolling price estimate. With reduced motion the finished map is shown at once and the day cards are a plain swipe row.

## Common mistakes

- Faking contours with decorative wavy lines: they must come from real terrain, close on themselves, never cross and tighten with the slope.
- Spreading route red over buttons, headings and notice boxes: once red is everywhere, the route disappears. Here buttons are ink and red stays on the map, its legend and the profile.
- Dressing every block as a route sheet: section numbers, tick-rule labels, monospace units, hairlines everywhere, hazard-striped panels. Keep the concept literal on the map; use plain headings, tables and lists for the rest.
- Letting map labels scale with the SVG: on phones they shrink to nothing. Keep labels in an HTML layer at fixed sizes, positioned in percentages.
- Turning the scroll story into a long pin: a phone map held for two screens and more, with the days readable only by scrolling through the animation. On phones keep the map in the page with a swipe row of days right under it; on a computer use native scrolling with sticky positioning, let camps and the profile jump straight to a day, skip hints like "scroll down", and show the whole route under reduced motion.

## Design tokens

| Token | Value | Role |
| --- | --- | --- |
| `--color-paper` | `#f0eee6` | Map paper ground |
| `--color-sheet` | `#f8f7f2` | Light surface: the maps, day cards and booking form |
| `--color-ink` | `#1f2421` | Text, buttons, and the dark ground of the booking section and footer |
| `--color-graphite` | `#585c57` | Secondary text |
| `--color-contour` | `#a47c55` | Contour lines |
| `--color-contour-deep` | `#86613d` | Supporting |
| `--color-route` | `#b8341d` | Route red, used only on the map, its legend and the profile |
| `--color-route-deep` | `#9e2b17` | Supporting |
| `--color-line` | `#d8d4c7` | Supporting |

Semantic colors with shadcn/ui names, ready for `globals.css`:

```css
:root {
  --background: #f0eee6;
  --foreground: #1f2421;
  --card: #f8f7f2;
  --card-foreground: #1f2421;
  --primary: #1f2421;
  --primary-foreground: #f8f7f2;
  --muted: #f8f7f2;
  --muted-foreground: #585c57;
  --accent: #a47c55;
  --border: #d8d4c7;
  --ring: #1f2421;
}
```

Fonts. The stacks use Fontsource family names; with Google Fonts or `next/font`, drop the " Variable" suffix. Each npm package holds the CSS and its unicode-range sliced font files. The jsDelivr links are for prototypes only: Google Fonts is blocked in mainland China and jsDelivr is unreliable there, so a production site for mainland visitors bundles the packages, or copies each CSS file with its `files/` folder to its own server or object storage and links that. A Chinese family costs about 100 KB of render-blocking CSS per weight (31 KB gzipped, about 100 slices); browsers then download only the slices for the characters on the page, so link only the weights you use.

- `--font-sans`: "Overpass Variable", "Noto Sans SC Variable", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif
- `--font-mono`: "Overpass Mono Variable", ui-monospace, "SFMono-Regular", Menlo, monospace
- `--font-settlement`: "Noto Serif SC", "Songti SC", "SimSun", serif
- Overpass Variable: `npm install @fontsource-variable/overpass`, then `import '@fontsource-variable/overpass'` and `import '@fontsource-variable/overpass/wght-italic.css'`. Plain-HTML prototype: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/overpass@5.3.0/index.css">` `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/overpass@5.3.0/wght-italic.css">`
- Overpass Mono Variable: `npm install @fontsource-variable/overpass-mono`, then `import '@fontsource-variable/overpass-mono'`. Plain-HTML prototype: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/overpass-mono@5.3.0/index.css">`
- Noto Sans SC Variable: `npm install @fontsource-variable/noto-sans-sc`, then `import '@fontsource-variable/noto-sans-sc'`. Plain-HTML prototype: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/noto-sans-sc@5.3.1/index.css">`
- Noto Serif SC: `npm install @fontsource/noto-serif-sc`, then `import '@fontsource/noto-serif-sc/600.css'`. Plain-HTML prototype: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource/noto-serif-sc@5.3.1/600.css">`

Easing:

- `--ease-survey`: `cubic-bezier(0.32, 0.72, 0, 1)`

All tokens: [tokens.css](/styles/topographic/tokens.css) · [tokens.json](/styles/topographic/tokens.json)

## Page structure

Screenshots are 1440 × 900 (desktop) and 390 × 844 (mobile) viewports, on the Chinese page unless marked English. Sections taller than the screen, such as pinned scroll chapters, are captured part-way through.

1. **Header** (`:is(body, main) > header`): [components/Header.astro](/sources/topographic/components/Header.astro.txt). Visible in the Hero screenshots
2. **Hero** (`#top`): [components/Hero.astro](/sources/topographic/components/Hero.astro.txt). Screenshots: [desktop](/shots/topographic/top-desktop.jpg) · [mobile](/shots/topographic/top-mobile.jpg) · [desktop, English](/shots/topographic/top-desktop-en.jpg) · [mobile, English](/shots/topographic/top-mobile-en.jpg)
3. **Days** (`#days`): [components/Days.astro](/sources/topographic/components/Days.astro.txt). Screenshots: [desktop](/shots/topographic/days-desktop.jpg) · [mobile](/shots/topographic/days-mobile.jpg) · [desktop, English](/shots/topographic/days-desktop-en.jpg) · [mobile, English](/shots/topographic/days-mobile-en.jpg)
4. **RouteMap** (`#map`): [components/RouteMap.astro](/sources/topographic/components/RouteMap.astro.txt). Screenshots: [desktop](/shots/topographic/map-desktop.jpg) · [mobile](/shots/topographic/map-mobile.jpg) · [desktop, English](/shots/topographic/map-desktop-en.jpg) · [mobile, English](/shots/topographic/map-mobile-en.jpg)
5. **Gorge** (`#gorge`): [components/Gorge.astro](/sources/topographic/components/Gorge.astro.txt). Screenshots: [desktop](/shots/topographic/gorge-desktop.jpg) · [mobile](/shots/topographic/gorge-mobile.jpg) · [desktop, English](/shots/topographic/gorge-desktop-en.jpg) · [mobile, English](/shots/topographic/gorge-mobile-en.jpg)
6. **Treks** (`#treks`): [components/Treks.astro](/sources/topographic/components/Treks.astro.txt). Screenshots: [desktop](/shots/topographic/treks-desktop.jpg) · [mobile](/shots/topographic/treks-mobile.jpg) · [desktop, English](/shots/topographic/treks-desktop-en.jpg) · [mobile, English](/shots/topographic/treks-mobile-en.jpg)
7. **Seasons** (`#seasons`): [components/Seasons.astro](/sources/topographic/components/Seasons.astro.txt). Screenshots: [desktop](/shots/topographic/seasons-desktop.jpg) · [mobile](/shots/topographic/seasons-mobile.jpg) · [desktop, English](/shots/topographic/seasons-desktop-en.jpg) · [mobile, English](/shots/topographic/seasons-mobile-en.jpg)
8. **Prices** (`#prices`): [components/Prices.astro](/sources/topographic/components/Prices.astro.txt). Screenshots: [desktop](/shots/topographic/prices-desktop.jpg) · [mobile](/shots/topographic/prices-mobile.jpg) · [desktop, English](/shots/topographic/prices-desktop-en.jpg) · [mobile, English](/shots/topographic/prices-mobile-en.jpg)
9. **Gear** (`#gear`): [components/Gear.astro](/sources/topographic/components/Gear.astro.txt). Screenshots: [desktop](/shots/topographic/gear-desktop.jpg) · [mobile](/shots/topographic/gear-mobile.jpg) · [desktop, English](/shots/topographic/gear-desktop-en.jpg) · [mobile, English](/shots/topographic/gear-mobile-en.jpg)
10. **Altitude** (`#altitude`): [components/Altitude.astro](/sources/topographic/components/Altitude.astro.txt). Screenshots: [desktop](/shots/topographic/altitude-desktop.jpg) · [mobile](/shots/topographic/altitude-mobile.jpg) · [desktop, English](/shots/topographic/altitude-desktop-en.jpg) · [mobile, English](/shots/topographic/altitude-mobile-en.jpg)
11. **Book** (`#book`): [components/Book.astro](/sources/topographic/components/Book.astro.txt). Screenshots: [desktop](/shots/topographic/book-desktop.jpg) · [mobile](/shots/topographic/book-mobile.jpg) · [desktop, English](/shots/topographic/book-desktop-en.jpg) · [mobile, English](/shots/topographic/book-mobile-en.jpg)
12. **Footer** (`:is(body, main) > footer`): [components/Footer.astro](/sources/topographic/components/Footer.astro.txt). Screenshots: [desktop](/shots/topographic/footer-desktop.jpg) · [mobile](/shots/topographic/footer-mobile.jpg) · [desktop, English](/shots/topographic/footer-desktop-en.jpg) · [mobile, English](/shots/topographic/footer-mobile-en.jpg)
13. **ActionBar** (`#actions`): [components/ActionBar.astro](/sources/topographic/components/ActionBar.astro.txt). Visible in the Footer screenshots

## Key components

### RouteMap

The signature: a square map of the real terrain where the route draws itself up to the day being read, a marker walks the path, the profile fills in step and the readout shows the day, camp, altitude and distance walked. On a computer it is pinned beside the day list and follows the page scroll; on a phone it stays in the page and follows the day cards beneath it. Tap a camp number, drag sideways along the profile or use the arrow keys to jump to a day; nothing on screen explains it.

- Source: [components/RouteMap.astro](/sources/topographic/components/RouteMap.astro.txt)
- Also needs: [route-story.ts](/sources/topographic/route-story.ts.txt), [route.ts](/sources/topographic/route.ts.txt)
- Appears in: RouteMap (`map`)

### Days

The day list: start and end, distance, ascent, descent and camp altitude for each day, with the pass and its height beside the day number on pass days. It is also the map’s scale: the map draws up to the day being read. On a computer it runs down beside the map; on a phone it is a swipe row of cards right under the map, readable one by one without scrolling through any animation, with the route intro below the cards.

- Source: [components/Days.astro](/sources/topographic/components/Days.astro.txt)
- Appears in: Days (`days`)

### Treks

The inset: a larger-scale map of Kawagebo’s east face at 100 m contours with the two short treks keyed A and B; beside it each trek has its distance, high point, a profile and a day-by-day table. On desktop the inset holds still while the text scrolls; on phones the treks swipe sideways.

- Source: [components/Treks.astro](/sources/topographic/components/Treks.astro.txt)
- Also needs: [route.ts](/sources/topographic/route.ts.txt)
- Appears in: Treks (`treks`)

### Seasons

The seasons calendar uses map-legend fills (solid for best, stipple for possible, hatching for no departures) set apart by gaps instead of rules, over Deqin’s monthly rainfall; beside it a plain table of the 2027 departures with the return date and places left.

- Source: [components/Seasons.astro](/sources/topographic/components/Seasons.astro.txt)
- Appears in: Seasons (`seasons`)

### BookingDetails

The booking form: pick a route, month and group size and it writes a message for WeChat or SMS, with just two buttons, Copy booking details and Send as SMS. Per-person and total prices roll with SlidingNumber, shown as plain text under reduced motion. It sits in the ink booking section beside the phone number, copy-WeChat button and office address.

- Source: [components/BookingDetails.tsx](/sources/topographic/components/BookingDetails.tsx.txt) (Motion Primitives)
- Also needs: [copy.ts](/sources/topographic/copy.ts.txt), [components/Book.astro](/sources/topographic/components/Book.astro.txt)
- Built on Motion Primitives `sliding-number` ([components/ui/sliding-number.tsx](/sources/topographic/components/ui/sliding-number.tsx.txt), restyled): `npx shadcn@latest add https://motion-primitives.com/c/sliding-number.json`
- Appears in: Book (`book`)

### Folded sheet

A Paper Shaders PaperTexture baked ahead of time into a sheet folded twice, laid under both maps (.sheet-folds) with the relief multiplied on top, like a route sheet just unfolded. No shader runs at load.

- Source: [styles.css](/sources/topographic/styles.css.txt) (Paper Shaders)
- Also needs: [components/RouteMap.astro](/sources/topographic/components/RouteMap.astro.txt), [components/Treks.astro](/sources/topographic/components/Treks.astro.txt)

## Dependencies

`npm install motion react-use-measure`

## Source files

Read only what you need:

- [Site.astro](/sources/topographic/Site.astro.txt): the whole page, with fonts, sections and scripts
- [styles.css](/sources/topographic/styles.css.txt): tokens and component classes
- [i18n.ts](/sources/topographic/i18n.ts.txt): all copy, in Chinese and English
- [meta.ts](/sources/topographic/meta.ts.txt): this guide as data
- [components/Header.astro](/sources/topographic/components/Header.astro.txt): section
- [components/Hero.astro](/sources/topographic/components/Hero.astro.txt): section
- [components/Days.astro](/sources/topographic/components/Days.astro.txt): section
- [components/RouteMap.astro](/sources/topographic/components/RouteMap.astro.txt): section
- [components/Gorge.astro](/sources/topographic/components/Gorge.astro.txt): section
- [components/Treks.astro](/sources/topographic/components/Treks.astro.txt): section
- [components/Seasons.astro](/sources/topographic/components/Seasons.astro.txt): section
- [components/Prices.astro](/sources/topographic/components/Prices.astro.txt): section
- [components/Gear.astro](/sources/topographic/components/Gear.astro.txt): section
- [components/Altitude.astro](/sources/topographic/components/Altitude.astro.txt): section
- [components/Book.astro](/sources/topographic/components/Book.astro.txt): section
- [components/Footer.astro](/sources/topographic/components/Footer.astro.txt): section
- [components/ActionBar.astro](/sources/topographic/components/ActionBar.astro.txt): section
- [components/BookingDetails.tsx](/sources/topographic/components/BookingDetails.tsx.txt)
- [components/SectionHead.astro](/sources/topographic/components/SectionHead.astro.txt)
- [copy.ts](/sources/topographic/copy.ts.txt)
- [route-story.ts](/sources/topographic/route-story.ts.txt)
- [route.ts](/sources/topographic/route.ts.txt)
- [text.ts](/sources/topographic/text.ts.txt)
- [type.ts](/sources/topographic/type.ts.txt)
- [components/ui/sliding-number.tsx](/sources/topographic/components/ui/sliding-number.tsx.txt): Motion Primitives `sliding-number`, restyled

Everything in one file: [/sources/topographic.txt](/sources/topographic.txt) (about 38K tokens).

Before building, read the [design guide](/guide.md): the process and rules that apply to every site.
