/* ---------------------------------------------------------------
   Linus Jeary — personal site, v2
   Terminal-academic minimalism: Source Serif 4 for prose,
   JetBrains Mono for chrome/UI. Dark theme, no build step.
------------------------------------------------------------- */

/* Source Serif 4 (SIL OFL, see woff2/OFL-sourceserif4.txt) — lower-contrast,
   screen-friendly serif that keeps the academic feel without Computer
   Modern's spiky hairline strokes. Subsetted to ASCII + the extra glyphs
   prose uses (— · … → ε), ~155KB down to ~13KB. Regenerate from the full
   woff2/sourceserif4*.woff2 if new glyphs are ever needed:
     pyftsubset woff2/sourceserif4.woff2 --output-file=woff2/sourceserif4-subset.woff2 --flavor=woff2 --unicodes=... */
@font-face {
	font-family: "Source Serif 4";
	src: url('woff2/sourceserif4-subset.woff2') format('woff2');
	font-display: swap;
}
@font-face {
	font-family: "Source Serif 4";
	src: url('woff2/sourceserif4-bold-subset.woff2') format('woff2');
	font-weight: bold;
	font-display: swap;
}

/* JetBrains Mono (SIL OFL, see woff2/OFL-jetbrainsmono.txt) — subsetted to
   ASCII + the handful of extra glyphs the terminal chrome uses (— · … →),
   ~550KB down to ~9KB. Regenerate from the full woff2/jetbrainsmono*.ttf
   if new glyphs are ever needed:
     pyftsubset woff2/jetbrainsmono.ttf --output-file=woff2/jetbrainsmono-subset.woff2 --flavor=woff2 --unicodes=... */
@font-face {
	font-family: "JetBrains Mono";
	src: url('woff2/jetbrainsmono-subset.woff2') format('woff2');
	font-display: swap;
}
@font-face {
	font-family: "JetBrains Mono";
	src: url('woff2/jetbrainsmono-bold-subset.woff2') format('woff2');
	font-weight: bold;
	font-display: swap;
}

:root {
	--bg: #08070d;
	--bg-panel: #0f0d18;
	--bg-panel-2: #141120;
	--line: #262233;
	--line-bright: #3a3452;
	--fg: #ededf4;
	--fg-dim: #9a95ad;
	--fg-faint: #625d75;

	--purple: #bb6bde;
	--teal: #3ecdc2;
	--blue: #6cd4f0;
	--pink: #ff5c8a;
	--orange: #ff8952;

	--serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
	--mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

	--content-w: 780px;
	--radius: 6px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	background: var(--bg);
	background-image:
		radial-gradient(circle at 1px 1px, rgba(255,255,255,0.035) 1px, transparent 0);
	background-size: 28px 28px;
	color: var(--fg);
	font-family: var(--serif), sans-serif;
	font-size: 17px;
	line-height: 1.6;
	margin: 0;
	padding: 0 1.25rem;
	-webkit-font-smoothing: antialiased;
}

main {
	max-width: var(--content-w);
	margin: 0 auto;
}

::selection { background: var(--purple); color: #08070d; }

/* ---------------- Typography ---------------- */

h1, h2, h3 { font-weight: normal; line-height: 1.25; }

h1 {
	color: var(--fg);
	font-size: 2.1rem;
	letter-spacing: 0.01em;
	margin: 0;
}

h2 {
	color: var(--teal);
	font-size: 1.3rem;
	text-align: left;
	margin: 2.75rem 0 1rem;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--line);
}

h3 {
	color: var(--blue);
	font-size: 1.05rem;
	text-align: left;
	margin: 1.75rem 0 0.75rem;
}

p { color: var(--fg); }

a {
	color: var(--pink);
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 92, 138, 0.35);
	transition: border-color .15s ease, color .15s ease;
}
a:hover { border-color: var(--pink); }

.icon {
	height: 0.85em;
	width: 0.85em;
	vertical-align: middle;
	margin-right: 0.15em;
}

code, .mono {
	font-family: var(--mono);
	font-size: 0.92em;
}

code {
	color: var(--orange);
	background: var(--bg-panel);
	padding: 0.1em 0.35em;
	border-radius: 4px;
	overflow-wrap: break-word;
}

/* ---------------- Header / nav ---------------- */

.site-header {
	padding: 2.75rem 0 1.5rem;
}

.tagline {
	font-family: var(--mono);
	color: var(--fg-dim);
	font-size: 0.92rem;
	margin: 0.5rem 0 0;
}
.tagline .prompt { color: var(--teal); }
.tagline .cursor {
	display: inline-block;
	width: 0.55em;
	background: var(--fg-dim);
	margin-left: 2px;
	animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

nav.crumbs {
	font-family: var(--mono);
	font-size: 0.9rem;
	color: var(--fg-faint);
	margin-top: 1.1rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 0;
}
nav.crumbs a {
	color: var(--fg-dim);
	border-bottom: none;
	padding: 0.15rem 0;
}
nav.crumbs a:hover { color: var(--teal); }
nav.crumbs a.current { color: var(--teal); }
nav.crumbs .sep { margin: 0 0.6rem; color: var(--line-bright); }

/* ---------------- Hero ---------------- */

.hero {
	display: flex;
	gap: 2.25rem;
	align-items: flex-start;
	margin-top: 1.75rem;
	flex-wrap: wrap;
}

.hero-photo {
	flex: 0 0 auto;
	width: 148px;
	height: 148px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--line-bright);
	box-shadow: 0 0 0 6px var(--bg-panel);
}

.hero-text { flex: 1 1 320px; min-width: 260px; }
.hero-text p { margin: 0 0 0.85rem; color: var(--fg-dim); }
.hero-text p:first-child { color: var(--fg); font-size: 1.05rem; }

.hero-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1.1rem;
}
.hero-links a {
	font-family: var(--mono);
	font-size: 0.86rem;
	color: var(--fg-dim);
	border: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	border-radius: 999px;
	padding: 0.32rem 0.85rem;
}
.hero-links a:hover { color: var(--teal); border-color: var(--teal); }

/* ---------------- Terminal panel (globe/clock widget) ---------------- */

.term-panel {
	background: var(--bg-panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	margin-top: 1.5rem;
	box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.term-titlebar {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.7rem;
	background: var(--bg-panel-2);
	border-bottom: 1px solid var(--line);
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--fg-faint);
}
.term-dot {
	width: 8px; height: 8px; border-radius: 50%;
	background: var(--line-bright);
}
.term-dot:nth-child(1) { background: #ff5f57; }
.term-dot:nth-child(2) { background: #febc2e; }
.term-dot:nth-child(3) { background: #28c840; }
.term-title { margin-left: 0.5rem; }
.term-credit {
	margin-left: auto;
	color: var(--fg-faint);
	border-bottom: none;
	font-size: 0.7rem;
}
.term-credit:hover { color: var(--teal); }

.term-body {
	padding: 0.65rem 1rem 0.8rem;
	display: flex;
	gap: 1.25rem;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
}

#globe {
	font-family: var(--mono);
	font-size: 9px;
	line-height: 9px;
	letter-spacing: 1px;
	color: var(--teal);
	white-space: pre;
	margin: 0;
	text-align: center;
}

.clocks {
	font-family: var(--mono);
	font-size: 0.82rem;
	color: var(--fg-dim);
	display: grid;
	gap: 0.6rem;
	min-width: 210px;
}
.clock-row .clock-label {
	color: var(--fg-faint);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.clock-row .clock-time {
	color: var(--fg);
	font-size: 1.15rem;
	margin-top: 0.1rem;
}
.clock-row.you .clock-time { color: var(--blue); }
.clock-row.linus .clock-time { color: var(--teal); }
.clock-row .clock-place { color: var(--fg-faint); }

@media (max-width: 480px) {
	#globe { font-size: 7px; line-height: 7px; }
}

/* ---------------- Project / content cards ---------------- */

.card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.1rem;
}

.card {
	display: grid;
	grid-template-columns: 152px 1fr;
	gap: 1.1rem;
	background: var(--bg-panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1rem;
	transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--line-bright); transform: translateY(-2px); }

.card-thumb {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid var(--line);
	cursor: zoom-in;
	background: var(--bg-panel-2);
}

.card-body h3 { margin: 0 0 0.4rem; }
.card-body h3 a { border-bottom: none; color: inherit; }
.card-body h3 a:hover { color: var(--blue); }
.card-body p { margin: 0 0 0.6rem; color: var(--fg-dim); font-size: 0.95rem; }

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.5rem;
}
.tag {
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--fg-faint);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 0.15rem 0.6rem;
}

.card-links { margin-top: 0.65rem; display: flex; gap: 0.9rem; }
.card-links a { font-family: var(--mono); font-size: 0.82rem; }

.card--text { grid-template-columns: 1fr; }

@media (max-width: 560px) {
	.card { grid-template-columns: 1fr; }
}

/* ---------------- Simple lists (software / hardware pages) ---------------- */

dl.simple-list dt {
	font-weight: bold;
	color: var(--fg);
	margin-top: 1.1rem;
}
dl.simple-list dt a { color: inherit; }
dl.simple-list dd {
	margin: 0.3rem 0 0;
	color: var(--fg-dim);
}
dl.simple-list dt:first-child { margin-top: 0; }

/* ---------------- Lightbox ---------------- */

.lightbox-overlay {
	position: fixed;
	inset: 0;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem 1.5rem;
	background: rgba(4, 3, 8, 0.88);
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s ease;
	cursor: zoom-out;
}
.lightbox-overlay.active { opacity: 1; pointer-events: auto; }
.lightbox-overlay img {
	max-width: min(92vw, 1150px);
	max-height: 88vh;
	border: 1px solid var(--line-bright);
	border-radius: 4px;
	box-shadow: 0 25px 70px rgba(0,0,0,0.6);
}
.lightbox-close {
	position: fixed;
	top: 1.25rem;
	right: 1.5rem;
	font-family: var(--mono);
	color: var(--fg-dim);
	font-size: 0.85rem;
	border: 1px solid var(--line-bright);
	border-radius: 999px;
	padding: 0.3rem 0.8rem;
	background: var(--bg-panel);
}

/* ---------------- Footer ---------------- */

footer {
	max-width: var(--content-w);
	margin: 4rem auto 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
	text-align: center;
	font-family: var(--mono);
	font-size: 0.82rem;
	color: var(--fg-faint);
}
footer a { color: var(--fg-faint); border-bottom: none; }
footer a:hover { color: var(--teal); }

/* ---------------- Motion sensitivity ---------------- */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.tagline .cursor { animation: none; }
	.card { transition: none; }
}
