@import url("./syntax.css");

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-100-normal.woff2") format("woff2");
	font-weight: 100;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-100-italic.woff2") format("woff2");
	font-weight: 100;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-200-normal.woff2") format("woff2");
	font-weight: 200;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-200-italic.woff2") format("woff2");
	font-weight: 200;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-300-normal.woff2") format("woff2");
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-300-italic.woff2") format("woff2");
	font-weight: 300;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-400-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-500-normal.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-500-italic.woff2") format("woff2");
	font-weight: 500;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-600-normal.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-600-italic.woff2") format("woff2");
	font-weight: 600;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-700-normal.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-700-italic.woff2") format("woff2");
	font-weight: 700;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-800-normal.woff2") format("woff2");
	font-weight: 800;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maple Mono";
	src: url("../fonts/maple/maple-mono-latin-800-italic.woff2") format("woff2");
	font-weight: 800;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora/lora-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora/lora-latin-400-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora/lora-latin-500-normal.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora/lora-latin-500-italic.woff2") format("woff2");
	font-weight: 500;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora/lora-latin-600-normal.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora/lora-latin-600-italic.woff2") format("woff2");
	font-weight: 600;
	font-style: italic;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora/lora-latin-700-normal.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora/lora-latin-700-italic.woff2") format("woff2");
	font-weight: 700;
	font-style: italic;
	font-display: swap;
}

:root {
	color-scheme: dark;

	--bg: hsla(240, 6%, 10%, 1);
	--text-fg-100: hsl(0 0 50%);
	--text-fg-200: hsl(0 0 60%);
	--text-fg-300: hsl(0 0 90%);
	--text-accent: hsl(185 75% 40%);
	--text-accent-hover: hsl(185 75% 55%);

	--font-sans: "Inter", sans-serif;
	--font-serif: "Lora", Georgia, serif;
	--font-mono: "Maple Mono", "Cascadia Code", monospace;

	--font-weight-thin: 100;
	--font-weight-extra-light: 200;
	--font-weight-light: 300;
	--font-weight-regular: 400;
	--font-weight-medium: 500;
	--font-weight-semibold: 600;
	--font-weight-bold: 700;
	--font-weight-extra-bold: 800;
	--font-weight-black: 900;

	--text-xs: 0.75rem;
	--text-sm: 0.875rem;
	--text-base: 1rem;
	--text-lg: 1.125rem;
	--text-xl: 1.25rem;
	--text-2xl: 1.5rem;
	--text-3xl: 1.875rem;
	--text-4xl: 2.25rem;
	--text-5xl: 3rem;
	--text-6xl: 3.75rem;
	--text-7xl: 4.5rem;

	--space-0: 0;
	--space-px: 1px;
	--space-0_5: 0.125rem;
	--space-1: 0.25rem;
	--space-1_5: 0.375rem;
	--space-2: 0.5rem;
	--space-2_5: 0.625rem;
	--space-3: 0.75rem;
	--space-3_5: 0.875rem;
	--space-4: 1rem;
	--space-5: 1.25rem;
	--space-6: 1.5rem;
	--space-7: 1.75rem;
	--space-8: 2rem;
	--space-9: 2.25rem;
	--space-10: 2.5rem;
	--space-11: 2.75rem;
	--space-12: 3rem;
	--space-14: 3.5rem;
	--space-16: 4rem;

	--measure-md: 28rem;
	--measure-lg: 38rem;
	--measure-xl: 42rem;
	--blog-notes-width: 16rem;
	--blog-notes-gap: clamp(var(--space-4), 4vw, var(--space-14));
	--blog-page-gutter: 20px;
	--line-1: var(--space-px);
	--ornament-offset: var(--space-1_5);
	--ornament-size: calc(var(--space-4) - var(--space-3));
	--note-corner-width: var(--space-5);
	--note-text-indent: calc(var(--note-corner-width) + var(--space-2));
	--note-rail-dot-size: calc(var(--space-px) * 2);
	--note-rail-left: calc((var(--note-corner-width) / 5) - (var(--note-rail-dot-size) / 2));
}

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

html {
	scroll-behavior: smooth;
	overflow-x: hidden;
}

body {
	overflow-x: hidden;
}

a {
	color: inherit;
	width: fit-content;
}

/*
===============================================================================
Container
===============================================================================
*/

.container {
	--container-max-width: 60rem;
	--container-padding-inline: var(--space-4);
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--container-max-width);
	margin-inline: auto;
	padding-inline: var(--container-padding-inline);
}

@media (min-width: 48rem) {
	.container {
		--container-padding-inline: var(--space-6);
	}
}

@media (min-width: 64rem) {
	.container {
		--container-padding-inline: var(--space-8);
	}
}

/*
===============================================================================
Blog Layout
===============================================================================
*/

.blog-main {
	padding-bottom: var(--space-16);
	overflow-x: hidden;
	padding-top: var(--space-8);
	min-width: 0;
}

.blog-notes {
	display: none;
}

.blog-notes-title {
	display: none;
}

@media (min-width: 87.5rem) {
	.blog-notes {
		display: block;
		position: absolute;
		top: var(--space-4);
		left: calc(100% + var(--blog-notes-gap));
		width: var(--blog-notes-width);
		padding-top: var(--space-4);
	}
}

/*
===============================================================================
Blog Article
===============================================================================
*/

.blog-header {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	padding-bottom: var(--space-8);
}

.blog-title {
	margin-left: 0;
	color: var(--text-accent);
	font-family: var(--font-sans);
	font-size: var(--text-7xl);
	font-weight: var(--font-weight-extra-bold);
	line-height: 1.06;
	letter-spacing: -0.03em;
	filter: url(#dry-ink);
	text-wrap: balance;
}

.blog-meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2) var(--space-4);
	font-family: var(--font-sans);
	font-weight: var(--font-weight-regular);
}

.blog-meta-line {
	color: var(--text-fg-100);
	font-size: var(--text-sm);
	line-height: 1.5;
}

.blog-tag {
	color: var(--text-fg-200);
	text-decoration: underline dotted;
	font-style: italic;
}

.blog-tag:hover,
.blog-tag:focus-visible {
	color: var(--text-fg-300);
	text-decoration: underline;
}

.blog-article {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
	font-weight: var(--font-weight-regular);
}

.blog-section {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
}

.blog-section p,
.blog-article p,
.blog-article li,
.blog-list li,
.blog-reading-link {
	color: var(--text-fg-300);
	font-family: var(--font-serif);
	font-size: 16.5px;
	line-height: 1.6;
}

.blog-article p,
.blog-article h1,
.blog-article h2,
.blog-article h3,
.blog-article h4,
.blog-article h5,
.blog-article h6 {
	margin: 0;
	color: var(--text-fg-300);
	font-family: var(--font-serif);
}

.blog-article h3 {
	margin-top: var(--space-4);
	font-size: 1.55rem;
	font-weight: var(--font-weight-semibold);
	line-height: 1.25;
}

.blog-article h4 {
	margin-top: var(--space-3);
	font-size: 1.2rem;
	font-weight: var(--font-weight-semibold);
	line-height: 1.3;
}

.blog-article h3:first-child,
.blog-article h4:first-child {
	margin-top: 0;
}

.blog-section p a,
.blog-article p a {
	color: var(--text-accent);
}

.blog-section p a:hover,
.blog-section p a:focus-visible,
.blog-article p a:hover,
.blog-article p a:focus-visible {
	color: var(--text-accent-hover);
}

.blog-article code {
	display: inline-block;
	padding: 0.08em 0.32em;
	border-radius: 0.25rem;
	background: hsl(0 0% 100% / 0.045);
	color: var(--text-fg-300);
	font-family: var(--font-mono);
	font-size: 14px;
	line-height: 1.35;
}

.code-block {
	position: relative;
}

.blog-article pre {
	overflow-x: auto;
	margin: 0;
	padding: var(--space-4);
	border-radius: 0.35rem;
	background: hsl(0 0% 100% / 0.045);
}

.blog-article pre code {
	display: block;
	padding: 0;
	border-radius: 0;
	background: transparent;
	font-size: var(--text-sm);
	line-height: 1.65;
	white-space: pre;
}

.code-copy-button {
	position: absolute;
	top: var(--space-3);
	right: var(--space-3);
	z-index: 1;
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: var(--line-1) solid hsl(0 0% 36% / 0.7);
	border-radius: 0.25rem;
	background: hsl(240 6% 10% / 0.92);
	color: var(--text-fg-200);
	cursor: pointer;
	opacity: 0;
	transition:
		opacity 140ms ease,
		color 140ms ease,
		border-color 140ms ease;
}

.code-block:hover .code-copy-button,
.code-block:focus-within .code-copy-button {
	opacity: 1;
}

.code-copy-button:hover,
.code-copy-button:focus-visible {
	border-color: hsl(0 0% 58% / 0.85);
	color: var(--text-fg-300);
}

.code-copy-icon {
	grid-area: 1 / 1;
	width: 1rem;
	height: 1rem;
	pointer-events: none;
	transition:
		opacity 120ms ease,
		transform 120ms ease;
}

.code-copy-icon-check {
	color: hsl(135 65% 58%);
	opacity: 0;
	transform: scale(0.72);
}

.code-copy-button.is-copied {
	border-color: hsl(135 65% 44%);
	color: hsl(135 65% 58%);
}

.code-copy-button.is-copied .code-copy-icon-copy {
	opacity: 0;
	transform: scale(0.72);
}

.code-copy-button.is-copied .code-copy-icon-check {
	opacity: 1;
	transform: scale(1);
}

.blog-muted {
	color: var(--text-fg-100);
}

.blog-center {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.blog-note-ref {
	margin-left: var(--space-px);
	font-size: var(--text-xs);
	line-height: 0;
	vertical-align: super;
}

.blog-note-ref a {
	color: var(--text-accent);
	text-decoration: none;
}

.blog-note-ref a:hover,
.blog-note-ref a:focus-visible {
	color: var(--text-accent-hover);
	text-decoration: underline;
}

.blog-section-heading {
	max-width: none;
	margin-bottom: var(--space-1);
}

.blog-section-title {
	color: var(--text-accent);
	font-family: var(--font-serif);
	font-size: var(--text-2xl);
	font-weight: var(--font-weight-semibold);
	line-height: 1.3;
	filter: none;
}

.blog-list,
.blog-article ol,
.blog-article ul,
.blog-reading-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	padding-left: var(--space-6);
}

.blog-article ol,
.blog-article ul {
	margin: 0;
}

.blog-list li::marker,
.blog-article li::marker,
.blog-reading-list li::marker {
	color: var(--text-fg-300);
}

.blog-pull-quote {
	max-width: var(--measure-md);
	padding: var(--space-6) 0;
	border-top: var(--line-1) solid hsl(0 0% 36% / 0.75);
	border-bottom: var(--line-1) solid hsl(0 0% 36% / 0.75);
}

.blog-pull-quote p {
	color: var(--text-accent);
	font-family: var(--font-serif);
	font-size: var(--text-3xl);
	line-height: 1.25;
}

.blog-reading-link {
	color: var(--text-accent);
	text-decoration: underline;
	text-underline-offset: var(--space-1);
}

.blog-reading-link:hover,
.blog-reading-link:focus-visible {
	color: var(--text-accent-hover);
}

/*
===============================================================================
Margin Notes
===============================================================================
*/

.notes-list {
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	list-style: none;
}

.note-item {
	position: absolute;
	top: var(--note-offset, 0);
	left: 0;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: var(--space-px);
}

.note-header {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	padding-left: var(--note-text-indent);
}

.note-index {
	color: var(--text-accent);
	font-family: var(--font-sans);
	font-size: var(--text-xs);
	font-weight: var(--font-weight-semibold);
	line-height: 1;
	transform: translateY(calc(var(--space-px) * -1));
}

.blog-article .note-index {
	color: var(--text-accent);
	font-family: var(--font-sans);
	font-size: var(--text-xs);
	font-weight: var(--font-weight-semibold);
	line-height: 1;
}

.note-corner {
	flex: none;
	width: var(--note-corner-width);
	height: var(--space-6);
	margin-left: calc(var(--note-text-indent) * -1);
	overflow: visible;
}

.note-corner-stroke {
	stroke: hsl(0 0% 36% / 0.8);
	stroke-width: 1;
	stroke-linecap: round;
	stroke-dasharray: 0 1.8;
	vector-effect: non-scaling-stroke;
}

.note-corner-dot {
	fill: hsl(0 0% 36% / 0.8);
	vector-effect: non-scaling-stroke;
}

.note-corner-stub-merged {
	display: none;
}

.note-item.is-merged-from-prev .note-corner-dot-bottom {
	display: none;
}

.note-item.is-merged-from-prev .note-corner-stub-default {
	display: none;
}

.note-item.is-merged-from-prev .note-corner-stub-merged {
	display: inline;
}

.note-rule {
	position: relative;
	flex: 1;
	height: var(--ornament-size);
	transform: translateY(calc(var(--space-px) * -1));
}

.note-rail {
	position: absolute;
	top: var(--note-rail-top, 0);
	left: var(--note-rail-left);
	width: var(--note-rail-dot-size);
	height: var(--note-rail-height, 0);
	pointer-events: none;
}

.note-rail-solid,
.note-rail-dotted {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
}

.note-rail-solid {
	top: 0;
	width: 0;
	height: var(--note-rail-solid-height, 0);
	border-left: var(--line-1) solid hsl(0 0% 36% / 0.8);
}

.note-rail-dotted {
	top: var(--note-rail-solid-height, 0);
	width: var(--note-rail-dot-size);
	height: var(--note-rail-dotted-height, 0);
	overflow: visible;
}

.note-rail-dotted-svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.note-rail-terminal {
	position: absolute;
	left: 50%;
	bottom: 0;
	width: var(--note-rail-dot-size);
	height: var(--note-rail-dot-size);
	transform: translateX(-50%);
	background-image: radial-gradient(circle, hsl(0 0% 36% / 0.8) 0 0.9px, transparent 1px);
	background-repeat: no-repeat;
	background-position: center;
	background-size: var(--note-rail-dot-size) var(--note-rail-dot-size);
	display: none;
}

.note-item.is-terminal .note-rail-terminal {
	display: block;
}

.note-item.is-merged .note-rail-terminal {
	display: none;
}

.note-item.is-terminal .note-rail-dotted {
	display: none;
}

.note-text {
	padding-left: var(--note-text-indent);
	color: var(--text-fg-100);
	font-family: var(--font-serif);
	font-weight: var(--font-weight-medium);
	font-size: var(--text-sm);
	line-height: 1.6;
}

.blog-article .note-text {
	color: var(--text-fg-100);
	font-family: var(--font-serif);
	font-weight: var(--font-weight-medium);
	font-size: var(--text-sm);
	line-height: 1.6;
}

.note-backlink {
	display: none;
	color: var(--text-accent);
	text-decoration: none;
}

.note-backlink:hover,
.note-backlink:focus-visible {
	color: var(--text-accent-hover);
	text-decoration: underline;
}

.note-backlink-glyph {
	font-family: var(--font-mono);
	font-size: 0.9em;
}

.note-rule::before,
.u-border-dots-dotted-bottom::before {
	content: "";
	position: absolute;
	right: var(--ornament-offset);
	left: var(--ornament-offset);
	border-bottom: var(--line-1) dotted hsl(0 0% 36% / 0.8);
}

.note-rule::after,
.u-border-dots-dotted-bottom::after {
	content: "";
	position: absolute;
	right: 0;
	left: 0;
	height: var(--ornament-size);
	background-image:
		radial-gradient(circle, hsl(0 0% 36% / 0.8) 0 1px, transparent 1.5px),
		radial-gradient(circle, hsl(0 0% 36% / 0.8) 0 1px, transparent 1.5px);
	background-position: left center, right center;
	background-repeat: no-repeat;
	background-size: var(--ornament-size) var(--ornament-size);
}

.note-rule::before {
	top: 50%;
	transform: translateY(calc(var(--line-1) * -0.5));
}

.note-rule::after {
	top: 50%;
	transform: translateY(-50%);
}

.u-border-dots-dotted-bottom {
	position: relative;
	padding-bottom: 6px;
}

.u-border-dots-dotted-bottom::before {
	bottom: 0;
}

.u-border-dots-dotted-bottom::after {
	bottom: -2px;
}

/*
===============================================================================
Footer
===============================================================================
*/

.footer {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--space-6);
	padding-top: var(--space-8);
	padding-bottom: var(--space-10);
	color: var(--text-fg-200);
	font-family: var(--font-serif);
	font-size: var(--text-sm);
	font-weight: var(--font-weight-medium);
}

.footer > p {
	flex: none;
	white-space: nowrap;
}

.footer > div {
	min-width: 0;
}

.footer a {
	color: var(--text-fg-200);
	text-decoration: none;
}

.footer a:hover,
.footer a:focus-visible {
	color: var(--text-accent);
	text-decoration: underline;
}

/*
===============================================================================
Utilities
===============================================================================
*/

.print-filter-defs {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

/*
===============================================================================
Responsive
===============================================================================
*/

@media (max-width: 87.499rem) {
	.blog-title {
		font-size: var(--text-5xl);
	}

	.blog-notes {
		display: block;
		margin-top: var(--space-12);
		padding-top: var(--space-8);
		padding-bottom: var(--space-8);
		border-top: var(--line-1) solid hsl(0 0% 36% / 0.55);
	}

	.blog-notes-title {
		display: block;
		margin-bottom: var(--space-5);
		color: var(--text-accent);
		font-family: var(--font-serif);
		font-size: 1.45rem;
		font-weight: var(--font-weight-semibold);
		line-height: 1.2;
	}

	.notes-list {
		display: flex;
		flex-direction: column;
		gap: var(--space-3);
		list-style: decimal;
		list-style-position: outside;
		padding-left: 1.45rem;
	}

	.note-item {
		position: static;
		display: list-item;
		width: auto;
	}

	.note-header,
	.note-rail {
		display: none;
	}

	.note-text {
		padding-left: 0 !important;
		color: var(--text-fg-300) !important;
		font-size: 16px !important;
		line-height: 1.6 !important;
		font-weight: var(--font-weight-regular) !important;
	}

	.note-backlink {
		display: inline;
	}

	.note-item::marker {
		color: var(--text-fg-300);
		font-family: var(--font-serif);
		font-size: 16.5px;
	}
}

@media (max-width: 700px) {
	.blog-title {
		font-size: var(--text-3xl);
		line-height: 1.08;
	}

	.blog-section-title {
		font-size: 1.3rem;
		line-height: 1.25;
	}

	.blog-section p,
	.blog-list li,
	.blog-reading-link {
		font-size: 17px;
		line-height: 1.58;
	}

	.blog-notes-title {
		font-size: 1.3rem;
	}

	.note-text,
	.note-item::marker {
		font-size: 0.985rem;
		line-height: 1.42;
	}

	.footer {
		font-size: var(--text-xs);
	}
}

@media (max-width: 375px) {
	.footer {
		font-size: 10px !important;
	}
}
