@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');

/*-- COLOR SCHEMES --*/
:root {
	--whimsy: #fa7921;
	--bg: light-dark(#f9f8f5,#1a1c22);
	--bg-vellum: light-dark(rgba(249,248,245,0.75),rgba(26,28,34,0.75));
	--bg-contrast: light-dark(rgba(26,28,34,0.75),rgba(249,248,245,0.75));
	--ink: light-dark(#4b505c,#b6b6b8);
	--ink-contrast: light-dark(#dddeda,#1a1c22);
	--highlight: light-dark(#767c8a,#9ba0af);
	--emphatic: light-dark(#1a1c22,#dddeda);
	--line: light-dark(#e6e7ec,#282a33);
}
body {
	background-color: var(--bg);
	color: var(--ink);
	color-scheme: light dark;
	transition: background-color 150ms ease-in-out, color 150ms ease-in-out;
}
@media screen and (prefers-color-scheme: dark) {
	body:has([name='color-mode-toggle']:checked) {
		color-scheme: light;
	}
	.color-mode-light {
		display: none;
	}
}
@media  screen and(prefers-color-scheme: light) {
	body:has([name='color-mode-toggle']:checked) {
		color-scheme: dark;
	}
	.color-mode-dark {
		display: none;
	}
}

/*-- TYPOGRAPHY --*/
body {
	font-family: 'Inter', system-ui, -apple-system, sans-serif;
	font-optical-sizing: auto;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.75;
	margin: auto;
	max-width: 34em;
	padding: 1em 1.5em;
}
p {
	margin: 0;
}
.section-title + p {
	margin-top: 2.85em;
}
p + p {
	margin-top: 1em;
}
p,
ul,
ol,
label {
	font-size: 0.75em;
}
label {
	display: block;
	position: relative;
}
p.description,
ul,
ol {
	margin-bottom: 1em;
	margin-top: 1em;
}
a {
	color: var(--emphatic);
	text-decoration: underline;
	text-decoration-color: var(--highlight);
	text-underline-offset: 0.25em;
	transition: color 150ms ease-in-out, text-decoration-color 150ms ease-in-out;
}
a:active,
a:focus,
a:hover {
	color: var(--whimsy);
	text-decoration-color: var(--whimsy);
}
h1,
h2,
h3,
h4,
h5,
h6,
.title,
time {
	color: var(--emphatic);
	font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
	font-size: 0.75em;
	font-weight: 600;
	transition: color 150ms ease-in-out;
}
time {
	font-size: 0.8em;
}
h1,
h2,
h3,
h4,
h5,
h6 {
	margin-bottom: 1em;
	margin-top: 2em;
}
.col h1,
.col h2,
.col h3,
.col h4,
.col h5,
.col h6 {
	margin-bottom: 0;
}
h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child {
	margin-top: 0;
}
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
	text-decoration: none;
}
bold,
strong,
p a,
li a {
	color: var(--emphatic);
	font-weight: 500;
	transition: color 150ms ease-in-out;
}
.site-name {
	font-size: 1.25em;
	line-height: 1;
	margin: 0;
	text-transform: lowercase;
}
.site-name span {
	color: var(--whimsy);
	transition: color 150ms ease-in-out;
}
.section-title,
.company,
time {
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.section-title {
	font-size: 0.8em;
	font-weight: 600;
}
.company {
	font-size: 1em;
	margin: 0;
}
.company:not(:first-child) {
	margin-top: 1em;
}
time {
	font-size: 0.75em;
}
@media only screen {
	.screen-reader {
		border: 0;
		clip: rect(1px, 1px, 1px, 1px);
		clip-path: inset(50%);
		height: 1px;
		margin: -1px;
		overflow: hidden;
		padding: 0;
		position: absolute !important;
		width: 1px;
		word-wrap: normal !important;
	}
}
@media screen and (min-width: 600px) {
	body {
		font-size: 20px;
		padding-bottom: 3em;
		padding-top: 3em;
	}
	p,
	ul,
	ol {
		font-size: 0.7em;
	}
}
@media (prefers-color-scheme: dark) {
	body {
		font-weight: 300;
	}
	h1,
	h2,
	h3,
	h4,
	h5,
	h6,
	.title,
	time {
		font-weight: 500;
	}
	bold,
	strong,
	p a,
	li a {
		font-weight: 400;
	}
	.section-title {
		font-weight: 500;
	}
}

/*-- LAYOUT --*/
.site-header {
	margin-bottom: 3em;
	margin-top: 2em;
}
.header-container {
	align-items: center;
	backdrop-filter: blur(0.2em);
	background-color: var(--bg-vellum);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	padding-top: 0.5em;
	padding-bottom: 0.5em;
	position: sticky;
	transition: background-color 150ms ease-in-out;
	top: 0;
}
.site-header nav {
	align-items: center;
	display: flex;
	flex-wrap: nowrap;
	gap: 1em;
	justify-content: center;
}
.site-header nav a {
	align-items: center;
	display: flex;
	gap: 0.5em;
	margin-left: -0.5em;
	margin-right: -0.5em;
	padding: 0.5em;
}
.site-header nav a:active,
.site-header nav a:focus,
.site-header nav a:hover {
	color: var(--whimsy);
}
.site-header nav a svg {
	height: 1em;
	width: 1em;
}
section {
	margin-top: 2em;
}
.section-title {
	margin-bottom: 0.25em;
}
.col {
	margin-top: 2em;
}
.col > * + * {
	margin-top: 1.5em;
}
.section-title::after {
	background-color: var(--line);
	content: '';
	display: block;
	height: 1px;
	margin-left: calc(50% - 50vw);
	transition: background-color 150ms ease-in-out;
	width: 100vw;
}
article {
	margin-bottom: 2em;
	margin-top: 2em;
}
article + article::before {
	background-color: var(--line);
	content: '';
	display: block;
	height: 1px;
	margin-bottom: 2em;
	margin-left: calc(50% - 50vw);
	width: 100vw;
}
article header {
	backdrop-filter: blur(0.2em);
	background-color: var(--bg-vellum);
	padding-bottom: 0.5em;
	padding-top: 0.5em;
	position: sticky;
	transition: background-color 150ms ease-in-out;
	top: 0;
}
.title {
	margin: 0;
}
article header .title {
	align-items: flex-end;
	display: flex;
	justify-content: space-between;
}
article header .title time {
	margin-bottom: 0.1em;
	margin-left: 0.5em;
}
ul,
ol {
	padding-left: 1.25em;
}
li {
	margin-bottom: 0.25em;
	margin-top: 0.25em;
	padding-left: 0.25em;
}
li::marker {
	color: var(--highlight);
}
@media all and (min-width: 600px) {
	.site-header {
		margin-bottom: 5em;
		margin-top: 3em;
	}
	section {
		margin-top: 4em;
	}
	.col {
		display: flex;
		flex-wrap: no-wrap;
		gap: 2em;
	}
	.col > * {
		flex: 1;
	}
	.col > * + * {
		margin-top: 0;
	}
	article {
		margin-bottom: 4em;
		margin-top: 4em;
	}
	article + article::before {
		margin-bottom: 4em;
	}
}

/*-- COLOR SCHEME TOGGLE COMPONENT --*/
.color-scheme-toggle {
	align-items: center;
	backdrop-filter: blur(0.2em);
	background-color: var(--bg-contrast);
	bottom: 0;
	color: var(--ink-contrast);
	display: flex;
	font-size: 0.75em;
	font-weight: 500;
	justify-content: flex-end;
	letter-spacing: 0.05em;
	overflow: hidden;
	position: fixed;
	right: 0;
	text-transform: uppercase;
	transition: background-color 150ms ease-in-out, color 150ms ease-in-out;
	z-index: 1;
}
.toggle-settings-label {
	cursor: pointer;
	display: block;
	height: 1.25em;
	padding: 0.5em 0.75em;
	transition: transform 250ms ease-in-out;
	width: 1.25em;
}
.toggle-settings-label::before,
.toggle-settings-label::after {
	content: '';
	display: block;
	height: calc(1.25em + 1px);
	position: absolute;
	width: calc(1.25em + 1px);
	transition: border-color 250ms ease-in-out;
}
.toggle-settings-label::before {
	border-left: 1px solid var(--ink-contrast);
	left: 1.375em;
	top: 0.5em;
}
.toggle-settings-label::after {
	border-top: 1px solid var(--ink-contrast);
	left: 0.75em;
	top: 1.125em;
}
.component-toggle {
	align-items: center;
	display: flex;
	gap: 0.5em;
	max-height: 1.25em;
	max-width: 0;
	padding-bottom: 0.5em;
	padding-top: 0.625em;
	opacity: 0;
	overflow: hidden;
	transition: max-width 250ms ease-in-out, opacity 250ms ease-in-out;
	white-space: nowrap;
}
.toggle-settings:checked + .toggle-settings-label {
	transform: rotate(45deg);
}
.toggle-settings:checked + .toggle-settings-label + .component-toggle {
	max-width: 8em;
	opacity: 1;
}
.component-toggle-container {
	width: 2.25em;
	height: 1.25em;
	margin-right: 0.75em;
	position: relative;
}

/* Hide default HTML checkbox */
.toggle-settings,
.component-toggle-checkbox {
	display: none;
}
.component-toggle-label {
	font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
	font-weight: 400;
}
.component-toggle-switch {
	width: 100%;
	height: 100%;
	display: block;
	background-color: #e9e9eb;
	border-radius: 1em;
	cursor: pointer;
	transition: background-color 250ms ease-out;
}

/* The slider */
.component-toggle-slider {
	width: 1.65em;
	height: 1.65em;
	position: absolute;
	left: 0;
	top: 0;
	border-radius: 50%;
	background: white;
	box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15), 0px 2px 1px rgba(0, 0, 0, 0.06);
	transition: background-color 250ms ease-out, transform 250ms ease-in-out;
	cursor: pointer;
}

.component-toggle-checkbox:checked + .component-toggle-switch {
	background-color: #34C759;
}

.component-toggle-checkbox:checked + .component-toggle-switch .component-toggle-slider {
	transform: translateX(75%);
}
