/* Fonts: code and chart labels only; prose uses the system sans */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); }

/* Design tokens */
:root {
	--bg: #ffffff;
	--bg-subtle: #f6f7f9;
	--rule: #e3e6ea;
	--text: #14171c;
	--text-dim: #555d68;
	--accent: #1d4ed8;
	--accent-hover: #1e3a8a;
	--on-accent: #ffffff;
	--font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	--measure: 62ch;
	--gutter: clamp(20px, 5vw, 48px);
	--selection: #dbe4fb;
	--shadow: var(--shadow);
	color-scheme: light dark;
}
/* Follows the OS setting; no toggle */
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0f1115;
		--bg-subtle: #171a20;
		--rule: #2a2f37;
		--text: #e6e8eb;
		--text-dim: #9aa3ae;
		--accent: #7aa2ff;
		--accent-hover: #a8c1ff;
		--on-accent: #0f1115;
		--selection: #1e3a8a;
		--shadow: rgba(0, 0, 0, 0.5);
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 1.0625rem/1.65 var(--font-sans);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
::selection { background: var(--selection); color: var(--text); }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; text-wrap: balance; }

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link { position: absolute; left: 16px; top: -100px; padding: 8px 14px; background: var(--text); color: var(--bg); z-index: 10; }
.skip-link:focus { top: 16px; }
.skip-link:hover { color: var(--bg); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* Nav */
.nav { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; padding-top: 28px; padding-bottom: 28px; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { color: var(--accent); }
.nav__name { font-weight: 650; }
.nav__links { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.nav__links a { color: var(--text-dim); }

/* Hero */
.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	gap: 64px;
	align-items: center;
	padding-top: clamp(32px, 8vh, 96px);
	padding-bottom: clamp(48px, 8vh, 80px);
}
.hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); letter-spacing: -0.03em; line-height: 1.04; }
.hero__role { margin-top: 20px; font-size: clamp(1.125rem, 1.8vw, 1.375rem); font-weight: 500; }
.hero__bio { margin-top: 20px; color: var(--text-dim); max-width: var(--measure); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 36px; }

.btn {
	display: inline-block;
	padding: 12px 20px;
	border-radius: 6px;
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease-out;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.findings { padding-left: 1.25em; list-style: disc; }

/* Code + chart figure */
.window { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--bg); box-shadow: 0 8px 24px -12px var(--shadow); }
.window__bar { position: relative; display: flex; align-items: center; justify-content: center; height: 36px; background: var(--bg-subtle); border-bottom: 1px solid var(--rule); }
.window__dots { position: absolute; left: 14px; display: flex; gap: 7px; }
.window__dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.window__dots i:nth-child(2) { background: #febc2e; }
.window__dots i:nth-child(3) { background: #28c840; }
.window__file { font: 500 0.75rem/1 var(--font-mono); color: var(--text-dim); }
.figure__code {
	margin: 0;
	padding: 20px 20px 0;
	font: 400 0.8125rem/1.7 var(--font-mono);
	color: var(--text);
	overflow-x: auto;
	tab-size: 4;
}
.figure__code .tk { font-weight: 600; }
.figure__code .tf { color: var(--accent); }
.figure__code .tn { color: var(--accent); }
.figure__code .tc { color: var(--text-dim); }
.figure__plot { margin: 20px 20px 16px; height: clamp(220px, 22vw, 300px); }
.figure__plot canvas { display: block; width: 100%; height: 100%; }
.figure figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--text-dim); }

/* Sections */
.section { padding-top: 48px; padding-bottom: 48px; }
.section > h2 { font-size: 1.5rem; padding-top: 24px; border-top: 1px solid var(--rule); }
.section:last-of-type { padding-bottom: 96px; }

/* Label column + text column, shared by skills, project and experience */
.entries { margin-top: 32px; display: grid; gap: 40px; }
.entry { display: grid; grid-template-columns: 220px minmax(0, var(--measure)); gap: 8px 48px; }
.entry dt, .entry h3 { font-size: 1.0625rem; font-weight: 650; letter-spacing: 0; }
.entry dd > * + *, .entry > div > * + * { margin-top: 8px; }
.entry__date { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.entry__meta { color: var(--text-dim); font-size: 0.9375rem; }
.contact { margin-top: 32px; max-width: var(--measure); }
.contact .hero__actions { margin-top: 24px; }

/* Footer */
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 40px; background: linear-gradient(var(--rule), var(--rule)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat; color: var(--text-dim); font-size: 0.9375rem; }
.site-footer a { color: var(--text-dim); }

/* 404 */
.not-found { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.not-found h1 { font-size: clamp(2.5rem, 6vw, 4rem); letter-spacing: -0.03em; }
.not-found p { color: var(--text-dim); }
.not-found .btn { align-self: flex-start; }

@media (max-width: 900px) {
	.hero { grid-template-columns: 1fr; gap: 56px; }
	.entry { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.nav__links { gap: 4px 20px; }
	.figure__code { font-size: 0.65rem; padding: 16px 14px 0; }
	.figure__plot { margin: 16px 14px 12px; }
}
