/* BAKKAL personal site. Black and white, one column, no frameworks. */

:root {
	--bg: #000;
	--fg: #fff;
	--muted: #9a9a9a;
	--line: #262626;
	--panel: #0e0e0e;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--mono: ui-monospace, Consolas, "SF Mono", Menlo, monospace;
	--header: 60px;
}

* { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header) + 24px);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	color: var(--fg);
	background: var(--bg);
	font: 17px/1.6 var(--sans);
	-webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.wrap {
	width: 100%;
	max-width: 920px;
	margin: 0 auto;
	padding-left: 24px;
	padding-right: 24px;
}

.sprite { position: absolute; width: 0; height: 0; }

.icon {
	width: 1em;
	height: 1em;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.skip {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 20;
	padding: 8px 14px;
	color: var(--bg);
	background: var(--fg);
}
.skip:focus { left: 8px; }

/* HEADER */
.header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
}
.header-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: var(--header);
}
.logo {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-decoration: none;
}
.logo-smile { width: 34px; height: 9px; }

.nav { display: flex; gap: 4px; }
.nav a {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 8px 12px;
	border-radius: 6px;
	color: var(--muted);
	font-size: 15px;
	text-decoration: none;
	transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--fg); }
.nav a.current { color: var(--fg); background: #1a1a1a; }

/* INTRO */
.hero { padding-top: 112px; padding-bottom: 96px; }
.eyebrow {
	margin-bottom: 20px;
	color: var(--muted);
	font: 14px var(--mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
h1 {
	font-size: clamp(2.4rem, 8vw, 4.75rem);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.035em;
}
.lead {
	max-width: 30em;
	margin-top: 28px;
	color: var(--muted);
	font-size: 1.2rem;
}

/* SECTIONS */
.section { padding-top: 24px; padding-bottom: 96px; }
h2 {
	font: 14px var(--mono);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
	padding-bottom: 16px;
}
.section-note { margin-bottom: 28px; font-size: 1.2rem; }

/* GAMES FILTER */
.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
	padding-bottom: 16px;
}
.section-head h2 { padding-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px;
	border: 1px solid #333;
	border-radius: 999px;
	color: var(--muted);
	background: none;
	font: 14px var(--sans);
	cursor: pointer;
	transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.filter:hover { color: var(--fg); border-color: var(--fg); }
.filter[aria-pressed="true"] { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.count { font: 12px var(--mono); opacity: 0.7; }

.thumb {
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 6px;
	background: var(--panel);
}
.thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.thumb-fit { background: #fff; }
.thumb-fit img { object-fit: contain; }
.thumb-banner { aspect-ratio: 8 / 3; }
.thumb-portrait { background: var(--panel); border: 1px solid var(--line); }
.thumb-portrait img { object-fit: contain; object-position: center bottom; }
.thumb-text {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--line);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.work[hidden] { display: none; }
.pixel { image-rendering: pixelated; }

/* GAMES */
.work {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: 32px;
	padding: 32px 0;
	border-top: 1px solid var(--line);
}
.avatar:hover { filter: none; }

.work-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
h3 { font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.01em; }
.work-body p { color: #d6d6d6; }

.tag {
	display: inline-block;
	margin-left: 8px;
	padding: 3px 8px;
	border: 1px solid #444;
	border-radius: 999px;
	color: var(--muted);
	font: 400 12px var(--mono);
	letter-spacing: 0.04em;
	vertical-align: middle;
	white-space: nowrap;
}

.meta {
	display: flex;
	flex-wrap: wrap;
	color: var(--muted);
	font: 13px/1.7 var(--mono);
}
.meta li + li:not(.by)::before { content: "·"; margin: 0 8px; }
.meta .by { flex-basis: 100%; }  /* the credits always get their own line */

.button {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-top: 6px;
	padding: 9px 16px;
	border: 1px solid var(--fg);
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s, background 0.15s;
}
.button:hover { color: var(--bg); background: var(--fg); }

/* TOOLS */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tool { display: block; text-decoration: none; }
.tool h3 { margin-top: 14px; font-size: 1.1rem; }
.tool-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 4px;
	color: var(--muted);
	font-size: 15px;
	transition: color 0.15s;
}
.tool:hover .tool-link { color: var(--fg); }

/* ABOUT */
.about {
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 32px;
	padding-top: 32px;
	border-top: 1px solid var(--line);
}
.avatar {
	width: 120px;
	height: 120px;
	border-radius: 6px;
	filter: grayscale(1);
	transition: filter 0.25s;
}
.about-text { max-width: 34em; font-size: 1.2rem; }
.about-text p + p { margin-top: 1em; }
.about-text a { text-underline-offset: 3px; }

/* CONTACT */
.links li { border-top: 1px solid var(--line); }
.links li:last-child { border-bottom: 1px solid var(--line); }
.links a {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 12px;
	text-decoration: none;
	transition: color 0.15s, background 0.15s;
}
.links-name { flex: 0 0 110px; font-size: 1.2rem; font-weight: 600; }
.links-note { flex: 1; color: var(--muted); transition: color 0.15s; }
.links .icon { font-size: 20px; }
.links a:hover { color: var(--bg); background: var(--fg); }
.links a:hover .links-note { color: #444; }

/* FOOTER */
.footer {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 24px;
	padding-bottom: 40px;
	color: var(--muted);
	font: 13px var(--mono);
}

/* PHONES */
@media (max-width: 720px) {
	.hero { padding-top: 64px; padding-bottom: 64px; }
	.section { padding-bottom: 64px; }
	.work { grid-template-columns: 1fr; gap: 18px; }
	.tools { grid-template-columns: 1fr; }
	.about { grid-template-columns: 1fr; gap: 20px; }
	.avatar { width: 88px; height: 88px; }
}
@media (max-width: 540px) {
	:root { --header: 96px; }
	.wrap { padding-left: 16px; padding-right: 16px; }
	.header-row { flex-direction: column; align-items: stretch; gap: 0; padding-top: 12px; padding-bottom: 6px; }
	.nav { justify-content: space-between; margin: 4px -10px 0; }
	.nav a { padding: 8px 10px; }
	.links-name { flex-basis: 84px; }
	.tag { margin-left: 0; }
}

/* BACKGROUND FACES: the old site's smileys, in the empty space beside the column */
.bg {
	display: none;
	position: fixed;
	top: calc(var(--header) + 40px);
	z-index: -1;
	height: auto;
	max-width: none;
	opacity: 0.55;
	pointer-events: none;
	--side: calc((100vw - 920px) / 2);
}
.bg-left { left: 0; width: min(1005px, calc(var(--side) * 1.4)); }
.bg-right { right: 0; width: min(597px, var(--side)); }
@media (min-width: 1400px) { .bg { display: block; } }

/* MOTION: small feedback on hover and a fade-in on scroll */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.5s ease; }
.thumb img { transition: transform 0.4s ease; }
.work:hover .thumb img, .tool:hover .thumb img { transform: scale(1.04); }
.thumb-text { transition: letter-spacing 0.3s ease, border-color 0.3s; }
.work:hover .thumb-text { letter-spacing: 0.2em; border-color: #555; }
.button .icon, .links .icon, .tool-link .icon, .logo-smile { transition: transform 0.2s ease; }
.button:hover .icon { transform: translateX(3px); }
.tool:hover .tool-link .icon { transform: translateY(2px); }
.links a:hover .icon { transform: translate(3px, -3px); }
.links a:hover { padding-left: 20px; }
.links a { transition: color 0.15s, background 0.15s, padding 0.2s ease; }
.logo:hover .logo-smile { transform: scale(1.15, 1.7); }
.button:active, .filter:active { transform: scale(0.96); }

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