/*
 * Reset, element typography, global utilities. Nothing component specific.
 */

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

* {
	margin: 0;
}

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

/* A column, so the strip sits at the foot of a short page. */
body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100svh;
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--font-4);
	font-weight: var(--weight-regular);
	line-height: var(--leading);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-wrap: pretty;
}

main {
	flex: 1;
}

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

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

/* --------------------------------------------------------------------------
 * Headings
 * ----------------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--color-heading);
	font-family: var(--font-display);
	font-weight: var(--weight-bold);
	line-height: var(--leading-heading);
	text-wrap: balance;
}

h1 {
	font-size: var(--font-8);
}

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

h3,
h4,
h5,
h6 {
	font-size: var(--font-4);
}

/* --------------------------------------------------------------------------
 * Flow
 * ----------------------------------------------------------------------- */

p,
ul,
ol,
dl,
blockquote,
figure,
table {
	margin-block-end: var(--space-3);
}

:is(p, ul, ol, dl, blockquote, figure, table):last-child {
	margin-block-end: 0;
}

h2,
h3,
h4 {
	margin-block-start: var(--space-4);
}

/* A heading that opens a container takes its spacing from the container. */
:is(h1, h2, h3, h4, h5, h6):first-child {
	margin-block-start: 0;
}

h1 + p {
	margin-block-start: var(--space-2);
}

/* --------------------------------------------------------------------------
 * Links
 * ----------------------------------------------------------------------- */

a {
	color: var(--color-link);
	text-decoration-thickness: max(0.06em, var(--border-hairline));
	text-underline-offset: 0.16em;
	transition: color var(--duration) var(--ease);
}

a:hover,
a:focus-visible {
	color: var(--color-link-hover);
}

/* --------------------------------------------------------------------------
 * Focus
 *
 * No border-radius here. Setting one changes the element's own geometry while it happens to be
 * focused. The outline traces whatever radius the component already has.
 * ----------------------------------------------------------------------- */

:focus-visible {
	outline: var(--focus-width) solid var(--focus-color);
	outline-offset: var(--focus-offset);
}

.skip-link {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 50%;
	z-index: 100;
	padding: var(--space-1) var(--space-3);
	background-color: var(--llm-ink);
	color: var(--llm-white);
	font-size: var(--font-3);
	text-decoration: none;
	border-end-start-radius: var(--radius-sm);
	border-end-end-radius: var(--radius-sm);
	/* A pixel further than its own height, or a fractional height leaves a sliver showing. */
	transform: translate(-50%, calc(-100% - 1px));
}

.skip-link:focus {
	color: var(--llm-white);
	transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
 * Layout utilities
 * ----------------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

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

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

.visually-hidden,
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
 * Motion guard, last
 * ----------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
