@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,700;1,8..60,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@500;600;700&display=swap');

@font-face {
	font-family: "Nunito Sans";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: local("Nunito Sans"),
		 url("../fonts/nunito-sans.woff2") format("woff2"),
		 url("../fonts/nunito-sans.woff") format("woff"),
		 url("../fonts/nunito-sans.ttf") format("ttf");
}

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

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

:root {
	--gray: hsl(0, 0%, 85%);
	--subtitle: hsl(0, 0%, 45%);
}

html {
	font-size: 62.5%;
	scroll-behavior: smooth;
}

body {
	font-size: 1.55rem;
	font-family: "Source Serif 4", serif;
	line-height: 1.55;
	color: hsl(0, 0%, 30%);
	background-color: hsl(0, 0%, 99%);
	max-width: 95ch;
	padding: 0 2.5rem;
	margin: 4rem auto;
}

header {
	text-align: center;
	padding-bottom: 3rem;
	margin-bottom: 3.5rem;
	border-bottom: 0.1rem solid var(--gray);
}

main section + section {
	margin-top: 2.5rem;
}

footer {
	display: flex;
	justify-content: center;
	padding-top: 3rem;
	margin-top: 4rem;
	margin-bottom: -1.5rem;
	border-top: 0.1rem solid var(--gray);
}

/* Typography */
h1, h2, h3 {
	font-family: "Lora", sans-serif;
	scroll-margin-top: 1rem;
	line-height: 1;
}

h1 {
	line-height: 1.1;
}

h1 + * {
	margin-top: 1.5rem;
}

* + h2, * + h3 {
	margin-top: 2.5rem;
}

h2 + *, h3 + *,
section p + p {
	margin-top: 1rem;
}

p {
	hyphens: auto;
}

p:has(small) {
	line-height: 1.3;
}

a, a:visited {
	color: hsl(0, 0%, 25%);
}

a:is(:hover, :focus-visible) {
	color: hsl(0, 0%, 0%);
}

q {
	font-style: italic;
}

.center {
	text-align: center;
}

.break-all {
	word-break: break-all;
}

/* Containers */
hr {
	margin-block: 3rem;
	border: 0;
	border-top: 0.1rem solid var(--gray);
}

flex, .flex {
	display: flex;
	flex-flow: row wrap;
}

.justify-center {
	justify-content: center;
}

grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.hidden {
	display: none;
}

.block {
	display: block;
}

.subtitle {
	color: hsl(0, 0%, 50%);
}

/* Lists */
ul, ol, dd {
	padding-left: 1.45rem;
	margin-block: 1rem;
}

dd + dt {
	margin-top: 3rem;
}

/* Details */
details {
	padding-left: 2.5rem;
	padding: 0 1rem 2rem 2.5rem;
}

details[open],
details:last-of-type {
	padding-bottom: 1rem;
}

details[open]:last-of-type {
	padding-bottom: 0.1rem;
}

details summary {
	cursor: pointer;
	list-style-position: outside;
}

summary + * {
	margin-top: 0.5rem;
}

/* Images */
figure {
	display: flex;
	justify-content: center;
	flex-flow: row wrap;
	margin-block: 2rem;
}

figure > a {
	display: block;
}

figure > a > img {
	display: block;
}

figure figcaption {
	font-size: 1.35rem;
	text-align: center;
	width: 100%;
}

img {
	width: 50ch;
	max-width: 100%;
}

/* Icons */
.icon {
	margin: 0;
	max-width: 2.5rem;
	filter: invert(1) opacity(0.75);
	transition: 250ms;
}

.icon:hover, a:focus .icon {
	filter: invert(1) opacity(0.65);
}

footer .icon {
	max-width: 2.25rem;
}

/* Code */
code {
	position: relative;
	bottom: 0.1rem;
	font-size: 1.2rem;
	line-height: 1.4;
	padding: 0.3rem 0.5rem;
	border-radius: 0.3rem;
	color: hsl(0, 0%, 0%);
	background-color: hsl(0, 0%, 88%);
}

.gist {
	margin: 2rem 0;
}

.gist table {
	width: 100%;
}

.gist-file, .gist-data {
	border-radius: 0 !important;
}

/* Embed */
.embed {
	max-width: 45ch;
	display: block;
	margin: 3.25rem auto 2rem;
}

.embed > div {
	position: relative;
	margin: 1rem 0;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	max-width: 100%;
}

.embed iframe,
.embed object,
.embed embed {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* Blockquote */
blockquote {
	position: relative;
	padding: 1.5rem 1rem;
	margin: 2.25rem 2.5rem 2rem 2.5rem;
	border: solid hsl(0, 0%, 85%);
	border-width: 0.2rem 0;
	font-style: italic;
}

blockquote::before {
	content: "\201C";
	position: absolute;
	top: 1.5rem;
	left: 50%;
	width: 6.5rem;
	height: 2rem;
	font-size: 8rem;
	font-family: "Nunito Sans";
	font-style: normal;
	line-height: 0.5;
	text-align: center;
	color: hsl(0, 0%, 45%);
	background: hsl(0, 0%, 99%);
	transform: translate(-50%, -85%);
}

blockquote + figcaption {
	margin: 0 0 0.5rem 2.5rem;
	text-align: left;
}