/* =========================================================================
   Automation Matrix - Signal Grid
   Deep navy engineering ground, one cyan signal.
   ========================================================================= */

:root {
	--bg: #0B1220;
	--surface: #111C2F;
	--surface-alt: #16233A;
	--ink: #E8EFF9;
	--muted: #93A7C4;
	--line: #1E2E49;
	--accent: #22D3EE;
	--accent-deep: #0E7C8C;
	--support: #14B8B8;
	--warn: #F5A524;

	--font-display: "Space Grotesk", "Segoe UI", sans-serif;
	--font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, monospace;

	--xs: 8px;
	--sm: 16px;
	--md: 28px;
	--lg: 56px;
	--xl: 96px;
	--xxl: 148px;

	--r-sm: 6px;
	--r-md: 14px;
	--r-pill: 999px;

	--wrap: 1200px;
	--nav-h: 76px;
}

/* --- reset ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol) {
	margin: 0;
	padding: 0;
}

:where(ul, ol) { list-style: none; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.65;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

img, svg, video, iframe { max-width: 100%; display: block; }
img { height: auto; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
	border-radius: var(--r-sm);
}

::selection { background: var(--accent); color: var(--bg); }

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent);
	color: var(--bg);
	padding: 10px 18px;
	z-index: 999;
	font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* --- typography -------------------------------------------------------- */

h1, h2, h3, h4, .display {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.022em;
	margin: 0;
	text-wrap: balance;
}

h1, .h1 { font-size: clamp(2.7rem, 6vw, 4.6rem); }
h2, .h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; }
h3, .h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.15; }
h4      { font-size: 1.1rem; line-height: 1.2; }

.lede {
	font-size: clamp(1.06rem, 1.5vw, 1.25rem);
	color: var(--muted);
	line-height: 1.6;
	max-width: min(60ch, 100%);
}

.eyebrow {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
	display: block;
	margin-bottom: var(--sm);
}

.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* --- layout ------------------------------------------------------------ */

.wrap {
	width: min(100% - 40px, var(--wrap));
	margin-inline: auto;
}

.section { padding-block: clamp(64px, 9vw, var(--xl)); }
.section--tight { padding-block: clamp(48px, 6vw, 72px); }
.section--raised { background: var(--surface); border-block: 1px solid var(--line); }

.stack > * + * { margin-top: var(--sm); }
.stack-lg > * + * { margin-top: var(--md); }

.split {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: clamp(32px, 5vw, 80px);
	align-items: center;
}

.split--wide-left { grid-template-columns: 1.25fr 0.75fr; }
.split--wide-right { grid-template-columns: 0.8fr 1.2fr; }

.section-head {
	max-width: min(62ch, 100%);
	margin-bottom: clamp(36px, 5vw, 64px);
}
.section-head p { color: var(--muted); margin-top: var(--sm); }

/* --- buttons ----------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 0.97rem;
	line-height: 1;
	padding: 15px 28px;
	border-radius: var(--r-pill);
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 0.12s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
	white-space: nowrap;
	text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn--primary {
	background: var(--accent);
	color: #06202A;
}
.btn--primary:hover { background: #4FE0F4; }

.btn--ghost {
	background: transparent;
	color: var(--ink);
	border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--sm { padding: 11px 20px; font-size: 0.9rem; }

.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
}

.arrow-link {
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.arrow-link::after { content: "\2192"; transition: transform 0.16s ease; }
.arrow-link:hover::after { transform: translateX(4px); }

/* --- chips ------------------------------------------------------------- */

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: var(--sm);
}
.chip {
	font-family: var(--font-mono);
	font-size: 0.76rem;
	letter-spacing: 0.02em;
	background: var(--surface-alt);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: 5px 10px;
	color: var(--muted);
}

/* --- header ------------------------------------------------------------ */

.site-header {
	position: sticky;
	top: 0;
	z-index: 60;
	background: rgba(11, 18, 32, 0.82);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.nav {
	height: var(--nav-h);
	display: flex;
	align-items: center;
	gap: var(--md);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.06rem;
	letter-spacing: -0.02em;
	color: var(--ink);
	flex: none;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand img { max-height: 38px; width: auto; }
.brand svg { flex: none; }

.nav-menu {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}
.nav-menu a {
	color: var(--muted);
	font-size: 0.94rem;
	font-weight: 500;
	padding: 8px 14px;
	border-radius: var(--r-sm);
	display: block;
	transition: color 0.16s ease;
}
.nav-menu a:hover { color: var(--ink); text-decoration: none; }
.nav-menu .current-menu-item > a,
.nav-menu .current_page_parent > a { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: 12px; flex: none; }

.nav-menu .nav-cta { display: none; }

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	width: 42px; height: 38px;
	color: var(--ink);
	cursor: pointer;
	align-items: center;
	justify-content: center;
	margin-left: auto;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
	display: block;
	width: 17px; height: 1.5px;
	background: currentColor;
	position: relative;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5.5px; }
.nav-toggle span::after { top: 5.5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-5.5px) rotate(-45deg); }

/* --- hero -------------------------------------------------------------- */

.hero {
	position: relative;
	min-height: calc(100svh - var(--nav-h));
	display: flex;
	align-items: center;
	padding-block: clamp(28px, 3.5vw, 52px);
	overflow: hidden;
}

.hero__grid {
	display: grid;
	grid-template-columns: 1.02fr 0.98fr;
	gap: clamp(28px, 4vw, 60px);
	align-items: center;
	position: relative;
	z-index: 2;
}

.hero__title {
	font-size: clamp(2.6rem, 5.6vw, 4.5rem);
	line-height: 1.02;
}
.hero__title em {
	font-style: normal;
	color: var(--accent);
}

.hero__lede {
	margin-top: var(--md);
	font-size: clamp(1.06rem, 1.5vw, 1.22rem);
	color: var(--muted);
	max-width: min(52ch, 100%);
	line-height: 1.6;
}

.hero__actions { margin-top: clamp(28px, 4vw, 40px); }

/* The canvas overflows its grid slot toward the viewport edge without
   widening the grid, which would drag the shared container off centre. */
.hero__canvas-wrap {
	position: relative;
	aspect-ratio: 1 / 1;
	min-height: 340px;
}
.hero__canvas-wrap canvas {
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(58vw, 760px);
	height: min(58vw, 760px);
	max-width: none;
	transform: translate(-44%, -50%);
}

.hero::after {
	content: "";
	position: absolute;
	top: -20%;
	right: -10%;
	width: 70vw;
	height: 70vw;
	max-width: 900px;
	max-height: 900px;
	background: radial-gradient(circle, rgba(34, 211, 238, 0.11), transparent 62%);
	pointer-events: none;
	z-index: 1;
}

/* --- counter ----------------------------------------------------------- */

.counter {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
}

/* reflows when optional metrics are absent */
.counter--auto {
	grid-template-columns: minmax(260px, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
	gap: clamp(20px, 3vw, 44px);
	align-items: end;
}

.metric__value {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(2.6rem, 6.5vw, 5.4rem);
	line-height: 0.95;
	letter-spacing: -0.035em;
	color: var(--accent);
	font-variant-numeric: tabular-nums;
	display: block;
}
.metric--sm .metric__value {
	font-size: clamp(1.9rem, 3.2vw, 2.9rem);
	color: var(--ink);
}
.metric__label {
	display: block;
	margin-top: 10px;
	font-family: var(--font-mono);
	font-size: 0.76rem;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--muted);
}
.metric__note {
	display: block;
	margin-top: 6px;
	font-size: 0.86rem;
	color: var(--muted);
}

/* --- capability rail --------------------------------------------------- */

.rail {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	overflow: hidden;
}
.rail__item {
	background: var(--bg);
	padding: clamp(26px, 3vw, 38px);
	transition: background-color 0.2s ease;
}
.rail__item:hover { background: var(--surface); }
.rail__item h3 { margin-bottom: 10px; }
.rail__item p { color: var(--muted); font-size: 0.95rem; }
.rail__num {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	color: var(--accent-deep);
	display: block;
	margin-bottom: 14px;
}

/* --- bento ------------------------------------------------------------- */

.bento {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 18px;
}
.bento > * {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: clamp(24px, 3vw, 36px);
}
.bento__wide { grid-column: span 4; }
.bento__narrow { grid-column: span 2; }
.bento__half { grid-column: span 3; }
.bento__full { grid-column: span 6; }
.bento h3 { margin-bottom: 12px; }
.bento p { color: var(--muted); font-size: 0.95rem; }

.bento__tinted {
	background: linear-gradient(150deg, var(--surface-alt), var(--surface));
}

/* --- steps ------------------------------------------------------------- */

.steps {
	display: grid;
	gap: 0;
	border-top: 1px solid var(--line);
}
.step {
	display: grid;
	grid-template-columns: 88px 1fr 1.15fr;
	gap: clamp(16px, 3vw, 40px);
	padding-block: clamp(26px, 3vw, 38px);
	border-bottom: 1px solid var(--line);
	align-items: start;
}
.step__k {
	font-family: var(--font-mono);
	font-size: 0.82rem;
	color: var(--accent);
	padding-top: 6px;
}
.step h3 { font-size: 1.28rem; }
.step p { color: var(--muted); font-size: 0.96rem; }

/* --- pricing ----------------------------------------------------------- */

.plans {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
	gap: 18px;
	align-items: stretch;
}
.plan {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: clamp(26px, 3vw, 34px);
	display: flex;
	flex-direction: column;
}
.plan--featured {
	background: linear-gradient(165deg, var(--surface-alt), var(--surface));
	border-color: var(--accent-deep);
}
.plan__name { font-size: 1.18rem; margin-bottom: 6px; }
.plan__for { color: var(--muted); font-size: 0.9rem; min-height: 3em; }
.plan__price {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 2.1rem;
	line-height: 1;
	letter-spacing: -0.03em;
	margin: 20px 0 4px;
	font-variant-numeric: tabular-nums;
}
.plan__price small {
	display: block;
	font-family: var(--font-body);
	font-weight: 400;
	font-size: 0.82rem;
	color: var(--muted);
	letter-spacing: 0;
	margin-top: 8px;
}
.plan__list {
	margin: 22px 0 26px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	display: grid;
	gap: 11px;
	font-size: 0.93rem;
	color: var(--muted);
}
.plan__list li { padding-left: 22px; position: relative; }
.plan__list li::before {
	content: "";
	position: absolute;
	left: 0; top: 9px;
	width: 9px; height: 9px;
	border-radius: 2px;
	border: 1px solid var(--accent-deep);
	background: rgba(34, 211, 238, 0.16);
}
.plan .btn { margin-top: auto; justify-content: center; }

.price-note {
	margin-top: var(--md);
	color: var(--muted);
	font-size: 0.92rem;
	max-width: min(70ch, 100%);
}

/* --- cards / articles / projects --------------------------------------- */

.grid-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	gap: clamp(20px, 2.4vw, 30px);
}

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--accent-deep); transform: translateY(-3px); }
.card__media {
	aspect-ratio: 16 / 9;
	background: linear-gradient(140deg, var(--surface-alt), #0d1728);
	position: relative;
	overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: clamp(20px, 2.2vw, 26px); display: flex; flex-direction: column; flex: 1; }
.card__meta {
	font-family: var(--font-mono);
	font-size: 0.73rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 12px;
}
.card h3 { font-size: 1.18rem; margin-bottom: 10px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { color: var(--muted); font-size: 0.94rem; }
.card .arrow-link { margin-top: 18px; font-size: 0.9rem; }

/* project entry on the projects page */
.project {
	display: grid;
	grid-template-columns: 0.9fr 1.1fr;
	gap: clamp(28px, 4vw, 56px);
	padding-block: clamp(44px, 5vw, 76px);
	border-bottom: 1px solid var(--line);
	align-items: start;
}
.project:nth-child(even) .project__media { order: -1; }
.project__client {
	font-family: var(--font-mono);
	font-size: 0.76rem;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--accent);
	display: block;
	margin-bottom: 12px;
}
.project h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.project__outcome {
	margin-top: var(--sm);
	font-size: 1.05rem;
	color: var(--ink);
	border-left: 2px solid var(--accent);
	padding-left: 16px;
}
.project__body { color: var(--muted); margin-top: var(--sm); }
.project__body p + p { margin-top: 14px; }
.project__hours {
	font-family: var(--font-mono);
	font-size: 0.86rem;
	color: var(--accent);
	margin-top: var(--sm);
}
.project__media { display: grid; gap: 18px; }

.embed {
	position: relative;
	border-radius: var(--r-md);
	overflow: hidden;
	border: 1px solid var(--line);
	background: var(--surface);
}
.embed iframe,
.embed .instagram-media {
	width: 100% !important;
	min-width: 0 !important;
	display: block;
	border: 0;
	margin: 0 !important;
	border-radius: 0 !important;
}
.embed iframe[src*="youtube"],
.embed iframe[src*="youtu.be"] { aspect-ratio: 16 / 9; height: auto; }
.embed-fallback { font-size: 0.92rem; }

.slot {
	border: 1px dashed var(--line);
	border-radius: var(--r-md);
	padding: 28px;
	color: var(--muted);
	font-size: 0.92rem;
	background: linear-gradient(140deg, rgba(22, 35, 58, 0.6), transparent);
}
.slot strong { color: var(--ink); font-family: var(--font-display); display: block; margin-bottom: 6px; }

/* --- article body ------------------------------------------------------ */

.article-hero { padding-block: clamp(50px, 6vw, 84px) clamp(28px, 3vw, 40px); }
.article-hero h1 { max-width: min(20ch, 100%); }
.article-meta {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--muted);
	margin-top: var(--md);
	display: flex;
	gap: 18px;
	flex-wrap: wrap;
}
.article-figure {
	margin-block: var(--md);
	border-radius: var(--r-md);
	overflow: hidden;
	border: 1px solid var(--line);
}

.prose {
	max-width: min(68ch, 100%);
	font-size: 1.06rem;
	line-height: 1.75;
	color: #D3DEEE;
}
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
	font-size: clamp(1.5rem, 2.6vw, 1.95rem);
	margin-top: 2em;
	color: var(--ink);
}
.prose h3 { font-size: 1.25rem; margin-top: 1.7em; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul li { list-style: none; position: relative; padding-left: 20px; }
.prose ul li::before {
	content: "";
	position: absolute;
	left: 0; top: 12px;
	width: 7px; height: 1.5px;
	background: var(--accent);
}
.prose ol { list-style: decimal; }
.prose ol li { padding-left: 6px; }
.prose li + li { margin-top: 8px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose code {
	font-family: var(--font-mono);
	font-size: 0.85em;
	background: var(--surface-alt);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: 2px 6px;
}
.prose blockquote {
	border: 0;
	border-left: 2px solid var(--accent);
	padding: 4px 0 4px 20px;
	margin: 1.6em 0;
	color: var(--ink);
	font-size: 1.12rem;
}
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose figure { margin: 1.6em 0; }
.prose img { border-radius: var(--r-md); border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.callout {
	background: var(--surface-alt);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: 24px 26px;
	color: var(--muted);
	font-size: 0.98rem;
}
.callout strong { color: var(--ink); }
.callout__label {
	display: block;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 10px;
}

/* --- forms ------------------------------------------------------------- */

.field { display: grid; gap: 7px; }
.field label {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--muted);
}
.field input,
.field select,
.field textarea {
	font-family: var(--font-body);
	font-size: 1rem;
	color: var(--ink);
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	padding: 13px 15px;
	width: 100%;
	transition: border-color 0.16s ease;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.field input::placeholder,
.field textarea::placeholder { color: #5F7391; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--accent); outline: none; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }

.checkline {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	font-size: 0.92rem;
	color: var(--muted);
}
.checkline input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--accent); flex: none; }

.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; }

.notice {
	border-radius: var(--r-md);
	padding: 16px 20px;
	font-size: 0.95rem;
	margin-bottom: var(--md);
	border: 1px solid var(--accent-deep);
	background: rgba(34, 211, 238, 0.08);
	color: var(--ink);
}
.notice--error { border-color: var(--warn); background: rgba(245, 165, 36, 0.09); }

/* --- popup ------------------------------------------------------------- */

.popup {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(6, 11, 20, 0.72);
	backdrop-filter: blur(5px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}
.popup.is-open { opacity: 1; visibility: visible; }

.popup__panel {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	max-width: 460px;
	width: 100%;
	padding: clamp(28px, 4vw, 40px);
	position: relative;
	transform: translateY(14px) scale(0.985);
	transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.popup.is-open .popup__panel { transform: none; }
.popup__panel h2 { font-size: 1.65rem; margin-bottom: 12px; }
.popup__panel p { color: var(--muted); font-size: 0.96rem; }
.popup__form { margin-top: 22px; display: grid; gap: 14px; }
.popup__close {
	position: absolute;
	top: 14px; right: 14px;
	width: 34px; height: 34px;
	border-radius: var(--r-pill);
	border: 1px solid var(--line);
	background: transparent;
	color: var(--muted);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
}
.popup__close:hover { color: var(--ink); border-color: var(--accent); }
.popup__msg { font-size: 0.92rem; color: var(--accent); min-height: 1.2em; }
.popup__msg.is-error { color: var(--warn); }
.popup__fine { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* --- inline subscribe band --------------------------------------------- */

.subscribe-band {
	background: linear-gradient(150deg, var(--surface-alt), var(--surface));
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: clamp(30px, 4vw, 50px);
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: clamp(24px, 4vw, 50px);
	align-items: center;
}
.subscribe-band h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.subscribe-band p { color: var(--muted); margin-top: 12px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 220px; }

/* --- CTA band ---------------------------------------------------------- */

.cta-band {
	text-align: center;
	padding-block: clamp(70px, 9vw, 120px);
	position: relative;
	overflow: hidden;
	border-top: 1px solid var(--line);
}
.cta-band::before {
	content: "";
	position: absolute;
	left: 50%; top: 50%;
	transform: translate(-50%, -50%);
	width: 900px; height: 500px;
	background: radial-gradient(ellipse, rgba(34, 211, 238, 0.11), transparent 66%);
	pointer-events: none;
}
.cta-band .wrap { position: relative; }
.cta-band h2 { max-width: min(18ch, 100%); margin-inline: auto; }
.cta-band p { margin: var(--sm) auto 0; max-width: min(52ch, 100%); color: var(--muted); }
.cta-band .btn-row { justify-content: center; margin-top: var(--md); }

/* --- footer ------------------------------------------------------------ */

.site-footer {
	background: var(--surface);
	border-top: 1px solid var(--line);
	padding-block: clamp(48px, 6vw, 76px) 30px;
}
.footer-grid {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr 1fr;
	gap: clamp(28px, 4vw, 56px);
}
.footer-grid h4 {
	font-family: var(--font-mono);
	font-size: 0.74rem;
	font-weight: 500;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 16px;
}
.footer-grid ul { display: grid; gap: 10px; }
.footer-grid a { color: var(--ink); font-size: 0.94rem; }
.footer-grid a:hover { color: var(--accent); text-decoration: none; }
.footer-blurb { color: var(--muted); font-size: 0.94rem; margin-top: 16px; max-width: min(34ch, 100%); }
.footer-bottom {
	margin-top: clamp(36px, 5vw, 56px);
	padding-top: 24px;
	border-top: 1px solid var(--line);
	display: flex;
	justify-content: space-between;
	gap: 18px;
	flex-wrap: wrap;
	color: var(--muted);
	font-size: 0.86rem;
}

/* --- pagination -------------------------------------------------------- */

.pagination {
	margin-top: clamp(40px, 5vw, 60px);
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px; height: 42px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	color: var(--muted);
	font-size: 0.92rem;
}
.pagination .page-numbers:hover { color: var(--ink); border-color: var(--accent-deep); text-decoration: none; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #06202A; font-weight: 600; }

/* --- reveal ------------------------------------------------------------ */

.js .reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* --- responsive -------------------------------------------------------- */

@media (max-width: 1040px) {
	.counter { grid-template-columns: 1fr 1fr; row-gap: 32px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
	.nav-toggle { display: inline-flex; }
	.nav-menu {
		position: absolute;
		top: var(--nav-h);
		left: 0; right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		background: var(--surface);
		border-block: 1px solid var(--line);
		padding: 10px 20px 18px;
		display: none;
	}
	.nav-menu.is-open { display: flex; }
	.nav-menu a { padding: 13px 4px; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
	.nav-menu li:last-child a { border-bottom: 0; }
	.nav-actions .btn { display: none; }
	.nav-menu .nav-cta { display: block; margin-top: 14px; }
	.nav-menu .nav-cta a {
		background: var(--accent);
		color: #06202A;
		border: 0;
		border-radius: var(--r-pill);
		text-align: center;
		font-weight: 600;
	}
}

@media (max-width: 860px) {
	body { font-size: 16px; }

	.split,
	.hero__grid,
	.subscribe-band,
	.form-grid,
	.project { grid-template-columns: 1fr; }

	.project:nth-child(even) .project__media { order: 0; }

	.hero { min-height: 0; padding-block: 56px 64px; }
	.hero__canvas-wrap {
		aspect-ratio: 4 / 3;
		min-height: 280px;
		opacity: 0.9;
	}
	.hero__canvas-wrap canvas {
		width: 108vw;
		height: 108vw;
		transform: translate(-50%, -50%);
	}
	.hero__grid { gap: 34px; }

	.step { grid-template-columns: 54px 1fr; }
	.step p { grid-column: 2; }

	.bento__wide,
	.bento__narrow,
	.bento__half,
	.bento__full { grid-column: span 6; }

	.counter { grid-template-columns: 1fr 1fr; }
	.metric--wide { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
	.footer-grid { grid-template-columns: 1fr; }
	.counter { grid-template-columns: 1fr; }
	.btn { width: 100%; justify-content: center; }
	.btn-row { flex-direction: column; align-items: stretch; }
	.nav-menu .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
	.js .reveal { opacity: 1 !important; transform: none !important; }
}

/* No element may exceed the column it sits in, whatever its ch measure. */
.wrap > *, .prose > *, .hero__grid > * { min-width: 0; }
.prose, .lede, .hero__lede, .section-head, .cta-band p { overflow-wrap: break-word; }
