:root {
	--lime-green: hsl(163, 72%, 41%);
	--bright-red: hsl(356, 69%, 56%);
	--facebook: hsl(208, 92%, 53%);
	--twitter: hsl(203, 89%, 53%);
	--instagram: linear-gradient(to right, hsl(37, 97%, 70%), hsl(329, 70%, 58%));
	--youtube: hsl(348, 97%, 39%);
	--toggle: hsl(230, 22%, 74%);
	--main-bg: hsl(0, 0, 100%);
	--top-bg-pattern: hsl(225, 100%, 98%);
	--card-bg: hsl(227, 47%, 96%);
	--card-bg-hover: hsl(227, 47%, 91%);
	--primary-text: hsl(230, 17%, 14%);
	--secundary-text: hsl(228, 12%, 44%);
	--attribution-link:  hsl(228, 45%, 44%);
}
.dark-theme {
	--toggle: linear-gradient(to right, #378fe6, #3eda82);
	--main-bg: hsl(230, 17%, 14%);
	--top-bg-pattern: hsl(232, 19%, 15%);
	--card-bg: hsl(228, 28%, 20%);
	--card-bg-hover: hsl(228, 28%, 25%);
	--primary-text: hsl(0, 0%, 100%);
	--secundary-text: hsl(228, 34%, 66%);
	--attribution-link:  hsl(228, 45%, 60%);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
	padding: 0;
	margin: 0;
	font-family: 'Inter', sans-serif;
	font-size: 100%;
	background-color: var(--main-bg);
}
header {
	height: 15rem;
	background-color: var(--top-bg-pattern);
	border-bottom-left-radius: 1rem;
	border-bottom-right-radius: 1rem;
}
.header-container {
	display: flex;
	margin: 0 auto;
	padding: 2rem 0;
	max-width: 1110px;
	justify-content: space-between;
	align-items: center;
}
.header-text {
	display: flex;
	flex-direction: column;
}
.header-text h1 {
	font-size: 1.7rem;
	margin: 0;
	color: var(--primary-text);
}
.header-text p {
	font-size: 0.875rem;
	font-weight: 700;
	margin: 0.25rem 0;
	color: var(--secundary-text);
}
.switch-label {
	display: flex;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--secundary-text);
	align-items: center;
}
.switch-input {
	width: 0;
	height: 0;
	opacity: 0;
}
.switch-input:checked + .switch-handle {
	background-image: var(--toggle);
}
.switch-input:checked + .switch-handle::after {
	left: 0.25rem;
}
.switch-handle {
	position: relative;
	width: 3rem;
	height: 1.5rem;
	margin-left: 0.5rem;
	background-color: var(--toggle);
	border-radius: 1rem;
	cursor: pointer;
}
.switch-handle:hover {
	background-image: linear-gradient(to right, #378fe6, #3eda82);
}
.switch-handle::after {
	content: '';
	position: absolute;
	width: 1rem;
	height: 1rem;
	background-color: var(--top-bg-pattern);
	border-radius: 50%;
	top: 0.25rem;
	left: 1.75rem;
	transition: .3s;
}
.main-cards {
	display: flex;
	margin: -7rem auto 0;
	max-width: 1110px;
	justify-content: space-between;
}
.card {
	text-align: center;
	text-decoration: none;
	width: 16rem;
	height: 13.5rem;
	padding: 1.75rem 0 0.5rem;
	background-color: var(--card-bg);
	border-radius: 0.25rem;
}
.card:hover,
.overview-card:hover {
	background-color: var(--card-bg-hover);
}
.card.facebook {
	border-top: 4px solid var(--facebook);
}
.card.twitter {
	border-top: 4px solid var(--twitter);
}
.card.instagram {
	position: relative;
}
.card.instagram::before {
	content: '';
  position: absolute;
	width: 100%;
	height: 0.25rem;
	top: 0;
	left: 0;
  background-image: var(--instagram);
	border-radius: 0.25rem 0.25rem 0 0;
}
.card.youtube {
	border-top: 4px solid var(--youtube);
}
.username {
	display: flex;
	justify-content: center;
}
.facebook-logo,
.instagram-logo,
.youtube-logo {
	width: 1.25rem;
	height: 1.25rem;
}
.twitter-logo {
	width: 1.25rem;
	height: 1.063rem;
}
.username p {
	font-size: 0.875rem;
	font-weight: bold;
	margin: 0 0.5rem;
	color: var(--secundary-text);
}
.followers-number {
	font-size: 3.2rem;
	font-weight: bold;
	margin: 1rem auto 0;
	color: var(--primary-text);
}
.followers-text {
	font-size: 0.875rem;
	letter-spacing: 0.25rem;
	margin: 0;
	color: var(--secundary-text);
}
.gain {
	display: flex;
	font-size: 0.75rem;
	font-weight: bold;
	margin: 0.75rem auto;
	align-items: center;
	justify-content: center;
}
.gain img,
.overview-gain img {
	margin: 0 0.25rem;
}
.gain-positive {
	color: var(--lime-green);
}
.gain-negative {
	color: var(--bright-red);
}
.overview-cards {
	margin: 3rem auto;
	max-width: 1110px;
	color: var(--primary-text);
}
.first-row {
	display: flex;
	margin: 0 auto;
	max-width: 1110px;
	justify-content: space-between;
}
.overview-card {
	display: flex;
	text-align: center;
	width: 16rem;
	height: 8rem;
	padding: 1.5rem 0.5rem 1rem;
	flex-direction: column;
	justify-content: space-between;
	background-color: var(--card-bg);
	border-radius: 0.25rem;
}
.top,
.bottom {
	display: flex;
	justify-content: space-between;
	margin: 0 1rem;
}
.top p {
	font-size: 0.875rem;
	font-weight: bold;
	color: var(--secundary-text);
	margin: 0;
}
.bottom > p {
	font-size: 2rem;
	font-weight: bold;
	color: var(--primary-text);
	margin: 0;
}
.overview-gain {
	display: flex;
	font-size: 0.75rem;
	font-weight: bold;
	margin: 0;
	align-items: center;
}
.second-row {
	display: flex;
	margin: 1.5rem auto;
	max-width: 1110px;
	justify-content: space-between;
}
footer {
	margin: 1rem auto;
}
.attribution {
	font-size: 0.688rem;
	text-align: center;
	color: var(--primary-text);
}
.attribution a {
	color: var(--attribution-link);
}

@media (max-width: 1140px) {
	.header-container {
		margin: 0 1.5rem;
		flex-direction: column;
		align-items: flex-start;
	}
	.header-text {
		width: 100%;
		padding-bottom: 1.25rem;
		border-bottom: 1px solid var(--secundary-text);
	}
	.switch-label {
		width: 100%;
		margin: 1rem 0;
		justify-content: space-between;
	}
	.main-cards {
		margin: -3.5rem 1.5rem 0;
		flex-direction: column;
		align-items: center;
	}
	.card {
		width: 100%;
		margin: 0.75rem auto;
	}
	.overview-cards {
		margin: 1.75rem 1.5rem;
	}
	.first-row,
	.second-row {
		flex-direction: column;
		align-items: center;
	}
	.second-row {
		margin: 0;
	}
	.overview-card {
		width: 100%;
		margin: 0.5rem auto;
	}
}