/* Crafted minimal — monochrome, type-first, light/dark */

:root {
	color-scheme: light dark;

	/* D: all serif + mono labels (typography study) */
	--font-heading: "IBM Plex Serif", Georgia, "Times New Roman", serif;
	--font-body: "IBM Plex Serif", Georgia, "Times New Roman", serif;
	--font-meta: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

	/* Warm paper + subtle plum ink */
	--ink: #3d2430;
	--ink-heading: #4a2838;
	--ink-muted: #6a5e64;
	--paper: #faf6f3;
	--rule: #e0d8d4;
	--focus: #4a2838;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.25rem;
	--step-2: 1.5rem;
	--step-3: 1.875rem;

	--leading: 1.65;
	--measure: 40rem;
	--space: 1.5rem;
	--space-lg: 2.5rem;
}

/* Forced themes (type compare panes); also keep OS preference on :root */
.theme-light {
	color-scheme: light;
	--ink: #3d2430;
	--ink-heading: #4a2838;
	--ink-muted: #6a5e64;
	--paper: #faf6f3;
	--rule: #e0d8d4;
	--focus: #4a2838;
}

.theme-dark {
	color-scheme: dark;
	/* Moonlight: cool monochrome silver on night paper */
	--ink: #e4e2e6;
	--ink-heading: #d8d4db;
	--ink-muted: #9b98a0;
	--paper: #0f1014;
	--rule: #2a2b30;
	--focus: #d8d4db;
	/* Light type on dark reads optically heavier; subpixel AA makes it worse. */
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

@media (prefers-color-scheme: dark) {
	:root {
		--ink: #e4e2e6;
		--ink-heading: #d8d4db;
		--ink-muted: #9b98a0;
		--paper: #0f1014;
		--rule: #2a2b30;
		--focus: #d8d4db;
	}

	html {
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}
}

/* Session override from theme toggle (no persistence) */
html[data-theme="light"] {
	color-scheme: light;
	--ink: #3d2430;
	--ink-heading: #4a2838;
	--ink-muted: #6a5e64;
	--paper: #faf6f3;
	--rule: #e0d8d4;
	--focus: #4a2838;
	-webkit-font-smoothing: auto;
	-moz-osx-font-smoothing: auto;
}

html[data-theme="dark"] {
	color-scheme: dark;
	--ink: #e4e2e6;
	--ink-heading: #d8d4db;
	--ink-muted: #9b98a0;
	--paper: #0f1014;
	--rule: #2a2b30;
	--focus: #d8d4db;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

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

body {
	margin: 0;
	min-height: 100vh;
	font-family: var(--font-body);
	font-size: var(--step-0);
	line-height: var(--leading);
	color: var(--ink);
	background: var(--paper);
	text-rendering: optimizeLegibility;
	transition:
		background-color 0.28s ease,
		color 0.28s ease;
}

.skip-link {
	position: absolute;
	left: var(--space);
	top: -100%;
	z-index: 10;
	padding: 0.4rem 0.75rem;
	background: var(--paper);
	color: var(--ink);
	text-decoration: none;
	border: 1px solid var(--rule);
}

.skip-link:focus {
	top: var(--space);
}

.site-header,
.site-main {
	width: min(100% - 2 * var(--space), var(--measure));
	margin-inline: auto;
}

.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: var(--space-lg) var(--space-lg);
}

.breadcrumbs {
	display: flex;
	align-items: baseline;
	gap: 0;
	min-width: 0;
	font-family: var(--font-meta);
	font-size: var(--step--1);
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.3;
}

/* Theme toggle: canvas sphere (phase terminator on a 45° axis) */

.theme-toggle {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.theme-toggle:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
	border-radius: 2px;
}

.theme-toggle__canvas {
	display: block;
	width: 1.15rem;
	height: 1.15rem;
}

.theme-toggle--xl {
	width: 8.5rem;
	height: 8.5rem;
}

.theme-toggle--xl .theme-toggle__canvas {
	width: 7rem;
	height: 7rem;
}

.design-orb-lab {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: var(--space-lg);
	margin: 0 0 var(--space-lg);
	padding: var(--space-lg) 0;
	/* Match both panes: XL orb + vertical padding */
	min-height: calc(7rem + 2 * var(--space-lg));
	box-sizing: content-box;
}

.design-orb-controls {
	margin: 0 0 var(--space-lg);
	padding: 0 0 var(--space-lg);
	border-bottom: 1px solid var(--rule);
	font-family: var(--font-meta);
	font-size: var(--step--1);
	/* Collapsed toggle row — same on both panes */
	min-height: 1.3em;
}

.design-orb-controls__bar {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.design-orb-controls__toggle {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font-family: var(--font-meta);
	font-size: var(--step--1);
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--ink-muted);
	cursor: pointer;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: color-mix(in srgb, var(--ink-muted) 45%, transparent);
}

.design-orb-controls__toggle:hover {
	color: var(--ink);
	text-decoration-color: var(--ink);
}

.design-orb-controls__toggle:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
	border-radius: 2px;
}

.design-orb-controls__panel {
	margin-top: 0.85rem;
}

.design-orb-controls__panel[hidden] {
	display: none;
}

.design-orb-controls__reset {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font-family: var(--font-meta);
	font-size: var(--step--1);
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--ink-muted);
	cursor: pointer;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: color-mix(in srgb, var(--ink-muted) 45%, transparent);
}

.design-orb-controls__reset:hover {
	color: var(--ink);
	text-decoration-color: var(--ink);
}

.design-orb-controls__reset:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
	border-radius: 2px;
}

.design-orb-controls__list {
	display: grid;
	gap: 0.65rem;
}

.design-orb-controls__row {
	display: grid;
	grid-template-columns: 7.5rem 1fr 3.25rem;
	align-items: center;
	gap: 0.75rem;
}

.design-orb-controls__label {
	color: var(--ink);
}

.design-orb-controls__value {
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--ink-muted);
}

.design-orb-controls__row input[type="range"] {
	width: 100%;
	accent-color: var(--ink-heading);
}

@media (prefers-reduced-motion: reduce) {
	body {
		transition: none;
	}
}

.breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.breadcrumbs a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.path-gap {
	display: inline-block;
	width: 0.1ch;
}

.crumb-slash {
	color: inherit;
}

.site-main {
	padding-block: 0 var(--space-lg);
}

/* Links */

a {
	color: var(--ink);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent);
}

a:hover {
	text-decoration-color: var(--ink);
}

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

/* Intro + list */

.intro p {
	margin: 0;
	font-size: var(--step-1);
	line-height: 1.55;
}

.intro strong {
	color: var(--ink-heading);
}

.intro p.intro-links {
	margin: 0.65em 0 calc(var(--space-lg) + var(--space));
	font-family: var(--font-meta);
	font-size: var(--step--1);
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.3;
}

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

.post-list li {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	padding-block: 0.85rem;
}

.post-list li + li {
	border-top: 1px solid var(--rule);
}

.post-list-main {
	min-width: 0;
}

.post-list a {
	font-family: var(--font-heading);
	font-size: var(--step-1);
	font-weight: 600;
	line-height: 1.3;
	color: var(--ink-heading);
	text-decoration: none;
}

.post-list a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.post-list-subtitle {
	margin: 0.3rem 0 0;
	font-size: var(--step--1);
	line-height: 1.45;
	color: var(--ink-muted);
}

.post-list time {
	font-family: var(--font-meta);
	font-size: var(--step--1);
	color: var(--ink-muted);
	letter-spacing: 0.02em;
	line-height: 1.3;
}

@media (min-width: 40rem) {
	.post-list li {
		flex-direction: row;
		flex-wrap: nowrap;
		justify-content: space-between;
		gap: 1rem;
	}

	.post-list-main {
		flex: 1 1 auto;
	}

	.post-list time {
		flex: 0 0 auto;
		white-space: nowrap;
		padding-top: 0.15em;
	}
}

/* Post */

.post-header {
	margin-bottom: var(--space-lg);
}

.post-header h1 {
	margin: 0 0 0.4rem;
	font-family: var(--font-heading);
	font-size: var(--step-3);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--ink-heading);
}

.post-subtitle {
	margin: 0 0 0.75rem;
	font-size: var(--step-1);
	color: var(--ink-muted);
	line-height: 1.45;
}

.post-meta {
	margin: 0;
	font-family: var(--font-meta);
	font-size: var(--step--1);
	color: var(--ink-muted);
	letter-spacing: 0.02em;
}

.post-body > *:first-child {
	margin-top: 0;
}

.post-body h2,
.post-body h3,
.post-body h4 {
	font-family: var(--font-heading);
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.015em;
	margin-top: 1.75em;
	margin-bottom: 0.6em;
	color: var(--ink-heading);
}

.post-body h2 {
	font-size: var(--step-2);
}

.post-body h3 {
	font-size: var(--step-1);
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body blockquote {
	margin-block: 0 1.1em;
}

.post-body li {
	margin-block: 0.25em;
}

.post-body blockquote {
	margin-inline: 0;
	padding-inline: 1rem;
	border-left: 1px solid var(--rule);
	color: var(--ink-muted);
}

.post-body img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-block: 1.25em;
}

.post-body hr {
	border: 0;
	border-top: 1px solid var(--rule);
	margin-block: 2em;
}

.post-body code {
	font-size: 0.9em;
}

.home-footer {
	margin: var(--space-lg) 0 0;
	padding-top: var(--space);
	font-family: var(--font-meta);
	font-size: var(--step--1);
}

/* Specimen page: separate homepage block from post block */
.design-compare-pane .home-footer {
	margin-bottom: var(--space-lg);
	padding-bottom: var(--space-lg);
	border-bottom: 1px solid var(--rule);
}

/* Design compare: light | dark half-pages */

body.design-compare {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: start;
	min-height: 100vh;
	background: transparent;
	color: inherit;
}

.design-compare-pane {
	min-width: 0;
	min-height: 100vh;
	color: var(--ink);
	background: var(--paper);
}

.design-compare-pane.theme-dark {
	border-left: 1px solid var(--rule);
}

.design-compare-pane .site-header,
.design-compare-pane .site-main {
	width: min(100% - 2 * var(--space), var(--measure));
	margin-inline: auto;
}
