:root {
	--text: #1f2933;
	--muted: #6b7280;
	--background: #fdfdfd;
	--surface: #f6f8fa;
	--border: #d8dee4;
	--link: #fab387;

	--content-width: 65ch;
	--page-left-margin: clamp(1rem, 6vw, 8rem);
}

* {
	box-sizing: border-box;
}

html {
	font-size: 100%;
}

body {
	margin: 0;
	padding: 2rem 1rem;
	color: var(--text);
	background: var(--background);

	font-family:
	system-ui,
	-apple-system,
	BlinkMacSystemFont,
	"Segoe UI",
	sans-serif;

	font-size: 1.0625rem;
	line-height: 1.7;
	text-align: left;
}

body > header,
body > main,
body > footer {
	width: min(100%, var(--content-width));
	max-width: var(--content-width);
	margin-left: var(--page-left-margin);
	margin-right: auto;
}

body > main {
	margin-top: 3rem;
}

body > footer {
	margin-top: 4rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.95rem;
}

.site-header {
	margin-bottom: 3rem;
}

.site-title {
	margin: 0;
	font-size: 2rem;
	line-height: 1.2;
}

.site-title a {
	color: inherit;
	text-decoration: none;
}

.site-description {
	margin-top: 0.5rem;
	color: var(--muted);
}

h1 {
	font-family: sans-serif;
	border-bottom: 1px solid #ccc;
	padding-bottom: 0.2em;
	margin-top: 2em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-top: 2.2em;
	margin-bottom: 0.6em;
	line-height: 1.25;
	color: #111827;
}

h1 {
	margin-top: 0;
	font-size: 2rem;
}

h2 {
	font-size: 1.55rem;
}

h3 {
	font-size: 1.25rem;
}

p {
	margin-top: 0;
	margin-bottom: 1.25em;
}

h1 + p,
h2 + p,
h3 + p {
	margin-top: 0;
}

p,
li {
	text-align: left;
	hyphens: none;
}

a {
	color: var(--link);
	text-underline-offset: 0.15em;
}

a:hover {
	text-decoration-thickness: 0.12em;
}

a:visited {
	color: var(--link);
}

/* ---------- Article list ---------- */

.article-list {
	padding-left: 0;
	list-style: none;
}

.article-item {
	margin-bottom: 2rem;
}

.article-title {
	margin-bottom: 0.25rem;
	font-size: 1.2rem;
}

.article-title a {
	color: inherit;
	text-decoration: none;
  	position: relative;
}

.article-title a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;

  width: 100%;
  height: 2px;
  background: var(--link);

  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.article-title a:hover::after {
  transform: scaleX(1);
}

.article-meta {
	margin-bottom: 0.5rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.article-summary {
	margin-bottom: 0;
	color: #374151;
}

/* ---------- Article pages ---------- */

article {
	width: 100%;
	max-width: var(--content-width);
}

article header {
	margin-bottom: 3rem;
}

article header h1 {
	margin-bottom: 0.4rem;
}

article time,
.date {
	color: var(--muted);
	font-size: 0.95rem;
}

/* ---------- Lists ---------- */

ul,
ol {
	padding-left: 1.5rem;
	margin-top: 0;
	margin-bottom: 1.25em;
}

li {
	margin-bottom: 0.4em;
}

li > ul,
li > ol {
	margin-top: 0.4em;
	margin-bottom: 0.4em;
}

/* ---------- Blockquotes ---------- */

blockquote {
	margin: 1.8rem 0;
	padding-left: 1rem;
	border-left: 4px solid var(--border);
	color: #374151;
}

blockquote p:last-child {
	margin-bottom: 0;
}

/* ---------- Code ---------- */

code,
pre {
	font-family:
	ui-monospace,
	SFMono-Regular,
	Menlo,
	Monaco,
	Consolas,
	"Liberation Mono",
	monospace;
}

code {
	padding: 0.1em 0.25em;
	border-radius: 0.25rem;
	background: var(--surface);
	font-size: 0.95em;
}

pre {
	max-width: 100%;
	overflow-x: auto;
	padding: 1rem;
	border-radius: 0.5rem;
	background: var(--surface);
	border: 1px solid var(--border);
	line-height: 1.5;
}

pre code {
	padding: 0;
	background: transparent;
	font-size: 0.95rem;
}

/* ---------- Images and media ---------- */

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

figure {
	margin: 2rem 0;
}

figcaption {
	margin-top: 0.5rem;
	color: var(--muted);
	font-size: 0.95rem;
	text-align: center;
}

/* ---------- Tables ---------- */

table {
	width: 100%;
	border-collapse: collapse;
	margin: 2rem 0;
	font-size: 0.95rem;
}

th,
td {
	padding: 0.5rem;
	border: 1px solid var(--border);
	text-align: left;
}

th {
	background: var(--surface);
}

/* ---------- Horizontal rule ---------- */

hr {
	margin: 3rem 0;
	border: 0;
	border-top: 1px solid var(--border);
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
	body {
		padding: 1.25rem 1rem;
		font-size: 1rem;
	}

	body > header,
	body > main,
	body > footer {
		width: auto;
		max-width: var(--content-width);
		margin-left: 0;
		margin-right: 0;
	}

	.site-title {
		font-size: 1.7rem;
	}

	h1 {
		font-size: 1.7rem;
	}

	h2 {
		font-size: 1.35rem;
	}
}

.site-title a:visited {
	color: inherit;
	text-decoration: none;
}

/* Dark mode */

@media (prefers-color-scheme: dark) {
	:root {
		--text: #e5e7eb;
		--muted: #9ca3af;
		--background: #1e1e1e;
		--surface: #2d2d2d;
		--border: #444;
		--link: #fab387;
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		color: #f9fafb;
	}

	article a:visited {
		color: var(--link);
	}

}
