/* Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
	box-sizing: border-box;
}

/* Add spacing between content and its focus outline */
:focus-visible {
	outline-offset: 3px;
}

html {
	/* Prevent font size inflation when rotating from portrait to landscape */
	-moz-text-size-adjust: none;
	-webkit-text-size-adjust: none;
	text-size-adjust: none;
	/* Prevent the page from “jumping” when switching from a long to a short page */
	scrollbar-gutter: stable;
}

/* Remove default margins in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
h5,
h6,
address,
p,
hr,
pre,
blockquote,
ol,
ul,
li,
dl,
dt,
dd,
figure,
figcaption,
div,
table,
caption,
form,
fieldset {
	margin: 0;
}

/* Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
	html {
		interpolate-size: allow-keywords;
	}
}

/* Remove list styles on ul, ol elements with a class */
:is(ul, ol)[class] {
	list-style-type: "";
	padding-inline-start: 0;
}

/* Defines whether a browser scrolls smoothly to a fragment identifier */
html:focus-within {
	scroll-behavior: smooth;
}

/* Set some sensible defaults that can be used throughout the whole web page */
body {
	-webkit-font-smoothing: auto;
	line-height: 1.5;
	min-block-size: 100vh;
	-moz-osx-font-smoothing: auto;
	font-feature-settings: "liga" 1, "tnum" 1;
	font-optical-sizing: auto;
	font-smooth: auto;
	hanging-punctuation: first allow-end last;
	text-decoration-skip-ink: auto;
	text-rendering: optimizeLegibility;
}

/* Set shorter line heights on interactive elements */
button,
input,
label {
	line-height: 1.1;
}

/* Avoid text overflows and improve line wrapping */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

p {
	text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
	text-wrap: balance;
}

/* Improve media defaults */
img,
picture,
video,
canvas,
svg {
	display: block;
	max-inline-size: 100%;
}

/* Inherit font styling in form elements */
input,
button,
textarea,
select {
	font-family: inherit;
	font-size: inherit;
}

/* Increase the block-size of textareas */
textarea:not([rows]) {
	min-block-size: 6em;
}

/* Adds extra margin above an element when it’s snap scrolled to */
:target {
	scroll-margin-block-start: 1.5rem;
}

/* Animations and transitions are reduced for people who choose that option on their device */
@media (prefers-reduced-motion: reduce) {
	html:focus-within {
		animation-duration: 1ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto;
		transition-duration: 1ms !important;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
