:root {
	--bg: #0a0d0a;
	--bg-panel: #0e130f;
	--fg: #d9dcd3;
	--fg-dim: #7c8a76;
	--accent: #ffb347;
	--accent-dim: #c98a3e;
	--border: #24291f;
	--font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
	box-sizing: border-box;
}

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

body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font-mono);
	font-size: 15px;
	line-height: 1.6;
	position: relative;
	overflow-x: hidden;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0.025) 0px,
		rgba(255, 255, 255, 0.025) 1px,
		transparent 1px,
		transparent 3px
	);
	z-index: 2;
}

body::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
	z-index: 3;
}

.page {
	position: relative;
	z-index: 1;
	max-width: 1100px;
	margin: 0 auto;
	padding: 48px 24px 80px;
}

a:focus-visible {
	outline: 1px dashed var(--accent);
	outline-offset: 3px;
}

.intro {
	position: relative;
	padding-left: 184px;
	margin-bottom: 40px;
}

.avatar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 160px;
	object-fit: cover;
	border: 2px solid var(--accent);
	filter: grayscale(55%) contrast(1.05);
}

.intro-text {
	min-width: 0;
}

.boot-line {
	opacity: 0;
	transform: translateY(6px);
	animation: reveal 0.4s ease forwards;
	animation-delay: calc(var(--d) * 0.18s + 0.1s);
}

@keyframes reveal {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.boot-line {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.cursor {
		animation: none;
	}
}

h1 {
	font-size: clamp(2rem, 5vw, 3.2rem);
	letter-spacing: 0.04em;
	margin: 0 0 8px;
}

.role {
	color: var(--fg-dim);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.85rem;
	margin: 0 0 8px;
}

.sep {
	color: var(--accent-dim);
	margin: 0 6px;
}

.contact {
	margin: 0;
	color: var(--fg-dim);
	font-size: 0.85rem;
}

.contact a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dotted var(--fg-dim);
}

.contact a:hover {
	color: var(--accent);
	border-color: var(--accent);
}

.links .cv-download {
	color: var(--accent);
}

.reveal {
	appearance: none;
	background: none;
	border: none;
	padding: 0;
	color: inherit;
	font: inherit;
	cursor: pointer;
	border-bottom: 1px dotted var(--fg-dim);
}

.reveal:hover,
.reveal:focus-visible {
	color: var(--accent);
	border-color: var(--accent);
}

.cursor {
	display: inline-block;
	color: var(--accent);
	animation: blink 1s steps(1) infinite;
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

.links {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 12px 0 0;
}

.links a {
	color: var(--fg);
	text-decoration: none;
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	padding: 2px 0;
	transition:
		color 0.15s,
		text-shadow 0.15s;
}

.links a:hover,
.links a:focus-visible {
	color: var(--accent);
	text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

.layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 0;
	border-top: 1px solid var(--border);
	margin-top: 8px;
}

.pane {
	padding: 32px 28px;
}

.pane.skills {
	border-right: 1px solid var(--border);
	background: var(--bg-panel);
}

.pane h2 {
	color: var(--accent);
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	margin: 0 0 24px;
}

.pane .entry + h2 {
	margin-top: 40px;
}

.skills section {
	margin-bottom: 24px;
}

.skills section:last-child {
	margin-bottom: 0;
}

.skills h3 {
	color: var(--fg-dim);
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	margin: 0 0 8px;
	font-weight: 500;
}

.skills ul {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.85rem;
	line-height: 1.8;
}

.skills li::before {
	content: "- ";
	color: var(--accent-dim);
}

.skills .level {
	color: var(--accent-dim);
	margin-left: 6px;
}

.summary {
	color: var(--fg-dim);
	margin: 0 0 36px;
	padding-left: 14px;
	border-left: 2px solid var(--border);
}

.prompt {
	color: var(--accent);
	margin-right: 8px;
}

.prompt-line {
	margin: 24px 0 0;
}

.entry {
	margin-bottom: 32px;
	padding-left: 14px;
	border-left: 2px solid var(--border);
	position: relative;
}

.entry:last-child {
	margin-bottom: 0;
}

.entry::before {
	content: "$";
	position: absolute;
	left: -9px;
	top: 0;
	color: var(--accent);
	background: var(--bg);
	padding: 0 2px;
}

.entry h3 {
	font-size: 1rem;
	margin: 0 0 4px;
	color: var(--fg);
	font-weight: 600;
}

.entry .org {
	color: var(--fg-dim);
	font-weight: 400;
}

.entry .dates {
	display: block;
	color: var(--accent-dim);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	margin-bottom: 10px;
}

.entry .note {
	font-size: 0.85rem;
	color: var(--fg-dim);
	margin: 4px 0 10px;
}

.entry ul {
	margin: 0;
	padding-left: 18px;
	font-size: 0.85rem;
	line-height: 1.7;
	color: var(--fg);
}

.entry ul li::marker {
	color: var(--accent-dim);
}

.entry li a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dotted var(--fg-dim);
	transition:
		color 0.15s,
		border-color 0.15s;
}

.entry li a:hover,
.entry li a:focus-visible {
	color: var(--accent);
	border-color: var(--accent);
}

.entry .courses {
	list-style: none;
	padding-left: 0;
	margin: 4px 0 2px;
}

.entry .courses li {
	padding-left: 5.5rem;
}

.entry .courses .code {
	float: left;
	width: 5.5rem;
	margin-left: -5.5rem;
	line-height: calc(0.85rem * 1.7);
	color: var(--fg-dim);
	font-size: 0.75rem;
}

.site-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 16px;
	margin: -16px 0 32px;
	font-size: 0.85rem;
}

.site-nav .path {
	color: var(--fg-dim);
}

.site-nav a,
.project-links a {
	color: var(--fg);
	text-decoration: none;
	padding: 2px 0;
	transition:
		color 0.15s,
		text-shadow 0.15s;
}

.site-nav a[aria-current="page"] {
	color: var(--accent);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.project-links a:hover,
.project-links a:focus-visible {
	color: var(--accent);
	text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ---------- projects page ---------- */

.projects-head h1 {
	margin-bottom: 16px;
}

.project-group {
	border-top: 1px solid var(--border);
	padding-top: 32px;
	margin-bottom: 48px;
}

.project-group h2 {
	color: var(--accent);
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	margin: 0 0 24px;
}

.group-note {
	color: var(--fg-dim);
	font-size: 0.85rem;
	max-width: 72ch;
	margin: -8px 0 24px;
}

.project {
	display: grid;
	grid-template-columns: minmax(0, 320px) 1fr;
	gap: 32px;
	align-items: start;
	margin-bottom: 40px;
}

.project:last-child {
	margin-bottom: 0;
}

.project-media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border: 1px solid var(--border);
	background: var(--bg-panel);
	transition: border-color 0.2s;
}

.project-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(55%) contrast(1.05);
	transition:
		filter 0.3s,
		transform 0.4s;
}

.project-media:hover,
.project-media:focus-visible {
	border-color: var(--accent);
}

.project-media:hover img,
.project-media:focus-visible img {
	filter: none;
	transform: scale(1.03);
}

.project-media--drawing svg {
	display: block;
	width: 100%;
	height: 100%;
}

.dw-grid {
	stroke: var(--border);
	stroke-width: 0.6;
}

.dw-line {
	fill: none;
	stroke: var(--fg-dim);
	stroke-width: 1.2;
}

.dw-accent path {
	fill: color-mix(in srgb, var(--accent) 18%, transparent);
	stroke: var(--accent);
	stroke-width: 1.2;
}

.dw-accent .dw-ray {
	fill: none;
	stroke: var(--accent-dim);
	stroke-dasharray: 3 3;
}

.dw-label {
	fill: var(--fg-dim);
	font-family: var(--font-mono);
	font-size: 9px;
	letter-spacing: 0.04em;
}

.project-meta {
	color: var(--accent-dim);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin: 0 0 4px;
}

.project-meta .sep {
	margin: 0 4px;
}

.project h3 {
	font-size: 1.15rem;
	margin: 0 0 10px;
}

.project-body p {
	font-size: 0.9rem;
	margin: 0 0 12px;
}

.project .highlight {
	color: var(--accent);
	border-left: 2px solid var(--accent);
	padding-left: 10px;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.tags li {
	font-size: 0.72rem;
	color: var(--fg-dim);
	border: 1px solid var(--border);
	padding: 1px 8px;
}

.project-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	font-size: 0.85rem;
}

.project-body .project-links {
	margin-bottom: 0;
}

.repo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 32px 24px;
}

.repo h3 {
	font-size: 0.95rem;
	margin: 14px 0 6px;
}

.repo p {
	font-size: 0.85rem;
	color: var(--fg-dim);
	margin: 0 0 8px;
}

/* ---------- links page ---------- */

.page--narrow {
	max-width: 640px;
}

.links-avatar {
	display: block;
	width: 96px;
	height: 96px;
	object-fit: cover;
	border: 2px solid var(--accent);
	filter: grayscale(55%) contrast(1.05);
	margin-bottom: 18px;
}

.links-head h1 {
	font-size: clamp(1.8rem, 6vw, 2.4rem);
}

.links-head .summary {
	margin-bottom: 24px;
}

.icon {
	width: 20px;
	height: 20px;
	flex: none;
	fill: currentColor;
}

.vcard-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	appearance: none;
	background: color-mix(in srgb, var(--accent) 8%, transparent);
	border: 1px solid var(--accent);
	color: var(--accent);
	font: inherit;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
	padding: 12px 18px;
	cursor: pointer;
	transition:
		background 0.15s,
		color 0.15s;
}

.vcard-btn:hover,
.vcard-btn:focus-visible {
	background: var(--accent);
	color: var(--bg);
	outline: none;
}

.links-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.qr-dialog {
	width: min(360px, calc(100vw - 32px));
	padding: 24px;
	border: 1px solid var(--accent);
	background: var(--bg-panel);
	color: var(--fg);
	font-family: var(--font-mono);
	text-align: center;
}

.qr-dialog::backdrop {
	background: rgba(0, 0, 0, 0.75);
}

.qr-dialog[open] {
	animation: reveal 0.25s ease;
}

.qr-title {
	color: var(--accent);
	font-weight: 600;
	letter-spacing: 0.06em;
	margin: 0 0 16px;
	text-align: left;
}

.qr-code {
	background: #f4f1e8;
	padding: 16px;
	line-height: 0;
}

.qr-svg {
	width: 100%;
	height: auto;
	shape-rendering: crispEdges;
}

.qr-url {
	color: var(--fg-dim);
	font-size: 0.85rem;
	margin: 14px 0 18px;
}

.qr-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 16px;
}

.qr-close {
	appearance: none;
	background: none;
	border: none;
	color: var(--fg-dim);
	font: inherit;
	font-size: 0.85rem;
	padding: 8px 0;
	cursor: pointer;
}

.qr-close:hover,
.qr-close:focus-visible {
	color: var(--accent);
	outline: none;
}

.link-group {
	margin-top: 40px;
}

.link-group h2 {
	color: var(--accent);
	font-size: 0.95rem;
	letter-spacing: 0.06em;
	margin: 0 0 12px;
}

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

.link-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 4px;
	border-bottom: 1px solid var(--border);
	color: var(--fg);
	text-decoration: none;
	transition:
		background 0.15s,
		color 0.15s;
}

.link-row .icon {
	color: var(--fg-dim);
	transition: color 0.15s;
}

.link-name {
	font-weight: 500;
}

.link-handle {
	margin-left: auto;
	color: var(--fg-dim);
	font-size: 0.8rem;
	text-align: right;
}

.link-row::after {
	content: "→";
	color: var(--accent-dim);
	transition: transform 0.15s;
}

.link-row:hover,
.link-row:focus-visible {
	background: var(--bg-panel);
	color: var(--accent);
	outline: none;
}

.link-row:hover .icon,
.link-row:focus-visible .icon {
	color: var(--accent);
}

.link-row:hover::after,
.link-row:focus-visible::after {
	transform: translateX(4px);
}

@media (max-width: 700px) {
	.site-nav {
		margin: -8px 0 24px;
	}

	.site-nav .path {
		display: none;
	}

	.site-nav a,
	.project-links a {
		padding: 8px 0;
	}

	.project {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.project-group {
		margin-bottom: 36px;
	}

	.project-body p {
		font-size: 0.85rem;
	}
}

@media (max-width: 700px) {
	.page {
		padding: 28px 16px 60px;
	}

	h1 {
		font-size: 2rem;
	}

	.intro {
		padding-left: 0;
		margin-bottom: 28px;
	}

	.avatar {
		position: static;
		display: block;
		width: 96px;
		height: 96px;
		margin-bottom: 18px;
	}

	.role,
	.contact {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
	}

	.role {
		letter-spacing: 0.04em;
		margin-bottom: 14px;
	}

	.role .sep,
	.contact .sep {
		display: none;
	}

	.role > span {
		padding-left: 2ch;
		text-indent: -2ch;
	}

	.role > span::before {
		content: "> ";
		color: var(--accent-dim);
	}

	.contact {
		gap: 6px;
	}

	.links {
		gap: 4px 18px;
		margin-top: 14px;
	}

	.links a {
		padding: 8px 0;
	}

	.summary {
		font-size: 0.9rem;
		margin-bottom: 28px;
	}

	.layout {
		grid-template-columns: 1fr;
	}

	.pane {
		padding: 24px 0;
	}

	.pane.skills {
		border-right: none;
		border-bottom: 1px solid var(--border);
		margin: 0 -16px;
		padding: 24px 16px;
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
		gap: 22px 16px;
	}

	.pane.skills h2 {
		grid-column: 1 / -1;
		margin-bottom: 0;
	}

	.skills section {
		margin-bottom: 0;
	}

	.skills li {
		padding-left: 2ch;
		text-indent: -2ch;
	}

	.pane.main {
		padding-top: 28px;
	}

	.entry h3 {
		font-size: 0.95rem;
		line-height: 1.45;
	}

	.entry .org {
		display: block;
		font-size: 0.85rem;
		margin-top: 2px;
	}

	.entry ul {
		padding-left: 16px;
	}
}

@media print {
	body {
		background: #fff;
		color: #111;
	}
	body::before,
	body::after {
		display: none;
	}
	.boot-line {
		opacity: 1;
		transform: none;
		animation: none;
	}
	.cursor,
	.links,
	.site-nav {
		display: none;
	}
	.project-media img {
		filter: none;
	}
	.layout {
		grid-template-columns: 1fr;
	}
	.pane.skills {
		border-right: none;
	}
	.prompt,
	.entry::before {
		color: #333;
	}
	.entry .dates,
	.skills .level,
	.summary,
	.role {
		color: #444;
	}
	a {
		color: #111;
	}
}
