/* ===================================================================
   STYLESHEET TABLE OF CONTENTS
   
   1. CSS CUSTOM PROPERTIES (COLORS & SPACING)
      - Base color scheme (light mode)
      - Dark mode overrides
      - Manual theme toggle classes
      - Spacing scale
   
   2. BASE STYLES & RESETS
      - Global resets
      - Typography
      - Links & buttons
      - Selection & focus
   
   3. TYPOGRAPHY
      - Headings
      - Text elements
      - Code blocks
      - Blockquotes
   
   4. LAYOUT COMPONENTS
      - Site header & navigation
      - Main layout
      - Sidebar
   
   5. CONTENT COMPONENTS
      - Posts & articles
      - Images & figures
      - Tables
      - Lists
   
   6. FORMS
      - Form controls
      - Newsletter signup
   
   7. INTERACTIVE COMPONENTS
      - Theme toggle
      - Share buttons
      - Author card
      - Tags & metadata
   
   8. SPECIAL FEATURES
      - Header anchors
      - Pull quotes
      - Table of contents
      - Search UI (Pagefind)
   
   9. FOOTER
      - Site footer layout
      - Back to top
   
   10. UTILITIES & HELPERS
       - Visibility
       - Spacing utilities
       - Print styles
   
   11. RESPONSIVE DESIGN
       - Mobile breakpoints
       - Reduced motion
   
================================================================== */

/* ===================================================================
   1. CSS CUSTOM PROPERTIES (COLORS & SPACING)
================================================================== */

:root {
	color-scheme: light dark;
	
	/* Base colors (light mode) */
	--bg: #fbf1c7;
	--bg-alt: #f9f5d7;
	--panel: #f2e5bc;
	--fg: #3c3836;
	--muted: #665c54;
	--border: #7c6f64;

	--accent-primary: #cc241d;
	--accent-secondary: #076678;

	/* Link colors */
	--link: var(--accent-primary);
	--visited: #b16286;
	--link-hover: #9d0006;

	/* Selection */
	--selection-bg: #d65d0e;
	--selection-fg: #fbf1c7;

	/* Navigation rainbow colors */
	--nav-red: #cc241d;
	--nav-orange: #d65d0e;
	--nav-yellow: #b57614;
	--nav-green: #79740e;
	--nav-blue: #076678;
	--nav-indigo: #458588;
	--nav-violet: #b16286;

	/* Spacing scale */
	--space-xs: 0.5rem;
	--space-sm: 0.75rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2rem;
	--space-2xl: 3rem;
}

/* Dark mode - system preference */
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #282828;
		--bg-alt: #32302f;
		--panel: #1d2021;
		--fg: #ebdbb2;
		--muted: #a89984;
		--border: #504945;

		--accent-primary: #83a598;
		--accent-secondary: #fb4934;

		--link: var(--accent-primary);
		--visited: #d3869b;
		--link-hover: #b3d7ff;

		--selection-bg: var(--accent-secondary);
		--selection-fg: #1d2021;

		--nav-red: #fb4934;
		--nav-orange: #fe8019;
		--nav-yellow: #fabd2f;
		--nav-green: #b8bb26;
		--nav-blue: #83a598;
		--nav-indigo: #8ec07c;
		--nav-violet: #d3869b;
	}
}

/* Manual theme toggle - light mode */
:root.light-mode {
	--bg: #fbf1c7;
	--bg-alt: #f9f5d7;
	--panel: #f2e5bc;
	--fg: #3c3836;
	--muted: #665c54;
	--border: #7c6f64;

	--accent-primary: #cc241d;
	--accent-secondary: #076678;

	--link: var(--accent-primary);
	--visited: #b16286;
	--link-hover: #9d0006;

	--selection-bg: #d65d0e;
	--selection-fg: #fbf1c7;

	--nav-red: #cc241d;
	--nav-orange: #d65d0e;
	--nav-yellow: #b57614;
	--nav-green: #79740e;
	--nav-blue: #076678;
	--nav-indigo: #458588;
	--nav-violet: #b16286;
}

/* Manual theme toggle - dark mode */
:root.dark-mode {
	--bg: #282828;
	--bg-alt: #32302f;
	--panel: #1d2021;
	--fg: #ebdbb2;
	--muted: #a89984;
	--border: #504945;

	--accent-primary: #83a598;
	--accent-secondary: #fb4934;

	--link: var(--accent-primary);
	--visited: #d3869b;
	--link-hover: #b3d7ff;

	--selection-bg: var(--accent-secondary);
	--selection-fg: #1d2021;

	--nav-red: #fb4934;
	--nav-orange: #fe8019;
	--nav-yellow: #fabd2f;
	--nav-green: #b8bb26;
	--nav-blue: #83a598;
	--nav-indigo: #8ec07c;
	--nav-violet: #d3869b;
}

/* ===================================================================
   2. BASE STYLES & RESETS
================================================================== */

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

* { 
	box-sizing: border-box; 
}

html { 
	scroll-behavior: auto; 
}

body {
	margin: 0;
	font-family: 'PT Serif', serif;
	font-size: 16px;
	line-height: 1.6;
	color: #3c3836; /* fallback */
	color: var(--fg);
	background: #fbf1c7; /* fallback */
	background: var(--bg);
}

::selection {
	background: #d65d0e; /* fallback */
	background: var(--selection-bg);
	color: #fbf1c7; /* fallback */
	color: var(--selection-fg);
}

/* ===================================================================
   3. TYPOGRAPHY
================================================================== */

h1, h2, h3, h4, h5, h6 {
	font-family: 'Public Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
	font-weight: 800;
	line-height: 1.2;
}

/* Links */
a:link,
a:visited {
	color: #cc241d; /* fallback */
	color: var(--link);
	text-decoration: underline;
	text-decoration-thickness: 0.12em;
	text-underline-offset: 0.2em;
	text-decoration-color: #cc241d; /* fallback */
	text-decoration-color: var(--link);
	transition: color 140ms ease, text-decoration-thickness 140ms ease, text-decoration-color 140ms ease;
	position: relative;
}

a:link::before,
a:visited::before {
	content: '';
	position: absolute;
	top: 0;
	left: -2px;
	right: -2px;
	bottom: -2px;
	background: transparent;
	border-radius: 4px;
	transition: background 200ms ease;
	z-index: -1;
}

a:visited { 
	color: #b16286; /* fallback */
	color: var(--visited); 
}

a:hover,
a:active {
	color: #9d0006; /* fallback */
	color: var(--link-hover);
	text-decoration-thickness: 0.18em;
	text-decoration-color: #076678; /* fallback */
	text-decoration-color: var(--accent-secondary);
}

a:hover::before {
	background: rgba(204, 36, 29, 0.05);
}

a:active {
	text-decoration-thickness: 0.2em;
}

/* External links */
a[href^="http://"],
a[href^="https://"] {
	position: relative;
}

a[href^="http://"]:not([href*="brennan.day"]):not(.no-external-icon)::after,
a[href^="https://"]:not([href*="brennan.day"]):not(.no-external-icon)::after {
	content: "➚";
	font-size: 0.75em;
	line-height: 1;
	margin-left: 0.2em;
	vertical-align: super;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
	outline: 2px solid #cc241d; /* fallback */
	outline: 2px solid var(--accent-primary);
	outline-offset: 2px;
}

/* Code */
code {
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.9em;
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	padding: 0.15em 0.4em;
	border-radius: 4px;
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
}

pre {
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.875em;
	line-height: 1.5;
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	padding: 1.25rem;
	overflow-x: auto;
	overflow-y: hidden;
	border-radius: 8px;
	margin: 1.5rem 0;
	max-width: 100%;
	width: 100%;
	box-sizing: border-box;
	word-wrap: normal;
	white-space: pre;
}

pre code {
	background: none;
	border: none;
	padding: 0;
	font-size: inherit;
	display: block;
	overflow-x: auto;
}

/* Syntax highlighting */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
	color: var(--muted);
	font-style: italic;
}

.token.punctuation {
	color: var(--fg);
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
	color: #d3869b;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
	color: #b8bb26;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
	color: #fe8019;
}

.token.atrule,
.token.attr-value,
.token.keyword {
	color: #83a598;
}

.token.function,
.token.class-name {
	color: #fabd2f;
}

.token.regex,
.token.important,
.token.variable {
	color: #fb4934;
}

.token.important,
.token.bold {
	font-weight: 700;
}

.token.italic {
	font-style: italic;
}

/* Blockquotes */
blockquote {
	margin: 1.5rem 0;
	padding: 0.5rem 0 0.5rem 1.5rem;
	border-left: 4px solid #076678; /* fallback */
	border-left: 4px solid var(--accent-secondary);
	color: #665c54; /* fallback */
	color: var(--muted);
	font-style: italic;
}

blockquote p {
	margin: 0.5rem 0;
}

/* Tables */
table { 
	border-collapse: collapse; 
	width: 100%;
	margin: 1.5rem 0;
}

td, th { 
	padding: 0.75rem; 
	text-align: left; 
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border); 
}

th {
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	font-weight: 700;
}

/* Horizontal rule */
hr {
	border: 0;
	border-top: 2px solid #7c6f64; /* fallback */
	border-top: 2px solid var(--border);
	margin: 2rem 0;
}

/* ===================================================================
   4. LAYOUT COMPONENTS
================================================================== */

/* Site header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	--scroll-progress: 0;
	isolation: isolate;
	background: var(--bg);
	border-bottom: 2px solid transparent;
}

.site-header::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	z-index: 2;
	background: linear-gradient(
		90deg,
		var(--nav-red),
		var(--nav-orange),
		var(--nav-yellow),
		var(--nav-green),
		var(--nav-blue),
		var(--nav-indigo),
		var(--nav-violet)
	);
	transform: scaleX(var(--scroll-progress));
	transform-origin: left;
	will-change: transform;
	pointer-events: none;
}

.site-header-inner {
	max-width: 70rem;
	margin: 0 auto;
	padding: 0.75rem 1rem;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
}

/* Navigation */
nav.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.25rem 1rem;
}

nav.site-nav li { 
	margin: 0; 
	padding: 0; 
}

/* Enhanced navigation animations */
nav.site-nav a {
	--nav-underline: #cc241d; /* fallback */
	--nav-underline: var(--nav-red);
	position: relative;
	text-decoration: none;
	padding-bottom: 0.2rem;
	color: #3c3836; /* fallback */
	color: var(--fg);
	font-family: 'Public Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
	transition: color 140ms ease;
	will-change: transform;
}

nav.site-nav a i {
	transition: transform 200ms ease;
	display: inline-block;
	will-change: transform;
}

nav.site-nav a:visited { 
	color: var(--fg); 
}

nav.site-nav a:hover {
	color: var(--nav-underline);
}

nav.site-nav a:hover i {
	transform: rotate(-10deg) scale(1.1);
}

nav.site-nav a i {
	margin-right: 0.2rem;
}

/* Navigation rainbow colors */
nav.site-nav li:nth-child(7n + 1) a { --nav-underline: #cc241d; /* fallback */ --nav-underline: var(--nav-red); }
nav.site-nav li:nth-child(7n + 2) a { --nav-underline: #d65d0e; /* fallback */ --nav-underline: var(--nav-orange); }
nav.site-nav li:nth-child(7n + 3) a { --nav-underline: #b57614; /* fallback */ --nav-underline: var(--nav-yellow); }
nav.site-nav li:nth-child(7n + 4) a { --nav-underline: #79740e; /* fallback */ --nav-underline: var(--nav-green); }
nav.site-nav li:nth-child(7n + 5) a { --nav-underline: #076678; /* fallback */ --nav-underline: var(--nav-blue); }
nav.site-nav li:nth-child(7n + 6) a { --nav-underline: #458588; /* fallback */ --nav-underline: var(--nav-indigo); }
nav.site-nav li:nth-child(7n + 7) a { --nav-underline: #b16286; /* fallback */ --nav-underline: var(--nav-violet); }

nav.site-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--nav-underline);
	transform: scaleX(1);
	transform-origin: left;
	transition: transform 140ms ease;
}

nav.site-nav a:hover::after,
nav.site-nav a:focus-visible::after {
	transform: scaleX(1);
}

/* Main layout */
.site-layout {
	max-width: 70rem;
	margin: 0 auto;
	padding: 1rem;
	display: flex; /* fallback for older browsers */
	flex-wrap: wrap;
}

.site-layout > .content {
	flex: 7;
	min-width: 300px;
}

.site-layout > .sidebar {
	flex: 3;
	min-width: 200px;
}

@supports (display: grid) {
	.site-layout {
		display: grid;
		grid-template-columns: 7fr 3fr;
		gap: 2rem;
	}
	
	.site-layout > .content,
	.site-layout > .sidebar {
		flex: none;
		min-width: 0;
	}
}

.content {
	min-width: 0;
}

/* Sidebar */
.sidebar .module {
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
	border-radius: 12px;
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	padding: 1rem;
	margin-bottom: 1rem;
}

.sidebar .module h2 {
	margin: 0 0 0.75rem;
	font-size: 1rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

.sidebar .module-badges h2 {
	margin-bottom: 0.35rem;
}

.sidebar .module-badges .badges-grid {
	margin-top: 0;
}

.sidebar ul {
	margin: 0;
	padding-left: 1.25rem;
}

.sidebar ul li {
	margin: 0.15rem 0;
	line-height: 1.3;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.sidebar ul li i {
	color: #cc241d; /* fallback */
	color: var(--accent-primary);
	font-size: 1rem;
	width: 1.25rem;
	text-align: center;
}

.sidebar a {
	display: inline-block;
	padding: 0.25rem 0;
	color: #cc241d; /* fallback */
	color: var(--link);
	text-decoration: underline;
}

.sidebar a:hover {
	color: #9d0006; /* fallback */
	color: var(--link-hover);
}

/* ===================================================================
   HERO SECTION
================================================================== */

.hero {
	background: #f9f5d7; /* fallback */
	background: var(--bg-alt);
	border-bottom: 2px solid #7c6f64; /* fallback */
	border-bottom: 2px solid var(--border);
	padding: 2rem 1rem;
	margin-bottom: 2rem;
	position: relative;
}

.hero-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: none;
	border: none;
	color: #665c54; /* fallback */
	color: var(--muted);
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 4px;
	transition: all 140ms ease;
	z-index: 10;
}

.hero-close:hover {
	color: #3c3836; /* fallback */
	color: var(--fg);
	background: rgba(60, 56, 54, 0.1);
}

.hero-close:active {
	transform: scale(0.95);
}

.hero-close i {
	font-size: 1.25rem;
}

.hero-inner {
	max-width: 70rem;
	margin: 0 auto;
	display: flex; /* fallback for older browsers */
	flex-wrap: wrap;
	gap: 2rem;
	align-items: center;
}

@supports (display: grid) {
	.hero-inner {
		display: grid;
		grid-template-columns: 200px 1fr;
		gap: 2rem;
		align-items: center;
	}
}

.hero-image {
	text-align: center;
}

.hero-image-bg {
	background: #f2e5bc;
	border-radius: 8px;
	padding: 1rem;
	display: inline-block;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hero-image img {
	max-width: 150px;
	height: auto;
	display: block;
	transition: transform 200ms ease;
	will-change: transform;
}

.hero-image img:hover {
	transform: scale(1.05);
}

.hero-image-credit {
	margin-top: 0.5rem;
	font-size: 0.75rem;
	color: #665c54; /* fallback */
	color: var(--muted);
}

.hero-image-credit a {
	color: #665c54; /* fallback */
	color: var(--muted);
	text-decoration: none;
}

.hero-image-credit a:hover {
	color: #cc241d; /* fallback */
	color: var(--link);
}

.hero-content {
	font-size: 1.125rem;
	line-height: 1.6;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

.hero-content p {
	margin: 0 0 1.5rem;
	max-width: 40rem;
}

.hero-btn {
	display: inline-flex;
	align-items: center;
	padding: 0.75rem 1.5rem;
	border-radius: 8px;
	font-weight: 600;
	text-decoration: none;
	transition: all 140ms ease;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	background: #cc241d; /* fallback */
	background: var(--bg);
	color: #fbf1c7; /* fallback */
	color: var(--accent-secondary);
	border: 2px solid #cc241d; /* fallback */
	border: 2px solid var(--accent-primary);
}

.hero-btn:hover {
	color: #9d0006; /* fallback */
	color: var(--link-hover);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(204, 36, 29, 0.3);
}

/* Responsive hero */
@media (max-width: 768px) {
	.hero {
		padding: 1.5rem 1rem;
	}
	
	.hero-inner {
		gap: 1.5rem;
		text-align: center;
	}
	
	@supports (display: grid) {
		.hero-inner {
			grid-template-columns: 1fr;
			grid-template-rows: auto auto;
		}
	}
	
	.hero-content {
		font-size: 1rem;
		margin-top: -3em;
	}
	
	.hero-image-bg {
		padding: 0.75rem;
	}
	
	.hero-image img {
		max-width: 120px;
		margin: 0 auto;
	}
}

/* ===================================================================
   5. CONTENT COMPONENTS
================================================================== */

/* Content typography */
.content h1 {
	font-size: 2rem;
	margin: 0 0 1rem;
	font-weight: 800;
	line-height: 1.2;
}

.post-blurb {
	color: #665c54; /* fallback */
	color: var(--muted);
	font-style: italic;
	margin: 0.5rem 0 0;
	line-height: 1.5;
	font-size: 1rem!important;
	margin-top: -0.5rem!important;
}

.content h2 {
	font-size: 1.5rem;
	margin: 0 0 1rem;
	font-weight: 800;
}

.content p {
	text-align: justify;
	text-justify: inter-word;
}

.content article {
	padding-top: 1.5rem;
	margin-top: 2rem;
}

/* Post header */
.post-header {
	border-bottom: 3px solid #cc241d; /* fallback */
	border-bottom: 3px solid var(--accent-primary);
	padding-bottom: 2rem;
	margin-bottom: 2.5rem;
}

.post-header h1 {
	font-size: 2.5rem;
	line-height: 1.2;
	margin-bottom: 1.5rem;
	font-weight: 800;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

/* Entry content */
.e-content {
	font-size: 1.125rem;
	line-height: 1.8;
	color: #3c3836; /* fallback */
	color: var(--fg);
	max-width: 65ch;
}

.e-content > p {
	margin: 1.5rem 0;
	text-align: left;
}

.e-content > p:first-of-type {
	font-size: 1.2rem;
	line-height: 1.7;
}

.e-content .drop-cap-word {
	font-size: 2.5rem;
	line-height: 1;
	font-weight: 800;
	color: #cc241d; /* fallback */
	color: var(--accent-primary);
	font-family: 'PT Serif', serif;
	margin-right: 0.15rem;
	margin-top: 0.15rem;
}

.e-content h2 {
	font-size: 1.875rem;
	margin: 3rem 0 1.25rem;
	font-weight: 800;
	color: #3c3836; /* fallback */
	color: var(--fg);
	border-left: 4px solid #cc241d; /* fallback */
	border-left: 4px solid var(--accent-primary);
	padding-left: 1rem;
}

.e-content h3 {
	font-size: 1.5rem;
	margin: 2.5rem 0 1rem;
	font-weight: 700;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

.e-content h4 {
	font-size: 1.25rem;
	margin: 2rem 0 0.75rem;
	font-weight: 700;
	color: #665c54; /* fallback */
	color: var(--muted);
}

.e-content ul,
.e-content ol {
	margin: 1.5rem 0;
	padding-left: 2.5rem;
}

.e-content li {
	margin: 0.75rem 0;
	line-height: 1.7;
}

.e-content li::marker {
	color: #cc241d; /* fallback */
	color: var(--accent-primary);
	font-weight: 700;
}

.e-content blockquote {
	margin: 2rem 0;
	padding: 1.5rem 1.5rem 1.5rem 2rem;
	border-left: 4px solid #076678; /* fallback */
	border-left: 4px solid var(--accent-secondary);
	background: #f9f5d7; /* fallback */
	background: var(--bg-alt);
	font-style: italic;
	color: #665c54; /* fallback */
	color: var(--muted);
}

.e-content blockquote p {
	margin: 0.5rem 0;
}

.e-content code {
	padding: 0.2rem 0.4rem;
	background: #f9f5d7; /* fallback */
	background: var(--bg-alt);
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
	border-radius: 3px;
	font-size: 0.9em;
	font-family: 'JetBrains Mono', monospace;
}

.e-content pre code {
	padding: 0;
	background: none;
	border: none;
}

/* Images */
img { 
	max-width: 100%; 
	height: auto;
	border-radius: 8px;
	margin: 0;
}

/* Image Alt-Text Tooltips */
.image-tooltip {
	position: fixed;
	background: #3c3836;
	color: #fbf1c7;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.4;
	max-width: 300px;
	word-wrap: break-word;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	z-index: 1000;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	pointer-events: none;
}

.image-tooltip.visible {
	opacity: 0.95;
	visibility: visible;
}

/* Dark mode adjustments */
.dark-mode .image-tooltip {
	background: #ebdbb2;
	color: #282828;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.content img {
	margin: 1.5rem 0;
}

.about-author-figure {
	margin: 0 0 1.5rem 0;
	text-align: center;
}

.about-author-figure .about-author-image {
	display: block;
	max-width: min(720px, 100%);
	margin: 0 auto;
	border-radius: 0;
}

.about-author-figure .about-author-caption {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted);
}

.book-cover-figure {
	display: block;
	margin: 0.75rem auto 1.25rem;
	text-align: center;
	max-width: min(320px, 100%);
}

.book-cover-image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
	border-radius: 0;
}

.book-cover-caption {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--muted);
}

.post-graph {
	margin: 0 auto;
	max-width: 950px;
}

.post-hero-image {
	width: 100%;
	max-width: 100%;
	margin: 0 0 2rem 0;
	border-radius: 0;
	display: block;
}

.post-hero-caption {
	font-size: 0.875rem;
	color: var(--muted);
	font-style: italic;
	text-align: center;
	margin-top: 0.5rem;
}

figure {
	margin: 2rem 0;
}

figcaption {
	font-size: 0.875rem;
	color: var(--muted);
	font-style: italic;
	text-align: center;
	margin-top: 0.5rem;
	padding: 0 1rem;
}

/* ===================================================================
   6. FORMS
================================================================== */

form {
	margin: 3rem 0; /* fallback for var(--space-xl) */
	margin: var(--space-xl) 0;
	padding: 1.5rem; /* fallback for var(--space-lg) */
	padding: var(--space-lg);
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
	border-radius: 4px;
}

.form-group {
	margin-bottom: 1rem; /* fallback for var(--space-md) */
	margin-bottom: var(--space-md);
}

label {
	display: block;
	margin-bottom: 0.5rem; /* fallback for var(--space-xs) */
	margin-bottom: var(--space-xs);
	font-weight: 600;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

input[type="text"],
input[type="email"],
textarea {
	width: 100%;
	padding: 0.75rem; /* fallback for var(--space-sm) */
	padding: var(--space-sm);
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
	border-radius: 4px;
	background: #fbf1c7; /* fallback */
	background: var(--bg);
	color: #3c3836; /* fallback */
	color: var(--fg);
	font-family: inherit;
	font-size: 0.9rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
	outline: none;
	border-color: #cc241d; /* fallback */
	border-color: var(--accent-primary);
	box-shadow: 0 0 0 2px rgba(204, 36, 29, 0.2);
}

textarea {
	resize: vertical;
	min-height: 120px;
}

/* Enhanced button animations */
button {
	background: #cc241d; /* fallback */
	background: var(--accent-primary);
	color: #fbf1c7; /* fallback */
	color: var(--bg);
	border: none;
	padding: 0.75rem 2rem; /* fallback for var(--space-sm) var(--space-lg) */
	padding: var(--space-sm) var(--space-lg);
	border-radius: 4px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 150ms ease, box-shadow 200ms ease;
	position: relative;
	overflow: hidden;
	will-change: transform, box-shadow;
}

button::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s ease, height 0.6s ease;
}

button:hover {
	background: #9d0006; /* fallback */
	background: var(--link-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(204, 36, 29, 0.3);
}

button:active {
	transform: translateY(0) scale(0.98);
	transition: transform 100ms ease;
}

button:active::before {
	width: 300px;
	height: 300px;
}

/* Newsletter signup */
.newsletter-signup {
	background: #f9f5d7; /* fallback */
	background: var(--bg-alt);
	border: 2px solid #7c6f64; /* fallback */
	border: 2px solid var(--border);
	border-radius: 8px;
	padding: 0.9rem 1rem;
	margin: 1rem auto 0;
	max-width: 70rem;
}

.newsletter-signup h3 {
	margin: 0 0 0.25rem;
	font-family: 'Public Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
	font-size: 1.05rem;
}

.newsletter-signup p {
	color: #665c54; /* fallback */
	color: var(--muted);
}

.embeddable-buttondown-form {
	background: none;
	margin: 0;
	padding: 0;
	border: 0px;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.5rem;
	align-items: end;
}

.embeddable-buttondown-form label {
	grid-column: 1 / -1;
	font-size: 0.9rem;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

.embeddable-buttondown-form input[type="email"] {
	width: 100%;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	border: 2px solid #7c6f64; /* fallback */
	border: 2px solid var(--border);
	background: #fbf1c7; /* fallback */
	background: var(--bg);
	color: #3c3836; /* fallback */
	color: var(--fg);
	font-family: inherit;
}

.embeddable-buttondown-form input[type="email"]:focus {
	outline: 2px solid transparent;
	border-color: #cc241d; /* fallback */
	border-color: var(--accent-primary);
}

.embeddable-buttondown-form input[type="submit"] {
	padding: 0.55rem 0.85rem;
	border-radius: 8px;
	border: 2px solid #cc241d; /* fallback */
	border: 2px solid var(--accent-primary);
	background: #cc241d; /* fallback */
	background: var(--accent-primary);
	color: #fbf1c7; /* fallback */
	color: var(--selection-fg);
	font-weight: 700;
	cursor: pointer;
}

.embeddable-buttondown-form input[type="submit"]:hover {
	filter: brightness(1.05);
}

.embeddable-buttondown-form p {
	margin: 0.5rem 0 0;
	grid-column: 1 / -1;
}

.embeddable-buttondown-form p a {
	color: #cc241d; /* fallback */
	color: var(--link);
}

/* Sidebar newsletter overrides */
.sidebar .newsletter-signup {
	background: transparent;
	border: 0;
	border-radius: 0;
	padding: 0;
	margin: 0;
	max-width: none;
}

.sidebar .newsletter-signup h3 {
	display: none;
}

.newsletter-copy {
	margin-bottom: -0.5lh;
}

/* Guestbook */
.guestbook-form {
	margin-bottom: 3rem;
	padding: 2rem;
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	border-radius: 8px;
}

.guestbook-form .form-group {
	margin-bottom: 1.5rem;
}

.guestbook-form label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 600;
}

.guestbook-form input,
.guestbook-form textarea {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
	border-radius: 4px;
	background: #fbf1c7; /* fallback */
	background: var(--bg);
	color: #3c3836; /* fallback */
	color: var(--fg);
	font-family: inherit;
	font-size: 1rem;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
	outline: none;
	border-color: #cc241d; /* fallback */
	border-color: var(--accent-primary);
}

.guestbook-form small {
	display: block;
	margin-top: 0.25rem;
	opacity: 0.7;
	font-size: 0.875rem;
}

.guestbook-form .btn {
	background: #cc241d; /* fallback */
	background: var(--accent-primary);
	color: #fbf1c7; /* fallback */
	color: var(--bg);
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s;
}

.guestbook-form .btn:hover {
	opacity: 0.9;
}

.guestbook-entries {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.guestbook-entry {
	padding: 1rem;
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	border-radius: 8px;
	margin-top: -2rem!important;
	margin-bottom: -1rem;
}

.guestbook-entry .entry-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: -1rem;
}

.guestbook-entry .entry-header h3 {
	margin: 0;
	font-size: 1.1rem;
}

.guestbook-entry .entry-header h3 a {
	color: inherit;
	text-decoration: none;
}

.guestbook-entry .entry-header h3 a:hover {
	text-decoration: underline;
}

.guestbook-entry .entry-header time {
	opacity: 0.7;
	font-size: 0.875rem;
}

.guestbook-entry .entry-content p {
	margin: 0;
	line-height: 1.5;
}

@media (max-width: 768px) {
	.guestbook-form {
		padding: 1rem;
	}
	
	.guestbook-entry {
		padding: 0.75rem;
	}
	
	.guestbook-entry .entry-header {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ===================================================================
   7. INTERACTIVE COMPONENTS
================================================================== */

/* Theme toggle */
/* Enhanced theme toggle */
.theme-toggle {
	background: none;
	border: 2px solid #7c6f64; /* fallback */
	border: 2px solid var(--border);
	border-radius: 8px;
	color: #3c3836; /* fallback */
	color: var(--fg);
	font-size: 1.2rem;
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	transition: all 140ms ease;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
	will-change: transform;
}

.theme-toggle i {
	transition: transform 300ms ease;
	display: inline-block;
	will-change: transform;
}

.theme-toggle:hover {
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	border-color: #076678; /* fallback */
	border-color: var(--accent-secondary);
	color: #076678; /* fallback */
	color: var(--accent-secondary);
	transform: scale(1.05);
}

.theme-toggle:hover i {
	transform: rotate(180deg);
}

.theme-toggle:active {
	transform: scale(0.95);
	transition: transform 100ms ease;
}

/* Weblog title */
.weblog-title {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1.1;
}

.weblog-title a {
	color: #3c3836; /* fallback */
	color: var(--fg);
	text-decoration: none;
	position: relative;
	padding-bottom: 0.25rem;
	background: linear-gradient(
		90deg,
		var(--nav-red),
		var(--nav-orange),
		var(--nav-yellow),
		var(--nav-green),
		var(--nav-blue),
		var(--nav-indigo),
		var(--nav-violet),
		var(--nav-red)
	);
	background-size: 200% 100%;
	background-clip: text;
	-webkit-background-clip: text;
	color: transparent;
	transition: background-position 0.5s ease;
	background-position: 0% 50%;
}

.weblog-title a:hover {
	background-position: 100% 50%;
	animation: rainbow-wave 1.5s ease-in-out infinite;
}

@keyframes rainbow-wave {
	0% {
		background-position: 0% 50%;
		transform: translateY(0);
	}
	25% {
		transform: translateY(-2px);
	}
	50% {
		background-position: 100% 50%;
		transform: translateY(0);
	}
	75% {
		transform: translateY(-1px);
	}
	100% {
		background-position: 0% 50%;
		transform: translateY(0);
	}
}

.weblog-title a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: linear-gradient(
		90deg,
		var(--nav-red),
		var(--nav-orange),
		var(--nav-yellow),
		var(--nav-green),
		var(--nav-blue),
		var(--nav-indigo),
		var(--nav-violet)
	);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s ease;
}

.weblog-title a:hover::after {
	transform: scaleX(1);
}

/* Post metadata */
.post-metadata {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	align-items: center;
	margin-top: 1rem;
	font-size: 0.95rem;
	padding: 1rem 0;
	border-top: 1px solid #7c6f64; /* fallback */
	border-top: 1px solid var(--border);
	border-bottom: 1px solid #7c6f64; /* fallback */
	border-bottom: 1px solid var(--border);
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.875rem;
	color: #665c54; /* fallback */
	color: var(--muted);
}

.post-metadata-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.meta {
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.875rem;
	color: #665c54; /* fallback */
	color: var(--muted);
}

.post-info, .post-date, .post-tags {
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.875rem;
	color: #665c54; /* fallback */
	color: var(--muted);
}

.post-footer {
	border-top: 2px solid #7c6f64; /* fallback */
	border-top: 2px solid var(--border);
	padding-top: 1.5rem;
	margin-top: 3rem;
}

/* Tags */
.post-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.875rem;
}

.post-tags i {
	color: #076678; /* fallback */
	color: var(--accent-secondary);
	font-size: 1rem;
}

.post-tags .tag {
	padding: 0;
	background: transparent;
	border: none;
	font-size: 0.875rem;
	transition: color 0.2s ease;
}

.post-tags a.tag:visited {
	color: var(--link) !important;
}

.post-tags a.tag:hover,
.post-tags a.tag:active {
	color: var(--link-hover) !important;
}

.post-tags a.tag:focus-visible {
	color: #9d0006; /* fallback */
	color: var(--link-hover) !important;
	outline: 2px solid #076678; /* fallback */
	outline: 2px solid var(--accent-secondary);
	outline-offset: 2px;
}

.tag {
	background: transparent;
	color: #cc241d; /* fallback */
	color: var(--link) !important;
	border: none;
	padding: 0;
	font-size: 0.875rem;
	text-decoration: none !important;
	display: inline-block;
	margin-right: 0.75rem;
	margin-bottom: 0.25rem;
	transition: color 0.2s ease;
}

.tag::before {
	content: "#";
	margin-right: 0.15rem;
}

a.tag:visited {
	color: var(--link) !important;
}

a.tag:hover,
a.tag:active {
	color: var(--link-hover) !important;
}

a.tag:focus-visible {
	color: #9d0006; /* fallback */
	color: var(--link-hover) !important;
	outline: 2px solid #076678; /* fallback */
	outline: 2px solid var(--accent-secondary);
	outline-offset: 2px;
}

/* Author card */
.author-card {
	margin: 3rem 0;
	padding: 2rem;
	background: #f9f5d7; /* fallback */
	background: var(--bg-alt);
	border: 2px solid #7c6f64; /* fallback */
	border: 2px solid var(--border);
	border-radius: 8px;
	border-left: 4px solid #cc241d; /* fallback */
	border-left: 4px solid var(--accent-primary);
}

.author-card-inner {
	max-width: 100%;
}

.author-card-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.author-avatar {
	display: block;
	border-radius: 0;
	object-fit: cover;
	float: left;
	margin: 0.25rem 1rem 0.75rem 0;
}

.author-avatar-link {
	display: inline-block;
	margin: 0.25rem 0 0.75rem 0;
}

.sidebar .author-avatar {
	width: 56px;
	height: 56px;
}

.sidebar .h-card .p-note .author-avatar-link {
	float: left;
	margin: 0.25rem 0.75rem 0.25rem 0;
}

.sidebar .h-card .p-note .author-avatar {
	float: none;
	margin: 0;
}

.sidebar .h-card .p-note {
	text-align: justify;
	text-align-last: left;
	font-size: 0.95rem;
	line-height: 1.4;
}

.author-card .author-avatar {
	width: 72px;
	height: 72px;
	margin: 0 0.75rem 0.75rem 0;
}

.author-card-cta {
	clear: both;
}

.author-card-header h3 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

.author-card-icon {
	font-size: 2rem;
	color: #cc241d; /* fallback */
	color: var(--accent-primary);
}

.author-card-bio {
	margin: 0 0 1.5rem;
	line-height: 1.6;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

.author-card-cta {
	padding-top: 1.5rem;
	border-top: 1px solid #7c6f64; /* fallback */
	border-top: 1px solid var(--border);
}

.author-card-cta p {
	margin: 0 0 1rem;
	font-size: 1rem;
}

.author-card-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* Enhanced support button animations */
.support-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem;
	background: #fbf1c7; /* fallback */
	background: var(--bg);
	border: 2px solid #cc241d; /* fallback */
	border: 2px solid var(--accent-primary);
	border-radius: 6px;
	color: #cc241d; /* fallback */
	color: var(--accent-primary);
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none;
	transition: all 140ms ease;
	font-family: 'Public Sans', sans-serif;
	position: relative;
	overflow: hidden;
}

.support-btn i {
	transition: transform 200ms ease;
}

.support-btn:hover {
	background: #cc241d; /* fallback */
	background: var(--accent-primary);
	color: #fbf1c7; /* fallback */
	color: var(--bg);
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.support-btn:hover i {
	transform: translateY(-2px) rotate(-10deg) scale(1.1);
}

.support-btn i {
	font-size: 1.1rem;
}

/* Enhanced badge animations */
.badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.65rem;
	background: #f9f5d7; /* fallback */
	background: var(--bg-alt);
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 600;
	font-family: 'Public Sans', sans-serif;
	color: #3c3836; /* fallback */
	color: var(--fg);
	text-decoration: none;
	transition: all 140ms ease;
	position: relative;
	overflow: hidden;
}

.badge i {
	transition: transform 200ms ease;
}

.badge:hover {
	transform: translateY(-1px);
	border-color: #076678; /* fallback */
	border-color: var(--accent-secondary);
	color: #076678; /* fallback */
	color: var(--accent-secondary);
	box-shadow: 0 2px 8px rgba(7, 102, 120, 0.2);
}

.badge:hover i {
	transform: rotate(15deg) scale(1.1);
}

/* Share buttons */
.share-buttons {
	margin-top: 2rem;
	padding-top: 2rem;
	padding-bottom: 1rem;
	border-top: 1px solid #7c6f64; /* fallback */
	border-top: 1px solid var(--border);
}

.share-buttons h3 {
	font-size: 1.1rem;
	margin: 0 0 1rem 0;
	font-weight: 700;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

.share-buttons-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 0.75rem;
	padding: 1rem 0;
}

/* Enhanced share button animations */
.share-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	border: 2px solid #7c6f64; /* fallback */
	border: 2px solid var(--border);
	border-radius: 8px;
	background: #fbf1c7; /* fallback */
	background: var(--bg);
	color: #3c3836; /* fallback */
	color: var(--fg);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 600;
	font-family: 'Public Sans', sans-serif;
	transition: all 140ms ease;
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.share-button i {
	transition: transform 200ms ease;
}

.share-button:hover {
	transform: translateY(-2px);
	border-color: #076678; /* fallback */
	border-color: var(--accent-secondary);
	color: #076678; /* fallback */
	color: var(--accent-secondary);
	box-shadow: 0 4px 12px rgba(7, 102, 120, 0.2);
}

.share-button:hover i {
	transform: translateY(-2px) rotate(5deg) scale(1.1);
}

.share-button:active {
	transform: translateY(0) scale(0.95);
	transition: transform 100ms ease;
}

.share-button i {
	font-size: 1.1rem;
}

/* Pagination */
.pagination {
	margin-top: 2rem;
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.previous-page + .next-page::before {
	content: " ";
}

/* Recent posts */
.recent-posts-list {
	padding: 0;
	margin: 0;
}

.recent-post-item {
	border-top: 2px solid var(--border);
	padding-top: 1.5rem;
	margin-top: 1.5rem;
}

.recent-post-item:first-child {
	border-top: none;
	padding-top: 0;
	margin-top: 0;
}

.recent-post-title {
	font-size: 1.5rem;
	margin: 0 0 0.5rem;
	font-weight: 700;
	line-height: 1.3;
}

.recent-post-title a {
	color: #3c3836; /* fallback */
	color: var(--fg);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: border-color 140ms ease, color 140ms ease;
}

.recent-post-title a:hover {
	border-bottom-color: #076678; /* fallback */
	border-bottom-color: var(--accent-secondary);
	color: #9d0006; /* fallback */
	color: var(--link-hover);
}

.recent-post-meta {
	margin: 0;
	font-size: 0.875rem;
	color: #665c54; /* fallback */
	color: var(--muted);
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

/* Verification cards */
.verify-intro {
	margin-bottom: 2rem;
	font-size: 1.05rem;
	color: #665c54; /* fallback */
	color: var(--muted);
}

.verify-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
	margin-top: 2rem;
}

.verify-card {
	--card-accent: #cc241d; /* fallback */
	--card-accent: var(--nav-red);
	background: #f9f5d7; /* fallback */
	background: var(--bg-alt);
	border: 2px solid #7c6f64; /* fallback */
	border: 2px solid var(--border);
	border-radius: 8px;
	padding: 1.5rem;
	transition: all 140ms ease;
}

.verify-card:nth-child(7n + 1) { --card-accent: #cc241d; /* fallback */ --card-accent: var(--nav-red); }
.verify-card:nth-child(7n + 2) { --card-accent: #d65d0e; /* fallback */ --card-accent: var(--nav-orange); }
.verify-card:nth-child(7n + 3) { --card-accent: #b57614; /* fallback */ --card-accent: var(--nav-yellow); }
.verify-card:nth-child(7n + 4) { --card-accent: #79740e; /* fallback */ --card-accent: var(--nav-green); }
.verify-card:nth-child(7n + 5) { --card-accent: #076678; /* fallback */ --card-accent: var(--nav-blue); }
.verify-card:nth-child(7n + 6) { --card-accent: #458588; /* fallback */ --card-accent: var(--nav-indigo); }
.verify-card:nth-child(7n + 7) { --card-accent: #b16286; /* fallback */ --card-accent: var(--nav-violet); }

.verify-card:hover {
	border-color: var(--card-accent);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.verify-card h2 {
	margin: 0 0 1rem 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #3c3836; /* fallback */
	color: var(--fg);
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.verify-card h2 i {
	color: var(--card-accent);
	font-size: 1.1rem;
}

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

.verify-links li {
	margin: 0.75rem 0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.95rem;
}

.verify-links li i {
	color: var(--card-accent);
	font-size: 1rem;
	width: 1.25rem;
	text-align: center;
	flex-shrink: 0;
}

.verify-links a {
	color: #cc241d; /* fallback */
	color: var(--link);
	text-decoration: none;
	transition: color 140ms ease;
}

.verify-links a:hover {
	color: var(--card-accent);
	text-decoration: underline;
}

/* Badges */
.badges-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
	grid-auto-rows: 31px;
	gap: 1px 6px;
	align-content: start;
	justify-content: start;
}

.badges-grid > div {
	margin: 0;
	padding: 0;
	line-height: 0;
}

.badges-grid a {
	display: block;
	padding: 0 !important;
	line-height: 0;
}

.badges-grid img {
	width: 88px;
	height: 31px;
	border: none;
	border-radius: 0;
	background: transparent;
	display: block;
}

/* Stats list */
.stats-list {
	list-style: none;
	padding: 0;
}

.stats-list li {
	margin: 0.75rem 0;
	font-size: 0.9rem;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

/* Post meta */
.post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 1.5rem;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.9rem;
	color: #665c54; /* fallback */
	color: var(--muted);
	gap: 0.2rem;
}

.post-header .post-meta {
	gap: 0.7rem;
}

.post-meta-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.post-meta-item i {
	color: #cc241d; /* fallback */
	color: var(--accent-primary);
	font-size: 1rem;
}

.post-info, .post-tags {
	margin-top: 0.75rem;
}


/* ===================================================================
   8. SPECIAL FEATURES
================================================================== */

/* Header anchors */
h1 .header-anchor::after {
	content: " #";
}

h2 .header-anchor::after {
	content: " ##";
}

h3 .header-anchor::after {
	content: " ###";
}

h4 .header-anchor::after {
	content: " ####";
}

.header-anchor {
	text-decoration: none;
	color: #665c54; /* fallback */
	color: var(--muted);
	margin-left: 0.5rem;
	opacity: 0;
	transition: opacity 0.2s ease;
}

h1:hover .header-anchor,
h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor {
	opacity: 1;
}

/* Pull quotes */
.pullquote {
	font-size: 1.5rem;
	line-height: 1.4;
	text-align: center;
	margin: 2.5rem 0;
	padding: 2rem;
	border-top: 3px solid #cc241d; /* fallback */
	border-top: 3px solid var(--accent-primary);
	border-bottom: 3px solid #cc241d; /* fallback */
	border-bottom: 3px solid var(--accent-primary);
	font-style: italic;
	color: #3c3836; /* fallback */
	color: var(--fg);
}

/* Table of contents */
.toc {
	border: 1px solid #7c6f64; /* fallback for color-mix */
	border: 1px solid var(--border);
	border-radius: 10px;
	background: #f2e5bc; /* fallback */
	background: var(--panel);
	padding: 0.55rem 0.7rem;
	margin: 0.75rem 0 1rem;
	width: 90%;
	max-width: 56rem;
	margin-left: auto;
	margin-right: auto;
	font-size: 0.85em;
	line-height: 1.35;
}

.toc-title {
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.75em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #665c54; /* fallback */
	color: var(--muted);
	margin: 0 0 0.35rem;
	text-align: center;
}

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

.toc ul ul {
	margin-top: 0.2rem;
	padding-left: 0.65rem;
	border-left: 1px solid #7c6f64; /* fallback for color-mix */
	border-left: 1px solid var(--border);
}

.toc li {
	margin: 0.12rem 0;
}

.toc a {
	text-decoration: none;
}

.toc a:hover,
.toc a:active {
	text-decoration: underline;
}

/* Pagefind search UI */
:root {
	--pagefind-ui-scale: 1;
	--pagefind-ui-primary: #d9730d;
	--pagefind-ui-text: #000;
	--pagefind-ui-background: #fff;
	--pagefind-ui-border: #ccc;
	--pagefind-ui-tag: #d9730d;
	--pagefind-ui-border-width: 2px;
	--pagefind-ui-border-radius: 8px;
	--pagefind-ui-image-border-radius: 8px;
	--pagefind-ui-image-box-ratio: 3 / 2;
	--pagefind-ui-font: 'Public Sans', sans-serif;
}

/* Pagefind dark mode overrides */
:root.dark-mode {
	--pagefind-ui-primary: #83a598;
	--pagefind-ui-text: #ebdbb2;
	--pagefind-ui-background: #282828;
	--pagefind-ui-border: #504945;
}

/* Direct styling for Pagefind UI elements in dark mode */
.dark-mode .pagefind-ui__result-link,
.dark-mode .pagefind-ui__result-title,
.dark-mode .pagefind-ui__message {
	color: #ebdbb2 !important;
}

.dark-mode .pagefind-ui__result-excerpt {
	color: #a89984 !important;
}

.dark-mode .pagefind-ui__result {
	background: #282828 !important;
	border-color: #504945 !important;
}

.dark-mode .pagefind-ui__search-input {
	background: #282828 !important;
	color: #ebdbb2 !important;
	border-color: #504945 !important;
}

.dark-mode mark {
	background: #fabd2f !important;
	color: #1d2021 !important;
}

/* Alert boxes dark mode overrides */
.dark-mode .alert-info {
	background: rgba(7, 102, 120, 0.2);
	color: #458588;
}

.dark-mode .alert-warning {
	background: rgba(213, 93, 14, 0.2);
	color: #d79921;
}

.dark-mode .alert-danger {
	background: rgba(204, 36, 29, 0.2);
	color: #cc241d;
}

/* Hero close button dark mode */
.dark-mode .hero-close {
	color: #928374; /* fallback */
	color: var(--muted);
}

.dark-mode .hero-close:hover {
	color: #ebdbb2; /* fallback */
	color: var(--fg);
	background: rgba(235, 219, 178, 0.1);
}

/* ===================================================================
   9. FOOTER
================================================================== */

.page-footer {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid #7c6f64; /* fallback */
	border-top: 1px solid var(--border);
	text-align: center;
	color: #665c54; /* fallback */
	color: var(--muted);
}

.site-footer {
	border-top: 2px solid #7c6f64; /* fallback */
	border-top: 2px solid var(--border);
	margin-top: 2rem;
}

.site-footer-inner {
	max-width: 70rem;
	margin: 0 auto;
	padding: 1rem;
}

.site-footer p {
	margin: 0.5rem 0;
}

.site-footer-grid {
	display: grid;
	grid-template-columns: 1.25fr 1fr 1fr;
	gap: 1.25rem;
	padding: 1rem 0;
}

.site-footer-heading {
	font-size: 1rem;
	margin: 0 0 0.5rem;
	font-family: 'Public Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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

.site-footer-list li {
	margin: 0.35rem 0;
}

.site-footer-list a {
	--nav-underline: #cc241d; /* fallback */
	--nav-underline: var(--nav-red);
	display: inline-flex;
	align-items: baseline;
	gap: 0.35rem;
	position: relative;
	text-decoration: none;
	padding-bottom: 0.2rem;
	color: #3c3836; /* fallback */
	color: var(--fg);
	transition: color 140ms ease;
}

.site-footer-list a:visited { color: var(--fg); }
.site-footer-list a:hover,
.site-footer-list a:active { color: var(--nav-underline); }

.site-footer-list li:nth-child(7n + 1) a { --nav-underline: #cc241d; /* fallback */ --nav-underline: var(--nav-red); }
.site-footer-list li:nth-child(7n + 2) a { --nav-underline: #d65d0e; /* fallback */ --nav-underline: var(--nav-orange); }
.site-footer-list li:nth-child(7n + 3) a { --nav-underline: #b57614; /* fallback */ --nav-underline: var(--nav-yellow); }
.site-footer-list li:nth-child(7n + 4) a { --nav-underline: #79740e; /* fallback */ --nav-underline: var(--nav-green); }
.site-footer-list li:nth-child(7n + 5) a { --nav-underline: #076678; /* fallback */ --nav-underline: var(--nav-blue); }
.site-footer-list li:nth-child(7n + 6) a { --nav-underline: #458588; /* fallback */ --nav-underline: var(--nav-indigo); }
.site-footer-list li:nth-child(7n + 7) a { --nav-underline: #b16286; /* fallback */ --nav-underline: var(--nav-violet); }

.site-footer-list a::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 2px;
	background: var(--nav-underline);
	transform: scaleX(1);
	transform-origin: left;
	transition: transform 140ms ease;
}

.site-footer-list a:hover::before,
.site-footer-list a:focus-visible::before {
	transform: scaleX(1);
}

.site-footer-list a i {
	color: #665c54; /* fallback */
	color: var(--muted);
}

.site-footer-land {
	border-top: 1px solid #7c6f64; /* fallback */
	border-top: 1px solid var(--border);
	margin-top: 1rem;
	padding-top: 1rem;
}

.footer-links {
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.875rem;
}

/* Back to top button */
.to-top {
	position: fixed !important;
	bottom: 20px !important;
	right: 20px !important;
	left: auto !important;
	top: auto !important;
	z-index: 100;
	border: 1px solid #7c6f64; /* fallback */
	border: 1px solid var(--border);
	border-radius: 999px;
	background: #fbf1c7; /* fallback */
	background: var(--bg);
	color: #3c3836; /* fallback */
	color: var(--fg);
	text-decoration: none;
	padding: 0.4rem 0.6rem;
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-weight: 700;
	/* Ensure proper positioning relative to viewport */
	transform: none !important;
}

/* Override link styles for to-top button */
.to-top:link,
.to-top:visited {
	position: fixed !important;
}

.to-top::before {
	display: none;
}

/* ===================================================================
   STYLE GUIDE COMPONENTS
================================================================== */

/* Footnotes and citations */
.footnote-ref {
	font-size: 0.8em;
	vertical-align: super;
	color: var(--accent-primary);
	text-decoration: none;
	font-weight: 600;
}

.footnote-ref:hover {
	color: var(--link-hover);
	text-decoration: underline;
}

.footnotes {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
	font-size: 0.9em;
	color: var(--muted);
}

.footnotes ol {
	padding-left: 1.5rem;
}

.footnotes li {
	margin-bottom: 0.5rem;
	line-height: 1.5;
}

/* Citation styling */
sup.citation {
	font-size: 0.75em;
	vertical-align: super;
	color: var(--accent-primary);
	font-weight: 600;
	margin-left: 2px;
}

/* Emoji support */
body {
	/* Ensure emoji rendering is consistent */
	font-family: 'PT Serif', serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'EmojiFont', sans-serif;
}

code, pre {
	/* Include emoji fonts in code blocks */
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
}

/* Color utility classes */
.text-primary {
	color: var(--accent-primary) !important;
}

.text-secondary {
	color: var(--accent-secondary) !important;
}

.text-success {
	color: #79740e !important; /* Using green from nav colors */
}

.text-danger {
	color: var(--accent-primary) !important; /* Using red as danger */
}

.text-muted {
	color: var(--muted) !important;
}

/* Badge styles */
.badge {
	display: inline-block;
	padding: 0.25em 0.6em;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: 4px;
	background: var(--panel);
	color: var(--fg);
	border: 1px solid var(--border);
}

.badge-primary {
	background: var(--accent-primary);
	color: var(--bg);
	border-color: var(--accent-primary);
}

.badge-secondary {
	background: var(--accent-secondary);
	color: var(--bg);
	border-color: var(--accent-secondary);
}

/* Alert boxes */
.alert {
	padding: 1rem 1.25rem;
	margin: 1.5rem 0;
	border: 1px solid;
	border-radius: 8px;
	position: relative;
}

.alert::before {
	font-family: 'Font Awesome 6 Free';
	font-weight: 900;
	position: absolute;
	left: 1rem;
	top: 1rem;
	font-size: 1.25rem;
	color: inherit;
}

.alert strong {
	margin-left: 1.75rem;
	display: block;
}

.alert > *:not(strong):not(:first-child) {
	margin-left: 1.75rem;
}

.alert-info {
	background: rgba(7, 102, 120, 0.1);
	border-color: #076678;
	color: #076678;
}

.alert-info::before {
	content: '\f05a'; /* fa-info-circle */
}

.alert-warning {
	background: rgba(213, 93, 14, 0.1);
	border-color: #d65d0e;
	color: #d65d0e;
}

.alert-warning::before {
	content: '\f071'; /* fa-exclamation-triangle */
}

.alert-danger {
	background: rgba(204, 36, 29, 0.1);
	border-color: #cc241d;
	color: #cc241d;
}

.alert-danger::before {
	content: '\f057'; /* fa-times-circle */
}

/* Button variants */
.btn {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	margin: 0.25rem;
	border: 2px solid;
	border-radius: 8px;
	font-family: 'Public Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: all 140ms ease;
	background: none;
}

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

.btn-primary:hover {
	background: var(--link-hover);
	border-color: var(--link-hover);
	color: var(--bg);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(204, 36, 29, 0.3);
}

.btn-secondary {
	background: var(--accent-secondary);
	border-color: var(--accent-secondary);
	color: var(--bg);
}

.btn-secondary:hover {
	background: #458588;
	border-color: #458588;
	color: var(--bg);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(7, 102, 120, 0.3);
}

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

.btn-outline:hover {
	background: var(--accent-primary);
	color: var(--bg);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(204, 36, 29, 0.3);
}

/* Keyboard keys styling */
kbd {
	display: inline-block;
	padding: 0.2em 0.4em;
	margin: 0 0.1em;
	font-size: 0.875em;
	font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	line-height: 1;
	color: var(--fg);
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
	box-shadow: 0 2px 0 var(--border), 0 3px 5px rgba(0, 0, 0, 0.1);
}

/* Details/accordion styling */
details {
	margin: 1rem 0;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 0;
	background: var(--bg-alt);
}

details summary {
	padding: 1rem;
	cursor: pointer;
	font-weight: 600;
	border-radius: 8px;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

details summary:hover {
	background: var(--panel);
}

details summary::marker {
	display: none;
}

details summary::before {
	content: '▶';
	font-size: 0.75rem;
	transition: transform 200ms ease;
}

details[open] summary::before {
	transform: rotate(90deg);
}

details > *:not(summary) {
	padding: 0 1rem 1rem;
}

details[open] summary {
	border-bottom: 1px solid var(--border);
}

/* Highlight/mark styling */
mark {
	background: #fabd2f;
	color: #1d2021;
	padding: 0.1em 0.2em;
	border-radius: 2px;
}

/* Underline styling */
u {
	text-decoration: underline;
	text-decoration-color: var(--accent-primary);
	text-decoration-thickness: 2px;
	text-underline-offset: 2px;
}

/* Strikethrough styling */
del {
	text-decoration: line-through;
	text-decoration-color: var(--muted);
	text-decoration-thickness: 1px;
}

/* ===================================================================
   10. UTILITIES & HELPERS
================================================================== */

.hidden {
	display: none;
}

.pagefind-ui__result-link::before {
	left: -1rem!important;
}

/* Print styles */
@media print {
	body {
		background: white;
		color: black;
		font-size: 12pt;
	}
	
	.site-header,
	.sidebar,
	.share-buttons,
	.author-card-cta,
	.theme-toggle,
	.header-anchor,
	.webmentions,
	.related-posts {
		display: none;
	}
	
	.site-layout {
		grid-template-columns: 1fr;
		max-width: 100%;
	}
	
	.e-content {
		max-width: 100%;
	}
	
	a {
		text-decoration: underline;
		color: black;
	}
	
	a[href]:after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
	}
	
	.post-header {
		border-bottom: 2px solid black;
	}
	
	img {
		max-width: 100%;
		page-break-inside: avoid;
	}
	
	h1, h2, h3 {
		page-break-after: avoid;
	}
	
	blockquote, pre {
		page-break-inside: avoid;
	}
}

/* ===================================================================
   11. RESPONSIVE DESIGN
================================================================== */

/* Mobile breakpoints */
@media (max-width: 768px) {
	body { font-size: 16px; }
	.e-content { font-size: 1.0625rem; }
	
	.site-header-inner {
		padding: 0.5rem 0.75rem;
		flex-wrap: nowrap;
		align-items: center;
		gap: 0.5rem;
	}

	.weblog-title {
		font-size: 0.9rem;
	}

	nav.site-nav ul {
		gap: 0.15rem 0.5rem;
	}

	nav.site-nav a {
		font-size: 0.85rem;
		padding-bottom: 0.1rem;
		white-space: nowrap;
	}

	.theme-toggle {
		font-size: 1rem;
		padding: 0.35rem 0.5rem;
		border-width: 1px;
		border-radius: 6px;
	}
	
	nav.site-nav a::after {
		transform: scaleX(1);
	}
	
	.site-layout { grid-template-columns: 1fr; }
	
	.author-card {
		padding: 1.5rem;
	}
	
	.author-card-buttons {
		flex-direction: column;
	}
	
	.support-btn {
		width: 100%;
		justify-content: center;
	}
	
	.share-buttons-grid {
		grid-template-columns: 1fr 1fr;
	}
	
	.newsletter-signup {
		margin: 1rem;
		padding: 0.9rem 1rem;
	}


	.embeddable-buttondown-form input[type="submit"] {
		width: 100%;
	}
	
	.verify-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
	
	.verify-card {
		padding: 1.25rem;
	}
	
	.site-footer-grid {
		grid-template-columns: 1fr;
		gap: 0.75rem;
		padding: 0.75rem 0;
	}
	
	.site-footer-list li {
		margin: 0.25rem 0;
	}
	
	.author-avatar {
		float: none;
		margin: 0 0 1rem 0;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
	}
}
