Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

18.7 KB
Raw Blame
/*
 * The landing page (features/homepage). It is one scroll-driven story: the scroll engine (scroll.ts) writes each
 * section's progress as --p (0 to 1) and every motion below is derived from it with calc(), so React only re-renders
 * on coarse steps. Imported by index.css, not the route, so a server-prerendered page is styled at first paint.
 */
/*
 * Write's lines and comment reveal by clip and translate instead of max-height (see write.tsx). Registered as lengths
 * so their em values resolve once, at the grid, and the comment's smaller text doesn't change the distances.
 */
@property --wov {
	syntax: "<length>";
	inherits: true;
	initial-value: 0px;
}

@property --wnv {
	syntax: "<length>";
	inherits: true;
	initial-value: 0px;
}

@property --wcv {
	syntax: "<length>";
	inherits: true;
	initial-value: 0px;
}

/* Short viewports hide the secondary captions of the pinned scenes so nothing overlaps. */
@custom-variant short (@media (height < 720px));

/*
 * Backdrop blur, only where it's cheap: a mouse-driven, non-Gecko browser. Firefox and phones re-blur the backdrop on
 * every scroll frame, which halved the landing page's frame rate there; they get the plain tinted backdrop instead.
 */
@custom-variant blur-ok {
	@media (pointer: fine) {
		@supports not (-moz-appearance: none) {
			@slot;
		}
	}
}

@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
}

@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("/fonts/ibm-plex-mono-700.woff2") format("woff2");
}

@theme {
	/* Existing landing classes share the app's display and UI families. */
	--font-anybody: var(--font-display);
	--font-martian: var(--font-ui);
	--font-receipt: "IBM Plex Mono", ui-monospace, monospace;

	--animate-breathe: landing-breathe 16s ease-in-out infinite alternate;
	--animate-drift: landing-drift 90s ease-in-out infinite alternate;
	--animate-mote: landing-mote var(--mote-duration) linear var(--mote-delay) infinite;
	--animate-swing: landing-swing 7s ease-in-out 2s infinite;
	--animate-flicker: landing-flicker 0.6s ease-out 1;
	--animate-language-turn: landing-language-turn 0.9s var(--ease-in-out-strong) backwards;

	@keyframes landing-language-turn {
		from {
			transform: translateY(0);
		}
		to {
			transform: translateY(-1.25em);
		}
	}

	@keyframes landing-breathe {
		from {
			opacity: 0.7;
		}
		to {
			opacity: 1;
		}
	}
	@keyframes landing-drift {
		from {
			transform: skewX(-16deg) rotate(-8deg) translate3d(-3%, -2%, 0);
		}
		to {
			transform: skewX(-11deg) rotate(-4deg) translate3d(6%, 4%, 0);
		}
	}
	@keyframes landing-mote {
		0% {
			transform: translate(0, 0);
			opacity: 0;
		}
		15% {
			opacity: 1;
		}
		85% {
			opacity: 0.8;
		}
		100% {
			transform: translate(var(--dx), var(--dy));
			opacity: 0;
		}
	}
	/* The theme cord sways over the last 14% of each cycle, so it reads as a nudge rather than constant motion. */
	@keyframes landing-swing {
		0%,
		86%,
		100% {
			rotate: 0deg;
		}
		89% {
			rotate: 7deg;
		}
		92% {
			rotate: -5deg;
		}
		95% {
			rotate: 3deg;
		}
		98% {
			rotate: -1deg;
		}
	}
	/* The bulb's halo flashing as it catches, before it settles to its resting glow. */
	@keyframes landing-flicker {
		0%,
		100% {
			opacity: 1;
		}
		40% {
			opacity: 0.55;
		}
		45% {
			opacity: 1;
		}
		70% {
			opacity: 0.8;
		}
	}
}

@theme inline {
	--shadow-paper: var(--paper-shadow);
	--color-graphite: var(--graphite);
}

.landing {
	--gutter: clamp(18px, 3vw, 44px);
	--paper-shadow:
		0 1px 2px oklch(0.2 0.01 95 / 0.12), 0 40px 80px -30px oklch(0.2 0.01 95 / 0.5), 0 0 0 1px oklch(0.2 0.01 95 / 0.04);
	--graphite: oklch(0.38 0.01 95 / 0.3);
	/* Horizontal motion that points somewhere (slides, flights) is multiplied by this so it mirrors in RTL. */
	--dir: 1;
	/* Default ink before the scroll engine updates the individual consumers. */
	--nt: 0;
}

.dark .landing {
	/* Paper under a dark room's light: a warm grey, not a glaring white. */
	--paper: oklch(0.93 0.008 90);
	--paper-shadow: 0 1px 2px oklch(0 0 0 / 0.45), 0 30px 60px -28px oklch(0 0 0 / 0.65);
	--graphite: oklch(0.9 0.01 95 / 0.18);
}

[dir="rtl"] .landing {
	--dir: -1;
}

.landing [data-scene] {
	--p: 0;
	/* Pinned scenes replace this with their exit progress once the engine measures them. */
	--out: 0;
}

/*
 * Pinned scenes have explicit heights, so offscreen demos can skip rendering without moving the scroll positions. The
 * scroll engine marks the scenes within a screen or two `data-warm`, so they render before they arrive.
 */
.landing [data-pin]:not(#top, [data-warm]) {
	content-visibility: auto;
}

/*
 * Reduced motion renders every scene at its end state; the pinned scenes also collapse to one screen. Unlayered, so it
 * beats each scene's `h-[…]` utilities at every width.
 */
@media (prefers-reduced-motion: reduce) {
	.landing [data-scene] {
		--p: 1;
	}

	.landing [data-pin] {
		height: 100svh;
	}
}

/* A graphite illustration that sketches in with a diagonal mask wipe as --wipe goes from 0 to 1. */
@utility doodle {
	position: absolute;
	pointer-events: none;
	user-select: none;
	height: auto;
	opacity: calc(0.92 * var(--doodle-fade, 1));
	mask-image: linear-gradient(110deg, #000 40%, transparent 60%);
	mask-size: 300% 100%;
	mask-repeat: no-repeat;
	mask-position: calc((1 - var(--wipe, 1)) * 100%) 0;
	transition: mask-position 0.35s linear;

	/* Watercolour keeps its colours at night, a little dimmer so it sits back from the text. */
	.dark & {
		opacity: calc(0.8 * var(--doodle-fade, 1));
		filter: brightness(0.92);
	}
}

/*
 * The template wall fades into the page above and below its middle, clearing the bands where Design's closing headline
 * sits. Once the wall reaches its resting size those bands are empty anyway, so this only softens the oversized frames
 * on the way in and stops the words from sitting on thumbnails at low contrast.
 */
@utility design-wall {
	mask-image: linear-gradient(to bottom, transparent 18.5%, #000 20%, #000 81%, transparent 88%);
}

/* One of the hero's career fragments: it drifts from (--x, --y) to (--tx, --ty) as the page assembles (--e). */
@utility hero-fragment {
	position: absolute;
	top: 50%;
	left: 50%;
	white-space: nowrap;
	opacity: calc(1 - clamp(0, (var(--e) - 0.7) * 3.4, 1));
	transform: translate(-50%, -50%)
		translate(
			calc(var(--x) * (1 - var(--e)) + var(--tx) * var(--e) + var(--mx, 0) * var(--z) * 28px),
			calc(var(--y) * 0.78 * (1 - var(--e)) + var(--ty) * var(--e) + var(--my, 0) * var(--z) * 20px)
		)
		rotate(calc(var(--r) * (1 - var(--e)))) scale(calc(var(--s) + (0.3 - var(--s)) * var(--e)));
	transition: transform 0.7s var(--ease);
}

/* The hero page lies back in perspective and settles flat as --e2 goes to 1. */
@utility hero-page {
	opacity: var(--e2);
	transform: translate(-50%, -50%) perspective(1600px) rotateX(calc((1 - var(--e2)) * 50deg))
		rotateZ(calc((1 - var(--e2)) * -6deg)) scale(calc(0.6 + var(--e2) * 0.4));
	transition: transform 0.5s var(--ease);
}

/* "Everything you've done," starts centred and enlarged, then slides to sit beside the page. */
@utility hero-headline-start {
	transform-origin: 100% 50%;
	transform: translate(
			calc(var(--dir) * (1 - var(--e)) * ((1 + (1 - var(--e)) * 0.45) * 50% + var(--pw) / 2 + 2.6vw)),
			-50%
		)
		scale(calc(1 + (1 - var(--e)) * 0.45));
	transition: transform 0.45s var(--ease);

	[dir="rtl"] & {
		transform-origin: 0% 50%;
	}
}

/*
 * A character of typed text: it appears once --typed passes its position --f in the string. The glyph is generated
 * content, so the page's text (what crawlers and copy-paste read) holds the sentence once, not once per layer.
 */
@utility typed {
	opacity: clamp(0, calc((var(--typed) - var(--f)) * var(--typed-rate, 90)), 1);

	&::before {
		content: attr(data-char);
	}
}

/* A typed character that carries the caret while it's the last one typed (--typed-step is one character's share). */
@utility typed-caret {
	position: relative;

	&::after {
		content: "";
		position: absolute;
		inset-inline-end: -0.07em;
		top: 0.16em;
		bottom: 0.1em;
		width: 0.07em;
		background: var(--caret, currentColor);
		opacity: calc(
			clamp(0, (var(--typed) - var(--f)) * var(--typed-rate, 90), 1) *
				(1 - clamp(0, (var(--typed) - var(--f) - var(--typed-step)) * var(--typed-rate, 90), 1))
		);
	}
}

/*
 * A character of Write's suggested line: highlighted and underlined until the suggestion is accepted (--cl). The
 * underline is painted as a background line, because a text underline skips the spaces typed between words.
 */
@utility typed-suggestion {
	--underline: color-mix(in oklch, oklch(0.5 0.1 150) calc((1 - var(--cl)) * 100%), transparent);
	background-color: color-mix(in oklch, oklch(0.93 0.05 150) calc((1 - var(--cl)) * 100%), transparent);
	background-image: linear-gradient(var(--underline), var(--underline));
	background-size: 100% 2px;
	background-position: 0 100%;
	background-repeat: no-repeat;
}

/* A keyword on the demo resume that lights up when the Tailor scene matches it (--k from 0 to 1). */
@utility sheet-keyword {
	margin-inline: -0.3cqw;
	border-radius: 0.4cqw;
	padding-inline: 0.3cqw;
	background: color-mix(in oklch, oklch(0.88 0.1 150) calc(var(--k, 0) * 100%), transparent);
}

/* A keyword in the job posting, highlighted in step with its match on the resume. */
@utility posting-keyword {
	border-radius: 3px;
	padding-inline: 2px;
	color: inherit;
	background: color-mix(in oklch, var(--accent-soft) calc(var(--k, 0) * 100%), transparent);
	box-shadow: 0 0 0 1px color-mix(in oklch, var(--accent) calc(var(--k, 0) * 60%), transparent);
}

/* The Check lens: the parsed text layer, revealed through a circle at (--lx, --ly). */
@utility check-lens {
	background-color: oklch(0.2 0.03 160);
	background-image:
		repeating-linear-gradient(0deg, oklch(0.6 0.1 150 / 0.1) 0 1px, transparent 1px 4cqw),
		repeating-linear-gradient(90deg, oklch(0.6 0.1 150 / 0.1) 0 1px, transparent 1px 4cqw);
	/* A touch wider than the glass (which is slightly oval): the brass rim drawn over it hides the overflow. */
	clip-path: circle(12.2cqw at var(--lx, 50%) var(--ly, 16%));
}

/* Ink that turns light as Share's night falls (--nt) and back as it lifts, whatever the theme. */
@utility night-ink {
	color: color-mix(in oklch, oklch(0.95 0.01 95) calc(var(--nt, 0) * 100%), var(--ink));
}

/* The header's tapered backdrop: solid under the bar, fading out below it. */
@utility header-taper {
	background: linear-gradient(
		to bottom,
		var(--bg) 0%,
		color-mix(in oklch, var(--bg) 82%, transparent) 45%,
		transparent 100%
	);
	mask-image: linear-gradient(to bottom, #000 40%, transparent);

	@variant blur-ok {
		backdrop-filter: blur(10px);
	}
}

/*
 * The soft shadow of a window's mullions falling across the desk. The softness is drawn into the gradients (what a
 * 28px blur of 3%-wide bars looks like) rather than applied with filter: blur(), which kept the GPU busy re-blurring a
 * screen-sized layer for the whole visit, and made Firefox and phones drop frames while scrolling.
 */
@utility window-shadow {
	--mullion: oklch(0.35 0.02 80 / 0.034);
	--mullion-edge: oklch(0.35 0.02 80 / 0.016);
	--transom: oklch(0.35 0.02 80 / 0.03);
	--transom-edge: oklch(0.35 0.02 80 / 0.014);
	background-image:
		linear-gradient(
			90deg,
			transparent 26.5%,
			var(--mullion-edge) 29%,
			var(--mullion) 31.5%,
			var(--mullion-edge) 34%,
			transparent 36.5% 59.5%,
			var(--mullion-edge) 62%,
			var(--mullion) 64.5%,
			var(--mullion-edge) 67%,
			transparent 69.5%
		),
		linear-gradient(
			0deg,
			transparent 43%,
			var(--transom-edge) 45.5%,
			var(--transom) 47.5%,
			var(--transom-edge) 49.5%,
			transparent 52%
		);
	transform-origin: 0 0;
	transform: skewX(-16deg) rotate(-8deg);
}

/* The receipt's torn, zig-zag bottom edge. */
@utility receipt-paper {
	mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
}

@utility receipt-barcode {
	background: repeating-linear-gradient(
		90deg,
		oklch(0.22 0.01 95) 0 2px,
		transparent 2px 4px,
		oklch(0.22 0.01 95) 4px 5px,
		transparent 5px 8px,
		oklch(0.22 0.01 95) 8px 11px,
		transparent 11px 12px,
		oklch(0.22 0.01 95) 12px 13px,
		transparent 13px 17px
	);
}

/*
 * 09 Questions. Each is a <details>: opening one draws a pencil circle round its number and finishes the underline that
 * hovering starts, turns the plus into a cross, and unfolds the answer like a folded note swinging down from its crease.
 */
@utility faq-item {
	interpolate-size: allow-keywords;

	&::details-content {
		block-size: 0;
		overflow-y: clip;
		transition:
			block-size 0.45s var(--ease),
			content-visibility 0.45s allow-discrete;
	}
	&[open]::details-content {
		block-size: auto;
	}

	/*
	 * Pencil strokes: paths with pathLength="1", drawn by their dash offset. The gap is longer than the path and the
	 * resting offset past its start, so an undrawn stroke leaves no round-capped dot at either end.
	 */
	& [data-stroke] {
		fill: none;
		stroke: currentColor;
		stroke-linecap: round;
		stroke-linejoin: round;
		stroke-dasharray: 1 2;
		stroke-dashoffset: 1.05;
		transition: stroke-dashoffset 0.5s var(--ease);
	}
	@media (hover: hover) {
		& summary:hover [data-stroke="underline"] {
			stroke-dashoffset: 0.62;
		}
	}
	&[open] [data-stroke] {
		stroke-dashoffset: 0;
	}
	&[open] [data-stroke="circle"] {
		transition-duration: 0.7s;
		transition-delay: 0.1s;
	}

	& [data-plus] {
		transition: rotate 0.35s var(--ease);
	}
	&[open] [data-plus] {
		rotate: 135deg;
	}

	& [data-note] {
		transform-origin: 50% 0;
		transform: perspective(900px) rotateX(-80deg) rotate(var(--tilt));
		opacity: 0;
		transition:
			transform 0.55s var(--ease),
			opacity 0.3s var(--ease);
	}
	&[open] [data-note] {
		transform: perspective(900px) rotateX(0deg) rotate(var(--tilt));
		opacity: 1;

		@starting-style {
			transform: perspective(900px) rotateX(-80deg) rotate(var(--tilt));
			opacity: 0;
		}
	}
	/* The crease's shadow, fading as the note flattens. */
	& [data-note]::after {
		content: "";
		position: absolute;
		inset: 0;
		border-radius: inherit;
		pointer-events: none;
		background: linear-gradient(to bottom, oklch(0.2 0.01 95 / 0.16), transparent 60%);
		transition: opacity 0.6s var(--ease) 0.1s;
	}
	&[open] [data-note]::after {
		opacity: 0;

		@starting-style {
			opacity: 1;
		}
	}

	@media (prefers-reduced-motion: reduce) {
		&::details-content,
		& [data-stroke],
		& [data-plus],
		& [data-note],
		& [data-note]::after {
			transition: none;
		}
	}
}

/* Paper is white in both themes, so controls drawn on it take the light theme's ink, lines and accent. */
@utility on-paper {
	--bg: oklch(0.975 0.005 95);
	--surface: oklch(0.995 0.002 95);
	--raised: oklch(1 0 0);
	--sunken: oklch(0.952 0.006 95);
	--line: oklch(0.9 0.006 95);
	--line-2: oklch(0.82 0.008 95);
	--ink: oklch(0.22 0.01 95);
	--ink-2: oklch(0.42 0.01 95);
	--ink-3: oklch(0.53 0.01 95);
	--accent: oklch(0.5 0.1 150);
	--on-accent: oklch(0.99 0.01 150);
	--accent-soft: oklch(0.94 0.035 150);
	--accent-text: oklch(0.42 0.1 150);
	--warn-soft: oklch(0.95 0.045 85);
	--warn-text: oklch(0.48 0.1 70);
	--hover: oklch(0.22 0.01 95 / 0.05);
	--shadow-2: 0 1px 2px oklch(0.2 0.01 95 / 0.06), 0 10px 28px -8px oklch(0.2 0.01 95 / 0.18);
	color: oklch(0.28 0.01 95);
}

/* 07 Remember: a sentence of a redrafted answer settling in, one after another (--i). */
@utility remember-settle {
	animation: landing-settle 0.5s var(--ease) calc(var(--i, 0) * 90ms) backwards;

	@media (prefers-reduced-motion: reduce) {
		animation: none;
	}
}

@keyframes landing-settle {
	from {
		opacity: 0;
		filter: blur(4px);
		translate: 0 0.25em;
	}
}

/*
 * The footer's desk. scroll.ts writes --dp, 0 as the desk's top enters the screen and 1 when the page ends, and the
 * drawing paints itself in from the window down, just ahead of the fold, while it rises and settles into place. It blends into the
 * page (multiply on light, lighten on dark), and its far edges fade out so the desk has no hard ends on wide screens.
 */
@utility footer-desk {
	--dp: 1;
	/* The edge of the paint-in, a soft wash just above the fold: the window paints first, the desk as it arrives. */
	--wash: calc(var(--dp) * 130%);
	position: relative;
	width: 100%;
	max-width: 1800px;
	margin: clamp(8px, 2vw, 32px) auto 0;
	aspect-ratio: 2172 / 724;

	/* Phones show the middle of the desk (window, resume and calendar) larger instead of the whole width. */
	@media (width < 700px) {
		aspect-ratio: 16 / 10;
	}

	/* Desktop: the desk rises into the footer's content, its top fading into the page so the two read as one. */
	@media (width >= 1000px) {
		margin-top: clamp(-150px, -7vw, -64px);
	}
}

@utility footer-desk-art {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	user-select: none;
	mask-image:
		linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent),
		linear-gradient(to bottom, #000 calc(var(--wash) - 30%), transparent var(--wash));
	mask-composite: intersect;

	@media (width >= 1000px) {
		mask-image:
			linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent),
			linear-gradient(to bottom, transparent 8%, #000 34%),
			linear-gradient(to bottom, #000 calc(var(--wash) - 30%), transparent var(--wash));
		mask-composite: intersect;
	}
	/* On the drawing itself, not the desk: a translated parent would isolate it from the page it blends into. */
	translate: 0 calc((1 - var(--dp)) * 12%);
	scale: calc(1.04 - var(--dp) * 0.04);
	transform-origin: 50% 100%;
}

/* Morning light from the window, on the wall around it. Light theme only: at night the lamp lights the desk. */
@utility footer-dawn {
	position: absolute;
	left: 50%;
	top: 0;
	width: 60%;
	height: 90%;
	translate: -50% calc((1 - var(--dp)) * 30%);
	opacity: var(--dp);
	background: radial-gradient(closest-side, oklch(0.95 0.06 120 / 0.7), transparent);

	.dark & {
		display: none;
	}
}

/*
 * Paper grain over the whole page: fractal noise kept in the alpha channel of black specks, so it composites with plain
 * opacity (a blend mode on a fixed full-screen layer would repaint the page on every scroll frame). Static, so reduced
 * motion has nothing to stop. Dark mode inverts it to pale specks.
 */
@utility paper-grain {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
	background-size: 220px;
}

/*
 * Arabic, Persian, Urdu and Hebrew have no italic convention, and their fonts ship none: the browser would slant the
 * glyphs. The accent colour still carries the emphasis.
 */
:where(:lang(ar), :lang(fa), :lang(ur), :lang(he), :lang(ps)) :is(.italic, em, i) {
	font-style: normal;
}