:root {
	--bg: #050a05;
	--surface: #0a140a;
	--fg: #00ff41;
	--fg-muted: #00cc33;
	--border: #008f11;
	--border-dim: #003b00;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

html {
	background-color: var(--bg);
	color: var(--fg);
	font-family: var(--font-mono);
	line-height: 1.6;
}

body {
	background-color: var(--bg);
	color: var(--fg);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Subtle CRT scanline overlay */
body::after {
	content: "";
	position: fixed;
	inset: 0;
	background: repeating-linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0) 0px,
		rgba(0, 0, 0, 0) 2px,
		rgba(0, 0, 0, 0.18) 3px,
		rgba(0, 0, 0, 0.18) 4px
	);
	pointer-events: none;
	z-index: 9999;
}

a {
	color: var(--fg);
	text-decoration: underline;
	text-underline-offset: 3px;
}

a:hover {
	background-color: var(--fg);
	color: var(--bg);
	text-decoration: none;
}

a:focus-visible,
.btn:focus-visible,
.project-link:focus-visible {
	outline: 2px solid var(--fg);
	outline-offset: 2px;
}

header,
footer {
	position: relative;
	overflow: hidden;
	background-color: var(--bg);
}

.matrix-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 0;
	display: block;
}

header > :not(.matrix-canvas),
footer > :not(.matrix-canvas) {
	position: relative;
	z-index: 1;
}

header {
	border-bottom: 1px solid var(--border);
	padding: 1.5rem 0 2rem;
	text-align: center;
}

nav {
	text-align: center;
	margin-bottom: 1.5rem;
	padding: 0 1rem;
	color: var(--border);
}

nav a {
	display: inline-block;
	padding: 0.25rem 0.6rem;
	text-decoration: none;
	background-color: rgba(5, 10, 5, 0.78);
	border: 1px solid transparent;
}

nav a:hover {
	background-color: var(--fg);
	color: var(--bg);
	border-color: var(--fg);
}

main {
	flex: 1;
}

.container {
	width: 90%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 2rem 0;
}

header .container,
footer .container {
	padding: 0.5rem 0;
}

h1 {
	font-size: 2.25rem;
	margin-bottom: 0.5rem;
	letter-spacing: 0.04em;
	text-shadow: 0 0 8px #050a05, 0 0 16px #050a05;
}

h2 {
	font-size: 1.4rem;
	color: var(--fg);
	margin-bottom: 1rem;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--border);
}

h3 {
	font-size: 1.1rem;
	color: var(--fg);
	margin-bottom: 0.5rem;
}

.subtitle {
	font-size: 1rem;
	color: var(--fg-muted);
	max-width: 700px;
	margin: 0 auto;
	text-shadow: 0 0 8px #050a05, 0 0 14px #050a05;
}

p {
	margin-bottom: 1.25rem;
	color: var(--fg-muted);
}

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

.projects-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 1.5rem;
}

.project-card,
.content-section {
	background-color: var(--surface);
	border: 1px solid var(--border);
	padding: 1.75rem;
	margin-bottom: 1.75rem;
}

.project-card {
	margin-bottom: 0;
	display: flex;
	flex-direction: column;
}

.project-card p {
	flex: 1;
}

.project-icon {
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--fg);
	margin-bottom: 0.75rem;
	letter-spacing: 0.08em;
}

.card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1rem;
}

.features {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
	margin: 1.5rem 0;
}

.feature-card {
	background-color: var(--bg);
	border: 1px solid var(--border-dim);
	border-left: 3px solid var(--border);
	padding: 1.25rem;
}

.btn,
.project-link {
	display: inline-block;
	background-color: var(--fg);
	color: var(--bg);
	border: 1px solid var(--fg);
	padding: 0.55rem 1.1rem;
	text-decoration: none;
	font-weight: 700;
	font-size: 0.95rem;
}

.btn:hover,
.project-link:hover {
	background-color: var(--bg);
	color: var(--fg);
}

.btn-outline {
	background-color: transparent;
	color: var(--fg);
	border: 1px solid var(--border);
}

.btn-outline:hover {
	background-color: var(--fg);
	color: var(--bg);
	border-color: var(--fg);
}

.content-section ul,
.content-section ol {
	padding-left: 1.5rem;
	margin-bottom: 1.25rem;
	color: var(--fg-muted);
}

.content-section li {
	margin-bottom: 0.5rem;
}

.content-section strong {
	color: var(--fg);
}

pre {
	background-color: var(--bg);
	border: 1px solid var(--border);
	padding: 1rem;
	overflow-x: auto;
	margin-bottom: 1.25rem;
	color: var(--fg);
}

code {
	font-family: var(--font-mono);
	font-size: 0.92rem;
	color: var(--fg);
	background-color: var(--bg);
	padding: 0.1rem 0.3rem;
}

pre code {
	padding: 0;
	background: none;
}

/* Directory index listing (obsd.tracey.spot) */
.dir-breadcrumb {
	margin-bottom: 1rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--border);
	font-size: 0.95rem;
	word-break: break-all;
}

.dir-breadcrumb a {
	text-decoration: none;
}

.dir-table-wrap {
	overflow-x: auto;
}

.dir-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.dir-table th,
.dir-table td {
	padding: 0.5rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid var(--border-dim);
}

.dir-table thead th {
	color: var(--fg);
	border-bottom: 1px solid var(--border);
	font-weight: 700;
}

.dir-table tbody tr:hover {
	background-color: var(--bg);
}

.dir-table a {
	text-decoration: none;
}

.dir-tag {
	color: var(--fg);
	font-weight: 700;
}

.file-tag {
	color: var(--border);
}

.col-size,
.col-date {
	white-space: nowrap;
	text-align: right;
	color: var(--fg-muted);
}

.dir-empty {
	color: var(--border);
	font-style: italic;
}

footer {
	text-align: center;
	padding: 1.5rem 0;
	margin-top: 2rem;
	border-top: 1px solid var(--border);
	color: var(--fg-muted);
	font-size: 0.9rem;
}

footer p {
	text-shadow: 0 0 8px #050a05, 0 0 14px #050a05;
}

@media (max-width: 768px) {
	.projects-grid,
	.features {
		grid-template-columns: 1fr;
	}

	h1 {
		font-size: 1.75rem;
	}

	.project-card,
	.content-section {
		padding: 1.25rem;
	}

	.col-date {
		display: none;
	}
}
