:root {
	--serif: Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
	--sans-serif: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
	--monospace: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;

	--blue-light: #3398da;
	--blue-darker: #2077b1;
	--green-light: #33da6e;
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
}

html {
	background: white;
	color: black;
}

body {
	font-family: var(--sans-serif);
	line-height: 1.42;
	font-size: clamp(1rem, 0.7rem + 0.75vw, 1.65rem);
	font-weight: 300;
}

:is(main, header) :is(h1, h2, h3) {
	font-family: var(--serif);
}

header {
	display: grid;
	place-content: center;
	height: 90vh;
	height: 90dvh;
	margin-bottom: 10vh;
	margin-bottom: 10dvh;
	gap: 2.5vmin;
}
header img {
	display: block;
	height: 20rem;
	max-height: 50vw;
	width: auto;
	margin: 0 auto;
}
header h1 {
	margin: 0;
	font-size: 2.5em;
	text-align: center;
	line-height: 1;
	max-width: 80vw;
}
header h1 em {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.4em;
	line-height: 1.2;
}

main h2 {
	margin-top: 4em;
	border-bottom: 1px solid #333;
	display: flex;
	align-items: center;
	gap: 0.2em;
}

a, a:visited {
	color: var(--blue-light);
}
a:hover {
	color: var(--blue-darker);
}

a[name] {
	color: inherit;
	text-decoration: none;
	font-size: 0.8em;
}

main, footer {
	max-width: 90rem;
	padding: 2em;
	margin: 0 auto;
}

footer {
	text-align: center;
	font-style: italic;
}

.cards {
	width: 100%;

	/* @ref https://css-tricks.com/an-auto-filling-css-grid-with-max-columns/ */
	--grid-layout-gap--vertical: 5em;
	--grid-layout-gap--horizontal: 3em;
	--grid-max-column-count: 4;
	--grid-item--min-width: 14em;

	--gap-count: calc(var(--grid-max-column-count) - 1);
	--total-gap-width: calc(var(--gap-count) * var(--grid-layout-gap--horizontal));
	--grid-item--max-width: calc((100% - var(--total-gap-width)) / var(--grid-max-column-count));

	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(max(var(--grid-item--min-width), var(--grid-item--max-width)), 1fr));
	grid-gap: var(--grid-layout-gap--vertical) var(--grid-layout-gap--horizontal);
}

.card {
	display: grid;
	gap: 0.75em;
	grid-template-areas:
	  "title title"
	  "cover cover"
	  "description description"
	  "link1 link2";
	grid-template-rows: 3em auto 5em auto;
	padding: 0.75em;
}

.card[data-pick] {
	outline: 0.2em dotted hotpink;
}

.card:target {
	background: #33da6d2a;
	outline: 0.2em dotted var(--green-light);
}

.card:hover, .card:focus-within {
	background: #f0f8ffa3;
	outline: 0.2em dotted var(--blue-light);
}

.card--tool {
	grid-template-areas:
	  "title title"
	  "cover cover"
	  "link";
	grid-template-rows: 3em auto auto;
}

.card * {
	margin: 0;
}

.card h3 {
	grid-area: title;
	margin: 0;
	align-self: end;
	font-size: 1.1em;
}
.card :is(img, video) {
	grid-area: cover;
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	position: relative;
	filter: brightness(1.1) grayscale();
	background: #ccc;
	border: 1px solid #333;
}
.card:hover :is(img, video),
.card:has(.button:focus) :is(img, video) {
	filter: none;
}

.card img::after {
	content: '😵 \A [NO PREVIEW]';
	white-space: pre;
	font-size: 2em;
	filter: brightness(1.1) grayscale();
	background: #ccc;
	display: grid;
	position: absolute;
	inset: 0;
	place-content: center;
	text-align: center;
	color: #888;
}
.card p {
	grid-area: description;
	align-self: self-start;
}

main .button {
	border-radius: 0.5em;
	padding: 0.7em;
	text-decoration: none;
	text-transform: uppercase;
	border: 2px solid currentcolor;
	background-color: aliceblue;
	color: var(--blue-light);
	font-size: 0.8em;
	white-space: nowrap;
	text-align: center;
}

main .button:not([disabled]):is(:hover,:active,:focus) {
	color: var(--blue-darker);
	outline: 0px solid;
}

main .button--special {
	background-color: lightyellow;
	color: goldenrod;
}
main .button--special:not([disabled]):is(:hover,:active,:focus) {
	color: darkgoldenrod;
}

main .button[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
	background-color: #ccc;
	color: #333;
}

.cta {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	margin-top: 2em;
	gap: 2rem;
	justify-content: center;
}

.cta .button {
	border-width: 4px;
	font-weight: bold;
}


.youtube {
	width: 100%;
	height: auto;
	aspect-ratio: 560 / 315;
	display: block;
	max-width: 800px;
	margin: 0 auto;
}
