/* === Universal styles === */
* {
	box-sizing: border-box;
}

/* === Global (inherited) styles === */
:root {
	/* Fluid typography - scales with viewport */
	font-size: calc(1rem + 0.25vw);

	/* Modular scale - mathematical harmony */
	/* Ratio of 1.5 for visual harmony (major third) */
	--ratio: 1.5;
	--s-2: calc(var(--s-1) / var(--ratio));
	--s-1: calc(var(--s0) / var(--ratio));
	--s0: 1rem;
	--s1: calc(var(--s0) * var(--ratio));
	--s2: calc(var(--s1) * var(--ratio));
	--s3: calc(var(--s2) * var(--ratio));
	--s4: calc(var(--s3) * var(--ratio));

	/* NEW: Font family variables */
	--font-serif: 'Crimson Pro', serif;
	--font-sans: 'Inter', sans-serif;
	--font-mono: 'JetBrains Mono', monospace;

	/* NEW: Stone color palette */
	--stone-50: #fafaf9;
	--stone-100: #f5f5f4;
	--stone-200: #e7e5e4;
	--stone-300: #d6d3d1;
	--stone-400: #a8a29e;
	--stone-500: #78716c;
	--stone-600: #57534e;
	--stone-700: #44403c;
	--stone-800: #292524;
	--stone-900: #1c1917;

	/* Colors - branding layer */
	--color-light: var(--stone-50);
	--color-dark: var(--stone-900);
	--color-secondary: var(--stone-400);
	--color-tertiary: var(--stone-300);
	--bg-color: var(--stone-50);
	--line-color: #e5e5e0;

	/* Design axioms */
	--measure: 60ch;
}

body {
	margin: 0;
	padding: var(--s1);
	font-family: var(--font-sans);
	background-color: var(--bg-color);
	line-height: 1.6;
	color: var(--color-dark);
	scroll-behavior: smooth;
}

/* Page Layout */
.page-body {
	overflow-x: hidden;
	color: var(--stone-900);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.main-content {
	flex-grow: 1;
	padding-top: 8rem;
}

/* === Exception-based styling === */
/* Measure axiom: no line of text should exceed 60ch */
* {
	max-inline-size: var(--measure);
}

/* Container exceptions: these may contain multiple adjacent boxes */
html,
body,
div,
header,
nav,
main,
footer,
.stack,
.box,
.cluster,
.sidebar {
	max-inline-size: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
figcaption {
	max-inline-size: var(--measure);
}

/* === Element selectors === */
/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	line-height: 1.2;
	font-family: var(--font-serif);
	font-weight: 700;
}

h1 {
	font-size: var(--s3);
}

h2 {
	font-size: var(--s2);
}

h3 {
	font-size: var(--s1);
}

p {
	margin: 0;
}

/* NEW: Selection styling */
::selection {
	background-color: var(--stone-900);
	color: white;
}

/* Inline elements - em for context-sensitive sizing */
code {
	font-family: var(--font-mono);
	background-color: var(--stone-200);
	padding: 0.2rem 0.4rem;
	font-size: 0.9em;
	color: var(--stone-900);
}

pre {
	background-color: var(--stone-900);
	color: var(--stone-200);
	padding: 1.5rem;
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: 0.85rem;
}

pre code {
	background-color: transparent;
	padding: 0;
	color: inherit;
}

a {
	color: inherit;
}

hr {
	border: none;
	border-block-start: 1px solid currentColor;
	margin: 0;
}

/* === Utility Classes === */
.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }

/* === Navigation States === */
/* Active state for nav links */
.nav-active,
.nav-link-active {
	color: var(--stone-900) !important;
	border-bottom: 1px solid var(--stone-900);
}

/* Inactive state for nav links */
.nav-inactive,
.nav-link-inactive {
	color: var(--stone-400) !important;
}

.nav-inactive:hover,
.nav-link-inactive:hover {
	color: var(--stone-500) !important;
}

/* Scrolled Navbar State */
.nav-scrolled {
	background-color: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	padding-top: 1rem !important;
	padding-bottom: 1rem !important;
	border-bottom: 1px solid var(--stone-100);
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* === Animations === */
@keyframes fadeIn {
	to { opacity: 1; transform: translateY(0); }
}

.fade-in {
	animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
	opacity: 0;
	transform: translateY(10px);
}

/* === Intrinsic Grid === */
.intrinsic-grid,
.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
	grid-auto-rows: minmax(300px, auto);
	grid-auto-flow: dense;
	gap: 1px;
	background-color: var(--line-color);
	border: 1px solid var(--line-color);
}

.post-grid {
	max-width: 80rem;
	margin: 0 auto;
	border-top: 1px solid rgba(231, 229, 228, 0.5);
	border-bottom: 1px solid rgba(231, 229, 228, 0.5);
}

.grid-item {
	background-color: var(--bg-color);
	padding: 2.5rem;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: background-color 0.3s ease;
	cursor: pointer;
}

.grid-item:hover {
	background-color: var(--stone-100);
}

/* Grid item variants */
.grid-item.span-2-cols {
	grid-column: span 2;
}

.grid-item.span-2-rows {
	grid-row: span 2;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.grid-item.span-2-cols,
	.grid-item.span-2-rows {
		grid-column: span 1;
		grid-row: span 1;
	}
}

/* === Component-Specific Styles === */

/* Category Buttons */
.category-btn {
	padding: 0.5rem 1.5rem;
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-weight: 900;
	transition: all 0.3s ease;
	border: 1px solid transparent;
	background-color: transparent;
	color: var(--stone-300);
	cursor: pointer;
}

.category-btn:hover {
	color: var(--stone-900);
	border-color: var(--stone-200);
}

.category-btn.active {
	background-color: var(--stone-900);
	color: white;
	border-color: var(--stone-900);
}

/* Footer Layout */
.footer-content {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	gap: 3rem;
	color: var(--stone-400);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	max-width: 80rem;
	margin-left: auto;
	margin-right: auto;
}

@media (min-width: 768px) {
	.footer-content {
		flex-direction: row;
	}
}

.footer-links {
	display: flex;
	gap: 2rem;
}

.footer-link {
	color: inherit;
	transition: color 0.3s ease;
}

.footer-link:hover {
	color: var(--stone-900);
}

/* Newsletter Input Container */
.newsletter-input-group {
	display: flex;
	flex-direction: column;
	gap: 0;
	border-bottom: 2px solid var(--stone-900);
	transition: border-color 0.3s ease;
}

@media (min-width: 640px) {
	.newsletter-input-group {
		flex-direction: row;
	}
}

.newsletter-input-group:focus-within {
	border-color: var(--stone-400);
}

.newsletter-input {
	background-color: transparent;
	border: none;
	padding: 1rem 1rem;
	flex-grow: 1;
	font-size: 1.125rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-weight: 900;
}

.newsletter-input:focus {
	outline: none;
}

.newsletter-input::placeholder {
	color: var(--stone-300);
}

.newsletter-button {
	padding: 1.5rem 2rem;
	color: var(--stone-900);
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.3em;
	font-size: 0.75rem;
	white-space: nowrap;
	transition: background-color 0.3s ease;
	background-color: transparent;
	border: none;
	cursor: pointer;
}

.newsletter-button:hover {
	background-color: var(--stone-200);
}

/* === Footer Component === */
.footer-component {
	background-color: white;
	padding: 4rem 1.5rem;
	border-top: 1px solid var(--stone-100);
	margin-top: auto;
}

@media (min-width: 768px) {
	.footer-component {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

/* === Newsletter Component === */
.newsletter-component {
	padding: 1.5rem;
	text-align: center;
	padding-top: 6rem;
	padding-bottom: 6rem;
	max-width: 70rem;
	margin-left: auto;
	margin-right: auto;
}

@media (min-width: 768px) {
	.newsletter-component {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

.newsletter-input-group {
	max-width: 48rem;
	margin-left: auto;
	margin-right: auto;
}

.newsletter-title {
	font-size: 3rem;
	margin-bottom: 2rem;
}

@media (min-width: 768px) {
	.newsletter-title {
		font-size: 4.5rem;
	}
}

@media (min-width: 992px) {
	.newsletter-title {
		font-size: 5rem;
	}
}

.newsletter-description {
	color: var(--stone-500);
	font-size: 1.125rem;
	font-weight: 300;
	margin-bottom: 4rem;
	max-width: 36rem;
	margin-left: auto;
	margin-right: auto;
}

/* === Navbar Component === */
.navbar-component {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 50;
	transition: all 0.5s ease;
	background-color: transparent;
	padding-top: 2rem;
	padding-bottom: 2rem;
}

.navbar-inner {
	max-width: 80rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

@media (min-width: 768px) {
	.navbar-inner {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

.navbar-logo-text {
	font-weight: 700;
	letter-spacing: -0.05em;
	font-family: var(--font-serif);
}

.navbar-logo {
	font-size: 1.25rem;
	transition: opacity 0.3s ease;
}

@media (min-width: 768px) {
	.navbar-logo {
		font-size: 1.5rem;
	}
}

.navbar-logo:hover {
	opacity: 0.7;
}

.navbar-nav {
	gap: 2rem;
	align-items: center;
	font-weight: 500;
	font-size: 0.875rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.navbar-divider {
	display: none;
	height: 2.5rem;
	width: 1px;
	background-color: var(--stone-200);
}

@media (min-width: 768px) {
	.navbar-divider {
		display: block;
	}
}

.navbar-subscribe-btn {
	display: none;
}

@media (min-width: 768px) {
	.navbar-subscribe-btn {
		display: block;
		background-color: var(--stone-900);
		color: white;
		padding: 0.5rem 1.25rem;
		transition: background-color 0.3s ease;
	}
}

.navbar-subscribe-btn:hover {
	background-color: var(--stone-700);
}

/* === Manifesto Component === */
.manifesto-component {
	margin-top: 12rem;
	margin-bottom: 12rem;
	padding-top: 8rem;
	padding-bottom: 8rem;
	background-color: #1c1917;
	color: #e7e5e4;
}

.manifesto-blockquote {
	text-align: center;
	max-width: 80rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

.manifesto-quote {
	font-family: var(--font-serif);
	font-size: 2.25rem;
	font-style: italic;
	line-height: 1.25;
	margin-bottom: 3rem;
}

@media (min-width: 768px) {
	.manifesto-quote {
		font-size: 4.5rem;
	}
}

.manifesto-attribution {
	text-transform: uppercase;
	letter-spacing: 0.4em;
	font-size: 0.625rem;
	font-weight: 900;
	color: var(--stone-500);
	font-style: normal;
}

/* === Index Page === */
.page-header {
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	max-width: 80rem;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 8rem;
}

@media (min-width: 768px) {
	.page-header {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

.page-title {
	font-size: 4.5rem;
	font-family: var(--font-serif);
	line-height: 0.85;
	letter-spacing: -0.05em;
	color: var(--stone-900);
	word-break: break-word;
}

@media (min-width: 768px) {
	.page-title {
		font-size: 9rem;
	}
}

@media (min-width: 1024px) {
	.page-title {
		font-size: 12rem;
	}
}

.page-description {
	font-size: 1.5rem;
	color: var(--stone-400);
	line-height: 1.625;
	font-weight: 300;
	max-width: 32rem;
	font-family: var(--font-serif);
}

@media (min-width: 768px) {
	.page-description {
		font-size: 1.875rem;
	}
}

/* Post Items */
.post-category {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-weight: 900;
	color: var(--stone-300);
	transition: color 0.3s ease;
}

.group:hover .post-category {
	color: var(--stone-900);
}

.post-reading-time {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--stone-400);
	font-weight: 500;
}

.post-title {
	font-family: var(--font-serif);
	line-height: 1.1;
	letter-spacing: -0.025em;
	font-size: 1.875rem;
	transition: color 0.3s ease;
}

.group:hover .post-title {
	color: var(--stone-600);
}

.post-excerpt {
	color: var(--stone-500);
	line-height: 1.625;
	font-weight: 300;
	font-size: 0.875rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.post-footer {
	padding-top: 1.5rem;
	border-top: 1px solid rgba(227, 229, 232, 0.5);
}

.post-date {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--stone-400);
	font-weight: 700;
}

.post-read-link {
	font-size: 0.75rem;
	font-weight: 700;
	transition: transform 0.3s ease;
	display: inline-block;
}

.group:hover .post-read-link {
	transform: translateX(0.5rem);
}

/* === About Page === */
.about-page {
	padding-top: 4rem;
	padding-bottom: 8rem;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	max-width: 60rem;
	margin-left: auto;
	margin-right: auto;
}

@media (min-width: 768px) {
	.about-page {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

.about-title {
	font-size: 4.5rem;
	font-family: var(--font-serif);
	line-height: 0.8;
	margin-bottom: 4rem;
	letter-spacing: -0.05em;
	color: var(--stone-900);
}

@media (min-width: 768px) {
	.about-title {
		font-size: 10rem;
	}
}

.about-label {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.4em;
	font-weight: 900;
	color: var(--stone-300);
	position: sticky;
	top: 8rem;
}

.about-quote {
	font-size: 1.875rem;
	font-family: var(--font-serif);
	line-height: 1.25;
	margin-bottom: 3rem;
	color: var(--stone-700);
	font-style: italic;
}

@media (min-width: 768px) {
	.about-quote {
		font-size: 2.25rem;
	}
}

.about-content {
	font-size: 1.25rem;
	color: var(--stone-600);
	font-weight: 300;
	line-height: 1.625;
}

.principles-section {
	padding-top: 6rem;
	padding-bottom: 6rem;
	border-top: 1px solid var(--stone-100);
	border-bottom: 1px solid var(--stone-100);
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
}

.principle-number {
	font-family: var(--font-mono);
	font-size: 0.625rem;
	color: var(--stone-300);
	font-weight: 700;
}

.principle-title {
	font-size: 1.25rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.15em;
}

.principle-description {
	font-size: 0.875rem;
	color: var(--stone-500);
	font-weight: 300;
	line-height: 1.625;
}

.about-footer {
	text-align: center;
	padding-top: 3rem;
}

.about-footer-label {
	color: var(--stone-300);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.5em;
	font-weight: 900;
	margin-bottom: 3rem;
}

.about-social-links {
	display: flex;
	gap: 3rem;
	justify-content: center;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-size: 0.625rem;
}

.social-link {
	color: inherit;
	transition: color 0.3s ease;
}

.social-link:hover {
	color: var(--stone-400);
}

/* === Post Article Page === */
.post-article {
	padding-top: 8rem;
	padding-bottom: 6rem;
}

.post-header {
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	max-width: 60rem;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 6rem;
}

@media (min-width: 768px) {
	.post-header {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

.back-link {
	margin-bottom: 4rem;
	color: var(--stone-400);
	display: inline-flex;
	gap: var(--gap-sm);
	transition: color 0.3s ease;
}

.back-link:hover {
	color: var(--stone-900);
}

.back-arrow {
	transition: transform 0.3s ease;
	display: inline-block;
}

.back-link:hover .back-arrow {
	transform: translateX(-0.25rem);
}

.back-text {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.3em;
	font-weight: 900;
}

.post-meta {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-weight: 700;
	color: var(--stone-300);
	gap: 1.5rem;
}

.post-category-tag {
	color: var(--stone-900);
	background-color: var(--stone-100);
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	padding-top: 0.25rem;
	padding-bottom: 0.25rem;
}

.post-article-title {
	font-size: 3.75rem;
	font-family: var(--font-serif);
	line-height: 1;
	letter-spacing: -0.05em;
	color: var(--stone-900);
}

@media (min-width: 768px) {
	.post-article-title {
		font-size: 6rem;
	}
}

.post-article-excerpt {
	font-size: 1.5rem;
	color: var(--stone-400);
	font-weight: 300;
	font-style: italic;
	line-height: 1.375;
	border-left: 2px solid var(--stone-200);
	padding-left: 2rem;
	font-family: var(--font-serif);
}

@media (min-width: 768px) {
	.post-article-excerpt {
		font-size: 1.875rem;
	}
}

.post-content-wrapper {
	max-width: 64rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

@media (min-width: 768px) {
	.post-content-wrapper {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

.post-content {
	line-height: 1.75;
	font-size: 1.25rem;
}

.post-article-footer {
	max-width: 64rem;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
	margin-top: 8rem;
	padding-top: 4rem;
	border-top: 1px solid var(--stone-100);
}

@media (min-width: 768px) {
	.post-article-footer {
		padding-left: 3rem;
		padding-right: 3rem;
	}
}

.author-avatar {
	width: 4rem;
	height: 4rem;
	background-color: var(--stone-900);
	color: white;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 1.25rem;
	font-weight: 900;
	font-family: var(--font-serif);
}

.author-label {
	font-size: 0.75rem;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--stone-400);
	margin-bottom: 0.25rem;
}

.author-name {
	font-size: 1.125rem;
	font-weight: 700;
}

.author-title {
	font-size: 0.875rem;
	color: var(--stone-500);
}

.post-action-button {
	padding-left: 2rem;
	padding-right: 2rem;
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-size: 0.625rem;
	font-weight: 900;
	transition: all 0.3s ease;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	border: none;
}

.post-share-button {
	background-color: var(--stone-900);
	color: white;
}

.post-share-button:hover {
	background-color: var(--stone-700);
}

.post-back-button {
	border: 1px solid var(--stone-200);
	color: var(--stone-400);
}

.post-back-button:hover {
	border-color: var(--stone-900);
	color: var(--stone-900);
}

/* === Post Card Component === */
/* Note: Card styles reuse post-item styles for consistency */
.card-category {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	font-weight: 900;
	color: var(--stone-300);
	transition: color 0.3s ease;
}

.group:hover .card-category {
	color: var(--stone-900);
}

.card-reading-time {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--stone-400);
	font-weight: 500;
}

.card-title {
	font-family: var(--font-serif);
	line-height: 1.1;
	letter-spacing: -0.025em;
	font-size: 1.875rem;
	transition: color 0.3s ease;
}

.group:hover .card-title {
	color: var(--stone-600);
}

.card-excerpt {
	color: var(--stone-500);
	line-height: 1.625;
	font-weight: 300;
	font-size: 0.875rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-footer {
	padding-top: 1.5rem;
	border-top: 1px solid rgba(227, 229, 232, 0.5);
}

.card-date {
	font-size: 0.625rem;
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--stone-400);
	font-weight: 700;
}

.card-read-link {
	font-size: 0.75rem;
	font-weight: 700;
	transition: transform 0.3s ease;
	display: inline-block;
}

.group:hover .card-read-link {
	transform: translateX(0.5rem);
}

/* === Utility Classes === */
.with-top-margin {
	margin-top: 3rem;
}
