Three Blocks

Minimal scene / source

Open preview
src/style.cssPlain text ↗
:root {
	--ink: #070910;
	--paper: #f4f1e8;
	--mist: #a6aec2;
	--gold: #f4ae0c;
	--red: #dd4c33;
	--blue: #1e54c8;
	color: var(--paper);
	/* Templates that ship a webfont set --font-sans (see templates/text/index.html); a plain
	   font-family here would race the inline override on stylesheet injection order. */
	font-family: var(--font-sans, Inter, ui-sans-serif, system-ui, sans-serif);
	background: var(--ink);
	font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; }
a { font: inherit; }

#scene {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

main { position: relative; z-index: 1; }

#render-status {
	position: fixed;
	z-index: 3;
	inset: 1rem auto auto 1rem;
	max-width: min(32rem, calc(100vw - 2rem));
	color: var(--paper);
	background: var(--ink);
	padding: 0.5rem 0.75rem;
	font: 0.8rem/1.4 ui-monospace, monospace;
}

#render-status[data-state='ok'] { display: none; }

section {
	min-height: 100svh;
	display: grid;
	align-content: center;
	padding: clamp(6.5rem, 10vw, 10rem) clamp(1.5rem, 7vw, 8rem);
}

section > div { width: min(42rem, 100%); }
section:nth-child(even) > div { margin-left: auto; }

.eyebrow {
	margin: 0 0 1rem;
	color: var(--gold);
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

h1, h2, p { margin-block: 0; }
h1, h2 { max-width: 12ch; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(3.7rem, 11vw, 9.5rem); line-height: 0.86; letter-spacing: -0.075em; }
h2 { font-size: clamp(2.7rem, 7vw, 6rem); line-height: 0.91; letter-spacing: -0.06em; }
p { max-width: 36rem; color: var(--mist); font-size: clamp(1rem, 1.7vw, 1.25rem); line-height: 1.55; }
h1 + p, h2 + p, p + p { margin-top: 1.35rem; }

.text-link {
	display: inline-flex;
	align-items: center;
	margin-top: 1.75rem;
	border: 1px solid color-mix(in srgb, var(--paper) 24%, transparent);
	border-radius: 999px;
	background: color-mix(in srgb, var(--ink) 72%, transparent);
	color: var(--paper);
	padding: 0.7rem 1rem;
	text-decoration: none;
	cursor: pointer;
}

.text-link:hover { border-color: var(--gold); }
.text-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.type-hero { max-width: 10ch; }
.type-line { display: block; width: fit-content; }
.type-line:last-child { color: var(--red); transform: translateX(clamp(1rem, 7vw, 6rem)); }
.type-proof { max-width: 28rem; }
.jp-proof { color: color-mix(in srgb, var(--paper) 88%, var(--blue)); }

[data-canvas-text] { user-select: text; }
[data-canvas-text][data-three-blocks-text-state='ready'] { -webkit-text-fill-color: transparent; }
[data-canvas-text][data-three-blocks-text-state='ready']::selection { -webkit-text-fill-color: transparent; background: Highlight; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

@media (max-width: 560px) {
	section:nth-child(even) > div { margin-left: 0; }
}