/*
Theme Name: Kemie Portfolio v2
Theme URI: https://kemielikes.design
Description: Minimal block theme for kemielikes.design. Design tokens live in theme.json; this file holds only what theme.json cannot express.
Author: Kemie Guaida
Version: 2.0.0
Requires at least: 6.7
Requires PHP: 7.4
Text Domain: kemie-portfolio
*/

/* Navigation: the underline sits on the label text only, so top-level items and
   submenu items share the same text-to-underline distance. Red on hover/focus,
   black for the selected page. */
.site-header .wp-block-navigation-item__content {
	text-decoration: none;
	text-transform: lowercase;
}

.site-header .wp-block-navigation-item__label {
	position: relative;
	display: inline-block;
}

.site-header .wp-block-navigation-item__label::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: -0.2em;
	height: 2px;
	background: var(--wp--preset--color--accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 180ms ease-out;
}

.site-header .wp-block-navigation-item__content:hover .wp-block-navigation-item__label::after,
.site-header .wp-block-navigation-item__content:focus-visible .wp-block-navigation-item__label::after,
.site-header .current-menu-item > .wp-block-navigation-item__content .wp-block-navigation-item__label::after,
.site-header .current-menu-ancestor > .wp-block-navigation-item__content .wp-block-navigation-item__label::after,
.site-header .wp-block-navigation-item__content[aria-current="page"] .wp-block-navigation-item__label::after {
	transform: scaleX(1);
}

.site-header .current-menu-item > .wp-block-navigation-item__content .wp-block-navigation-item__label::after,
.site-header .current-menu-ancestor > .wp-block-navigation-item__content .wp-block-navigation-item__label::after,
.site-header .wp-block-navigation-item__content[aria-current="page"] .wp-block-navigation-item__label::after {
	background: var(--wp--preset--color--ink);
}

.site-header .wp-block-navigation-item__content:hover .wp-block-navigation-item__label::after,
.site-header .wp-block-navigation-item__content:focus-visible .wp-block-navigation-item__label::after {
	background: var(--wp--preset--color--accent);
}

/* Buttons: hard shadow nudges on hover. */
.wp-block-button__link {
	transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}

.wp-block-button__link:hover {
	transform: translate(2px, 2px);
	box-shadow: 2px 2px 0 var(--wp--preset--color--ink);
}

/* Accent word inside a heading: <mark class="has-accent-color"> keeps semantics. */
mark.has-accent-color {
	background: none;
}

@media (prefers-reduced-motion: reduce) {
	.site-header .wp-block-navigation-item__label::after,
	.wp-block-button__link {
		transition: none;
	}
}

a:hover {
	text-decoration-thickness: 0.12em;
}

.wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent-dark);
}

.site-header .wp-block-navigation {
	gap: 2rem;
}

.footer-links a {
	color: inherit;
	text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
	color: var(--wp--preset--color--ink);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
}

/* Keep the footer at the bottom on short pages. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.wp-site-blocks > main {
	flex: 1;
}

.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	white-space: nowrap;
}

/* Work dropdown (desktop): roomier padding and a quick fade-and-rise when it opens. */
.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container {
	padding: 0.75rem 0.75rem;
	transform: translateY(-6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.5rem 1.25rem;
}

.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child:hover > .wp-block-navigation__submenu-container,
.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .has-child:focus-within > .wp-block-navigation__submenu-container,
.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container.is-open {
	transform: none;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
	.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container {
		transform: none;
		transition: none;
	}
}

/* Project details: rows with hairlines; a small uppercase label above each value, tight line height. */
.project-details__row {
	display: block;
	padding-block: 0.75rem;
	border-top: 1px solid rgb(23 23 23 / 0.2);
}

.project-details__row:last-child {
	border-bottom: 1px solid rgb(23 23 23 / 0.2);
}

.project-details .project-details__row > * {
	margin: 0;
	line-height: 1.35;
}

.project-details .project-details__row > * + * {
	margin-top: 0.2rem;
}

.project-details__label {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #6a6666;
}

/* Intro details block: a small title, and a narrower label column. */
.project-details__title {
	margin: 0 0 0.5rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Side by side with the headline, the title sits on the headline's first baseline (0.96 x heading size, less the
   title's own 17px baseline offset). Stacked, no offset. */
@media (min-width: 1000px) {
	.stack-tablet .project-details__title {
		margin-top: calc(var(--wp--preset--font-size--heading-1) * 0.96 - 17px);
	}
}

.wp-block-list.is-style-no-disc {
	padding: 0;
	list-style: none;
}

/* Home hero illustration: inline SVG scales with its column; marks may drift outside the box. */
.hero-illustration svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

/* Columns that need more room than core's 782px stacking point allows. */
@media (min-width: 782px) and (max-width: 999px) {
	.wp-block-columns.stack-tablet {
		flex-wrap: wrap !important;
	}

	.wp-block-columns.stack-tablet > .wp-block-column {
		flex-basis: 100% !important;
	}
}

/* Stacked layouts: images and illustrations inside columns are capped and centred, so they
   never balloon to full tablet width. Core stacks columns below 782px; .stack-tablet below 1000px. */
:root {
	--stacked-media-max: 30rem;
}

@media (max-width: 781px) {
	.wp-block-column > .wp-block-image,
	.wp-block-column > .hero-illustration {
		max-width: var(--stacked-media-max);
		margin-inline: auto;
	}
}

@media (min-width: 782px) and (max-width: 999px) {
	.stack-tablet > .wp-block-column > .wp-block-image,
	.stack-tablet > .wp-block-column > .hero-illustration,
	.stack-tablet > .wp-block-column > .wp-block-html {
		max-width: var(--stacked-media-max);
		margin-inline: auto;
	}
}


/* Project grid and card: 3 columns, 2 on tablet, 1 on phone. */
.project-grid .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 3rem 2.25rem;
	margin: 0;
	padding: 0;
}

@media (max-width: 999px) {
	.project-grid .wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.project-grid .wp-block-post-template {
		grid-template-columns: 1fr;
	}
}

.project-grid .wp-block-post-template > li {
	margin: 0;
}

.project-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.project-card > * {
	margin: 0;
}

.project-card .wp-block-post-featured-image {
	margin-block-end: 0.5rem;
	overflow: hidden;
	border-radius: 12px;
}

.project-card .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Title row: title left, arrow right. The title link stretches over the whole card. */
.project-card .wp-block-post-title {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--wp--preset--spacing--30);
}

.project-card .wp-block-post-title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.project-card .wp-block-post-title a::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: 12px;
}

.project-card .wp-block-post-title a:focus-visible {
	outline: none;
}

.project-card .wp-block-post-title a:focus-visible::before {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 4px;
}

.project-card .wp-block-post-title::after {
	content: "→" / "";
	flex-shrink: 0;
	color: var(--wp--preset--color--accent);
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.project-card .wp-block-post-terms a {
	position: relative;
	z-index: 2;
	color: inherit;
	text-decoration: none;
}

.project-card .wp-block-post-terms a:hover {
	text-decoration: underline;
}

.project-card:hover .wp-block-post-featured-image img {
	transform: scale(1.06);
}

.project-card:hover .wp-block-post-title::after,
.project-card:focus-within .wp-block-post-title::after {
	opacity: 1;
	transform: none;
}

/* Touch screens have no hover, so keep the arrow visible. */
@media (hover: none) {
	.project-card .wp-block-post-title::after {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.project-card .wp-block-post-featured-image img,
	.project-card .wp-block-post-title::after {
		transition: none;
	}

	.project-card:hover .wp-block-post-featured-image img {
		transform: none;
	}
}

.project-card .wp-block-post-featured-image.is-placeholder {
	background: var(--wp--preset--color--mist);
}

/* CTA: big illustration column keeps its natural size; minimal contact line sits over a faint watermark. */
.cta-illustration img {
	width: 100%;
	height: auto;
	border-radius: 0;
}

.cta-touch {
	position: relative;
	isolation: isolate;
	display: grid;
	place-items: center;
	min-height: clamp(4.5rem, 12vw, 7rem);
}

.cta-touch::before {
	content: "GET IN TOUCH" / "";
	position: absolute;
	inset: 0;
	z-index: -1;
	display: grid;
	place-items: center;
	color: var(--wp--preset--color--mist);
	font-size: clamp(1.5rem, 9vw, 6.1rem);
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.cta-touch > p {
	margin: 0;
}

.cta-touch a {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

.cta-touch a:hover,
.cta-touch a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 0.06em;
	text-underline-offset: 0.15em;
}

/* Vertical rhythm.
   - Sections own equal space above and below (spacing 6); adjacent margins collapse, so no doubling.
   - First/last section on a page add none: the template already pads <main>.
   - A heading sits close to the text it introduces; buttons get more air above them. */
.wp-block-post-content > :first-child {
	margin-top: 0 !important;
}

.wp-block-post-content > :last-child {
	margin-bottom: 0 !important;
}

/* 2-3rem above buttons */
:is(.is-layout-flow, .is-layout-constrained) > * + .wp-block-buttons {
	margin-block-start: clamp(2rem, 1rem + 2vw, 3rem);
}

/* Headings: a larger gap above than below (proximity), in em so it scales with the heading.
   Tune the two variables to change every heading on the site. */
:root {
	--heading-space-above: 1.2em;
	--heading-space-below: 0.6em;
}

:is(.is-layout-flow, .is-layout-constrained) > :is(h1, h2, h3, h4, h5, h6) {
	margin-block-start: var(--heading-space-above);
	margin-block-end: var(--heading-space-below);
}

:is(.is-layout-flow, .is-layout-constrained) > :is(h1, h2, h3, h4, h5, h6):first-child {
	margin-block-start: 0;
}

:is(.is-layout-flow, .is-layout-constrained) > :is(h1, h2, h3, h4, h5, h6) + * {
	margin-block-start: 0;
}

/* Narrower, centred section on desktop: a fixed measure of 80% of the MAX content width (1024px),
   not 75% of whatever width the viewport leaves; it only shrinks when the screen cannot fit it. Works at the top level of a page and
   inside a wrapping group (where the editor omits the alignwide class); the second selector is specific enough
   to beat WordPress's own wide-block rule in the editor. */
@media (min-width: 1000px) {
	.section-narrow:is(.wp-block-columns, .wp-block-group, .wp-block-query, .wp-block-image),
	:is(.is-layout-constrained, .is-root-container) > .alignwide.section-narrow:is(.wp-block-columns, .wp-block-group, .wp-block-query, .wp-block-image) {
		max-width: min(100%, calc(var(--wp--style--global--wide-size) * 0.8));
		margin-inline: auto;
	}
}


/* Cards keep their own tight internal spacing (overrides the heading rhythm above). */
.project-card > .wp-block-post-title {
	margin-block: 0;
}

.project-card .wp-block-post-title + * {
	margin-block-start: 0;
}

/* Paragraph rhythm: consecutive text blocks sit closer than other blocks (half the block gap). */
:is(.is-layout-flow, .is-layout-constrained) > :is(p, ul, ol) + :is(p, ul, ol) {
	margin-block-start: calc(var(--wp--style--block-gap) / 2);
}

/* Even out heading line breaks (avoids a single orphaned word on the last line). */
h1,
h2,
h3 {
	text-wrap: balance;
}

/* Compact project grid (related projects): two small thumbnails side by side at every width. */
.project-grid--compact .wp-block-post-template {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem;
}

.project-grid--compact .project-card .wp-block-post-title {
	font-size: var(--wp--preset--font-size--body);
}

/* A full-width image gives the text that follows it more room (section spacing). */
.wp-block-image.alignwide + * {
	margin-block-start: var(--wp--preset--spacing--60);
}

/* Gallery styles. Masonry flows images into columns by height (columns follow the gallery's Columns setting);
   Slider turns the gallery into a scrolling carousel with arrows (assets/gallery-slider.js). */
.wp-block-gallery.is-style-masonry {
	display: block;
	column-count: 2;
	column-gap: 1.5rem;
}

.wp-block-gallery.is-style-masonry.columns-1 { column-count: 1; }
.wp-block-gallery.is-style-masonry.columns-3 { column-count: 3; }
.wp-block-gallery.is-style-masonry.columns-4 { column-count: 4; }
.wp-block-gallery.is-style-masonry.columns-5 { column-count: 5; }
.wp-block-gallery.is-style-masonry.columns-6 { column-count: 6; }

/* inline-block (not display:block + break-inside) keeps images from vanishing inside CSS columns. The
   :not(#individual-image) and [class] lift this above core's own gallery rules (margins, per-column widths), which load later. */
.wp-block-gallery.has-nested-images.is-style-masonry[class] > figure.wp-block-image:not(#individual-image) {
	display: inline-block;
	width: 100%;
	margin: 0 0 1.5rem;
	vertical-align: top;
}

@media (max-width: 999px) {
	.wp-block-gallery.is-style-masonry:is(.columns-3, .columns-4, .columns-5, .columns-6) { column-count: 3; }
}

@media (max-width: 599px) {
	.wp-block-gallery.is-style-masonry { column-count: 1; }
	.wp-block-gallery.is-style-masonry:is(.columns-3, .columns-4, .columns-5, .columns-6) { column-count: 2; }
}

.wp-block-gallery.is-style-slider {
	display: flex;
	flex-wrap: nowrap;
	gap: 1.5rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
}

.wp-block-gallery.is-style-slider::-webkit-scrollbar {
	display: none;
}

.wp-block-gallery.has-nested-images.is-style-slider[class] > figure.wp-block-image:not(#individual-image) {
	flex: 0 0 100%;
	width: 100%;
	margin: 0;
	scroll-snap-align: start;
}

.gallery-slider {
	position: relative;
}

.gallery-slider__nav {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-block-start: 0.75rem;
}

.gallery-slider__nav button {
	width: 2.75rem;
	height: 2.75rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 4px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.gallery-slider__nav button:hover,
.gallery-slider__nav button:focus-visible {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--paper);
}

.gallery-slider__nav button:disabled {
	opacity: 0.35;
	cursor: default;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.is-style-slider {
		scroll-behavior: auto;
	}
}

/* Breadcrumbs: Work / Format / Category. Quiet text; slashes drawn by CSS so they are not read aloud. */
.breadcrumbs {
	gap: 0 0.5rem;
	margin-block-start: 0;
}

.breadcrumbs > * {
	margin: 0;
}

.breadcrumbs > * + *::before {
	content: "/" / "";
	margin-inline-end: 0.5rem;
	opacity: 0.5;
}

.breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
	color: var(--wp--preset--color--ink);
	text-decoration: underline;
}

/* When the project opens with a wide hero image, the breadcrumb lines up with the image's edge instead. */
@media (min-width: 1000px) {
	main:has(> .wp-block-post-content > .wp-block-image.alignwide:first-child) .breadcrumbs.section-narrow {
		max-width: var(--wp--style--global--wide-size);
		margin-inline: auto;
	}
}

/* Landing page: cases as stacked horizontal cards with generous air between them. */

.case-card .wp-block-columns {
	margin: 0;
}

.case-card .wp-block-post-title {
	margin-block: 0.25rem 0.75rem;
}

.case-card .wp-block-post-excerpt {
	margin: 0;
}

.case-card__label {
	margin: 0;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.case-card .wp-block-column > * + * {
	margin-block-start: 0;
}

/* Differentiators: icon, title and text; spacing between items comes from the grid layout. */
.differentiator > * {
	margin: 0;
}

.differentiator > * + * {
	margin-block-start: 0.75rem;
}

.differentiator h3 {
	font-weight: 700;
}

/* Work filter chips: outlined pills; the active one is filled. */
.work-filter__chips {
	margin-bottom: var(--wp--preset--spacing--40);
}

/* The Work grid is dense: rows sit as close as the columns do. */
.work-filter .project-grid .wp-block-post-template {
	row-gap: 2.25rem;
}

/* Filter links (Work, Case studies): quiet text like the top navigation, 2px smaller, with the same underline: red
   on hover and focus, black for the active one. */
.work-filter__chips {
	gap: 0.5rem 1.5rem;
}

.work-filter .filter-chip .wp-block-button__link {
	position: relative;
	display: inline-block;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--wp--preset--color--ink);
	font-size: calc(1rem - 2px);
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.5;
	text-decoration: none;
	text-transform: lowercase;
}

.work-filter .filter-chip .wp-block-button__link::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: -0.2em;
	height: 2px;
	background: var(--wp--preset--color--accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 180ms ease-out;
}

.work-filter .filter-chip .wp-block-button__link:hover,
.work-filter .filter-chip .wp-block-button__link:focus-visible,
.work-filter .filter-chip .wp-block-button__link.is-active {
	background: transparent;
	color: var(--wp--preset--color--ink);
	transform: none;
	box-shadow: none;
}

.work-filter .filter-chip .wp-block-button__link:hover::after,
.work-filter .filter-chip .wp-block-button__link:focus-visible::after,
.work-filter .filter-chip .wp-block-button__link.is-active::after {
	transform: scaleX(1);
}

.work-filter .filter-chip .wp-block-button__link.is-active::after {
	background: var(--wp--preset--color--ink);
}

@media (prefers-reduced-motion: reduce) {
	.work-filter .filter-chip .wp-block-button__link::after {
		transition: none;
	}
}

.project-grid .wp-block-post-template > li[hidden] {
	display: none;
}

/* Button style "Arrow link": a quiet text link for "see all" and "see more" actions. Buttons stay for CTAs. */
.wp-block-button.is-style-arrow-link .wp-block-button__link {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--wp--preset--color--accent-dark);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	transition: none;
}

.wp-block-button.is-style-arrow-link .wp-block-button__link::after {
	content: "→" / "";
	display: inline-block;
	margin-inline-start: 0.4em;
	transition: transform 180ms ease-out;
}

.wp-block-button.is-style-arrow-link .wp-block-button__link:hover,
.wp-block-button.is-style-arrow-link .wp-block-button__link:focus-visible {
	background: none;
	box-shadow: none;
	color: var(--wp--preset--color--ink);
	transform: none;
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.wp-block-button.is-style-arrow-link .wp-block-button__link:hover::after,
.wp-block-button.is-style-arrow-link .wp-block-button__link:focus-visible::after {
	transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-button.is-style-arrow-link .wp-block-button__link::after {
		transition: none;
	}
}

/* Landing page: case cards in two columns; an odd last card sits on the left, like everything else. */
.project-grid--cases .wp-block-post-template {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: var(--wp--preset--spacing--60) 2.25rem;
}

.project-grid--cases .wp-block-post-template > li {
	width: calc(50% - 1.125rem);
}

@media (max-width: 781px) {
	.project-grid--cases .wp-block-post-template > li {
		width: 100%;
	}
}

/* Timeline: a thin vertical line with a dot per entry. Pure CSS; entries are ordinary blocks. */
.timeline {
	position: relative;
	margin-inline-start: 0.4rem;
	padding-inline-start: 1.5rem;
	border-inline-start: 2px solid rgb(23 23 23 / 0.2);
}

.timeline__item {
	position: relative;
	padding-block-end: 1.75rem;
}

.timeline__item:last-child {
	padding-block-end: 0;
}

.timeline__item::before {
	content: "";
	position: absolute;
	inset-inline-start: calc(-1.5rem - 7px);
	inset-block-start: 0.3rem;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 4px var(--wp--preset--color--paper);
}

.timeline__item > * {
	margin: 0;
}

.timeline__item > * + * {
	margin-block-start: 0.25rem;
}

.timeline__date {
	font-weight: 600;
}

.timeline__item h4 {
	font-weight: 700;
}

.timeline__meta {
	color: var(--wp--preset--color--grey);
}

/* Contact form */
.contact-form__field {
	margin-block-end: 1.25rem;
}

.contact-form label {
	display: block;
	margin-block-end: 0.35rem;
	font-weight: 600;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 0.75rem 1rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 4px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font: inherit;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
	outline-offset: 2px;
}

.contact-form [aria-invalid="true"] {
	border-color: var(--wp--preset--color--accent-dark);
}

.contact-form__error {
	margin: 0.4rem 0 0;
	color: var(--wp--preset--color--accent-dark);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.contact-form__success {
	padding: 1.25rem 1.5rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 4px;
	background: var(--wp--preset--color--mist);
	font-weight: 600;
}

.contact-form__note {
	margin-block-start: 1rem;
	color: var(--wp--preset--color--grey);
	font-size: var(--wp--preset--font-size--small);
}

/* Honeypot: out of sight and out of the tab order; humans never see it. */
.contact-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.contact-form button.wp-block-button__link {
	cursor: pointer;
	border-width: 2px;
}

/* Rotating headline: the coral phrase sits on its own line. Without the script, the static first phrase shows. */
.rotating-headline__phrase {
	position: relative;
	display: block;
	color: var(--wp--preset--color--accent);
}

.rotating-headline__live {
	display: block;
	transition: opacity 380ms ease, transform 380ms ease;
}

.rotating-headline__live.is-leaving {
	opacity: 0;
	transform: translateY(-0.35em);
}

.rotating-headline__live.is-entering {
	opacity: 0;
	transform: translateY(0.35em);
	transition: none;
}

/* Once the script is running, the animated copy is what you see and the static copy stays for assistive tech. */
.rotating-headline__phrase.is-live .rotating-headline__static {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.rotating-headline__probe {
	position: absolute;
	visibility: hidden;
	width: 100%;
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.rotating-headline__live {
		transition: none;
	}
}

/* Before / after: without the script the two images just stack with their captions. With it, the "after" image
   sits over the "before" and is revealed by a draggable divider (assets/before-after.js). */
.wp-block-group.is-style-before-after.is-slider {
	position: relative;
	container-type: inline-size;
	overflow: hidden;
	border-radius: 12px;
	cursor: ew-resize;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	--pos: 50%;
}

.is-style-before-after.is-slider > figure.wp-block-image {
	margin: 0;
}

.is-style-before-after.is-slider > figure.wp-block-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
	pointer-events: none;
}

.is-style-before-after.is-slider > figure.wp-block-image:nth-of-type(2) {
	position: absolute;
	inset: 0;
	clip-path: inset(0 0 0 var(--pos));
}

.is-style-before-after.is-slider > figure.wp-block-image:nth-of-type(2) img {
	height: 100%;
	object-fit: cover;
}

/* Captions become small corner labels. */
.is-style-before-after.is-slider figcaption {
	position: absolute;
	top: 0.75rem;
	margin: 0;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	line-height: 1.3;
	pointer-events: none;
}

.is-style-before-after.is-slider > figure:nth-of-type(1) figcaption {
	left: 0.75rem;
}

.is-style-before-after.is-slider > figure:nth-of-type(2) figcaption {
	right: 0.75rem;
	left: auto;
}

.ba-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--pos);
	width: 0;
	pointer-events: none;
}

.ba-handle::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -1px;
	width: 2px;
	background: var(--wp--preset--color--ink);
	box-shadow: 0 0 0 1px rgb(255 255 255 / 0.85);
}

.ba-grip {
	position: absolute;
	top: 50%;
	left: 0;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: -1.375rem 0 0 -1.375rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 50%;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	transition: background 120ms ease-out, color 120ms ease-out;
}

.is-style-before-after.is-dragging .ba-grip,
.ba-range:focus-visible ~ .ba-handle .ba-grip {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}

.ba-range:focus-visible ~ .ba-handle .ba-grip {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}

/* The real control for keyboards and screen readers: present, focusable, but not visible. */
.ba-range {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

/* In narrow columns (such as three in a row), a smaller grip and labels. */
@container (max-width: 380px) {
	.ba-grip {
		width: 2.25rem;
		height: 2.25rem;
		margin: -1.125rem 0 0 -1.125rem;
	}

	.ba-grip svg {
		width: 16px;
		height: 16px;
	}

	.is-style-before-after.is-slider figcaption {
		top: 0.5rem;
		padding: 0.1rem 0.45rem;
		font-size: 0.75rem;
	}

	.is-style-before-after.is-slider > figure:nth-of-type(1) figcaption {
		left: 0.5rem;
	}

	.is-style-before-after.is-slider > figure:nth-of-type(2) figcaption {
		right: 0.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ba-grip {
		transition: none;
	}
}

/* Focus: one strong, consistent ring for keyboard users on every control (ink, 3px, offset), replacing the
   browser's thin default. :where() keeps it overridable. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}

/* Mobile menu: roomy, easy to hit targets (WCAG 2.2 asks for at least 24px; this gives about 44px). */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	padding-block: 0.6rem;
	font-size: 1.25rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-icon {
	min-width: 2.75rem;
	min-height: 2.75rem;
}

/* Pause-motion toggle in the footer: reads as one of the footer links. */
.motion-toggle {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.motion-toggle:hover {
	color: var(--wp--preset--color--ink);
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
}

.motion-toggle[aria-pressed="true"]::after {
	content: " (paused)";
}

/* An email address is one unbreakable word: let it wrap rather than push the page sideways at 320px or when a
   visitor widens letter spacing. */
.cta-touch a {
	overflow-wrap: anywhere;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 2.75rem;
	min-height: 2.75rem;
}

/* Image stacks: images are centred and, if the source is small, never shown narrower than 700px (on narrow
   screens they simply fill the width). Tall full-page screenshots sit centred at the measure width. */
.image-stack .wp-block-image {
	margin-inline: auto;
}

.image-stack .wp-block-image img {
	display: block;
	width: auto;
	min-width: min(700px, 100%);
	max-width: 100%;
	height: auto;
	margin-inline: auto;
}

/* Previous / next project: quiet, centred, with air above (padding, so it adds to the band's margin instead of
   collapsing into it). */
.project-pagination {
	gap: 3rem;
	padding-block-start: var(--wp--preset--spacing--50);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 300;
}

.project-pagination a {
	color: var(--wp--preset--color--grey);
	text-decoration: none;
}

.project-pagination a:hover,
.project-pagination a:focus-visible {
	color: var(--wp--preset--color--ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

.project-pagination [class*="__arrow"] {
	display: inline-block;
	opacity: 0.6;
	transition: transform 160ms ease-out;
}

.project-pagination .post-navigation-link-previous a:hover [class*="__arrow"] {
	transform: translateX(-3px);
}

.project-pagination .post-navigation-link-next a:hover [class*="__arrow"] {
	transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
	.project-pagination [class*="__arrow"] {
		transition: none;
	}
}

/* Step flow: a row of numbered-by-order steps, each a circle icon over a link, with an arrow to the next one.
   The whole step is clickable (stretched link); arrows are hidden when the steps wrap into two columns. */
.step-flow {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--wp--preset--spacing--40);
}

.step-flow > * {
	margin-block: 0;
}

.step-flow__step {
	position: relative;
	text-align: center;
}

.step-flow__step > * {
	margin-block: 0;
}

.step-flow__step > * + * {
	margin-top: var(--wp--preset--spacing--30);
}

.step-flow__step .wp-block-image {
	box-sizing: border-box;
	width: 5rem;
	height: 5rem;
	margin-inline: auto;
	padding: 0.4rem;
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 50%;
	background: var(--wp--preset--color--accent-dark);
	box-shadow: var(--wp--preset--shadow--hard);
}

.step-flow__step .wp-block-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 0;
}

.step-flow__title {
	font-size: var(--wp--preset--font-size--lead);
	font-weight: 700;
}

.step-flow__title a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.step-flow__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.step-flow__title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

.step-flow__title a:focus-visible {
	outline: none;
}

.step-flow__title a:focus-visible::after {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
	border-radius: 12px;
}

.step-flow__step:not(:last-child)::after {
	content: "→" / "";
	position: absolute;
	top: 1.6rem;
	right: calc(var(--wp--preset--spacing--40) / -2);
	transform: translateX(50%);
	font-size: 1.75rem;
	line-height: 1;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

/* Five steps (e.g. a research process) */
.step-flow:has(> :nth-child(5)) {
	grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 699px) {
	.step-flow:has(> :nth-child(5)),
	.step-flow {
		grid-template-columns: repeat(2, 1fr);
		row-gap: var(--wp--preset--spacing--50);
	}

	.step-flow__step::after {
		display: none;
	}
}

/* Case cards: the contribution sentence is hidden when a project has none. */
.case-card__contribution:empty {
	display: none;
}

/* Cookie banner (Complianz): restyled to match the site: outlined box with the hard shadow, the same buttons.
   The plugin's own colours are overridden here so the look lives in the theme. */
.cmplz-cookiebanner.cmplz-cookiebanner {
	box-sizing: border-box;
	max-width: min(30rem, calc(100vw - 2rem));
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 4px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	box-shadow: 4px 4px 0 var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.cmplz-cookiebanner .cmplz-title,
.cmplz-cookiebanner .cmplz-category-title {
	font-weight: 700;
	font-size: 1.0625rem;
}

.cmplz-cookiebanner a {
	color: var(--wp--preset--color--accent-dark);
}

.cmplz-cookiebanner .cmplz-btn {
	border: 2px solid var(--wp--preset--color--ink) !important;
	border-radius: 4px !important;
	background: var(--wp--preset--color--paper) !important;
	color: var(--wp--preset--color--ink) !important;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.cmplz-cookiebanner .cmplz-btn.cmplz-accept {
	background: var(--wp--preset--color--accent-dark) !important;
	color: var(--wp--preset--color--paper) !important;
	box-shadow: var(--wp--preset--shadow--hard);
}

.cmplz-cookiebanner .cmplz-btn:hover {
	background: var(--wp--preset--color--mist) !important;
}

.cmplz-cookiebanner .cmplz-btn.cmplz-accept:hover {
	background: var(--wp--preset--color--accent-dark) !important;
}

.cmplz-cookiebanner .cmplz-btn:focus-visible,
.cmplz-cookiebanner .cmplz-close:focus-visible {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}

.cmplz-cookiebanner .cmplz-close {
	color: var(--wp--preset--color--ink);
}

#cmplz-manage-consent .cmplz-manage-consent {
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 4px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 700;
}

/* The consent banner would show the privacy policy link twice (cookie policy and privacy policy are the same page here). */
.cmplz-cookiebanner a.cmplz-link.cookie-statement:not([class*="cmplz-manage"]) {
	display: none;
}

/* Lightbox (project pages): light, slightly frosted overlay, a plain close cross, a zoom cursor on images. */
.wp-lightbox-container img {
	cursor: zoom-in;
}

.wp-lightbox-overlay .scrim {
	opacity: 0.94;
	backdrop-filter: blur(4px);
}

.wp-lightbox-overlay .wp-lightbox-close-button {
	fill: var(--wp--preset--color--ink);
	opacity: 0.75;
}

.wp-lightbox-overlay .wp-lightbox-close-button:hover,
.wp-lightbox-overlay .wp-lightbox-close-button:focus-visible {
	opacity: 1;
}

.wp-lightbox-overlay .wp-lightbox-close-button:focus-visible {
	outline: 3px solid var(--wp--preset--color--ink);
	outline-offset: 2px;
}

/* The small "enlarge" button on each image: quiet, ink on paper, only shown on hover and focus. */
.wp-lightbox-container .lightbox-trigger {
	background-color: var(--wp--preset--color--paper);
	border: 2px solid var(--wp--preset--color--ink);
	border-radius: 4px;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.wp-lightbox-container:hover .lightbox-trigger,
.wp-lightbox-container .lightbox-trigger:focus-visible {
	opacity: 1;
}

.wp-lightbox-container .lightbox-trigger svg {
	fill: var(--wp--preset--color--ink);
}

@media (hover: none) {
	.wp-lightbox-container .lightbox-trigger {
		display: none; /* touch screens: tapping the image itself opens it */
	}
}

/* Case layout ("rail"): used by case studies (and, next, projects).
   Header: hero image, then the details (left) and the title with the lead (right), closed by a 2px line.
   Sections: the title in a narrow left rail (sticky on desktop), the rows on the right; a 1px line above each
   section and a 2px line closing the last. A row (.rail-item) is a Columns block whose Style sets the proportions:
   text and image 50/50, image wider (60/40), text wider (40/60), two text columns, or text only.
   Desktop: rail beside the rows. Tablet (600-999px): the rail sits above its rows, but a row keeps its columns
   side by side. Phone (under 600px): everything in one column. */
.rail-header {
	gap: var(--wp--preset--spacing--50);
	margin-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--60);
	border-bottom: 2px solid var(--wp--preset--color--ink);
}

.rail-header h1 {
	margin-bottom: var(--wp--preset--spacing--40);
}

.rail-header .project-details__title {
	margin-top: 0;
}

.rail-row {
	gap: var(--wp--preset--spacing--50);
}

.rail-row--section {
	margin-top: var(--wp--preset--spacing--70);
	padding-top: var(--wp--preset--spacing--60);
	border-top: 1px solid var(--wp--preset--color--ink);
}

/* The first section follows the header's own (thicker) line, so it needs none of its own. */
.rail-header + .rail-row--section {
	margin-top: 0;
	padding-top: var(--wp--preset--spacing--70);
	border-top: 0;
}

/* The last section is closed by a 2px line before the call to action. */
.rail-row--last {
	padding-bottom: var(--wp--preset--spacing--70);
	margin-bottom: var(--wp--preset--spacing--70);
	border-bottom: 2px solid var(--wp--preset--color--ink);
}

/* The sticky section title stays 2rem below the top of the window (and below the admin bar when logged in). */
@media (min-width: 1000px) {
	.rail-row__left {
		position: sticky;
		top: 2rem;
		align-self: flex-start;
	}

	body.admin-bar .rail-row__left {
		top: calc(32px + 2rem);
	}
}

.rail-row .rail-title {
	margin: 0;
	font-size: 1.5rem !important; /* 24px; beats the heading size preset class */
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1.2;
	text-transform: uppercase;
}

/* Tablet: the rail on top, closer to its rows. */
@media (min-width: 600px) and (max-width: 999px) {
	.rail-row {
		gap: var(--wp--preset--spacing--40);
	}
}

/* Rows. */
.rail-item {
	align-items: flex-start;
	gap: var(--wp--preset--spacing--50);
	margin-top: 0;
}

.rail-item + .rail-item {
	margin-top: var(--wp--preset--spacing--70);
}

.rail-item h3 {
	margin-bottom: 0.75rem;
	font-size: var(--wp--preset--font-size--lead);
}

/* The five row layouts. Column 1 is the text, column 2 the image (or the second text). The ratios share what is left
   after the gap, so they hold at any width. */
.rail-item > .wp-block-column {
	flex: 1 1 0 !important;
}

.rail-item.is-style-row-image-wide > .wp-block-column:nth-child(1) { flex-grow: 2 !important; }
.rail-item.is-style-row-image-wide > .wp-block-column:nth-child(2) { flex-grow: 3 !important; }
.rail-item.is-style-row-text-wide > .wp-block-column:nth-child(1) { flex-grow: 3 !important; }
.rail-item.is-style-row-text-wide > .wp-block-column:nth-child(2) { flex-grow: 2 !important; }

.rail-item.is-style-row-text-only > .wp-block-column {
	flex: 1 1 100% !important;
}

.rail-item.is-style-row-text-only > .wp-block-column > :is(p, ul, ol, h3) {
	max-width: 60rem;
}

/* Stacked: the first column (the text) above the second (an image or gallery), full width, at every screen size. */
.rail-item.is-style-row-stacked {
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

.rail-item.is-style-row-stacked > .wp-block-column {
	flex: 1 1 100% !important;
	width: 100%;
}

.rail-item.is-style-row-stacked > .wp-block-column:first-child > :is(p, ul, ol, h3) {
	max-width: 60rem;
}

/* Phone: a row becomes one column. */
@media (max-width: 599px) {
	.rail-item {
		flex-direction: column;
		gap: var(--wp--preset--spacing--40);
	}

	.rail-item > .wp-block-column {
		flex: 1 1 100% !important;
		width: 100%;
	}
}

/* A short note under the last row of a section (e.g. "Same client, a different problem" with its link): compact. */
.rail-item--note {
	margin-top: var(--wp--preset--spacing--40) !important;
}

.rail-item--note .rail-note {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.4;
}

.rail-item--note .wp-block-buttons {
	margin: 0;
}

/* The breadcrumb lines up with the wide column when the page opens with the rail header (no hero image). */
@media (min-width: 1000px) {
	main:has(> .wp-block-post-content > .rail-header:first-child) .breadcrumbs.section-narrow {
		max-width: var(--wp--style--global--wide-size);
		margin-inline: auto;
	}
}

/* Stacked header (tablet and phone): the title and introduction come first, the details list after them. */
@media (max-width: 999px) {
	.rail-header > .rail-header__main {
		order: -1;
	}
}

/* A section without a title (image stacks, galleries): no line above it, tighter spacing, the left rail stays empty. */
.rail-row--plain {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: 0;
	border-top: 0;
}

.rail-header + .rail-row--plain {
	margin-top: 0;
	padding-top: var(--wp--preset--spacing--70);
}

/* Landing page header: full width, closed by a 2px line (same weight as the case header). */
.landing-header {
	gap: var(--wp--preset--spacing--50);
	margin-bottom: 0;
	padding-bottom: var(--wp--preset--spacing--60);
	border-bottom: 2px solid var(--wp--preset--color--ink);
}

.landing-header + .rail-row--section {
	margin-top: 0;
	padding-top: var(--wp--preset--spacing--70);
	border-top: 0;
}

/* Filter pills in the rail (Work, Case studies): stacked and sticky on desktop; a wrapping row elsewhere. */
@media (min-width: 1000px) {
	.rail-row__left .work-filter__chips {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.6rem;
		margin: 0;
	}
}

.rail-row__main .project-grid {
	margin-top: 0;
}

/* Plain pages that open with a landing header (Work, Case studies): the first row follows its line directly. */
.work-filter > .landing-header + .rail-row--section {
	margin-top: 0;
}

/* Differentiators with a link (home "I also do"): the links line up along the bottom of the row. */
.differentiator:has(> .wp-block-buttons) {
	display: flex;
	flex-direction: column;
}

.differentiator > .wp-block-buttons {
	margin-top: auto;
	padding-top: 0.75rem;
}
