/* ==========================================================================
   jevontimmons.com: editorial / bone and aubergine / oxblood, plum, umber
   ========================================================================== */

:root {
	--paper: #f1e9e4;
	--ink: #241519;
	--ink-soft: #6e5961;
	--rule: #24151926;
	--grid: #2415190d;

	--red: #a3242f;      /* oxblood */
	--plum: #6b2d5c;
	--umber: #8a5432;
	--accent-bg: #a3242f;
	--on-accent: #f6eee9;
	--btn-shadow: #241519;

	--display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
	--serif: "Newsreader", Georgia, serif;
	--mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

	--pad: clamp(1.25rem, 4vw, 3.5rem);
	--max: 78rem;
	--edge: max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
	--ease: cubic-bezier(.2, .7, .1, 1);
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #170f13;
		--ink: #f0e4de;
		--ink-soft: #b19ea6;
		--rule: #f0e4de21;
		--grid: #f0e4de0a;

		--red: #e4606b;
		--plum: #c48ab4;
		--umber: #d19a72;
		--accent-bg: #b3303c;
		--btn-shadow: #5d2650;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background-color: var(--paper);
	color: var(--ink);
	font: 400 clamp(1.05rem, .98rem + .3vw, 1.2rem)/1.6 var(--serif);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	/* graph-paper grid, vertical lines registered to the content edge */
	background-image:
		linear-gradient(var(--grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 100% 6rem, 6rem 100%;
	background-position: 0 0, var(--edge) 0;
	background-attachment: fixed;
}

/* grain */
body::after {
	content: "";
	position: fixed; inset: 0;
	pointer-events: none;
	opacity: .06;
	z-index: 100;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent-bg); color: var(--on-accent); }

a { color: inherit; }
a:focus-visible, .btn:focus-visible {
	outline: 3px solid var(--red);
	outline-offset: 4px;
	border-radius: 2px;
}

.mono { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
	position: absolute; left: 1rem; top: -4rem; z-index: 200;
	background: var(--ink); color: var(--paper); padding: .6rem 1rem;
	font-family: var(--mono); font-size: .8rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

.dot { color: var(--red); }

/* ---------- top bar ---------- */
.bar {
	position: sticky; top: 0; z-index: 50;
	display: flex; align-items: center; gap: 1.5rem;
	padding: 1rem var(--pad);
	background: color-mix(in srgb, var(--paper) 82%, transparent);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--rule);
}
.mark {
	font: 800 1.15rem/1 var(--display);
	text-decoration: none;
	letter-spacing: -.02em;
	position: relative;
}
.mark::after {
	content: ""; position: absolute; right: -.45rem; bottom: .05rem;
	width: .32rem; height: .32rem; border-radius: 50%; background: var(--red);
}
.bar-meta { margin: 0 auto 0 1rem; color: var(--ink-soft); }
.bar ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.bar nav a { text-decoration: none; position: relative; }
.bar nav a::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -.25rem; height: 2px;
	background: var(--red); transform: scaleX(0); transform-origin: left;
	transition: transform .35s var(--ease);
}
.bar nav a:hover::after { transform: scaleX(1); }

@media (max-width: 34rem) { .bar-meta { display: none; } .bar nav { margin-left: auto; } }

/* ---------- layout ---------- */
main > section {
	position: relative;
	max-width: var(--max);
	margin-inline: auto;
	padding: clamp(4rem, 10vw, 8rem) var(--pad);
	scroll-margin-top: 3.5rem;
}
/* section rules sit on the content edges, not the padding box */
.about::before, .contact::before, .foot::before {
	content: "";
	position: absolute; top: 0; left: var(--pad); right: var(--pad);
	height: 1px; background: var(--rule);
}

.label { color: var(--ink-soft); margin: 0 0 1rem; }

h2 {
	font: 800 clamp(2.4rem, 1.5rem + 4vw, 5rem)/.95 var(--display);
	letter-spacing: -.035em;
	margin: 0;
}

/* ---------- hero ---------- */
.hero {
	min-height: calc(100svh - 4rem);
	display: grid;
	align-content: center;
	padding-top: clamp(3rem, 8vw, 6rem) !important;
}
.kicker { color: var(--ink-soft); margin: 0 0 clamp(1rem, 3vw, 2rem); }

.trio {
	list-style: none; margin: 0; padding: 0;
	font: 800 clamp(3.2rem, 1rem + 10.5vw, 10.5rem)/.86 var(--display);
	letter-spacing: -.05em;
}
.trio li {
	position: relative;
	padding: 1.6rem 0 .1em;
	border-bottom: 1px solid var(--rule);
	transition: color .3s var(--ease), padding-left .45s var(--ease);
}
.trio li:first-child { padding-top: 1.2rem; }
.trio li:last-child { border-bottom: 0; }
.trio li:hover { color: var(--c); padding-left: .12em; }
.trio .idx {
	position: absolute; left: 0; top: .5rem;
	font-size: .72rem; font-weight: 500; letter-spacing: .1em;
	line-height: 1;
	color: var(--c);
}
.trio li:first-child .idx { top: .1rem; }
/* colored dash after each number: umber, plum, red */
.trio .idx::after, .pillars .num::after {
	content: "";
	display: inline-block;
	width: 2.25rem; height: 2px;
	margin-left: .6rem;
	vertical-align: middle;
	background: var(--c);
}
.br-sm { display: none; }
@media (max-width: 30rem) { .br-sm { display: inline; } }

/* "Gamer": letters hop on hover, and when Player 2 joins */
.gamer { cursor: default; user-select: none; -webkit-user-select: none; }
.wave span { display: inline-block; }
.gamer:hover .wave span,
.gamer.is-playing .wave span {
	animation: hop .55s var(--ease) both;
	animation-delay: calc(var(--i) * 55ms);
}
@keyframes hop {
	35% { transform: translateY(-.16em); }
	70% { transform: translateY(.02em); }
	100% { transform: none; }
}

.lede {
	max-width: 38rem;
	margin: clamp(2rem, 4vw, 3rem) 0 0;
	font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem);
	line-height: 1.5;
	color: var(--ink-soft);
}

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; margin-top: 2.25rem; }

/* desktop: words on the left, intro and button take the right column */
@media (min-width: 62rem) {
	.hero {
		grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem);
		column-gap: clamp(2rem, 5vw, 5rem);
	}
	.kicker { grid-column: 1 / -1; }
	.hero-aside { align-self: end; padding-bottom: 1.2rem; }
	.lede { margin-top: 0; font-size: clamp(1.1rem, .9rem + .4vw, 1.3rem); }
}

.btn {
	display: inline-flex; align-items: center; gap: .6rem;
	font: 700 1rem/1 var(--display);
	text-decoration: none;
	color: var(--on-accent);
	background: var(--accent-bg);
	padding: 1rem 1.4rem;
	box-shadow: 5px 5px 0 var(--btn-shadow);
	transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--btn-shadow); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--btn-shadow); }
.link { text-underline-offset: .3em; text-decoration-thickness: 1px; }
.link:hover { color: var(--red); }

/* ---------- about ---------- */
.section-head { display: grid; gap: .25rem; margin-bottom: clamp(2.5rem, 6vw, 4rem); }

.pillars {
	list-style: none; margin: 0; padding: 0;
	border-top: 2px solid var(--ink);
}
.pillars li {
	display: grid;
	gap: .6rem;
	padding: clamp(1.75rem, 3.5vw, 2.75rem) 0;
	border-bottom: 1px solid var(--rule);
}
.pillars .num { color: var(--c); }
.pillars h3 {
	font: 700 clamp(1.6rem, 1.1rem + 1.8vw, 2.75rem)/1 var(--display);
	letter-spacing: -.03em;
	margin: 0;
	transition: color .3s var(--ease);
}
.pillars li:hover h3 { color: var(--c); }
.pillars p { margin: 0; color: var(--ink-soft); max-width: 36rem; }

@media (min-width: 56rem) {
	.pillars li {
		grid-template-columns: 4rem minmax(0, 22rem) minmax(0, 1fr);
		column-gap: clamp(1.5rem, 4vw, 3.5rem);
		align-items: baseline;
	}
}

.toolbox { margin-top: clamp(3rem, 7vw, 5rem); }
.inline-list {
	list-style: none; margin: 0 0 2.25rem; padding: 0;
	max-width: 62rem;
	font: 700 clamp(1.2rem, .95rem + 1vw, 1.75rem)/1.45 var(--display);
	letter-spacing: -.015em;
}
.inline-list li { display: inline; }
.inline-list li:not(:last-child)::after {
	/* nbsp keeps the dot on the word before it; the plain space after is where lines break.
	   Two spaces: CSS swallows the first one as the end of the \00a0 escape. */
	content: "\00a0\00a0·\00a0  ";
	content: "\00a0\00a0·\00a0  " / "";
	color: var(--red);
	font-weight: 400;
}
.inline-alt li { color: var(--plum); }
.inline-alt li:not(:last-child)::after { color: var(--umber); }

/* ---------- contact ---------- */
.contact h2 { font-size: clamp(3rem, 1.5rem + 7vw, 8rem); }
.contact-copy { max-width: 34rem; color: var(--ink-soft); margin: 1.5rem 0 3rem; }
.contact-links { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.contact-links a {
	display: grid; grid-template-columns: 7rem 1fr auto; align-items: baseline; gap: 1rem;
	padding: 1.4rem 0;
	text-decoration: none;
	border-bottom: 1px solid var(--rule);
	transition: padding .35s var(--ease), background .35s var(--ease), color .2s;
}
.contact-links .mono { color: var(--ink-soft); }
.contact-links .handle {
	font: 700 clamp(1.5rem, 1rem + 2.5vw, 3rem)/1 var(--display);
	letter-spacing: -.03em;
	overflow-wrap: anywhere;
}
.contact-links .arrow { font-size: 1.5rem; transition: transform .35s var(--ease); }
.contact-links a:hover { padding-inline: 1rem; background: var(--accent-bg); color: var(--on-accent); }
.contact-links a:hover .mono { color: var(--on-accent); }
.contact-links a:hover .arrow { transform: translate(4px, -4px); }
@media (max-width: 34rem) {
	.contact-links a { grid-template-columns: 1fr auto; }
	.contact-links .mono { grid-column: 1 / -1; }
}

/* ---------- footer ---------- */
.foot {
	position: relative;
	max-width: var(--max); margin: 0 auto;
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
	padding: 2rem var(--pad) 3rem;
	color: var(--ink-soft);
}
.foot p { margin: 0; }
.cheat { letter-spacing: .25em; opacity: .55; transition: opacity .3s; }
.cheat:hover { opacity: 1; color: var(--plum); }

/* ---------- Player 2 toast ---------- */
.toast {
	position: fixed; left: 50%; bottom: 1.5rem; z-index: 150;
	transform: translate(-50%, calc(100% + 3rem));
	padding: .9rem 1.3rem;
	background: var(--ink); color: var(--paper);
	font-size: .85rem; letter-spacing: .14em;
	box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--plum), 6px 6px 0 6px var(--red);
	transition: transform .5s steps(6, end);
	pointer-events: none;
}
.toast:empty { visibility: hidden; }
.toast.show { transform: translate(-50%, 0); }
.toast::before { content: "▶ "; color: var(--red); }

/* ---------- motion ---------- */
.reveal {
	opacity: 0;
	transform: translateY(.6em);
	animation: rise .9s var(--ease) forwards;
	animation-delay: calc(var(--d, 0) * 110ms + 80ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.reveal { opacity: 1; transform: none; }
}
