/**
 * EQRN AI MART — base layer.
 *
 * 1. Design tokens (defaults; live values are injected by inc/theme-options.php)
 * 2. Modern reset
 * 3. Typography
 * 4. Layout primitives
 * 5. Accessibility helpers
 * 6. Motion preferences
 */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
	/* Brand */
	--eqrn-primary: #1b3a6b;
	--eqrn-primary-dark: #12294e;
	--eqrn-primary-light: #2b5490;
	--eqrn-accent: #f7941d;
	--eqrn-green: #2e9e44;
	--eqrn-lime: #8bc53f;
	--eqrn-text: #12203a;
	--eqrn-text-soft: #3d4a63;
	--eqrn-light: #f4f7fb;
	--eqrn-border: #e3eaf3;
	--eqrn-dark: #0c1728;

	/* Derived (recalculated by PHP so they follow brand edits) */
	--eqrn-primary-soft: #f2f5fa;
	--eqrn-primary-ink: #ffffff;
	--eqrn-accent-ink: #12203a;
	--eqrn-green-ink: #ffffff;
	--eqrn-accent-soft: #fef5e9;
	/*
	 * Darkened brand orange for text on light backgrounds. These are the
	 * static equivalents of what eqrn_accessible_on_white() derives at runtime
	 * from the Customizer accent; keep them in step if the brand orange moves.
	 * #A86514 = 4.63:1 on white (AA), #804D0F = 7.03:1 (AAA).
	 */
	--eqrn-accent-strong: #a86514;
	--eqrn-accent-strong-hover: #804d0f;
	--eqrn-green-soft: #eef8f0;
	--eqrn-lime-soft: #f2f9ec;
	--eqrn-brand-gradient: linear-gradient(100deg, #f7941d 0%, #8bc53f 48%, #2e9e44 100%);
	--eqrn-brand-gradient-soft: linear-gradient(100deg, #fef5e9 0%, #f2f9ec 50%, #eef8f0 100%);
	--eqrn-dark-2: #080f1b;

	/* Typography */
	--eqrn-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
		"Apple Color Emoji", "Segoe UI Emoji";
	--eqrn-font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
		Roboto, "Helvetica Neue", Arial, sans-serif;

	--eqrn-fs-xs: 0.75rem;
	--eqrn-fs-sm: 0.875rem;
	--eqrn-fs-base: 1rem;
	--eqrn-fs-md: 1.0625rem;
	--eqrn-fs-lg: 1.125rem;
	--eqrn-fs-xl: 1.375rem;
	--eqrn-fs-2xl: clamp(1.5rem, 1.15rem + 1.5vw, 2rem);
	--eqrn-fs-3xl: clamp(1.875rem, 1.35rem + 2.2vw, 2.75rem);
	--eqrn-fs-4xl: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem);

	--eqrn-lh-tight: 1.15;
	--eqrn-lh-snug: 1.3;
	--eqrn-lh-base: 1.65;
	--eqrn-lw-tight: 700;
	--eqrn-lw-bold: 600;

	/* Spacing scale */
	--eqrn-space-1: 0.25rem;
	--eqrn-space-2: 0.5rem;
	--eqrn-space-3: 0.75rem;
	--eqrn-space-4: 1rem;
	--eqrn-space-5: 1.5rem;
	--eqrn-space-6: 2rem;
	--eqrn-space-7: 2.5rem;
	--eqrn-space-8: 3rem;
	--eqrn-space-9: 4rem;
	--eqrn-space-10: 5rem;
	--eqrn-section-y: clamp(3.5rem, 2rem + 6vw, 6.5rem);

	/* Radius */
	--eqrn-radius-sm: 8px;
	--eqrn-radius: 14px;
	--eqrn-radius-lg: 20px;
	--eqrn-radius-xl: 28px;
	--eqrn-radius-pill: 999px;

	/* Elevation */
	--eqrn-shadow-xs: 0 1px 2px rgba(18, 32, 58, 0.06);
	--eqrn-shadow-sm: 0 2px 8px rgba(18, 32, 58, 0.07);
	--eqrn-shadow: 0 8px 24px rgba(18, 32, 58, 0.08);
	--eqrn-shadow-lg: 0 18px 48px rgba(18, 32, 58, 0.12);
	--eqrn-shadow-brand: 0 10px 30px rgba(46, 158, 68, 0.18);

	/* Layout */
	--eqrn-container: 1240px;
	--eqrn-container-narrow: 860px;
	--eqrn-gutter: clamp(1.15rem, 0.6rem + 2.5vw, 2.5rem);
	--eqrn-header-h: 76px;

	/* Motion */
	--eqrn-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--eqrn-dur: 0.28s;
	--eqrn-dur-slow: 0.55s;
}

/* ==========================================================================
   2. Modern reset
   ========================================================================== */

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--eqrn-header-h) + 16px);
}

body {
	min-height: 100vh;
	font-family: var(--eqrn-font-sans);
	font-size: var(--eqrn-fs-base);
	line-height: var(--eqrn-lh-base);
	color: var(--eqrn-text);
	background: #fff;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	/* Prevents horizontal scroll on all breakpoints. */
	overflow-x: hidden;
}

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

img {
	/* Neutralises the inline baseline gap. */
	vertical-align: middle;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

button {
	background: none;
	border: 0;
	cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--eqrn-font-display);
	font-weight: var(--eqrn-lw-bold);
	line-height: var(--eqrn-lh-snug);
	color: var(--eqrn-primary);
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

ul[class],
ol[class] {
	list-style: none;
	padding: 0;
}

address {
	font-style: normal;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */

.eqrn-section-title {
	font-size: var(--eqrn-fs-3xl);
	font-weight: 800;
	line-height: var(--eqrn-lh-tight);
	letter-spacing: -0.02em;
	color: var(--eqrn-primary);
	margin-bottom: var(--eqrn-space-4);
}

.eqrn-section-title--light {
	color: #fff;
}

.eqrn-lead {
	font-size: var(--eqrn-fs-lg);
	line-height: 1.7;
	color: var(--eqrn-text-soft);
	max-width: 62ch;
}

.eqrn-lead--light {
	color: rgba(255, 255, 255, 0.86);
}

.eqrn-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--eqrn-space-2);
	font-size: var(--eqrn-fs-xs);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	/*
	 * The brand green (#2E9E44) only reaches 3.2:1 on white, which is below
	 * the 4.5:1 required for 12px text. A darker green keeps the hue while
	 * meeting AA.
	 */
	color: #1d6b2e;
	margin-bottom: var(--eqrn-space-3);
}

.eqrn-eyebrow::before {
	content: "";
	width: 28px;
	height: 3px;
	border-radius: var(--eqrn-radius-pill);
	background: var(--eqrn-brand-gradient);
	flex: none;
}

/* On dark backgrounds the lime needs lifting to reach AA contrast. */
.eqrn-eyebrow--light {
	color: #b4e07a;
}

/* ==========================================================================
   4. Layout primitives
   ========================================================================== */

.eqrn-container {
	width: 100%;
	max-width: var(--eqrn-container);
	margin-inline: auto;
	padding-inline: var(--eqrn-gutter);
}

/*
 * Opt-in wider container for feature grids that carry large artwork, such as
 * the About page ventures. Only widens where there is room, so it never leaves
 * an uncomfortable line length, and is capped by the viewport like any other
 * container.
 */
@media (min-width: 1320px) {
	.eqrn-container--wide {
		max-width: 1480px;
	}
}

.eqrn-section {
	padding-block: var(--eqrn-section-y);
	position: relative;
}

.eqrn-section--soft {
	background: var(--eqrn-light);
}

.eqrn-section--tight {
	padding-block: clamp(2.5rem, 1.5rem + 4vw, 4rem);
}

.eqrn-section__footer {
	display: flex;
	justify-content: center;
	margin-top: var(--eqrn-space-8);
}

.eqrn-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow-x: clip;
}

.eqrn-main {
	flex: 1 0 auto;
}

.eqrn-main:focus {
	outline: none;
}

.eqrn-grid {
	display: grid;
	gap: clamp(1.25rem, 0.8rem + 1.6vw, 2rem);
	grid-template-columns: 1fr;
}

@media (min-width: 600px) {
	.eqrn-grid--2,
	.eqrn-grid--3,
	.eqrn-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.eqrn-grid--3,
	.eqrn-grid--4 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.eqrn-grid--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Placeholder values (clearly editable content) */
.eqrn-placeholder {
	display: inline;
	padding: 0.1em 0.5em;
	border-radius: var(--eqrn-radius-sm);
	background: var(--eqrn-accent-soft);
	color: #8a5600;
	font-size: 0.9em;
	font-style: italic;
	box-shadow: inset 0 0 0 1px rgba(247, 148, 29, 0.35);
}

/* On dark surfaces the placeholder needs a light treatment. */
.eqrn-footer .eqrn-placeholder,
.eqrn-partnership .eqrn-placeholder,
.eqrn-contact-cta .eqrn-placeholder {
	background: rgba(247, 148, 29, 0.16);
	color: #ffd08a;
	box-shadow: inset 0 0 0 1px rgba(247, 148, 29, 0.45);
}

/* Breadcrumb */
.eqrn-breadcrumbs {
	margin-bottom: var(--eqrn-space-5);
}

.eqrn-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--eqrn-space-2);
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: var(--eqrn-fs-sm);
	color: var(--eqrn-text-soft);
}

.eqrn-breadcrumbs__item {
	display: inline-flex;
	align-items: center;
	gap: var(--eqrn-space-2);
}

.eqrn-breadcrumbs__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding-block: 0.25rem;
	color: var(--eqrn-text-soft);
	text-decoration: none;
	transition: color var(--eqrn-dur) var(--eqrn-ease);
}

.eqrn-breadcrumbs__link:hover,
.eqrn-breadcrumbs__link:focus-visible {
	color: var(--eqrn-primary);
	text-decoration: underline;
}

.eqrn-breadcrumbs__current {
	color: var(--eqrn-primary);
	font-weight: 600;
}

.eqrn-breadcrumbs__sep svg {
	width: 14px;
	height: 14px;
	opacity: 0.5;
}

/* ==========================================================================
   5. Accessibility
   ========================================================================== */

.eqrn-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 9999;
	padding: 0.85rem 1.4rem;
	background: var(--eqrn-primary);
	color: #fff;
	font-weight: 600;
	border-radius: 0 0 var(--eqrn-radius) 0;
	text-decoration: none;
}

.eqrn-skip-link:focus {
	left: 0;
}

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

.screen-reader-text:focus {
	background: #fff;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: var(--eqrn-primary);
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* Visible focus for keyboard users on every interactive element. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--eqrn-accent);
	outline-offset: 2px;
	border-radius: var(--eqrn-radius-sm);
}

/* Skip outline for pointer users but never remove it entirely. */
:focus:not(:focus-visible) {
	outline: none;
}

/* ==========================================================================
   6. Motion preferences
   ========================================================================== */

[data-eqrn-reveal] {
	opacity: 1;
}

html.js-enabled [data-eqrn-reveal] {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity var(--eqrn-dur-slow) var(--eqrn-ease),
		transform var(--eqrn-dur-slow) var(--eqrn-ease);
	will-change: opacity, transform;
}

html.js-enabled [data-eqrn-reveal].is-visible {
	opacity: 1;
	transform: none;
	will-change: auto;
}

html.js-enabled [data-eqrn-reveal-item] {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity var(--eqrn-dur-slow) var(--eqrn-ease),
		transform var(--eqrn-dur-slow) var(--eqrn-ease);
}

html.js-enabled [data-eqrn-reveal-item].is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}

	html.js-enabled [data-eqrn-reveal],
	html.js-enabled [data-eqrn-reveal-item] {
		opacity: 1;
		transform: none;
	}
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
	.eqrn-header,
	.eqrn-footer,
	.eqrn-mobile-nav,
	.eqrn-hero__actions,
	.eqrn-section__footer {
		display: none !important;
	}

	body {
		color: #000;
		background: #fff;
		font-size: 12pt;
	}
}