body {
	font-size: 0;
	background-color: black;
	background-image: url("/image/main_hexagon_bg.svg");
	background-repeat: repeat;
	background-size: 60% auto; /* 2/5 * 1.5 */
	background-position: 0 3vw;
}
label.navictrl {
	top: 5vw;
	left: 50%;
	width: 10vw;
	transform: translateX(-50%);
	z-index: 5;
}
#overview_bg {
	position: absolute;
	display: block;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: black;
}
#overview {
	position: absolute;
	display: block;
	top: 0;
	left: 0;
	width: 100%;
	height: calc(100% - 3vw);
	padding: 3vw 0 0 0;
	opacity: 1;
	background-image: url("/image/main_hexagon.svg");
	background-repeat: repeat;
	background-size: 60% auto; /* 2/5 * 1.5 */
	background-position: 0 3vw;
	transition: opacity 0.5s;
	z-index: 1;
}
#navictrl:checked ~ #overview_bg #overview {
	opacity: 0.4;
}
.line {
	height: 1vw;
	z-index: 6;
}
.line:nth-child(1) {
	top: 1vw;
}
.line:nth-child(2) {
	top: 4.5vw;
}
.line:nth-child(3) {
	top: 8vw;
}
#navictrl:checked + .navictrl .line:nth-child(1) {
	transform: translateY(3.5vw) rotate(-45deg);
}
#navictrl:checked + .navictrl .line:nth-child(3) {
	transform: translateY(-3.5vw) rotate(45deg);
}
nav.topmenu {
	top: 14vw;
}
.topic {
	position: relative;
	display: inline-block;
	width: 39.2%; /* 2/5 * 0.98 */
	aspect-ratio : 1.1547;
	margin: 0.3464vw 0 -16.9736vw 20.8%; /* 1/5 * 0.866 * 0.02 ; 0 ; -1/5 * 0.866 * 0.98 ; 1/5 * 1.04 */
	overflow: hidden;
	background: white;
	z-index: 10;
}
.topic div {
	position: absolute;
	top: 1%;
	left: 1%;
	width: 98%;
	height: 98%;
	filter: none;
	transition: filter 0.5s;
	background-color: black;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}
.topic .contain {
	background-size: contain;
}
.topic a {
	position: absolute;
	display: flex;
	top: 1%;
	left: 13%;
	width: 74%;
	height: 98%;
	align-items: center;
	justify-content: center;
	font-size: 3.5vw;
	font-weight: bold;
	text-decoration: none;
	text-align: center;
	overflow-wrap: break-word;
	color: white;
	visibility: hidden;
	opacity: 0;
	transition: visibility 0s 0.5s, opacity 0.5s;
}
.topic:hover div {
	filter: grayscale(1) brightness(0.3);
	transition: filter 0.5s 0.1s;
}
.topic:hover a {
	visibility: visible;
	opacity: 1;
	transition: visibility 0s 0.1s, opacity 0.5s 0.1s;
}
.topic .permanent {
	filter: grayscale(1) brightness(0.3);
	transition: none;
}
.topic .permanent ~ a {
	visibility: visible;
	opacity: 1;
	transition: visibility 0s 0.1s, opacity 0.5s 0.1s;
}
.topic:hover .permanent {
	transition: none;
}
#navictrl:checked ~ #overview_bg #overview .topic {
	filter: grayscale(1) brightness(0.25);
	transition: filter 0.5s;
}
#navictrl:checked ~ #overview_bg #overview .topic:hover div {
	filter: none;
}
#navictrl:checked ~ #overview_bg #overview .topic:hover a {
	visibility: hidden;
}
#navictrl:checked ~ #overview_bg #overview .topic .permanent ~ a {
	visibility: hidden;
	opacity: 0;
}

@media (max-aspect-ratio: 0.8) or (width < 480px) { /* default portrait mode, nth-of-types all here so that they do not need to be overriden later */
	.topic:nth-of-type(3n+1) {
		margin-left: 0.4%; /* 1/5 * 0.02 */
	}
	.topic:nth-of-type(3n) {
		margin-left: 30.4%; /* 2/5 * 0.76 */
	}
}

@media (0.8 < aspect-ratio < 1.2) and (min-width: 480px) { /* square mode */
	body, #overview {
		background-size: 37.5% auto; /* 1/4 * 1.5 */
		background-position: 30% 3vw; /* 1/4 * 0.75 / (1 - 1/4 * 1.5) * 100 */
	}
	label.navictrl {
		top: 3vw;
		left: 6%;
		width: 7vw;
		transform: none;
	}
	.line {
		left: 0.5vw;
		height: 0.5vw;
		width: 6vw;
	}
	.line:nth-child(1) {
		top: 1vw;
	}
	.line:nth-child(2) {
		top: 3vw;
	}
	.line:nth-child(3) {
		top: 5vw;
	}
	#navictrl:checked + .navictrl .line:nth-child(1) {
		transform: translateY(2vw) rotate(-45deg);
	}
	#navictrl:checked + .navictrl .line:nth-child(3) {
		transform: translateY(-2vw) rotate(45deg);
	}
	nav.topmenu {
		top: 9vw;
	}
	.topic {
		width: 24.5%; /* 1/4 * 0.98 where 1/4 is two times 1/8 */
		margin: 0.2165vw 0 -10.6085vw 13%; /* 1/8 * 0.866 * 0.02 ; 0 ; -1/8 * 0.866 * 0.98 ; 1/8 * 1.04 */
	}
	.topic a {
		font-size: 2.2vw;
	}
	.topic:nth-of-type(5n+3) {
		margin-left: 0.25%; /* 1/8 * 0.02 */
	}
	.topic:nth-of-type(5n+1) {
		margin-left: 19%; /* 1/4 * 0.76 */
	}
}

@media (1.2 <= aspect-ratio < 2.49) and (min-width: 480px) { /* landscape mode */
	body, #overview {
		background-size: 31.575% auto; /* 10.525% * 2 * 1.5 */
		background-position: 23.0727% 3vw; /* 10.525% * 2 * 0.75 / (1 - 10.525% * 2 * 1.5) * 100 */
	}
	label.navictrl {
		top: 3vw;
		left: 4%;
		width: 6vw;
		transform: none;
	}
	.line {
		left: 1vw;
		height: 0.5vw;
		width: 5vw;
	}
	.line:nth-child(1) {
		top: 1vw;
	}
	.line:nth-child(2) {
		top: 2.5vw;
	}
	.line:nth-child(3) {
		top: 4vw;
	}
	#navictrl:checked + .navictrl .line:nth-child(1) {
		transform: translateY(1.5vw) rotate(-45deg);
	}
	#navictrl:checked + .navictrl .line:nth-child(3) {
		transform: translateY(-1.5vw) rotate(45deg);
	}
	nav.topmenu {
		top: 0;
		left: 15vw;
	}
	.topic {
		width: 20.629%; /* 10.525% * 2 * 0.98 where 10.525% is roughly 100% / 9.5 */
		margin: 0.182293vw 0 -8.932357vw 10.946%; /* 10.525vw * 0.866 * 0.02 ; 0 ; -10.525vw * 0.866 * 0.98 ; 10.525% * 1.04 */
	}
	.topic a {
		font-size: 1.8vw;
	}
	.topic:nth-of-type(6n+4) {
		margin-left: 0.2105%; /* 10.525% * 0.02 */
	}
	.topic:nth-of-type(6n+1) {
		margin-left: 15.998%; /* 10.525% * 2 * 0.76 */
	}
}

@media (2.49 <= aspect-ratio < 4.57) and (min-width: 480px) { /* ultra wide mode */
	body, #overview {
		background-size: 24% auto; /* 16% * 1.5 */
		background-position: 15.7895% 1vw; /* 16% * 0.75 / (1 - 16% * 1.5) * 100 */
	}
	#overview {
		height: calc(100% - 1vw);
		padding: 1vw 0 0 0;
	}
	label.navictrl {
		top: 0.5vw;
		left: 3%;
		width: 6vw;
		transform: none;
	}
	.line {
		left: 1vw;
		height: 0.5vw;
		width: 5vw;
	}
	.line:nth-child(1) {
		top: 1vw;
	}
	.line:nth-child(2) {
		top: 2.5vw;
	}
	.line:nth-child(3) {
		top: 4vw;
	}
	#navictrl:checked + .navictrl .line:nth-child(1) {
		transform: translateY(1.5vw) rotate(-45deg);
	}
	#navictrl:checked + .navictrl .line:nth-child(3) {
		transform: translateY(-1.5vw) rotate(45deg);
	}
	nav.topmenu {
		top: 0;
		left: 15vw;
	}
	.topic {
		width: 15.68%; /* 16% * 0.98 where 8% is two times 1 / 12.5 */
		margin: 0.13856vw 0 -6.78944vw 8.32%; /* 8vw * 0.866 * 0.02 ; 0 ; -8vw * 0.866 * 0.98 ; 8% * 1.04 */
	}
	.topic a {
		font-size: 1.4vw;
	}
	.topic:nth-of-type(8n+5) {
		margin-left: 0.16%; /* 8% * 0.02 */
	}
	.topic:nth-of-type(8n+1) {
		margin-left: 12.16%; /* 8% * 2 * 0.76 */
	}
}

@media (aspect-ratio >= 4.57) or ((width < 480px) and (aspect-ratio > 0.8)) {
	body, #overview {
		padding: 1vw 0 0 0;
		background: black;
	}
	#overview {
		height: calc(100% - 1vw);
	}
}

@media (prefers-color-scheme: light) {
	body {
		background-color: white;
	}
	#overview_bg {
		background: white;
	}
	.topic {
		background: black;
	}
	.topic a {
		color: black;
	}
	.topic:hover div {
		filter: grayscale(1) invert(0.4) brightness(1.8);
		}
	.topic .permanent {
		filter: grayscale(1) invert(0.4) brightness(1.8);
	}
	#navictrl:checked ~ #overview_bg #overview .topic {
		filter: grayscale(1) invert(0.44) brightness(1.99);
	}
	#navictrl:checked ~ #overview_bg #overview .topic .permanent {
		filter: none;
	}
	@media (aspect-ratio >= 4.57) or ((width < 480px) and (aspect-ratio > 0.8)) {
		body, #overview {
			background: white;
		}
	}
}
