/*
 * jlaude — header, footer, dark mode and motion.
 *
 * Colours, fonts and spacing come from theme.json (Appearance > Editor > Styles).
 * This file only adds what blocks cannot express: the floating header bar,
 * the dark-mode colour swap, and the animations.
 */

/* ---------------------------------------------------------------------------
 * Tokens
 * ------------------------------------------------------------------------ */

:root {
	--jl-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--jl-speed: 320ms;
	--jl-line: color-mix(in srgb, var(--wp--preset--color--contrast) 10%, transparent);
	--jl-tint: color-mix(in srgb, var(--wp--preset--color--contrast) 6%, transparent);
	--jl-shadow: 0 12px 32px -14px rgb(20 30 24 / 0.22);
	/* The deep green of the dark bands (the footer, the closing call to action). The same in both modes. */
	--jl-deep: color-mix(in srgb, var(--wp--preset--color--dark-accent-3) 38%, var(--wp--preset--color--dark-base));
	color-scheme: light;
}

/*
 * Dark mode: every "Dark mode: …" colour in the palette replaces its light
 * counterpart, so both sets stay editable from the Styles panel.
 */
:root[data-theme="dark"] {
	--wp--preset--color--base: var(--wp--preset--color--dark-base);
	--wp--preset--color--contrast: var(--wp--preset--color--dark-contrast);
	--wp--preset--color--accent-1: var(--wp--preset--color--dark-accent-1);
	--wp--preset--color--accent-2: var(--wp--preset--color--dark-accent-2);
	--wp--preset--color--accent-3: var(--wp--preset--color--dark-accent-3);
	--wp--preset--color--accent-4: var(--wp--preset--color--dark-accent-4);
	--wp--preset--color--accent-5: var(--wp--preset--color--dark-accent-5);
	--jl-shadow: 0 12px 32px -14px rgb(0 0 0 / 0.6);
	color-scheme: dark;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Thin underlines that sit slightly below the text. */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: 0.1em;
}

/* Fewer widows and orphans in headings and paragraphs. */
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}

.more-link {
	display: block;
}

:where(pre) {
	overflow-x: auto;
}

/* Keyboard focus ring: visible, in the brand colour, clear of the text. */
.wp-site-blocks :focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-3);
	outline-offset: 2px;
}

::selection {
	background: color-mix(in srgb, var(--wp--preset--color--accent-1) 45%, transparent);
}

/* A section that receives the focus after a jump link is not itself a control: no ring around it. */
.wp-site-blocks [tabindex="-1"]:focus-visible {
	outline: none;
}

/* No focus ring on a mouse click or tap; keyboard navigation keeps it. */
.wp-site-blocks *:focus:not(:focus-visible) {
	outline: none;
}

.wp-site-blocks a,
.wp-site-blocks button {
	-webkit-tap-highlight-color: transparent;
}

/* Pages cross-fade into each other instead of flashing. */
@media (prefers-reduced-motion: no-preference) {
	@view-transition {
		navigation: auto;
	}
}

/* The light/dark switch grows out of the toggle button as a circle. */
.jl-theme-switching::view-transition-old(root),
.jl-theme-switching::view-transition-new(root) {
	animation: none;
	mix-blend-mode: normal;
}

.jl-theme-switching::view-transition-new(root) {
	animation: jl-theme-reveal 650ms var(--jl-ease);
}

@keyframes jl-theme-reveal {
	from {
		clip-path: circle(0 at var(--jl-reveal-x, 50%) var(--jl-reveal-y, 0));
	}
	to {
		clip-path: circle(150vmax at var(--jl-reveal-x, 50%) var(--jl-reveal-y, 0));
	}
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------ */

/*
 * The header floats over the page, transparent, and keeps the same shape
 * while scrolling. Its text colour follows whatever is behind it: light on a
 * dark section or a photo, dark on a light one. The script sets data-tone on
 * each item (brand, every menu link, every button) separately, so the header
 * stays readable when the page behind it changes part-way across.
 */
:root {
	--jl-header-h: 72px;
}

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
}

@media (max-width: 600px) {
	.wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}

/*
 * Once the page has scrolled, whatever passes behind the header is softly
 * blurred so the menu stays readable. No fill, border or shadow: the colour
 * behind still shows through. Remove this rule pair for a fully clear header.
 */
.wp-site-blocks > header.wp-block-template-part::before {
	content: "";
	position: absolute;
	inset: 0 0 -10px;
	z-index: -1;
	opacity: 0;
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	-webkit-mask-image: linear-gradient(#000 65%, transparent);
	mask-image: linear-gradient(#000 65%, transparent);
	pointer-events: none;
	transition: opacity var(--jl-speed) var(--jl-ease);
}

.jl-scrolled .wp-site-blocks > header.wp-block-template-part::before {
	opacity: 1;
}

.jl-header.jl-header {
	padding: 10px clamp(10px, 3vw, 32px) 6px;
	color: var(--wp--preset--color--contrast);
	pointer-events: none;
}

.jl-header .jl-header__bar {
	position: relative;
	gap: 8px;
	min-height: 56px;
	padding: 6px 8px 6px 22px;
	pointer-events: auto;
}

.jl-header .jl-header__bar,
.jl-header .jl-header__bar * {
	transition-property: color, background-color, border-color, opacity, transform, box-shadow;
	transition-duration: 450ms;
	transition-timing-function: var(--jl-ease);
}

/*
 * Tone: over a dark background in light mode the header borrows the dark
 * mode colours, and over a light background in dark mode it does the reverse.
 * Everything inside the header reads these variables, so it all switches.
 */
:root:not([data-theme="dark"]) .jl-header [data-tone="dark"],
:root[data-theme="dark"] .jl-header [data-tone="light"] {
	--jl-tint: color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	--jl-line: color-mix(in srgb, var(--wp--preset--color--contrast) 18%, transparent);
	--wp--preset--color--accent-4: color-mix(in srgb, var(--wp--preset--color--contrast) 78%, transparent);
}

:root:not([data-theme="dark"]) .jl-header [data-tone="dark"] {
	color: var(--wp--preset--color--dark-contrast);
	--wp--preset--color--contrast: var(--wp--preset--color--dark-contrast);
	--wp--preset--color--base: var(--wp--preset--color--dark-base);
	--wp--preset--color--accent-3: var(--wp--preset--color--dark-accent-3);
}

:root[data-theme="dark"] .jl-header [data-tone="light"] {
	color: var(--wp--preset--color--dark-base);
	--wp--preset--color--contrast: var(--wp--preset--color--dark-base);
	--wp--preset--color--base: var(--wp--preset--color--dark-contrast);
	--wp--preset--color--accent-3: var(--wp--preset--color--dark-accent-5);
}

/* Brand */
.jl-header .wp-block-site-title,
.jl-footer .wp-block-site-title {
	margin: 0;
}

/*
 * Brand: the Site Logo block followed by the Site Title block. Once a logo
 * is uploaded it takes over, and the title stays only for screen readers.
 */
.jl-brand {
	flex-shrink: 0;
	align-items: center;
}

.jl-header__bar > .jl-brand {
	margin-inline-end: auto;
}

.jl-brand .wp-block-site-logo {
	line-height: 0;
}

.jl-brand .wp-block-site-logo img {
	width: auto;
	max-width: 180px;
	height: auto;
	max-height: 36px;
}

.jl-footer .jl-brand .wp-block-site-logo img {
	max-height: 48px;
}

/*
 * Logo colours (inc/logo.php, Settings → General).
 *
 * Single colour: the picture keeps its place but is not seen; its shape is
 * painted in the text colour, so it follows dark mode and the header's tone
 * just as the site name does.
 */
.wp-block-site-logo.jl-logo--mono .custom-logo-link {
	position: relative;
	display: inline-block;
	color: inherit;
}

.wp-block-site-logo.jl-logo--mono img {
	visibility: hidden;
}

.wp-block-site-logo.jl-logo--mono .custom-logo-link::after {
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	-webkit-mask: var(--jl-logo) center / contain no-repeat;
	mask: var(--jl-logo) center / contain no-repeat;
}

/*
 * Logo for dark backgrounds: the light version replaces the main one in dark
 * mode, and wherever the header sits over something dark (data-tone, set by
 * jlaude.js). In dark mode the header can also sit over something light.
 */
.jl-logo--paired .jl-logo__dark,
:root[data-theme="dark"] .jl-logo--paired [data-jl-logo-main],
:root:not([data-theme="dark"]) .jl-header [data-tone="dark"] .jl-logo--paired [data-jl-logo-main] {
	display: none;
}

:root[data-theme="dark"] .jl-logo--paired .jl-logo__dark,
:root:not([data-theme="dark"]) .jl-header [data-tone="dark"] .jl-logo--paired .jl-logo__dark {
	display: inline;
}

:root[data-theme="dark"] .jl-header [data-tone="light"] .jl-logo--paired [data-jl-logo-main] {
	display: inline;
}

:root[data-theme="dark"] .jl-header [data-tone="light"] .jl-logo--paired .jl-logo__dark {
	display: none;
}

.jl-brand:has(.wp-block-site-logo img) .wp-block-site-title {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.jl-header .wp-block-site-title a,
.jl-footer .wp-block-site-title a {
	text-decoration: none;
}

.jl-header .wp-block-site-title a::after,
.jl-footer .wp-block-site-title a::after,
.jl-overlay .wp-block-site-title::after {
	content: "";
	display: inline-block;
	width: 0.26em;
	height: 0.26em;
	margin-inline-start: 0.1em;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-2);
	transition: transform var(--jl-speed) var(--jl-ease);
}

.jl-header .wp-block-site-title a:hover::after,
.jl-footer .wp-block-site-title a:hover::after {
	transform: scale(1.5);
}

/* Navigation links */
.jl-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container .wp-block-navigation-item__content {
	position: relative;
	padding: 0.45rem 0.85rem;
	border-radius: 999px;
	color: var(--wp--preset--color--accent-4);
	text-decoration: none;
	transition:
		color var(--jl-speed) var(--jl-ease),
		background-color var(--jl-speed) var(--jl-ease);
}

.jl-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container .wp-block-navigation-item__content:hover,
.jl-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container .wp-block-navigation-item__content:focus-visible {
	background: var(--jl-tint);
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.jl-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--wp--preset--color--contrast);
}

.jl-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	bottom: 0.1rem;
	left: 50%;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-2);
	opacity: 0;
	transform: translateX(-50%) scale(0);
	transition:
		opacity var(--jl-speed) var(--jl-ease),
		transform var(--jl-speed) var(--jl-ease);
}

.jl-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container .wp-block-navigation-item__content[aria-current="page"]::after {
	opacity: 1;
	transform: translateX(-50%) scale(1);
}

/* Menu button */
.jl-nav .wp-block-navigation__responsive-container-open,
.jl-nav .wp-block-navigation__responsive-container-close {
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	transition: background-color var(--jl-speed) var(--jl-ease);
}

.jl-nav .wp-block-navigation__responsive-container-open:hover,
.jl-nav .wp-block-navigation__responsive-container-close:hover {
	background: var(--jl-tint);
}

/* Header actions */
.jl-header .jl-header__actions,
.jl-header .jl-actions {
	flex-shrink: 0;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
}

/* Light / dark toggle: the button text stays as the accessible label. */
.jl-theme-toggle .wp-block-button__link {
	position: relative;
	display: block;
	width: 40px;
	height: 40px;
	padding: 0;
	overflow: hidden;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	font-size: 0;
	cursor: pointer;
	transition: background-color var(--jl-speed) var(--jl-ease);
}

.jl-theme-toggle .wp-block-button__link:hover {
	background: var(--jl-tint);
	color: var(--wp--preset--color--contrast);
}

.jl-theme-toggle .wp-block-button__link::before,
.jl-theme-toggle .wp-block-button__link::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	background: currentColor;
	-webkit-mask: var(--jl-icon) center / contain no-repeat;
	mask: var(--jl-icon) center / contain no-repeat;
	transition:
		opacity 450ms var(--jl-ease),
		transform 450ms var(--jl-ease);
}

/* Moon: shown in light mode. */
.jl-theme-toggle .wp-block-button__link::before {
	--jl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 14.2A8.5 8.5 0 0 1 9.8 3.5a8.5 8.5 0 1 0 10.7 10.7Z'/%3E%3C/svg%3E");
}

/* Sun: shown in dark mode. */
.jl-theme-toggle .wp-block-button__link::after {
	--jl-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E");
	opacity: 0;
	transform: rotate(-90deg) scale(0.4);
}

[data-theme="dark"] .jl-theme-toggle .wp-block-button__link::before {
	opacity: 0;
	transform: rotate(90deg) scale(0.4);
}

[data-theme="dark"] .jl-theme-toggle .wp-block-button__link::after {
	opacity: 1;
	transform: none;
}

/* Call to action */
.jl-cta .wp-block-button__link {
	padding: 0.62rem 1.2rem;
	white-space: nowrap;
	transition:
		background-color var(--jl-speed) var(--jl-ease),
		color var(--jl-speed) var(--jl-ease),
		transform var(--jl-speed) var(--jl-ease),
		box-shadow var(--jl-speed) var(--jl-ease);
}

.jl-cta .wp-block-button__link:hover {
	box-shadow: var(--jl-shadow);
	transform: translateY(-1px);
}

.jl-cta .wp-block-button__link:active {
	transform: translateY(0) scale(0.98);
}

/* Desktop: logo left, menu truly centred, actions right. */
@media (min-width: 1024px) {
	.jl-header .jl-header__bar {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
	}

	.jl-header .jl-header__actions {
		justify-self: end;
	}
}

/*
 * Below desktop the menu collapses into the menu button and the call to
 * action moves into the menu overlay, leaving a clean bar.
 */
@media (max-width: 1023px) {
	.jl-header .jl-nav {
		order: 3;
	}

	.jl-header .jl-nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none;
	}

	.jl-header .jl-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.jl-header__actions .jl-cta {
		display: none;
	}
}

@media (max-width: 480px) {
	:root {
		--jl-header-h: 66px;
	}

	.jl-header .jl-header__bar {
		gap: 4px;
		min-height: 50px;
		padding: 4px 4px 4px 14px;
	}

	.jl-header .wp-block-site-title {
		font-size: 1.3rem;
	}
}

/* ---------------------------------------------------------------------------
 * Menu overlay (the "Mobile menu" template part)
 * ------------------------------------------------------------------------ */

.jl-nav .wp-block-navigation__responsive-container.is-menu-open {
	animation: jl-fade 400ms var(--jl-ease) both;
}

.jl-overlay.jl-overlay {
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	min-height: 100vh;
	min-height: 100dvh;
	margin: 0;
	padding: 14px clamp(20px, 6vw, 40px) 28px;
	overflow: hidden;
	isolation: isolate;
}

/* Logged-in visitors: keep the top row clear of the admin bar. */
.admin-bar .jl-overlay.jl-overlay {
	padding-top: calc(14px + var(--wp-admin--admin-bar--height, 0px));
}

/* Soft sage and clay glows in opposite corners. */
.jl-overlay::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(70% 45% at 100% 0%, color-mix(in srgb, var(--wp--preset--color--accent-1) 34%, transparent), transparent 70%),
		radial-gradient(60% 40% at 0% 100%, color-mix(in srgb, var(--wp--preset--color--accent-2) 20%, transparent), transparent 70%);
	pointer-events: none;
}

.jl-overlay > * {
	margin-block: 0;
}

.jl-overlay .jl-overlay__top {
	min-height: 50px;
	margin-inline-end: -8px;
}

.jl-overlay .wp-block-navigation-overlay-close {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--jl-tint);
	color: inherit;
	cursor: pointer;
	transition:
		background-color var(--jl-speed) var(--jl-ease),
		transform 500ms var(--jl-ease);
}

.jl-overlay .wp-block-navigation-overlay-close:hover {
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	transform: rotate(90deg);
}

.jl-overlay .wp-block-navigation-overlay-close svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* Links: large serif titles, numbered, separated by hairlines. */
.jl-overlay > .jl-overlay__nav {
	display: block;
	margin-block: clamp(1.5rem, 6vh, 3.5rem) auto;
}

.jl-overlay .wp-block-navigation__container {
	display: block;
	margin: 0;
	counter-reset: jl-menu;
}

.jl-overlay__nav .wp-block-navigation-item {
	display: block;
	border-bottom: 1px solid var(--jl-line);
	counter-increment: jl-menu;
	animation: jl-rise 700ms var(--jl-ease) backwards;
}

.jl-overlay__nav .wp-block-navigation-item:nth-child(1) { animation-delay: 80ms; }
.jl-overlay__nav .wp-block-navigation-item:nth-child(2) { animation-delay: 130ms; }
.jl-overlay__nav .wp-block-navigation-item:nth-child(3) { animation-delay: 180ms; }
.jl-overlay__nav .wp-block-navigation-item:nth-child(4) { animation-delay: 230ms; }
.jl-overlay__nav .wp-block-navigation-item:nth-child(5) { animation-delay: 280ms; }
.jl-overlay__nav .wp-block-navigation-item:nth-child(n + 6) { animation-delay: 330ms; }

.jl-overlay__nav .wp-block-navigation-item__content.wp-block-navigation-item__content {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	padding: 0.85rem 0;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(1.75rem, 7.5vw, 2.5rem);
	font-weight: 400;
	letter-spacing: -0.02em;
	line-height: 1.1;
	text-decoration: none;
	transition:
		color var(--jl-speed) var(--jl-ease),
		padding var(--jl-speed) var(--jl-ease);
}

.jl-overlay__nav .wp-block-navigation-item__content::before {
	content: counter(jl-menu, decimal-leading-zero);
	min-width: 1.5rem;
	color: var(--wp--preset--color--accent-4);
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.08em;
}

.jl-overlay__nav .wp-block-navigation-item__content::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-inline-start: auto;
	align-self: center;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-2);
	opacity: 0;
	transform: scale(0);
	transition:
		opacity var(--jl-speed) var(--jl-ease),
		transform var(--jl-speed) var(--jl-ease);
}

.jl-overlay__nav .wp-block-navigation-item__content:hover,
.jl-overlay__nav .wp-block-navigation-item__content:focus-visible {
	padding-inline-start: 0.4rem;
	color: var(--wp--preset--color--accent-3);
}

.jl-overlay__nav .wp-block-navigation-item__content[aria-current="page"]::after,
.jl-overlay__nav .wp-block-navigation-item__content:hover::after {
	opacity: 1;
	transform: scale(1);
}

/* Actions: a full-width call to action. */
.jl-overlay .jl-overlay__actions {
	margin-block-start: 2rem;
	animation: jl-rise 700ms var(--jl-ease) 380ms backwards;
}

.jl-overlay__cta .wp-block-button,
.jl-overlay__cta .wp-block-button__link {
	display: block;
	box-sizing: border-box;
	width: 100%;
}

.jl-overlay__cta .wp-block-button__link {
	padding: 1rem 1.5rem;
	font-size: 1rem;
	text-align: center;
}

@keyframes jl-fade {
	from {
		opacity: 0;
	}
}

@keyframes jl-rise {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------ */

/* Keep the footer at the bottom of the window on short pages. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > footer.wp-block-template-part {
	margin-block-start: auto;
}

/*
 * The footer is a deep green band that reaches the bottom of the page, with
 * the footer itself set into it as a card. A page that ends on the closing
 * call to action is already on that green, so there the band carries straight
 * on (body.jl-ends-on-closing, see inc/footer.php). Anywhere else the band
 * first eases in from the page colour.
 */
.jl-footer.jl-footer {
	--jl-footer-pad: 24px;
	--jl-footer-lead: clamp(120px, 15vw, 200px);
	margin-block: 0;
	padding: calc(var(--jl-footer-lead) + var(--jl-footer-pad)) var(--jl-footer-pad) var(--jl-footer-pad);
	background-color: var(--jl-deep);
	background-image: linear-gradient(
		to bottom,
		var(--wp--preset--color--base) 0,
		color-mix(in srgb, var(--jl-deep) 10%, var(--wp--preset--color--base)) calc(var(--jl-footer-lead) * 0.18),
		color-mix(in srgb, var(--jl-deep) 38%, var(--wp--preset--color--base)) calc(var(--jl-footer-lead) * 0.42),
		color-mix(in srgb, var(--jl-deep) 74%, var(--wp--preset--color--base)) calc(var(--jl-footer-lead) * 0.68),
		color-mix(in srgb, var(--jl-deep) 94%, var(--wp--preset--color--base)) calc(var(--jl-footer-lead) * 0.88),
		var(--jl-deep) var(--jl-footer-lead)
	), none;
	/*
	 * The gradient paints the whole band. The plain colour underneath is kept
	 * to the content box: where the band's top edge falls between two screen
	 * pixels, a full-width colour layer would show through as a thin dark line.
	 */
	background-clip: border-box, content-box;
}

/* One pixel of overlap, so no hairline of the page colour can show where the two blocks meet. */
.jl-ends-on-closing .jl-footer.jl-footer {
	margin-top: -1px;
	padding-top: 1px;
	background-image: none;
}

/* WordPress spaces out a Group's children; every part here sets its own spacing. */
.jl-footer.jl-footer > *,
.jl-footer .jl-footer__card > *,
.jl-footer .jl-footer__bottom > *,
.jl-footer .jl-footer__legal > *,
.jl-footer .jl-footer__wordmark > * {
	margin-block: 0;
}

.jl-footer .jl-footer__card {
	padding: clamp(28px, 3.4vw, 52px);
	border-radius: 24px;
	color: var(--wp--preset--color--contrast);
}

.jl-footer .jl-footer__top {
	gap: var(--wp--preset--spacing--40) clamp(24px, 4vw, 64px);
}

/* Copyright line: the site name comes from the Site Title block. */
.jl-footer .jl-footer__copy {
	gap: 0 0.3em;
}

.jl-footer .jl-footer__copy .wp-block-site-title {
	font: inherit;
	letter-spacing: 0;
}

/* The line that opens the card, set as a short statement. */
.jl-footer .jl-footer__tagline {
	max-width: 17ch;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(1.625rem, 2.5vw, 2.25rem);
	letter-spacing: -0.02em;
	line-height: 1.12;
}

.jl-footer .jl-footer__label {
	margin-block: 0.35rem 1rem;
	color: var(--wp--preset--color--accent-4);
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.4;
	text-transform: uppercase;
}

.jl-footer .wp-block-column > p {
	margin-block: 0 0.5rem;
}

.jl-footer a {
	text-decoration: none;
	transition: color var(--jl-speed) var(--jl-ease);
}

.jl-footer p a:hover {
	color: var(--wp--preset--color--contrast);
}

.jl-footer__nav .wp-block-navigation-item__content {
	display: inline-block;
	transition:
		color var(--jl-speed) var(--jl-ease),
		transform var(--jl-speed) var(--jl-ease);
}

.jl-footer__nav .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--accent-3);
	text-decoration: none;
	transform: translateX(4px);
}

.jl-footer .wp-block-social-links {
	gap: 0.35rem;
	margin-block-start: 1.25rem;
}

.jl-footer .wp-block-social-link {
	color: var(--wp--preset--color--contrast);
	transition:
		color var(--jl-speed) var(--jl-ease),
		transform var(--jl-speed) var(--jl-ease);
}

.jl-footer .wp-block-social-link:hover {
	color: var(--wp--preset--color--accent-2);
	transform: translateY(-2px);
}

/* The foot of the card: copyright and legal links on the left, the site name, very large, on the right. */
.jl-footer .jl-footer__bottom {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: end;
	column-gap: clamp(32px, 6vw, 96px);
	margin-top: clamp(56px, 8vw, 120px);
}

.jl-footer .jl-footer__legal {
	display: grid;
	row-gap: 6px;
	padding-bottom: clamp(10px, 1.6vw, 26px);
}

.jl-footer .jl-footer__legal p {
	margin: 0;
}

/*
 * The large site name. Its size is the width it has, divided by the number of
 * characters in the name (--jl-name-length, set in inc/footer.php), so it
 * fills that width whatever the site is called. A logo, once uploaded, takes
 * its place.
 */
.jl-footer .jl-footer__wordmark {
	display: block;
	min-width: 0;
	container-type: inline-size;
	text-align: right;
}

/* The line is kept tall enough for letters that hang below it (j, g, p, y) to stay inside the card. */
.jl-footer .jl-footer__wordmark .wp-block-site-title {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: min(15rem, calc(100cqi / (var(--jl-name-length, 6) * 0.56)));
	font-weight: 500;
	letter-spacing: -0.045em;
	line-height: 1;
	white-space: nowrap;
}

.jl-footer .jl-footer__wordmark .wp-block-site-logo {
	display: block;
	text-align: right;
}

.jl-footer .jl-footer__wordmark .wp-block-site-logo img {
	width: auto;
	max-width: 100%;
	max-height: clamp(72px, 12vw, 180px);
}

/* Tablets: the opening line takes the full width, the three link columns share the row under it. */
@media (max-width: 1099px) {
	.jl-footer .jl-footer__top {
		flex-wrap: wrap !important;
	}

	.jl-footer .jl-footer__top > .jl-footer__intro {
		flex-basis: 100% !important;
	}

	.jl-footer .jl-footer__tagline {
		max-width: 22ch;
	}
}

/* Narrow screens: links two to a row, the site name across the card, the small print under it. */
@media (max-width: 781px) {
	.jl-footer.jl-footer {
		--jl-footer-pad: 12px;
	}

	.jl-footer .jl-footer__card {
		border-radius: 20px;
	}

	.jl-footer .jl-footer__top > .wp-block-column:not(.jl-footer__intro) {
		flex-basis: calc(50% - var(--wp--preset--spacing--40)) !important;
		flex-grow: 1;
	}

	.jl-footer .jl-footer__bottom {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 28px;
	}

	.jl-footer .jl-footer__wordmark {
		order: -1;
		text-align: left;
	}

	.jl-footer .jl-footer__wordmark .wp-block-site-logo {
		text-align: left;
	}
}

/* Reveal on scroll: only hidden once the script has confirmed it can show it. */
.jl-js .jl-reveal > * {
	opacity: 0;
	transform: translateY(18px);
	transition:
		opacity 800ms var(--jl-ease),
		transform 800ms var(--jl-ease);
}

.jl-js .jl-reveal > :nth-child(2) { transition-delay: 80ms; }
.jl-js .jl-reveal > :nth-child(3) { transition-delay: 160ms; }
.jl-js .jl-reveal > :nth-child(n + 4) { transition-delay: 240ms; }

.jl-js .jl-reveal.is-visible > * {
	opacity: 1;
	transform: none;
}

/* ---------------------------------------------------------------------------
 * FAQ: a Group with the class "jl-faq" holding Details blocks
 * ------------------------------------------------------------------------ */

.jl-faq .wp-block-details {
	margin-block: 0;
	border-bottom: 1px solid var(--jl-line);
}

.jl-faq .wp-block-details summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 1.1rem;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: 1.25rem;
	line-height: 1.3;
	list-style: none;
	cursor: pointer;
	transition: color var(--jl-speed) var(--jl-ease);
}

.jl-faq .wp-block-details summary::-webkit-details-marker {
	display: none;
}

.jl-faq .wp-block-details summary::after {
	content: "+";
	flex: none;
	color: var(--wp--preset--color--accent-2);
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: 1.5rem;
	font-weight: 300;
	line-height: 1;
	transition: transform var(--jl-speed) var(--jl-ease);
}

.jl-faq .wp-block-details[open] summary::after {
	transform: rotate(45deg);
}

.jl-faq .wp-block-details summary:hover {
	color: var(--wp--preset--color--accent-3);
}

.jl-faq .wp-block-details > :not(summary) {
	margin-block: 0 1.2rem;
	color: var(--wp--preset--color--accent-4);
}

/* ---------------------------------------------------------------------------
 * Hero blocks as they appear in the editor
 *
 * On the front the "jl-hero" group is replaced by the interactive hero
 * (inc/hero.php, assets/css/hero.css), so these rules only ever show while
 * editing: they label each part and keep the blocks readable.
 * ------------------------------------------------------------------------ */

.jl-hero.jl-hero {
	padding-block: var(--wp--preset--spacing--50);
	background: color-mix(in srgb, var(--wp--preset--color--accent-1) 14%, var(--wp--preset--color--base));
}

.jl-hero__lines {
	counter-reset: jl-hero;
}

.jl-hero__lines > * {
	margin-block: 0 0.4rem;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(1.75rem, 3.4vw, 2.75rem);
	font-weight: 400;
	letter-spacing: -0.02em;
	line-height: 1.1;
	counter-increment: jl-hero;
}

.jl-hero__lines > *::before,
.jl-hero__hint::before,
.jl-hero__hint-touch::before,
.jl-hero__final::before {
	display: block;
	margin-bottom: 0.15rem;
	color: var(--wp--preset--color--accent-4);
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.4;
	text-transform: uppercase;
}

.jl-hero__lines > *::before {
	content: "Headline " counter(jl-hero);
}

.jl-hero__lines > :last-child::before {
	content: "Finale headline (over the video)";
}

.jl-hero__hint::before {
	content: "Hint — mouse";
}

.jl-hero__hint-touch::before {
	content: "Hint — touch screens";
}

.jl-hero__final::before {
	content: "Finale text";
}

/* ---------------------------------------------------------------------------
 * Arrow pill: a Button with the class "jl-pill"
 *
 * An outlined pill with a round arrow badge, shared by the page sections.
 * ------------------------------------------------------------------------ */

.jl-pill.jl-pill .wp-block-button__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 24px;
	padding: 8px 8px 8px 26px;
	border: 1px solid var(--jl-line);
	border-radius: 999px;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	font-size: 1.125rem;
	font-weight: 400;
	letter-spacing: -0.01em;
	transition: padding 0.3s;
}

.jl-pill.jl-pill .wp-block-button__link::after {
	content: "";
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--wp--preset--color--contrast);
	transition: transform 0.3s;
}

.jl-pill.jl-pill .wp-block-button__link::before {
	content: "";
	position: absolute;
	top: 50%;
	right: 20px;
	z-index: 1;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	background: var(--wp--preset--color--base);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9H16M10.5 3.5L16 9L10.5 14.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9H16M10.5 3.5L16 9L10.5 14.5'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.3s;
}

.jl-pill.jl-pill .wp-block-button__link:hover {
	padding-left: 32px;
	background: transparent;
	color: var(--wp--preset--color--contrast);
}

.jl-pill.jl-pill .wp-block-button__link:hover::after,
.jl-pill.jl-pill .wp-block-button__link:hover::before {
	transform: translateX(6px);
}

@media (max-width: 639px) {
	.jl-pill.jl-pill .wp-block-button__link {
		padding-left: 22px;
		font-size: 1rem;
	}
}

/* ---------------------------------------------------------------------------
 * Small label: a Paragraph with the class "jl-tag"
 *
 * The small upper-case line that opens a section ("/About", "/Our story").
 * ------------------------------------------------------------------------ */

.jl-tag.jl-tag {
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
 * Arrow link: a Paragraph with the class "jl-arrow"
 *
 * Its link is followed by a thin arrow that moves along on hover. A button
 * inside such a paragraph (added on the site, e.g. "Send another message")
 * looks the same.
 * ------------------------------------------------------------------------ */

.jl-arrow button {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	letter-spacing: inherit;
	cursor: pointer;
}

.jl-arrow a,
.jl-arrow button {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	color: inherit;
	text-decoration: none;
	transition: color 0.4s var(--jl-ease);
}

.jl-arrow a::after,
.jl-arrow button::after {
	content: "";
	flex: none;
	width: 1.15em;
	height: 0.8em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 7h17M12 1l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14' fill='none' stroke='%23000' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 7h17M12 1l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.4s var(--jl-ease);
}

.jl-arrow a:hover,
.jl-arrow a:focus-visible,
.jl-arrow button:hover,
.jl-arrow button:focus-visible {
	color: var(--wp--preset--color--accent-3);
}

.jl-arrow a:hover::after,
.jl-arrow a:focus-visible::after,
.jl-arrow button:hover::after,
.jl-arrow button:focus-visible::after {
	transform: translateX(6px);
}

/* ---------------------------------------------------------------------------
 * Reduced motion
 * ------------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.jl-header *,
	.jl-header *::before,
	.jl-header *::after,
	.jl-footer *,
	.jl-footer *::before,
	.jl-footer *::after {
		animation: none !important;
		transition: none !important;
	}

	.jl-js .jl-reveal > * {
		opacity: 1;
		transform: none;
	}

	.jl-pill .wp-block-button__link,
	.jl-pill .wp-block-button__link::before,
	.jl-pill .wp-block-button__link::after,
	.jl-arrow a,
	.jl-arrow a::after,
	.jl-arrow button,
	.jl-arrow button::after {
		transition: none !important;
	}
}
