/*
 * AYHL base: reset, typography, layout primitives, prose.
 * Framework-agnostic — shared with the future React application.
 */

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

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

body {
	margin: 0;
	background: var(--ayhl-color-bg);
	color: var(--ayhl-color-text-body);
	font-family: var(--ayhl-font-body);
	font-size: var(--ayhl-text-base);
	line-height: var(--ayhl-leading-normal);
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

img,
video {
	height: auto;
}

img {
	display: block;
}

svg {
	flex-shrink: 0;
}

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

button {
	cursor: pointer;
}

[hidden] {
	display: none !important;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--ayhl-space-4);
	color: var(--ayhl-color-heading);
	font-family: var(--ayhl-font-display);
	font-weight: 700;
	line-height: var(--ayhl-leading-tight);
	letter-spacing: var(--ayhl-tracking-display);
	text-wrap: balance;
}

h1 { font-size: var(--ayhl-text-4xl); font-weight: 800; text-transform: uppercase; }
h2 { font-size: var(--ayhl-text-3xl); }
h3 { font-size: var(--ayhl-text-2xl); }
h4 { font-size: var(--ayhl-text-xl); }
h5 { font-size: var(--ayhl-text-lg); }
h6 { font-size: var(--ayhl-text-md); text-transform: uppercase; letter-spacing: var(--ayhl-tracking-caps); }

p {
	margin: 0 0 var(--ayhl-space-4);
}

a {
	color: var(--ayhl-color-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--ayhl-duration-fast) var(--ayhl-ease);
}

a:hover {
	color: var(--ayhl-color-link-hover);
}

strong,
b {
	font-weight: 650;
}

small {
	font-size: var(--ayhl-text-sm);
}

hr {
	height: 1px;
	margin: var(--ayhl-space-8) 0;
	border: 0;
	background: var(--ayhl-color-border);
}

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

::selection {
	background: var(--ayhl-blue-100);
	color: var(--ayhl-navy-900);
}

/* Kicker / eyebrow label used above headings */
.ayhl-kicker {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	margin: 0 0 var(--ayhl-space-3);
	color: var(--ayhl-color-accent);
	font-family: var(--ayhl-font-display);
	font-size: var(--ayhl-text-sm);
	font-weight: 700;
	line-height: 1;
	letter-spacing: var(--ayhl-tracking-label);
	text-transform: uppercase;
}

.ayhl-kicker::before {
	content: "";
	width: 1.5rem;
	height: 3px;
	background: currentColor;
	transform: skewX(-20deg);
}

.ayhl-kicker--plain::before {
	display: none;
}

.ayhl-display {
	font-family: var(--ayhl-font-display);
	font-weight: 800;
	line-height: var(--ayhl-leading-none);
	text-transform: uppercase;
}

.ayhl-lead {
	color: var(--ayhl-color-text-muted);
	font-size: var(--ayhl-text-lg);
	line-height: var(--ayhl-leading-snug);
}

.ayhl-meta {
	color: var(--ayhl-color-text-subtle);
	font-size: var(--ayhl-text-xs);
	font-weight: 600;
	letter-spacing: var(--ayhl-tracking-caps);
	text-transform: uppercase;
}

.ayhl-num,
.ayhl-tabular {
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum";
}

/* ---------- Layout primitives ---------- */
.ayhl-container {
	width: 100%;
	max-width: calc(var(--ayhl-w-content) + (var(--ayhl-gutter) * 2));
	margin-inline: auto;
	padding-inline: var(--ayhl-gutter);
}

.ayhl-container--prose {
	max-width: calc(var(--ayhl-w-prose) + (var(--ayhl-gutter) * 2));
}

.ayhl-container--app {
	max-width: calc(var(--ayhl-w-app) + (var(--ayhl-gutter) * 2));
}

.ayhl-container--full {
	max-width: none;
}

.ayhl-section {
	padding-block: var(--ayhl-section-y);
}

.ayhl-section--tight {
	padding-block: calc(var(--ayhl-section-y) * 0.6);
}

.ayhl-section--white { background: var(--ayhl-color-surface); }
.ayhl-section--sunken { background: var(--ayhl-color-surface-sunken); }
.ayhl-section--dark {
	background: var(--ayhl-color-surface-dark);
	color: var(--ayhl-color-text-on-dark-muted);
}
.ayhl-section--dark :is(h1, h2, h3, h4, h5, h6) { color: var(--ayhl-color-text-on-dark); }
.ayhl-section--dark .ayhl-card:not(.ayhl-card--dark) { color: var(--ayhl-color-text-body); }
.ayhl-section--dark .ayhl-card:not(.ayhl-card--dark) :is(h1, h2, h3, h4, h5, h6) { color: var(--ayhl-color-heading); }
.ayhl-section--dark .ayhl-card:not(.ayhl-card--dark) .ayhl-link-arrow { color: var(--ayhl-color-primary); }

.ayhl-stack > * + * {
	margin-top: var(--ayhl-stack-space, var(--ayhl-space-4));
}

.ayhl-cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ayhl-cluster-gap, var(--ayhl-space-3));
}

.ayhl-grid {
	display: grid;
	gap: var(--ayhl-grid-gap, var(--ayhl-space-6));
	grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--ayhl-grid-min, 18rem)), 1fr));
}

.ayhl-grid--2 { --ayhl-grid-min: 24rem; }
.ayhl-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ayhl-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 64rem) {
	.ayhl-grid--3,
	.ayhl-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 40rem) {
	.ayhl-grid--3,
	.ayhl-grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Prose (long-form editorial content) ---------- */
.ayhl-prose {
	color: var(--ayhl-color-text-body);
	font-size: var(--ayhl-text-md);
	line-height: var(--ayhl-leading-relaxed);
}

.ayhl-prose > * {
	margin-top: 0;
	margin-bottom: 0;
}

.ayhl-prose > * + * {
	margin-top: 1.25em;
}

.ayhl-prose :is(h2, h3, h4, h5, h6) {
	margin-top: 2em;
	margin-bottom: 0;
}

.ayhl-prose :is(h2, h3, h4, h5, h6) + * {
	margin-top: 0.75em;
}

.ayhl-prose > :first-child {
	margin-top: 0;
}

.ayhl-prose h2 {
	font-size: var(--ayhl-text-2xl);
	text-transform: uppercase;
}

.ayhl-prose h3 {
	font-size: var(--ayhl-text-xl);
}

.ayhl-prose h4 {
	font-size: var(--ayhl-text-lg);
}

.ayhl-prose a:not([class]) {
	font-weight: 550;
	text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

.ayhl-prose a:not([class]):hover {
	text-decoration-color: currentColor;
}

.ayhl-prose :is(ul, ol) {
	padding-left: 1.35em;
}

.ayhl-prose li + li {
	margin-top: 0.4em;
}

.ayhl-prose ul li::marker {
	color: var(--ayhl-color-accent);
}

.ayhl-prose ol li::marker {
	color: var(--ayhl-color-primary);
	font-weight: 700;
}

.ayhl-prose blockquote {
	margin-inline: 0;
	padding: 0.25em 0 0.25em 1.25em;
	border-left: 4px solid var(--ayhl-color-accent);
	color: var(--ayhl-color-heading);
	font-family: var(--ayhl-font-display);
	font-size: var(--ayhl-text-xl);
	font-style: italic;
	font-weight: 600;
	line-height: var(--ayhl-leading-snug);
}

.ayhl-prose blockquote cite {
	display: block;
	margin-top: 0.75em;
	color: var(--ayhl-color-text-muted);
	font-family: var(--ayhl-font-body);
	font-size: var(--ayhl-text-sm);
	font-style: normal;
	font-weight: 600;
}

.ayhl-prose figure {
	margin-inline: 0;
}

.ayhl-prose img {
	border-radius: var(--ayhl-radius-md);
}

.ayhl-prose figcaption {
	margin-top: 0.6em;
	color: var(--ayhl-color-text-subtle);
	font-size: var(--ayhl-text-sm);
	line-height: var(--ayhl-leading-snug);
}

.ayhl-prose code {
	padding: 0.1em 0.35em;
	border-radius: var(--ayhl-radius-xs);
	background: var(--ayhl-gray-100);
	font-family: var(--ayhl-font-mono);
	font-size: 0.9em;
}

/* ---------- Spacing utilities ---------- */
.ayhl-mt-0 { margin-top: 0 !important; }
.ayhl-mt-4 { margin-top: var(--ayhl-space-4) !important; }
.ayhl-mt-6 { margin-top: var(--ayhl-space-6) !important; }
.ayhl-mt-8 { margin-top: var(--ayhl-space-8) !important; }
.ayhl-mb-0 { margin-bottom: 0 !important; }
.ayhl-mb-6 { margin-bottom: var(--ayhl-space-6) !important; }

/* ---------- Accessibility helpers ---------- */
.screen-reader-text,
.ayhl-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 0.5rem;
	left: 0.5rem;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0.75rem 1.25rem;
	clip: auto;
	clip-path: none;
	border-radius: var(--ayhl-radius-sm);
	background: var(--ayhl-gray-0);
	box-shadow: var(--ayhl-shadow-lg);
	color: var(--ayhl-navy-900);
	font-weight: 700;
	text-decoration: none;
}

@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;
	}
}
