:root {
	--bg: #fafaf8;
	--surface: #ffffff;
	--tile: #f1f1ee;
	--ink: #14171c;
	--muted: #5c6470;
	--faint: #9aa1ab;
	--line: #e4e4df;
	--line-strong: #c9cbc6;
	--accent: #2547b5;
	--accent-soft: rgba(37, 71, 181, 0.12);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0f1114;
		--surface: #15181c;
		--tile: #1a1e23;
		--ink: #e8ebee;
		--muted: #9aa2ac;
		--faint: #69717b;
		--line: #252a30;
		--line-strong: #3a4048;
		--accent: #85a0f2;
		--accent-soft: rgba(133, 160, 242, 0.16);
	}
}

:root[data-theme="dark"] {
	--bg: #0f1114;
	--surface: #15181c;
	--tile: #1a1e23;
	--ink: #e8ebee;
	--muted: #9aa2ac;
	--faint: #69717b;
	--line: #252a30;
	--line-strong: #3a4048;
	--accent: #85a0f2;
	--accent-soft: rgba(133, 160, 242, 0.16);
}

* { box-sizing: border-box; }

html { scroll-padding-top: 72px; }

body {
	margin: 0;
	font-family: "Inter", system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { width: min(1040px, 100% - 32px); margin-inline: auto; }

.mono {
	font-family: "IBM Plex Mono", ui-monospace, monospace;
	font-size: 12.5px;
	letter-spacing: 0.02em;
}

/* Header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 32px; height: 60px; }
.brand { font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.nav { display: flex; gap: 24px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 15px; }
.nav a:hover, .nav a:focus-visible { color: var(--ink); }
.header-icons { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.icon-btn {
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	color: var(--muted);
	background: none;
	border: 0;
	cursor: pointer;
	text-decoration: none;
}
.icon-btn:hover, .icon-btn:focus-visible { color: var(--ink); background: var(--tile); }
.icon-btn svg { width: 18px; height: 18px; }

/* Hero */
.hero { padding: 72px 0 8px; }
.hero h1 { margin: 0; font-size: clamp(36px, 6vw, 52px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.hero .role { margin: 10px 0 0; color: var(--muted); font-size: 18px; }
.hero .lede { max-width: 620px; margin: 24px 0 0; font-size: 17px; }
.status {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 28px;
	padding: 7px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font-size: 14.5px;
	text-decoration: none;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2f9e62; flex: none; }
.status:hover, .status:focus-visible { color: var(--ink); border-color: var(--line-strong); }

/* Sections */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 80px 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.section-head a { color: var(--muted); font-size: 14.5px; text-decoration: none; }
.section-head a:hover, .section-head a:focus-visible { color: var(--accent); }

/* Projects */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 32px; }
.card { display: flex; flex-direction: column; }
.figure {
	aspect-ratio: 16 / 10;
	border-radius: 12px;
	background: var(--tile);
	border: 1px solid var(--line);
	overflow: hidden;
}
.figure svg { width: 100%; height: 100%; display: block; }
.card .date { margin-top: 18px; color: var(--muted); }
.card h3 { margin: 4px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.card p { margin: 8px 0 12px; color: var(--muted); font-size: 15.5px; }
.card .foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tags li { color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
.link { color: var(--accent); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.link:hover, .link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.note { color: var(--faint); font-size: 14px; }

/* Figure strokes */
.f-axis { stroke: var(--line-strong); stroke-width: 1; fill: none; }
.f-grid { stroke: var(--line); stroke-width: 1; fill: none; }
.f-ink { stroke: var(--ink); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.f-mute { stroke: var(--faint); stroke-width: 1.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.f-acc { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.f-dash { stroke-dasharray: 4 4; }
.f-dot { fill: var(--accent); }
.f-fill { fill: var(--accent-soft); stroke: none; }
.f-solid { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.f-label { fill: var(--muted); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 9px; letter-spacing: 0.04em; }

/* About */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.about p { margin: 0 0 14px; }
.about h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: grid; grid-template-columns: 128px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.entries li:first-child { border-top: 0; padding-top: 0; }
.entries .when { color: var(--muted); padding-top: 3px; }
.entries strong { display: block; font-weight: 600; }
.entries span.desc { color: var(--muted); font-size: 15px; }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tools span { border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; font-size: 14px; color: var(--muted); background: var(--surface); }

/* Badges */
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.badge {
	display: block;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	text-decoration: none;
}
.badge .issuer { color: var(--muted); }
.badge strong { display: block; margin-top: 6px; font-weight: 600; line-height: 1.35; }
.badge:hover, .badge:focus-visible { border-color: var(--accent); }

/* Footer */
footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover, footer a:focus-visible { color: var(--ink); }

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

@media (max-width: 820px) {
	.nav { display: none; }
	.grid, .about { grid-template-columns: 1fr; }
	.badges { grid-template-columns: 1fr; }
	.hero { padding-top: 48px; }
}
@media (max-width: 420px) {
	.entries li { grid-template-columns: 1fr; gap: 2px; }
}
.tools-head { margin-top: 28px !important; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 20; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--bg); text-decoration: none; }
.skip:focus { top: 12px; }
