/* ==========================================================================
   Linux.krd — main stylesheet
   RTL-first: layout uses logical properties so it also works in LTR.
   ========================================================================== */

/* Tokens ------------------------------------------------------------------ */
:root {
	--bg: #f7f5ef;
	--bg-grid: rgba(20, 24, 30, .045);
	--surface: #ffffff;
	--surface-2: #efece4;
	--text: #15181e;
	--text-2: #474d5a;
	--muted: #767c88;
	--line: rgba(20, 24, 30, .1);
	--line-strong: rgba(20, 24, 30, .18);
	--accent: #e8a317;
	--accent-ink: #8f5d00;
	--on-accent: #1d1400;
	--leaf: #2ea36b;
	--flame: #e0533d;
	--term-bg: #0e1116;
	--term-bar: #171b22;
	--term-text: #d5d9e0;
	--term-dim: #7d8594;
	--prompt: #3fd18a;
	--shadow-sm: 0 1px 2px rgba(15, 20, 30, .06), 0 2px 8px rgba(15, 20, 30, .04);
	--shadow-lg: 0 24px 60px -20px rgba(15, 20, 30, .28), 0 8px 20px -12px rgba(15, 20, 30, .2);
	--radius: 18px;
	--radius-sm: 10px;
	--font: Vazirmatn, "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
	--mono: "JetBrains Mono", Vazirmatn, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	--header-h: 68px;
	--gutter: 20px;
	--max: 1200px;
	--narrow: 760px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0b0d11;
		--bg-grid: rgba(255, 255, 255, .035);
		--surface: #12161c;
		--surface-2: #1a1f27;
		--text: #ecebe6;
		--text-2: #b4b9c3;
		--muted: #858b97;
		--line: rgba(255, 255, 255, .08);
		--line-strong: rgba(255, 255, 255, .16);
		--accent-ink: #f3bb4c;
		--term-bg: #07090c;
		--term-bar: #10141a;
		--shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
		--shadow-lg: 0 30px 70px -25px rgba(0, 0, 0, .7);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #0b0d11;
	--bg-grid: rgba(255, 255, 255, .035);
	--surface: #12161c;
	--surface-2: #1a1f27;
	--text: #ecebe6;
	--text-2: #b4b9c3;
	--muted: #858b97;
	--line: rgba(255, 255, 255, .08);
	--line-strong: rgba(255, 255, 255, .16);
	--accent-ink: #f3bb4c;
	--term-bg: #07090c;
	--term-bar: #10141a;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
	--shadow-lg: 0 30px 70px -25px rgba(0, 0, 0, .7);
	color-scheme: dark;
}

/* Base -------------------------------------------------------------------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 1rem;
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

img {
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.45;
	margin: 0 0 .5em;
	font-weight: 800;
	letter-spacing: 0;
}

p {
	margin: 0 0 1em;
}

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

button {
	cursor: pointer;
}

kbd {
	font-family: var(--mono);
	font-size: .72rem;
	line-height: 1;
	padding: .3em .45em;
	border-radius: 6px;
	border: 1px solid var(--line-strong);
	border-bottom-width: 2px;
	background: var(--surface);
	color: var(--muted);
	white-space: nowrap;
}

::selection {
	background: color-mix(in srgb, var(--accent) 40%, transparent);
}

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

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	clip: auto;
	width: auto;
	height: auto;
	margin: 0;
	inset-inline-start: 12px;
	top: 12px;
	z-index: 1000;
	padding: .6rem 1rem;
	background: var(--accent);
	color: var(--on-accent);
	border-radius: var(--radius-sm);
}

.wrap {
	width: 100%;
	max-width: calc(var(--max) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.wrap--narrow {
	max-width: calc(var(--narrow) + var(--gutter) * 2);
}

.site-main {
	min-height: 60vh;
	outline: none;
}

/* Icons ------------------------------------------------------------------- */
.icon {
	width: 1.15em;
	height: 1.15em;
	flex: none;
	vertical-align: -.2em;
}

[dir="rtl"] .flip-next,
:root:not([dir="rtl"]) .flip-prev {
	transform: scaleX(-1);
}

.when-dark,
.when-open {
	display: none;
}

:root[data-theme="dark"] .when-dark {
	display: block;
}

:root[data-theme="dark"] .when-light {
	display: none;
}

/* Buttons ----------------------------------------------------------------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 46px;
	padding: .55rem 1.3rem;
	border-radius: 999px;
	border: 1px solid transparent;
	font-weight: 700;
	font-size: .98rem;
	line-height: 1.2;
	transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}

.btn:hover {
	transform: translateY(-1px);
}

.btn-primary {
	background: var(--accent);
	color: var(--on-accent);
	box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}

.btn-primary:hover {
	background: color-mix(in srgb, var(--accent) 88%, #fff);
}

.btn-ghost {
	border-color: var(--line-strong);
	background: var(--surface);
}

.btn-ghost:hover {
	border-color: var(--text);
}

.btn-link {
	padding-inline: .4rem;
	color: var(--accent-ink);
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--text-2);
	transition: color .2s, border-color .2s, background .2s;
}

.icon-btn:hover {
	color: var(--text);
	border-color: var(--line-strong);
}

/* Chips ------------------------------------------------------------------- */
.chips {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.chip {
	--chip: var(--accent);
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .15rem .75rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--chip) 13%, transparent);
	color: color-mix(in srgb, var(--chip) 62%, var(--text));
	font-size: .82rem;
	font-weight: 700;
	line-height: 1.9;
	white-space: nowrap;
	transition: background .2s;
}

.chip::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--chip);
}

a.chip:hover {
	background: color-mix(in srgb, var(--chip) 24%, transparent);
}

.format-badge {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .2rem .7rem;
	border-radius: 999px;
	background: var(--flame);
	color: #fff;
	font-size: .78rem;
	font-weight: 700;
	line-height: 1.7;
}

.format-badge.is-audio {
	background: #7c3aed;
}

.format-badge .icon {
	width: .95em;
	height: .95em;
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	margin-bottom: 1rem;
	color: var(--accent-ink);
	font-size: .9rem;
	font-weight: 700;
}

/* Header ------------------------------------------------------------------ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: saturate(1.4) blur(14px);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid var(--line);
}

.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 0;
	}
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	height: var(--header-h);
}

.brand,
.custom-logo-link {
	display: inline-flex;
	align-items: center;
	gap: .65rem;
	flex: none;
	font-weight: 900;
	font-size: 1.15rem;
}

.custom-logo {
	max-height: 44px;
	width: auto;
}

.brand-mark {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: var(--term-bg);
	color: var(--prompt);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
	direction: ltr;
}

.brand-prompt {
	font-family: var(--mono);
	font-size: .9rem;
	font-weight: 800;
}

.primary-nav {
	flex: 1;
}

.primary-nav .menu {
	display: flex;
	align-items: center;
	gap: .15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-nav .menu > li {
	position: relative;
}

.primary-nav a {
	display: block;
	padding: .4rem .8rem;
	border-radius: 10px;
	color: var(--text-2);
	font-weight: 600;
	font-size: .96rem;
	transition: color .2s, background .2s;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a,
.primary-nav .current-category-ancestor > a {
	color: var(--text);
	background: var(--surface-2);
}

.primary-nav .sub-menu {
	position: absolute;
	inset-inline-start: 0;
	top: 100%;
	min-width: 220px;
	margin: 0;
	padding: .4rem;
	list-style: none;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: var(--shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .2s, transform .2s, visibility .2s;
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-inline-start: auto;
}

.search-trigger {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	height: 42px;
	padding-inline: .9rem .5rem;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--muted);
	font-size: .92rem;
	transition: border-color .2s;
}

.search-trigger:hover {
	border-color: var(--line-strong);
	color: var(--text-2);
}

.search-trigger-label {
	min-width: 5.5rem;
	text-align: start;
}

.menu-toggle {
	display: none;
}

.read-progress {
	position: absolute;
	inset-inline: 0;
	bottom: -1px;
	height: 2px;
}

.read-progress span {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--accent), var(--flame));
	transform-origin: var(--progress-origin, right);
	transform: scaleX(var(--progress, 0));
}

:root:not([dir="rtl"]) .read-progress span {
	--progress-origin: left;
}

@media (max-width: 960px) {
	.menu-toggle {
		display: inline-grid;
	}

	.search-trigger-label,
	.search-trigger kbd {
		display: none;
	}

	.search-trigger {
		width: 42px;
		padding: 0;
		justify-content: center;
	}

	.primary-nav {
		position: absolute;
		inset-inline: 0;
		top: 100%;
		padding: .75rem var(--gutter) 1.25rem;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
		box-shadow: var(--shadow-lg);
		display: none;
	}

	.primary-nav.is-open {
		display: block;
		animation: drop .25s var(--ease);
	}

	.primary-nav .menu {
		flex-direction: column;
		align-items: stretch;
	}

	.primary-nav a {
		padding: .7rem .9rem;
		font-size: 1.05rem;
	}

	.primary-nav .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		padding: 0 1rem 0 0;
		background: none;
	}

	.menu-open .when-closed {
		display: none;
	}

	.menu-open .when-open {
		display: block;
	}
}

/* Sections ---------------------------------------------------------------- */
.section {
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.6rem;
}

.section-title {
	display: flex;
	align-items: baseline;
	gap: .5rem;
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	margin: 0;
}

.section-hash {
	font-family: var(--mono);
	color: var(--accent);
	font-weight: 700;
}

.section-links {
	display: flex;
	gap: 1rem;
}

.section-more {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	color: var(--accent-ink);
	font-weight: 700;
	font-size: .95rem;
	white-space: nowrap;
}

.section-more:hover {
	text-decoration: underline;
	text-underline-offset: 6px;
}

.grid {
	display: grid;
	gap: 1.25rem;
}

.grid-3 {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

/* Hero -------------------------------------------------------------------- */
.hero {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	align-items: center;
	gap: clamp(2rem, 5vw, 4rem);
	padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2rem, 5vw, 4rem);
}

.hero::before {
	content: "";
	position: absolute;
	inset: -40px calc(50% - 50vw) 0;
	z-index: -1;
	background-image:
		radial-gradient(600px 380px at 75% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
		linear-gradient(var(--bg-grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
	background-size: auto, 32px 32px, 32px 32px;
	mask-image: linear-gradient(to bottom, #000 55%, transparent);
	-webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
	pointer-events: none;
}

.dot-live {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--leaf);
	box-shadow: 0 0 0 0 color-mix(in srgb, var(--leaf) 60%, transparent);
	animation: pulse 2.2s infinite;
}

.hero-title {
	font-size: clamp(2.3rem, 6vw, 4.3rem);
	font-weight: 900;
	line-height: 1.3;
	margin-bottom: 1.1rem;
	text-wrap: balance;
}

.hero-lead {
	max-width: 34rem;
	color: var(--text-2);
	font-size: clamp(1.05rem, 1.6vw, 1.2rem);
	line-height: 1.95;
}

.hero-search {
	display: flex;
	align-items: center;
	gap: .8rem;
	width: 100%;
	max-width: 30rem;
	margin-block: 1.8rem 1.4rem;
	padding: .95rem 1.1rem;
	border-radius: 16px;
	border: 1px solid var(--line-strong);
	background: var(--surface);
	color: var(--muted);
	font-size: 1.05rem;
	box-shadow: var(--shadow-sm);
	text-align: start;
	transition: border-color .2s, box-shadow .2s;
}

.hero-search span {
	flex: 1;
}

.hero-search:hover {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Terminal ---------------------------------------------------------------- */
.terminal {
	border-radius: var(--radius);
	background: var(--term-bg);
	color: var(--term-text);
	box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .06);
	overflow: hidden;
}

.terminal-bar {
	display: flex;
	align-items: center;
	gap: .8rem;
	padding: .75rem 1rem;
	background: var(--term-bar);
	border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.tdots {
	display: flex;
	gap: 7px;
}

.tdots i {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #ff5f57;
}

.tdots i:nth-child(2) {
	background: #febc2e;
}

.tdots i:nth-child(3) {
	background: #28c840;
}

.terminal-title {
	flex: 1;
	text-align: center;
	margin-inline-end: 50px;
	font-family: var(--mono);
	font-size: .78rem;
	color: var(--term-dim);
}

.terminal-body {
	padding: 1.1rem 1.25rem 1.3rem;
	font-size: .95rem;
}

.t-line {
	margin: 0;
	line-height: 1.9;
}

.t-cmd {
	font-family: var(--mono);
	font-size: .86rem;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
}

.t-prompt {
	color: var(--prompt);
	font-family: var(--mono);
}

.t-dim {
	color: var(--term-dim);
}

.t-err {
	color: #ff7b72;
	font-family: var(--mono);
	font-size: .88rem;
}

.t-typed {
	display: inline-block;
	vertical-align: bottom;
	overflow: hidden;
	white-space: nowrap;
	max-width: 24ch;
	animation: typing 1.1s steps(24, end) .3s both;
}

.t-list {
	list-style: none;
	margin: .35rem 0 .5rem;
	padding: 0;
}

.t-list li {
	animation: lineIn .45s var(--ease) both;
	animation-delay: calc(1.45s + var(--i, 0) * .11s);
}

.t-list li:nth-child(2) { --i: 1; }
.t-list li:nth-child(3) { --i: 2; }
.t-list li:nth-child(4) { --i: 3; }
.t-list li:nth-child(5) { --i: 4; }

.t-list a {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: .9rem;
	padding: .38rem .6rem;
	margin-inline: -.6rem;
	border-radius: 8px;
	transition: background .15s;
}

.t-list a:hover,
.t-list a:focus-visible {
	background: rgba(255, 255, 255, .06);
}

.t-date,
.t-size {
	font-family: var(--mono);
	font-size: .78rem;
	color: var(--term-dim);
}

[dir="rtl"] .t-date,
[dir="rtl"] .t-size {
	font-family: var(--font);
}

.t-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #f1f3f6;
}

.t-title::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-inline-end: .55rem;
	border-radius: 2px;
	background: var(--chip, var(--accent));
	vertical-align: .1em;
}

.t-list a:hover .t-title {
	color: var(--accent);
}

.cursor {
	display: inline-block;
	width: .6em;
	height: 1.1em;
	vertical-align: -.2em;
	background: var(--prompt);
	animation: blink 1s steps(2, start) infinite;
}

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

/* Cards ------------------------------------------------------------------- */
.card {
	--chip: var(--accent);
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}

.card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
	border-color: color-mix(in srgb, var(--chip) 45%, var(--line));
}

.card-media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--surface-2);
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s var(--ease);
}

.card:hover .card-media img {
	transform: scale(1.04);
}

.card-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: .3rem;
	padding: 1.2rem 1.3rem;
	background:
		radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--chip) 42%, transparent), transparent 60%),
		radial-gradient(80% 80% at 0% 100%, color-mix(in srgb, var(--chip) 18%, transparent), transparent 70%),
		var(--term-bg);
	color: #fff;
}

.card-placeholder span {
	font-family: var(--mono);
	font-size: .78rem;
	color: color-mix(in srgb, var(--chip) 70%, #fff);
	text-align: left;
}

.card-placeholder strong {
	font-size: 1.6rem;
	font-weight: 900;
	line-height: 1.3;
	opacity: .92;
}

.card-media .format-badge {
	position: absolute;
	top: .8rem;
	inset-inline-start: .8rem;
}

.card-duration {
	position: absolute;
	bottom: .7rem;
	inset-inline-end: .7rem;
	padding: .1rem .5rem;
	border-radius: 6px;
	background: rgba(0, 0, 0, .72);
	color: #fff;
	font-family: var(--mono);
	font-size: .75rem;
}

.card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.1rem 1.25rem 1.2rem;
}

.card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .6rem;
	margin-bottom: .55rem;
	color: var(--muted);
	font-size: .84rem;
}

.card-title {
	font-size: 1.15rem;
	line-height: 1.6;
	margin-bottom: .45rem;
}

.card-title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.card-title a:focus-visible {
	outline: none;
}

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

.card-excerpt {
	color: var(--text-2);
	font-size: .95rem;
	line-height: 1.85;
	margin-bottom: .8rem;
}

.card-foot {
	margin-top: auto;
	color: var(--muted);
	font-size: .82rem;
}

.meta-read {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
}

.card--compact .card-body {
	padding: 1rem 1.2rem;
}

/* Bento ------------------------------------------------------------------- */
.bento {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.25rem;
}

.bento .card--feature {
	grid-column: span 2;
	grid-row: span 2;
}

.bento .card--feature .card-media {
	aspect-ratio: auto;
	flex: 1;
	min-height: 260px;
}

.bento .card--feature .card-title {
	font-size: clamp(1.35rem, 2.4vw, 1.75rem);
	line-height: 1.5;
}

.bento .card--feature .card-placeholder strong {
	font-size: clamp(2rem, 4vw, 3rem);
}

.bento .card:not(.card--feature) .card-excerpt {
	display: none;
}

@media (max-width: 1024px) {
	.bento {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

	.bento .card--feature {
		grid-column: auto;
		grid-row: auto;
	}

	.bento .card--feature .card-media {
		aspect-ratio: 16 / 10;
		min-height: 0;
	}
}

/* Topics ------------------------------------------------------------------ */
.topics {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
	gap: 1rem;
}

.topic {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: .15rem;
	padding: 1.2rem 1.3rem 1.1rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--line);
	overflow: hidden;
	transition: transform .25s var(--ease), border-color .25s, background .25s;
}

.topic::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 3px;
	background: var(--chip);
	transform: scaleX(.25);
	transform-origin: var(--origin, right);
	transition: transform .35s var(--ease);
}

:root:not([dir="rtl"]) .topic::before {
	--origin: left;
}

.topic:hover {
	transform: translateY(-3px);
	border-color: color-mix(in srgb, var(--chip) 50%, var(--line));
	background: color-mix(in srgb, var(--chip) 6%, var(--surface));
}

.topic:hover::before {
	transform: scaleX(1);
}

.topic-path {
	font-family: var(--mono);
	font-size: .76rem;
	color: color-mix(in srgb, var(--chip) 70%, var(--muted));
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topic-name {
	font-size: 1.2rem;
	font-weight: 800;
}

.topic-count {
	color: var(--muted);
	font-size: .86rem;
}

/* Media / coming soon ----------------------------------------------------- */
.section--media {
	background: var(--term-bg);
	color: var(--term-text);
}

.section--media .section-title {
	color: #fff;
}

.section--media .section-more {
	color: var(--accent);
}

.section--media .card {
	background: #12161c;
	border-color: rgba(255, 255, 255, .07);
	color: #ecebe6;
}

.section--media .card-excerpt,
.section--media .card-meta,
.section--media .card-foot {
	color: #9aa0ab;
}

.soon {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
	align-items: center;
	gap: 2rem;
	padding: clamp(1.75rem, 4vw, 3rem);
	border-radius: calc(var(--radius) + 6px);
	background:
		radial-gradient(500px 300px at 10% 100%, rgba(124, 58, 237, .35), transparent 70%),
		radial-gradient(500px 300px at 90% 0%, rgba(224, 83, 61, .3), transparent 70%),
		var(--term-bg);
	color: var(--term-text);
	overflow: hidden;
}

.soon .section-title {
	color: #fff;
	margin-bottom: .6rem;
	display: block;
}

.soon .eyebrow {
	color: var(--accent);
}

.soon p {
	color: #a8aeb9;
}

.soon .social-links a {
	color: #d5d9e0;
	border-color: rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .04);
}

.soon-wave {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	height: 140px;
	direction: ltr;
}

.soon-wave i {
	width: 6px;
	height: 100%;
	border-radius: 6px;
	background: linear-gradient(to top, var(--flame), var(--accent));
	transform: scaleY(.2);
	animation: wave 1.4s ease-in-out infinite;
}

.soon-wave i:nth-child(3n) { animation-delay: -.3s; }
.soon-wave i:nth-child(3n + 1) { animation-delay: -.7s; }
.soon-wave i:nth-child(4n) { animation-delay: -1.1s; background: linear-gradient(to top, #7c3aed, var(--flame)); }
.soon-wave i:nth-child(5n) { animation-duration: 1.1s; }
.soon-wave i:nth-child(7n) { animation-duration: 1.8s; }

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

	.soon-wave {
		height: 80px;
	}
}

/* Book -------------------------------------------------------------------- */
.book {
	--bw: 240px;
	--bh: 340px;
	--bt: 36px;
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
	align-items: center;
	gap: clamp(2rem, 5vw, 4.5rem);
	padding: clamp(2rem, 5vw, 3.5rem);
	border-radius: calc(var(--radius) + 8px);
	background:
		radial-gradient(500px 360px at 25% 50%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
		var(--surface);
	border: 1px solid var(--line);
	overflow: hidden;
}

.book-stage {
	position: relative;
	display: grid;
	place-items: center;
	min-height: calc(var(--bh) + 60px);
	perspective: 1400px;
}

.book-3d {
	position: relative;
	width: var(--bw);
	height: var(--bh);
	transform-style: preserve-3d;
	transform: rotateY(var(--ry, 28deg)) rotateX(4deg);
	transition: transform .8s var(--ease);
}

:root:not([dir="rtl"]) .book-3d {
	--ry: -28deg;
}

.book:hover .book-3d {
	transform: rotateY(0deg) rotateX(0deg);
}

.book-cover,
.book-back {
	position: absolute;
	inset: 0;
	border-radius: 4px 12px 12px 4px;
}

[dir="rtl"] .book-cover,
[dir="rtl"] .book-back {
	border-radius: 12px 4px 4px 12px;
}

.book-cover {
	transform: translateZ(calc(var(--bt) / 2));
	overflow: hidden;
	background: var(--term-bg);
	box-shadow: inset 4px 0 10px rgba(0, 0, 0, .25);
}

.book-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.book-cover-art {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: .5rem;
	padding: 1.5rem;
	background:
		radial-gradient(circle at 70% 25%, var(--accent) 0 34px, transparent 35px),
		repeating-conic-gradient(from 0deg at 70% 25%, color-mix(in srgb, var(--accent) 40%, transparent) 0 6deg, transparent 6deg 20deg),
		linear-gradient(160deg, #1b2230, #07090c);
	color: #fff;
}

.book-cover-art strong {
	font-size: 1.6rem;
	line-height: 1.4;
	font-weight: 900;
}

.book-cover-art span {
	color: #c9ced6;
	font-size: .9rem;
}

.book-cover-prompt {
	font-family: var(--mono);
	color: var(--prompt) !important;
	font-size: 1.1rem !important;
	text-align: left;
}

.book-back {
	transform: translateZ(calc(var(--bt) / -2));
	background: #1b2230;
	box-shadow: 0 30px 60px -10px rgba(0, 0, 0, .5);
}

.book-pages {
	position: absolute;
	top: 4px;
	bottom: 4px;
	width: var(--bt);
	inset-inline-start: 0;
	background: repeating-linear-gradient(90deg, #fbf9f3 0 2px, #e7e1d3 2px 3px);
	transform: translateX(calc(var(--bw) - var(--bt) / 2 - 3px)) rotateY(90deg);
}

[dir="rtl"] .book-pages {
	inset-inline-start: auto;
	left: 0;
	transform: translateX(calc(var(--bt) / -2 + 3px)) rotateY(90deg);
}

.book-glow {
	position: absolute;
	bottom: 6px;
	width: 70%;
	height: 26px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .35);
	filter: blur(18px);
	z-index: -1;
}

.book.has-mockup {
	background:
		radial-gradient(520px 420px at var(--glow-x, 78%) 50%, color-mix(in srgb, var(--book, var(--accent)) 26%, transparent), transparent 70%),
		var(--surface);
}

:root:not([dir="rtl"]) .book.has-mockup {
	--glow-x: 22%;
}

.book.has-mockup .book-stage {
	min-height: 0;
	perspective: none;
}

.book-mockup {
	width: 100%;
	max-width: 430px;
	height: auto;
	filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .28));
	animation: bookFloat 6s ease-in-out infinite;
	transition: transform .6s var(--ease);
}

.book.has-mockup:hover .book-mockup {
	transform: scale(1.03) rotate(-1.5deg);
}

.book.has-mockup .book-glow {
	bottom: 2%;
	width: 55%;
	background: color-mix(in srgb, var(--book, #000) 45%, rgba(0, 0, 0, .35));
	animation: glowPulse 6s ease-in-out infinite;
}

.book.has-mockup .eyebrow,
.book.has-mockup .book-price strong {
	color: color-mix(in srgb, var(--book, var(--accent)) 82%, var(--text));
}

.book.has-mockup .btn-primary {
	background: color-mix(in srgb, var(--book, var(--accent)) 85%, #000);
	color: #fff;
	box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--book, var(--accent)) 80%, transparent);
}

.book.has-mockup .btn-primary:hover {
	background: var(--book, var(--accent));
}

@keyframes bookFloat {
	0%, 100% { translate: 0 0; }
	50% { translate: 0 -12px; }
}

@keyframes glowPulse {
	0%, 100% { opacity: 1; scale: 1; }
	50% { opacity: .7; scale: .9; }
}

.book-title {
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	font-weight: 900;
	line-height: 1.35;
	margin-bottom: .4rem;
}

.book-subtitle {
	font-size: 1.15rem;
	color: var(--text-2);
}

.book-author {
	color: var(--muted);
	font-weight: 600;
}

.book-desc {
	color: var(--text-2);
	line-height: 2;
}

.book-facts {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: .7rem;
	margin: 1.4rem 0;
}

.book-facts div {
	padding: .7rem .9rem;
	border-radius: 12px;
	background: var(--surface-2);
}

.book-facts dt {
	color: var(--muted);
	font-size: .78rem;
}

.book-facts dd {
	margin: 0;
	font-weight: 800;
	overflow-wrap: anywhere;
}

.book-facts .fact-isbn {
	grid-column: span 2;
}

.book-facts .fact-isbn dd {
	font-family: var(--mono);
	font-size: .92rem;
	white-space: nowrap;
	overflow-wrap: normal;
	text-align: end;
}

.book-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem;
	margin-top: 1.2rem;
}

.book-price {
	display: flex;
	flex-direction: column;
	margin: 0;
	margin-inline-end: .75rem;
	line-height: 1.4;
}

.book-price span {
	color: var(--muted);
	font-size: .8rem;
}

.book-price strong {
	font-size: 1.5rem;
	font-weight: 900;
	color: var(--accent-ink);
}

@media (max-width: 820px) {
	.book {
		--bw: 190px;
		--bh: 270px;
		--bt: 28px;
		grid-template-columns: 1fr;
		text-align: start;
	}
}

/* Projects ---------------------------------------------------------------- */
.project-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: .8rem;
	padding: 1.3rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--line);
	transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}

.project-card:hover {
	transform: translateY(-3px);
	border-color: var(--line-strong);
	box-shadow: var(--shadow-lg);
}

.project-head {
	display: flex;
	align-items: center;
	gap: .85rem;
}

.project-head > div:nth-child(2) {
	flex: 1;
	min-width: 0;
}

.project-icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 13px;
	background: var(--term-bg);
	color: var(--prompt);
	overflow: hidden;
}

.project-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.project-icon--lg {
	width: 72px;
	height: 72px;
	border-radius: 20px;
}

.project-icon--lg .icon {
	width: 32px;
	height: 32px;
}

.project-title {
	font-size: 1.15rem;
	margin: 0;
	line-height: 1.5;
}

.project-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.project-repo {
	margin: 0;
	font-family: var(--mono);
	font-size: .76rem;
	color: var(--muted);
	text-align: start;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

[dir="rtl"] .project-repo {
	text-align: right;
}

.project-status {
	flex: none;
	padding: .1rem .6rem;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	font-size: .75rem;
	font-weight: 700;
	color: var(--text-2);
}

.status-active,
.status-stable {
	border-color: color-mix(in srgb, var(--leaf) 50%, transparent);
	color: var(--leaf);
}

.status-beta {
	border-color: color-mix(in srgb, var(--accent) 60%, transparent);
	color: var(--accent-ink);
}

.status-contribute {
	border-color: rgba(59, 130, 246, .5);
	color: #3b82f6;
}

.project-excerpt {
	color: var(--text-2);
	font-size: .95rem;
	margin: 0;
}

.project-foot {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem .9rem;
	margin-top: auto;
}

.tech {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	font-family: var(--mono);
	font-size: .76rem;
	color: var(--muted);
}

.tech i {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--accent);
}

.project-foot .tech:nth-child(2) i { background: var(--leaf); }
.project-foot .tech:nth-child(3) i { background: #3b82f6; }

.project-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
	padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
}

.project-hero-title {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	margin: 1rem 0;
}

.project-hero-title .entry-title {
	margin: 0;
}

.project-facts {
	display: grid;
	gap: .8rem;
	margin: 0;
	padding: 1.3rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--line);
}

.project-facts dt {
	font-size: .8rem;
	color: var(--muted);
}

.project-facts dd {
	margin: 0;
	font-weight: 700;
}

.project-facts pre {
	margin: .3rem 0 0;
	white-space: pre-wrap;
	word-break: break-all;
}

@media (max-width: 860px) {
	.project-hero {
		grid-template-columns: 1fr;
	}
}

/* Archive ----------------------------------------------------------------- */
.archive-header {
	--chip: var(--accent);
	padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
}

.archive-path {
	display: inline-block;
	margin-bottom: .6rem;
	font-family: var(--mono);
	font-size: .85rem;
	color: color-mix(in srgb, var(--chip) 75%, var(--muted));
}

.archive-title {
	font-size: clamp(2rem, 5vw, 3.2rem);
	font-weight: 900;
	line-height: 1.35;
	margin-bottom: .6rem;
}

.archive-title span {
	color: var(--accent-ink);
}

.archive-desc {
	max-width: 44rem;
	color: var(--text-2);
	font-size: 1.08rem;
}

.archive-count {
	color: var(--muted);
}

.archive-search {
	max-width: 36rem;
	margin-top: 1rem;
}

.empty-state {
	padding: 4rem 1rem;
	text-align: center;
	color: var(--text-2);
}

.empty-state .search-form {
	max-width: 32rem;
	margin: 1.2rem auto 0;
}

.empty-code {
	font-family: var(--mono);
	color: var(--muted);
}

.pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .4rem;
	margin: 3rem 0 1rem;
	padding: 0;
	list-style: none;
}

.pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding-inline: .7rem;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface);
	font-weight: 700;
}

.pagination .page-numbers.current {
	background: var(--text);
	color: var(--bg);
	border-color: var(--text);
}

.pagination a.page-numbers:hover {
	border-color: var(--line-strong);
}

/* Search form ------------------------------------------------------------- */
.search-form {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .35rem;
	padding-inline-start: 1rem;
	border-radius: 16px;
	border: 1px solid var(--line-strong);
	background: var(--surface);
	color: var(--muted);
}

.search-form:focus-within {
	border-color: var(--accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search-field {
	flex: 1;
	min-width: 0;
	border: 0;
	background: none;
	padding: .5rem 0;
	outline: none;
	font-size: 1rem;
}

.search-form .btn {
	min-height: 40px;
}

/* Single ------------------------------------------------------------------ */
.entry-header {
	padding-block: clamp(2.5rem, 6vw, 4.5rem) 1.6rem;
}

.entry-kicker {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .6rem;
	margin-bottom: 1rem;
}

.entry-title {
	font-size: clamp(1.9rem, 4.6vw, 3.1rem);
	font-weight: 900;
	line-height: 1.4;
	margin-bottom: .8rem;
	text-wrap: balance;
}

.entry-lead {
	color: var(--text-2);
	font-size: clamp(1.08rem, 1.8vw, 1.25rem);
	line-height: 1.95;
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem 1.3rem;
	margin-top: 1.2rem;
	color: var(--muted);
	font-size: .92rem;
}

.meta-author {
	display: inline-flex;
	align-items: center;
	gap: .55rem;
	color: var(--text);
	font-weight: 700;
}

.meta-author img {
	border-radius: 50%;
}

.entry-hero {
	margin: 0 auto 2.5rem;
}

.entry-hero img {
	width: 100%;
	border-radius: calc(var(--radius) + 4px);
	aspect-ratio: 2 / 1;
	object-fit: cover;
}

.theater {
	margin-bottom: 2.5rem;
	padding-block: 2rem;
	background: var(--term-bg);
}

.video-frame {
	overflow: hidden;
	border-radius: var(--radius);
	background: #000;
	box-shadow: var(--shadow-lg);
}

.video-frame iframe,
.video-frame video,
.video-frame .wp-video {
	display: block;
	width: 100% !important;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
}

.theater--audio {
	background:
		radial-gradient(500px 240px at 15% 100%, rgba(124, 58, 237, .4), transparent 70%),
		var(--term-bg);
}

.podcast-card {
	display: grid;
	grid-template-columns: 140px minmax(0, 1fr);
	align-items: center;
	gap: 1.5rem;
}

.podcast-art {
	width: 140px;
	height: 140px;
	border-radius: 18px;
	object-fit: cover;
}

.podcast-art--empty {
	display: grid;
	place-items: center;
	background: linear-gradient(135deg, #7c3aed, var(--flame));
	color: #fff;
}

.podcast-art--empty .icon {
	width: 48px;
	height: 48px;
}

@media (max-width: 560px) {
	.podcast-card {
		grid-template-columns: 1fr;
	}
}

.entry-layout {
	display: grid;
	grid-template-columns: 230px minmax(0, var(--narrow));
	justify-content: center;
	gap: 3.5rem;
}

.entry-aside {
	position: relative;
}

.entry-aside > * {
	position: sticky;
	top: calc(var(--header-h) + 24px);
}

.entry-aside .share {
	top: auto;
	position: static;
	margin-top: 1.5rem;
}

.toc {
	max-height: calc(100vh - var(--header-h) - 60px);
	overflow: auto;
	padding-inline-end: .5rem;
}

.toc-title {
	display: flex;
	align-items: center;
	gap: .5rem;
	margin-bottom: .6rem;
	color: var(--muted);
	font-size: .8rem;
	font-weight: 800;
}

.toc ol {
	list-style: none;
	margin: 0;
	padding: 0;
	border-inline-start: 2px solid var(--line);
}

.toc a {
	display: block;
	margin-inline-start: -2px;
	padding: .3rem .9rem;
	border-inline-start: 2px solid transparent;
	color: var(--text-2);
	font-size: .9rem;
	line-height: 1.6;
	transition: color .2s, border-color .2s;
}

.toc .toc-l3 a {
	padding-inline-start: 1.7rem;
	font-size: .85rem;
}

.toc a:hover,
.toc a.is-active {
	color: var(--text);
	border-inline-start-color: var(--accent);
}

.share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .45rem;
}

.share .toc-title {
	width: 100%;
	margin-bottom: .1rem;
}

.share .icon-btn {
	width: 38px;
	height: 38px;
}

body:not(.has-toc) .entry-layout {
	grid-template-columns: minmax(0, var(--narrow));
}

body:not(.has-toc) .entry-aside {
	order: 2;
}

body:not(.has-toc) .entry-aside .share {
	margin-top: 0;
}

@media (max-width: 1100px) {
	.entry-layout,
	body.has-toc .entry-layout {
		grid-template-columns: minmax(0, var(--narrow));
		gap: 1.5rem;
	}

	.entry-aside > * {
		position: static;
	}

	.toc {
		max-height: none;
		padding: 1rem 1.2rem;
		border-radius: var(--radius);
		background: var(--surface);
		border: 1px solid var(--line);
	}

	.entry-aside .share {
		display: none;
	}
}

.entry-footer {
	padding-block: 2.5rem 1rem;
}

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-bottom: 2rem;
}

.tag {
	padding: .25rem .8rem;
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-2);
	font-size: .88rem;
}

.tag:hover {
	color: var(--text);
}

.author-box {
	display: flex;
	gap: 1.1rem;
	padding: 1.3rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--line);
}

.author-box img {
	flex: none;
	border-radius: 50%;
	width: 64px;
	height: 64px;
}

.author-label {
	margin: 0;
	color: var(--muted);
	font-size: .8rem;
}

.author-name {
	margin: 0 0 .3rem;
	font-weight: 800;
	font-size: 1.1rem;
}

.author-bio {
	margin: 0;
	color: var(--text-2);
	font-size: .95rem;
}

.post-navigation {
	margin-top: 2rem;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.post-navigation a {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 1rem 1.2rem;
	border-radius: var(--radius);
	border: 1px solid var(--line);
	transition: border-color .2s, background .2s;
}

.post-navigation a:hover {
	border-color: var(--line-strong);
	background: var(--surface);
}

.post-navigation .nav-next {
	text-align: end;
	grid-column: 2;
}

.nav-label {
	color: var(--muted);
	font-size: .8rem;
}

.nav-title {
	font-weight: 700;
	line-height: 1.6;
}

@media (max-width: 600px) {
	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next {
		grid-column: auto;
	}
}

/* Prose ------------------------------------------------------------------- */
.prose {
	font-size: 1.125rem;
	line-height: 2.05;
	overflow-wrap: break-word;
}

.prose > * {
	margin-block: 0 1.35em;
}

.prose h2,
.prose h3,
.prose h4 {
	margin-block: 2em .7em;
	line-height: 1.5;
}

.prose h2 {
	font-size: 1.6rem;
}

.prose h3 {
	font-size: 1.3rem;
}

.prose h4 {
	font-size: 1.12rem;
}

.prose a {
	color: var(--accent-ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 6px;
	text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

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

.prose ul,
.prose ol {
	padding-inline-start: 1.4em;
}

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

:lang(ckb) .prose ol {
	list-style-type: arabic-indic;
}

.prose li::marker {
	color: var(--accent);
}

.prose img,
.prose video,
.prose iframe {
	border-radius: 14px;
}

.prose figure {
	margin-inline: 0;
}

.prose figcaption,
.wp-element-caption {
	margin-top: .6rem;
	color: var(--muted);
	font-size: .88rem;
	text-align: center;
}

.prose blockquote {
	position: relative;
	margin-inline: 0;
	padding: 1.1rem 1.4rem;
	border-inline-start: 4px solid var(--accent);
	border-radius: 4px 14px 14px 4px;
	background: var(--surface);
	color: var(--text);
	font-size: 1.15em;
}

[dir="rtl"] .prose blockquote {
	border-radius: 14px 4px 4px 14px;
}

.prose blockquote p:last-child {
	margin-bottom: 0;
}

.prose blockquote cite {
	display: block;
	margin-top: .5rem;
	color: var(--muted);
	font-size: .85rem;
	font-style: normal;
}

.prose hr {
	border: 0;
	height: 1px;
	margin-block: 3em;
	background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: .95rem;
}

.prose th,
.prose td {
	padding: .6rem .8rem;
	border-bottom: 1px solid var(--line);
	text-align: start;
}

.prose th {
	background: var(--surface-2);
}

.wp-block-table {
	overflow-x: auto;
}

.prose :not(pre) > code,
.prose kbd {
	padding: .12em .42em;
	border-radius: 6px;
	background: var(--surface-2);
	font-family: var(--mono);
	font-size: .84em;
	direction: ltr;
	unicode-bidi: isolate;
}

.prose kbd {
	border: 1px solid var(--line-strong);
	border-bottom-width: 2px;
	color: var(--text);
}

/* Code blocks: always LTR, terminal style. */
.prose pre,
pre.wp-block-code,
pre.wp-block-preformatted {
	position: relative;
	direction: ltr;
	text-align: left;
	margin-inline: 0;
	padding: 2.6rem 1.25rem 1.15rem;
	border-radius: 14px;
	background: var(--term-bg);
	color: var(--term-text);
	font-family: var(--mono);
	font-size: .88rem;
	line-height: 1.75;
	overflow-x: auto;
	tab-size: 4;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.prose pre::before,
pre.wp-block-code::before {
	content: "";
	position: absolute;
	top: 14px;
	left: 16px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #ff5f57;
	box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
	opacity: .85;
}

.prose pre code {
	padding: 0;
	background: none;
	font-size: inherit;
	color: inherit;
	white-space: pre;
}

.code-lang {
	position: absolute;
	top: 8px;
	left: 72px;
	color: var(--term-dim);
	font-size: .72rem;
	text-transform: lowercase;
}

.code-copy {
	position: absolute;
	top: 6px;
	right: 8px;
	padding: .2rem .65rem;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: rgba(255, 255, 255, .05);
	color: var(--term-dim);
	font-family: var(--font);
	font-size: .76rem;
	line-height: 1.6;
	transition: color .2s, background .2s;
}

.code-copy:hover,
.code-copy.is-done {
	color: #fff;
	background: rgba(255, 255, 255, .12);
}

.code-copy.is-done {
	color: var(--prompt);
}

.sh-prompt {
	color: var(--prompt);
	user-select: none;
}

.sh-comment {
	color: var(--term-dim);
}

.sh-root {
	color: #ff7b72;
	user-select: none;
}

/* WordPress core alignments ------------------------------------------------ */
.alignwide {
	max-width: min(var(--max), 100vw - var(--gutter) * 2);
	margin-inline: calc((var(--narrow) - min(var(--max), 100vw - var(--gutter) * 2)) / 2);
}

.alignfull {
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.alignfull img,
.alignwide img {
	width: 100%;
}

@media (max-width: 800px) {
	.alignwide {
		margin-inline: 0;
		max-width: 100%;
	}
}

.aligncenter {
	margin-inline: auto;
}

.alignleft {
	float: left;
	margin: .3em 0 1em 1.5em;
	margin-inline-end: 1.5em;
}

.alignright {
	float: right;
	margin: .3em 1.5em 1em 0;
}

.wp-block-button__link {
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent) !important;
	text-decoration: none !important;
	font-weight: 700;
}

.wp-block-embed__wrapper iframe {
	width: 100%;
}

.sticky .card-title::before {
	content: "★ ";
	color: var(--accent);
}

.page-links {
	display: flex;
	gap: .5rem;
}

/* Comments ---------------------------------------------------------------- */
.comments {
	padding-block: 2rem 3rem;
}

.comments .section-title {
	margin-bottom: 1.5rem;
}

.comment-list,
.comment-list .children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .children {
	padding-inline-start: 2rem;
	border-inline-start: 2px solid var(--line);
}

.comment-body {
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--line);
}

.comment-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem 1rem;
	font-size: .88rem;
	color: var(--muted);
}

.comment-author {
	display: flex;
	align-items: center;
	gap: .6rem;
	color: var(--text);
	font-weight: 700;
}

.comment-author img {
	border-radius: 50%;
}

.comment-author .says {
	display: none;
}

.comment-content {
	margin-top: .6rem;
}

.reply a {
	color: var(--accent-ink);
	font-size: .88rem;
	font-weight: 700;
}

.comment-respond {
	margin-top: 2rem;
	padding: 1.5rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--line);
}

.comment-form {
	display: grid;
	gap: 1rem;
}

.comment-form label {
	display: block;
	margin-bottom: .3rem;
	font-size: .9rem;
	font-weight: 700;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: .7rem .9rem;
	border-radius: 12px;
	border: 1px solid var(--line-strong);
	background: var(--bg);
	outline: none;
}

.comment-form textarea {
	height: 150px;
	resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
	border-color: var(--accent);
}

.comment-form-cookies-consent {
	display: flex;
	gap: .5rem;
	align-items: center;
}

.comment-form-cookies-consent label {
	margin: 0;
	font-weight: 400;
}

/* Social links ------------------------------------------------------------ */
.social-links {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.social-links a {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--text-2);
	transition: color .2s, border-color .2s, transform .2s;
}

.social-links a:hover {
	color: var(--accent-ink);
	border-color: var(--accent);
	transform: translateY(-2px);
}

/* Footer ------------------------------------------------------------------ */
.site-footer {
	margin-top: clamp(3rem, 7vw, 5rem);
	padding-top: 3rem;
	border-top: 1px solid var(--line);
	background: var(--surface-2);
}

.footer-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) repeat(auto-fit, minmax(200px, 1fr));
	gap: 2.5rem;
	padding-bottom: 2.5rem;
}

.footer-desc {
	margin-top: 1rem;
	max-width: 26rem;
	color: var(--text-2);
}

.footer-menu {
	display: grid;
	gap: .2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer-menu a {
	color: var(--text-2);
}

.footer-menu a:hover {
	color: var(--accent-ink);
}

.widget-title,
.footer-widgets h2,
.footer-widgets .wp-block-heading {
	font-size: 1rem;
	margin-bottom: .6rem;
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1.5rem;
}

.footer-widgets ul {
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
}

.footer-widgets li {
	padding-block: .15rem;
}

.footer-widgets a {
	color: var(--text-2);
}

.footer-widgets a:hover {
	color: var(--accent-ink);
}

.footer-term {
	align-self: start;
	padding: 1rem 1.2rem;
	border-radius: 14px;
	background: var(--term-bg);
	color: var(--term-text);
	font-family: var(--mono);
	font-size: .8rem;
	line-height: 1.9;
}

.footer-term .t-dim {
	font-family: var(--font);
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1.5rem;
	padding-block: 1.3rem;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: .88rem;
}

.footer-bottom p {
	margin: 0;
}

.sponsor a {
	color: var(--text);
	font-weight: 700;
}

.sponsor a:hover,
.to-top:hover {
	color: var(--accent-ink);
}

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

/* Command palette --------------------------------------------------------- */
.palette {
	width: min(680px, calc(100vw - 2 * var(--gutter)));
	max-height: min(72vh, 620px);
	margin: 12vh auto auto;
	padding: 0;
	border: 1px solid var(--line-strong);
	border-radius: 20px;
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .5);
	overflow: hidden;
}

.palette[open] {
	display: flex;
	flex-direction: column;
	animation: pop .22s var(--ease);
}

.palette::backdrop {
	background: rgba(8, 10, 14, .55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.palette-form {
	display: flex;
	align-items: center;
	gap: .8rem;
	padding: .9rem 1.1rem;
	border-bottom: 1px solid var(--line);
}

.palette-prompt {
	flex: none;
	font-family: var(--mono);
	font-size: .8rem;
	color: var(--leaf);
}

.palette-input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	background: none;
	font-size: 1.15rem;
	padding: .3rem 0;
}

.palette-input::-webkit-search-cancel-button {
	display: none;
}

.palette-close {
	border: 0;
	background: none;
	padding: 0;
}

.palette-body {
	flex: 1;
	overflow: auto;
	padding: .5rem;
}

.palette-results {
	list-style: none;
	margin: 0;
	padding: 0;
}

.palette-results:empty {
	display: none;
}

.palette-results a,
.palette-results .palette-msg {
	display: flex;
	align-items: center;
	gap: .8rem;
	padding: .7rem .8rem;
	border-radius: 12px;
}

.palette-results .palette-msg {
	color: var(--muted);
}

.palette-results a[aria-selected="true"] {
	background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.palette-type {
	flex: none;
	min-width: 3.6rem;
	padding: .05rem .5rem;
	border-radius: 6px;
	background: var(--surface-2);
	color: var(--muted);
	font-size: .72rem;
	text-align: center;
}

.palette-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.palette-hints {
	padding: .8rem;
}

.palette-results:not(:empty) + .palette-hints {
	display: none;
}

.palette-label {
	margin-bottom: .6rem;
	color: var(--muted);
	font-size: .8rem;
	font-weight: 700;
}

.palette-foot {
	display: flex;
	align-items: center;
	gap: .35rem;
	padding: .6rem 1rem;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: .75rem;
}

.palette-foot kbd:not(:first-child) {
	margin-inline-start: .6rem;
}

.palette-foot kbd:nth-child(2) {
	margin-inline-start: 0;
}

@media (max-width: 600px) {
	.palette {
		margin-top: 4vh;
	}

	.palette-foot,
	.palette-prompt {
		display: none;
	}
}

/* 404 --------------------------------------------------------------------- */
.notfound {
	padding-block: clamp(3rem, 8vw, 5rem);
	text-align: center;
}

.notfound .terminal {
	max-width: 520px;
	margin: 0 auto 2.5rem;
	text-align: left;
}

.notfound .terminal-body {
	font-family: var(--mono);
	font-size: .86rem;
}

.notfound .search-form {
	max-width: 32rem;
	margin: 1.5rem auto;
}

/* Motion ------------------------------------------------------------------ */
@keyframes blink {
	to { visibility: hidden; }
}

@keyframes typing {
	from { max-width: 0; }
	to { max-width: 24ch; }
}

@keyframes lineIn {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

@keyframes pulse {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--leaf) 55%, transparent); }
	70% { box-shadow: 0 0 0 10px transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes wave {
	0%, 100% { transform: scaleY(.18); }
	50% { transform: scaleY(1); }
}

@keyframes pop {
	from { opacity: 0; transform: translateY(-8px) scale(.98); }
	to { opacity: 1; transform: none; }
}

@keyframes drop {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

.reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.is-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		animation-delay: 0s !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}

	.reveal {
		opacity: 1;
		transform: none;
	}
}

/* Print ------------------------------------------------------------------- */
@media print {
	.site-header,
	.site-footer,
	.entry-aside,
	.palette,
	.code-copy,
	.post-navigation,
	.comments {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
	}

	.entry-layout {
		display: block;
	}
}
