:root {
	--bg: #040711;
	--bg-alt: #090f21;
	--card: rgba(13, 20, 41, 0.92);
	--ink: #f4f6ff;
	--muted: #9aa7d6;
	--accent: #8d7dff;
	--accent-soft: rgba(141, 125, 255, 0.18);
	--border: rgba(255, 255, 255, 0.08);
	--shell: 1040px;
	--glow: rgba(141, 125, 255, 0.35);
}

* {
	box-sizing: border-box;
}

body {
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	margin: 0;
	min-height: 100vh;
	background: radial-gradient(circle at 15% 20%, rgba(141, 125, 255, 0.18), transparent 40%),
		radial-gradient(circle at 80% 0%, rgba(38, 188, 255, 0.2), transparent 45%),
		var(--bg);
	color: var(--ink);
	line-height: 1.6;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	background: linear-gradient(160deg, rgba(9, 15, 33, 0.75), rgba(4, 7, 17, 0.85));
	z-index: -1;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: #c9c2ff;
}

.shell {
	max-width: var(--shell);
	margin: 0 auto;
	padding: 0 1.25rem;
}

.skip-link {
	position: absolute;
	left: 1rem;
	top: -40px;
	background: var(--accent);
	color: white;
	padding: 0.5rem 1rem;
	border-radius: 0.25rem;
}

.skip-link:focus {
	top: 1rem;
}

.masthead {
	background: linear-gradient(120deg, rgba(14, 20, 45, 0.95), rgba(6, 8, 21, 0.95));
	border-bottom: 1px solid var(--border);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.masthead__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem 0;
	gap: 1rem;
}

.brand {
	font-weight: 700;
	font-size: 1.25rem;
	color: white;
}

.tagline {
	margin: 0.25rem 0 0;
	color: var(--muted);
}

.nav {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.nav__link {
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	font-size: 0.95rem;
	color: var(--muted);
	transition: background 0.2s ease, color 0.2s ease;
}

.nav__link--button {
	border: none;
	background: transparent;
	cursor: pointer;
	font: inherit;
}

.nav__link--button:hover {
	text-decoration: underline;
}

.nav__link.is-active {
	background: rgba(255, 255, 255, 0.08);
	color: white;
}

.site-main {
	padding: 3rem 0 3.5rem;
}

.hero {
	background: linear-gradient(135deg, rgba(18, 28, 68, 0.95), rgba(10, 15, 36, 0.95));
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 1.5rem;
	padding: 2.75rem;
	margin-bottom: 2.75rem;
	box-shadow: 0 30px 80px rgba(5, 8, 18, 0.6);
	position: relative;
	overflow: hidden;
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 75% 20%, rgba(141, 125, 255, 0.35), transparent 40%);
	opacity: 0.8;
	pointer-events: none;
}

.hero .eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--muted);
	font-size: 0.8rem;
	margin: 0 0 0.5rem;
}

.hero h1 {
	font-size: clamp(2rem, 4vw, 3rem);
	margin-bottom: 1rem;
}

.hero__lead p {
	margin: 0 0 1rem;
	font-size: 1.1rem;
	color: #ced4f9;
}

.hero__cta {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.hero--not-found {
	text-align: center;
}

.hero--not-found .hero__lead {
	margin: 0 auto 1.25rem;
	max-width: 560px;
}

.hero--not-found .hero__cta {
	justify-content: center;
}

.hero__cta button {
	cursor: pointer;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 1.5rem;
	border-radius: 999px;
	border: none;
	background: var(--accent);
	color: white;
	font-weight: 600;
	box-shadow: 0 15px 35px var(--glow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
	transform: translateY(-1px);
	box-shadow: 0 20px 45px rgba(141, 125, 255, 0.45);
}

.button--ghost {
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: var(--ink);
}

.layout-grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
	gap: 2rem;
}

.panel--not-found {
	margin-top: 1rem;
}

.panel__links {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 0.75rem;
}

.panel__links li {
	padding: 0.75rem 1rem;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--border);
	border-radius: 0.85rem;
	text-align: center;
}

.post-feed {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.post-feed--list {
	margin-top: 2rem;
}

.section-heading {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
}

.see-all {
	font-size: 0.95rem;
	color: var(--muted);
}

.post-card {
	background: var(--card);
	border: 1px solid rgba(255, 255, 255, 0.04);
	border-radius: 1rem;
	padding: 1.65rem;
	box-shadow: 0 25px 60px rgba(3, 4, 12, 0.65);
	backdrop-filter: blur(14px);
}

.post-card__meta {
	margin: 0 0 0.35rem;
	color: var(--muted);
	font-size: 0.9rem;
}

.post-card h3 {
	margin: 0 0 0.35rem;
}

.post-card__tags {
	margin-top: 0.75rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.post-card__tags a {
	font-size: 0.8rem;
	padding: 0.15rem 0.5rem;
	border-radius: 0.5rem;
	background: var(--accent-soft);
	color: var(--accent);
	text-decoration: none;
}

.post-card__cta {
	margin-top: 1rem;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-weight: 600;
	color: #cfd2ff;
	text-transform: uppercase;
	font-size: 0.85rem;
	letter-spacing: 0.08em;
}

.post-card__cta::after {
	content: "→";
	font-size: 1rem;
	transition: transform 0.2s ease;
}

.post-card__cta:hover::after {
	transform: translateX(3px);
}

.sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.panel {
	background: linear-gradient(145deg, rgba(12, 18, 39, 0.95), rgba(8, 11, 27, 0.95));
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 1rem;
	padding: 1.5rem;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.panel h3 {
	margin-top: 0;
}

.panel ul {
	padding-left: 1.2rem;
	margin: 0.5rem 0 0;
	color: var(--muted);
}

.page-header .eyebrow,
.post__header .eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--muted);
	font-size: 0.8rem;
}

.page-header h1 {
	margin-bottom: 0.5rem;
}

.post {
	background: var(--card);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 1.25rem;
	padding: 2.25rem;
	box-shadow: 0 35px 80px rgba(0, 0, 0, 0.65);
}

.post__meta {
	color: var(--muted);
}

.post__tags {
	display: flex;
	gap: 0.35rem;
	flex-wrap: wrap;
	margin-top: 0.5rem;
}

.post__tags a {
	font-size: 0.8rem;
	padding: 0.15rem 0.5rem;
	border-radius: 0.5rem;
	background: var(--accent-soft);
	color: var(--accent);
	text-decoration: none;
}

.post__body h2,
.post__body h3,
.post__body h4,
.post__body h5 {
	margin: 0;
	color: var(--ink);
}

.post__body h2 {
	margin-top: 3rem;
	margin-bottom: 0.75rem;
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	letter-spacing: -0.01em;
	position: relative;
}

.post__body h2::before {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	margin-bottom: 0.85rem;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--accent), rgba(141, 125, 255, 0));
}

.post__body h3 {
	margin-top: 2rem;
	margin-bottom: 0.5rem;
	font-size: clamp(1.25rem, 2.6vw, 1.6rem);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: #b7c0ef;
}

.post__body h4,
.post__body h5 {
	margin-top: 1.5rem;
	margin-bottom: 0.35rem;
	font-size: 1.05rem;
	color: #c2c9f3;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.post__body img {
	max-width: 100%;
	border-radius: 0.75rem;
}

.post-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 1.5rem;
}

.post-nav__link {
	color: var(--muted);
}

.site-footer {
	border-top: 1px solid var(--border);
	padding: 2rem 0;
	background: rgba(4, 7, 17, 0.85);
	color: var(--muted);
	font-size: 0.95rem;
}

.footer__grid {
	display: flex;
	justify-content: space-between;
	gap: 2rem;
	flex-wrap: wrap;
}

.search-panel {
	position: fixed;
	inset: 0;
	background: rgba(16, 18, 26, 0.6);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 3rem 1.5rem 1.5rem;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	z-index: 1000;
}

.no-js [data-search-open],
.no-js [data-search-panel] {
	display: none !important;
}

.has-js .search-panel {
	display: flex;
}

.search-panel.is-open {
	opacity: 1;
	pointer-events: auto;
}

.search-panel__dialog {
	width: min(720px, 100%);
	background: var(--card);
	border-radius: 1.25rem;
	padding: 1.75rem;
	box-shadow: 0 60px 100px rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(18px);
	max-height: calc(100vh - 4rem);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.search-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.search-panel__close {
	border: none;
	background: var(--accent-soft);
	color: var(--accent);
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 999px;
	cursor: pointer;
	font-size: 1.1rem;
}

.search-panel__input {
	width: 100%;
	padding: 0.85rem 1rem;
	border-radius: 0.85rem;
	border: 1px solid rgba(255, 255, 255, 0.12);
	font-size: 1rem;
	margin-bottom: 0.85rem;
	background: rgba(8, 12, 28, 0.8);
	color: var(--ink);
}

.search-panel__results {
	max-height: 360px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.search-result {
	padding: 0.75rem 0.5rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.search-result:last-child {
	border-bottom: none;
}

.search-result a {
	color: inherit;
	text-decoration: none;
	display: block;
}

.search-result a:hover .search-result__title {
	text-decoration: underline;
}

.search-result__title {
	font-weight: 600;
	margin: 0 0 0.2rem;
}

.search-result__meta {
	font-size: 0.85rem;
	color: var(--muted);
}

.search-result__tags {
	margin-top: 0.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.search-result__tags a {
	font-size: 0.75rem;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	text-decoration: none;
}

.search-panel__empty {
	color: var(--muted);
}

.toc {
	margin: 1.5rem 0;
	background: rgba(10, 15, 38, 0.85);
	border: 1px dashed rgba(255, 255, 255, 0.12);
	border-radius: 0.85rem;
	padding: 1rem 1.25rem;
}

.toc summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--muted);
}

.toc ul {
	margin: 0.5rem 0 0;
	padding-left: 1.1rem;
	color: var(--muted);
	list-style: none;
}
.toc li {
	margin: 0.15rem 0;
}

.toc__has-children {
	position: relative;
	padding-left: 1.2rem;
}

.toc__has-children > ul {
	margin-left: 0.35rem;
	padding-left: 1rem;
	border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.toc__has-children > ul[hidden] {
	display: none;
}

.toc__toggle {
	border: none;
	background: none;
	color: var(--muted);
	padding: 0;
	margin: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1rem;
	height: 1rem;
	position: absolute;
	left: 0;
	top: 0.1rem;
}

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

.toc__toggle::before {
	content: "▸";
	font-size: 0.85rem;
	transition: transform 0.2s ease;
}

.toc__toggle.is-open::before {
	transform: rotate(90deg);
}

@media (max-width: 900px) {
	.layout-grid {
		grid-template-columns: 1fr;
	}

	.masthead__inner {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 600px) {
	.hero {
		padding: 1.75rem;
	}

	.post {
		padding: 1.5rem;
	}
}
