/*!
 * Technology Radar
 * https://github.com/urre/radar
 * @author Urban Sanden
 * MIT licensed.
 */

:root {
	--profile: #00cc99;
	--profile-dark: #009973;
	--profile-light: #99ffe6;
	--footer: #445380;

	--techniques: #0096a4;
	--tools: #7db58d;
	--platforms: #ec7632;
	--frameworks: #a13f52;

	--grey-95: #f2f2f2;
	--grey-92: #ebebeb;
	--grey-90: #e6e6e6;
	--grey-85: #d9d9d9;
	--grey-75: #bfbfbf;
	--grey-55: #8c8c8c;

	/* Leave room for the area labels that sit outside the circle */
	--radar-size: min(46em, calc(100vw - 8rem));
	--blip-size: 16px;
}

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

html {
	font-size: 140%;
}

html,
body {
	height: 100%;
	min-height: 100%;
	margin: 0;
}

body {
	font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
	line-height: 1.5;
	color: #111;
	background: #fff;
}

h1,
h2,
h3,
h4,
h5 {
	font-weight: 300;
}

img,
iframe,
object {
	max-width: 100%;
}

img {
	height: auto;
	border: none;
}

a {
	color: #333;
}

.container {
	max-width: 70rem;
	margin: 0 auto;
	padding: 2rem;
}

/*-------------------------------------------------------------------

	Header

-------------------------------------------------------------------*/

.header {
	position: relative;
	border-bottom: 1px solid #d3d3d3;
	background-color: var(--footer);
	background-size: cover;
	background-position: center center;
	padding: 2em;
	text-align: center;
}

.header h1 {
	margin: 0;
	font-size: 1.2rem;
	color: var(--grey-95);
}

.header p {
	font-size: .7rem;
	color: var(--grey-95);
	margin: 2em 0 0;
}

.header a {
	color: #fff;
	transition: color 400ms ease;
}

.header a:hover {
	text-decoration: none;
	color: var(--profile-light);
}

.header img {
	display: inline-block;
	vertical-align: middle;
	margin-left: 1em;
	margin-right: .5em;
	border-radius: 50%;
	width: 40px;
	height: 40px;
}

/*-------------------------------------------------------------------

	Layout switch (CSS-only toggle)

-------------------------------------------------------------------*/

.layoutswitch {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1em;
	background: var(--grey-95);
	border-bottom: 1px solid var(--grey-90);
	padding: .5em 1em;
}

.layoutswitch label {
	font-size: .8em;
	color: var(--grey-75);
	cursor: pointer;
}

.switch {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	width: 33px;
	height: 20px;
	margin: 0;
	border: 1px solid #dfdfdf;
	border-radius: 20px;
	background: #fff;
	cursor: pointer;
	transition: background-color .4s, border-color .4s, box-shadow .4s;
}

.switch::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
	transition: transform .25s;
}

.switch:checked {
	background: var(--profile);
	border-color: var(--profile);
	box-shadow: inset 0 0 0 10px var(--profile);
}

.switch:checked::before {
	transform: translateX(13px);
}

.switch:focus-visible {
	outline: 2px solid var(--profile-dark);
	outline-offset: 2px;
}

/*-------------------------------------------------------------------

	Area lists

-------------------------------------------------------------------*/

ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

ul li {
	font-size: .7em;
	margin-bottom: .2em;
	border-bottom: 1px solid var(--grey-92);
}

ul li a {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

ul li a span {
	font-size: .7em;
	margin-left: 4em;
	color: var(--grey-55);
	text-transform: uppercase;
}

.techniques,
.tools,
.platforms,
.frameworks {
	z-index: 100;
}

.techniques,
.techniques ul li a { color: var(--techniques); }
.tools,
.tools ul li a { color: var(--tools); }
.platforms,
.platforms ul li a { color: var(--platforms); }
.frameworks,
.frameworks ul li a { color: var(--frameworks); }

/*-------------------------------------------------------------------

	Radar

-------------------------------------------------------------------*/

.radar {
	position: relative;
	width: var(--radar-size);
	height: var(--radar-size);
	margin: 4rem auto 4em;
	background: var(--grey-95);
	border-radius: 50%;
}

.radar::before {
	content: "Hold";
}

.radar .xline,
.radar .yline {
	position: absolute;
	z-index: 100;
	background: rgba(140, 140, 140, .4);
}

.radar .xline {
	width: 110%;
	height: 1px;
	left: -5%;
	top: 50%;
}

.radar .yline {
	height: 110%;
	width: 1px;
	left: 50%;
	top: -5%;
}

.radar .techniques,
.radar .tools,
.radar .platforms,
.radar .frameworks {
	position: absolute;
}

.radar .techniques { left: -3em; top: 0; }
.radar .tools { right: -3em; top: 0; }
.radar .platforms { left: -3em; bottom: 0; }
.radar .frameworks { right: -3em; bottom: 0; }

.adopt,
.trial,
.assess {
	position: absolute;
	left: 0;
	right: 0;
	margin: 0 auto;
	border-radius: 50%;
	border: 2px solid #fff;
}

.adopt {
	top: 35%;
	width: 30%;
	height: 30%;
	background: var(--grey-85);
	z-index: 3;
}

.trial {
	top: 20%;
	width: 60%;
	height: 60%;
	background: var(--grey-90);
	z-index: 2;
}

.assess {
	top: 10%;
	width: 80%;
	height: 80%;
	background: var(--grey-92);
}

.adopt::before { content: "Adopt"; }
.trial::before { content: "Trial"; }
.assess::before { content: "Assess"; }

.radar::before,
.adopt::before,
.trial::before,
.assess::before {
	position: absolute;
	top: -30px;
	left: 0;
	right: 0;
	display: block;
	font-size: .6em;
	text-transform: uppercase;
	text-align: center;
}

/* List layout */

.radar.compact {
	background: none;
	max-width: 60%;
	width: auto;
	height: auto;
}

.radar.compact #blips,
.radar.compact .xline,
.radar.compact .yline,
.radar.compact .adopt,
.radar.compact .assess,
.radar.compact .trial,
.radar.compact::before {
	display: none;
}

.radar.compact .techniques,
.radar.compact .tools,
.radar.compact .platforms,
.radar.compact .frameworks {
	position: static;
	width: 100%;
}

/*-------------------------------------------------------------------

	Blips

-------------------------------------------------------------------*/

.blip {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 100;
	display: block;
	width: var(--blip-size);
	height: var(--blip-size);
	border: 1px solid #fff;
	border-radius: 50%;
	background: var(--platforms);
}

.blip:hover,
.blip:focus-visible,
.blip.is-active {
	animation: waves .1s ease-in-out 1 forwards;
	outline: none;
}

.blip--techniques { background: var(--techniques); }
.blip--tools { background: var(--tools); }
.blip--platforms { background: var(--platforms); }
.blip--frameworks { background: var(--frameworks); }

@keyframes waves {
	0% { box-shadow: 0 0 0 1px rgba(140, 140, 140, .3); }
	100% { box-shadow: 0 0 0 4px rgba(140, 140, 140, .3); }
}

/*-------------------------------------------------------------------

	Tooltips

-------------------------------------------------------------------*/

.tooltip {
	--tip: #333;
	position: absolute;
	z-index: 100;
	max-width: 340px;
	margin-top: 2px;
	padding: .6em 1.2em;
	font-size: .9em;
	text-align: center;
	color: #fff;
	background-color: var(--tip);
	pointer-events: none;
	animation: fadeIn .5s ease both;
}

.tooltip::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -10px;
	margin-left: -10px;
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-top: 10px solid var(--tip);
}

.tooltip.techniques { --tip: var(--techniques); }
.tooltip.tools { --tip: var(--tools); }
.tooltip.frameworks { --tip: var(--frameworks); }
.tooltip.platforms { --tip: var(--platforms); }

@keyframes fadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

/*-------------------------------------------------------------------

	Footer

-------------------------------------------------------------------*/

.footer {
	margin-top: 6em;
	background: var(--footer);
	color: #fff;
}

.footer a {
	color: var(--profile-light);
	transition: color 400ms ease;
}

.footer a:hover {
	text-decoration: none;
	color: #fff;
}

.footer__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1em 2em;
}

.footer__grid p {
	margin: 0 0 .5em;
}

.footer__copy {
	padding: 1rem;
	text-align: center;
	background: #fff;
	color: var(--grey-75);
}

.footer__copy p {
	margin: 0;
}

.footer__copy a {
	color: var(--grey-75);
}

.footer__copy a:hover {
	color: var(--profile-dark);
}

/*-------------------------------------------------------------------

	Breakpoints

-------------------------------------------------------------------*/

@media (max-width: 1200px) {
	.radar h3 { font-size: .8em; }
	.blip { --blip-size: 12px; }
	.tooltip { font-size: .7em; }
}

@media (max-width: 1024px) {
	html { font-size: 100%; }
	.header h1 { font-size: .9em; }

	/* No room for the lists next to the circle, use the List toggle */
	.radar:not(.compact) ul { display: none; }
}

@media (max-width: 768px) {
	.radar { margin-top: 3rem; }
	.radar h3 { font-size: .6em; }
	.radar::before,
	.adopt::before,
	.trial::before,
	.assess::before { top: -1.6em; font-size: .5em; }
	.blip { --blip-size: 10px; }
}

@media (max-width: 480px) {
	ul li { font-size: .8em; }
	.radar.compact { max-width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
