h1, h2, p, a, section, ul, li {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	list-style: none;
}

html {
	min-height: 100%;
	background: #F8F8F8; /* safari overscroll colour */
}

body {
	font: 1rem sans-serif;
	color: #444444;
	text-align: center;
	padding: 3rem 2rem 10rem;
	box-sizing: border-box;
	min-height: 100vh;
	margin: 0;
	background: linear-gradient(to bottom, #DDEEFF, #F8F8F8);
}

/* top/bottom overscroll colour (works in Chrome & Firefox, but not Safari) */
body::before {
	content: "";
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to bottom, #DDEEFF 30%, #F8F8F8 70%);
	z-index: -1;
}

h1 {
	margin: 0 0 2rem;
	font: bolder 2rem sans-serif;
}

h2 {
	margin: 0 0 1rem;
	font: bolder 1.5rem sans-serif;
}

section {
	margin-bottom: 2rem;
}

li {
	margin-bottom: 0.5rem;
}

.item {
	--col: white;
	--outlinecol: #0050C0;
	display: block;
	color: inherit;
	text-decoration: none;
	border-radius: 5px;
	max-width: 26rem;
	margin: 0 auto 1rem;
}
.item>section {
	padding: 1.5rem;
	border-radius: 5px;
	background: var(--col);
	transition: 0.2s ease background, 0.2s ease transform;
	margin: 0;
}
.item:active>section, a.item:hover>section {
	transform: scale(0.95);
}
.item:focus {
	outline: none;
	box-shadow: 0 0 0 2px var(--outlinecol);
}
.item .info {
	margin: 0 0 1rem;
	line-height: 1.4;
}
.item .link {
	font-size: 0.8rem;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.item:link .link, .item:visited .link {
	color: #4466AA;
	text-decoration: underline;
}
.item:active .link, a.item:hover .link {
	color: #333333;
	text-decoration: underline;
}
a.item:hover {
	--col: var(--hover-col);
}

@media (min-width: 46rem) {
	.itemlist {
		--size: 9rem;
		--space: 0.5rem;
		display: grid;
		justify-content: center;
		margin-top: -4.5rem;
	}

	.spacer {
		display: none;
		height: calc(var(--size) * 0.866025403784439 + var(--space));
	}

	.item {
		--grow: 0px;
		grid-row-end: span 2;
		position: relative;
		margin: var(--space) calc(var(--size) * 0.25 + var(--space) * 0.866025403784439 - var(--grow));
		width: calc(var(--size) + var(--grow) * 2);
		height: calc(var(--size) * 1.732050807568877);
		border-radius: 0;
		z-index: 1;
	}
	.item>section {
		position: absolute;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 2rem 0;
		border-radius: 0;
		top: 0;
		left: var(--grow);
		right: var(--grow);
		bottom: 0;
		z-index: 1;
	}
	.item>section, .item>section::before, .item>section::after {
		background: var(--col);
		transition: 0.2s ease background, 0.2s ease transform;
	}
	.item::before, .item::after, .item>section::before, .item>section::after {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: -1;
	}
	.item::before, .item>section::before {
		transform: rotate(60deg);
	}
	.item::after, .item>section::after {
		transform: rotate(-60deg);
	}

	.item h2 {
		margin: 0 -0.8rem;
		min-height: 3rem;
	}
	.item .info {
		margin: 0 -2.5rem;
	}
	.item .link {
		margin: 0 -2rem;
		min-height: 3rem;
		padding-top: 0.25rem;
	}
	.item:focus {
		--grow: 4px;
	}
	.item:focus, .item:focus::before, .item:focus::after {
		box-shadow: 0 -5px 0 -3px var(--outlinecol), 0 5px 0 -3px var(--outlinecol);
	}
}

@media (min-width: 46rem) {
	.itemlist {
		grid-template-columns: repeat(3, max-content);
	}
	.spacer:nth-of-type(2) { display: block; }
}

@media (min-width: 76rem) {
	.itemlist {
		grid-template-columns: repeat(5, max-content);
	}
	.spacer:nth-of-type(1) { display: block; }
	.spacer:nth-of-type(2) { display: block; }
	.spacer:nth-of-type(3) { display: block; }
}

.error header {
	margin: 2rem 0 3rem;
}

.error header p {
	font-size: 0.6rem;
	color: #888888;
}

a:link:not(.item), a:visited:not(.item) {
	color: #4466AA;
	text-decoration: underline;
}
a:active:not(.item), a:hover:not(.item) {
	color: #6699BB;
	text-decoration: none;
}

a.item:nth-of-type(8n + 1) { --hover-col: #AACCFF; }
a.item:nth-of-type(8n + 2) { --hover-col: #BBAAFF; }
a.item:nth-of-type(8n + 3) { --hover-col: #EEAAFF; }
a.item:nth-of-type(8n + 4) { --hover-col: #FFAAAA; }
a.item:nth-of-type(8n + 5) { --hover-col: #FFCCAA; }
a.item:nth-of-type(8n + 6) { --hover-col: #FFEEAA; }
a.item:nth-of-type(8n + 7) { --hover-col: #BBEEAA; }
a.item:nth-of-type(8n + 8) { --hover-col: #AAEEFF; }
