/**
 * Reset, document, typography, layout primitives.
 *
 * UA resets are wrapped in :where() so they carry zero specificity and any
 * component rule wins without an arms race.
 */

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

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

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

:where(img, svg, video, iframe) {
	display: block;
	max-width: 100%;
}

:where(img) {
	height: auto;
}

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

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	font-weight: 400;
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

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

h1 {
	font-size: var(--fs-h1);
	line-height: var(--lh-display);
}

h2 {
	font-size: var(--fs-h2);
}

h3 {
	font-size: var(--fs-h3);
	line-height: var(--lh-title);
	letter-spacing: -0.014em;
}

p {
	text-wrap: pretty;
}

a {
	color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	transition: color var(--t-fast) var(--ease);
}

a:hover {
	color: var(--ink);
}

strong {
	font-weight: 700;
}

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

:focus-visible {
	outline: none;
	box-shadow: var(--ring);
	border-radius: var(--r-sm);
}

/* ---------- Layout primitives ---------- */

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

.ci-section {
	padding-block: var(--sp-section);
	position: relative;
}

.ci-section--tight {
	padding-block: clamp(48px, 5vw, 80px);
}

.ci-section--alt {
	background: var(--surface-alt);
}

/* A single 2px ink rule, one of the four places the gradient is allowed. */
.ci-rule {
	height: 2px;
	border: 0;
	background: var(--grad-ink);
	opacity: 0.75;
}

.ci-kicker {
	font-family: var(--font-display);
	font-size: var(--fs-kicker);
	font-weight: 500;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: var(--sp-sm);
}

.ci-head {
	max-width: 46ch;
	margin-bottom: var(--sp-lg);
}

.ci-head--center {
	margin-inline: auto;
	text-align: center;
}

.ci-head__text {
	margin-top: var(--sp-md);
	color: var(--ink-muted);
	font-size: var(--fs-lead);
	max-width: var(--measure);
}

.ci-head--center .ci-head__text {
	margin-inline: auto;
}

.ci-accent {
	font-style: normal;
	background: var(--grad-ink);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	padding-bottom: 0.06em;
}

.ci-prose {
	max-width: var(--measure);
	color: var(--ink-muted);
}

.ci-prose > * + * {
	margin-top: var(--sp-md);
}

.ci-prose h2,
.ci-prose h3 {
	color: var(--ink);
	margin-top: var(--sp-lg);
}

.ci-prose ul {
	list-style: none;
	display: grid;
	gap: var(--sp-xs);
}

.ci-prose li {
	position: relative;
	padding-left: 1.6rem;
}

.ci-prose li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.66em;
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: var(--accent);
}

.ci-prose a {
	text-decoration: underline;
}

/* ---------- Accessibility ---------- */

.ci-skip {
	position: absolute;
	left: var(--gutter);
	top: -100px;
	z-index: 999;
	background: var(--accent);
	color: var(--accent-ink);
	padding: 12px 20px;
	border-radius: var(--r-pill);
	font-weight: 700;
	transition: top var(--t-fast) var(--ease);
}

.ci-skip:focus {
	top: 16px;
	color: var(--accent-ink);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Scroll reveal ----------
   Hidden only when JS has confirmed it is running, so no-JS, crawlers and
   print all render the content visible. */

.js .ci-reveal {
	opacity: 0;
	transform: translate3d(0, 18px, 0);
	transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

.js .ci-reveal.is-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.js .ci-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
