/*
 * Imaginuity 2025 redesign — global base: reset, typography, layout primitives, buttons, links,
 * form controls, rich text (.prose) and section tones. Component styles live in each .astro file.
 * Owned by the orchestrator (see .planning/redesign-conventions.md).
 */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 1rem);
}
body {
	margin: 0;
	background: var(--c-white);
	color: var(--c-ink);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	font-weight: 400;
	line-height: var(--lh-body);
	letter-spacing: var(--ls-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
	margin: 0;
}
ul[class],
ol[class] {
	padding: 0;
	list-style: none;
}
img,
svg,
video,
iframe,
picture {
	display: block;
	max-width: 100%;
}
img,
video {
	height: auto;
}
button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}
button {
	cursor: pointer;
}
a {
	color: inherit;
}
:focus-visible {
	outline: 2px solid var(--c-focus);
	outline-offset: 3px;
}
[data-tone="dark"] :focus-visible,
[data-tone="blue"] :focus-visible {
	outline-color: var(--c-cyan);
}
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}
.skip-link {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 1000;
	padding: 0.75rem 1rem;
	background: var(--c-white);
	color: var(--c-ink);
	font-weight: 700;
	transform: translateY(-200%);
	transition: transform var(--dur) var(--ease);
}
.skip-link:focus {
	transform: none;
}

/* ---------- Type ---------- */
/* Long uppercase words in big Oswald headings must never push the page sideways on phones. */
h1,
h2,
h3,
.display-xl,
.display-l,
.h1,
.h2,
.h3 {
	overflow-wrap: break-word;
	hyphens: auto;
}
.display-xl,
.display-l,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.eyebrow {
	font-family: var(--font-display);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--ls-heading);
	line-height: var(--lh-heading);
}
.display-xl {
	font-size: var(--fs-display-xl);
	line-height: var(--lh-display);
	letter-spacing: var(--ls-display);
}
.display-l {
	font-size: var(--fs-display-l);
	line-height: 1.03;
}
.h1 {
	font-size: var(--fs-display-l);
	line-height: 1.03;
}
.h2 {
	font-size: var(--fs-h2);
}
.h3 {
	font-size: var(--fs-h3);
}
.h4 {
	font-size: var(--fs-h4);
	letter-spacing: -0.02em;
}
.h5 {
	font-size: var(--fs-h5);
}
.h6 {
	font-size: var(--fs-h6);
}
.text-accent {
	color: var(--c-blue);
}
[data-tone="dark"] .text-accent,
[data-tone="blue"] .text-accent,
[data-tone="image"] .text-accent {
	color: var(--c-cyan);
}
.lead {
	font-size: var(--fs-lead);
	line-height: var(--lh-relaxed);
}
.label-caps {
	font-family: var(--font-body);
	font-size: var(--fs-label);
	font-weight: 700;
	letter-spacing: var(--ls-caps);
	text-transform: uppercase;
}
.body-bold {
	font-weight: 700;
}

/* Section eyebrow: magenta ↘ arrow + Oswald 40 heading ("WHO WE HELP", "HOW WE KNOW BETTER") */
.eyebrow {
	display: flex;
	align-items: flex-end;
	gap: clamp(1rem, 0.6rem + 1vw, 1.875rem);
	font-size: var(--fs-h2);
	color: inherit;
}
.eyebrow::before {
	content: "";
	flex: none;
	width: clamp(1.375rem, 1.1rem + 0.8vw, 1.9375rem);
	aspect-ratio: 1;
	margin-bottom: 0.12em;
	background: url("/redesign/icon-section-arrow-magenta.svg") center / contain no-repeat;
}
.eyebrow--plain::before {
	display: none;
}
.eyebrow--magenta {
	color: var(--c-magenta);
}

/* ---------- Layout ---------- */
.container {
	width: 100%;
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.container--narrow {
	max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}
.sec {
	position: relative;
	padding-block: var(--section-y);
	background: var(--sec-bg, transparent);
	color: var(--sec-fg, inherit);
}
.sec--flush {
	padding-block: 0;
}
.sec--tight {
	padding-block: var(--section-y-tight);
}
/* Consecutive same-tone sections (no custom background) share one gap instead of two. */
.sec[data-tone="light"] + .sec[data-tone="light"]:not(.sec--flush),
.sec[data-tone="mist"]:not([style*="--sec-bg"]) + .sec[data-tone="mist"]:not(.sec--flush, [style*="--sec-bg"]),
.sec[data-tone="panel"]:not([style*="--sec-bg"]) + .sec[data-tone="panel"]:not(.sec--flush, [style*="--sec-bg"]),
.sec[data-tone="dark"]:not([style*="--sec-bg"]) + .sec[data-tone="dark"]:not(.sec--flush, [style*="--sec-bg"]),
.sec[data-tone="blue"]:not([style*="--sec-bg"]) + .sec[data-tone="blue"]:not(.sec--flush, [style*="--sec-bg"]) {
	padding-top: 0;
}
[data-tone="light"] {
	--sec-bg: var(--c-white);
	--sec-fg: var(--c-ink);
}
[data-tone="mist"] {
	--sec-bg: var(--c-mist);
	--sec-fg: var(--c-ink);
}
[data-tone="panel"] {
	--sec-bg: var(--c-panel);
	--sec-fg: var(--c-ink);
}
[data-tone="dark"] {
	--sec-bg: var(--c-night);
	--sec-fg: var(--c-white);
}
[data-tone="blue"] {
	--sec-bg: var(--c-blue);
	--sec-fg: var(--c-white);
}
[data-tone="image"] {
	--sec-bg: var(--c-night);
	--sec-fg: var(--c-white);
}
.sec__bg {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
}
.sec__bg img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.sec__bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--sec-overlay, var(--c-overlay-dark));
}
.sec__bg + .container,
.sec > .container {
	position: relative;
	z-index: 1;
}
.stack > * + * {
	margin-top: var(--stack-gap, var(--space-5));
}
.section-head {
	display: grid;
	gap: var(--space-5);
	margin-bottom: clamp(2rem, 1.5rem + 1.5vw, 3rem);
}
.section-head--center {
	justify-items: center;
	text-align: center;
}
.section-head--center > p {
	max-width: 46rem;
}
.divider {
	border: 0;
	border-top: var(--rule);
	margin: 0;
}
[data-tone="dark"] .divider,
[data-tone="blue"] .divider,
[data-tone="image"] .divider {
	border-top: var(--rule-light);
}

/* ---------- Buttons + links ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 49px;
	padding: 0.75rem 2rem;
	border: 1.5px solid var(--btn-border, var(--btn-bg));
	border-radius: var(--radius-pill);
	background: var(--btn-bg);
	color: var(--btn-fg);
	font-family: var(--font-body);
	font-size: var(--fs-small);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition:
		background-color var(--dur) var(--ease),
		color var(--dur) var(--ease),
		border-color var(--dur) var(--ease);
}
.btn .icon {
	flex: none;
	transition: transform var(--dur) var(--ease);
}
.btn:hover .icon {
	transform: translateX(3px);
}
.btn--primary {
	--btn-bg: var(--c-blue);
	--btn-fg: var(--c-white);
}
.btn--primary:hover {
	--btn-bg: var(--c-blue-hover);
}
.btn--secondary {
	--btn-bg: transparent;
	--btn-fg: var(--c-blue);
	--btn-border: var(--c-blue);
}
.btn--secondary:hover {
	--btn-bg: var(--c-blue);
	--btn-fg: var(--c-white);
}
/* On dark/blue/image backgrounds: white pill with blue text (Figma "See The Platforms In Action") */
.btn--light,
[data-tone="dark"] .btn--primary,
[data-tone="blue"] .btn--primary,
[data-tone="image"] .btn--primary {
	--btn-bg: var(--c-white);
	--btn-fg: var(--c-blue);
	--btn-border: var(--c-white);
}
.btn--light:hover,
[data-tone="dark"] .btn--primary:hover,
[data-tone="blue"] .btn--primary:hover,
[data-tone="image"] .btn--primary:hover {
	--btn-bg: var(--c-mist);
}
[data-tone="dark"] .btn--secondary,
[data-tone="blue"] .btn--secondary,
[data-tone="image"] .btn--secondary {
	--btn-fg: var(--c-white);
	--btn-border: var(--c-white);
}
[data-tone="dark"] .btn--secondary:hover,
[data-tone="blue"] .btn--secondary:hover,
[data-tone="image"] .btn--secondary:hover {
	--btn-bg: var(--c-white);
	--btn-fg: var(--c-blue);
}
.btn--block {
	width: 100%;
}
.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
	align-items: center;
}
.btn-row--center {
	justify-content: center;
}
.btn-row--right {
	justify-content: flex-end;
}

/* "Our Human Approach →" */
.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	color: var(--c-blue);
	font-size: var(--fs-small);
	font-weight: 700;
	letter-spacing: -0.01em;
	text-decoration: none;
}
.link-arrow::after {
	content: "";
	flex: none;
	width: 15px;
	height: 11px;
	background: currentColor;
	-webkit-mask: url("/redesign/icon-arrow-right-blue.svg") center / contain no-repeat;
	mask: url("/redesign/icon-arrow-right-blue.svg") center / contain no-repeat;
	transition: transform var(--dur) var(--ease);
}
.link-arrow:hover::after {
	transform: translateX(4px);
}
.link-arrow:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}
[data-tone="dark"] .link-arrow,
[data-tone="blue"] .link-arrow,
[data-tone="image"] .link-arrow {
	color: var(--c-cyan);
}
[data-tone="blue"] .link-arrow {
	color: var(--c-white);
}

/* Chevron bullet list (tech section bullets); colour via --chev */
.chev-list {
	display: grid;
	gap: var(--chev-gap, 1.25rem);
	padding: 0;
	list-style: none;
}
.chev-list > li {
	position: relative;
	padding-left: 1.3125rem;
}
.chev-list > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 6px;
	height: 6px;
	border-top: 1.5px solid var(--chev, var(--c-magenta));
	border-right: 1.5px solid var(--chev, var(--c-magenta));
	transform: rotate(45deg);
}

/* ---------- Form controls ---------- */
.field {
	display: grid;
	gap: 0.3125rem;
}
.field > label,
.field-label {
	color: var(--c-ink-75);
	font-size: var(--fs-label);
	font-weight: 700;
	letter-spacing: var(--ls-caps);
	line-height: 1.9;
	text-transform: uppercase;
}
.input,
.field input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"], [type="hidden"]),
.field select,
.field textarea {
	width: 100%;
	min-height: 46px;
	padding: 0.6875rem 0.75rem;
	border: 1px solid var(--c-border);
	border-radius: 0;
	background: var(--c-white);
	color: var(--c-ink);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	transition: border-color var(--dur) var(--ease);
}
.field textarea {
	min-height: 8rem;
	resize: vertical;
}
.input::placeholder,
.field ::placeholder {
	color: var(--c-ink-50);
}
.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
	border-color: var(--c-blue);
	outline: 2px solid color-mix(in srgb, var(--c-blue) 25%, transparent);
	outline-offset: 0;
}
.field [aria-invalid="true"] {
	border-color: var(--c-error);
}
.field-error {
	color: var(--c-error);
	font-size: var(--fs-small);
	font-weight: 600;
}

[data-tone="dark"] .field-error,
[data-tone="blue"] .field-error,
[data-tone="image"] .field-error {
	color: var(--c-error-on-dark);
}

/* ---------- Rich text ---------- */
.prose {
	--stack-gap: var(--stack);
	overflow-wrap: break-word;
}
.prose > * + * {
	margin-top: var(--stack);
}
.prose :where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--font-display);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--ls-heading);
	line-height: var(--lh-heading);
}
.prose :where(h1) {
	font-size: var(--fs-display-l);
	line-height: 1.03;
}
.prose :where(h2) {
	font-size: var(--fs-h2);
}
.prose :where(h3) {
	font-size: var(--fs-h3);
}
.prose :where(h4) {
	font-size: var(--fs-h4);
}
.prose :where(h5) {
	font-size: var(--fs-h5);
}
.prose :where(h6) {
	font-size: var(--fs-h6);
}
.prose :where(h1, h2, h3, h4, h5, h6) + * {
	margin-top: var(--space-4);
}
.prose * + :where(h1, h2, h3) {
	margin-top: var(--space-7);
}
.prose * + :where(h4, h5, h6) {
	margin-top: var(--space-6);
}
.prose :where(a:not(.btn)) {
	color: var(--c-blue);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.prose :where(a:not(.btn)):hover {
	text-decoration-thickness: 2px;
}
[data-tone="dark"] .prose :where(a:not(.btn)),
[data-tone="blue"] .prose :where(a:not(.btn)),
[data-tone="image"] .prose :where(a:not(.btn)) {
	color: inherit;
}
.prose :where(strong, b) {
	font-weight: 700;
}
.prose :where(ul:not([class]), ol:not([class])) {
	padding-left: 1.25rem;
}
.prose :where(ul:not([class])) {
	list-style: none;
	padding-left: 1.3125rem;
}
.prose :where(ul:not([class]) > li) {
	position: relative;
}
.prose :where(ul:not([class]) > li)::before {
	content: "";
	position: absolute;
	left: -1.3125rem;
	top: 0.55em;
	width: 6px;
	height: 6px;
	border-top: 1.5px solid var(--c-magenta);
	border-right: 1.5px solid var(--c-magenta);
	transform: rotate(45deg);
}
.prose :where(li) + :where(li) {
	margin-top: 0.5rem;
}
.prose :where(blockquote) {
	padding-left: var(--space-5);
	border-left: 3px solid var(--c-blue);
	font-family: var(--font-display);
	font-size: var(--fs-h5);
	font-weight: 500;
	line-height: 1.25;
	text-transform: uppercase;
}
.prose :where(hr) {
	border: 0;
	border-top: var(--rule);
	margin-block: var(--space-7);
}
[data-tone="dark"] .prose :where(hr),
[data-tone="blue"] .prose :where(hr),
[data-tone="image"] .prose :where(hr) {
	border-top: var(--rule-light);
}
.prose :where(img) {
	height: auto;
}
.prose :where(figure img, p > img) {
	margin-inline: auto;
}
.prose :where(table) {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-small);
}
.prose :where(th, td) {
	padding: 0.75rem;
	border: 1px solid var(--c-border);
	text-align: left;
	vertical-align: top;
}
.prose :where(th) {
	background: var(--c-panel);
	font-weight: 700;
}
[data-tone="dark"] .prose :where(th, td),
[data-tone="blue"] .prose :where(th, td) {
	border-color: var(--c-white-20);
}
[data-tone="dark"] .prose :where(th),
[data-tone="blue"] .prose :where(th) {
	background: transparent;
}
.prose .table-scroll {
	overflow-x: auto;
}
.prose :where(iframe) {
	width: 100%;
	border: 0;
}
.prose .video {
	position: relative;
	aspect-ratio: 16 / 9;
}
.prose .video iframe {
	position: absolute;
	inset: 0;
	height: 100%;
}
/* Legacy size classes from the importer's textStyle marker (Pylot p2–p6) */
.prose .p2 {
	font-family: var(--font-display);
	font-size: var(--fs-h3);
	font-weight: 500;
	line-height: var(--lh-heading);
	text-transform: uppercase;
	letter-spacing: var(--ls-heading);
}
.prose .p3 {
	font-family: var(--font-display);
	font-size: var(--fs-h5);
	font-weight: 500;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: -0.02em;
}
.prose .p4 {
	font-weight: 600;
}
.prose .p5 {
	font-weight: 400;
}
.prose .p6 {
	font-size: var(--fs-menu-heading);
	font-weight: 800;
	line-height: 1.3;
}
/* Legacy icon lists (.bulleted-list / .mvk-bullet): see public/styles/prose.css */
/* Legacy "colour splash" short rule → design accent rule */
.prose .color-splash-hr {
	width: 37px;
	height: 0;
	margin-block: var(--space-4);
	border: 0;
	border-top: 2px solid var(--c-blue);
	background: none;
}
[data-tone="dark"] .prose .color-splash-hr,
[data-tone="image"] .prose .color-splash-hr {
	border-top-color: var(--c-cyan);
}
[data-tone="blue"] .prose .color-splash-hr {
	border-top-color: var(--c-white);
}
.prose .text-center,
.prose [style*="text-align: center"] {
	text-align: center;
}
.prose .btn-row,
.prose > .btn {
	margin-top: var(--space-5);
}

/* ---------- Carousel (behaviour: src/components/ui/carousel.ts) ---------- */
.carousel {
	--per-view: 1;
	--carousel-gap: var(--space-5);
	position: relative;
}
.carousel__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--per-view) - 1) * var(--carousel-gap)) / var(--per-view));
	gap: var(--carousel-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar {
	display: none;
}
.carousel__track:focus-visible {
	outline-offset: 6px;
}
.carousel__slide {
	min-width: 0;
	scroll-snap-align: start;
}
.carousel__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-5);
	margin-top: var(--space-6);
}
.carousel--single .carousel__controls {
	display: none;
}
.carousel__btn {
	display: inline-grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: currentColor;
	transition: background-color var(--dur) var(--ease);
}
.carousel__btn:hover {
	background: var(--c-ink-15);
}
.carousel__dots {
	display: flex;
	gap: 0.625rem;
}
.carousel__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.3;
}
.carousel__dot[aria-current="true"] {
	opacity: 1;
}
@media (min-width: 640px) {
	.carousel[data-per-view="2"],
	.carousel[data-per-view="3"] {
		--per-view: 2;
	}
}
@media (min-width: 1024px) {
	.carousel[data-per-view="3"] {
		--per-view: 3;
	}
}
@media (min-width: 640px) {
	.carousel[data-per-view="4"] {
		--per-view: 2;
	}
}
@media (min-width: 1024px) {
	.carousel[data-per-view="4"] {
		--per-view: 4;
	}
}
[data-tone="dark"] .carousel__btn:hover,
[data-tone="blue"] .carousel__btn:hover,
[data-tone="image"] .carousel__btn:hover {
	background: var(--c-white-20);
}

/* Category kicker (blog cards, post header): Manrope 700 13 caps +0.15em */
.kicker {
	font-family: var(--font-body);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: var(--ls-caps);
	line-height: 1.75;
	text-transform: uppercase;
	text-decoration: none;
}

/* Animate to/from intrinsic sizes (accordions) where supported */
:root {
	interpolate-size: allow-keywords;
}

/* Whole-card link: put .stretched-link on the card's main <a>; the card needs position: relative */
.stretched-link::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
