/* ————— Tokens ————— */
:root {
	--ink: #f4f2ff;
	--text: #d4cfec;
	--muted: #a39ab8;
	--line: rgba(196, 190, 230, 0.14);
	--surface: #1a1728;
	--canvas: #121019;
	--accent: #fa625f;
	--accent-2: #ff8a87;
	--accent-soft: rgba(250, 98, 95, 0.16);
	--accent-hover: #e84e4b;
	--gold: #e8b84a;
	--gold-soft: rgba(232, 184, 74, 0.18);
	--radius: 18px;
	--radius-sm: 11px;
	--font: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont,
		"Segoe UI", Roboto, sans-serif;
	--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
	--shadow-tile: 0 12px 40px rgba(250, 98, 95, 0.14);
	--shadow-code: 0 14px 34px rgba(0, 0, 0, 0.38);
	--ease-emph: cubic-bezier(0.22, 1, 0.36, 1);
	--ease-hover: cubic-bezier(0.4, 0, 0.2, 1);
	--dur-fast: 180ms;
	--dur-hover: 0.55s;
	--focus-ring: 0 0 0 3px rgba(250, 98, 95, 0.35);
}
html[data-theme="light"] {
	--ink: #1a1824;
	--text: #3a3848;
	--muted: #6e6a7c;
	--line: rgba(72, 64, 96, 0.16);
	--surface: #e4e1ec;
	--canvas: #d8d4e4;
	--accent: #e85552;
	--accent-2: #ff9a96;
	--accent-soft: rgba(232, 85, 82, 0.12);
	--accent-hover: #d44441;
	--shadow-tile: 0 10px 36px rgba(22, 18, 40, 0.09);
	--shadow-code: 0 10px 28px rgba(22, 18, 40, 0.14);
	--focus-ring: 0 0 0 3px rgba(232, 85, 82, 0.22);
}

/* ————— Reset ————— */
*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
img,
svg {
	display: block;
	max-width: 100%;
}
a {
	color: inherit;
}
body {
	font-family: var(--font);
	font-weight: 500;
	font-size: 1.05rem;
	line-height: 1.55;
	color: var(--text);
	background-color: var(--canvas);
	min-height: 100vh;
	min-height: 100dvh;
	position: relative;
	overflow-x: hidden;
	--ptr-x: 50%;
	--ptr-y: 30%;
	--grid-ptr-x: 50%;
	--grid-ptr-y: 36%;
}

/* ————— Animated background ————— */
.bg-stack {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	overflow: hidden;
	background-color: var(--canvas);
}
.bg-grid {
	position: absolute;
	inset: -20%;
	background-size: 56px 56px;
	background-image: linear-gradient(
			rgba(250, 98, 95, 0.055) 1px,
			transparent 1px
		),
		linear-gradient(90deg, rgba(250, 98, 95, 0.055) 1px, transparent 1px);
	animation: grid-drift 72s linear infinite;
}
html[data-theme="light"] .bg-grid {
	background-image: linear-gradient(rgba(90, 78, 120, 0.1) 1px, transparent 1px),
		linear-gradient(90deg, rgba(90, 78, 120, 0.1) 1px, transparent 1px);
}
@keyframes grid-drift {
	to {
		transform: translate3d(28px, 28px, 0);
	}
}
/* Small bright cursor highlight — sitewide, follows the pointer everywhere. */
.bg-grid-accent {
	position: absolute;
	inset: -20%;
	background-size: 56px 56px;
	--grid-accent-line: rgba(255, 148, 145, 0.42);
	background-image: linear-gradient(var(--grid-accent-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--grid-accent-line) 1px, transparent 1px);
	-webkit-mask-image: radial-gradient(
		ellipse min(200px, 26vw) min(150px, 22vw) at var(--grid-ptr-x, 50%) var(--grid-ptr-y, 36%),
		#000 0%,
		rgba(0, 0, 0, 0.88) 10%,
		rgba(0, 0, 0, 0.62) 24%,
		rgba(0, 0, 0, 0.38) 40%,
		rgba(0, 0, 0, 0.22) 55%,
		rgba(0, 0, 0, 0.12) 68%,
		rgba(0, 0, 0, 0.05) 80%,
		rgba(0, 0, 0, 0.02) 90%,
		transparent 100%
	);
	mask-image: radial-gradient(
		ellipse min(200px, 26vw) min(150px, 22vw) at var(--grid-ptr-x, 50%) var(--grid-ptr-y, 36%),
		#000 0%,
		rgba(0, 0, 0, 0.88) 10%,
		rgba(0, 0, 0, 0.62) 24%,
		rgba(0, 0, 0, 0.38) 40%,
		rgba(0, 0, 0, 0.22) 55%,
		rgba(0, 0, 0, 0.12) 68%,
		rgba(0, 0, 0, 0.05) 80%,
		rgba(0, 0, 0, 0.02) 90%,
		transparent 100%
	);
	mix-blend-mode: plus-lighter;
	animation: grid-drift 72s linear infinite;
}
@supports not (mix-blend-mode: plus-lighter) {
	.bg-grid-accent {
		mix-blend-mode: screen;
	}
}
html[data-theme="light"] .bg-grid-accent {
	--grid-accent-line: rgba(88, 68, 200, 0.28);
	mix-blend-mode: normal;
}

/* Big red orbit glow — hero sections only, not sitewide. */
.hero-ambient {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	overflow: hidden;
}
.hero-orbit {
	position: absolute;
	width: min(120vw, 900px);
	height: min(120vw, 900px);
	left: var(--ptr-x);
	top: var(--ptr-y);
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(
			circle at 40% 35%,
			rgba(250, 98, 95, 0.1) 0%,
			transparent 55%
		),
		radial-gradient(
			circle at 60% 60%,
			rgba(232, 184, 74, 0.06) 0%,
			transparent 50%
		);
	filter: blur(40px);
	transition: left 0.5s var(--ease-emph), top 0.5s var(--ease-emph);
	animation: orbit-float 14s ease-in-out infinite;
}
@keyframes orbit-float {
	0%,
	100% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 0.9;
	}
	50% {
		transform: translate(-50%, -54%) scale(1.08);
		opacity: 1;
	}
}
.bg-vignette {
	position: absolute;
	inset: 0;
	background: radial-gradient(
			ellipse 90% 55% at 15% -10%,
			rgba(250, 98, 95, 0.09) 0%,
			transparent 52%
		),
		radial-gradient(
			120% 80% at 50% 100%,
			rgba(0, 0, 0, 0.35) 0%,
			transparent 55%
		);
	opacity: 0.85;
}
html[data-theme="light"] .bg-vignette {
	opacity: 0.4;
}

main,
.site-header,
.site-footer {
	position: relative;
	z-index: 1;
}

/* ————— Header ————— */
.site-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
	border-bottom: 1px solid var(--line);
	background: color-mix(in srgb, var(--canvas) 88%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	position: sticky;
	top: 0;
	z-index: 20;
}
@supports not (color: color-mix(in srgb, white, black)) {
	.site-header {
		background: var(--canvas);
	}
}
.site-logo {
	font-weight: 800;
	font-size: 1.1rem;
	letter-spacing: -0.02em;
	color: var(--ink);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
}
.site-logo .dot {
	color: var(--accent);
	animation: blink 2.4s steps(1) infinite;
}
@keyframes blink {
	0%,
	60% {
		opacity: 1;
	}
	61%,
	100% {
		opacity: 0.25;
	}
}
.site-nav {
	display: flex;
	gap: 0.5rem 1.5rem;
	flex-wrap: wrap;
}
.site-nav a {
	position: relative;
	color: var(--muted);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9rem;
	transition: color var(--dur-fast) var(--ease-emph);
}
.site-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -4px;
	height: 2px;
	width: 0;
	background: var(--accent);
	border-radius: 2px;
	transition: width 0.28s var(--ease-emph);
}
.site-nav a:hover {
	color: var(--accent);
}
.site-nav a:hover::after {
	width: 100%;
}
.header-right {
	display: flex;
	align-items: center;
	gap: 1rem;
}
.site-theme {
	width: 2.6rem;
	height: 2.6rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	cursor: pointer;
	font-size: 1.1rem;
	line-height: 1;
	transition: background var(--dur-fast) var(--ease-emph),
		border-color var(--dur-fast) var(--ease-emph),
		color var(--dur-fast) var(--ease-emph), transform 0.2s var(--ease-emph);
}
.site-theme:hover {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--accent);
	transform: rotate(-12deg);
}
.site-theme:active {
	transform: scale(0.94);
}
.site-theme:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}
.theme-ic-moon {
	display: none;
}
html[data-theme="light"] .theme-ic-sun {
	display: none;
}
html[data-theme="light"] .theme-ic-moon {
	display: inline;
}

/* ————— Buttons ————— */
.btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.68rem 1.3rem;
	border-radius: var(--radius-sm);
	font-family: var(--font);
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	overflow: hidden;
	transition: background var(--dur-fast) var(--ease-emph),
		border-color var(--dur-fast) var(--ease-emph),
		color var(--dur-fast) var(--ease-emph),
		transform var(--dur-fast) var(--ease-emph),
		filter var(--dur-fast) var(--ease-emph);
}
.btn:hover {
	transform: translateY(-2px);
}
.btn:active {
	transform: translateY(0);
}
.btn--primary {
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.12);
	box-shadow: 0 4px 20px rgba(250, 98, 95, 0.28);
}
.btn--primary:hover {
	filter: brightness(1.06);
	box-shadow: 0 8px 28px rgba(250, 98, 95, 0.4);
}
.btn--primary::before {
	content: "";
	position: absolute;
	top: 0;
	left: -80%;
	width: 60%;
	height: 100%;
	background: linear-gradient(
		100deg,
		transparent,
		rgba(255, 255, 255, 0.35),
		transparent
	);
	transform: skewX(-18deg);
	transition: left 0.6s var(--ease-emph);
}
.btn--primary:hover::before {
	left: 130%;
}
.btn--ghost {
	background: var(--surface);
	color: var(--ink);
	border-color: var(--line);
}
.btn--ghost:hover {
	border-color: var(--accent);
	color: var(--accent);
}
.btn:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}

/* ————— Hero (home) ————— */
.hero {
	position: relative;
	overflow: hidden;
	max-width: 64rem;
	margin: 0 auto;
	padding: clamp(3.5rem, 10vw, 7rem) clamp(1.25rem, 4vw, 2.5rem)
		clamp(1.5rem, 4vw, 2.5rem);
	min-height: min(82vh, 760px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 1.15rem;
}
.eyebrow::before {
	content: "";
	width: 1.8rem;
	height: 2px;
	background: var(--accent);
	border-radius: 2px;
}
.hero-title {
	font-size: clamp(2.75rem, 9vw, 5.25rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1.02;
	color: var(--ink);
	margin-bottom: 1.4rem;
}
.hero-title .accent,
.text-accent {
	background: linear-gradient(
		110deg,
		var(--accent-2) 0%,
		var(--accent) 35%,
		var(--gold) 60%,
		var(--accent-2) 100%
	);
	background-size: 220% auto;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: gradient-pan 7s linear infinite;
}
@keyframes gradient-pan {
	to {
		background-position: 220% center;
	}
}
.lead {
	color: var(--muted);
	font-size: clamp(1.02rem, 2.2vw, 1.18rem);
	line-height: 1.65;
	max-width: 40rem;
	margin-bottom: 2rem;
}
.lead strong {
	color: var(--text);
	font-weight: 700;
}
.lead a {
	color: var(--accent);
	text-decoration: none;
	font-weight: 600;
}
.lead a:hover {
	text-decoration: underline;
}
.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-bottom: 2.5rem;
}
.hero-facts {
	list-style: none;
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: color-mix(in srgb, var(--surface) 55%, transparent);
	overflow: hidden;
}
@supports not (color: color-mix(in srgb, white, black)) {
	.hero-facts {
		background: var(--surface);
	}
}
@media (min-width: 640px) {
	.hero-facts {
		grid-template-columns: repeat(3, 1fr);
	}
}
.hero-facts li {
	padding: 1.1rem 1.35rem;
	border-top: 1px solid var(--line);
	transition: background var(--dur-fast) var(--ease-emph);
}
.hero-facts li:first-child {
	border-top: none;
}
@media (min-width: 640px) {
	.hero-facts li {
		border-top: none;
		border-left: 1px solid var(--line);
	}
	.hero-facts li:first-child {
		border-left: none;
	}
}
.hero-facts li:hover {
	background: var(--accent-soft);
}
.hero-facts .k {
	display: block;
	font-size: 0.66rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-weight: 800;
	color: var(--accent);
	margin-bottom: 0.35rem;
}
.hero-facts .v {
	display: block;
	font-weight: 700;
	color: var(--ink);
	font-size: 0.98rem;
}

/* ————— Tech marquee ————— */
.marquee-band {
	position: relative;
	margin-top: 0.5rem;
	padding: 1.1rem 0;
	border-block: 1px solid var(--line);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(
		90deg,
		transparent,
		#000 10%,
		#000 90%,
		transparent
	);
	mask-image: linear-gradient(
		90deg,
		transparent,
		#000 10%,
		#000 90%,
		transparent
	);
}
.marquee-track {
	display: flex;
	align-items: center;
	gap: 2.75rem;
	width: max-content;
	animation: marquee 32s linear infinite;
}
.marquee-band:hover .marquee-track {
	animation-play-state: paused;
}
.marquee-item {
	font-weight: 700;
	font-size: 0.98rem;
	letter-spacing: 0.01em;
	color: var(--muted);
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 2.75rem;
}
.marquee-item::after {
	content: "◆";
	font-size: 0.55rem;
	color: var(--accent);
}
@keyframes marquee {
	to {
		transform: translateX(-50%);
	}
}

/* ————— Sections ————— */
.section {
	max-width: min(72rem, 96vw);
	margin: 0 auto;
	padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 4vw, 2.5rem);
}
.section-head {
	margin-bottom: 2.25rem;
}
.section-eyebrow {
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 0.6rem;
}
.section h2 {
	font-size: clamp(1.5rem, 3.5vw, 2rem);
	font-weight: 800;
	letter-spacing: -0.025em;
	color: var(--ink);
	margin-bottom: 0.5rem;
}
.section-intro {
	color: var(--muted);
	max-width: 40rem;
}

/* ————— Skills ————— */
.skills-grid {
	display: grid;
	gap: 1.1rem;
	grid-template-columns: 1fr;
}
@media (min-width: 640px) {
	.skills-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (min-width: 960px) {
	.skills-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
.skill-card {
	position: relative;
	padding: 1.5rem 1.5rem 1.6rem;
	border-radius: var(--radius);
	border: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 80%, transparent);
	overflow: hidden;
	transition: border-color var(--dur-hover) var(--ease-hover),
		box-shadow var(--dur-hover) var(--ease-hover),
		transform var(--dur-hover) var(--ease-hover),
		background var(--dur-hover) var(--ease-hover);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.skill-card {
		background: var(--surface);
	}
}
.skill-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	height: 3px;
	width: 0;
	background: linear-gradient(90deg, var(--accent), var(--gold));
	transition: width 0.5s var(--ease-hover);
}
.skill-card:hover {
	border-color: rgba(250, 98, 95, 0.4);
	box-shadow: var(--shadow-tile);
	transform: translateY(-4px);
}
.skill-card:hover::before {
	width: 100%;
}
.skill-head {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin-bottom: 1.1rem;
}
.skill-num {
	font-family: var(--mono);
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--accent);
	background: var(--accent-soft);
	border: 1px solid var(--line);
	border-radius: 7px;
	padding: 0.18rem 0.45rem;
	line-height: 1;
}
.skill-head h3 {
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-weight: 800;
	color: var(--muted);
}
.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.chip {
	font-size: 0.85rem;
	font-weight: 600;
	padding: 0.38rem 0.72rem;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--accent-soft);
	color: var(--ink);
	cursor: default;
	transition: transform 0.2s var(--ease-emph),
		border-color 0.2s var(--ease-emph), background 0.2s var(--ease-emph),
		color 0.2s var(--ease-emph);
}
.chip:hover {
	transform: translateY(-2px);
	border-color: var(--accent);
	color: var(--accent);
}
.chip--muted {
	background: transparent;
	color: var(--text);
}
.chip--muted:hover {
	color: var(--accent);
}

/* ————— Projects (cards) ————— */
.project-list {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
}
@media (min-width: 760px) {
	.project-list {
		grid-template-columns: repeat(2, 1fr);
	}
}
.project-card {
	display: flex;
	flex-direction: column;
	padding: 1.5rem 1.6rem;
	border-radius: var(--radius);
	border: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 92%, transparent);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
	transition: border-color var(--dur-hover) var(--ease-hover),
		box-shadow var(--dur-hover) var(--ease-hover),
		background var(--dur-hover) var(--ease-hover),
		transform var(--dur-hover) var(--ease-hover);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.project-card {
		background: var(--surface);
	}
}
.project-card:hover {
	border-color: rgba(250, 98, 95, 0.42);
	box-shadow: var(--shadow-tile);
	transform: translateY(-4px);
}
.project-card--featured {
	border-color: rgba(250, 98, 95, 0.22);
}
.project-badge {
	font-size: 0.66rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 0.6rem;
}
.project-card h3 {
	font-size: 1.2rem;
	font-weight: 800;
	color: var(--ink);
	margin-bottom: 0.6rem;
}
.project-card h3 a {
	text-decoration: none;
	color: inherit;
}
.project-card h3 a:hover {
	color: var(--accent);
}
.project-card p {
	color: var(--muted);
	font-size: 0.95rem;
	line-height: 1.58;
	margin-bottom: 1rem;
}
.project-foot {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.9rem;
}
.project-tag {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--muted);
	font-family: var(--mono);
}
.project-link {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--accent);
	text-decoration: none;
}
.project-link:hover {
	text-decoration: underline;
}
.project-link--case {
	margin-left: auto;
}

/* ————— Contact ————— */
.contact-wrap {
	display: grid;
	gap: 2rem;
	grid-template-columns: 1fr;
}
@media (min-width: 820px) {
	.contact-wrap {
		grid-template-columns: 1.1fr 0.9fr;
		align-items: start;
	}
}
.contact-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	max-width: 34rem;
}
.form-row {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.form-row label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ink);
}
.form-row input,
.form-row textarea {
	font-family: var(--font);
	font-size: 1rem;
	padding: 0.65rem 0.85rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	transition: border-color var(--dur-fast) var(--ease-emph),
		box-shadow var(--dur-fast) var(--ease-emph);
}
.form-row textarea {
	resize: vertical;
	min-height: 7rem;
}
.form-row input:focus-visible,
.form-row textarea:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
	border-color: rgba(250, 98, 95, 0.35);
}
.hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.contact-details {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.contact-item {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1.1rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 70%, transparent);
	text-decoration: none;
	transition: border-color var(--dur-fast) var(--ease-emph),
		background var(--dur-fast) var(--ease-emph),
		transform var(--dur-fast) var(--ease-emph);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.contact-item {
		background: var(--surface);
	}
}
.contact-item:hover {
	border-color: rgba(250, 98, 95, 0.4);
	background: var(--accent-soft);
	transform: translateX(4px);
}
.contact-item .k {
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--muted);
}
.contact-item .v {
	font-weight: 700;
	color: var(--ink);
	font-size: 0.95rem;
}

/* ————— Footer ————— */
.site-footer {
	padding: 2.5rem clamp(1.25rem, 4vw, 2.5rem) 3rem;
	border-top: 1px solid var(--line);
	text-align: center;
}
.site-footer p {
	color: var(--muted);
	font-size: 0.9rem;
	margin: 0.3rem 0;
}
.site-footer strong {
	color: var(--ink);
}
.footer-links {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}
.footer-links a {
	color: var(--muted);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9rem;
	transition: color var(--dur-fast) var(--ease-emph);
}
.footer-links a:hover {
	color: var(--accent);
}

/* ═══════════ Project detail pages ═══════════ */

/* Back link */
.back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--muted);
	text-decoration: none;
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.02em;
	transition: color var(--dur-fast) var(--ease-emph),
		gap var(--dur-fast) var(--ease-emph);
}
.back-link:hover {
	color: var(--accent);
	gap: 0.65rem;
}

/* Doc hero */
.doc-hero {
	position: relative;
	overflow: hidden;
	max-width: min(72rem, 96vw);
	margin: 0 auto;
	padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2.5rem) 1rem;
}
.doc-status {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin: 1.25rem 0 1rem;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
}
.doc-status::before {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 0 4px var(--accent-soft);
}
.doc-title {
	font-size: clamp(2.4rem, 7vw, 4rem);
	font-weight: 800;
	letter-spacing: -0.04em;
	line-height: 1.04;
	color: var(--ink);
	margin-bottom: 1rem;
}
.doc-tagline {
	color: var(--muted);
	font-size: clamp(1.05rem, 2.4vw, 1.25rem);
	line-height: 1.6;
	max-width: 42rem;
}
.doc-tagline strong {
	color: var(--text);
	font-weight: 700;
}
.doc-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 1.75rem;
}
.doc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-top: 1.75rem;
}

/* Doc body */
.doc-section {
	max-width: min(72rem, 96vw);
	margin: 0 auto;
	padding: clamp(2.25rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2.5rem);
	border-top: 1px solid var(--line);
}
.doc-section:first-of-type {
	border-top: none;
}
.doc-kicker {
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 0.75rem;
}
.doc-section h2 {
	font-size: clamp(1.4rem, 3.2vw, 1.85rem);
	font-weight: 800;
	letter-spacing: -0.025em;
	color: var(--ink);
	margin-bottom: 1rem;
}
.prose {
	max-width: 44rem;
}
.prose p {
	color: var(--text);
	margin-bottom: 1rem;
	line-height: 1.7;
}
.prose p:last-child {
	margin-bottom: 0;
}
.prose strong {
	color: var(--ink);
	font-weight: 700;
}
.prose a {
	color: var(--accent);
	text-decoration: none;
	font-weight: 600;
}
.prose a:hover {
	text-decoration: underline;
}
.prose ul {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}
.prose ul li {
	position: relative;
	padding-left: 1.5rem;
	margin-bottom: 0.6rem;
	color: var(--text);
	line-height: 1.6;
}
.prose ul li::before {
	content: "▹";
	position: absolute;
	left: 0;
	color: var(--accent);
	font-weight: 700;
}

/* Fact grid (overview highlights) */
.fact-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
	margin-top: 2rem;
}
@media (min-width: 640px) {
	.fact-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
.fact {
	padding: 1.1rem 1.2rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--surface) 70%, transparent);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.fact {
		background: var(--surface);
	}
}
.fact .k {
	display: block;
	font-size: 0.66rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	font-weight: 800;
	color: var(--accent);
	margin-bottom: 0.35rem;
}
.fact .v {
	font-weight: 700;
	color: var(--ink);
	font-size: 0.95rem;
}

/* ————— Architecture diagram ————— */
.arch {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	margin-top: 0.5rem;
}
.arch-tier {
	display: grid;
	gap: 0.85rem;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.arch-node {
	position: relative;
	padding: 1rem 1.1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--surface) 85%, transparent);
	transition: border-color var(--dur-fast) var(--ease-emph),
		transform var(--dur-fast) var(--ease-emph),
		box-shadow var(--dur-fast) var(--ease-emph);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.arch-node {
		background: var(--surface);
	}
}
.arch-node:hover {
	border-color: rgba(250, 98, 95, 0.45);
	transform: translateY(-3px);
	box-shadow: var(--shadow-tile);
}
.arch-node--accent {
	border-color: rgba(250, 98, 95, 0.35);
	background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface));
}
.arch-node .n {
	display: block;
	font-weight: 800;
	color: var(--ink);
	font-size: 0.98rem;
	margin-bottom: 0.25rem;
}
.arch-node .d {
	font-size: 0.82rem;
	color: var(--muted);
	line-height: 1.45;
}
.arch-node .tech {
	display: block;
	margin-top: 0.5rem;
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--accent);
}
.arch-flow {
	text-align: center;
	color: var(--accent);
	font-size: 1.1rem;
	line-height: 1;
	opacity: 0.7;
}
.arch-caption {
	margin-top: 1rem;
	font-size: 0.85rem;
	color: var(--muted);
	font-style: italic;
}

/* ————— UI mockup window ————— */
.mock-window {
	margin-top: 0.5rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--canvas);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.mock-bar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 0.9rem;
	border-bottom: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 85%, transparent);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.mock-bar {
		background: var(--surface);
	}
}
.mock-dots {
	display: flex;
	gap: 0.35rem;
}
.mock-dots span {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
	background: var(--line);
}
.mock-dots span:first-child {
	background: var(--accent);
}
.mock-url {
	flex: 1;
	max-width: 22rem;
	margin: 0 auto;
	padding: 0.3rem 0.8rem;
	border-radius: 999px;
	background: var(--canvas);
	border: 1px solid var(--line);
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--muted);
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mock-app {
	display: grid;
	grid-template-columns: 1fr;
	min-height: 20rem;
}
.mock-frame-embed {
	display: block;
	min-height: 30rem;
	max-height: 70vh;
	background: var(--canvas);
}
.mock-frame-embed iframe {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 30rem;
	max-height: 70vh;
	border: 0;
}
/* 16:9-locked live-preview frame (Sutrix). The outer box is a fluid 16:9
   window; the inner wrapper is a fixed 1440x810 (also 16:9) logical canvas
   that JS scales by width via transform. Both being 16:9 means uniform scaling
   fills the box exactly — the whole app shrinks as one unit on any viewport,
   including mobile, with no reflow, squish, or crop. */
.mock-frame-scale {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--canvas);
}
.mock-frame-scale__inner {
	position: absolute;
	top: 0;
	left: 0;
	width: 1440px;
	height: 810px;
	transform-origin: top left;
	will-change: transform;
}
.mock-frame-scale__inner iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}
@media (min-width: 620px) {
	.mock-app--side {
		grid-template-columns: 12rem 1fr;
	}
}
.mock-side {
	padding: 1.1rem 0.9rem;
	border-bottom: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 55%, transparent);
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}
@media (min-width: 620px) {
	.mock-side {
		border-bottom: none;
		border-right: 1px solid var(--line);
	}
}
@supports not (color: color-mix(in srgb, white, black)) {
	.mock-side {
		background: var(--surface);
	}
}
.mock-brand {
	font-weight: 800;
	color: var(--ink);
	font-size: 0.9rem;
	margin-bottom: 0.4rem;
	letter-spacing: -0.01em;
}
.mock-nav {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.45rem 0.6rem;
	border-radius: 8px;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--muted);
}
.mock-nav::before {
	content: "";
	width: 0.85rem;
	height: 0.85rem;
	border-radius: 4px;
	background: var(--line);
	flex: none;
}
.mock-nav--active {
	background: var(--accent-soft);
	color: var(--accent);
}
.mock-nav--active::before {
	background: var(--accent);
}
.mock-main {
	padding: 1.2rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.mock-h {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}
.mock-h .t {
	font-weight: 800;
	color: var(--ink);
	font-size: 1rem;
}
.mock-btn {
	font-size: 0.72rem;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, var(--accent), var(--accent-hover));
	padding: 0.35rem 0.75rem;
	border-radius: 8px;
}
.mock-tiles {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.7rem;
}
.mock-tile {
	padding: 0.8rem;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: color-mix(in srgb, var(--surface) 70%, transparent);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.mock-tile {
		background: var(--surface);
	}
}
.mock-tile .kpi {
	font-weight: 800;
	color: var(--ink);
	font-size: 1.15rem;
}
.mock-tile .lbl {
	font-size: 0.66rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--muted);
	margin-top: 0.2rem;
}
.mock-bars {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	height: 5.5rem;
	padding: 0.8rem;
	border: 1px solid var(--line);
	border-radius: 10px;
}
.mock-bars i {
	flex: 1;
	background: linear-gradient(
		to top,
		var(--accent),
		color-mix(in srgb, var(--accent) 40%, transparent)
	);
	border-radius: 4px 4px 0 0;
	min-height: 12%;
}
@supports not (color: color-mix(in srgb, white, black)) {
	.mock-bars i {
		background: var(--accent);
	}
}
.mock-table {
	border: 1px solid var(--line);
	border-radius: 10px;
	overflow: hidden;
}
.mock-tr {
	display: grid;
	grid-template-columns: 1.6fr 1fr 0.8rem;
	gap: 0.75rem;
	align-items: center;
	padding: 0.6rem 0.85rem;
	border-top: 1px solid var(--line);
	font-size: 0.8rem;
	color: var(--text);
}
.mock-tr:first-child {
	border-top: none;
	color: var(--muted);
	font-weight: 700;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}
.mock-tag {
	font-size: 0.66rem;
	font-weight: 700;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	justify-self: start;
}
.mock-tag--gold {
	background: var(--gold-soft);
	color: var(--gold);
}
.mock-dot {
	width: 0.6rem;
	height: 0.6rem;
	border-radius: 50%;
	background: var(--accent);
}
.mock-line {
	height: 0.6rem;
	border-radius: 4px;
	background: var(--line);
}
.mock-caption {
	margin-top: 0.9rem;
	font-size: 0.82rem;
	color: var(--muted);
	font-style: italic;
}

/* ————— Challenge cards ————— */
.challenges {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
	margin-top: 0.5rem;
}
@media (min-width: 760px) {
	.challenges {
		grid-template-columns: repeat(2, 1fr);
	}
}
.challenge {
	padding: 1.35rem 1.4rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: color-mix(in srgb, var(--surface) 82%, transparent);
	transition: border-color var(--dur-hover) var(--ease-hover),
		box-shadow var(--dur-hover) var(--ease-hover),
		transform var(--dur-hover) var(--ease-hover);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.challenge {
		background: var(--surface);
	}
}
.challenge:hover {
	border-color: rgba(250, 98, 95, 0.4);
	box-shadow: var(--shadow-tile);
	transform: translateY(-3px);
}
.challenge-num {
	font-family: var(--mono);
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--accent);
	margin-bottom: 0.6rem;
}
.challenge h3 {
	font-size: 1.02rem;
	font-weight: 800;
	color: var(--ink);
	margin-bottom: 0.6rem;
}
.challenge .label {
	display: inline-block;
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
	margin: 0.5rem 0 0.25rem;
}
.challenge p {
	color: var(--text);
	font-size: 0.9rem;
	line-height: 1.6;
}
.challenge .fix {
	color: var(--muted);
}

/* ————— Code, commands, callouts ————— */
code {
	font-family: var(--mono);
	font-size: 0.9em;
	background: var(--accent-soft);
	color: var(--accent);
	padding: 0.12em 0.4em;
	border-radius: 6px;
}
pre {
	margin: 1.25rem 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--surface) 85%, transparent);
	overflow-x: auto;
}
@supports not (color: color-mix(in srgb, white, black)) {
	pre {
		background: var(--surface);
	}
}
pre code {
	display: block;
	padding: 1rem 1.15rem;
	background: none;
	color: var(--text);
	font-size: 0.8rem;
	line-height: 1.7;
	white-space: pre;
	border-radius: 0;
}
.cmd {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-family: var(--mono);
	font-size: 0.85rem;
	padding: 0.8rem 1rem;
	margin: 1.25rem 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--ink);
	overflow-x: auto;
	white-space: nowrap;
}
.cmd::before {
	content: "$";
	color: var(--accent);
	font-weight: 700;
	flex: none;
}
.callout {
	margin: 1.5rem 0;
	padding: 1.05rem 1.25rem;
	border: 1px solid rgba(250, 98, 95, 0.22);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-sm);
	background: rgba(250, 98, 95, 0.05);
}
.callout p {
	margin: 0;
	color: var(--text);
}
.callout strong {
	color: var(--ink);
}

/* ————— Prose subheadings + extras (articles) ————— */
.prose h3 {
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--ink);
	letter-spacing: -0.01em;
	margin: 1.9rem 0 0.7rem;
}
.prose h3:first-child {
	margin-top: 0;
}
.prose blockquote {
	margin: 1.5rem 0;
	padding: 0.5rem 0 0.5rem 1.25rem;
	border-left: 3px solid var(--accent);
	color: var(--ink);
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.5;
}
.prose ol {
	margin: 0 0 1rem;
	padding-left: 1.3rem;
	color: var(--text);
}
.prose ol li {
	margin-bottom: 0.6rem;
	line-height: 1.6;
	padding-left: 0.3rem;
}

/* ————— Article cards (home + listing) ————— */
.article-list {
	display: grid;
	gap: 1.1rem;
	grid-template-columns: 1fr;
}
@media (min-width: 760px) {
	.article-list {
		grid-template-columns: repeat(2, 1fr);
	}
}
.article-card {
	display: flex;
	flex-direction: column;
	padding: 1.4rem 1.5rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	text-decoration: none;
	transition: border-color var(--dur-hover) var(--ease-hover),
		box-shadow var(--dur-hover) var(--ease-hover),
		transform var(--dur-hover) var(--ease-hover);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.article-card {
		background: var(--surface);
	}
}
.article-card:hover {
	border-color: rgba(250, 98, 95, 0.42);
	box-shadow: var(--shadow-tile);
	transform: translateY(-4px);
}
.article-card .a-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.8rem;
	align-items: center;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 800;
	color: var(--muted);
	margin-bottom: 0.75rem;
}
.article-card .a-meta .tag {
	color: var(--accent);
}
.article-card h3 {
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--ink);
	margin-bottom: 0.5rem;
}
.article-card p {
	color: var(--muted);
	font-size: 0.92rem;
	line-height: 1.55;
	margin-bottom: 1rem;
}
.article-card .a-more {
	margin-top: auto;
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--accent);
}

/* Article meta row (on article page) */
.article-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: center;
	margin-top: 1.5rem;
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 600;
}
.article-meta .sep {
	opacity: 0.45;
}

/* Compact home sub-card (setup) */
.setup-card {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
	padding: 1.6rem 1.7rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: color-mix(in srgb, var(--surface) 80%, transparent);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.setup-card {
		background: var(--surface);
	}
}
@media (min-width: 780px) {
	.setup-card {
		grid-template-columns: 1.2fr 1fr;
		align-items: center;
	}
}
.setup-card h3 {
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--ink);
	margin-bottom: 0.5rem;
	letter-spacing: -0.02em;
}
.setup-card p {
	color: var(--muted);
	font-size: 0.95rem;
	line-height: 1.6;
	margin-bottom: 1rem;
}
.setup-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 0.9rem;
}

/* ————— Expandable command reference ————— */
.cmd-explain {
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--surface) 68%, transparent);
	margin-bottom: 0.6rem;
	overflow: hidden;
	transition: border-color var(--dur-fast) var(--ease-emph);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.cmd-explain {
		background: var(--surface);
	}
}
.cmd-explain:hover {
	border-color: rgba(250, 98, 95, 0.35);
}
.cmd-explain > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.72rem 0.95rem;
	font-family: var(--mono);
	font-size: 0.8rem;
	color: var(--ink);
	overflow-x: auto;
	white-space: nowrap;
}
.cmd-explain > summary::-webkit-details-marker {
	display: none;
}
.cmd-explain > summary::before {
	content: "$";
	color: var(--accent);
	font-weight: 700;
	flex: none;
}
.cmd-explain > summary .chev {
	margin-left: auto;
	color: var(--muted);
	font-family: var(--font);
	transition: transform 0.2s var(--ease-emph);
	flex: none;
}
.cmd-explain[open] > summary {
	border-bottom: 1px solid var(--line);
	background: var(--accent-soft);
}
.cmd-explain[open] > summary .chev {
	transform: rotate(90deg);
	color: var(--accent);
}
.cmd-explain .body {
	padding: 0.9rem 0.95rem;
	color: var(--text);
	font-family: var(--font);
	font-size: 0.92rem;
	line-height: 1.62;
}
.cmd-explain .body code {
	font-size: 0.85em;
}
.cmd-group {
	margin: 1.75rem 0 0.75rem;
	font-size: 1.1rem;
	font-weight: 800;
	color: var(--ink);
	letter-spacing: -0.01em;
}
.cmd-group:first-of-type {
	margin-top: 0.5rem;
}

/* ————— Reading progress bar ————— */
.read-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 100%;
	transform: scaleX(0);
	transform-origin: 0 50%;
	background: linear-gradient(90deg, var(--accent), var(--gold));
	z-index: 60;
	pointer-events: none;
	transition: transform 0.1s linear;
}

/* ————— Heading minimap ————— */
.minimap {
	position: fixed;
	right: 1.25rem;
	top: 50%;
	transform: translateY(-50%);
	z-index: 15;
	max-height: 76vh;
	overflow: hidden auto;
	scrollbar-width: none;
}
.minimap::-webkit-scrollbar {
	display: none;
}
.minimap ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-items: flex-end;
}
.minimap a {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	text-decoration: none;
	color: var(--muted);
}
.minimap a .lbl {
	font-size: 0.72rem;
	font-weight: 600;
	white-space: nowrap;
	max-width: 0;
	overflow: hidden;
	opacity: 0;
	transform: translateX(6px);
	transition: max-width 0.25s var(--ease-emph), opacity 0.2s var(--ease-emph),
		transform 0.25s var(--ease-emph);
}
.minimap:hover a .lbl,
.minimap a.active .lbl {
	max-width: 15rem;
	opacity: 1;
	transform: none;
	background: color-mix(in srgb, var(--canvas) 82%, transparent);
	padding: 0.1rem 0.45rem;
	border-radius: 6px;
}
@supports not (color: color-mix(in srgb, white, black)) {
	.minimap:hover a .lbl,
	.minimap a.active .lbl {
		background: var(--canvas);
	}
}
.minimap a::after {
	content: "";
	display: block;
	height: 2px;
	width: 20px;
	background: currentColor;
	border-radius: 2px;
	opacity: 0.45;
	flex: none;
	transition: width 0.2s var(--ease-emph), opacity 0.2s var(--ease-emph);
}
.minimap li.mm-h3 a::after {
	width: 11px;
}
.minimap a:hover {
	color: var(--text);
}
.minimap a.active {
	color: var(--accent);
}
.minimap a.active::after {
	width: 28px;
	opacity: 1;
}
@media (max-width: 1220px) {
	.minimap {
		display: none;
	}
}

/* ————— Tables ————— */
.tbl-wrap {
	overflow-x: auto;
	margin: 1.5rem 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	-webkit-overflow-scrolling: touch;
}
table.tbl {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.87rem;
	min-width: 540px;
}
table.tbl th,
table.tbl td {
	text-align: left;
	padding: 0.7rem 0.85rem;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
	line-height: 1.5;
}
table.tbl thead th {
	color: var(--accent);
	font-size: 0.66rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	background: var(--accent-soft);
	font-weight: 800;
	white-space: nowrap;
}
table.tbl tbody tr:last-child td {
	border-bottom: none;
}
table.tbl td strong,
table.tbl th strong {
	color: var(--ink);
}
table.tbl code {
	font-size: 0.82em;
}

/* ————— Figure caption ————— */
.fig-cap {
	margin: 0.6rem 0 0;
	font-size: 0.82rem;
	color: var(--muted);
	font-style: italic;
	text-align: center;
}

/* ————— Article body: images ————— */
.prose figure {
	margin: 1.5rem 0;
}
.prose figure img {
	display: block;
	width: 100%;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
}
.prose hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 2rem 0;
}

/* ————— Embeds (video, charts, flowcharts) ————— */
.embed-wrap {
	position: relative;
	aspect-ratio: 16 / 9;
	margin: 1.5rem 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--canvas);
	overflow: hidden;
}
.embed-wrap iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ————— Code blocks (Shiki, build-time highlighted) ————— */
.code-block {
	position: relative;
	margin: 1.5rem 0;
	padding-top: 2.1rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-code);
	font-family: var(--mono);
	font-size: 0.85rem;
	line-height: 1.6;
	overflow: hidden;
}
.code-block-head {
	position: absolute;
	top: 0.75rem;
	left: 1rem;
	display: flex;
	align-items: center;
	gap: 0.6rem;
}
.code-dots {
	display: inline-flex;
	gap: 0.32rem;
}
.code-dots span {
	width: 0.6rem;
	height: 0.6rem;
	border-radius: 50%;
	opacity: 0.55;
}
.code-dots span:nth-child(1) {
	background: #ff5f56;
}
.code-dots span:nth-child(2) {
	background: #ffbd2e;
}
.code-dots span:nth-child(3) {
	background: #27c93f;
}
.code-lang {
	font-size: 0.72rem;
	color: var(--muted);
	text-transform: lowercase;
	letter-spacing: 0.02em;
}
.code-block pre {
	margin: 0;
	padding: 0 1rem 1rem;
	border: none;
	border-radius: 0;
	background: transparent !important;
	overflow-x: auto;
}
.code-block pre code {
	padding: 0;
}
.shiki,
.shiki span {
	color: var(--shiki-dark, var(--text));
	background: transparent !important;
}
html[data-theme="light"] .shiki,
html[data-theme="light"] .shiki span {
	color: var(--shiki-light, var(--text));
}

/* ————— Live, editable, runnable code examples (Compiler Explorer for C++, OneCompiler for Go) ————— */
.godbolt-embed,
.onecompiler-embed {
	margin: 1.5rem 0;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-code);
	overflow: hidden;
}
.godbolt-embed-head,
.onecompiler-embed-head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.75rem 1rem;
	font-family: var(--mono);
}
.godbolt-embed-open {
	margin-left: auto;
	color: var(--muted);
	text-decoration: none;
	font-size: 0.78rem;
	font-family: var(--font);
	transition: color var(--dur-fast) var(--ease-emph);
}
.godbolt-embed-open:hover {
	color: var(--accent);
}
.godbolt-embed-fullscreen,
.onecompiler-embed-fullscreen {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	margin-left: auto;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--muted);
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	transition: color var(--dur-fast) var(--ease-emph), background var(--dur-fast) var(--ease-emph);
}
.godbolt-embed-head .godbolt-embed-fullscreen {
	margin-left: 0; /* .godbolt-embed-open already carries the margin-left:auto push */
}
.godbolt-embed-fullscreen:hover,
.onecompiler-embed-fullscreen:hover {
	color: var(--accent);
	background: var(--accent-soft);
}
.godbolt-embed-frame,
.onecompiler-embed-frame {
	display: block;
	width: 100%;
	border: 0;
	background: var(--canvas);
}
.godbolt-embed-frame {
	height: 420px;
}
.onecompiler-embed-frame {
	height: 520px;
}
.godbolt-embed.is-fullscreen,
.godbolt-embed:fullscreen,
.godbolt-embed:-webkit-full-screen,
.onecompiler-embed.is-fullscreen,
.onecompiler-embed:fullscreen,
.onecompiler-embed:-webkit-full-screen {
	display: flex;
	flex-direction: column;
	width: 100vw;
	height: 100vh;
	margin: 0;
	border-radius: 0;
}
.godbolt-embed.is-fullscreen .godbolt-embed-frame,
.godbolt-embed:fullscreen .godbolt-embed-frame,
.godbolt-embed:-webkit-full-screen .godbolt-embed-frame,
.onecompiler-embed.is-fullscreen .onecompiler-embed-frame,
.onecompiler-embed:fullscreen .onecompiler-embed-frame,
.onecompiler-embed:-webkit-full-screen .onecompiler-embed-frame {
	flex: 1 1 auto;
	width: 100%;
	height: auto;
	min-height: 0;
}
.godbolt-embed.is-fullscreen .godbolt-embed-head,
.godbolt-embed:fullscreen .godbolt-embed-head,
.godbolt-embed:-webkit-full-screen .godbolt-embed-head,
.onecompiler-embed.is-fullscreen .onecompiler-embed-head,
.onecompiler-embed:fullscreen .onecompiler-embed-head,
.onecompiler-embed:-webkit-full-screen .onecompiler-embed-head {
	flex: 0 0 auto;
}
.onecompiler-embed noscript pre {
	margin: 0;
	padding: 1rem;
}
.godbolt-embed noscript pre {
	margin: 0;
	padding: 1rem;
}

/* ————— Article search + tag filters (hub/featured pages) ————— */
.article-search {
	margin: 1.25rem 0 1rem;
}
.article-search input {
	width: 100%;
	max-width: 28rem;
	padding: 0.7rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--ink);
	font-family: var(--font);
	font-size: 0.92rem;
}
.article-search input:focus-visible {
	outline: var(--focus-ring);
}
.tag-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.75rem;
}
.tag-chip {
	padding: 0.4rem 0.85rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	transition: border-color var(--dur-fast) var(--ease-emph), color var(--dur-fast) var(--ease-emph);
}
.tag-chip:hover {
	border-color: rgba(250, 98, 95, 0.42);
	color: var(--text);
}
.tag-chip.active {
	border-color: var(--accent);
	background: var(--accent-soft);
	color: var(--accent);
}
.search-empty {
	color: var(--muted);
	font-size: 0.92rem;
	margin: 1rem 0 1.5rem;
}

/* ————— Featured badge ————— */
.featured-badge {
	color: var(--gold);
}

/* ————— Homepage view-all / featured links ————— */
.view-all-link {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 1.25rem;
	margin-top: 1.25rem;
}
.view-all-link a {
	color: var(--accent);
	font-weight: 700;
	font-size: 0.92rem;
	text-decoration: none;
}
.view-all-link a:hover {
	text-decoration: underline;
}

/* ————— Ad slots ————— */
.ad-slot {
	margin: 1.75rem 0;
	padding: 0.75rem;
	border: 1px dashed var(--line);
	border-radius: var(--radius-sm);
	text-align: center;
}
.ad-slot-label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.65rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ————— Nested containment box ————— */
.nest {
	margin: 1.5rem 0;
	border: 2px solid rgba(250, 98, 95, 0.5);
	border-radius: 14px;
	padding: 1.1rem;
}
.nest .nlabel {
	display: block;
	font-weight: 800;
	color: var(--accent);
	font-size: 0.78rem;
	letter-spacing: 0.04em;
	margin-bottom: 0.55rem;
}
.nest p {
	color: var(--text);
	font-size: 0.87rem;
	margin: 0 0 0.4rem;
	line-height: 1.5;
}
.nest .nest {
	border-color: rgba(232, 184, 74, 0.5);
}
.nest .nest > .nlabel {
	color: var(--gold);
}
.nest .nest .nest {
	border-color: rgba(163, 154, 184, 0.55);
}
.nest .nest .nest > .nlabel {
	color: var(--muted);
}

/* ————— Ladder (levels) ————— */
.ladder {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin: 1.5rem 0;
}
.ladder .rung {
	display: flex;
	gap: 0.9rem;
	align-items: baseline;
	padding: 0.8rem 1rem;
	border: 1px solid var(--line);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--surface) 68%, transparent);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.ladder .rung {
		background: var(--surface);
	}
}
.ladder .lvl {
	font-family: var(--mono);
	font-weight: 800;
	color: var(--accent);
	flex: none;
}
.ladder .rung .rtext {
	font-size: 0.9rem;
	color: var(--text);
	line-height: 1.5;
}
.ladder .rung b {
	color: var(--ink);
}

/* ═══════════ Diagram components ═══════════ */
.dgm {
	margin: 1.75rem 0;
}
.dgm-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.3rem;
}
/* a flow: column of steps by default, row (scrollable) when --row */
.dgm-flow {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	align-items: stretch;
}
.dgm-flow--row {
	flex-direction: row;
	align-items: stretch;
	min-width: min-content;
}
.dgm-flow--row > .dgm-box {
	flex: 1 1 9rem;
	min-width: 9rem;
}
/* a node/box */
.dgm-box {
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: color-mix(in srgb, var(--surface) 78%, transparent);
	padding: 0.85rem 0.95rem;
	display: flex;
	flex-direction: column;
	gap: 0.28rem;
	transition: border-color var(--dur-fast) var(--ease-emph),
		transform var(--dur-fast) var(--ease-emph);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.dgm-box {
		background: var(--surface);
	}
}
.dgm-box:hover {
	border-color: rgba(250, 98, 95, 0.4);
	transform: translateY(-2px);
}
.dgm-box--accent {
	border-color: rgba(250, 98, 95, 0.38);
	background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
}
.dgm-box--gold {
	border-color: rgba(232, 184, 74, 0.4);
	background: color-mix(in srgb, var(--gold-soft) 45%, var(--surface));
}
@supports not (color: color-mix(in srgb, white, black)) {
	.dgm-box--accent,
	.dgm-box--gold {
		background: var(--surface);
	}
}
.dgm-box--ghost {
	border-style: dashed;
	background: transparent;
	opacity: 0.85;
}
.dgm-bt {
	font-weight: 800;
	color: var(--ink);
	font-size: 0.9rem;
	letter-spacing: -0.01em;
}
.dgm-bd {
	font-size: 0.8rem;
	color: var(--muted);
	line-height: 1.45;
}
.dgm-tag {
	font-family: var(--mono);
	font-size: 0.68rem;
	color: var(--accent);
	margin-top: 0.15rem;
}
.dgm-box--gold .dgm-tag {
	color: var(--gold);
}
/* arrow connector */
.dgm-arr {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	color: var(--accent);
	font-weight: 700;
	flex: none;
	font-size: 0.72rem;
	text-align: center;
}
.dgm-arr .ico {
	font-size: 1.15rem;
	line-height: 1;
}
.dgm-arr .lbl {
	font-family: var(--mono);
	color: var(--muted);
}
.dgm-flow--row > .dgm-arr {
	flex-direction: column;
	align-self: center;
}
/* the vertical (↓) vs horizontal (→) glyph */
.dgm-arr .v {
	display: inline;
}
.dgm-arr .h {
	display: none;
}
.dgm-flow--row > .dgm-arr .v {
	display: none;
}
.dgm-flow--row > .dgm-arr .h {
	display: inline;
}
/* a plus/merge connector */
.dgm-plus {
	text-align: center;
	color: var(--muted);
	font-weight: 800;
	font-size: 1.1rem;
	padding: 0.1rem 0;
}
/* branch: two outcome boxes */
.dgm-branch {
	display: grid;
	gap: 0.5rem;
	grid-template-columns: 1fr;
}
@media (min-width: 560px) {
	.dgm-branch--2 {
		grid-template-columns: 1fr 1fr;
	}
}
/* compare: two panels side by side */
.dgm-compare {
	display: grid;
	gap: 0.85rem;
	grid-template-columns: 1fr;
}
@media (min-width: 680px) {
	.dgm-compare {
		grid-template-columns: 1fr 1fr;
	}
}
.dgm-panel {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.1rem 1.15rem;
	background: color-mix(in srgb, var(--surface) 65%, transparent);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.dgm-panel {
		background: var(--surface);
	}
}
.dgm-panel--accent {
	border-color: rgba(250, 98, 95, 0.35);
}
.dgm-panel h4 {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 800;
	color: var(--muted);
	margin-bottom: 0.85rem;
}
.dgm-panel--accent h4 {
	color: var(--accent);
}
.dgm-mini {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.dgm-mini .m {
	padding: 0.5rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	font-size: 0.82rem;
	color: var(--text);
	background: color-mix(in srgb, var(--surface) 80%, transparent);
}
@supports not (color: color-mix(in srgb, white, black)) {
	.dgm-mini .m {
		background: var(--surface);
	}
}
.dgm-mini .m.strike {
	text-decoration: line-through;
	opacity: 0.55;
}
.dgm-mini .m.keep {
	border-color: rgba(250, 98, 95, 0.4);
	color: var(--ink);
}
.dgm-mini .sep {
	font-size: 0.7rem;
	color: var(--accent);
	font-weight: 700;
	text-align: center;
}
/* "browser page" wrapper for the islands diagram */
.dgm-page {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1rem;
	background: color-mix(in srgb, var(--surface) 55%, transparent);
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}
@supports not (color: color-mix(in srgb, white, black)) {
	.dgm-page {
		background: var(--surface);
	}
}
.dgm-static {
	padding: 0.6rem 0.8rem;
	border: 1px dashed var(--line);
	border-radius: 8px;
	font-size: 0.8rem;
	color: var(--muted);
	text-align: center;
}
.dgm-islands {
	display: grid;
	gap: 0.6rem;
	grid-template-columns: 1fr;
}
@media (min-width: 520px) {
	.dgm-islands {
		grid-template-columns: 1fr 1fr;
	}
}
.dgm-island {
	padding: 0.85rem;
	border: 1px solid rgba(250, 98, 95, 0.45);
	border-radius: 10px;
	background: var(--accent-soft);
	text-align: center;
}
.dgm-island .t {
	font-weight: 800;
	color: var(--ink);
	font-size: 0.9rem;
}
.dgm-island .s {
	font-family: var(--mono);
	font-size: 0.68rem;
	color: var(--accent);
	margin-top: 0.2rem;
}

/* Page reveal (shared) */
html.js .reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.7s var(--ease-emph), transform 0.7s var(--ease-emph);
	transition-delay: var(--d, 0s);
	will-change: opacity, transform;
}
html.js .reveal.in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html.js .reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.bg-grid,
	.bg-grid-accent,
	.hero-orbit,
	.marquee-track,
	.hero-title .accent,
	.text-accent,
	.site-logo .dot {
		animation: none !important;
	}
	html {
		scroll-behavior: auto;
	}
}

/* ————— Docs section (sidebar + content layout) ————— */
.section.docs-page {
	padding-top: 2rem;
}
.docs-layout {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
	margin-top: 0;
}
.docs-sidebar {
	position: sticky;
	top: 5.5rem;
	max-height: calc(100vh - 7rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 0.5rem;
}
.docs-sidebar-topic-title {
	margin-bottom: 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--line);
}
.docs-sidebar-topic-title a {
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;
}
.docs-sidebar ul {
	list-style: none;
}
.docs-sidebar ul ul {
	margin-left: 0.6rem;
	padding-left: 0.6rem;
	border-left: 1px solid var(--line);
}
.docs-sidebar li {
	margin: 0.1rem 0;
}
.docs-sidebar a {
	display: block;
	padding: 0.35rem 0.6rem;
	border-radius: var(--radius-sm);
	color: var(--muted);
	text-decoration: none;
	font-size: 0.92rem;
	transition: background-color var(--dur-hover) var(--ease-hover), color var(--dur-hover) var(--ease-hover);
}
.docs-sidebar a:hover {
	color: var(--text);
	background: var(--surface);
}
.docs-sidebar a.active {
	color: var(--accent);
	background: var(--accent-soft);
	font-weight: 600;
}
.docs-sidebar-toggle {
	display: none;
	width: 100%;
	margin-bottom: 1rem;
	padding: 0.6rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font-family: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}
.docs-content {
	min-width: 0;
}
.docs-content > .back-link {
	margin-bottom: 1.25rem;
}
.docs-page-head {
	margin-bottom: 1.5rem;
}
.docs-page-head h1 {
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	color: var(--ink);
	margin-top: 0.4rem;
}
@media (max-width: 860px) {
	.docs-layout {
		display: block;
	}
	.docs-sidebar-toggle {
		display: block;
	}
	.docs-sidebar {
		position: fixed;
		inset: 0 22% 0 0;
		z-index: 60;
		max-height: 100vh;
		background: var(--canvas);
		border-right: 1px solid var(--line);
		padding: 5.5rem 1.25rem 2rem;
		transform: translateX(-100%);
		transition: transform var(--dur-hover) var(--ease-emph);
	}
	.docs-sidebar.open {
		transform: translateX(0);
	}
}
