/*
 * Turbo Logic — Terminal Brutalism (Turbo Pascal / BBS)
 * Mobile-first, single stylesheet, template-driven static site
 */

@font-face {
	font-family: "Helix Mono";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("fonts/HelixMono-Regular.woff2") format("woff2");
}

@font-face {
	font-family: "Helix Mono";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("fonts/HelixMono-Bold.woff2") format("woff2");
}

:root {
	--unit: 8px;
	--char-unit: 8px;
	--gutter: 16px;
	--margin-page: 24px;
	/* CRT-style: use the glass — thin bezel, no artificial max column */
	--page-inset: 8px;
	--spacing-component: 12px;
	--spacing-section: 20px;
	--spacing-major: 40px;
	--container-max: calc(100vw - 2 * var(--page-inset));
	/* Landscape monitors: 1920×1080/1200, 2560×1440/1600 */
	--bp-widescreen: 1600px;
	--bp-fullhd-plus: 1920px;
	--bp-ultrawide: 2560px;
	/* Blog article reading measure (mono) */
	--read-measure: 72ch;
	--read-column: 84ch;
	--read-media-max: 72ch;
	--read-code-max: 80ch;

	/* Turbo Logic tokens */
	--background: #0d141e;
	--on-background: #dde2f1;
	--surface: #0d141e;
	--on-surface: #dde2f1;
	--on-surface-variant: #c5c6ca;
	--surface-container: #1a202a;
	--surface-container-low: #161c26;
	--surface-container-high: #242a35;
	--surface-container-highest: #2f3540;
	--surface-variant: #2f3540;
	--primary: #ffffff;
	--primary-fixed-dim: #c3c7cc;
	--secondary: #e9c34d;
	--secondary-container: #af8d17;
	--tertiary-fixed-dim: #97cfe0;
	--tertiary-container: #b3ecfc;
	--outline: #8f9194;
	--outline-variant: #44474a;
	--error: #ffb4ab;

	/* Legacy aliases (compat during migration) */
	--polar-night-1: var(--background);
	--polar-night-2: var(--surface-container);
	--polar-night-3: var(--surface-container-high);
	--polar-night-4: var(--outline-variant);
	--snow-storm-1: var(--primary);
	--snow-storm-2: var(--on-surface-variant);
	--snow-storm-3: var(--outline);
	--frost-1: var(--tertiary-fixed-dim);
	--frost-2: var(--secondary);
	--frost-3: var(--secondary-container);
	--frost-4: var(--outline-variant);
	--aurora-1: var(--error);
	--aurora-2: #ff6644;
	--aurora-3: var(--secondary);
	--aurora-4: #44ff88;
	--aurora-5: var(--tertiary-container);

	--font-mono: "Helix Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	--font-size-base: 1rem;
	--line-height: 1.6;
	--radius-ui: 0;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms;
		animation-iteration-count: 1;
		transition-duration: 0.01ms;
		scroll-behavior: auto;
	}
}

/* Skip link for accessibility */
.skip-link {
	position: absolute;
	top: -100px;
	left: 0;
	background: var(--polar-night-2);
	color: var(--frost-2);
	padding: 0.5rem 1rem;
	text-decoration: none;
	z-index: 10000;
	border: 1px solid var(--frost-2);
	clip: rect(0, 0, 0, 0);
	overflow: hidden;

	&:focus {
		top: 0.5rem;
		left: 0.5rem;
		clip: auto;
		overflow: visible;
	}
}

/* Base styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: var(--font-mono);
	font-size: var(--font-size-base);
	line-height: var(--line-height);
	color: var(--snow-storm-2); /* Silver-like text, easy on eyes */
	background-color: var(--polar-night-1);
	padding: var(--unit) var(--spacing-component);
	max-width: 100%;
	overflow-x: hidden;
	min-height: 100vh;
}

@media (min-width: 768px) {
	body {
		padding: var(--unit) var(--page-inset);
	}
}

/* Container */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin: 0 auto;
	padding: var(--unit);
	box-sizing: border-box;
	container-type: inline-size;
}

@container (min-width: 768px) {
	.container {
		padding: var(--unit) var(--gutter);
	}
}

/* Header */
header {
	display: block;
	text-align: left;
	padding-bottom: var(--spacing-component);
	border-bottom: 1px solid var(--polar-night-4);
	margin-bottom: var(--spacing-section);
}

.site-title {
	font-size: clamp(1.8rem, 6vw, 2.2rem);
	letter-spacing: 0.05em;
	color: #a8d0e0; /* Brighter blue for better contrast */
	margin-bottom: var(--unit);
	text-align: left;
	font-weight: bold;

	/* Don't add brackets to site title (it's a quote) */
	&::before,
	&::after {
		display: none;
	}
}


.site-description {
	font-size: clamp(0.9rem, 3vw, 1rem);
	max-width: 100%;
	color: var(--snow-storm-2); /* Light cyan */
	margin-bottom: 1.5rem;
	text-align: left;
}

/* Navigation - PlanetScale style */
.nav-mobile {
	margin: var(--spacing-section) 0 var(--spacing-component);
	width: 100%;

	summary {
		cursor: pointer;
		font-weight: bold;
		color: var(--frost-1);
		padding: var(--unit) 0;
		list-style: none;
		user-select: none;

		&::marker {
			display: none;
		}

		&::-webkit-details-marker {
			display: none;
		}

		&::before {
			content: "[";
			color: var(--frost-1);
			opacity: 0.8;
			margin-right: calc(var(--unit) / 2);
		}

		&::after {
			content: "]";
			color: var(--frost-1);
			opacity: 0.8;
			margin-left: calc(var(--unit) / 2);
		}

		&:hover {
			color: var(--frost-2);

			&::before,
			&::after {
				opacity: 1;
			}
		}
	}

	&[open] summary {
		margin-bottom: var(--unit);
	}
}

.dashed-box {
	border: 1px dashed var(--polar-night-4);
	padding: var(--spacing-component);
	margin-top: var(--unit);
	background-color: var(--polar-night-2);
	/* Subtle cyan tint in background */
	box-shadow: inset 0 0 20px rgba(136, 192, 208, 0.05);

	&:hover {
		border-color: var(--frost-4);
		box-shadow: inset 0 0 20px rgba(136, 192, 208, 0.08);
	}
}

nav.dashed-box {
	.nav-list {
		list-style: none;
		display: flex;
		flex-wrap: wrap;
		gap: var(--unit);
		margin: 0;
		padding: 0;
		align-items: center;

		li {
			display: flex;
			align-items: center;
		}

		.nav-separator {
			color: var(--polar-night-4);
			user-select: none;
			opacity: 0.6;
		}

		a {
			--nav-color: var(--frost-1);
			color: var(--nav-color);
			text-decoration: none;
			font-weight: bold;
			transition: all 0.2s ease;
			position: relative;
			white-space: nowrap;
			font-size: 1.2rem;

			&::before {
				content: "[";
				color: var(--nav-color);
				opacity: 0.7;
			}

			&::after {
				content: "]";
				color: var(--nav-color);
				opacity: 0.7;
			}

			/* Underline for current page */
			&[aria-current="page"] {
				text-decoration: underline;
				text-decoration-thickness: 2px;
				text-underline-offset: 4px;
				text-decoration-color: var(--nav-color);

				&::before,
				&::after {
					opacity: 1;
				}
			}

			&:hover {
				color: var(--nav-color);
				opacity: 0.9;

				&::before,
				&::after {
					opacity: 1;
				}
			}

			&:focus-visible {
				outline: 2px solid var(--nav-color);
				outline-offset: 2px;
			}
		}

		/* Individual nav item colors */
		li:nth-child(1) a {
			--nav-color: var(--frost-1);
		}
		li:nth-child(3) a {
			--nav-color: var(--aurora-4);
		}
		li:nth-child(5) a {
			--nav-color: var(--aurora-3);
		}
		li:nth-child(7) a {
			--nav-color: var(--aurora-2);
		}
		li:nth-child(9) a {
			--nav-color: var(--aurora-5);
		}
		li:nth-child(11) a {
			--nav-color: var(--frost-2);
		}
	}
}

/* Desktop: always visible, no details/summary */
@media (min-width: 1024px) {
	.nav-mobile {
		summary {
			display: none;
		}

		.dashed-box {
			margin-top: 0;
		}
	}
}

/* Mobile: use details/summary */
@media (max-width: 1023px) {
	.nav-mobile {
		&:not([open]) .dashed-box {
			display: none;
		}
	}
}



/* Main content */
main {
	padding: var(--unit) 0;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	display: block;
	overflow-x: clip;

	.terminal,
	.bbs-box {
		margin-left: 0;
		margin-right: 0;
	}

	@media (max-width: 480px) {
		h2 {
			text-align: left;
		}
	}
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--frost-1); /* Primary accent for headings */
	margin: var(--spacing-component) 0 var(--unit);
	position: relative;
	font-weight: bold;
}

h1 {
	font-size: 1.8rem;
	color: #a8d0e0; /* Brighter blue for better contrast */

	&::before {
		content: "[";
		color: #a8d0e0;
		opacity: 0.8;
		margin-right: calc(var(--unit) / 4);
	}

	&::after {
		content: "]";
		color: #a8d0e0;
		opacity: 0.8;
		margin-left: calc(var(--unit) / 4);
	}
}

h2 {
	font-size: 1.5rem;
	color: #9bc5d5; /* Brighter blue for better contrast */

	&::before {
		content: "[";
		color: #9bc5d5;
		opacity: 0.75;
		margin-right: calc(var(--unit) / 4);
	}

	&::after {
		content: "]";
		color: #9bc5d5;
		opacity: 0.75;
		margin-left: calc(var(--unit) / 4);
	}

	/* Exclude post titles from brackets (they're inside links that have brackets) */
	&.post-title {
		&::before,
		&::after {
			display: none;
		}
	}
}

h3 {
	font-size: 1.3rem;
	color: #8db3c8; /* Brighter blue for better contrast */

	&::before {
		content: "[";
		color: #8db3c8;
		opacity: 0.7;
		margin-right: calc(var(--unit) / 4);
	}

	&::after {
		content: "]";
		color: #8db3c8;
		opacity: 0.7;
		margin-left: calc(var(--unit) / 4);
	}
}

/* Clean typography for blog post content - no brackets */
article h1,
article h2,
article h3,
article h4,
article h5,
article h6,
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6,
.blog-post h1,
.blog-post h2,
.blog-post h3,
.blog-post h4,
.blog-post h5,
.blog-post h6,
#blog-post-content article h1,
#blog-post-content article h2,
#blog-post-content article h3,
#blog-post-content article h4,
#blog-post-content article h5,
#blog-post-content article h6 {
	&::before,
	&::after {
		display: none !important;
	}

	color: var(--snow-storm-1); /* Clean, bright text for readability */
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

article h1,
.post-content h1,
.blog-post h1,
#blog-post-content article h1 {
	/*font-size: 2.5rem;*/
	margin-top: var(--spacing-section);
	margin-bottom: var(--unit);
	color: var(--snow-storm-1);
}

article h2,
.post-content h2,
.blog-post h2,
#blog-post-content article h2 {
	font-size: 1.75rem;
	margin-top: var(--spacing-component);
	margin-bottom: var(--unit);
	color: var(--snow-storm-1);
}

article h3,
.post-content h3,
.blog-post h3,
#blog-post-content article h3 {
	font-size: 1.4rem;
	margin-top: var(--spacing-component);
	margin-bottom: var(--unit);
	color: var(--snow-storm-1);
}

article h4,
.post-content h4,
.blog-post h4,
#blog-post-content article h4 {
	font-size: 1.2rem;
	margin-top: var(--spacing-component);
	margin-bottom: var(--unit);
	color: var(--snow-storm-1);
}

article h5,
.post-content h5,
.blog-post h5,
#blog-post-content article h5,
article h6,
.post-content h6,
.blog-post h6,
#blog-post-content article h6 {
	font-size: 1.1rem;
	margin-top: var(--spacing-component);
	margin-bottom: var(--unit);
	color: var(--snow-storm-1);
}

h4 {
	font-size: 1.1rem;
}

h5,
h6 {
	font-size: 1rem;
}

/* Links */
a {
	color: var(--frost-2); /* Secondary accent for links */
	text-decoration: none;
	transition: color 0.2s ease;
	position: relative;

	/* Skip bracket styling for navigation links and post content links */
	&:not(nav a):not(.skip-link):not(.menu-toggle):not(.submit-btn):not(.theme-toggle):not(.post-content a):not(article a):not(.blog-post a) {
		&::before {
			content: "[";
			color: var(--frost-2);
			opacity: 0.8;
		}

		&::after {
			content: "]";
			color: var(--frost-2);
			opacity: 0.8;
		}

		&:hover {
			color: var(--frost-1); /* Primary accent on hover */

			&::before,
			&::after {
				color: var(--frost-1);
				opacity: 1;
			}
		}
	}

	&:focus-visible {
		outline: 2px solid var(--frost-1);
		outline-offset: 2px;
		border-radius: 2px;
	}
}

/* Text elements */
p {
	margin-bottom: var(--spacing-component);
	color: var(--snow-storm-2); /* Silver-like, easy on eyes */
	line-height: 1.7; /* Slightly more spacing for readability */
}

ul,
ol {
	margin: var(--spacing-component) 0;
	padding-left: var(--spacing-section);
}

blockquote {
	border-left: 3px solid var(--polar-night-4);
	padding-left: var(--spacing-component);
	margin: var(--spacing-component) 0;
	color: var(--snow-storm-2);
}

code,
pre {
	font-family: var(--font-mono);
	background-color: var(--polar-night-2);
	border-radius: 3px;
}

code {
	padding: 0.2rem 0.4rem;
	font-size: 0.9em;
}

pre {
	padding: 1rem;
	margin: 1rem 0;
	overflow-x: auto;

	code {
		padding: 0;
		background-color: transparent;
	}
}

/* BBS-style elements */
.bbs-box {
	border: 1px solid var(--polar-night-4);
	padding: var(--spacing-component);
	margin: var(--spacing-component) 0;
	background-color: var(--polar-night-2);
	box-shadow: 0 var(--unit) var(--spacing-major) rgba(136, 192, 208, 0.1);
	border-radius: calc(var(--unit) / 4);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	/* Subtle blue glow on border for cyberpunk feel */
	border-color: var(--polar-night-4);

	&:hover {
		border-color: var(--frost-4);
		box-shadow: 0 var(--unit) var(--spacing-major) rgba(136, 192, 208, 0.15);
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		color: var(--frost-2);
		margin: var(--spacing-section) 0 var(--spacing-component);
	}

	h1 {
		font-size: 1.8rem;
	}
	h2 {
		font-size: 1.5rem;
	}
	h3 {
		font-size: 1.3rem;
	}
	h4 {
		font-size: 1.1rem;
	}
	h5,
	h6 {
		font-size: 1rem;
	}

	p {
		margin-bottom: var(--spacing-component);
		line-height: 1.6;
	}

	ul,
	ol {
		margin: var(--spacing-component) 0;
		padding-left: var(--spacing-section);
	}

	li {
		margin-bottom: 0.5rem;
	}

	blockquote {
		border-left: 3px solid var(--polar-night-4);
		padding-left: 1rem;
		margin: 1rem 0;
		color: var(--snow-storm-2);
		font-style: italic;
	}

	code {
		font-family: var(--font-mono);
		background-color: var(--polar-night-3);
		padding: 0.2rem 0.4rem;
		font-size: 0.9em;
		border-radius: 3px;
	}

	pre {
		font-family: var(--font-mono);
		background-color: var(--polar-night-3);
		padding: 1rem;
		margin: 1rem 0;
		overflow-x: auto;
		border-radius: 3px;
		border: 1px solid var(--polar-night-4);

		code {
			padding: 0;
			background-color: transparent;
			border: none;
		}
	}

	strong,
	b {
		font-weight: bold;
		color: var(--frost-1);
	}

	em,
	i {
		font-style: italic;
	}

	a {
		color: var(--frost-3);
		text-decoration: none;
		border-bottom: 1px dotted var(--frost-4);
		transition: color 0.2s ease, border-color 0.2s ease;

		&:hover {
			color: var(--frost-2);
			border-bottom-color: var(--frost-2);
		}
	}

	table {
		width: 100%;
		border-collapse: collapse;
		margin: 1rem 0;

		th,
		td {
			border: 1px solid var(--polar-night-4);
			padding: 0.5rem;
			text-align: left;
		}

		th {
			background-color: var(--polar-night-3);
			font-weight: bold;
			color: var(--frost-2);
		}

		tr:nth-child(even) {
			background-color: var(--polar-night-2);
		}
	}

	hr {
		border: none;
		border-top: 1px solid var(--polar-night-4);
		margin: 2rem 0;
	}
}

.bbs-header {
	border-bottom: 1px dashed var(--polar-night-4);
	padding-bottom: var(--unit);
	margin-bottom: var(--unit);
	font-weight: bold;
	color: var(--frost-1);
	position: relative;

	&::before {
		content: "[";
		color: var(--frost-1);
		opacity: 0.6;
		margin-right: calc(var(--unit) / 4);
	}

	&::after {
		content: "]";
		color: var(--frost-1);
		opacity: 0.6;
		margin-left: calc(var(--unit) / 4);
	}
}

.bbs-box.error {
	border-color: var(--aurora-1);
	background-color: color-mix(in srgb, var(--aurora-1) 10%, var(--polar-night-2));
}

/* Blog post lists */
.post-list {
	list-style: none;
	padding: 0;
}

.post-item {
	margin-bottom: var(--spacing-section);
	padding: var(--unit);
	padding-bottom: var(--spacing-section);
	border-bottom: 1px dashed var(--polar-night-4);
	transition: all 0.2s ease;
	border-radius: calc(var(--unit) / 4);

	&:hover {
		background-color: var(--polar-night-2);
		border-bottom-color: var(--frost-4);
	}
}

.post-title {
	font-size: 1.3rem;
	margin-bottom: var(--unit);
	color: #9bc5d5; /* Brighter blue for better contrast */
	font-weight: bold;

	a {
		transition: color 0.2s ease;
		color: #9bc5d5;

		&:hover {
			color: #a8d0e0; /* Even brighter on hover */
		}
	}
}

.post-meta {
	font-size: 0.9rem;
	color: var(--snow-storm-3); /* Tertiary text for metadata */
	margin-bottom: var(--unit);
}

.post-excerpt {
	margin-bottom: var(--spacing-component);
}

/* Portfolio grid */
.portfolio-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--spacing-section);
	margin: var(--spacing-section) 0;
	max-width: 100%;
}

@media (min-width: 480px) {
	.portfolio-grid {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	}
}

@media (min-width: 768px) {
	.portfolio-grid {
		grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	}
}

.portfolio-item {
	border: 1px solid var(--polar-night-4);
	padding: var(--spacing-component);
	background-color: var(--polar-night-2);
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: left;
	width: 100%;
	box-sizing: border-box;

	&:hover {
		background-color: var(--polar-night-3);
		border-color: var(--frost-4);
		box-shadow: 0 var(--spacing-component) var(--spacing-section) rgba(136, 192, 208, 0.15);
	}

	img {
		max-width: 100%;
		height: auto;
		border-radius: 5px;
		margin-bottom: 1rem;
	}

	.ascii-art {
		font-family: var(--font-mono);
		margin: 0.75rem auto;
		max-width: 100%;
		font-size: clamp(0.6rem, 2vw, 0.8rem);
		line-height: clamp(1, 2.5vw, 1.2);
	}

	@media (min-width: 768px) {
		.ascii-art {
			font-size: 0.7rem;
			line-height: 1;
		}
	}

	@media (max-width: 480px) {
		padding: 0.75rem;

		img {
			margin-bottom: 0.5rem;
		}
	}
}

/* Footer */
footer {
	margin-top: var(--spacing-major);
	padding-top: var(--spacing-section);
	border-top: 1px solid var(--polar-night-4);
	color: var(--snow-storm-3);
	font-size: 0.9rem;
	text-align: left;
}

.footer-links {
	margin-top: var(--spacing-component);

	a {
		margin-right: var(--spacing-component);
	}
}

/* Terminal-like elements - Cyberpunk aesthetic */
.terminal {
	background-color: var(--polar-night-1);
	padding: var(--spacing-section);
	border-radius: calc(var(--unit) / 4);
	overflow: auto;
	margin: var(--spacing-section) 0;
	max-width: 100%;
	width: 100%;
	border: 1px solid var(--polar-night-4);
	box-shadow:
		inset 0 0 var(--spacing-component) rgba(136, 192, 208, 0.1),
		0 var(--unit) var(--spacing-component) rgba(136, 192, 208, 0.15);
	position: relative;

	&::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		box-shadow: inset 0 0 10px var(--frost-1);
		opacity: 0.08;
		pointer-events: none;
		border-radius: inherit;
		z-index: 1;
	}

	&:hover {
		border-color: var(--frost-4);

		&::before {
			opacity: 0.12;
			box-shadow: inset 0 0 15px var(--frost-1);
			transition: all 0.4s ease;
		}
	}
}

.prompt {
	color: var(--frost-1);
	font-weight: bold;
}

.command {
	color: var(--snow-storm-1);
}

.output {
	color: var(--snow-storm-3);
	margin-top: 0.75rem;
	padding-left: 1.25rem;
	border-left: 2px solid var(--frost-4);
}

/* Special text highlighting */
.blog-post .post-content > pre:has(> code.language-diagram) {
	padding: var(--unit);
	border: 1px solid var(--outline-variant);
	background: var(--surface);
	overflow-x: auto;
	white-space: pre;
	font-variant-ligatures: none;
}

.blog-post .post-content > pre > code.language-diagram {
	display: block;
	width: max-content;
	font-family: inherit;
	white-space: inherit;
	overflow-wrap: normal;
	word-break: normal;
}

.highlight-1 {
	color: var(--frost-1);
}
.highlight-2 {
	color: var(--frost-2);
}
.highlight-3 {
	color: var(--frost-3);
}
.highlight-4 {
	color: var(--frost-4);
}

.alert-1 {
	color: var(--aurora-1);
}
.alert-2 {
	color: var(--aurora-2);
}
.alert-3 {
	color: var(--aurora-3);
}
.alert-4 {
	color: var(--aurora-4);
}
.alert-5 {
	color: var(--aurora-5);
}

/* Theme toggler */
.theme-toggle {
	position: fixed;
	bottom: 1rem;
	right: 1rem;
	background-color: var(--polar-night-2);
	color: var(--snow-storm-1);
	border: 1px solid var(--polar-night-4);
	padding: 0.5rem 0.75rem;
	font-family: var(--font-mono);
	cursor: pointer;
	z-index: 100;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	transition: all 0.3s ease;
	border-radius: 3px;

	&:hover {
		background-color: var(--polar-night-3);
	}

	&:focus-visible {
		outline: 2px solid var(--frost-2);
		outline-offset: 2px;
	}
}

.theme-toggle-icon {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	background-color: var(--frost-2);
}

/* ANSI-style Art (legacy class) */
.ansi-art {
	white-space: pre;
	font-family: var(--font-mono);
	font-size: clamp(0.58rem, 0.45vw + 0.48rem, 0.78rem);
	line-height: 1.2;
	margin: var(--spacing-component) auto;
	padding: var(--gutter);
	overflow: hidden;
	text-align: left;
	width: 100%;
	max-width: var(--read-code-max);
	display: block;
	background-color: var(--surface-container-low);
	border-radius: var(--radius-ui);
	border: 1px solid var(--outline-variant);
}

@media (min-width: 577px) and (max-width: 991px) {
	.ascii-art {
		font-size: 0.7rem;
		margin-left: auto;
		margin-right: auto;
	}
}

/* Contact Form Styles */
.contact-methods {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	margin: 1.5rem 0;
}

.contact-method {
	flex: 1 1 300px;
}

.contact-form {
	width: 100%;
}

.form-group {
	margin-bottom: 1.5rem;

	label {
		display: block;
		font-family: var(--font-mono);
		margin-bottom: 0.5rem;
		color: var(--frost-1);
	}

	input,
	textarea {
		width: 100%;
		padding: 0.75rem;
		border: 1px solid var(--polar-night-4);
		background-color: var(--polar-night-2);
		color: var(--snow-storm-1);
		font-family: var(--font-mono);
		font-size: 1rem;
		transition: border-color 0.3s, box-shadow 0.3s;

		&:focus {
			border-color: var(--frost-2);
			outline: none;
			box-shadow: 0 0 0 2px rgba(136, 192, 208, 0.25);
		}

		&:focus-visible {
			outline: 2px solid var(--frost-2);
			outline-offset: 2px;
		}
	}
}

.submit-btn {
	background-color: var(--frost-3);
	color: var(--polar-night-1);
	border: none;
	padding: 0.75rem 1.5rem;
	font-family: var(--font-mono);
	font-size: 1rem;
	cursor: pointer;
	transition: background-color 0.3s;

	&:hover {
		background-color: var(--frost-2);
	}

	&:focus-visible {
		outline: 2px solid var(--frost-2);
		outline-offset: 2px;
	}
}

.form-response {
	margin-top: 2rem;
}

.form-response--error .bbs-header {
	color: var(--error, #ff6b6b);
}

.contact-form__honeypot {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.submit-btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Blog Post Styling - Clean and Elegant */
.blog-post {
	/*max-width: 100ch; */ /* Optimal reading width */
	margin: 0 auto;
}

.post-header {
	margin-bottom: var(--spacing-component);
	border-bottom: 1px solid var(--polar-night-4);
	padding-bottom: var(--unit);
	max-width: var(--read-measure);
	width: 100%;
	margin-inline: auto;
}

.journal-scene {
	max-width: var(--read-measure);
	width: 100%;
	margin-inline: auto;
	margin-bottom: var(--spacing-component);
	padding: var(--unit);
	border: 1px solid var(--polar-night-4);
	background: var(--polar-night-2);
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--snow-storm-2);
}

.journal-scene__label {
	margin: 0;
	font-family: var(--font-mono, monospace);
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	color: var(--frost-2);
}

.journal-scene summary {
	cursor: pointer;
}

.journal-scene[open] summary {
	margin-bottom: var(--unit);
}

.journal-scene__body p {
	margin: 0 0 0.65rem;
}

.journal-scene__body p:last-child {
	margin-bottom: 0;
}

.journal-tldr {
	max-width: var(--read-measure);
	width: 100%;
	margin-inline: auto;
	margin-bottom: var(--spacing-component);
	padding: var(--unit);
	border: 1px solid var(--frost-4);
	background: var(--polar-night-1);
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--snow-storm-1);
}

.journal-tldr__label {
	margin: 0 0 0.75rem;
	font-family: var(--font-mono, monospace);
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	color: var(--frost-1);
}

.journal-tldr__body p {
	margin: 0 0 0.65rem;
}

.journal-tldr__body p:last-child {
	margin-bottom: 0;
}

.post-pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--unit);
	max-width: var(--read-measure);
	width: 100%;
	margin: var(--spacing-component) auto;
	padding-top: var(--unit);
	border-top: 1px solid var(--polar-night-4);
}

.post-pager__link {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	max-width: min(48%, 32ch);
	font-size: 0.9rem;
	line-height: 1.35;
	color: var(--frost-2);
	text-decoration: none;
}

.post-pager__link:hover,
.post-pager__link:focus-visible {
	color: var(--snow-storm-1);
	text-decoration: underline;
}

.post-pager__link--next {
	margin-left: auto;
	text-align: right;
}

.post-pager__dir {
	font-family: var(--font-mono, monospace);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	color: var(--frost-3);
}

.post-pager__title {
	font-weight: 500;
}

.blog-post .post-header .post-title-main,
#blog-post-content .post-title-main {
	font-size: clamp(1.375rem, 2.4vw, 2rem);
	font-weight: 700;
	color: var(--snow-storm-1);
	margin: 0 0 var(--unit);
	line-height: 1.2;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;

	&::before,
	&::after {
		display: none !important;
	}
}

.post-content {
	margin-top: var(--spacing-component);
	line-height: 1.6;
	color: var(--snow-storm-2);
	width: 100%;
	max-width: var(--read-measure);
	margin-inline: auto;
	min-width: 0;
	overflow-wrap: break-word;

	p {
		margin-bottom: var(--spacing-component);
	}

	& > table {
		max-width: 100%;
	}

	& > figure,
	& > img,
	& > picture,
	& > video,
	& > iframe {
		max-width: var(--read-media-max);
	}

	& > p:has(> img:only-child),
	& > p:has(> picture:only-child) {
		max-width: var(--read-media-max);
	}

	img,
	picture,
	video,
	iframe,
	svg {
		max-width: 100%;
		height: auto;
		display: block;
		margin-inline: auto;
	}

	figure {
		margin: var(--spacing-component) auto;
	}

	figure img {
		margin-inline: auto;
		max-width: 100%;
	}

	table {
		display: block;
		overflow-x: auto;
	}

	ul,
	ol {
		margin: var(--spacing-component) 0;
		padding-inline-start: 1.25em;
		list-style-position: outside;
	}

	li {
		margin-bottom: calc(var(--unit) / 2);
		padding-inline-start: 0;
	}

	/* Inline code: wrap inside measure — no horizontal scroll */
	code {
		background-color: var(--polar-night-2);
		padding: 0.15em 0.35em;
		border-radius: 3px;
		font-size: 0.85em;
		color: var(--frost-1);
		white-space: normal;
		overflow-wrap: anywhere;
		word-break: break-word;
	}

	/* Fenced blocks */
	& > pre {
		max-width: 100%;
		margin: var(--spacing-component) 0;
		padding: var(--unit);
		background: transparent;
		border: none;
		border-radius: 0;
		overflow-x: auto;
		white-space: pre-wrap;
		font-size: 0.875rem;
		line-height: 1.5;
		color: var(--snow-storm-2);

		code {
			background: transparent;
			padding: 0;
			color: inherit;
			font-size: inherit;
			white-space: inherit;
			overflow-wrap: anywhere;
			word-break: break-word;
		}
	}

	blockquote {
		border-left: 3px solid var(--frost-3);
		padding-left: var(--spacing-component);
		margin: var(--spacing-component) 0;
		color: var(--snow-storm-3);
		font-style: italic;
	}

	a {
		color: var(--frost-2);
		text-decoration: underline;
		text-decoration-thickness: 1px;
		text-underline-offset: 2px;

		&:hover {
			color: var(--frost-1);
		}

		&::before,
		&::after {
			display: none !important;
		}
	}
}

/* Article layout and contents navigation */
.blog-post-wrapper {
	--post-toc-width: min(16rem, 20vw);
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gutter);
	align-items: start;
	width: 100%;
	max-width: var(--read-column);
	margin: var(--gutter) auto;
	min-width: 0;
}

.blog-post-wrapper > .terminal-window {
	min-width: 0;
	width: 100%;
	margin: 0;
}

#blog-post-content {
	width: 100%;
}

@media (min-width: 1280px) {
	.article-page {
		--read-measure: 94ch;
		--read-column: 108ch;
	}
}

.article-page main {
	scroll-padding-block-start: var(--gutter);
}

.post-mobile-toc, .post-end {
	width: 100%;
	max-width: var(--read-measure);
	margin-inline: auto;
}

.post-mobile-toc summary {
	cursor: pointer;
}

.post-mobile-toc:not([open]) summary {
	border-bottom: 0;
}

.toc-sidebar {
	display: none;
}

.toc-list {
	list-style: none;
	margin: 0;
	padding: calc(var(--unit) / 2) var(--gutter);
}

.toc-item + .toc-item {
	border-top: 1px solid var(--outline-variant);
}

.toc-item a {
	display: block;
	padding: .45rem 0;
	color: var(--on-surface-variant);
	font-size: .875rem;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.toc-item a:hover {
	color: var(--secondary);
	text-decoration: underline;
}

.post-end-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--unit) var(--gutter);
	padding-block: var(--unit);
	border-top: 1px solid var(--outline-variant);
	font-size: .875rem;
}

.post-end-links a {
	text-decoration: underline;
	text-underline-offset: .2em;
}

.post-license {
	margin: 0;
	color: var(--on-surface-variant);
	font-size: .8125rem;
}

@media (min-width: 1024px) {
	.blog-post-wrapper:has(> .toc-sidebar) {
		max-width: calc(var(--read-column) + var(--post-toc-width) + var(--gutter));
		grid-template-columns: minmax(0, 1fr) var(--post-toc-width);
	}

	.blog-post-wrapper > .toc-sidebar {
		display: block;
		position: sticky;
		top: var(--unit);
		max-height: 60dvh;
		margin: 0;
		overflow-y: auto;
	}

	.post-mobile-toc {
		display: none;
	}
}

@media (max-width: 520px) {
	.post-pager__link {
		width: 100%;
		max-width: 100%;
	}

	.post-pager__link--next {
		text-align: left;
	}
}

/* Categories horizontal list */
.categories-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--unit);
	list-style: none;
	padding: 0;
	margin: 0;

	li {
		margin: 0;
	}
}

/* Keyboard navigation help */
.navigation-help.terminal-window {
	position: fixed;
	inset: 0;
	width: min(calc(100% - 2 * var(--gutter)), 30rem);
	max-height: calc(100dvh - 2 * var(--gutter));
	margin: auto;
	padding: 0;
	overflow-y: auto;
	color: var(--on-surface);
}

.navigation-help::backdrop {
	background: var(--background);
	opacity: .8;
}

.navigation-help dl {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	align-items: baseline;
	gap: var(--unit) var(--gutter);
	margin-block: calc(var(--unit) / 2) var(--gutter);
	font-size: .875rem;
}

.navigation-help dt {
	white-space: nowrap;
}

.navigation-help dd {
	margin: 0;
	color: var(--on-surface-variant);
}

.navigation-help kbd {
	display: inline-block;
	padding: 0 .3em;
	border: 1px solid var(--outline-variant);
	background: var(--surface-container);
	color: var(--tertiary-fixed-dim);
	font-family: inherit;
	font-size: .9em;
}

.navigation-help form {
	display: flex;
	justify-content: flex-end;
}

.navigation-help form button {
	font-size: .875rem;
}

/* Mobile responsiveness */
@media (max-width: 576px) {
	main {
		overflow-x: hidden;
	}
}

/* --- Turbo Logic components --- */

::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: var(--background);
}

::-webkit-scrollbar-thumb {
	background: var(--surface-variant);
}

::-webkit-scrollbar-thumb:hover {
	background: var(--outline-variant);
}

button,
input,
textarea,
select,
.bbs-box,
.terminal-window,
.portfolio-item,
.toc-sidebar {
	border-radius: var(--radius-ui);
}

/* Site chrome */
.site-chrome {
	border-bottom: 1px solid var(--outline-variant);
	margin-bottom: var(--spacing-component);
	padding-bottom: var(--unit);
}

.top-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--gutter);
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
}

.top-bar-brand {
	flex: 1 1 200px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--unit);
}

.btn-bracket.site-help {
	font-size: .875rem;
	white-space: nowrap;
}

.site-id {
	font-size: clamp(1.1rem, 4vw, 1.5rem);
	font-weight: 700;
	color: var(--secondary);
	margin: 0 0 calc(var(--unit) / 2);
	letter-spacing: -0.02em;

	&::before,
	&::after {
		display: none;
	}
}

.site-tagline {
	font-size: 0.75rem;
	color: var(--on-surface-variant);
	margin: 0;
}

.top-bar-nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gutter);
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;

	a {
		color: var(--on-surface-variant);
		font-size: 0.875rem;
		font-weight: 500;
		text-decoration: none;
		padding: calc(var(--unit) / 2) var(--unit);
		transition: color 0.15s ease, background-color 0.15s ease;

		&::before,
		&::after {
			display: none;
		}

		&:hover {
			color: var(--secondary);
			background-color: var(--surface-variant);
		}

		&[aria-current="page"], &[aria-current="location"] {
			color: var(--secondary);
			font-weight: 700;

			&::before {
				content: "> ";
				display: inline;
				color: var(--secondary);
			}
		}

		&:focus-visible {
			outline: 2px solid var(--secondary);
			outline-offset: 2px;
		}
	}
}

.nav-mobile summary.nav-mobile-summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--secondary);
	padding: calc(var(--unit) / 2) 0;
	list-style: none;
	user-select: none;

	&::marker,
	&::-webkit-details-marker {
		display: none;
	}
}

@media (min-width: 768px) {
	.nav-mobile summary.nav-mobile-summary {
		display: none;
	}

	.nav-mobile .top-bar-nav {
		display: flex !important;
	}
}

@media (max-width: 767px) {
	.nav-mobile:not([open]) .top-bar-nav {
		display: none;
	}

	.nav-mobile .top-bar-nav {
		width: 100%;
		flex-direction: column;
		align-items: flex-start;
		padding-top: var(--unit);
	}
}

.site-chrome .nav-mobile:not([open]) > .nav-mobile-summary {
	display: block;
}

/* Terminal windows */
.terminal-window {
	border: 1px solid var(--outline-variant);
	background-color: var(--surface-container-low);
	position: relative;
	margin: var(--spacing-component) 0;
	box-shadow: none;
}

.terminal-header {
	border-bottom: 1px solid var(--outline-variant);
	padding: 2px var(--gutter);
	background: var(--surface-container);
	font-size: 0.75rem;
	color: var(--secondary);
}

.terminal-window-body {
	padding: var(--unit) var(--gutter);
}

.terminal-window-body--compact {
	padding: var(--unit);
	font-size: 0.875rem;
}

/* BBS box aligns with terminal window */
.bbs-box {
	border-radius: var(--radius-ui);
	box-shadow: none;
	border-color: var(--outline-variant);
	background-color: var(--surface-container);
}

.bbs-header {
	color: var(--secondary);
}

/* Bracket controls */
.bracket-link,
.btn-bracket {
	display: inline-block;
	color: var(--secondary);
	font-weight: 500;
	text-decoration: none;
	padding: calc(var(--unit) / 2) var(--unit);
	border: 1px solid var(--secondary);
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	font-size: inherit;

	&::before,
	&::after {
		display: none !important;
	}

	&:hover {
		background-color: var(--secondary);
		color: var(--background);
	}
}

.tag-chip {
	display: inline-block;
	color: var(--tertiary-fixed-dim);
	background: var(--surface-variant);
	border: 1px solid var(--outline-variant);
	padding: 2px var(--unit);
	font-size: 0.75rem;
}

.cursor-block {
	display: inline-block;
	width: 8px;
	height: 1em;
	background-color: var(--secondary);
	vertical-align: text-bottom;
	margin-left: 4px;
	animation: turbo-cursor-blink 1s step-end infinite;
}

@media (prefers-reduced-motion: reduce) {
	.cursor-block {
		animation: none;
		opacity: 1;
	}
}

@keyframes turbo-cursor-blink {
	50% {
		opacity: 0;
	}
}

/* BBS page frame */
.board-page {
	min-height: 100dvh;
	padding-block: 0;
}
.board-page > .container {
	display: grid;
	grid-template-rows: auto minmax(8rem, 1fr) auto;
	height: 100vh;
	height: 100dvh;
	max-width: min(var(--container-max), clamp(78rem, 86vw, 100rem));
	padding-bottom: 0;
}
.board-page main {
	overflow-y: auto;
	scrollbar-gutter: stable;
}
.board-page main:focus-visible {
	outline: 2px solid var(--secondary);
	outline-offset: -2px;
}
.board-page .footer-chrome {
	margin-top: var(--unit);
}
.board-page .site-chrome {
	margin-bottom: 0;
}
.board-page .site-chrome .top-bar {
	align-items: center;
	row-gap: var(--unit);
}
.board-page .nav-mobile {
	width: auto;
	margin: 0;
}
.board-page .nav-mobile[open] > .nav-mobile-summary {
	display: none;
}
.board-page .nav-mobile .top-bar-nav {
	flex-direction: row;
	align-items: center;
	gap: calc(var(--unit) / 2) var(--unit);
	padding-top: 0;
}
.board-page .site-chrome .top-bar-nav a {
	padding-inline: calc(var(--unit) / 2);
}
.home-board, .board-column, .profile-layout, .profile-columns, .profile-stack {
	display: grid;
	gap: var(--gutter);
	align-content: start;
	min-width: 0;
}
.home-board, .profile-layout {
	margin-block: var(--gutter);
}
.home-board .terminal-window, .profile-layout .terminal-window {
	min-width: 0;
	margin: 0;
}
.board-page .terminal-header {
	min-height: 1.875rem;
	align-content: center;
}
.board-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0 var(--unit);
}
.board-bar h1, .board-bar h2 {
	margin: 0;
	font: inherit;
	color: inherit;
}
.board-bar h1::before, .board-bar h1::after, .board-bar h2::before, .board-bar h2::after {
	content: none;
}
.board-bar a {
	display: inline-block;
	padding-block: .15rem;
	color: inherit;
}
.board-list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.board-list li + li {
	border-top: 1px solid var(--outline-variant);
}
.board-list li {
	padding-block: 1rem;
}
.board-list li:first-child {
	padding-top: calc(var(--unit) / 2);
}
.board-list li:last-child {
	padding-bottom: calc(var(--unit) / 2);
}
.board-list a {
	color: var(--on-surface);
	font-weight: 700;
	overflow-wrap: anywhere;
}
.board-list a:hover {
	color: var(--secondary);
}
.board-list p {
	margin: .25rem 0 0;
	color: var(--on-surface-variant);
	font-size: .875rem;
}
.board-log li {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	gap: .2rem var(--unit);
}
.board-log p {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}
.board-log time {
	color: var(--secondary);
	font-size: .8125rem;
	padding-top: .2rem;
}
.whoami-name, .profile-title {
	color: var(--on-surface);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0;
}
.whoami-role, .profile-role {
	font-size: .875rem;
	margin: .2rem 0 .6rem;
}
.whoami-role {
	color: var(--on-surface-variant);
}
.board-bio {
	font-size: .875rem;
	margin: 0;
}
.home-welcome summary {
	cursor: pointer;
}
.home-welcome:not([open]) summary {
	border-bottom: 0;
}
@media (min-width: 768px) {
	.home-board, .profile-columns {
		grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
	}
}
@media (width < 1600px) {
	.board-log > li:nth-child(n + 4),
	.board-projects > li:nth-child(n + 3) {
		display: none;
	}
	.board-log > li:nth-child(3),
	.board-projects > li:nth-child(2) {
		padding-bottom: calc(var(--unit) / 2);
	}
}
@media (max-width: 520px) {
	.board-log li {
		grid-template-columns: 1fr;
	}
	.board-log time {
		padding: 0;
	}
	.board-page .nav-mobile {
		width: 100%;
	}
	.board-page .nav-mobile .top-bar-nav {
		justify-content: space-between;
	}
	.board-page .site-chrome .top-bar-nav a {
		font-size: .8125rem;
	}
}

.welcome-quote {
	border-left: 2px solid var(--secondary-container);
	padding-left: var(--gutter);
	margin: var(--unit) 0;
}

.prompt-line-meta {
	font-size: 0.75rem;
	color: var(--tertiary-fixed-dim);
	margin: 0 0 var(--unit);
}

.prompt-line {
	border: 1px dashed var(--outline-variant);
	padding: var(--unit) var(--gutter);
	font-size: 0.75rem;
	color: var(--on-surface-variant);
	margin-top: var(--spacing-component);
}

/* Blog archive rows */
.journal-columns {
	align-items: start;
}

@media (min-width: 768px) {
	.journal-archive {
		grid-column: 1;
		grid-row: 1;
	}

	.journal-start {
		grid-column: 2;
		grid-row: 1;
	}
}

.journal-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: calc(var(--unit) / 2) var(--gutter);
	padding-bottom: var(--unit);
	border-bottom: 1px solid var(--outline-variant);
	font-size: 0.875rem;

	select {
		min-width: 0;
		max-width: 100%;
		min-height: 2.25rem;
		padding: 0.25rem 0.5rem;
		color: var(--on-surface);
		background: var(--surface-container);
		border: 1px solid var(--outline-variant);
		font: inherit;
	}

	p {
		margin: 0 0 0 auto;
		color: var(--on-surface-variant);
	}
}

.post-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	margin: 0.4rem 0;
	padding: 0;
	list-style: none;

	a {
		display: inline-block;
		padding: 0.125rem 0.45rem;
		border: 1px solid var(--outline-variant);
		color: var(--frost-2);
		font-size: 0.8rem;
		text-decoration: none;

		&::before,
		&::after {
			display: none;
		}

		&:hover,
		&:focus-visible {
			border-color: var(--secondary);
			color: var(--secondary);
		}
	}
}

.post-list--archive {
	list-style: none;
	padding: 0;
	margin: 0;
}

.archive-year {
	margin-top: var(--unit);
	padding: .3rem var(--unit);
	background: var(--surface-container);
	border-bottom: 1px solid var(--outline-variant);
}

.archive-year h3 {
	color: var(--secondary);
	font-size: .875rem;
	margin: 0;
}

.archive-year h3::before, .archive-year h3::after {
	content: none;
}

.post-item--row {
	margin-bottom: 0;
	border-bottom: 1px solid var(--outline-variant);
	padding: calc(1.5 * var(--unit)) 0;

	.post-row {
		display: grid;
		grid-template-columns: 6.5rem minmax(0, 1fr);
		gap: .25rem var(--unit);
		align-items: baseline;
	}

	.post-entry-body:only-child {
		grid-column: 1 / -1;
	}

	.post-date-col {
		color: var(--secondary);
		font-size: .8125rem;
	}

	.post-title {
		margin: 0;
		font-size: 1rem;

		a {
			color: var(--on-surface);
			overflow-wrap: anywhere;

			&::before,
			&::after {
				display: none;
			}

			&:hover {
				color: var(--secondary);
			}
		}
	}

	.post-excerpt {
		margin: .25rem 0 0;
		color: var(--on-surface-variant);
		font-size: 0.875rem;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}
}

@media (max-width: 520px) {
	.journal-start .board-list li {
		padding-block: var(--unit);
	}

	.journal-start .board-list p {
		display: none;
	}

	.post-item--row .post-row {
		grid-template-columns: 1fr;
	}
}

.blog-layout {
	display: grid;
	gap: var(--spacing-component);
}

@media (min-width: 768px) {
	.blog-layout {
		grid-template-columns: minmax(0, 1fr) min(240px, 16vw);
	}
}

/* Footer chrome */
.footer-chrome {
	border-top: 1px solid var(--outline-variant);
	background: var(--surface-container);
	padding: var(--unit) 0;
	margin-top: var(--spacing-section);
}

.footer-chrome-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: var(--gutter);
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	font-size: 0.75rem;
}

.footer-status {
	color: var(--tertiary-fixed-dim);

	.status-online {
		color: var(--secondary);
	}
}

.footer-chrome-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--gutter);

	a {
		color: var(--on-surface-variant);

		&::before,
		&::after {
			display: none;
		}

		&:hover {
			color: var(--primary);
		}
	}
}

.footer-meta-block {
	margin-top: var(--unit);
	padding-top: var(--unit);
	border-top: 1px dashed var(--outline-variant);
	font-size: 0.85rem;
}

/* Projects */
.project-columns {
	align-items: start;
}

.project-build {
	display: grid;
	align-items: start;
	gap: var(--gutter);
	padding-block: var(--gutter);
}

.project-build + .project-build,
.project-clients > li {
	border-top: 1px solid var(--outline-variant);
}

.project-build > img {
	display: block;
	width: 100%;
	max-width: 26rem;
	height: auto;
	border: 1px solid var(--outline-variant);
}

.project-title {
	color: var(--on-surface);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	margin: 0;
	overflow-wrap: anywhere;
}

.project-title::before, .project-title::after {
	content: none;
}

.project-status {
	color: var(--on-surface-variant);
	font-size: .75rem;
	font-weight: 400;
}

.project-build-copy p, .project-clients p {
	font-size: .875rem;
	margin: calc(var(--unit) / 2) 0 0;
}

.project-build-copy .project-summary {
	color: var(--tertiary-fixed-dim);
	margin-bottom: var(--unit);
}

.project-links {
	display: flex;
	flex-wrap: wrap;
	gap: calc(var(--unit) / 2) var(--gutter);
}

.project-links a {
	color: var(--secondary);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: .2em;
}

.project-clients {
	display: grid;
	gap: 0 var(--gutter);
	padding: 0;
	margin: 0;
	list-style: none;
}

.project-clients > li {
	display: grid;
	grid-template-columns: 5rem minmax(0, 1fr);
	align-items: start;
	gap: var(--unit);
	padding-block: var(--unit);
}

.project-clients > li:first-child {
	border-top: 0;
}

.project-clients img {
	display: block;
	width: 100%;
	height: 3.5rem;
	padding: 2px;
	object-fit: contain;
	background: var(--on-surface);
}

@media (min-width: 768px) {
	.project-clients {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.project-clients > li:nth-child(2) {
		border-top: 0;
	}
}

@media (min-width: 1080px) {
	.project-build {
		grid-template-columns: minmax(0, .85fr) minmax(0, 1.55fr);
	}

	.project-build > img {
		grid-column: 1;
		grid-row: 1;
	}
}

/* About and CV */
.profile-intro {
	padding: 0;
}

.profile-intro-body {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: var(--gutter);
}

.profile-title::before, .profile-title::after,
.cv-role-heading h3::before, .cv-role-heading h3::after {
	content: none;
}

.profile-role {
	color: var(--tertiary-fixed-dim);
}

.profile-lead {
	max-width: 62ch;
	margin: 0;
}

.profile-lead, .profile-body {
	font-size: .875rem;
}

.profile-actions, .profile-contact, .profile-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--unit) var(--gutter);
	font-size: .875rem;
}

.profile-actions :is(a, button) {
	line-height: inherit;
}

.profile-actions :is(a, button):focus-visible {
	outline: 2px solid var(--secondary);
	outline-offset: 3px;
}

.profile-actions a:not(.btn-bracket) {
	color: var(--on-surface-variant);
	text-decoration: underline;
	text-underline-offset: .2em;
}

.profile-actions a:not(.btn-bracket):hover {
	color: var(--secondary);
}

.profile-contact, .profile-links {
	list-style: none;
	padding: 0;
	margin: 0;
}

.profile-contact {
	margin: var(--unit) 0 0;
}

.profile-records {
	margin: 0;
}

.profile-records > div + div, .cv-history > li + li {
	border-top: 1px solid var(--outline-variant);
	margin-top: var(--gutter);
	padding-top: var(--gutter);
}

.profile-records dt, .cv-role-heading h3 {
	color: var(--on-surface);
	font-size: 1rem;
	font-weight: 700;
}

.profile-records dd, .profile-body p, .cv-history ul {
	margin: 0;
}

.profile-records dd {
	margin-top: calc(var(--unit) / 2);
}

.cv-history {
	list-style: none;
	padding: 0;
	margin: 0;
}

.cv-role-heading {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 0 var(--gutter);
}

.cv-role-heading h3 {
	margin: 0;
}

.cv-role-heading p {
	color: var(--secondary);
	font-size: .875rem;
}

.cv-history .cv-position {
	color: var(--tertiary-fixed-dim);
	font-size: .875rem;
	margin-bottom: var(--unit);
}

.cv-history ul {
	padding-inline-start: 1.5rem;
}

.cv-history ul li + li {
	margin-top: calc(var(--unit) / 2);
}

@media print {
	.cv-page {
		--unit: 5px;
		--gutter: 8px;
		--line-height: 1.4;
		--on-surface: #000;
		--tertiary-fixed-dim: #222;
		--secondary: #222;
		--outline-variant: #aaa;
		color: #000;
		background: #fff;
		color-scheme: light;
		font-size: 10pt;
		min-height: 0;
		padding: 0;
	}
	.cv-page :is([data-template="header"], [data-template="footer"], .skip-link, .profile-actions, .board-bar a, .profile-intro .terminal-header) {
		display: none;
	}
	.cv-page > .container, .cv-page main {
		max-width: none;
		overflow: visible;
		padding: 0;
		scrollbar-gutter: auto;
	}
	.cv-page > .container {
		display: block;
		height: auto;
	}
	.cv-page :is(.profile-layout, .profile-columns, .profile-stack, .profile-intro-body) {
		display: block;
	}
	.cv-page .terminal-window {
		border: 0;
		background: transparent;
		margin-bottom: .75em;
	}
	.cv-page :is(.terminal-header, .terminal-window-body) {
		background: transparent;
		min-height: 0;
		padding: 0;
	}
	.cv-page :is(.cv-role-heading, .terminal-header) {
		break-after: avoid;
	}
	.cv-page :is(.cv-history > li, .profile-records > div) {
		break-inside: avoid;
	}
	.cv-page .profile-title {
		font-size: 21pt;
	}
	.cv-page a {
		color: inherit;
	}
}

.license-box {
	margin-top: var(--spacing-component) !important;
}

/* Turbo Logic: terminal bodies must not expand past column (grid/flex fix) */
.terminal-window-body {
	min-width: 0;
	max-width: 100%;
}

.blog-post.terminal-window {
	min-width: 0;
	max-width: 100%;
}

/* Enhanced post prose (Turbo Logic) — measure rules live in .post-content above */
.blog-post .post-content {
	color: var(--on-surface);

	p,
	li {
		color: var(--on-surface);
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		color: var(--primary);
	}

	a {
		color: var(--secondary);
	}

	blockquote {
		border-left-color: var(--secondary);
		color: var(--on-surface-variant);
	}

	/* Inline code in prose — not fenced pre */
	:not(pre) > code,
	p code,
	li code,
	td code,
	th code,
	dd code {
		color: var(--tertiary-fixed-dim);
		background-color: var(--surface-container-high);
		padding: 0.15em 0.35em;
		border-radius: var(--radius-ui);
	}

	& > pre {
		background: transparent;
		border: none;
		padding: var(--unit) 0;
		color: var(--tertiary-fixed-dim);

		code {
			background: transparent;
			padding: 0;
		}
	}
}

.highlight-1 {
	color: var(--tertiary-fixed-dim);
}

.highlight-2 {
	color: var(--secondary);
}

.highlight-3 {
	color: var(--secondary-container);
}

.highlight-4 {
	color: var(--outline);
}

/* --- Widescreen 16:9 / 16:10 (1920×1080, 1920×1200, 2560×1440, 2560×1600) --- */

/* Landscape: prefer horizontal bands over vertical stacks */
@media (min-width: 1280px) and (min-aspect-ratio: 8/5) {
	.blog-layout {
		grid-template-columns: minmax(0, 1fr) min(220px, 16vw);
		align-items: start;
	}
}

@media (min-width: 1600px) {

	.blog-layout {
		grid-template-columns: minmax(0, 1fr) min(200px, 14vw);
	}

	.contact-methods {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: var(--spacing-component);
	}
}

@media (min-width: 2560px) {

	.blog-post-wrapper {
		--post-toc-width: 240px;
	}
}

.contact-methods {
	display: block;
}
