@layer child {
	/* Gallery intro: left-aligned like every other page hero, with room below
	   the copy before the filter pills. */
	.kk-gallery__intro {
		padding-block: clamp(3rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem);
		text-align: left;
	}

	/* Space below the grid so the last row is not jammed against the CTA band. */
	.kk-gallery__body {
		padding-block-end: clamp(3rem, 6vw, 5rem);
	}

	/* Cards: uniform thumbnails, subtle lift on hover */
	.toc-project-grid__thumb {
		border-radius: 6px;
		background: var(--color-base-2);
	}
	.toc-project-grid__thumb-img {
		aspect-ratio: 4 / 3;
		object-fit: cover;
		width: 100%;
		height: auto;
		transition: transform 0.3s ease;
	}
	.toc-project-grid__item:hover .toc-project-grid__thumb-img {
		transform: scale(1.03);
	}
	.toc-project-grid__title-link {
		color: var(--color-text);
		text-decoration: none;
		font-family: var(--font-display);
	}
	.toc-project-grid__title-link:hover {
		color: var(--color-brand-secondary);
	}
	.toc-project-grid__description {
		color: var(--color-text);
		opacity: 0.8;
	}

	/* Filter chips: left-aligned to match the hero and grid. */
	.toc-project-filter {
		justify-content: flex-start;
		margin-block-end: var(--space-xl, 2rem);
	}
	/* Chip look is unlayered below (must beat portfolio.css unlayered defaults). */

	/* Single project */
	.kk-single-project {
		padding-block: var(--space-2xl, 2rem);
	}
	.kk-single-project .wp-block-post-featured-image img {
		border-radius: 8px;
		width: 100%;
		height: auto;
	}
	.toc-project-gallery__img {
		border-radius: 6px;
		aspect-ratio: 4 / 3;
		object-fit: cover;
	}
	.kk-back-link {
		margin-block-start: var(--space-xl, 2rem);
	}

	/* Lightbox skin (parent ships it unstyled) */
	.toc-lightbox {
		background: color-mix(in srgb, var(--color-text) 92%, black);
	}
	.toc-lightbox__close,
	.toc-lightbox__prev,
	.toc-lightbox__next {
		color: var(--color-text-light);
		font-size: 2rem;
	}

	/* CTA band */
	.kk-cta {
		padding-block: var(--space-3xl, 3rem);
	}
}

/* ---------------------------------------------------------------------------
   Filter chip skin. UNLAYERED on purpose.
   The parent portfolio.css sets `.toc-project-filter__chip { background:
   transparent; border: 1px solid currentColor }` outside any cascade layer,
   and unlayered rules beat @layer child per property. So the chip brand look
   must also be unlayered to win, the same pattern the parent uses for nav.css.
   --------------------------------------------------------------------------- */
.toc-project-filter__chip {
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	border-color: color-mix(in srgb, var(--color-text) 25%, transparent);
	color: var(--color-text);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.toc-project-filter__chip:hover {
	border-color: var(--color-brand-secondary);
}
.toc-project-filter__chip.is-active {
	background: var(--color-brand-primary);
	border-color: var(--color-brand-primary);
	color: var(--color-text-light);
}

/* Dashed cut-line below the projects hero, spanning the content column so it
   lines up with the heading and pills. The descendant selector (0,3,0) beats
   WP core's `.wp-block-separator:not(.is-style-wide):not(.is-style-dots)`
   short-and-centered default by source order. */
.kk-gallery__intro .wp-block-separator.kk-cut {
	border: 0;
	border-top: 1.5px dashed color-mix(in srgb, var(--color-text) 28%, transparent);
	background: none;
	width: 100%;
	max-width: var(--wp--style--global--content-size, 1200px);
	margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
	opacity: 1;
}

/* =============================================================
   PROJECT CARD HOVER: image zoom + a "View project" cue.
   ============================================================= */
.toc-project-grid__thumb {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
}
.toc-project-grid__thumb-img {
	transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.toc-project-grid__item:hover .toc-project-grid__thumb-img,
.toc-project-grid__thumb-link:focus-visible .toc-project-grid__thumb-img {
	transform: scale(1.05);
}
.toc-project-grid__thumb::after {
	content: "View project";
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding: 1.4rem 1rem 0.9rem;
	font-family: var(--font-subhead);
	font-weight: 600;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	color: var(--color-text-light);
	background: linear-gradient(transparent, color-mix(in srgb, var(--color-brand-primary) 88%, transparent));
	transform: translateY(101%);
	opacity: 0;
	transition: transform 0.35s ease, opacity 0.35s ease;
	pointer-events: none;
}
.toc-project-grid__item:hover .toc-project-grid__thumb::after {
	transform: translateY(0);
	opacity: 1;
}

/* =============================================================
   SLIDE-OUT PROJECT PANEL.
   ============================================================= */
.kk-noscroll { overflow: hidden; }

.kk-slideout {
	position: fixed;
	inset: 0;
	z-index: 1000;
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0s linear 0.5s;
}
.kk-slideout.is-open {
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0s;
}
.kk-slideout__overlay {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--color-brand-primary) 62%, transparent);
	opacity: 0;
	transition: opacity 0.4s ease;
}
.kk-slideout.is-open .kk-slideout__overlay { opacity: 1; }

.kk-slideout__panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(600px, 94vw);
	background: var(--color-bg);
	overflow-y: auto;
	padding: clamp(1.5rem, 4vw, 3rem);
	box-shadow: -16px 0 48px rgba(38, 15, 1, 0.28);
	transform: translateX(100%);
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.kk-slideout.is-open .kk-slideout__panel { transform: translateX(0); }

.kk-slideout__close {
	position: sticky;
	top: 0;
	float: right;
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	background: var(--color-brand-primary);
	color: var(--color-text-light);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1rem;
	transition: background-color 0.2s ease, transform 0.3s ease;
}
.kk-slideout__close:hover {
	background: var(--color-brand-accent);
	transform: rotate(90deg);
}
.kk-slideout__body { clear: both; }
.kk-slideout__title {
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 3.2vw, 2.3rem);
	letter-spacing: -0.01em;
	line-height: 1.08;
	margin: 0.5rem 0 0.85rem;
	padding-bottom: 0.85rem;
	border-bottom: 1.5px dashed color-mix(in srgb, var(--color-text) 26%, transparent);
}
.kk-slideout__desc {
	color: color-mix(in srgb, var(--color-text) 88%, transparent);
	margin-bottom: 1.75rem;
}
.kk-slideout__desc p { margin: 0 0 0.75rem; }
.kk-slideout__gallery {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.9rem;
}
.kk-slideout__imgbtn {
	display: block;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	cursor: pointer;
	border-radius: 6px;
	overflow: hidden;
}
.kk-slideout__imgbtn img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
	transition: transform 0.4s ease;
}
.kk-slideout__imgbtn:hover img,
.kk-slideout__imgbtn:focus-visible img { transform: scale(1.04); }
.kk-slideout__loading {
	/* 65% (not 55%) keeps this transient text at ~5:1 on the panel bg — WCAG AA. */
	color: color-mix(in srgb, var(--color-text) 65%, transparent);
	font-family: var(--font-mono);
}

/* Lightbox above the slide-out. */
.kk-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: none;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--color-brand-primary) 92%, black);
}
.kk-lightbox.is-open { display: flex; }
.kk-lightbox__img {
	max-width: 90vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.kk-lightbox__close,
.kk-lightbox__prev,
.kk-lightbox__next {
	position: absolute;
	background: transparent;
	border: 0;
	color: var(--color-text-light);
	cursor: pointer;
	padding: 0.75rem;
	line-height: 1;
	transition: color 0.2s ease, transform 0.2s ease;
}
.kk-lightbox__close { top: 1.25rem; right: 1.5rem; font-size: 1.9rem; }
.kk-lightbox__prev { left: 1.25rem; top: 50%; transform: translateY(-50%); font-size: 3rem; }
.kk-lightbox__next { right: 1.25rem; top: 50%; transform: translateY(-50%); font-size: 3rem; }
.kk-lightbox__close:hover { color: var(--color-brand-accent); transform: rotate(90deg); }
.kk-lightbox__prev:hover { color: var(--color-brand-accent); transform: translateY(-50%) scale(1.15); }
.kk-lightbox__next:hover { color: var(--color-brand-accent); transform: translateY(-50%) scale(1.15); }
@media (max-width: 600px) {
	.kk-slideout__panel { width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
	.toc-project-grid__thumb-img,
	.kk-slideout__panel,
	.kk-slideout__overlay { transition: none; }
	.toc-project-grid__item:hover .toc-project-grid__thumb-img { transform: none; }
}
