/* nickrunco.me */

@font-face {
	font-family: "Karla";
	src: url("../fonts/karla-latin-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--text: #777;
	--link: #800080;
	--link-line: rgba(128, 0, 128, 0.5);
	--highlight: #f00;
	--highlight-line: rgba(255, 0, 0, 0.25);
	--ease-out: cubic-bezier(0.1, 0.75, 0.21, 1);
	--ease-in-out: cubic-bezier(1, 0, 0, 1);
}

body {
	margin: 0;
	font-family: "Karla", sans-serif;
	line-height: 1;
	letter-spacing: -1px;
	color: var(--text);
}

a {
	color: var(--link);
	text-decoration: none;
	border-bottom: 0.25rem solid var(--link-line);
}

a:hover {
	border-bottom-color: var(--link);
}

.sep {
	margin: 0 0.35em 0 0.5em;
}

/* Site nav, rotated to run down the right edge */
.site-nav {
	position: fixed;
	z-index: 10;
	top: 1rem;
	right: 1rem;
	width: 0;
	height: 0;
	transform-origin: 100% 0;
	transform: rotate(90deg);
	color: var(--highlight);
	white-space: nowrap;
}

/* Page copy: each child of <main> is one large block */
main {
	position: relative;
	z-index: 1;
	padding: 3rem 6rem 50vh;
}

main > * {
	margin: 0 0 35vh;
	font-size: 3em;
	font-weight: 400;
	line-height: 1.75em;
}

.work main > * {
	margin-bottom: 10vh;
}

main > :first-child {
	margin-top: 25vh;
}

main > :last-child {
	margin-bottom: 0;
}

/* Highlighted words: white text on a red bar */
main em {
	position: relative;
	z-index: 0;
	padding: 0 0.25em;
	border-bottom: 0.25rem solid var(--highlight-line);
	color: #fff;
	font-style: normal;
	white-space: nowrap;
}

main em::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	background: var(--highlight);
	transform-origin: 0 0;
}

.note {
	display: block;
	font-size: 0.5em;
}

/* Scroll animation. Applies only when <html> has .js (set in each page's <head>) and the
   visitor hasn't asked for reduced motion; otherwise everything shows in its final state. */
@media (prefers-reduced-motion: no-preference) {
	.js main > * {
		opacity: 0.2;
		transform: translate3d(0, 3rem, 0);
	}

	.js main > .on {
		opacity: 1;
		transform: none;
		transition: transform 1.5s var(--ease-out), opacity 1s linear;
	}

	/* Bars sweep in one word at a time; site.js numbers each word with --i */
	.js main em::before {
		transform: scaleX(0);
		transition: transform 0.5s var(--ease-in-out);
	}

	.js main > .on em::before {
		transform: scaleX(1);
		transition-delay: calc(1.1s + var(--i, 0) * 0.25s);
	}
}

@media (max-width: 568px) {
	main {
		padding: 2rem 5rem 2rem 2rem;
	}

	main > * {
		margin-bottom: 18vh;
		font-size: 2em;
	}

	main > :first-child {
		margin-top: 10vh;
	}

	main > :last-child {
		margin-bottom: 10vh;
	}
}
