/* Site base: fonts, type, grid, links and focus. Every value comes from /token.css. */

@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('/font/inter-400.woff2') format('woff2');
}
@font-face {
	font-family: 'Inter';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('/font/inter-600.woff2') format('woff2');
}
@font-face {
	font-family: 'Montserrat';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('/font/montserrat-600.woff2') format('woff2');
}
/* Arial sized to the metrics of each face, so the swap to the web font barely moves the text. */
@font-face {
	font-family: 'Inter Fallback';
	src: local('Arial'), local('ArialMT');
	size-adjust: 104.32%;
	ascent-override: 92.86%;
	descent-override: 23.12%;
	line-gap-override: 0%;
}
@font-face {
	font-family: 'Montserrat Fallback';
	src: local('Arial'), local('ArialMT');
	size-adjust: 112.63%;
	ascent-override: 85.95%;
	descent-override: 22.29%;
	line-gap-override: 0%;
}

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

/* The brand's font stacks with the metric-matched fallbacks above. */
:root {
	--font-display: 'Montserrat', 'Montserrat Fallback', var(--m-font-display);
	--font-body: 'Inter', 'Inter Fallback', var(--m-font-body);
}

html {
	background: var(--m-paper);
	color: var(--m-ink);
	text-size-adjust: 100%;
}

body {
	display: flex;
	flex-direction: column;
	min-block-size: 100svh;
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--m-text-base);
	font-weight: 400;
	line-height: 1.5;
}

h1,
h2 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.15;
	text-wrap: balance;
}
h1 {
	margin-block: 0 var(--m-space-6);
	font-size: var(--m-text-2xl);
	letter-spacing: -0.02em;
}
h2 {
	margin-block: 0 var(--m-space-5);
	font-size: var(--m-text-lg);
}
@media (min-width: 48rem) {
	h1 {
		font-size: var(--m-text-3xl);
	}
	h2 {
		font-size: var(--m-text-xl);
	}
}
@media (min-width: 64rem) {
	h1 {
		font-size: var(--m-text-display);
	}
}

/* A hyphenated compound in a heading breaks at its hyphen only on narrow screens. */
@media (min-width: 48rem) {
	.compound {
		white-space: nowrap;
	}
}

p,
ol,
ul,
dl {
	margin-block: 0 var(--m-space-4);
}
p,
li,
dd {
	max-inline-size: var(--m-measure);
}

a {
	color: var(--m-ink);
	text-decoration-line: underline;
	text-decoration-color: currentColor;
	text-decoration-thickness: var(--m-line-hair);
	text-underline-offset: var(--layout-underline-offset);
	transition: text-decoration-color var(--m-motion-fast);
}
a:hover {
	text-decoration-thickness: var(--m-line-strong);
}
:focus-visible {
	outline: var(--m-line-strong) solid var(--m-ink);
	outline-offset: var(--m-line-strong);
}

.lead {
	color: var(--m-ink-2);
	font-size: var(--m-text-md);
}

/* The page grid: 4, 8 and 12 columns; every block spans all columns until 64rem, then its own span. It fills the height a short page leaves, so the footer sits at the bottom. */
.grid {
	flex: 1 0 auto;
	align-content: start;
	display: grid;
	grid-template-columns: repeat(var(--layout-columns), minmax(0, 1fr));
	column-gap: var(--layout-gutter);
	padding-inline: var(--layout-margin);
}
.grid > * {
	grid-column: 1 / -1;
}
@media (min-width: 64rem) {
	.grid > .span-8 {
		grid-column: 1 / span 8;
	}
	.grid > .span-9 {
		grid-column: 1 / span 9;
	}
}

/* Vertical rhythm between page blocks: steps of the brand's space scale. */
.space-7 {
	margin-block-end: var(--m-space-7);
}
.space-8 {
	margin-block-end: var(--m-space-8);
}
.space-9 {
	margin-block-end: var(--m-space-9);
}
.grid > :last-child {
	margin-block-end: 0;
}

dt {
	font-weight: 600;
}
dd {
	margin-inline-start: 0;
	margin-block-end: var(--m-space-3);
}

@media (forced-colors: active) {
	:focus-visible {
		outline-color: CanvasText;
	}
}

@media print {
	a {
		overflow-wrap: anywhere;
	}
	a[href^='http']::after,
	a[href^='mailto:']::after {
		content: ' (' attr(href) ')';
	}
	a[href^='/']:not(.home)::after {
		content: ' (https://mightreya.com' attr(href) ')';
	}
}
