~james/core

core/web/src/lib/components/landing/landing.css -rw-r--r-- 7.0 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 15 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
@reference "../../../app.css";

/*
 * The landing page's tokens and base. The colours point at the app's tokens, so the page
 * follows the site theme; the few drawn dark-first re-point under `@variant light`.
 * Everything is scoped to `.landing`, so none of it reaches the app. The hairline / iso
 * material behind the visuals lives in material.css.
 */

.landing {
	/* ---- colour ---- */
	--bg: var(--color-background-canvas);
	--line: var(--color-border-strong);
	--text: var(--color-foreground-default);
	--text-3: var(--color-foreground-subtle);
	--muted: var(--color-foreground-muted);
	/* The dimmed aside of a heading (opaque, so the emboss keeps its strength — a translucent
	   fill would scale the shadows down with it). */
	--fg-dim: var(--color-foreground-placeholder);
	--ind-grid: var(--color-background-info-emphasis);
	--accent-text: var(--color-foreground-link-info);
	--danger: var(--color-foreground-danger);
	--focus: var(--color-border-focus);
	/* The thread: the line, the rail's knots and the CTA's knot. */
	--thread: var(--color-background-info-emphasis);
	--hairline: var(--color-border-default);

	--emboss-inner-color: #000;
	--emboss-inner: 0.24;
	--emboss-drop-color: #000;
	--emboss-drop: 0.5;

	/* ---- type ---- */
	--font-display: "TimelessSans", "TimelessSans Fallback", ui-sans-serif, system-ui, sans-serif;
	--font-body: var(--font-display);
	--font-mono: "IBMPlexMono", ui-monospace, SFMono-Regular, Menlo, monospace;

	/* Display and section titles step with the breakpoints, as drawn: phones and tablets share
	   a size, desktop has its own. */
	--text-display: 3rem;
	/* The CTA steps with the breakpoints, as drawn: 32 on phones, 48 on tablets, 72 on desktop. */
	--text-cta: 3rem;
	--text-section: 2rem;
	--text-menu: 2rem;
	--text-body: 0.9375rem;
	--text-small: 0.8125rem;
	--text-legal: 0.6875rem;
	--text-label: 0.625rem;

	/* ---- layout ----
	   One coordinate system for the thread: a rail container's left edge, the thread's x
	   inside it (--rail-x) and the content's start (--rail-lane). Narrow screens run the
	   container edge to edge; desktop centres the 1086px column the navbar draws. */
	--page-w: 1086px;
	--hero-w: 980px;
	--content-w: 980px;
	--gutter: 20px;
	--rail-x: 19px;
	--rail-lane: 48px;
	--rail-end: 24px;
	--section-y: 120px;
	--nav-h: 66px;
	/* Below the navbar, above a page's title (compare, legal). */
	--page-top: 48px;
	/* How far art may hang past the page column and still clear the gutter: none until the
	   screen is wider than the column and both gutters. */
	--bleed: max(0px, (100vw - var(--page-w)) / 2 - var(--gutter));

	/* ---- motion ---- */
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

	@media (width >= 48rem) {
		--text-cta: 3rem;
		--rail-x: 30px;
		--rail-lane: 64px;
		--rail-end: 64px;
		/* The gap between the hero's art and its copy. */
		--hero-gap: clamp(40px, 7vw, 100px);
	}

	@media (width >= 64rem) {
		--text-cta: 4.5rem;
		--text-display: 4.5rem;
		--text-section: 2.5rem;
		--gutter: 24px;
		/* Under the centre of the navbar's logo mark, which starts at the column's edge. */
		--rail-x: 17.5px;
		/* The content keeps the hero's 980px and ends where the navbar does. */
		--rail-lane: calc(var(--page-w) - var(--content-w));
		--rail-end: 0px;
		--nav-h: 89px;
		/* One rhythm from the features down to the CTA: 280px between every two sections. */
		--section-y: 140px;
		/* Where the hero's copy column starts, measured in a rail container's content box (as
		   a % of it, so use it in that box's grid or on its direct children): the hero and
		   the rail share a centre, and the rail's content starts half a lane right of it. */
		--hero-split: calc(50% - var(--rail-lane) / 2 + var(--hero-gap) / 2);
	}

	@variant light {
		/* The page in the brightest white, as the app's own pages are. */
		--bg: var(--color-background-default);
		/* Light-mode headings: both in the muted foreground — the lip 25%, the ledge 12%. */
		--emboss-inner-color: var(--color-foreground-muted);
		--emboss-inner: 0.25;
		--emboss-drop-color: var(--color-foreground-muted);
		--emboss-drop: 0.12;
	}
}

/* ---- side grids ---- */
/* The hero's side grids, the full height of the page: 1px lines on
   a 22px pitch, fading in from the outer edge. Dropped where the page narrows to one column. */
.landing .page-grid {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: -1;
	width: 358px;
	pointer-events: none;
	--grid-line: var(--color-border-default);
	background:
		linear-gradient(to right, var(--grid-line) 1px, transparent 1px) 0 0 / 22px 22px,
		linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px) 0 0 / 22px 22px;
	mask-image: linear-gradient(to left, rgb(0 0 0 / 73%), transparent 80%);

	&.l {
		left: -119px;
		scale: -1 1;
	}
	&.r {
		right: -108px;
	}

	@media (width <= 1100px) {
		display: none;
	}
}

/* ---- base ---- */
.landing {
	position: relative;
	isolation: isolate;
	min-height: 100svh;
	overflow-x: clip;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.5;
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
}

@layer base {
	.landing {
		:where(h1, h2, h3, h4, p, ul, ol) {
			margin: 0;
		}

		:where(a) {
			color: inherit;
			text-decoration: none;
		}

		:where(button) {
			font: inherit;
			color: inherit;
		}

		:where(:focus-visible) {
			outline: 2px solid var(--focus);
			outline-offset: 3px;
		}

		::selection {
			background: color-mix(in srgb, var(--ind-grid) 45%, transparent);
			color: var(--text);
		}
	}
}

/* ---- type ---- */
.landing {
	/* Display headings: TimelessSans over the emboss (EmbossFilter.svelte). The aside is dimmed;
	   `.l-heading-break` puts it on its own line. */
	.l-heading {
		font-family: var(--font-display);
		font-feature-settings: normal;
		font-weight: 420;
		letter-spacing: -0.04em;
		color: var(--text);
	}
	.l-heading-display {
		font-size: var(--text-display);
		line-height: 1;
	}
	.l-heading-section {
		font-size: var(--text-section);
		line-height: 1.1;
	}
	.l-heading :where(.solid, .dim) {
		filter: url(#l-emboss);
	}
	.l-heading .dim {
		color: var(--fg-dim);
	}
	.l-heading-break :where(.solid, .dim) {
		display: block;
	}

	.l-body {
		font-size: var(--text-body);
		font-weight: 480;
		line-height: 1.4;
		letter-spacing: -0.01em;
		color: var(--muted);
	}

	.l-label {
		font-family: var(--font-mono);
		font-size: var(--text-label);
		line-height: 1.6;
		letter-spacing: -0.01em;
		text-transform: uppercase;
		color: var(--muted);
	}

	/* A trimmed line box: its text sits flush with the box (cap to baseline). */
	.l-trim {
		text-box: trim-both cap alphabetic;
	}

	.l-sr {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	.landing *,
	.landing *::before,
	.landing *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}