/*
Theme Name: Cyber Engineering
Theme URI: https://cyber-engineering.de/
Description: Child-Theme von Twenty Twenty-Five für Cyber Engineering Gerd Gerhardus.
Author: Cyber Engineering
Template: twentytwentyfive
Version: 2.0.0
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cyber-engineering
*/

/* =====================================================================
   Tokens
   ===================================================================== */
:root {
	--ce-paper: var(--wp--preset--color--base);
	--ce-paper-2: var(--wp--preset--color--accent-5);
	--ce-ink: var(--wp--preset--color--contrast);
	--ce-green: var(--wp--preset--color--accent-1);
	--ce-night: var(--wp--preset--color--accent-2);
	--ce-signal: var(--wp--preset--color--accent-3);
	--ce-muted: var(--wp--preset--color--accent-4);
	--ce-line: var(--wp--preset--color--accent-6);
	--ce-cream: #ecebdf;
	--ce-cream-muted: #a3a89f;
	--ce-line-dark: rgb(236 235 223 / 0.12);
	--ce-mono: var(--wp--preset--font-family--geist-mono);
	--ce-pixel: var(--wp--preset--font-family--pixel);
	--ce-header-h: 64px;
	--ce-radius: 3px;
	--ce-ease: cubic-bezier(0.16, 1, 0.3, 1);

	--ce-icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E");
	--ce-icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E");
}

html {
	scroll-padding-top: calc(var(--ce-header-h) + 1.5rem);
	touch-action: manipulation;
	-webkit-tap-highlight-color: rgb(46 107 52 / 0.18);
	color-scheme: light;
}

/* Declared on body: that's where WordPress defines its page padding. */
body {
	/* The guide line sits on the left edge of the wide content column. */
	--ce-wide: var(--wp--style--global--wide-size, 1280px);
	--ce-gutter: var(--wp--style--root--padding-left, 1.5rem);
	--ce-rail-x: max(var(--ce-gutter), calc((100% - var(--ce-wide)) / 2));
	--ce-indent: 0px;
	--ce-rail-color: rgb(14 18 15 / 0.42);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

:where(h1, h2, h3, h4, h5, h6) {
	scroll-margin-top: calc(var(--ce-header-h) + 1.5rem);
	text-wrap: balance;
}

h1 {
	font-size: clamp(2.5rem, 3.6vw + 1rem, 4.9rem);
	line-height: 1.03;
	letter-spacing: -0.04em;
}

h2 {
	font-size: clamp(1.9rem, 2.2vw + 1rem, 3.3rem);
	letter-spacing: -0.035em;
}

h3 {
	font-size: clamp(1.25rem, 0.5vw + 1.05rem, 1.5rem);
	letter-spacing: -0.02em;
	line-height: 1.2;
}

p {
	text-wrap: pretty;
}

::selection {
	background: var(--ce-signal);
	color: var(--ce-night);
}

@media (min-width: 782px) {
	body {
		--ce-indent: 4.5rem;
	}
}

/* Header, main and footer sit flush against each other. */
.wp-site-blocks > * {
	margin-block-start: 0;
}

:focus-visible {
	outline: 2px solid var(--ce-green);
	outline-offset: 3px;
}

:is(.ce-dark, .ce-hero, .ce-header, .ce-mobilebar) :focus-visible {
	outline-color: var(--ce-signal);
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* =====================================================================
   Header: one grid — brand | menu | phone, dividers full height
   ===================================================================== */
header.wp-block-template-part {
	position: sticky;
	z-index: 50;
	top: 0;
}

.admin-bar header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 0px);
}

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

.ce-header {
	position: relative;
	isolation: isolate;
	border-bottom: 1px solid transparent;
	color: var(--ce-cream);
}

/* Blur on a layer behind, not on the header: a backdrop-filter on the header would
   trap the full-screen phone menu inside the header's 60px. */
.ce-header::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0 0 -1px;
	border-bottom: 1px solid var(--ce-line-dark);
	background: rgb(11 15 12 / 0.95);
	backdrop-filter: saturate(1.3) blur(14px);
	-webkit-backdrop-filter: saturate(1.3) blur(14px);
}

.ce-header__inner {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: stretch !important;
	gap: 0 !important;
	min-height: var(--ce-header-h);
}

.ce-brand {
	position: relative;
	justify-self: start;
	align-self: center;
	gap: 0.75rem;
	min-width: 0;
	padding-right: 1.5rem;
}

.ce-brand__logo {
	flex: none;
	margin: 0;
}

.ce-brand__logo img {
	display: block;
	width: 32px;
	height: 32px;
	border-radius: 2px;
}

.ce-brand .wp-block-site-title {
	margin: 0;
	min-width: 0;
	overflow: hidden;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ce-brand .wp-block-site-title a {
	color: var(--ce-cream);
	text-decoration: none;
}

/* The whole logo + name lockup links home. */
.ce-brand .wp-block-site-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

nav.ce-nav {
	justify-self: center;
	align-self: stretch;
	padding-inline: 1.5rem;
	border-left: 1px solid var(--ce-line-dark);
	border-right: 1px solid var(--ce-line-dark);
}

ul.ce-nav,
.ce-nav .wp-block-navigation__container {
	gap: 0 1.35rem;
	border: 0;
	padding: 0;
}

.ce-nav .wp-block-navigation-item__content {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--ce-cream-muted);
	font-family: var(--ce-mono);
	font-size: 0.74rem;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
}

.ce-nav .wp-block-navigation-item__content:hover {
	color: var(--ce-cream);
}

/* Size only — core decides when the menu toggle is shown (phones). */
.ce-nav .wp-block-navigation__responsive-container-open,
.ce-nav .wp-block-navigation__responsive-container-close {
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	color: var(--ce-cream);
}

/* Must beat core's :not(.has-background) rule, which paints the menu white. */
.wp-block-navigation.ce-nav:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--ce-night);
	color: var(--ce-cream);
	overscroll-behavior: contain;
	padding: calc(1.5rem + env(safe-area-inset-top)) max(1.5rem, env(safe-area-inset-right)) 1.5rem max(1.5rem, env(safe-area-inset-left));
}

.ce-nav .is-menu-open .wp-block-navigation-item__content {
	padding-block: 0.35rem;
	color: var(--ce-cream);
	font-family: inherit;
	font-size: 2rem;
	font-weight: 600;
	letter-spacing: -0.03em;
	text-transform: none;
}

.ce-phone {
	justify-self: end;
	align-self: center;
	margin: 0;
	padding-left: 1.5rem;
}

.ce-phone a {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.15rem;
	color: var(--ce-cream);
	font-size: 1.05rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
	line-height: 1.1;
	text-decoration: none;
	white-space: nowrap;
}

.ce-phone__label {
	color: var(--ce-signal);
	font-family: var(--ce-mono);
	font-size: 0.64rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ce-phone a:hover {
	color: var(--ce-signal);
}

/* Tablet: drop the phone (the mobile bar / contact page carry it). */
@media (max-width: 1100px) {
	.ce-header__inner {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.ce-phone {
		display: none;
	}

	nav.ce-nav {
		justify-self: end;
		border-right: 0;
		padding-right: 0;
	}
}

@media (min-width: 600px) and (max-width: 900px) {
	/* Name stays in the accessibility tree; the logo remains the link. */
	.ce-brand .wp-block-site-title {
		font-size: 0;
	}

	.ce-nav .wp-block-navigation__container {
		gap: 0 1.1rem;
	}
}

@media (max-width: 599px) {
	.ce-brand {
		gap: 0.6rem;
		padding-right: 0.5rem;
	}

	.ce-brand .wp-block-site-title {
		font-size: 0.84rem;
		letter-spacing: -0.02em;
	}

	nav.ce-nav {
		border: 0;
		padding: 0;
	}
}

/* =====================================================================
   Buttons: square, mono, with a stepped "pixel" offset shadow
   ===================================================================== */
.wp-block-button {
	position: relative;
	isolation: isolate;
}

.wp-block-button::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	border-radius: var(--ce-radius);
	background: var(--ce-green);
	pointer-events: none;
}

:is(.ce-dark, .ce-hero) .wp-block-button::after {
	background: var(--ce-signal);
}

:is(.ce-dark, .ce-hero) .ce-btn-light::after {
	background: var(--ce-cream);
}

.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 48px;
	border-radius: var(--ce-radius) !important;
}

.wp-block-button__link:is(:hover, :focus-visible) {
	background: var(--ce-ink);
	color: var(--ce-paper);
}

.ce-btn-light .wp-block-button__link,
.ce-btn-light .wp-block-button__link:is(:hover, :focus-visible) {
	background: var(--ce-signal);
	color: var(--ce-night);
}

.is-style-outline .wp-block-button__link,
.is-style-outline .wp-block-button__link:is(:hover, :focus-visible) {
	border: 1px solid var(--ce-ink);
	background: var(--ce-paper);
	color: var(--ce-ink);
}

.ce-section--tint .is-style-outline .wp-block-button__link {
	background: var(--ce-paper-2);
}

:is(.ce-dark, .ce-hero) .is-style-outline .wp-block-button__link,
:is(.ce-dark, .ce-hero) .is-style-outline .wp-block-button__link:is(:hover, :focus-visible) {
	border-color: rgb(236 235 223 / 0.4);
	background: var(--ce-night);
	color: var(--ce-cream);
}

.ce-btn-phone .wp-block-button__link::before,
.ce-btn-mail .wp-block-button__link::before {
	content: "";
	flex: none;
	width: 1.05em;
	height: 1.05em;
	background: currentColor;
	mask: var(--ce-icon-phone) center / contain no-repeat;
	-webkit-mask: var(--ce-icon-phone) center / contain no-repeat;
}

.ce-btn-mail .wp-block-button__link::before {
	mask-image: var(--ce-icon-mail);
	-webkit-mask-image: var(--ce-icon-mail);
}

/* =====================================================================
   Page frame & the guide line
   ===================================================================== */
.ce-main {
	padding-bottom: 0;
}

.ce-main .wp-block-post-content {
	counter-reset: ce-sec ce-service;
}

/* Full-width sections stack without gaps between their backgrounds. */
.ce-main .wp-block-post-content > .alignfull {
	margin-block: 0;
}

/* Pages without hero (Impressum, Datenschutz). */
.ce-main .wp-block-post-content > :first-child:not(.alignfull) {
	margin-top: clamp(3rem, 7vw, 6rem);
}

.ce-main .wp-block-post-content > :last-child:not(.alignfull) {
	margin-bottom: clamp(4rem, 8vw, 7rem);
}

.ce-section {
	position: relative;
	padding-block: clamp(5rem, 9vw, 8rem);
}

.ce-section--tint {
	background: var(--ce-paper-2);
}

.ce-section::after {
	content: "";
	position: absolute;
	z-index: 1;
	top: -8px;
	right: 0;
	left: 0;
	height: 8px;
	background: linear-gradient(90deg, var(--ce-edge, var(--ce-paper)) 50%, transparent 50%) 0 0 / 16px 8px repeat-x;
	pointer-events: none;
}

.ce-section--tint::after {
	--ce-edge: var(--ce-paper-2);
}

.ce-section.ce-dark::after {
	--ce-edge: var(--ce-night);
}

.ce-section--tight {
	padding-top: 0;
}

.ce-dark {
	--ce-rail-color: rgb(236 235 223 / 0.34);
	background: var(--ce-night);
	color: var(--ce-cream);
}

.ce-dark :is(h1, h2, h3, h4) {
	color: var(--ce-cream);
}

.ce-dark p {
	color: var(--ce-cream-muted);
}

.ce-dark a:not(.wp-element-button) {
	color: var(--ce-signal);
}

.ce-dark a:not(.wp-element-button):hover {
	color: var(--ce-cream);
}

@media (min-width: 782px) {
	/* Dotted pixel line through every section… */
	.ce-section::before {
		content: "";
		position: absolute;
		top: 0;
		bottom: 0;
		left: calc(var(--ce-rail-x) - 1px);
		width: 2px;
		background: repeating-linear-gradient(to bottom, var(--ce-rail-color) 0 4px, transparent 4px 10px);
		pointer-events: none;
	}

	/* …ending where the duck lands. */
	.ce-section--end::before {
		bottom: auto;
		height: clamp(5rem, 9vw, 8rem);
	}

	.ce-section--tight.ce-section--end::before {
		height: 2rem;
	}

	/* Section content is indented off the line. */
	.ce-section > .alignwide,
	.ce-hero > .alignwide {
		padding-left: var(--ce-indent);
	}
}

/* Numbered node on the line at each section label. */
.ce-eyebrow {
	position: relative;
	margin-bottom: 1.25rem;
	color: var(--ce-muted);
	font-family: var(--ce-mono);
	font-size: 0.76rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.ce-section .ce-eyebrow {
	counter-increment: ce-sec;
}

.ce-section .ce-eyebrow::before {
	content: counter(ce-sec, decimal-leading-zero);
	margin-right: 0.9em;
	color: var(--ce-green);
	font-family: var(--ce-pixel);
	font-size: 1rem;
	letter-spacing: 0;
}

@media (min-width: 782px) {
	.ce-section .ce-eyebrow::before {
		position: absolute;
		top: 50%;
		left: calc(var(--ce-indent) * -1);
		display: grid;
		place-items: center;
		width: 2.75rem;
		height: 2.75rem;
		margin: 0;
		translate: -50% -50%;
		background: var(--ce-paper);
		border: 2px solid currentColor;
	}

	.ce-section--tint .ce-eyebrow::before {
		background: var(--ce-paper-2);
	}

	.ce-dark .ce-eyebrow::before {
		background: var(--ce-night);
	}

	.ce-section .ce-eyebrow.is-passed::before {
		background: var(--ce-green);
		border-color: var(--ce-green);
		color: var(--ce-paper);
	}

	.ce-dark .ce-eyebrow.is-passed::before {
		background: var(--ce-signal);
		border-color: var(--ce-signal);
		color: var(--ce-night);
	}

	/* Inside the contact box the number stays inline. */
	.ce-section .ce-cta .ce-eyebrow::before {
		position: static;
		display: inline;
		width: auto;
		height: auto;
		margin-right: 0.9em;
		translate: none;
		background: none;
		border: 0;
	}
}

.ce-dark .ce-eyebrow,
.ce-hero .ce-eyebrow {
	color: var(--ce-cream-muted);
}

.ce-dark .ce-eyebrow::before {
	color: var(--ce-signal);
}

/* Section heads: label on top, headline left, lead right. */
.ce-section__head {
	margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.ce-section__head > * {
	margin-block: 0;
}

.ce-section__head > h2 {
	max-width: 16ch;
}

.ce-section__head > .ce-lead {
	margin-top: 1.5rem;
}

@media (min-width: 1000px) {
	.ce-section__head:has(> .ce-lead) {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
		column-gap: 4rem;
		align-items: start;
	}

	.ce-section__head > .ce-eyebrow {
		grid-column: 1 / -1;
	}

	.ce-section__head > .ce-lead {
		margin-top: 0.35rem;
	}
}

.ce-lead {
	color: var(--ce-muted);
	font-size: clamp(1.12rem, 0.4vw + 1rem, 1.3rem);
	line-height: 1.6;
	max-width: 60ch;
}

/* =====================================================================
   Hero
   ===================================================================== */
.ce-hero {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: var(--ce-night);
	color: var(--ce-cream);
}

.ce-hero::before {
	content: "";
	position: absolute;
	z-index: -2;
	inset: 0;
	background:
		radial-gradient(40% 55% at 78% 45%, rgb(155 219 126 / 0.16), transparent 70%),
		radial-gradient(70% 80% at 85% 30%, rgb(46 107 52 / 0.3), transparent 70%),
		linear-gradient(rgb(236 235 223 / 0.045) 1px, transparent 1px) 0 0 / 64px 64px,
		linear-gradient(90deg, rgb(236 235 223 / 0.045) 1px, transparent 1px) 0 0 / 64px 64px;
	mask-image: radial-gradient(120% 95% at 70% 40%, #000 35%, transparent 90%);
	-webkit-mask-image: radial-gradient(120% 95% at 70% 40%, #000 35%, transparent 90%);
}

.ce-hero > .ce-hero__content {
	width: 100%;
}

.ce-hero__content > * {
	margin-block: 0;
}

.ce-hero h1 {
	max-width: 17ch;
	color: var(--ce-cream);
}

.ce-hero .ce-lead {
	margin-top: 1.75rem;
	color: var(--ce-cream-muted);
	max-width: 52ch;
}

.ce-hero .wp-block-buttons {
	margin-top: 2.5rem;
}

.ce-kicker {
	margin-bottom: 1.5rem !important;
	color: var(--ce-signal);
	font-family: var(--ce-pixel);
	font-size: 1rem;
	letter-spacing: 0;
}

/* Home: full height; the logo square has its own column, the duck sits inside it. */
.ce-hero--home h1 {
	font-size: clamp(2.3rem, 2.6vw + 1rem, 4.1rem);
}

.ce-hero--home {
	--sq-w: clamp(220px, 28vw, 420px);
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: max(600px, min(calc(100svh - var(--ce-header-h)), 900px));
	padding-block: clamp(4rem, 9vh, 6rem) !important;
}

.ce-hero--home .ce-hero__content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--sq-w);
	column-gap: clamp(2rem, 5vw, 5rem);
	align-items: start;
}

.ce-hero--home .ce-hero__content > * {
	grid-column: 1;
}

/* Logo square as a little stage; the duck walks along its top edge. */
.ce-hero--home .ce-hero__content > .ce-logo-stage {
	position: relative;
	grid-column: 2;
	grid-row: 1 / span 5;
	align-self: center;
	width: var(--sq-w);
	aspect-ratio: 1;
	background: url("assets/images/square.svg") center / contain no-repeat;
}

.ce-trust {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 2.5rem;
	margin-top: clamp(3rem, 8vh, 4.5rem) !important;
	padding: 1.5rem 0 0;
	border-top: 1px solid var(--ce-line-dark);
	list-style: none;
	color: var(--ce-cream-muted);
	font-family: var(--ce-mono);
	font-size: 0.74rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ce-trust li::before {
	content: "■";
	content: "■" / "";
	margin-right: 0.7em;
	color: var(--ce-signal);
	font-size: 0.6em;
	vertical-align: 0.15em;
}

/* "Weiter" hint in the left margin, centred on the guide line the sections below use. */
.ce-hero__content > .ce-scrollhint {
	position: absolute;
	bottom: clamp(0.5rem, 2.5vh, 1.5rem);
	left: max(0px, calc(var(--ce-rail-x) - 2.25rem));
	width: 4.5rem;
	margin: 0;
	font-family: var(--ce-mono);
	font-size: 0.62rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ce-scrollhint a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 0;
	color: var(--ce-cream-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.ce-scrollhint a:is(:hover, :focus-visible) {
	color: var(--ce-cream);
}

/* Tall thin arrow, drawn as a mask so it takes the accent colour. */
.ce-scrollhint a::after {
	content: "";
	width: 1.5rem;
	height: 4rem;
	background: var(--ce-signal);
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 64' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='M12 1v61M3 53l9 9 9-9'/%3E%3C/svg%3E") center / contain no-repeat;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 64' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='square'%3E%3Cpath d='M12 1v61M3 53l9 9 9-9'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Where the scroll fade works: pinned to the window bottom so it is always on the
   first screen, then fades out. Elsewhere it stays at the hero bottom. */
@supports (animation-timeline: scroll()) {
	.ce-hero__content > .ce-scrollhint {
		position: fixed;
		z-index: 5;
		bottom: calc(clamp(0.5rem, 2.5vh, 1.5rem) + env(safe-area-inset-bottom));
		animation: ce-hint-fade linear both;
		animation-timeline: scroll();
		animation-range: 0 25vh;
	}
}

@keyframes ce-hint-fade {
	to { opacity: 0; visibility: hidden; }
}

@keyframes ce-hint-bob {
	0%, 60%, 100% { translate: 0 0; }
	30% { translate: 0 8px; }
}

@media (prefers-reduced-motion: no-preference) {
	.ce-scrollhint a::after {
		animation: ce-hint-bob 2.2s var(--ce-ease) infinite;
	}
}

.editor-styles-wrapper .ce-hero__content > .ce-scrollhint {
	position: static;
	margin-top: 1rem;
}

.ce-hero--page {
	padding-block: clamp(4.5rem, 9vw, 7rem) !important;
}

.ce-hero--page h1 {
	font-size: clamp(2.5rem, 3.4vw + 1rem, 4.5rem);
}

/* =====================================================================
   Steps (numbered columns)
   ===================================================================== */
.ce-steps {
	grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)) !important;
	counter-reset: ce-step;
	gap: 2.5rem clamp(2rem, 4vw, 3.5rem);
}

.ce-step {
	counter-increment: ce-step;
	padding-top: 1.5rem;
	border-top: 2px solid var(--ce-ink);
}

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

.ce-step::before {
	content: counter(ce-step, decimal-leading-zero);
	display: block;
	margin-bottom: 2rem;
	color: var(--ce-green);
	font-family: var(--ce-pixel);
	font-size: 1.5rem;
	line-height: 1;
}

.ce-step > :is(h2, h3) {
	font-size: clamp(1.25rem, 0.5vw + 1.05rem, 1.5rem);
}

.ce-step > p {
	margin-top: 0.9rem;
	color: var(--ce-muted);
}

/* =====================================================================
   Index rows (services on the start page)
   ===================================================================== */
.ce-index {
	counter-reset: ce-row;
	border-top: 0;
	background: linear-gradient(var(--ce-ink), var(--ce-ink)) var(--ce-indent) 0 / calc(100% - var(--ce-indent)) 2px no-repeat;
}

.ce-index > * {
	margin-block: 0 !important;
}

.ce-row {
	counter-increment: ce-row;
	position: relative;
	display: grid;
	grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 1.1fr) auto;
	align-items: baseline;
	gap: 0.5rem 2.5rem;
	padding-block: clamp(1.5rem, 2.4vw, 2.1rem);
	border-bottom: 1px solid var(--ce-line);
}

.ce-section--tint .ce-row {
	border-bottom-color: #cfcec3;
}

.ce-row > * {
	margin: 0 !important;
}

.ce-row::before {
	content: counter(ce-row, decimal-leading-zero);
	color: var(--ce-green);
	font-family: var(--ce-pixel);
	font-size: 1.5rem;
	line-height: 1;
}

.ce-row > h3 {
	font-size: clamp(1.3rem, 1vw + 1rem, 1.9rem);
	letter-spacing: -0.03em;
}

.ce-row > p:not(.ce-card__link) {
	color: var(--ce-muted);
	font-size: 1rem;
}

.ce-card__link a {
	color: var(--ce-ink);
	font-family: var(--ce-mono);
	font-size: 0.74rem;
	letter-spacing: 0.1em;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.ce-card__link::after {
	content: "→";
	content: "→" / "";
	display: inline-block;
	margin-left: 0.6em;
	color: var(--ce-green);
}

/* The whole row / card is the link's hit area. */
.ce-card__link a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
}

.ce-row:hover > h3,
.ce-row:hover .ce-card__link a {
	color: var(--ce-green);
}

.ce-row:has(a:focus-visible),
.ce-card:has(a:focus-visible) {
	outline: 2px solid var(--ce-green);
	outline-offset: 4px;
}

:is(.ce-row, .ce-card) a:focus-visible {
	outline: none;
}

@media (max-width: 781px) {
	.ce-row {
		grid-template-columns: 3.25rem minmax(0, 1fr);
		align-items: start;
	}

	.ce-row > * {
		grid-column: 2;
	}

	.ce-row::before {
		grid-column: 1;
		grid-row: 1 / span 3;
	}
}

/* =====================================================================
   Tiles (hairline grid)
   ===================================================================== */
.ce-tiles {
	grid-template-columns: repeat(auto-fit, minmax(min(21rem, 100%), 1fr)) !important;
	counter-reset: ce-tile;
	gap: 0 clamp(1.5rem, 3vw, 2.5rem) !important;
	border-top: 0;
	background: linear-gradient(var(--ce-ink), var(--ce-ink)) var(--ce-indent) 0 / calc(100% - var(--ce-indent)) 2px no-repeat;
}

.ce-tiles--2 {
	grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr)) !important;
}

.ce-tile {
	counter-increment: ce-tile;
	padding-block: clamp(1.75rem, 3vw, 2.5rem) clamp(2rem, 3vw, 2.75rem);
	border-bottom: 1px solid var(--ce-line);
}

.ce-section--tint .ce-tile {
	border-color: #cfcec3;
}

.ce-tile::before {
	content: counter(ce-tile, decimal-leading-zero);
	display: block;
	margin-bottom: 1.75rem;
	color: var(--ce-green);
	font-family: var(--ce-pixel);
	font-size: 1rem;
	line-height: 1;
}

.ce-tile > * {
	margin-block: 0;
}

.ce-tile > :is(h2, h3) {
	font-size: clamp(1.25rem, 0.5vw + 1.05rem, 1.5rem);
}

.ce-tile > p {
	margin-top: 0.8rem;
	color: var(--ce-muted);
	max-width: 46ch;
}

.ce-tiles + .wp-block-buttons {
	margin-top: 3rem;
}

/* =====================================================================
   Split (label + headline | text) and services list
   ===================================================================== */
.ce-split {
	gap: clamp(2rem, 6vw, 6rem);
}

.ce-split .ce-lead {
	margin-top: 0.35rem;
}

.ce-split .wp-block-buttons {
	margin-top: 2rem;
}

.ce-service {
	counter-increment: ce-service;
	position: relative;
	padding-top: 2rem;
	border-top: 0;
	background: linear-gradient(var(--ce-ink), var(--ce-ink)) var(--ce-indent) 0 / calc(100% - var(--ce-indent)) 2px no-repeat;
	gap: clamp(1.5rem, 5vw, 5rem);
}

.ce-service + .ce-service {
	margin-top: clamp(3.5rem, 7vw, 5.5rem);
}

.ce-service h2 {
	font-size: clamp(1.7rem, 1.6vw + 1rem, 2.6rem);
}

.ce-service h2::before {
	content: counter(ce-service, decimal-leading-zero);
	display: block;
	margin-bottom: 1rem;
	color: var(--ce-green);
	font-family: var(--ce-pixel);
	font-size: 1rem;
	letter-spacing: 0;
}

/* =====================================================================
   Statement (big type)
   ===================================================================== */
.ce-statement .ce-lead {
	color: var(--ce-ink);
	font-size: clamp(1.55rem, 1.9vw + 1rem, 2.75rem);
	font-weight: 500;
	letter-spacing: -0.03em;
	line-height: 1.2;
	max-width: 28ch;
}

/* =====================================================================
   Chips (hairline list)
   ===================================================================== */
.ce-chips {
	margin-top: 1.5rem;
	padding: 0;
	border-top: 1px solid var(--ce-line);
	list-style: none;
}

.ce-chips li {
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--ce-line);
	font-weight: 500;
}

.ce-chips li::before {
	content: "■";
	content: "■" / "";
	display: inline-block;
	width: 1.5rem;
	color: var(--ce-green);
	font-size: 0.6em;
	vertical-align: 0.15em;
}

/* =====================================================================
   CTA block — the duck lands on its top edge
   ===================================================================== */
.ce-cta {
	position: relative;
	padding: clamp(3rem, 6vw, 5rem) clamp(1.75rem, 5vw, 4.5rem) !important;
	border-radius: 4px;
	background:
		radial-gradient(60% 90% at 100% 0%, rgb(46 107 52 / 0.4), transparent 70%),
		linear-gradient(rgb(236 235 223 / 0.04) 1px, transparent 1px) 0 0 / 32px 32px,
		linear-gradient(90deg, rgb(236 235 223 / 0.04) 1px, transparent 1px) 0 0 / 32px 32px,
		var(--ce-night);
	box-shadow: 8px 8px 0 var(--ce-green);
}

@media (min-width: 782px) {
	/* The box starts right on the line, so the line runs into its corner. */
	.ce-section > .ce-cta.alignwide {
		padding-left: clamp(1.75rem, 5vw, 4.5rem) !important;
	}

	.ce-section > .ce-contact.alignwide {
		padding-left: 0;
	}
}

.ce-cta > * {
	margin-block: 0;
	max-width: 42rem;
}

.ce-cta h2 {
	font-size: clamp(2.1rem, 2.8vw + 1rem, 3.9rem);
}

.ce-cta .ce-lead {
	margin-top: 1.25rem;
}

.ce-cta .wp-block-buttons {
	margin-top: 2.25rem;
}

.ce-cta > p:not(.ce-lead):not(.ce-eyebrow) {
	margin-top: 1.5rem;
}

/* =====================================================================
   Contact cards
   ===================================================================== */
.ce-contact {
	grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)) !important;
	gap: clamp(1.25rem, 2vw, 2rem);
	padding-left: 0 !important;
}

.ce-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 1.75rem clamp(1.5rem, 2.5vw, 2rem) 2rem;
	background: #fff;
	border: 1px solid var(--ce-line);
	border-radius: 4px;
}

.ce-card > * {
	margin-block: 0;
}

.ce-card:has(.ce-card__link):hover {
	border-color: var(--ce-ink);
}

.ce-contact .ce-card > h2 {
	color: var(--ce-muted);
	font-family: var(--ce-mono);
	font-size: 0.74rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.ce-contact .ce-card > p.ce-contact__value {
	margin-top: 1.25rem;
	color: var(--ce-ink);
	font-size: clamp(1.25rem, 0.7vw + 1rem, 1.55rem);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	line-height: 1.3;
	overflow-wrap: break-word;
}

p.ce-card__link {
	margin-top: auto;
	padding-top: 1.5rem;
}

/* The phone card is the main action. */
.ce-card--primary {
	background: var(--ce-night);
	border-color: var(--ce-night);
	box-shadow: 8px 8px 0 var(--ce-green);
}

.ce-contact .ce-card--primary > h2 {
	color: var(--ce-cream-muted);
}

.ce-contact .ce-card--primary > p.ce-contact__value,
.ce-card--primary .ce-card__link a {
	color: var(--ce-cream);
}

.ce-card--primary .ce-card__link::after {
	color: var(--ce-signal);
}

.ce-card--primary:has(.ce-card__link):hover {
	border-color: var(--ce-night);
}

/* =====================================================================
   Footer
   ===================================================================== */
.ce-footer {
	padding-block: clamp(4rem, 8vw, 6rem) 2rem;
}

.ce-footer h2 {
	margin-bottom: 1rem;
	color: var(--ce-cream-muted) !important;
	font-family: var(--ce-mono);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.ce-footer p,
.ce-footer li {
	margin-block: 0.35rem;
	color: var(--ce-cream-muted);
}

.ce-footer .ce-footer__brand {
	color: var(--ce-cream);
	font-size: clamp(1.5rem, 1.4vw + 1rem, 2.1rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.1;
}

.ce-footer ul {
	padding: 0;
	list-style: none;
}

.ce-footer a:not(.wp-element-button) {
	display: inline-block;
	padding-block: 0.2rem;
	color: var(--ce-cream);
	text-decoration: none;
}

.ce-footer a:not(.wp-element-button):hover {
	color: var(--ce-signal);
}

.ce-footer__bottom {
	gap: 0.5rem 1.5rem;
	margin-top: clamp(3rem, 6vw, 4.5rem);
	padding-top: 1.5rem;
	border-top: 1px solid var(--ce-line-dark);
	font-family: var(--ce-mono);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
}

/* =====================================================================
   The duck (pixel sprite, 32×32 frames, scaled by whole pixels)
   ===================================================================== */
.ce-duck {
	--s: 4;
	position: absolute;
	z-index: 5;
	width: calc(32px * var(--s));
	height: calc(32px * var(--s));
	overflow: hidden;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.ce-duck.is-flipped {
	scale: -1 1;
}

.ce-duck__sheet {
	position: absolute;
	top: 0;
	left: 0;
	width: calc(768px * var(--s));
	height: calc(160px * var(--s));
	background: url("assets/images/duck-sheet.png") 0 0 / 100% 100% no-repeat;
	image-rendering: pixelated;
	pointer-events: none;
}

.ce-duck[hidden] {
	display: none;
}

/* Home hero: standing on the top edge of the logo square (edge at 8.25 %, feet at row 25/32). */
.ce-duck--hero {
	--s: 4;
	top: calc(8.5% - var(--s) * 24.5px);
	left: 50%;
}

/* Travelling duck: lives on the guide line (positioned by script, page coordinates). */
.ce-duck--travel {
	--s: 3;
	z-index: 40;
	top: 0;
	left: 0;
}

/* Roaming over content: let clicks through to links underneath. */
.ce-duck.is-roaming {
	pointer-events: none;
}

/* Portal: pixel sprite, 8 frames of 64×64 (Synapse Forge, tinted green). */
.ce-portal {
	position: absolute;
	z-index: 39;
	width: 128px;
	height: 128px;
	margin: 0 !important; /* WordPress layouts force auto margins on children */
	translate: -50% -50%;
	overflow: hidden;
	pointer-events: none;
	scale: 0.1 0.6;
}

.ce-portal__sheet {
	width: 800%;
	height: 100%;
	background: url("assets/images/portal-sheet.png") 0 0 / 100% 100% no-repeat;
	image-rendering: pixelated;
}

/* Landing spot: standing on the top edge of the final box, where the line arrives. */
.ce-duck--perch {
	--s: 3;
	top: calc(var(--s) * -24.5px);
	left: clamp(1rem, 2vw, 1.75rem);
}

/* Speech bubble on click. */
.ce-quak {
	position: absolute;
	z-index: 45;
	padding: 0.4rem 0.6rem 0.3rem;
	background: #fff;
	border: 2px solid var(--ce-ink);
	box-shadow: 3px 3px 0 var(--ce-ink);
	color: var(--ce-ink);
	font-family: var(--ce-pixel);
	font-size: 1rem;
	line-height: 1;
	white-space: nowrap;
	pointer-events: none;
}

/* =====================================================================
   Page scenes (built by duck.js in the sub page heroes)
   ===================================================================== */
.ce-hero--page[class*="ce-scene-"] .ce-hero__content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: clamp(2rem, 5vw, 5rem);
	align-items: center;
}

.ce-hero--page[class*="ce-scene-"] .ce-hero__content > * {
	grid-column: 1;
}

.ce-hero--page[class*="ce-scene-"] .ce-hero__content > .ce-scene-wrap {
	position: relative;
	grid-column: 2;
	grid-row: 1 / span 3;
	align-self: end;
}

.ce-scene {
	--u: 5;
	--sw: 96;
	--sh: 62;
	position: relative;
	width: calc(var(--u) * var(--sw) * 1px);
	height: calc(var(--u) * var(--sh) * 1px);
}

.ce-scene--speech,
.ce-scene--remote {
	--u: 4;
	--sw: 124;
}

.ce-scene > * {
	position: absolute;
}

.ce-scene .ce-duck {
	--s: var(--u);
	z-index: 1;
}

.ce-prop {
	z-index: 2;
	overflow: hidden;
}

.ce-prop__sheet {
	height: 100%;
	background-size: 100% 100%;
	image-rendering: pixelated;
}

.ce-prop--phone-s,
.ce-prop--handset-s,
.ce-prop--pad,
.ce-prop--pencil,
.ce-prop--keyboard {
	z-index: 3;
}

.ce-scene--think .ce-prop--pencil {
	rotate: -28deg;
	transform-origin: 50% 100%;
}

/* Lying on the desk until the duck picks it up. */
.ce-scene--think .ce-prop--pencil.is-lying {
	rotate: 90deg;
	translate: calc(var(--u) * 20px) calc(var(--u) * 2px);
}

.ce-prop--handset-v {
	z-index: 4;
}

.ce-prop--pencil {
	rotate: 35deg;
	transform-origin: 50% 100%;
}

/* Recoloured ducks: guest, old duck and the audience (seen from behind). */
.ce-duck--old .ce-duck__sheet {
	background-image: url("assets/images/duck-sheet-glasses.png");
	filter: grayscale(1) brightness(1.15);
}

.ce-duck--crowd {
	--s: calc(var(--u) / 2) !important;
	z-index: 4 !important;
}

.ce-duck--crowd-1 .ce-duck__sheet { filter: hue-rotate(110deg) saturate(0.9); }
.ce-duck--crowd-2 .ce-duck__sheet { filter: hue-rotate(190deg) saturate(1.1); }
.ce-duck--crowd-3 .ce-duck__sheet { background-image: url("assets/images/duck-sheet-glasses.png"); filter: grayscale(1) brightness(1.15); }

.ce-podium {
	z-index: 0;
	background: #7e4b2c;
	border: calc(var(--u) * 1px) solid #2d1522;
	box-shadow: inset 0 calc(var(--u) * 2px) 0 #c08454;
}

/* Dotted cable between the two PCs; packets run while connected. */
.ce-wire {
	z-index: 2;
	overflow: hidden;
}

.ce-wire span {
	position: absolute;
	inset: 0 0 0 -50%;
	background: repeating-linear-gradient(90deg, var(--ce-signal) 0 calc(var(--u) * 2px), transparent calc(var(--u) * 2px) calc(var(--u) * 4px));
}

.ce-quak--scene {
	z-index: 6;
	translate: -50% 0;
}

.ce-quak--code {
	background: var(--ce-night);
	border-color: var(--ce-signal);
	box-shadow: 3px 3px 0 var(--ce-signal);
	color: var(--ce-signal);
	font-size: 0.75rem;
}

.ce-quak--think {
	border-radius: 999px;
	box-shadow: none;
}

.ce-scene__pause {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.5rem);
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.5rem;
	border: 1px solid var(--ce-line-dark);
	border-radius: 3px;
	background: transparent;
	color: var(--ce-cream-muted);
	font-family: var(--ce-mono);
	font-size: 0.7rem;
	cursor: pointer;
	opacity: 0.6;
}

.ce-scene__pause:is(:hover, :focus-visible) {
	opacity: 1;
	color: var(--ce-cream);
}

@media (prefers-reduced-motion: no-preference) {
	.ce-scene--think .ce-prop--pencil {
		transition: rotate 0.3s steps(3, jump-end), translate 0.3s steps(3, jump-end);
	}

	.ce-prop.is-ringing {
		animation: ce-ring 0.16s steps(2, jump-none) infinite;
	}

	.ce-prop.is-writing {
		animation: ce-write 0.5s steps(2, jump-none) 8;
	}

	.ce-prop.is-on {
		animation: ce-blink 0.4s steps(2, jump-none) 4;
	}

	.ce-wire.is-live span {
		animation: ce-flow 0.5s steps(4, jump-none) infinite;
	}
}

@keyframes ce-ring {
	from { translate: calc(var(--u) * -1px) 0; }
	to { translate: calc(var(--u) * 1px) 0; }
}

@keyframes ce-write {
	from { translate: 0 0; }
	to { translate: calc(var(--u) * 3px) calc(var(--u) * -1px); }
}

@keyframes ce-blink {
	from { opacity: 1; }
	to { opacity: 0.35; }
}

@keyframes ce-flow {
	from { translate: 0 0; }
	to { translate: calc(var(--u) * 4px) 0; }
}

/* =====================================================================
   Mobile
   ===================================================================== */
.ce-mobilebar {
	display: none;
}

@media (max-width: 781px) {
	:root {
		--ce-header-h: 60px;
	}

	.ce-hero--home {
		--sq-w: 44vw;
		justify-content: flex-start;
		min-height: 0;
	}

	.ce-hero--home .ce-hero__content {
		grid-template-columns: minmax(0, 1fr);
	}

	.ce-hero--home .ce-hero__content > .ce-logo-stage {
		grid-column: 1;
		grid-row: 1;
		justify-self: end;
		margin: 3rem 0 2rem;
	}

	.ce-hero--home .ce-duck--hero {
		--s: 3;
	}

	.ce-hero--page[class*="ce-scene-"] .ce-hero__content {
		grid-template-columns: minmax(0, 1fr);
	}

	.ce-hero--page[class*="ce-scene-"] .ce-hero__content > .ce-scene-wrap {
		grid-column: 1;
		grid-row: auto;
		justify-self: start;
		margin-top: 2.5rem;
	}

	.ce-scene {
		--u: 3;
	}

	.ce-scene--speech,
	.ce-scene--remote {
		--u: 2;
	}

	/* Phones: the hero text already runs past the screen edge, and the call bar sits there. */
	.ce-hero__content > .ce-scrollhint {
		display: none;
	}

	.ce-mobilebar {
		display: block;
		position: fixed;
		z-index: 60;
		right: max(0.5rem, env(safe-area-inset-right));
		bottom: calc(0.5rem + env(safe-area-inset-bottom));
		left: max(0.5rem, env(safe-area-inset-left));
		margin: 0 !important;
		padding: 0.5rem;
		background: rgb(11 15 12 / 0.9);
		backdrop-filter: blur(16px);
		-webkit-backdrop-filter: blur(16px);
		border: 1px solid var(--ce-line-dark);
		border-radius: 6px;
	}

	.ce-mobilebar .wp-block-buttons {
		flex-wrap: nowrap;
		gap: 0.5rem;
	}

	.ce-mobilebar .wp-block-button {
		flex: 1 1 0;
		min-width: 0;
	}

	.ce-mobilebar .wp-block-button::after {
		display: none;
	}

	.ce-mobilebar .wp-block-button__link {
		width: 100%;
		padding-inline: 0.75rem;
	}

	.ce-mobilebar .ce-btn-phone .wp-block-button__link {
		background: var(--ce-signal);
		color: var(--ce-night);
	}

	.ce-mobilebar .is-style-outline .wp-block-button__link {
		border-color: rgb(236 235 223 / 0.35);
		background: transparent;
		color: var(--ce-cream);
	}

	/* Keep the last content clear of the fixed bar. */
	body {
		padding-bottom: calc(5rem + env(safe-area-inset-bottom));
	}
}

/* =====================================================================
   Motion
   ===================================================================== */
@keyframes ce-rise {
	from {
		opacity: 0;
		translate: 0 24px;
	}
	to {
		opacity: 1;
		translate: 0 0;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-button__link,
	.wp-block-button::after,
	.ce-card__link::after {
		transition: translate 0.18s steps(2, jump-end);
	}

	/* Button lifts off its pixel shadow. */
	.wp-block-button:hover .wp-block-button__link,
	.wp-block-button:has(:focus-visible) .wp-block-button__link {
		translate: -3px -3px;
	}

	.wp-block-button:hover::after,
	.wp-block-button:has(:focus-visible)::after {
		translate: 3px 3px;
	}

	:is(.ce-row, .ce-card):hover .ce-card__link::after {
		translate: 6px 0;
	}

	.ce-hero__content > * {
		animation: ce-rise 1s var(--ce-ease) both;
	}

	.ce-hero__content > :nth-child(2) { animation-delay: 0.08s; }
	.ce-hero__content > :nth-child(3) { animation-delay: 0.16s; }
	.ce-hero__content > :nth-child(4) { animation-delay: 0.24s; }
	.ce-hero__content > :nth-child(5) { animation-delay: 0.32s; }

	@supports (animation-timeline: view()) {
		.ce-reveal {
			animation: ce-rise linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 180px;
		}
	}
}

/* No effects while editing. */
.editor-styles-wrapper .ce-reveal,
.editor-styles-wrapper .ce-hero__content > * {
	animation: none !important;
}
