/* The pfetch card uses the author's terminal font, subset to Latin, arrows and box drawing */
@font-face {
	font-family: "Aporetic Sans Mono";
	font-weight: 400;
	font-display: swap;
	src: url("/assets/fonts/aporetic-sans-mono-regular.woff2") format("woff2");
}

@font-face {
	font-family: "Aporetic Sans Mono";
	font-weight: 700;
	font-display: swap;
	src: url("/assets/fonts/aporetic-sans-mono-bold.woff2") format("woff2");
}

/* Tokens: Catppuccin Latte (light) / Mocha (dark), mauve accent, same as the profile card */
:root {
	color-scheme: light dark;
	--bg: #eff1f5;
	--surface: #e6e9ef;
	--surface-2: #ccd0da;
	--text: #4c4f69;
	--text-strong: #1e1e2e;
	--text-2: #5c5f77;
	--line: #ccd0da;
	--accent: #8839ef;
	--accent-ink: #eff1f5;
	--nav-bg: rgba(239, 241, 245, 0.72);
	--shadow: 0 0 0 1px #ccd0da;

	--term-bg: #dce0e8;
	--term-border: #ccd0da;
	--term-text: #4c4f69;
	--term-dim: #5c5f77;
	--term-key: #0e6c80;
	--term-val: #4352c4;
	--term-mauve: #8839ef;
	--term-blue: #1e66f5;
	--term-peach: #fe640b;
	--term-ink: #eff1f5;

	/* Outside section accents; light values darkened from Latte to pass 4.5:1 as text */
	--oc-mauve: #8839ef;
	--oc-blue: #1c5fd6;
	--oc-green: #2b7a1e;
	--oc-peach: #b8460b;
	--oc-yellow: #8f6a00;

	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", sans-serif;
	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
	--term-mono: "Aporetic Sans Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--measure: 42rem;
	--wide: 64rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #1e1e2e;
		--surface: #181825;
		--surface-2: #313244;
		--text: #cdd6f4;
		--text-strong: #cdd6f4;
		--text-2: #a6adc8;
		--line: #313244;
		--accent: #cba6f7;
		--accent-ink: #11111b;
		--nav-bg: rgba(30, 30, 46, 0.72);
		--shadow: 0 0 0 1px #313244;

		--term-bg: #1e1e2e;
		--term-border: #313244;
		--term-text: #cdd6f4;
		--term-dim: #9399b2;
		--term-key: #74c7ec;
		--term-val: #b4befe;
		--term-mauve: #cba6f7;
		--term-blue: #89b4fa;
		--term-peach: #fab387;
		--term-ink: #11111b;

		--oc-mauve: #cba6f7;
		--oc-blue: #89b4fa;
		--oc-green: #a6e3a1;
		--oc-peach: #fab387;
		--oc-yellow: #f9e2af;
	}
}

/* Base */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: 4.5rem;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 1.0625rem/1.55 var(--font);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
	margin: 0;
	color: var(--text-strong);
	font-weight: 700;
	text-wrap: balance;
}

h1 {
	font-size: clamp(2.25rem, 6vw, 4rem);
	line-height: 1.05;
	letter-spacing: -0.025em;
}

h2 {
	font-size: clamp(1.5rem, 3.4vw, 2rem);
	line-height: 1.15;
	letter-spacing: -0.02em;
}

h3 {
	font-size: 1.1875rem;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

p {
	margin: 0 0 1em;
	text-wrap: pretty;
}

a {
	color: var(--accent);
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

a:hover {
	text-decoration-thickness: 2px;
}

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

img {
	max-width: 100%;
	height: auto;
}

.skip {
	position: absolute;
	left: 1rem;
	top: -4rem;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--accent);
	color: var(--accent-ink);
	border-radius: 0.5rem;
}

.skip:focus {
	top: 0.75rem;
}

.wrap {
	width: min(100% - 3rem, var(--wide));
	margin-inline: auto;
}

.prose {
	width: min(100% - 3rem, var(--measure));
	margin-inline: auto;
}

/* Nav: translucent material, content scrolls beneath */
.nav {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--nav-bg);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	backdrop-filter: blur(20px) saturate(180%);
	transition: box-shadow 0.3s var(--ease);
}

.nav.scrolled {
	box-shadow: 0 1px 0 var(--line);
}

.nav .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 3.5rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--text);
	font: 600 0.9375rem var(--mono);
	letter-spacing: -0.01em;
	text-decoration: none;
}

.brand img {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
}

.nav ul {
	display: flex;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav li a {
	display: block;
	padding: 0.5rem 0.75rem;
	color: var(--text-2);
	font-size: 0.9375rem;
	text-decoration: none;
	border-radius: 0.5rem;
	transition: color 0.15s;
}

.nav li a:hover,
.nav li a[aria-current="page"] {
	color: var(--text);
}

.nav li a[aria-current="page"] {
	font-weight: 600;
}

@media (max-width: 30rem) {
	.nav .wrap {
		gap: 0.5rem;
	}

	.brand img {
		display: none;
	}

	.nav li a {
		padding-inline: 0.5rem;
	}
}

/* Hero */
.hero {
	padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4rem);
}

.hero .eyebrow {
	margin-bottom: 1rem;
	color: var(--text-2);
	font: 0.875rem var(--mono);
}

.hero .lead {
	max-width: 40rem;
	margin: 1.25rem 0 1.75rem;
	color: var(--text-2);
	font-size: clamp(1.1875rem, 2.4vw, 1.4375rem);
	line-height: 1.4;
	letter-spacing: -0.01em;
}

.hero .lead strong {
	color: var(--text);
	font-weight: 600;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 2.75rem;
	padding: 0.55rem 1.25rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: transparent;
	color: var(--text);
	font: 500 0.9375rem var(--font);
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.1s ease-out, background 0.15s;
}

.btn:hover {
	background: var(--surface-2);
	text-decoration: none;
}

.btn:active {
	transform: scale(0.97);
}

.btn.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-ink);
}

.btn.primary:hover {
	background: var(--accent);
	filter: brightness(1.08);
}

/* pfetch card: mirrors the profile README SVG */
.term {
	margin-top: clamp(2rem, 5vw, 3.5rem);
	padding: 1.25rem;
	background: var(--term-bg);
	color: var(--term-text);
	border: 1px solid var(--term-border);
	border-radius: 0.75rem;
	font: 0.9375rem/1.55 var(--term-mono);
	overflow: clip;
}

.seg-bar {
	display: flex;
	align-items: stretch;
	margin: 0 0 1.1rem;
	padding: 0;
	list-style: none;
	color: var(--term-ink);
	line-height: 1.875rem;
	white-space: nowrap;
}

/* Powerline segment: body, then a 0.75rem zone in the next colour holding this colour's tip (as in the SVG) */
.seg-bar li {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding-left: 0.875rem;
	background: var(--c);
}

.seg-bar li:not(.s4) {
	margin-right: 0.75rem;
}

.seg-bar li:not(.s4)::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 100%;
	width: 0.75rem;
	background: var(--next);
}

.seg-bar li:not(.s4)::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 100%;
	z-index: 1;
	width: 0.75rem;
	background: var(--c);
	clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.seg-bar .s1 {
	--c: var(--term-mauve);
	--next: var(--term-blue);
	padding-right: 0.875rem;
}

.seg-bar .s2 {
	--c: var(--term-blue);
	--next: var(--term-peach);
	padding-right: 0.875rem;
}

.seg-bar .s3 {
	--c: var(--term-peach);
	--next: var(--term-bg);
	padding-right: 0.875rem;
}

.seg-bar .s4 {
	--c: var(--term-mauve);
	margin-left: auto;
	padding-right: 0.875rem;
}

.seg-bar .s4::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	right: 100%;
	width: 0.75rem;
	background: var(--c);
	clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.seg-bar svg {
	width: 0.9rem;
	height: 0.9rem;
}

.cmd {
	margin: 0 0 1.25rem;
	color: var(--term-val);
}

.cmd::before {
	content: "\203A";
	margin-right: 0.9rem;
	color: var(--term-mauve);
	font-weight: 700;
}

.fetch-grid {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1rem 2.25rem;
	align-items: start;
}

.cat {
	margin: 0;
	color: var(--term-mauve);
	font: 2rem/1.45 var(--term-mono);
	white-space: pre;
}

.fetch {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0 1.5rem;
	margin: 0;
	min-width: 0;
}

.fetch dt {
	color: var(--term-key);
	font-weight: 700;
}

.fetch dd {
	margin: 0;
	color: var(--term-val);
	overflow-wrap: anywhere;
}

.fetch .head {
	grid-column: 1 / -1;
	margin-bottom: 0.25rem;
	font-weight: 700;
	color: var(--term-mauve);
}

.fetch .head i {
	color: var(--term-dim);
	font-style: normal;
}

.fetch .head b {
	color: var(--term-val);
}

.fetch a {
	color: inherit;
	text-decoration-color: var(--term-dim);
	text-decoration-style: dotted;
	text-underline-offset: 0.25em;
}

.fetch a:hover {
	text-decoration-style: solid;
	text-decoration-color: currentColor;
}

.term-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1rem;
}

.term-tools button {
	min-height: 2.25rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid var(--term-border);
	border-radius: 0.5rem;
	background: transparent;
	color: var(--term-dim);
	font: inherit;
	font-size: 0.8125rem;
	cursor: pointer;
	transition: transform 0.1s ease-out, color 0.15s;
}

.term-tools button:hover {
	color: var(--term-text);
}

.term-tools button:active {
	transform: scale(0.96);
}


.prompt2 {
	margin: 1.25rem 0 0;
	color: var(--term-mauve);
	font-weight: 700;
}

.caret {
	display: inline-block;
	width: 0.5em;
	height: 1em;
	margin-left: 0.9rem;
	vertical-align: text-bottom;
	background: var(--term-text);
}

/* Sections */
.section {
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.section-head a {
	font-size: 0.9375rem;
	white-space: nowrap;
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
	gap: 1rem;
}

.card {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1.5rem;
	border-radius: 1.25rem;
	background: var(--surface);
	box-shadow: var(--shadow);
	color: var(--text);
	text-decoration: none;
	transition: transform 0.4s var(--ease);
}

a.card:hover {
	transform: translateY(-3px);
	text-decoration: none;
}

a.card:active {
	transform: scale(0.985);
	transition-duration: 0.1s;
}

.card p {
	margin: 0;
	color: var(--text-2);
	font-size: 0.9688rem;
}

.card .meta {
	color: var(--text-2);
	font: 0.8125rem var(--mono);
}

.card .stat {
	margin-top: auto;
	padding-top: 0.5rem;
	font-size: 0.9375rem;
	font-weight: 600;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tags li {
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-2);
	font: 0.75rem var(--mono);
}

/* Project / writing lists */
.project {
	padding-block: 2rem;
	border-top: 1px solid var(--line);
}

.project:first-of-type {
	border-top: 0;
}

.project header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	margin-bottom: 0.75rem;
}

/* sized so the longest title still fits beside its date/repo column at the full measure */
.project h2 {
	font-size: clamp(1.5rem, 3vw, 1.75rem);
}

.project .meta {
	flex: none;
	margin-left: auto;
	padding-top: 0.35rem;
	color: var(--text-2);
	font: 0.875rem/1.5 var(--mono);
	text-align: right;
}

.project .meta a {
	display: block;
	white-space: nowrap;
}

@media (max-width: 40rem) {
	.project header {
		flex-wrap: wrap;
	}

	.project .meta a {
		white-space: normal;
	}
}

.project header + p > strong {
	color: var(--accent);
}

.project ul.points {
	margin: 0.75rem 0;
	padding-left: 1.2rem;
	color: var(--text-2);
}

.project ul.points li {
	margin-bottom: 0.4rem;
}

.project .tags {
	margin-top: 0.9rem;
}

.page-head {
	padding-block: clamp(2.5rem, 7vw, 4.5rem) 1.5rem;
}

.page-head p {
	max-width: 36rem;
	margin: 1rem 0 0;
	color: var(--text-2);
	font-size: 1.1875rem;
}

.post-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.post-list li {
	padding-block: 1.5rem;
	border-top: 1px solid var(--line);
}

.post-list li:first-child {
	border-top: 0;
}

.post-list a {
	color: var(--text);
	text-decoration: none;
}

.post-list h2 {
	font-size: 1.375rem;
}

.post-list a:hover h2 {
	color: var(--accent);
}

.post-list time,
.post time {
	color: var(--text-2);
	font: 0.875rem var(--mono);
}

.post-list p {
	margin: 0.4rem 0 0;
	color: var(--text-2);
}

/* Blog post */
.post {
	padding-block: clamp(2.5rem, 7vw, 4.5rem) 3rem;
}

.post h1 {
	margin: 0.5rem 0 2rem;
	font-size: clamp(2rem, 5vw, 3rem);
}

.post h2 {
	margin: 2.25rem 0 0.75rem;
	font-size: 1.5rem;
}

.post h3 {
	margin: 1.5rem 0 0.5rem;
	color: var(--text-2);
	font-weight: 600;
}

.post img,
.post video {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 1.25rem 0;
	border-radius: 0.75rem;
}

/* Media: figure + caption, a wider variant that breaks out of the text column, and a two-up grid */
.post figure {
	margin: 1.75rem 0;
}

.post figure img,
.post figure video {
	margin: 0;
}

.post figcaption {
	margin-top: 0.5rem;
	color: var(--text-2);
	font-size: 0.875rem;
}

.post .grid2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin-block: 1.75rem;
}

.post .grid2 > figure {
	margin: 0;
}

.post .wide {
	width: min(100vw - 3rem, var(--wide));
	margin-inline: calc((100% - min(100vw - 3rem, var(--wide))) / 2);
}

@media (max-width: 40rem) {
	.post .grid2 {
		grid-template-columns: 1fr;
	}
}

/* Resume */
.resume-head {
	display: flex;
	flex-wrap: wrap;
	align-items: end;
	justify-content: space-between;
	gap: 1.25rem;
}

.resume-head .contact {
	margin: 0.75rem 0 0;
	color: var(--text-2);
	font-size: 0.9375rem;
}

.resume section {
	padding-block: 1.75rem;
	border-top: 1px solid var(--line);
}

.resume h2 {
	margin-bottom: 1rem;
	color: var(--text-2);
	font: 600 0.8125rem var(--mono);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.entry {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.15rem 1.5rem;
	margin-bottom: 1.5rem;
}

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

.entry h3 {
	font-size: 1.0625rem;
}

.entry .when {
	color: var(--text-2);
	font: 0.875rem var(--mono);
	white-space: nowrap;
}

.entry .sub {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--text-2);
	font-size: 0.9375rem;
}

.entry ul {
	grid-column: 1 / -1;
	margin: 0.5rem 0 0;
	padding-left: 1.2rem;
}

.entry li {
	margin-bottom: 0.35rem;
}

.skill-row {
	display: grid;
	grid-template-columns: 11rem 1fr;
	gap: 0.15rem 1rem;
	margin: 0 0 0.6rem;
}

.skill-row dt {
	font-weight: 600;
}

.skill-row dd {
	margin: 0;
	color: var(--text-2);
}

@media (max-width: 40rem) {
	.entry {
		grid-template-columns: 1fr;
	}

	.skill-row {
		grid-template-columns: 1fr;
	}
}

/* Footer */
.footer {
	margin-top: 2rem;
	padding-block: 2rem 3rem;
	border-top: 1px solid var(--line);
	color: var(--text-2);
	font-size: 0.875rem;
}

.footer .wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem 2rem;
}

.footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer a {
	color: var(--text-2);
}

.footer a:hover {
	color: var(--text);
}

/* Motion: critically damped, short; only when allowed */
@media (prefers-reduced-motion: no-preference) {
	.rise {
		animation: rise 0.6s var(--ease) backwards;
		animation-delay: calc(var(--i, 0) * 70ms);
	}

	.term .rv {
		animation: show 0.01s linear backwards;
		animation-delay: calc(0.9s + var(--i, 0) * 100ms);
	}

	.term .typed {
		display: inline-block;
		overflow: hidden;
		vertical-align: bottom;
		white-space: nowrap;
		animation: type 0.6s steps(6, end) 0.3s backwards;
	}

	.caret {
		animation: blink 1.1s steps(2, start) infinite;
	}
}

@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

@keyframes show {
	from {
		opacity: 0;
	}
}

@keyframes type {
	from {
		width: 0;
	}
}

@keyframes blink {
	to {
		visibility: hidden;
	}
}

@media (prefers-reduced-transparency: reduce) {
	.nav {
		background: var(--bg);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

@media (prefers-contrast: more) {
	:root {
		--line: currentColor;
		--text-2: var(--text);
	}
}

@media print {
	.nav,
	.footer,
	.actions,
	.skip {
		display: none;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 10.5pt;
	}

	.resume section {
		break-inside: avoid;
	}

	a {
		color: inherit;
	}
}

.mail {
	font-family: var(--mono);
	font-size: 0.9375em;
	overflow-wrap: anywhere;
}

/* Mobile hero: no cat, compact prompt bar that keeps the clock */
@media (max-width: 40rem) {
	.term {
		padding: 1rem 0.9rem;
		font-size: 0.875rem;
	}

	.cat {
		display: none;
	}

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

	.fetch {
		grid-template-columns: max-content 1fr;
		gap: 0 1rem;
	}

	.fetch dd {
		margin-bottom: 0;
	}

	.seg-bar {
		font-size: 0.75rem;
		line-height: 1.625rem;
	}

	.seg-bar .s1,
	.seg-bar svg,
	.seg-bar .tz {
		display: none;
	}

	.seg-bar li {
		padding-left: 0.5rem;
	}

	.seg-bar li:not(.s4) {
		margin-right: 0.5rem;
	}

	.seg-bar li:not(.s4)::before,
	.seg-bar li:not(.s4)::after,
	.seg-bar .s4::before {
		width: 0.5rem;
	}

	.seg-bar .s2,
	.seg-bar .s3,
	.seg-bar .s4 {
		padding-right: 0.5rem;
	}
}

/* Interactive prompt */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.out {
	margin-top: 1rem;
	color: var(--term-text);
}

.out .line {
	margin: 0;
	overflow-wrap: anywhere;
}

.out .dim {
	color: var(--term-dim);
}

.out .echo {
	margin-top: 0.5rem;
	color: var(--term-val);
}

.out .echo:first-child {
	margin-top: 0;
}

.out .chev {
	margin-right: 0.6rem;
	color: var(--term-mauve);
	font-weight: 700;
}

.out .art {
	font: inherit;
	line-height: 1.25;
	white-space: pre;
}

.out a {
	color: var(--term-val);
	text-underline-offset: 0.25em;
}

.cmd-link {
	display: inline-block;
	min-width: 5.5rem;
	padding: 0;
	border: 0;
	background: none;
	color: var(--term-key);
	font: inherit;
	font-weight: 700;
	text-align: left;
	cursor: pointer;
}

.cmd-link:hover {
	text-decoration: underline;
}

/* Command listings (help, easter-eggs): grid rows so every description starts
   at the same x. min-width on .cmd-link cannot do this, because it only pads
   commands shorter than 5.5rem and lets the long ones push their text out. */
.out .row-list {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0 1rem;
}

.out .row-list .cmd-link {
	min-width: 0;
}

.prompt2.live {
	display: flex;
	align-items: baseline;
	gap: 0.9rem;
	cursor: text;
}

.prompt2.live .chev {
	font-weight: 700;
}

.prompt2 .field {
	position: relative;
	flex: 1;
	min-width: 0;
}

.prompt2 .ghost {
	position: absolute;
	inset: 0;
	display: flex;
	pointer-events: none;
	white-space: pre;
	overflow: hidden;
}

.prompt2 .ghost i {
	font-style: normal;
	visibility: hidden;
}

.prompt2 .ghost b {
	color: var(--term-dim);
	font-weight: 400;
}

.prompt2 input {
	position: relative;
	width: 100%;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--term-val);
	caret-color: var(--term-text);
	caret-shape: block;
	font: inherit;
	font-weight: 400;
}

.prompt2 .fake-caret {
	position: absolute;
	left: 0;
	top: 0.2em;
	width: 0.55em;
	height: 1.1em;
	background: var(--term-text);
	opacity: 0.55;
	pointer-events: none;
}

.prompt2.focused .fake-caret {
	display: none;
}

.prompt2.focused {
	border-radius: 0.25rem;
	outline: 2px solid var(--term-mauve);
	outline-offset: 0.35rem;
}

@media (prefers-reduced-motion: no-preference) {
	.prompt2 .fake-caret {
		animation: blink 1.1s steps(2, start) infinite;
	}
}

@media (max-width: 40rem) {
	.prompt2 input {
		font-size: 1rem;
	}
}

.out .sl {
	position: relative;
	overflow: hidden;
	margin-top: 0.5rem;
	color: var(--term-mauve);
}

.out .sl pre {
	position: absolute;
	top: 0;
	left: 0;
	margin: 0;
	font: inherit;
	line-height: 1.15;
	white-space: pre;
	will-change: transform;
}

.cmd-link.dir {
	min-width: 0;
	margin-right: 1.5rem;
	color: var(--term-blue);
}

/* song card */
.out .song {
	margin-top: 0.5rem;
	padding: 0.6rem 0.9rem;
	border-left: 2px solid var(--term-mauve);
}

.song-head {
	margin-bottom: 0.3rem;
	color: var(--term-mauve);
	font-weight: 700;
}

.out .song dl {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0 1.25rem;
	margin: 0;
}

.out .song dt {
	color: var(--term-key);
	font-weight: 700;
}

.out .song dd {
	margin: 0;
	color: var(--term-val);
	overflow-wrap: anywhere;
}

.eq {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	height: 0.9em;
	margin-left: 0.2rem;
	vertical-align: baseline;
}

.eq i {
	width: 3px;
	height: 100%;
	background: var(--term-mauve);
	transform: scaleY(0.5);
	transform-origin: bottom;
}

.eq i:nth-child(2) { transform: scaleY(0.9); }
.eq i:nth-child(3) { transform: scaleY(0.6); }
.eq i:nth-child(4) { transform: scaleY(1); }
.eq i:nth-child(5) { transform: scaleY(0.4); }

@media (prefers-reduced-motion: no-preference) {
	.eq i {
		animation: eq 0.9s ease-in-out infinite alternate;
	}

	.eq i:nth-child(2) { animation-duration: 0.7s; animation-delay: -0.2s; }
	.eq i:nth-child(3) { animation-duration: 1.1s; animation-delay: -0.5s; }
	.eq i:nth-child(4) { animation-duration: 0.8s; animation-delay: -0.1s; }
	.eq i:nth-child(5) { animation-duration: 1s; animation-delay: -0.7s; }
}

@keyframes eq {
	from { transform: scaleY(0.25); }
	to { transform: scaleY(1); }
}

/* Jump links (Outside) */
.jump {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

.jump a {
	display: block;
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-2);
	font: 0.8125rem var(--mono);
	text-decoration: none;
}

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

section[aria-labelledby] > h2 {
	scroll-margin-top: 5rem;
}

/* ---- Shared entry rows: date column + text ---- */
.item,
.post-list li {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	column-gap: 1rem;
	padding-block: 1.1rem;
	border-top: 1px solid var(--line);
}

.item:first-child,
.post-list li:first-child {
	border-top: 0;
}

.item > time,
.post-list li > time {
	padding-top: 0.2rem;
	color: var(--text-2);
	font: 0.875rem var(--mono);
}

.item p,
.item div > p {
	margin: 0;
}

.post-list li > a {
	display: block;
}

@media (max-width: 40rem) {
	.item,
	.post-list li {
		grid-template-columns: 1fr;
		row-gap: 0.25rem;
	}
}

/* Type label (Research, Review, Log) */
.type {
	display: inline-block;
	margin-bottom: 0.25rem;
	padding: 0.05rem 0.5rem;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-2);
	font: 0.6875rem var(--mono);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ---- Post page: header, measure, leading, extras ---- */
.post.prose {
	width: min(100% - 3rem, 68ch);
	line-height: 1.65;
}

.post h1 {
	margin-bottom: 0.75rem;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.75rem;
	margin: 0 0 2rem;
	color: var(--text-2);
	font: 0.875rem var(--mono);
}

.post-meta .type {
	margin: 0;
}

.toc {
	margin: 0 0 2rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--line);
	border-radius: 0.75rem;
	font-size: 0.9375rem;
}

.toc ol {
	margin: 0.4rem 0 0;
	padding-left: 1.2rem;
}

.toc a {
	color: var(--text-2);
}

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

.post h2 {
	scroll-margin-top: 5rem;
}

.post-links {
	margin-top: 2.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
	color: var(--text-2);
	font-size: 0.9375rem;
}

.post-nav {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
}

.post-nav a:last-child {
	text-align: right;
}

/* ---- Outside ---- */
.jump-bar {
	position: sticky;
	top: 3.5rem;
	z-index: 40;
	margin-bottom: 1rem;
	padding-block: 0.6rem;
	background: var(--nav-bg);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	backdrop-filter: blur(20px) saturate(180%);
}

.jump-bar .jump {
	margin: 0;
}

#main {
	--sec: var(--accent);
}

[aria-labelledby="concerts"],
.jump a[href="#concerts"] { --sec: var(--oc-mauve); }
[aria-labelledby="games"],
.jump a[href="#games"] { --sec: var(--oc-blue); }
[aria-labelledby="mahjong"],
.jump a[href="#mahjong"] { --sec: var(--oc-green); }
[aria-labelledby="events"],
.jump a[href="#events"] { --sec: var(--oc-peach); }
[aria-labelledby="media"],
.jump a[href="#media"] { --sec: var(--oc-yellow); }

.jump-bar .jump a::before,
.jump-bar ~ section > h2::before {
	content: "";
	display: inline-block;
	border-radius: 50%;
	background: var(--sec);
	vertical-align: middle;
}

.jump-bar .jump a::before {
	width: 0.45rem;
	height: 0.45rem;
	margin: -0.1rem 0.45rem 0 0;
}

.jump-bar .jump a:hover,
.jump-bar .jump a:focus-visible {
	color: var(--sec);
}

.jump-bar ~ section > h2::before {
	width: 0.55em;
	height: 0.55em;
	margin: -0.12em 0.4em 0 0;
}

.jump-bar ~ section .item > time,
.jump-bar ~ section .hand time,
.jump-bar ~ section .trips time {
	color: var(--sec);
}

.item .what {
	color: var(--text-strong);
	font-weight: 600;
}

.item .where {
	margin-bottom: 0.35rem;
	color: var(--text-2);
	font-size: 0.875rem;
}

.hand,
.trips a {
	border-top: 3px solid var(--sec);
}

/* Jump targets clear the sticky bars. Measured painted footprint: 56px nav
   + 42px jump bar + 16px of the bar's bottom margin = 114px. 8rem leaves
   ~14px of clear space above the heading. The offset lives on the section,
   not the h2, so a section's own margin-top cannot drag the heading back up
   under the bar. */
.jump-bar ~ section {
	scroll-margin-top: 8rem;
}

.jump-bar ~ section,
.jump-bar ~ section .sub {
	margin-top: 2.5rem;
}

.jump-bar ~ section .sub > h3 {
	margin-bottom: 0.5rem;
}

/* Sections still being written. Delete this rule when they land, not the markup:
   the templates, markers and empty containers inside them are the scaffolding. */
.oc {
	display: none;
}

/* Rhythm games media: centred, with a caption that reads as a note rather than
   body text. Scoped by aria-labelledby, NOT by adding an .oc class: the
   osu!/maimai entry lists are empty, so .oc would hide the whole tab. The
   figcaption selector stays long to outrank the later .item figcaption rule,
   which otherwise wins on source order. */
section[aria-labelledby="games"] figure {
	margin: 1.25rem 0;
	text-align: center;
}

section[aria-labelledby="games"] figure img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-inline: auto;
	border-radius: 0.75rem;
}

section[aria-labelledby="games"] figure figcaption {
	max-width: 44ch;
	margin: 0.5rem auto 0;
	color: var(--text-2);
	font-size: 0.8125rem;
	line-height: 1.45;
	opacity: 0.8;
	text-wrap: balance;
}

.trips {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	align-items: start;
	gap: 1rem;
	margin: 1rem 0 1.5rem;
	padding: 0;
	list-style: none;
}

.trips a {
	display: block;
	overflow: hidden;
	border-radius: 0.75rem;
	background: var(--surface);
	box-shadow: var(--shadow);
	color: var(--text);
	text-decoration: none;
}

.trips img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.trips .body {
	padding: 1rem;
}

.trips time {
	color: var(--text-2);
	font: 0.8125rem var(--mono);
}

.trips h3 {
	margin-top: 0.2rem;
}

.trips a:hover h3 {
	color: var(--accent);
}

.trips p {
	margin: 0.35rem 0 0;
	color: var(--text-2);
	font-size: 0.9375rem;
}

.hands {
	display: grid;
	gap: 0.75rem;
	margin: 0.75rem 0 1.5rem;
}

.hand {
	padding: 0.9rem 1rem;
	border-radius: 0.75rem;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.hand .tiles {
	display: block;
	color: var(--text-strong);
	font: 0.9375rem/1.4 var(--mono);
	overflow-wrap: anywhere;
}

.hand time {
	color: var(--text-2);
	font: 0.75rem var(--mono);
}

.hand p {
	margin: 0.4rem 0 0;
	color: var(--text-2);
	font-size: 0.9375rem;
}

.hand img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0 0 0.5rem;
	border-radius: 0.5rem;
}

/* Hand captions read as notes, not body text: same values as .item figcaption,
   which does not reach .hand because hands are not entry rows. */
.hand figcaption {
	margin-top: 0.35rem;
	color: var(--text-2);
	font-size: 0.85rem;
}

/* Hand analysis behind a toggle, the same pattern as the blog's collapsible notes */
.hand details {
	margin-top: 0.4rem;
}

.hand summary {
	cursor: pointer;
	color: var(--text-2);
	font-size: 0.875rem;
}

.hand summary:hover {
	color: var(--text);
}

.hand details p {
	margin: 0.4rem 0 0;
	color: var(--text-2);
	font-size: 0.9375rem;
}

/* Photos inside entry rows. max-width keeps a tall photo from squeezing the text column. */
.item img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-top: 0.6rem;
	border-radius: 0.5rem;
}

.item figcaption {
	margin-top: 0.35rem;
	color: var(--text-2);
	font-size: 0.85rem;
}

/* A small aside under a section intro, for honest caveats */
.note {
	color: var(--text-2);
	font-size: 0.875rem;
}

/* Favourites: three unranked picks per category, then the near-misses. */
.picks {
	display: grid;
	gap: 0.5rem;
	margin: 0.75rem 0 0;
}

.pick {
	padding: 0.7rem 1rem;
	border-top: 3px solid var(--sec);
	border-radius: 0 0 0.75rem 0.75rem;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.pick .what {
	margin: 0;
}

.pick .what a {
	color: inherit;
	text-decoration-color: var(--text-2);
}

.pick .what a:hover {
	color: var(--accent);
}

.hon {
	margin: 0.5rem 0 0;
	color: var(--text-2);
	font-size: 0.875rem;
}

@media (prefers-reduced-transparency: reduce) {
	.jump-bar {
		background: var(--bg);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}
