
:root {
	--ground: #ded2bc;
	--ground-elevated: #e7dec9;
	--ground-muted: #d2c5ac;
	--ground-sunken: #c7b99e;

	--ink: #23211b;
	--ink-soft: #423e34;
	--ink-muted: #4d483e;
	--border: #c4b69c;
	--border-strong: #a6967a;

	--accent-terracotta: #8c3a19;
	--accent-terracotta-hover: #732e12;
	--accent-terracotta-soft: rgba(140, 58, 25, 0.12);
	--accent-olive: #48542e;
	--accent-olive-soft: rgba(72, 84, 46, 0.12);

	/* Functional alert & state */
	--state-error: #9e3725;
	--state-error-bg: #eed8d3;
	--state-success: #496336;
	--state-success-bg: #dfe8d7;

	/* Typography */
	--doge-315: 'Cinzel', Georgia, 'Times New Roman', serif;
	--doge-e7d: 'Barlow Semi Condensed', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--doge-ca2: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

	/* Fluid Type Scales via clamp() */
	--text-xs: clamp(0.72rem, 0.68rem + 0.2vw, 0.8rem);
	--text-sm: clamp(0.85rem, 0.8rem + 0.25vw, 0.95rem);
	--text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
	--text-md: clamp(1.15rem, 1.08rem + 0.35vw, 1.3rem);
	--text-lg: clamp(1.35rem, 1.25rem + 0.5vw, 1.6rem);
	--text-xl: clamp(1.65rem, 1.45rem + 1vw, 2.1rem);
	--text-2xl: clamp(2.1rem, 1.8rem + 1.5vw, 2.85rem);
	--text-3xl: clamp(2.65rem, 2.2rem + 2.25vw, 3.85rem);
	--text-display: clamp(3.2rem, 2.6rem + 3vw, 5.2rem);

	--space-2xs: 0.25rem;

	--space-xs: 0.5rem;
	--space-sm: 0.75rem;
	--space-md: 1.25rem;
	--space-lg: 2rem;
	--space-xl: 3.25rem;
	--space-2xl: 5rem;
	--space-3xl: 7.5rem;

	--container-max: 1360px;
	--container-narrow: 860px;
	--container-pad: clamp(1.25rem, 4vw, 3rem);
	--radius-sm: 2px;
	--radius-md: 4px;
	--radius-lg: 8px;

	/* Motion Tokens */
	--ease-standard: cubic-bezier(0.2, 0, 0.1, 1);
	--ease-out: cubic-bezier(0, 0, 0.2, 1);
	--ease-in: cubic-bezier(0.4, 0, 1, 1);
	--duration-micro: 140ms;
	--duration-short: 240ms;
	--duration-medium: 400ms;
	--duration-long: 650ms;

	/* Elevation */
	--shadow-subtle: 0 1px 3px rgba(35, 33, 27, 0.05), 0 4px 12px rgba(35, 33, 27, 0.04);
	--shadow-overlay: 0 16px 36px rgba(35, 33, 27, 0.14), 0 4px 12px rgba(35, 33, 27, 0.08);
}

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

html {
	background-color: var(--ground);
	color: var(--ink);
	font-family: var(--doge-e7d);
	font-size: 16px;
	line-height: 1.55;
	letter-spacing: 0.01em;
	-webkit-text-size-adjust: 100%;
	text-rendering: optimizeLegibility;
	scroll-behavior: smooth;
}

body {
	background-color: var(--ground);
	color: var(--ink);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
	position: relative;
	width: 100%;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--doge-315);
	font-weight: 600;
	line-height: 1.18;
	letter-spacing: 0.02em;
	color: var(--ink);
	text-wrap: balance;
	overflow-wrap: break-word;
}

h1 {
	font-size: var(--text-3xl);
	letter-spacing: 0.03em;
}

h2 {
	font-size: var(--text-2xl);
	line-height: 1.22;
}

h3 {
	font-size: var(--text-xl);
	line-height: 1.28;
}

h4 {
	font-size: var(--text-lg);
	line-height: 1.32;
}

p, li, dd {
	font-size: var(--text-base);
	color: var(--ink-soft);
	line-height: 1.62;
	overflow-wrap: break-word;
}

strong, b {
	font-weight: 600;
	color: var(--ink);
}

small { font-size: var(--text-xs); }

a {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: var(--border-strong);
	transition: color var(--duration-micro) var(--ease-standard),
							text-decoration-color var(--duration-micro) var(--ease-standard);
}

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

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

img, picture, svg, video {
	display: block;
	max-width: 100%;
	height: auto;
}

button, input, select, textarea {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

button {
	background: none;
	border: none;
	cursor: pointer;
}

ul, ol { list-style: none; }

code, kbd, samp, pre {
	font-family: var(--doge-ca2);
	font-size: 0.9em;
}

/* Accessibility primitives */
.visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.skip-link {
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 10000;
	padding: 0.75rem 1.25rem;
	background-color: var(--ink);
	color: var(--ground);
	font-family: var(--doge-ca2);

	font-size: var(--text-xs);
	text-decoration: none;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	border: 1px solid var(--ground-elevated);
	transform: translateY(-200%);
	transition: transform var(--duration-short) var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

/* Layout primitives */
.site-container {
	width: 100%;
	max-width: var(--container-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--container-pad);
	padding-right: var(--container-pad);
}

.site-container--narrow { max-width: var(--container-narrow); }

.site-flow > * + * { margin-top: var(--space-md); }

.site-flow--lg > * + * { margin-top: var(--space-xl); }

.icon {
	width: 1.25em;
	height: 1.25em;
	display: inline-block;
	vertical-align: -0.2em;
	fill: currentColor;
	flex-shrink: 0;
}

/* Horizontal rule / dividers */
.rule-thin {
	border: 0;

	height: 1px;
	background-color: var(--border);
	margin: var(--space-xl) 0;
}

/* Focus styles for keyboard accessibility */
:focus-visible {
	outline: 2px solid var(--accent-terracotta);
	outline-offset: 3px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

.prose {
	font-size: var(--text-base);
	line-height: 1.68;
	color: var(--ink-soft);
}

.prose p + p { margin-top: 1.25em; }

.prose h2 {
	margin-top: 2.2em;
	margin-bottom: 0.75em;
}

.prose h3 {
	margin-top: 1.8em;
	margin-bottom: 0.6em;
}

.prose ul, .prose ol {
	margin: 1.25em 0;
	padding-left: 1.5em;
}

.prose ul { list-style: disc; }

.prose ol { list-style: decimal; }

.prose li { margin-bottom: 0.5em; }

.prose blockquote {
	border-left: 2px solid var(--accent-terracotta);
	padding-left: 1.25rem;
	margin: 1.75rem 0;
	font-family: var(--doge-315);
	font-style: italic;
	color: var(--ink);
}

.text-mono { font-family: var(--doge-ca2); }

.text-muted { color: #38342c; }

.text-olive { color: var(--accent-olive); }

.text-terracotta { color: #8c3a19; }
