@charset "UTF-8";

/* =========================================================
   Tokens
   ========================================================= */

:root {
	/* Palette — unchanged */
	--bg-color: rgb(30, 30, 46);
	--text-color: rgb(205, 214, 244);
	--subtext0-color: rgb(166, 173, 200);
	--subtext1-color: rgb(186, 194, 222);
	--accent-color: rgb(250, 179, 135);
	--crust-color: rgb(17, 17, 27);

	/* Surfaces and rules, derived from the palette above */
	--surface-color: var(--crust-color);
	--border-color: rgba(166, 173, 200, 0.16);
	--accent-faded: rgba(250, 179, 135, 0.4);

	/* System font stacks — nothing to download.
	   Liberation Serif / Nimbus Roman are the metric-compatible
	   Times New Roman substitutes on Linux. */
	--font-serif: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", "Noto Serif", Georgia, serif;
	--font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "Fira Code", Menlo, Consolas, "DejaVu Sans Mono", monospace;

	/* Type scale — 1.22 ratio off an 18px body.
	   Sized up from the sans version: Times has a small x-height,
	   so it reads a step smaller at equal pixel size. */
	--fs-xs: 0.875rem;    /* 14px — footer */
	--fs-sm: 1rem;        /* 16px — nav, meta */
	--fs-base: 1.125rem;  /* 18px — body */
	--fs-md: 1.375rem;    /* 22px — h3 */
	--fs-lg: 1.625rem;    /* 26px — h2, logo */
	--fs-xl: 2.125rem;    /* 34px — h1 */
	--fs-code: 0.9375rem; /* 15px — code blocks (mono runs large) */

	/* Rhythm */
	--space: 1.5rem;
	--radius: 8px;
	--measure: 45rem;
}

/* =========================================================
   Reset
   ========================================================= */

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

html {
	font-size: 100%;
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	font-family: var(--font-serif);
	font-size: var(--fs-base);
	line-height: 1.65;
	background-color: var(--bg-color);
	color: var(--text-color);
	max-width: var(--measure);
	margin: 0 auto;
	padding: 2.5rem 1.5rem 3rem;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--accent-color);
	color: var(--crust-color);
}

:focus-visible {
	outline: 2px solid var(--accent-color);
	outline-offset: 3px;
	border-radius: 2px;
}

/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 700;
	line-height: 1.2;
	text-wrap: balance;
	margin-bottom: 0.5em;
}

h1 { font-size: var(--fs-xl); margin-top: 2.5rem; }
h2 { font-size: var(--fs-lg); margin-top: 2.25rem; }
h3 { font-size: var(--fs-md); margin-top: 2rem; }
h4 { font-size: var(--fs-base); margin-top: 1.75rem; }

h5,
h6 {
	font-size: var(--fs-sm);
	color: var(--subtext1-color);
	margin-top: 1.75rem;
}

:is(h1, h2, h3, h4, h5, h6):first-child {
	margin-top: 0;
}

p {
	margin-bottom: 1.15em;
	text-wrap: pretty;
}

ul,
ol {
	margin-bottom: 1.15em;
	padding-left: 1.5rem;
}

li {
	margin-bottom: 0.35em;
}

li > ul,
li > ol {
	margin: 0.35em 0 0;
}

li::marker {
	color: var(--subtext0-color);
}

strong,
b {
	font-weight: 700;
}

blockquote {
	margin-bottom: var(--space);
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 3px solid var(--accent-color);
	color: var(--subtext1-color);
}

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

img {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto var(--space);
	border-radius: var(--radius);
}

/* =========================================================
   Links
   ========================================================= */

a,
a:visited {
	color: var(--accent-color);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

/* Prose links carry a quiet underline so they read as links in a paragraph. */
main :is(p, li, td, blockquote) a {
	text-decoration: underline;
	text-decoration-color: var(--accent-faded);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

main :is(p, li, td, blockquote) a:hover {
	text-decoration-color: var(--accent-color);
}

/* =========================================================
   Code
   ========================================================= */

code,
kbd,
samp,
pre {
	font-family: var(--font-mono);
	font-feature-settings: "liga" 0;
}

/* Inline code — kept tight so it doesn't push the serif line box open */
:not(pre) > code {
	font-size: 0.85em;
	line-height: 1;
	background-color: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: 4px;
	padding: 0.12em 0.35em;
	white-space: break-spaces;
}

/* Fenced blocks */
pre {
	font-size: var(--fs-code);
	line-height: 1.6;
	background-color: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: var(--radius);
	padding: 1rem 1.15rem;
	margin-bottom: var(--space);
	overflow-x: auto;
	tab-size: 4;
	scrollbar-width: thin;
	scrollbar-color: rgba(166, 173, 200, 0.3) transparent;
}

pre code {
	font-size: inherit;
	background: none;
	border: 0;
	padding: 0;
	white-space: pre;
}

pre::-webkit-scrollbar {
	height: 10px;
}

pre::-webkit-scrollbar-track {
	background: transparent;
}

pre::-webkit-scrollbar-thumb {
	background: rgba(166, 173, 200, 0.25);
	border-radius: 999px;
}

pre::-webkit-scrollbar-thumb:hover {
	background: rgba(166, 173, 200, 0.4);
}

:is(h1, h2, h3, h4) code {
	font-size: 0.9em;
	font-style: normal;
}

/* =========================================================
   Tables
   ========================================================= */

table {
	width: 100%;
	max-width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-sm);
	line-height: 1.5;
	margin-bottom: var(--space);
}

th,
td {
	text-align: left;
	vertical-align: top;
	padding: 0.6rem 0.9rem;
	border-bottom: 1px solid var(--border-color);
}

thead th {
	color: var(--subtext1-color);
	font-weight: 700;
}

tbody tr:last-child td {
	border-bottom: 0;
}

:is(th, td):first-child { padding-left: 0; }
:is(th, td):last-child { padding-right: 0; }

/* Label/value pairs (contact, project lists) — not a data table. */
.meta-tbl {
	width: auto;
	font-size: var(--fs-base);
}

.meta-tbl td {
	border: 0;
	padding: 0.15rem 0;
	line-height: 1.5;
}

.meta-tbl td:first-child {
	color: var(--subtext0-color);
	padding-right: 1.25rem;
	white-space: nowrap;
}

/* =========================================================
   Site header
   ========================================================= */

body > header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.25rem 1.5rem;
	padding-bottom: 1rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--border-color);
}

#logo {
	font-size: var(--fs-lg);
	font-weight: 700;
	margin: 0;
}

#logo a,
#logo a:visited {
	color: var(--text-color);
	text-decoration: none;
}

#logo a:hover {
	color: var(--accent-color);
}

.menu {
	font-size: var(--fs-sm);
	margin: 0;
	padding: 0;
}

.menu li {
	display: inline;
	margin: 0;
}

.menu a,
.menu a:visited {
	color: var(--subtext0-color);
}

.menu a:hover {
	color: var(--accent-color);
	text-decoration: none;
}

.menu li:not(:first-child)::before {
	content: "|";
	padding: 0 0.6em;
	color: var(--border-color);
}

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

.article-meta > header {
	padding-bottom: 1.25rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--border-color);
}

.article-meta > header h1 {
	font-size: clamp(2rem, 1.5rem + 2.4vw, 2.625rem);
	margin: 0;
}

.article-meta .info {
	font-size: var(--fs-sm);
	color: var(--subtext0-color);
	margin: 0.6rem 0 0;
	font-variant-numeric: tabular-nums;
}

/* =========================================================
   Post list
   ========================================================= */

ul.posts {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--border-color);
}

ul.posts li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0 1.5rem;
	margin: 0;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--border-color);
}

/* Titles here are a link list, not prose — no standing underline. */
ul.posts a {
	text-decoration: none;
}

ul.posts a:hover {
	text-decoration: underline;
	text-decoration-color: var(--accent-color);
}

ul.posts .date {
	font-size: var(--fs-sm);
	color: var(--subtext0-color);
	margin: 0;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

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

footer {
	font-size: var(--fs-xs);
	color: var(--subtext0-color);
	margin-top: 4rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--border-color);
}

main > :last-child,
article > :last-child,
main :last-child > :last-child {
	margin-bottom: 0;
}

/* =========================================================
   Small screens
   ========================================================= */

@media (max-width: 40rem) {
	:root {
		--fs-xl: 1.875rem;
		--fs-lg: 1.5rem;
		--fs-md: 1.25rem;
	}

	body {
		padding: 2rem 1.125rem 2.5rem;
	}

	pre {
		padding: 0.875rem 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
