/* josiah.games: shared tokens and components.
   Starts from the josiah.tools system (2px ink outlines, flat pastels) and adds
   sticker shadows and a chunkier type voice. */

:root {
	--bg: #e6e3ee;
	--bg-dot: #cfcadd;
	--surface: #fff;
	--ink: #000;
	--muted: #57536a;
	--line: #000;

	--yellow: #ffe066;
	--mint: #55efc4;
	--mint-strong: #00b894;
	--peach: #fab1a0;
	--coral: #ff7a59;
	--cyan: #81ecec;
	--pink: #ffb3d1;
	--lilac: #c7b8ff;

	--btn: #fff;
	--btn-hover: #f3f1f8;

	--radius-card: 18px;
	--radius-control: 8px;
	--border: 2px solid var(--line);
	--shadow: 4px 4px 0 var(--ink);
	--shadow-lg: 6px 6px 0 var(--ink);

	--ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

	--font: "Bricolage Grotesque", "Poppins", system-ui, sans-serif;

	color-scheme: light;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

::selection {
	background: var(--ink);
	color: #fff;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background-color: var(--bg);
	background-image: radial-gradient(var(--bg-dot) 1.2px, transparent 1.4px);
	background-size: 22px 22px;
	color: var(--ink);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.5;
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
	margin: 0;
	line-height: 1.05;
	font-weight: 800;
	letter-spacing: -0.02em;
	font-stretch: 85%;
}

h1 {
	font-size: clamp(42px, 8vw, 76px);
	letter-spacing: -0.035em;
}

h2 {
	font-size: clamp(26px, 4vw, 34px);
}

h3 {
	font-size: 21px;
}

p {
	margin: 0;
}

a {
	color: inherit;
}

img,
svg {
	display: block;
	max-width: 100%;
}

:focus-visible {
	outline: 3px solid var(--mint-strong);
	outline-offset: 3px;
}

.wrap {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 20px;
}

main {
	flex: 1;
	overflow-x: clip;
	padding: 36px 0 72px;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Nav ---------- */

.site-nav {
	border-bottom: var(--border);
	background: var(--surface);
}

.site-nav .wrap {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 64px;
}

.wordmark {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 800;
	font-size: 21px;
	letter-spacing: -0.02em;
	text-decoration: none;
}

.wordmark-dots {
	display: grid;
	grid-template-columns: 11px 11px;
	gap: 3px;
	transition: transform 0.4s var(--ease-spring);
}

.wordmark-dots span {
	width: 11px;
	height: 11px;
	border: 2px solid var(--ink);
	border-radius: 50%;
}

.wordmark-dots span:nth-child(1) { background: var(--pink); }
.wordmark-dots span:nth-child(2) { background: var(--yellow); }
.wordmark-dots span:nth-child(3) { background: var(--mint); }
.wordmark-dots span:nth-child(4) { background: var(--lilac); }

.wordmark:hover .wordmark-dots {
	transform: rotate(90deg);
}

.nav-links {
	display: flex;
	gap: 6px;
	margin: 0 0 0 auto;
	padding: 0;
	list-style: none;
}

.nav-links a {
	display: block;
	white-space: nowrap;
	padding: 5px 14px;
	border: 2px solid transparent;
	border-radius: 50px;
	font-weight: 600;
	font-size: 16px;
	text-decoration: none;
}

.nav-links a:hover {
	border-color: var(--ink);
}

.nav-links a[aria-current="page"] {
	border-color: var(--ink);
	background: var(--link-color, var(--yellow));
}

/* ---------- Buttons ---------- */

.btn {
	--btn-bg: var(--btn);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 20px;
	border: var(--border);
	border-radius: var(--radius-control);
	background: var(--btn-bg);
	box-shadow: var(--shadow);
	color: var(--ink);
	font: inherit;
	font-weight: 700;
	font-size: 17px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition:
		transform 0.12s var(--ease-out),
		box-shadow 0.12s var(--ease-out),
		background-color 0.15s;
}

.btn:hover {
	transform: translate(-1px, -1px);
	box-shadow: 5px 5px 0 var(--ink);
}

.btn:active {
	transform: translate(4px, 4px);
	box-shadow: 0 0 0 var(--ink);
}

.btn[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
	transform: none;
	box-shadow: var(--shadow);
}

.btn.big {
	padding: 14px 28px;
	font-size: 21px;
	border-radius: 12px;
}

.btn.primary { --btn-bg: var(--mint); }
.btn.yellow { --btn-bg: var(--yellow); }
.btn.pink { --btn-bg: var(--pink); }

.btn.ghost {
	box-shadow: none;
	border-color: transparent;
	background: transparent;
}

.btn.ghost:hover {
	border-color: var(--ink);
	transform: none;
}

.btn svg {
	width: 20px;
	height: 20px;
}

/* ---------- Cards ---------- */

.card {
	border: var(--border);
	border-radius: var(--radius-card);
	background: var(--surface);
	padding: 22px;
}

.card.sticker {
	box-shadow: var(--shadow-lg);
}

/* ---------- Checkbox (round-robin style) ---------- */

.check {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	user-select: none;
}

.check input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.check-box {
	flex: none;
	position: relative;
	width: 22px;
	height: 22px;
	border: var(--border);
	border-radius: 5px;
	background: var(--surface);
	transition: background-color 0.15s, transform 0.2s var(--ease-spring);
}

.check:hover .check-box {
	background: #0000000d;
}

.check input:checked + .check-box {
	background: var(--check-color, var(--mint-strong));
}

.check input:checked + .check-box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 6px;
	height: 12px;
	border: solid var(--ink);
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}

.check input:indeterminate + .check-box {
	background: var(--check-color, var(--mint-strong));
}

.check input:indeterminate + .check-box::after {
	content: "";
	position: absolute;
	left: 3px;
	right: 3px;
	top: 8px;
	height: 2.5px;
	background: var(--ink);
}

.check input:active + .check-box {
	transform: scale(0.85);
}

.check input:focus-visible + .check-box {
	outline: 3px solid var(--mint-strong);
	outline-offset: 2px;
}

/* ---------- Toast ---------- */

.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 50;
	padding: 10px 18px;
	border-radius: 50px;
	background: var(--ink);
	color: #fff;
	font-weight: 600;
	transform: translate(-50%, calc(100% + 40px));
	visibility: hidden;
	transition: transform 0.3s var(--ease-spring), visibility 0s 0.3s;
	pointer-events: none;
}

.toast.show {
	transform: translate(-50%, 0);
	visibility: visible;
	transition: transform 0.3s var(--ease-spring);
}

/* ---------- Footer ---------- */

.site-footer {
	padding: 22px 0;
	border-top: var(--border);
	background: var(--surface);
	color: var(--muted);
	font-size: 15px;
}

/* ---------- Home ---------- */

.home-hero {
	max-width: 760px;
	margin-bottom: 44px;
}

.home-hero p {
	margin-top: 14px;
	max-width: 52ch;
	color: var(--muted);
	font-size: 20px;
}

.game-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 28px;
}

/* Paint-chip tile: a strip of swatches above a white label */
.game-tile {
	display: flex;
	flex-direction: column;
	border: var(--border);
	border-radius: var(--radius-card);
	background: var(--surface);
	box-shadow: var(--shadow-lg);
	overflow: hidden;
	text-decoration: none;
	transition: transform 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-spring);
}

.game-tile:hover {
	transform: translate(-3px, -3px) rotate(-1deg);
	box-shadow: 9px 9px 0 var(--ink);
}

.game-tile:active {
	transform: translate(3px, 3px);
	box-shadow: 0 0 0 var(--ink);
}

.tile-chips {
	display: flex;
	flex-direction: column;
	height: 190px;
	border-bottom: var(--border);
}

.tile-chips span {
	flex: 1;
	transition: flex 0.35s var(--ease-spring);
}

.tile-chips span + span {
	border-top: 2px solid var(--ink);
}

.game-tile:hover .tile-chips span:nth-child(2) {
	flex: 2.2;
}

.tile-label {
	padding: 16px 18px 18px;
}

.tile-label h2 {
	font-size: 28px;
}

.tile-label p {
	margin-top: 6px;
	color: var(--muted);
	font-size: 16px;
	line-height: 1.4;
}

.game-tile.soon {
	box-shadow: none;
	border-style: dashed;
	background: transparent;
	pointer-events: none;
}

.game-tile.soon .tile-chips {
	border-bottom-style: dashed;
}

.game-tile.soon .tile-chips span {
	background: repeating-linear-gradient(-45deg, transparent 0 10px, #0000000f 10px 20px);
}

.game-tile.soon .tile-chips span + span {
	border-top-style: dashed;
}

@media (max-width: 520px) {
	.site-nav .wrap {
		gap: 8px;
		padding: 0 12px;
	}

	.wordmark {
		gap: 7px;
		font-size: 17px;
	}

	.wordmark-dots {
		grid-template-columns: 9px 9px;
		gap: 2px;
	}

	.wordmark-dots span {
		width: 9px;
		height: 9px;
	}

	.nav-links {
		gap: 2px;
	}

	.nav-links a {
		padding: 3px 9px;
		font-size: 14px;
	}

	.wrap {
		padding: 0 16px;
	}
}

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