:root {
	--browser-gap: 8px
}

.CE-browser-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
	gap: var(--browser-gap);
	margin: var(--browser-gap);
}

/* limit to max 4 columns */
@media (min-width: 1100px) {
	.CE-browser-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 640px) {
	.CE-browser-grid {
		margin-bottom: 100px;
	}
}

.CE-browser-item {
	aspect-ratio: 1 / 1;
	background: #3e3e3e;
	box-sizing: border-box;
	background-size: contain;
	transition:
		transform 0.2s ease-in-out,
		box-shadow 0.2s ease-in-out;
	border-radius: 8px;
	text-decoration: none;

	display: flex;
	flex-direction: column;
	overflow: hidden;

	position: relative; /* Add this */
	overflow: hidden; /* already present, good */
}

/* Glint effect overlay */
.CE-browser-item::after {
	content: "";
	position: absolute;
	top: -50%;
	left: -75%;
	width: 50%;
	height: 200%;
	background: linear-gradient(
		120deg,
		transparent 0%,
		rgba(255, 255, 255, 0.25) 50%,
		transparent 100%
	);
	transform: rotate(25deg);
	opacity: 0;
	pointer-events: none;
	transition: none;
}

/* Hover triggers the glint animation */
.CE-browser-item:hover::after {
	animation: glint-sweep 0.8s ease forwards;
}

/* Keyframes for the glint sweep */
@keyframes glint-sweep {
	from {
		left: -75%;
		opacity: 0;
	}
	10% {
		opacity: 1;
	}
	to {
		left: 125%;
		opacity: 0;
	}
}

.CE-browser-item p {
	margin-top: auto;
	padding: 24px;
	font-size: clamp(18px, 3vw, 32px);
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
	line-height: 1;
	font-weight: 600;
	margin-bottom: 0;
	background: linear-gradient(
		90deg,
		rgba(0, 0, 0, 0.5) 0%,
		rgba(0, 0, 0, 0) 80%
	);
	font-family: "Hanson", "Circular Spotify", "Inter";
	border-radius: 0 0 0 8px;
}

/* Date */
.ce-date {
	display: block;
	font-size: clamp(12px, 1.5vw, 16px);
	margin-top: 4px;
}

/* Hover */
.CE-browser-item:hover {
	transform: scale(1.02);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

#CE-title {
	display: flex;
	margin: var(--browser-gap);
	margin-bottom: 0;
	background-image: url(../GameResources/CreativeExperiments/Images/CuttingBoardTextWide.png);
	background-size: cover;
	background-position: center;
	height: 10vw;
	box-sizing: border-box;
	flex-shrink: 0;
	border-radius: 8px;
}

@media (max-width: 790px) {
	#CE-title {
		background-image: url(../GameResources/CreativeExperiments/Images/CuttingBoardText.png);
		height: 25vw;
	}
}

.pdf-wrapper {
	display: flex;
	justify-content: center;
	width: 100%;
}

/* Main PDF viewer (object) */
.pdf-viewer {
	border: none;
	width: 100%;
	height: 150vw;
	max-height: 900px;
	max-width: 1200px;
	border-radius: 16px;
	background: #111; /* optional, looks nicer while loading */
}

/* Fallback iframe (smaller so it doesn’t feel oversized) */
.pdf-iframe {
	height: 75vw;
	max-height: 450px;
}

/* Final fallback (text only) */
.pdf-fallback {
	width: 100%;
	max-width: 1200px;
	height: 140px;

	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;

	border-radius: 16px;
	background: #111;
	color: #fff;
	padding: 16px;
	box-sizing: border-box;
}

.pdf-fallback a {
	color: #4da3ff;
	text-decoration: none;
}

.pdf-fallback a:hover {
	text-decoration: underline;
}
.project-content-div {
	padding: 24px;
}

.project-content-div #page-header {
	line-height: 1em;
	margin-bottom: 12px;
}

@media (max-width: 640px) {
	.project-content-div {
		padding-bottom: 100px;
	}
}

.CE-back-button {
	background-image: url(../GameResources/CreativeExperiments/Images/CuttingBoardBack.png);
	background-size: cover;
	background-position: center;
	width: 100%;
	aspect-ratio: 10/2;
	display: flex;
	margin-bottom: 24px;
	border-radius: 8px;
	max-width: 240px;
	transition:
		transform 0.2s ease-in-out,
		box-shadow 0.2s ease-in-out;
}

.CE-back-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ==== Page Styling ==== */

/* ── Intro section (floated thumbnail + prose) ───────────── */

.ah-intro-section {
	overflow: hidden;
	margin-bottom: 24px;
}

.ah-thumbnail {
	float: right;
	width: clamp(180px, 50%, 480px);
	margin: 16px 0 24px 24px;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
	display: block;
}

#robotics-back-button {
	margin-bottom: 64px;
}

@media (max-width: 640px) {
	.ah-thumbnail {
		float: none;
		width: 100%;
		margin: 0 0 16px 0;
	}

	.CE-back-button {
		max-width: 1000px;
	}

	#robotics-back-button {
		margin-bottom: 32px;
	}
}

/* ── Tool / software tags ────────────────────────────────── */

.ah-tools-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
	clear: right;
}

@media (max-width: 640px) {
	.ah-tools-row {
		clear: none;
	}
}

.ah-tool-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px 8px 16px;
	border-radius: 24px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	font-family: "Circular Spotify", "Inter", sans-serif;
	background: var(--tag-accent);
	color: var(--color-text-1);
}

.ah-tool-tag[data-tool="inventor"] 			{ --tag-accent: #dbae03; }
.ah-tool-tag[data-tool="affinity-publisher"]{ --tag-accent: #78b053; }
.ah-tool-tag[data-tool="blender"] 			{ --tag-accent: #ea7600; }
.ah-tool-tag[data-tool="davinci-resolve"]   { --tag-accent: #263e57; }
.ah-tool-tag[data-tool="sony"]       		{ --tag-accent: #1a3555; }
.ah-tool-tag[data-tool="darktable"]  		{ --tag-accent: #522759; }
.ah-tool-tag[data-tool="python"]       		{ --tag-accent: #306998; }
.ah-tool-tag[data-tool="raspberry-pi"] 		{ --tag-accent: #c51a4a; }
.ah-tool-tag[data-tool="godot"]         	{ --tag-accent: #478cbf; }
.ah-tool-tag[data-tool="vscode"] 			{ --tag-accent: #0078d4; }
.ah-tool-tag[data-tool="typescript"]		{ --tag-accent: #2f74c0; }
.ah-tool-tag[data-tool="php"]       		{ --tag-accent: #4f3b6e; }
.ah-tool-tag[data-tool="mysql"]     		{ --tag-accent: #4479a1; }
.ah-tool-tag[data-tool="html-css"]  		{ --tag-accent: #c0522b; }
.ah-tool-tag[data-tool="xampp"]     		{ --tag-accent: #f7820a; }
.ah-tool-tag[data-tool="cloudflare"]		{ --tag-accent: #f38020; }

/* ── Two-column breakdown grid ───────────────────────────── */

.ah-breakdown-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 24px;
}

@media (max-width: 640px) {
	.ah-breakdown-grid {
		grid-template-columns: 1fr;
	}
}

.ah-breakdown-card {
	padding: 16px;
	border-radius: 16px;
	background: var(--color-primary-a10);
}

.ah-breakdown-card p {
	margin: 0;
	font-size: 14px;
	line-height: 1.65;
	color: var(--color-text-2);
	font-family: "Circular Spotify", "Inter", sans-serif;
}

.ah-breakdown-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
	margin-bottom: 8px;
	font-family: "Circular Spotify", "Inter", sans-serif;
}

/* ── Section dividers ────────────────────────────────────── */

.ah-section-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 32px 0 16px;
}

.ah-section-divider::before,
.ah-section-divider::after {
	content: "";
	flex: 1;
	height: 2px;
	background: var(--color-primary-a20);
}

.ah-section-divider span {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
	white-space: nowrap;
	font-family: "Circular Spotify", "Inter", sans-serif;
}

/* ── PDF viewer ──────────────────────────────────────────── */

.pdf-viewer {
	border: none;
	width: 100%;
	height: 150vw;
	max-height: 700px;
}

/* ── Video wrapper ───────────────────────────────────────── */

.ah-video-wrapper {
	align-items: center;
	display: flex;
	flex-direction: column;
}

.ah-video-wrapper video {
	max-height: 480px;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
	display: block;
	background: var(--color-primary-a0);
}

.ah-video-caption {
	margin-top: 8px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--color-text-2);
	text-align: center;
	font-family: "Circular Spotify", "Inter", sans-serif;
	opacity: 0.7;
	width: 100%;
	max-width: 800px;
	margin-top: 12px;
	margin-bottom: 0;
}

@media (max-width: 800px) {
	.ah-video-wrapper video {
		width: 100%;
	}
}

/* ── Licence / credits footer ────────────────────────────── */

.license-footer {
	margin-top: 8px;
	margin-bottom: 8px;
}

.license-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: 12px;
	margin-bottom: 16px;
}

.license-group {
	background: var(--color-primary-a10);
	border-radius: 16px;
	padding: 16px;
}

.license-group-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-primary-a30);
	margin: 0 0 12px;
	font-family: "Circular Spotify", "Inter", sans-serif;
}

.license-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 0;
	border-bottom: 1px solid var(--color-primary-a10);
}

.license-item:first-of-type {
	padding-top: 0;
}

.license-item:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.license-asset {
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text-1);
	font-family: "Circular Spotify", "Inter", sans-serif;
}

.license-detail {
	font-size: 12px;
	line-height: 1.5;
	color: var(--color-text-2);
	opacity: 0.75;
	font-family: "Circular Spotify", "Inter", sans-serif;
}

.license-note {
	font-size: 12px;
	text-align: center;
	color: var(--color-text-2);
	opacity: 0.45;
	font-family: "Circular Spotify", "Inter", sans-serif;
	margin: 0;
	padding-top: 8px;
}

.ah-install-callout {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: var(--color-primary-a10);
	border-radius: 16px;
	padding: 20px 24px;
	flex-wrap: wrap;
	max-width: 640px;
}

.ah-install-callout p {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--color-text-2);
	font-family: "Circular Spotify", "Inter", sans-serif;
}

.ah-install-callout strong {
	display: block;
	font-size: 15px;
	color: var(--color-text-1);
	margin-bottom: 4px;
	font-family: "Circular Spotify", "Inter", sans-serif;
}

.ah-install-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: 24px;
	background: linear-gradient(
		135deg,
		var(--color-selected-1) 0%,
		var(--color-selected-2) 100%
	);
	color: var(--color-text-1);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	font-family: "Circular Spotify", "Inter", sans-serif;
	text-decoration: none;
	white-space: nowrap;
	transition: all 0.3s ease;
	flex-shrink: 0;
}

.ah-install-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.ah-install-meta {
	display: flex;
	gap: 16px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.ah-install-stat {
	font-size: 12px;
	color: var(--color-primary-a30);
	font-family: "Circular Spotify", "Inter", sans-serif;
	font-weight: 600;
}

.ah-screenshots-grid {
	column-width: 320px;
	column-gap: 16px;
	margin-bottom: 24px;
}

.ah-screenshots-grid > * {
	break-inside: avoid;
	margin-bottom: 16px;
}

.ah-screenshots-grid img {
	width: 100%;
	border-radius: 16px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
	display: block;
}

#code-screenshots {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

#code-screenshots .screenshot-item {
    flex: 1 1 300px; /* controls wrapping */
    max-width: 100%;
}

#code-screenshots img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    display: block;
}

.ah-screenshot-caption {
	font-size: 12px;
	text-align: center;
	color: var(--color-text-2);
	opacity: 0.6;
	margin-top: 12px;
	font-family: "Circular Spotify", "Inter", sans-serif;
}

.ce-rating-section {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 0;
}

.rating {
	display: flex;
	align-items: center;
	gap: 4px;
}

.stars {
	display: flex;
	gap: 1px;
}

.star {
	color: #ffd700;
	font-size: 14px;
}

.download-count, .rating-text {
	font-family: "Circular Spotify", "Inter", sans-serif;
}

@media (max-width: 640px) {
	.screenshot-item {
		margin-bottom: 0;
	}

	.ah-screenshot-caption {
		margin-bottom: 0;
	}
}