:root,
[data-theme='light'] {
	color-scheme: light;
	--text: #0f172a;
	--reading: #334155;
	--text-secondary: #475569;
	--muted: #64748b;
	--border: #e5e7eb;
	--border-strong: #d1d5db;
	--accent: #0f4c81;
	--accent-hover: #0a3558;
	--accent-soft: #e8f1f8;
	--blockquote-text: #1e3a5f;
	--notice-border: #bfdbfe;
	--market-up: #047857;
	--market-badge: #b45309;
	--bg: #ffffff;
	--surface: #f9fafb;
	--header-bg: #0a1628;
	--header-text: #f9fafb;
	--logo-accent: #7eb8e8;
	--tagline: #94a3b8;
	--header-input-bg: #1e293b;
	--header-input-border: #334155;
	--main-input-bg: #ffffff;
	--main-input-border: #d1d5db;
	--main-input-text: #111827;
	--font-sans: 'Inter', system-ui, -apple-system, sans-serif;
	--font-serif: 'Libre Baskerville', Georgia, serif;
	--max-width: 1180px;
	--radius: 10px;
}

[data-theme='dark'] {
	color-scheme: dark;
	--text: #eef2f7;
	--reading: #b8c5d6;
	--text-secondary: #94a3b8;
	--muted: #7b8da3;
	--border: #334155;
	--border-strong: #475569;
	--accent: #7eb8e8;
	--accent-hover: #93c5fd;
	--accent-soft: #1e3a5f;
	--blockquote-text: #bfdbfe;
	--notice-border: #1e40af;
	--market-up: #34d399;
	--market-badge: #f59e0b;
	--bg: #0a1628;
	--surface: #111d32;
	--header-bg: #060d18;
	--header-text: #f1f5f9;
	--logo-accent: #7eb8e8;
	--tagline: #94a3b8;
	--header-input-bg: #1e293b;
	--header-input-border: #475569;
	--main-input-bg: #1e293b;
	--main-input-border: #475569;
	--main-input-text: #f1f5f9;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: var(--font-sans);
	line-height: 1.6;
	color: var(--reading);
	background: var(--bg);
}

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

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

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Header */

.site-header {
	background: var(--header-bg);
	color: var(--header-text);
	border-bottom: 3px solid var(--accent);
}

.site-header__inner,
.site-main,
.site-footer__inner {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 1rem 1.25rem;
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 1.25rem;
	padding-bottom: 1.25rem;
}

.site-logo {
	font-family: var(--font-serif);
	font-size: 1.65rem;
	font-weight: 700;
	text-decoration: none;
	color: var(--header-text);
	letter-spacing: -0.02em;
}

.site-logo span {
	color: var(--logo-accent);
	font-weight: 700;
}

.site-tagline {
	margin: 0.2rem 0 0;
	color: var(--tagline);
	font-size: 0.85rem;
}

.site-header__tools {
	display: flex;
	flex: 1 1 280px;
	align-items: center;
	justify-content: flex-end;
	gap: 0.65rem;
	max-width: 380px;
}

.search-form {
	flex: 1 1 220px;
	min-width: 0;
}

.site-header .search-form input {
	width: 100%;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--header-input-border);
	border-radius: var(--radius);
	font: inherit;
	font-size: 0.9rem;
	background: var(--header-input-bg);
	color: var(--header-text);
}

.site-header .search-form input::placeholder {
	color: var(--tagline);
}

.site-header .search-form input:focus {
	outline: 2px solid var(--logo-accent);
	outline-offset: 1px;
	border-color: var(--logo-accent);
}

.site-main .search-form input {
	width: 100%;
	max-width: 28rem;
	padding: 0.65rem 0.9rem;
	border: 1px solid var(--main-input-border);
	border-radius: var(--radius);
	font: inherit;
	font-size: 0.95rem;
	background: var(--main-input-bg);
	color: var(--main-input-text);
}

.site-main .search-form input::placeholder {
	color: var(--muted);
}

.site-main .search-form input:focus {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
	border-color: var(--accent);
}

.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 1px solid var(--header-input-border);
	border-radius: var(--radius);
	background: var(--header-input-bg);
	color: var(--logo-accent);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
	border-color: var(--logo-accent);
	color: var(--header-text);
}

.theme-toggle:focus-visible {
	outline: 2px solid var(--logo-accent);
	outline-offset: 2px;
}

.theme-toggle__icon {
	display: none;
}

[data-theme='light'] .theme-toggle__icon--moon,
[data-theme='dark'] .theme-toggle__icon--sun {
	display: block;
}

/* Category nav */

.category-nav {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 1.25rem;
	border-bottom: 1px solid var(--border);
	background: var(--surface);
}

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

.category-nav a {
	color: var(--text);
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
	padding-bottom: 0.15rem;
	border-bottom: 2px solid transparent;
}

.category-nav a:hover,
.category-nav a.is-active {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

@media (max-width: 640px) {
	.category-nav ul {
		gap: 0.125rem 0.75rem;
	}

	.category-nav a {
		display: inline-flex;
		align-items: center;
		min-height: 2.75rem;
		padding: 0.35rem 0;
	}
}

/* Home layout */

.home-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	padding-top: 1.25rem;
}

@media (min-width: 960px) {
	.home-layout {
		grid-template-columns: minmax(0, 1fr) 300px;
		align-items: start;
	}
}

.section-label {
	margin: 0 0 1rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.empty-state {
	padding: 3rem 0;
	text-align: center;
	color: var(--muted);
}

/* Post cards */

.post-card {
	display: grid;
	gap: 1rem;
}

.post-card__image {
	display: block;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--surface);
	aspect-ratio: 16 / 9;
}

.post-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.post-card__image:hover img {
	transform: scale(1.03);
}

.post-card__body {
	min-width: 0;
}

.post-card__badge {
	display: inline-block;
	margin-bottom: 0.5rem;
	padding: 0.15rem 0.5rem;
	border-radius: 4px;
	background: var(--market-badge);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.post-card__title {
	margin: 0 0 0.35rem;
	font-family: var(--font-serif);
	line-height: 1.25;
}

.post-card__title a {
	color: var(--text);
	text-decoration: none;
	font-weight: 600;
}

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

.post-card__date {
	display: block;
	color: var(--muted);
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
}

.post-card__excerpt {
	margin: 0.65rem 0 0;
	color: var(--text-secondary);
	font-size: 0.95rem;
	line-height: 1.55;
}

/* Hero */

.post-card--hero {
	grid-template-columns: 1fr;
	gap: 1.25rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--border);
}

.post-card--hero .post-card__image {
	aspect-ratio: 21 / 9;
}

.post-card--hero .post-card__title {
	font-size: clamp(1.6rem, 3vw, 2.35rem);
}

.post-card--hero .post-card__excerpt {
	font-size: 1.05rem;
	max-width: 70ch;
}

@media (min-width: 768px) {
	.post-card--hero {
		grid-template-columns: 1.4fr 1fr;
		align-items: center;
	}

	.post-card--hero .post-card__image {
		aspect-ratio: 4 / 3;
	}
}

/* Lead headlines */

.home-headlines {
	margin-top: 2rem;
}

.home-headlines__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
}

@media (min-width: 640px) {
	.home-headlines__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.home-headlines__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.post-card--lead {
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--border);
}

.post-card--lead .post-card__title {
	font-size: 1.15rem;
}

/* Feed list */

.home-feed {
	margin-top: 2.5rem;
}

.home-feed__list {
	display: grid;
	gap: 0;
}

.post-card--default {
	grid-template-columns: 140px 1fr;
	gap: 1rem;
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--border);
	align-items: start;
}

.post-card--default .post-card__image {
	aspect-ratio: 4 / 3;
	border-radius: 6px;
}

.post-card--default .post-card__title {
	font-size: 1.05rem;
}

.post-card--default .post-card__excerpt {
	font-size: 0.9rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (max-width: 520px) {
	.post-card--default {
		grid-template-columns: 1fr;
	}

	.post-card--default .post-card__image {
		aspect-ratio: 16 / 9;
	}
}

/* Sidebar */

.home-sidebar {
	display: grid;
	gap: 1.75rem;
}

.category-section {
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.category-section__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid var(--accent);
}

.category-section__header h2 {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.category-section__header h2 a {
	color: var(--text);
}

.category-section__more {
	font-size: 0.8rem;
	font-weight: 500;
	white-space: nowrap;
}

.category-section__grid {
	display: grid;
	gap: 1rem;
}

.post-card--compact {
	gap: 0.35rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--border);
}

.post-card--compact:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.post-card--compact .post-card__title {
	font-family: var(--font-sans);
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.35;
}

.post-card--compact .post-card__date {
	font-size: 0.75rem;
}

/* Mobile polish */

@media (max-width: 640px) {
	.site-header__inner {
		padding-top: 0.85rem;
		padding-bottom: 0.85rem;
	}

	.site-logo {
		font-size: 1.4rem;
	}

	.site-tagline {
		font-size: 0.8rem;
	}

	.site-header__tools {
		flex: 1 1 100%;
		max-width: none;
	}

	.search-form {
		flex: 1 1 auto;
	}

	.site-main {
		padding-top: 0.75rem;
	}

	.section-label {
		margin-bottom: 0.75rem;
	}
}

/* Article / category pages */

.page-title {
	margin-top: 0;
	font-family: var(--font-serif);
	font-size: clamp(1.5rem, 5vw, 2rem);
	line-height: 1.2;
	color: var(--text);
}

.post-article {
	max-width: 720px;
	margin: 0 auto;
	padding-top: 1.25rem;
}

.post-article__header {
	margin-bottom: 1.5rem;
}

.post-article__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
	margin-bottom: 0.85rem;
}

.post-article__categories a {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--accent);
}

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

.post-article__title {
	margin: 0;
	font-family: var(--font-serif);
	font-size: clamp(1.75rem, 5vw, 2.5rem);
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--text);
}

.post-article__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.85rem;
	color: var(--muted);
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.post-article__meta-sep {
	color: var(--border-strong);
}

.post-article__hero {
	margin: 0 0 1.75rem;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--surface);
}

.post-article__hero img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.post-article__content {
	font-family: var(--font-serif);
	font-size: clamp(1.02rem, 2.5vw, 1.125rem);
	line-height: 1.8;
	color: var(--reading);
	letter-spacing: 0.01em;
}

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

.post-article__content h2,
.post-article__content h3,
.post-article__content h4 {
	font-family: var(--font-sans);
	color: var(--text);
	line-height: 1.35;
	margin-top: 2rem;
	margin-bottom: 0.75rem;
}

.post-article__content p,
.post-article__content li,
.post-article__content td,
.post-article__content th,
.post-article__content figcaption {
	color: var(--reading);
}

.post-article__content p {
	margin: 0 0 1.35rem;
}

.post-article__content a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.post-article__content a:hover {
	color: var(--accent-hover);
	text-decoration-color: var(--accent-hover);
}

[data-theme='dark'] .post-article__content :where(p, li, span, div, td, th, strong, em, figcaption) {
	color: var(--reading);
}

[data-theme='dark'] .post-article__content :where(h1, h2, h3, h4, h5, h6) {
	color: var(--text);
}

[data-theme='dark'] .post-article__content a {
	color: var(--accent);
}

.post-article__content blockquote {
	margin: 1.5rem 0;
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--accent);
	background: var(--accent-soft);
	color: var(--blockquote-text);
}

.post-article__content ul,
.post-article__content ol {
	margin: 0 0 1.25rem;
	padding-left: 1.5rem;
}

.post-article__content iframe,
.post-article__content audio {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 1.5rem 0;
	border: 0;
	border-radius: 6px;
}

.post-article__related {
	max-width: 720px;
	margin: 3rem auto 0;
	padding-top: 2rem;
	border-top: 1px solid var(--border);
}

.post-article__related-list {
	display: grid;
	gap: 0;
}

.category-page {
	padding-top: 1.25rem;
}

.category-page__header {
	margin-bottom: 1.5rem;
}

.category-page__description {
	margin: 0.5rem 0 0;
	color: var(--muted);
	font-size: 1rem;
	line-height: 1.6;
	max-width: 60ch;
}

.post-list {
	display: grid;
	gap: 0;
}

.post-content {
	font-family: var(--font-serif);
	font-size: 1.08rem;
	line-height: 1.75;
}

.post-content img,
.post-content video {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
}

.post-meta {
	color: var(--muted);
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
}

.notice {
	background: var(--accent-soft);
	border: 1px solid var(--notice-border);
	border-radius: var(--radius);
	padding: 1rem;
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
	color: var(--text);
}

/* Footer */

.site-footer {
	margin-top: 3rem;
	border-top: 1px solid var(--border);
	background: var(--surface);
	color: var(--muted);
	font-size: 0.85rem;
}

.site-footer__inner {
	padding-top: 1.5rem;
	padding-bottom: 1.5rem;
}
