/* Same palette and type as ouairei.com, so the two read as one person's work. */
:root {
	--color-orange: #ff7f00;
	--color-green-light: #65bb50;
	--color-bg: #0a0a0a;
	--color-bg-raised: #141414;
	--color-text: #f0f0f0;
	--color-text-muted: #888;
	--color-text-faint: #555;
	--color-border: #1f1f1f;

	--font-display: 'Fraunces', 'Times New Roman', serif;
	--font-body: 'Inter', system-ui, -apple-system, sans-serif;
	--font-zh: 'Noto Serif TC', 'Fraunces', serif;
	--font-mono: 'JetBrains Mono', ui-monospace, monospace;

	--ease: cubic-bezier(0.25, 1, 0.5, 1);
}

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

body {
	font-family: var(--font-body);
	background: var(--color-bg);
	color: var(--color-text);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration: none;
	transition: color 0.3s var(--ease);
}

.mono {
	font-family: var(--font-mono);
	text-transform: uppercase;
}

.page {
	display: grid;
	gap: 1.25rem;
	max-width: 1240px;
	margin: 0 auto;
	padding: clamp(1.25rem, 4vh, 3rem) 16px 2rem;
}

/* Wide screens: the three groups in columns. Centred in the window so
   everything shows without scrolling. */
@media (min-width: 700px) {
	.page {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 2.5rem;
		align-content: center;
		align-items: start;
		min-height: 100vh;
		padding-block: 2rem;
	}

	.group:nth-of-type(1) { grid-area: 1 / 1; }
	.group:nth-of-type(2) { grid-area: 1 / 2; }
	.group:nth-of-type(3) { grid-area: 1 / 3; }
}

/* Mid widths: narrow columns wrap more, so tighten things to stay on one
   screen. */
@media (min-width: 700px) and (max-width: 1199px) {
	.page {
		gap: 1.5rem;
		padding-block: 1.25rem;
	}

	.project {
		gap: 0.1rem;
		padding: 0.5rem 0.6rem;
	}

	.p-name {
		font-size: 1.1rem;
	}

	.p-desc {
		font-size: 0.85rem;
		line-height: 1.4;
	}
}

/* Narrowest three-column widths: drop the domain line, as phones do. */
@media (min-width: 700px) and (max-width: 899px) {
	.p-host {
		display: none;
	}
}

/* --- Logo --------------------------------------------------------------- */
/* Pinned behind everything, full window height, faded so the projects read
   on top. The edges fade out into the page. */
.logo {
	position: fixed;
	inset: 0;
	z-index: -1;
	display: grid;
	place-items: center;
	pointer-events: none;
}

.logo img {
	height: 100vh;
	height: 100dvh;
	width: auto;
	max-width: 100vw;
	object-fit: contain;
	opacity: 0.2;
	-webkit-mask-image: radial-gradient(#000 70%, transparent);
	mask-image: radial-gradient(#000 70%, transparent);
	animation: logo-in 1.6s var(--ease) both;
}

@keyframes logo-in {
	from {
		opacity: 0;
		transform: scale(1.04);
	}
}

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

/* --- Projects ----------------------------------------------------------- */
.group-label {
	font-size: 0.75rem;
	letter-spacing: 0.2em;
	color: var(--color-text-faint);
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--color-border);
}

.projects {
	list-style: none;
}

.project {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	padding: 0.7rem 0.8rem;
	border-bottom: 1px solid var(--color-border);
	border-left: 2px solid transparent;
	transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.project:hover,
.project:focus-visible {
	background: rgb(20 20 20 / 0.6);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	border-left-color: var(--color-orange);
}

.p-top {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.4rem 0.8rem;
}

.p-name {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.2rem;
	line-height: 1.2;
}

.project:hover .p-name,
.project:focus-visible .p-name {
	color: var(--color-orange);
}

.p-host {
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	color: var(--color-text-faint);
}

.p-desc {
	color: var(--color-text-muted);
	font-size: 0.9rem;
	line-height: 1.45;
}

.p-stack {
	font-size: 0.68rem;
	letter-spacing: 0.1em;
	color: var(--color-green-light);
}

/* Phones: tighten everything so the whole page fits one screen.
   Client cards put the stack beside the name; the domain hides
   (the card itself is the link). */
@media (max-width: 699px) {
	.page {
		grid-template-columns: minmax(0, 1fr);
		gap: 0.55rem;
		padding-block: 0.9rem;
	}


	.group-label {
		font-size: 0.65rem;
		padding-bottom: 0.3rem;
	}

	.project {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: baseline;
		column-gap: 0.7rem;
		row-gap: 0.05rem;
		padding: 0.3rem 0.6rem;
	}

	.p-top {
		display: contents;
	}

	.p-name {
		font-size: 1.05rem;
		white-space: nowrap;
	}

	.p-host {
		display: none;
	}

	.p-stack {
		grid-row: 1;
		grid-column: 2;
		justify-self: end;
		font-size: 0.58rem;
		letter-spacing: 0.04em;
		line-height: 1.3;
		text-align: right;
	}

	.p-desc {
		grid-column: 1 / -1;
		font-size: 0.82rem;
		line-height: 1.3;
	}
}

/* Narrow phones: a little smaller still. */
@media (max-width: 380px) {
	.page {
		padding-inline: 12px;
	}

	.p-desc {
		font-size: 0.76rem;
	}
}
