/* Projects page: coloured 4:5 cards with abstract shapes, one per page tagged #project.
   Loaded only by page-projects.hbs */
.projects-head .projects-intro {
	max-width: 42rem;
	margin: 1.5rem auto 0;
	text-align: center;
}
.projects-grid {
	display: grid;
	gap: 3rem 1.5rem;
	margin: 1rem 0 5rem;
	counter-reset: project;
}
@media (min-width: 640px) {
	.projects-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (min-width: 1024px) {
	.projects-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
.project-card {
	display: flex;
	flex-direction: column;
	counter-increment: project;
	transition: opacity 0.3s;
}
.projects-grid:has(> .project-card:hover) > .project-card:not(:hover) {
	opacity: 0.7;
}

/* six covers, cycled over the visible cards */
.project-card:nth-child(6n + 1) { --bg: #d8402e; --fg: #fbf1e4; --shape: #f2b632; --show: var(--s-circle); }
.project-card:nth-child(6n + 2) { --bg: #efe6d2; --fg: #16161a; --shape: #1f4fa0; --show: var(--s-half); }
.project-card:nth-child(6n + 3) { --bg: #1f4fa0; --fg: #f4f0e6; --shape: #e7533a; --show: var(--s-quarter); }
.project-card:nth-child(6n + 4) { --bg: #f2b632; --fg: #1c1606; --shape: #1c1606; --show: var(--s-stripes); }
.project-card:nth-child(6n + 5) { --bg: #17171b; --fg: #f1ece2; --shape: #d8402e; --show: var(--s-arch); }
.project-card:nth-child(6n + 6) { --bg: #2f6b4f; --fg: #eef3e6; --shape: #efe6d2; --show: var(--s-rings); }
.project-shape > * { display: none; }
.project-card:nth-child(6n + 1) .shape-circle,
.project-card:nth-child(6n + 2) .shape-half-disc,
.project-card:nth-child(6n + 3) .shape-quarter,
.project-card:nth-child(6n + 4) .shape-stripes,
.project-card:nth-child(6n + 5) .shape-arch,
.project-card:nth-child(6n + 6) .shape-rings { display: block; }

.project-cover {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	aspect-ratio: 4 / 5;
	padding: 1.5rem;
	border-radius: 0.9rem;
	overflow: hidden;
	background: var(--bg, #17171b);
	color: var(--fg, #f1ece2);
	text-decoration: none;
	transition: opacity 0.3s;
}
.project-cover:hover,
.project-cover:focus-visible {
	color: var(--fg, #f1ece2);
	opacity: 0.95;
}
.project-cover:focus-visible {
	outline: 2px solid var(--fg, #f1ece2);
	outline-offset: 3px;
}
.project-shape {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	fill: var(--shape, #d8402e);
	stroke: var(--shape, #d8402e);
	pointer-events: none;
	transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.project-shape .shape-rings { fill: none; }
.project-shape .shape-rings circle { fill: none; }
.project-shape .shape-circle,
.project-shape .shape-half-disc,
.project-shape .shape-quarter,
.project-shape .shape-stripes,
.project-shape .shape-arch { stroke: none; }
.project-card:hover .project-shape {
	transform: translate(-4%, 3%);
}
.project-topline,
.project-bottom {
	position: relative;
}
.project-topline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.project-issue {
	opacity: 0.7;
	font-variant-numeric: tabular-nums;
}
.project-issue::before {
	content: "No. " counter(project, decimal-leading-zero);
}
.project-bottom {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
}
.project-title {
	margin: 0;
	max-width: 12ch;
	font-size: clamp(1.75rem, 3.2vw, 2.75rem);
	font-weight: 700;
	line-height: 0.98;
	letter-spacing: -0.03em;
	text-wrap: balance;
	color: inherit;
}
.project-title:has(.project-title-page) .project-title-fallback {
	display: none;
}
.project-arrow {
	flex-shrink: 0;
	width: 1.5rem;
	height: 1.5rem;
	opacity: 0;
	transform: translateX(-0.5rem);
	transition: opacity 0.3s, transform 0.3s;
}
.project-card:hover .project-arrow {
	opacity: 1;
	transform: translateX(0);
}
.project-meta {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 1rem 0 0;
	font-size: 0.9rem;
}
.project-excerpt {
	color: var(--text-color-main);
}
.project-byline {
	color: var(--text-color-alt);
}
.project-author {
	font-weight: 500;
	color: var(--text-color-main);
}
@media (min-width: 768px) {
	.project-cover {
		padding: 2rem;
	}
}
@media (prefers-reduced-motion: reduce) {
	.project-card,
	.project-cover,
	.project-shape,
	.project-arrow {
		transition: none;
	}
	.project-card:hover .project-shape {
		transform: none;
	}
	.project-arrow {
		transform: none;
	}
}
