:root {
	color-scheme: light;
	--bg: #f7f9fc;
	--surface: #ffffff;
	--surface-2: #f1f5f9;
	--surface-3: #e8eef6;
	--text: #111827;
	--muted: #5b6575;
	--soft: #8993a3;
	--line: #dbe3ee;
	--line-strong: #c5d0df;
	--accent: #0f6fff;
	--accent-2: #0aa6a6;
	--accent-soft: #e8f1ff;
	--code-bg: #0e1726;
	--code-text: #e8edf6;
	--code-comment: #7f8da3;
	--code-keyword: #8fb4ff;
	--code-function: #67e8f9;
	--code-string: #a7f3d0;
	--code-number: #f9c56a;
	--code-constant: #fca5a5;
	--code-namespace: #c4b5fd;
	--code-property: #93c5fd;
	--code-punctuation: #94a3b8;
	--shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
	--sans: "Plus Jakarta Sans", "Noto Sans SC", "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0b1020;
	--surface: #111827;
	--surface-2: #172033;
	--surface-3: #1e293b;
	--text: #edf3ff;
	--muted: #a9b4c6;
	--soft: #78859a;
	--line: #263348;
	--line-strong: #35435b;
	--accent: #67a6ff;
	--accent-2: #5eead4;
	--accent-soft: rgba(103, 166, 255, 0.14);
	--code-bg: #070b14;
	--code-text: #e6edf8;
	--code-comment: #78859a;
	--code-keyword: #93c5fd;
	--code-function: #5eead4;
	--code-string: #86efac;
	--code-number: #facc15;
	--code-constant: #fda4af;
	--code-namespace: #c4b5fd;
	--code-property: #7dd3fc;
	--code-punctuation: #8492aa;
	--shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	overflow-x: hidden;
	background:
		linear-gradient(180deg, rgba(15, 111, 255, 0.055), transparent 24rem),
		var(--bg);
	color: var(--text);
	font-family: var(--sans);
	line-height: 1.62;
	letter-spacing: 0;
	transition: background-color 160ms ease, color 160ms ease;
}

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

.api-cross-link {
	color: var(--accent);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--accent) 32%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.16em;
}

.api-cross-link:hover {
	color: var(--accent-2);
	text-decoration-color: currentColor;
}

code {
	font-family: var(--mono);
	font-size: 0.91em;
	color: inherit;
}

pre {
	position: relative;
	max-width: 100%;
	margin: 0;
	overflow: auto;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--code-bg);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

pre code {
	display: block;
	width: max-content;
	min-width: 100%;
	padding: 1.05rem 1rem;
	color: var(--code-text);
	font-size: 0.82rem;
	line-height: 1.68;
	white-space: pre;
}

.code-token {
	color: var(--code-text);
}

.token-comment {
	color: var(--code-comment);
	font-style: italic;
}

.token-keyword {
	color: var(--code-keyword);
	font-weight: 700;
}

.token-function {
	color: var(--code-function);
}

.token-string {
	color: var(--code-string);
}

.token-number {
	color: var(--code-number);
}

.token-constant {
	color: var(--code-constant);
	font-weight: 700;
}

.token-namespace {
	color: var(--code-namespace);
	font-weight: 800;
}

.token-builtin,
.token-property {
	color: var(--code-property);
}

.token-punctuation {
	color: var(--code-punctuation);
}

button,
input {
	font: inherit;
}

.page-shell {
	display: grid;
	grid-template-columns: 17rem minmax(0, 1fr);
	min-height: 100vh;
}

.topbar {
	position: sticky;
	top: 0;
	z-index: 30;
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 17rem minmax(14rem, 1fr) auto auto;
	align-items: center;
	gap: 0.85rem;
	height: 4.35rem;
	padding: 0 1.3rem;
	border-bottom: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: blur(18px);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.brand-mark {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 8px;
	background: var(--accent);
	color: #fff;
	font-family: var(--mono);
	font-weight: 800;
	box-shadow: 0 12px 24px rgba(15, 111, 255, 0.24);
}

.brand-title,
.brand-subtitle {
	display: block;
	white-space: nowrap;
}

.brand-title {
	font-weight: 800;
	line-height: 1;
}

.brand-subtitle {
	color: var(--muted);
	font-size: 0.78rem;
}

.search {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 0.75rem;
	width: min(100%, 45rem);
	min-width: 0;
	height: 2.5rem;
	padding: 0 0.8rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface-2);
}

.search-label {
	color: var(--accent);
	font-size: 0.72rem;
	font-weight: 800;
	text-transform: uppercase;
}

.search input {
	width: 100%;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--text);
}

.search input::placeholder {
	color: var(--soft);
}

.search-panel {
	position: absolute;
	top: calc(100% + 0.55rem);
	left: 0;
	z-index: 60;
	display: grid;
	gap: 0.45rem;
	width: min(45rem, calc(100vw - 2rem));
	max-height: min(34rem, calc(100vh - 7rem));
	overflow: auto;
	padding: 0.55rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: color-mix(in srgb, var(--surface) 96%, transparent);
	box-shadow: var(--shadow);
	backdrop-filter: blur(18px);
}

.search-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.2rem 0.35rem 0.45rem;
	border-bottom: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.76rem;
	font-weight: 800;
	text-transform: uppercase;
}

.search-panel-head span:last-child {
	color: var(--soft);
	font-weight: 700;
	text-transform: none;
}

.search-results-list {
	display: grid;
	gap: 0.25rem;
}

.search-result,
.search-empty {
	display: grid;
	gap: 0.18rem;
	padding: 0.62rem 0.68rem;
	border-radius: 8px;
}

.search-result {
	border: 1px solid transparent;
	color: var(--text);
}

.search-result:hover,
.search-result.first {
	border-color: var(--line);
	background: var(--surface-2);
}

.search-result-meta {
	color: var(--accent);
	font-size: 0.68rem;
	font-weight: 800;
	text-transform: uppercase;
}

.search-result strong {
	font-size: 0.93rem;
	line-height: 1.25;
}

.search-result-body,
.search-empty {
	color: var(--muted);
	font-size: 0.82rem;
	line-height: 1.45;
}

mark {
	padding: 0 0.08rem;
	border-radius: 3px;
	background: color-mix(in srgb, var(--accent) 18%, transparent);
	color: inherit;
}

.header-controls {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	justify-self: end;
}

.segmented {
	display: inline-flex;
	align-items: center;
	height: 2.35rem;
	padding: 0.18rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface-2);
}

.segmented-button,
.menu-button,
.copy-button {
	border: 0;
	cursor: pointer;
}

.segmented-button {
	height: 1.9rem;
	min-width: 3.1rem;
	padding: 0 0.7rem;
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 800;
}

.segmented-button.active {
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
}

:root[data-theme="dark"] .segmented-button.active {
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.menu-button {
	display: none;
	justify-self: end;
	height: 2.35rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	padding: 0 0.9rem;
	font-weight: 800;
}

.sidebar {
	position: sticky;
	top: 4.35rem;
	align-self: start;
	height: calc(100vh - 4.35rem);
	padding: 1.25rem 1rem 2rem;
	border-right: 1px solid var(--line);
	background: color-mix(in srgb, var(--surface) 72%, transparent);
	overflow: auto;
}

.sidebar nav {
	display: grid;
	gap: 0.55rem;
}

.sidebar a {
	display: block;
	padding: 0.5rem 0.72rem;
	border-radius: 8px;
	color: var(--muted);
	font-size: 0.91rem;
	font-weight: 700;
}

.sidebar a:hover,
.sidebar a.active {
	background: var(--accent-soft);
	color: var(--accent);
}

.outline-title {
	padding: 0 0.72rem 0.25rem;
	color: var(--soft);
	font-size: 0.68rem;
	font-weight: 800;
	text-transform: uppercase;
}

.outline-group {
	display: grid;
	gap: 0.12rem;
}

.outline-children {
	display: grid;
	gap: 0.08rem;
	margin: 0.05rem 0 0.18rem;
	padding-left: 0.55rem;
	border-left: 1px solid var(--line);
}

.sidebar a.outline-link {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sidebar a.outline-link-top {
	color: var(--text);
	font-size: 0.9rem;
}

.sidebar a.outline-link-l3 {
	padding-block: 0.34rem;
	color: var(--muted);
	font-size: 0.79rem;
	font-weight: 700;
}

.sidebar a.outline-link-l4 {
	padding-block: 0.27rem;
	padding-left: 1rem;
	color: var(--soft);
	font-family: var(--mono);
	font-size: 0.72rem;
	font-weight: 700;
}

.content {
	width: min(100%, 84rem);
	min-width: 0;
	padding: 2.1rem clamp(1rem, 3.2vw, 3.2rem) 6rem;
}

.hero {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(23rem, 37rem);
	gap: clamp(1.6rem, 4vw, 4.5rem);
	align-items: center;
	min-height: calc(100vh - 6.45rem);
	min-height: calc(100svh - 6.45rem);
	padding-bottom: 1.4rem;
	border-bottom: 1px solid var(--line);
}

.hero-copy,
.doc-section,
.section-heading,
.hero-visual {
	min-width: 0;
}

.eyebrow {
	margin: 0 0 0.72rem;
	color: var(--accent);
	font-size: 0.77rem;
	font-weight: 800;
	text-transform: uppercase;
}

h1,
h2,
h3 {
	margin: 0;
	line-height: 1.08;
	letter-spacing: 0;
}

h1 {
	max-width: 11ch;
	font-size: clamp(3.25rem, 6.2vw, 5.85rem);
	font-weight: 800;
	overflow-wrap: normal;
}

h2 {
	font-size: clamp(2.05rem, 3.8vw, 3.9rem);
	font-weight: 800;
}

h3 {
	font-size: 1.03rem;
	font-weight: 800;
}

p {
	margin: 0;
}

.lede {
	max-width: 45rem;
	margin-top: 1.15rem;
	color: var(--muted);
	font-size: clamp(1.06rem, 1.8vw, 1.3rem);
}

.signal-row,
.barrier-strip,
.token-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.signal-row {
	margin-top: 1.5rem;
}

.signal-row span,
.barrier-strip span,
.token-list code {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: 0.36rem 0.66rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font-size: 0.84rem;
	box-shadow: 0 5px 18px rgba(15, 23, 42, 0.04);
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-top: 1.65rem;
}

.hero-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.55rem;
	padding: 0.52rem 0.9rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.9rem;
	font-weight: 800;
}

.hero-action.primary {
	border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
	background: var(--accent);
	color: #fff;
	box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 24%, transparent);
}

.hero-action:hover {
	border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
	color: var(--accent);
}

.hero-action.primary:hover {
	color: #fff;
}

.hero-proof {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.6rem;
	max-width: 44rem;
	margin-top: 1.65rem;
}

.hero-proof div {
	min-width: 0;
	padding: 0.72rem 0.78rem;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: color-mix(in srgb, var(--surface) 86%, transparent);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.hero-proof strong {
	display: block;
	color: var(--text);
	font-family: var(--mono);
	font-size: 0.9rem;
	line-height: 1.15;
}

.hero-proof span {
	display: block;
	margin-top: 0.18rem;
	color: var(--muted);
	font-size: 0.76rem;
	font-weight: 700;
	line-height: 1.35;
}

.renderer-stage {
	border: 1px solid var(--line);
	border-radius: 18px;
	background: var(--surface);
	box-shadow: var(--shadow), inset 0 1px 0 color-mix(in srgb, #fff 58%, transparent);
	overflow: hidden;
}

.stage-chrome {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--line);
	background: var(--surface-2);
	color: var(--muted);
	font-family: var(--mono);
	font-size: 0.72rem;
	text-transform: uppercase;
}

.stage-surface {
	position: relative;
	display: grid;
	gap: 0.9rem;
	padding: 1rem;
	background:
		linear-gradient(90deg, color-mix(in srgb, var(--line) 42%, transparent) 1px, transparent 1px),
		linear-gradient(0deg, color-mix(in srgb, var(--line) 34%, transparent) 1px, transparent 1px),
		var(--surface);
	background-size: 34px 34px;
}

.stage-surface::before {
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 74% 12%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 18rem);
	content: "";
	pointer-events: none;
}

.stage-surface > * {
	position: relative;
}

.stage-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.12fr) minmax(12rem, 0.88fr);
	gap: 0.85rem;
}

.hud-panel {
	position: relative;
	display: grid;
	gap: 0.8rem;
	min-width: 0;
	padding: 0.9rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: color-mix(in srgb, var(--surface) 82%, var(--surface-2));
	box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 42%, transparent);
}

.player-panel {
	grid-column: 1 / -1;
	padding: 1rem;
}

.hud-topline,
.player-unit,
.ring-panel,
.mask-panel,
.stage-api-strip {
	display: flex;
	align-items: center;
}

.hud-topline {
	justify-content: space-between;
	gap: 0.8rem;
	color: var(--soft);
	font-family: var(--mono);
	font-size: 0.72rem;
	text-transform: uppercase;
}

.player-unit {
	gap: 0.9rem;
}

.player-unit strong,
.ring-panel strong,
.mask-panel strong {
	display: block;
	color: var(--text);
	font-size: 1rem;
	line-height: 1.2;
}

.player-unit small,
.ring-panel small,
.mask-panel small {
	display: block;
	margin-top: 0.18rem;
	color: var(--muted);
	font-size: 0.82rem;
	line-height: 1.35;
}

.avatar-mask {
	flex: 0 0 auto;
	width: 3.4rem;
	height: 3.4rem;
	border: 2px solid color-mix(in srgb, var(--accent) 38%, var(--surface));
	border-radius: 999px;
	background:
		radial-gradient(circle at 45% 36%, #ffe1b5 0 18%, transparent 19%),
		radial-gradient(circle at 50% 76%, #6ee7b7 0 24%, transparent 25%),
		linear-gradient(145deg, #1b5fc9, #1e293b 52%, #0aa6a6);
	box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 10%, transparent), 0 10px 24px rgba(15, 23, 42, 0.15);
}

.health-track,
.mini-bars span {
	overflow: hidden;
	border-radius: 999px;
	background: var(--surface-3);
}

.health-track {
	height: 0.7rem;
}

.health-track span,
.mini-bars span::before {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #0f6fff, #0aa6a6 72%, #67d391);
}

.health-track span {
	width: 72%;
}

.mini-bars {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.45rem;
}

.mini-bars span {
	height: 0.42rem;
}

.mini-bars span::before {
	width: var(--value);
	content: "";
}

.ring-panel {
	justify-content: center;
	gap: 0.85rem;
	min-height: 10rem;
}

.ring-meter {
	position: relative;
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 5.9rem;
	height: 5.9rem;
	border-radius: 999px;
	background:
		radial-gradient(circle, var(--surface) 0 53%, transparent 54%),
		conic-gradient(from -90deg, #0f6fff 0 var(--progress), color-mix(in srgb, var(--line-strong) 70%, transparent) var(--progress) 360deg);
	box-shadow: inset 0 0 0 1px var(--line), 0 12px 26px rgba(15, 23, 42, 0.08);
}

.ring-meter::after {
	position: absolute;
	inset: 0.55rem;
	border: 1px solid color-mix(in srgb, var(--accent-2) 34%, transparent);
	border-radius: inherit;
	content: "";
}

.ring-meter span {
	color: var(--text);
	font-family: var(--mono);
	font-size: 1.15rem;
	font-weight: 800;
}

.mask-panel {
	flex-wrap: wrap;
	gap: 0.68rem;
}

.mask-tile {
	display: block;
	width: 3.2rem;
	height: 3.2rem;
	border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
	background:
		linear-gradient(135deg, rgba(15, 111, 255, 0.72), rgba(10, 166, 166, 0.72)),
		repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 4px, transparent 4px 9px);
}

.mask-tile.rounded {
	border-radius: 12px;
}

.mask-tile.chamfer {
	clip-path: polygon(16% 0, 100% 0, 100% 84%, 84% 100%, 0 100%, 0 16%);
}

.mask-tile.circle {
	border-radius: 999px;
}

.stage-api-strip {
	flex-wrap: wrap;
	gap: 0.45rem;
	padding-top: 0.05rem;
}

.stage-api-strip code {
	padding: 0.34rem 0.48rem;
	border: 1px solid var(--line);
	border-radius: 7px;
	background: var(--surface-2);
	font-size: 0.76rem;
}

.stage-stack {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 1px;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--line);
}

.stage-stack span {
	min-width: 0;
	padding: 0.45rem 0.2rem;
	background: color-mix(in srgb, var(--surface) 84%, var(--surface-2));
	color: var(--muted);
	font-family: var(--mono);
	font-size: 0.68rem;
	font-weight: 800;
	text-align: center;
	text-transform: uppercase;
}

.stage-stack span:nth-child(4),
.stage-stack span:nth-child(5) {
	color: var(--accent);
}

.api-table code,
.module-map code,
.token-list code,
.stage-api-strip code {
	color: var(--text);
}

.doc-section {
	padding: clamp(3rem, 6.2vw, 5.4rem) 0;
	border-bottom: 1px solid var(--line);
	scroll-margin-top: 5.35rem;
}

.comparison-section {
	padding-top: clamp(2.6rem, 5vw, 4.4rem);
}

.comparison-layout {
	display: grid;
	grid-template-columns: minmax(0, 0.92fr) minmax(22rem, 1.08fr);
	gap: clamp(1rem, 3vw, 2rem);
	align-items: stretch;
}

.comparison-copy {
	align-self: center;
	min-width: 0;
}

.comparison-copy h2 {
	font-size: clamp(2.15rem, 4.2vw, 4rem);
}

.comparison-copy p:not(.eyebrow) {
	margin-top: 1rem;
	color: var(--muted);
	font-size: 1.03rem;
}

.comparison-pill-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.55rem;
	margin-top: 1.2rem;
}

.comparison-pill-grid span {
	min-width: 0;
	padding: 0.62rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--muted);
	font-size: 0.84rem;
	font-weight: 700;
}

.comparison-board {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.8rem;
	min-width: 0;
	padding: 0.9rem;
	border: 1px solid var(--line);
	border-radius: 16px;
	background:
		linear-gradient(90deg, transparent calc(50% - 1px), var(--line) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
		var(--surface);
	box-shadow: var(--shadow);
}

.compare-output {
	position: relative;
	display: grid;
	align-content: start;
	gap: 0.7rem;
	min-width: 0;
	padding: 0.85rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface-2);
}

.vanilla-output {
	filter: saturate(0.78);
}

.mgfx-output {
	border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 74%, transparent), transparent 8rem),
		var(--surface-2);
}

.compare-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.7rem;
	color: var(--text);
	font-size: 0.82rem;
	font-weight: 800;
}

.compare-label small {
	color: var(--soft);
	font-family: var(--mono);
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
}

.vanilla-card,
.mgfx-card-preview {
	min-height: 12.2rem;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
}

.vanilla-card {
	display: grid;
	grid-template-columns: 3.1rem minmax(0, 1fr);
	grid-template-rows: auto auto 1fr;
	gap: 0.65rem 0.75rem;
	align-content: center;
	padding: 1rem;
}

.vanilla-card::after {
	grid-column: 1 / -1;
	align-self: start;
	width: 4.4rem;
	height: 0.5rem;
	border-radius: 999px;
	background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 13px);
	content: "";
	opacity: 0.7;
}

.vanilla-avatar {
	grid-row: 1 / 3;
	width: 3.1rem;
	height: 3.1rem;
	border-radius: 6px;
	background: var(--surface-3);
	box-shadow: inset 0 0 0 1px var(--line);
}

.vanilla-line,
.vanilla-bar {
	display: block;
	height: 0.62rem;
	border-radius: 999px;
	background: var(--line-strong);
}

.vanilla-line {
	width: 58%;
}

.vanilla-line.wide {
	width: 82%;
}

.vanilla-bar {
	grid-column: 1 / -1;
	align-self: end;
	height: 0.74rem;
	background: linear-gradient(90deg, var(--line-strong) 0 64%, var(--surface-3) 64%);
}

.mgfx-card-preview {
	position: relative;
	display: grid;
	grid-template-columns: 4.2rem minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	gap: 0.85rem;
	align-items: center;
	padding: 1rem;
	overflow: hidden;
}

.mgfx-card-preview::before {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 10rem),
		repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 11%, transparent) 0 6px, transparent 6px 14px);
	content: "";
	opacity: 0.7;
	pointer-events: none;
}

.mgfx-card-preview > * {
	position: relative;
}

.mgfx-avatar {
	width: 4.2rem;
	height: 4.2rem;
	border: 2px solid color-mix(in srgb, var(--accent-2) 48%, var(--surface));
	border-radius: 999px;
	background:
		radial-gradient(circle at 48% 36%, #ffdcaa 0 17%, transparent 18%),
		radial-gradient(circle at 50% 75%, #6ee7b7 0 24%, transparent 25%),
		linear-gradient(145deg, #0f6fff, #111827 54%, #0aa6a6);
	box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 11%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 25%, transparent);
}

.mgfx-card-preview strong {
	display: block;
	color: var(--text);
	font-size: 1rem;
}

.mgfx-card-preview small {
	display: block;
	margin-top: 0.2rem;
	color: var(--muted);
	font-size: 0.82rem;
}

.mgfx-preview-bar {
	grid-column: 1 / -1;
	align-self: end;
	height: 0.78rem;
	overflow: hidden;
	border-radius: 999px;
	background: var(--surface-3);
}

.mgfx-preview-bar span {
	display: block;
	width: 76%;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #0f6fff, #0aa6a6 70%, #67d391);
	box-shadow: 0 0 18px color-mix(in srgb, var(--accent-2) 28%, transparent);
}

.compare-code-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem;
	margin-top: 1rem;
}

.compare-code-grid article {
	display: grid;
	grid-template-rows: auto auto;
	align-content: start;
	gap: 0.7rem;
	min-width: 0;
	padding: 0.85rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.compare-code-grid h3 {
	font-size: 0.94rem;
}

.comparison-table {
	display: grid;
	margin-top: 1rem;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.comparison-table > div {
	display: grid;
	grid-template-columns: minmax(9rem, 0.62fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: 1rem;
	padding: 0.88rem 1rem;
	border-bottom: 1px solid var(--line);
}

.comparison-table > .comparison-table-head {
	padding-block: 0.68rem;
	background: var(--surface-2);
}

.comparison-table > div:last-child {
	border-bottom: 0;
}

.comparison-table strong {
	color: var(--text);
	font-size: 0.92rem;
}

.comparison-table-head strong {
	color: var(--muted);
	font-family: var(--mono);
	font-size: 0.72rem;
	text-transform: uppercase;
}

.comparison-table span {
	color: var(--muted);
	font-size: 0.9rem;
	line-height: 1.5;
}

.section-heading {
	max-width: 58rem;
	margin-bottom: 1.55rem;
}

.section-heading p:not(.eyebrow) {
	margin-top: 0.9rem;
	color: var(--muted);
	font-size: 1rem;
}

.note-grid,
.family-grid,
.text-model,
.ops-grid,
.trouble-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.9rem;
	margin-top: 1rem;
}

.family-grid,
.trouble-list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.note-card,
.family-card,
.text-model article,
.ops-grid article,
.trouble-list article,
.recipe,
.style-columns article,
.split article {
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	padding: 1rem;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.note-card p,
.family-card p,
.text-model p,
.trouble-list p,
.recipe p,
.split p {
	margin-top: 0.45rem;
	color: var(--muted);
	font-size: 0.94rem;
}

.principle-list {
	display: grid;
	gap: 0.7rem;
}

.principle {
	display: grid;
	grid-template-columns: 3rem minmax(0, 1fr);
	gap: 1rem;
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.index {
	color: var(--accent);
	font-family: var(--mono);
	font-weight: 800;
}

.principle p {
	margin-top: 0.35rem;
	color: var(--muted);
}

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

.recipe {
	display: grid;
	gap: 0.8rem;
	align-content: start;
}

.api-group {
	margin-top: 2rem;
}

.api-group h3 {
	margin-bottom: 0.7rem;
	color: var(--accent);
}

.api-table,
.module-map {
	display: grid;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.api-table > div,
.module-map > div {
	display: grid;
	grid-template-columns: minmax(16rem, 28rem) minmax(0, 1fr);
	gap: 1rem;
	padding: 0.9rem 1rem;
	border-bottom: 1px solid var(--line);
}

.api-table > div:last-child,
.module-map > div:last-child {
	border-bottom: 0;
}

.api-table span,
.module-map span {
	color: var(--muted);
}

.api-deep-dive {
	margin-top: 2.4rem;
}

.api-reference-details {
	margin-top: 2.6rem;
}

.compact-heading {
	margin-top: 0;
	margin-bottom: 1rem;
}

.compact-heading h3 {
	font-size: clamp(1.35rem, 2.2vw, 2rem);
	color: var(--text);
}

.api-detail-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin-top: 1rem;
}

.detail-card,
.mask-reference {
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.detail-card {
	display: grid;
	align-content: start;
	gap: 0.9rem;
	padding: 1rem;
}

.detail-card h3,
.mask-reference h3 {
	color: var(--text);
}

.detail-card p,
.mask-reference p,
.field-list span,
.spec-table span {
	color: var(--muted);
	font-size: 0.94rem;
}

.field-list {
	display: grid;
	gap: 0.55rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.field-list li {
	display: grid;
	grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr);
	gap: 0.75rem;
	align-items: start;
}

.field-list code,
.spec-table code,
.spec-table strong {
	color: var(--text);
}

.spec-table {
	display: grid;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface-2);
}

.spec-table > div {
	display: grid;
	grid-template-columns: minmax(8rem, 13rem) minmax(0, 1fr);
	gap: 0.85rem;
	padding: 0.85rem 0.9rem;
	border-bottom: 1px solid var(--line);
}

.spec-table > div:last-child {
	border-bottom: 0;
}

.compact-spec {
	margin-top: 0.1rem;
}

.mask-reference {
	display: grid;
	gap: 1rem;
	margin-top: 1rem;
	padding: 1rem;
}

.mask-kind-table {
	background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.example-stack {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}

.example-stack article {
	display: grid;
	gap: 0.65rem;
	min-width: 0;
}

h4 {
	margin: 0;
	color: var(--text);
	font-size: 0.86rem;
	font-weight: 800;
	line-height: 1.25;
}

.api-detail-mount {
	display: grid;
	gap: 1.35rem;
}

.api-family-detail {
	display: grid;
	gap: 0.85rem;
}

.api-family-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--line);
}

.api-family-heading h3 {
	color: var(--accent);
	font-size: 1.05rem;
}

.api-family-heading span {
	display: grid;
	place-items: center;
	min-width: 2rem;
	height: 2rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--muted);
	font-family: var(--mono);
	font-size: 0.78rem;
	font-weight: 800;
}

.api-entry {
	display: grid;
	gap: 0.95rem;
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
	scroll-margin-top: 5.35rem;
}

.api-entry-head {
	display: grid;
	gap: 0.45rem;
}

.api-entry-head h4 {
	font-size: 1.06rem;
}

.api-entry-head > code {
	display: block;
	width: fit-content;
	max-width: 100%;
	overflow-wrap: anywhere;
	padding: 0.38rem 0.55rem;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface-2);
	color: var(--text);
	font-size: 0.82rem;
}

.api-entry-head p {
	color: var(--muted);
	font-size: 0.95rem;
}

.api-entry-block {
	display: grid;
	gap: 0.55rem;
}

.api-param-list {
	display: grid;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface-2);
}

.api-param-list > div {
	display: grid;
	grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr);
	gap: 0.85rem;
	padding: 0.72rem 0.85rem;
	border-bottom: 1px solid var(--line);
}

.api-param-list > div:last-child {
	border-bottom: 0;
}

.api-param-list span,
.api-note-list {
	color: var(--muted);
	font-size: 0.92rem;
}

.api-param-list code {
	color: var(--text);
	overflow-wrap: anywhere;
}

.api-note-list {
	margin: 0;
	padding-left: 1.1rem;
}

.api-note-list li + li {
	margin-top: 0.35rem;
}

.api-detail-block {
	gap: 0.75rem;
}

.api-detail-table-group {
	display: grid;
	gap: 0.42rem;
}

.api-detail-table-group h5 {
	margin: 0;
	color: var(--text);
	font-size: 0.86rem;
	font-weight: 800;
}

.api-detail-table-wrap {
	overflow: auto;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface-2);
}

.api-detail-table {
	width: 100%;
	min-width: 44rem;
	border-collapse: collapse;
}

.api-detail-table th,
.api-detail-table td {
	padding: 0.68rem 0.78rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
	font-size: 0.88rem;
	line-height: 1.48;
}

.api-detail-table th {
	color: var(--soft);
	font-size: 0.72rem;
	font-weight: 800;
	text-transform: uppercase;
	white-space: nowrap;
}

.api-detail-table tr:last-child td {
	border-bottom: 0;
}

.api-detail-table td {
	color: var(--muted);
}

.api-detail-table td code {
	display: inline-block;
	margin-right: 0.28rem;
	color: var(--text);
	overflow-wrap: anywhere;
}

.api-detail-table td span {
	display: inline;
}

.style-columns,
.split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.split article {
	display: grid;
	gap: 1rem;
	align-content: start;
	padding: clamp(1rem, 2.2vw, 1.5rem);
}

.split article h3 {
	line-height: 1.22;
}

.split article > p,
.split article > .compact-list {
	margin-top: 0;
}

.split article > pre {
	margin-top: 0;
}

.style-columns article {
	display: grid;
	gap: 0.8rem;
	align-content: start;
}

.compact-list {
	margin: 0.7rem 0 0;
	padding-left: 1.1rem;
	color: var(--muted);
}

.compact-list li + li {
	margin-top: 0.45rem;
}

.barrier-strip {
	margin-top: 1rem;
}

.timeline {
	display: grid;
	gap: 0.7rem;
}

.timeline div {
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr);
	gap: 0.85rem;
	align-items: start;
	padding: 1rem;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.timeline span {
	display: grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent);
	font-family: var(--mono);
	font-weight: 800;
}

.timeline p {
	padding-top: 0.08rem;
	color: var(--muted);
}

.text-model {
	margin-top: 1.2rem;
}

.callout {
	margin-top: 1rem;
	padding: 1rem;
	border: 1px solid var(--line);
	border-left: 4px solid var(--accent-2);
	border-radius: 12px;
	background: var(--surface);
	color: var(--muted);
}

.callout strong {
	color: var(--text);
}

.ops-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.token-list {
	margin-top: 0.8rem;
}

.copy-button {
	position: absolute;
	top: 0.55rem;
	right: 0.55rem;
	height: 2rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.10);
	color: #fff;
	font-size: 0.74rem;
	font-weight: 800;
	padding: 0 0.7rem;
}

.copy-button:hover,
.menu-button:hover,
.segmented-button:hover {
	filter: brightness(0.98);
}

.is-hidden {
	display: none !important;
}

.no-results {
	margin-top: 1rem;
	padding: 1rem;
	border: 1px dashed var(--line-strong);
	border-radius: 12px;
	color: var(--muted);
	background: var(--surface);
}

@media (max-width: 1180px) {
	.topbar {
		grid-template-columns: 15rem minmax(10rem, 1fr) auto auto;
	}

	.header-controls {
		gap: 0.4rem;
	}
}

@media (max-width: 1040px) {
	.page-shell {
		grid-template-columns: minmax(0, 1fr);
	}

	.topbar {
		grid-template-columns: auto minmax(0, 1fr) auto auto;
	}

	.sidebar {
		position: fixed;
		top: 4.35rem;
		left: 0;
		z-index: 25;
		width: min(19rem, calc(100vw - 2rem));
		transform: translateX(-105%);
		transition: transform 160ms ease;
		box-shadow: var(--shadow);
	}

	.sidebar.open {
		transform: translateX(0);
	}

	.menu-button {
		display: inline-flex;
		align-items: center;
	}

	.content {
		width: 100%;
	}

	.hero {
		grid-template-columns: minmax(0, 1fr);
		min-height: auto;
	}

	.comparison-layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 820px) {
	.topbar {
		height: auto;
		min-height: 4.35rem;
		grid-template-columns: minmax(0, 1fr) auto;
		padding: 0.75rem 1rem;
	}

	.brand {
		grid-column: 1;
		grid-row: 1;
	}

	.menu-button {
		grid-column: 2;
		grid-row: 1;
	}

	.search {
		grid-column: 1 / -1;
		grid-row: 2;
		width: 100%;
	}

	.header-controls {
		grid-column: 1 / -1;
		grid-row: 3;
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		justify-self: stretch;
		width: 100%;
	}

	.segmented {
		min-width: 0;
	}

	.segmented-button {
		min-width: 0;
		flex: 1;
	}

	.sidebar {
		top: 10.45rem;
		height: calc(100vh - 10.45rem);
	}

	.content {
		width: 100%;
		max-width: 100vw;
		padding: 1.25rem 1rem 4rem;
	}

	.hero,
	.doc-section {
		max-width: 100%;
	}

	h1 {
		max-width: 11ch;
		font-size: clamp(2.75rem, 12.5vw, 3.55rem);
	}

	h2 {
		font-size: clamp(2rem, 10vw, 3rem);
	}

	.signal-row {
		display: none;
	}

	.stage-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.62rem;
	}

	.stage-surface {
		gap: 0.65rem;
		padding: 0.72rem;
	}

	.player-panel {
		grid-column: 1 / -1;
	}

	.hud-panel {
		padding: 0.72rem;
	}

	.ring-panel {
		flex-direction: column;
		gap: 0.48rem;
		min-height: 8.3rem;
		text-align: center;
	}

	.ring-meter {
		width: 4.45rem;
		height: 4.45rem;
	}

	.mask-panel {
		align-content: start;
		gap: 0.45rem;
		min-height: 8.3rem;
	}

	.mask-tile {
		width: 2.3rem;
		height: 2.3rem;
	}

	.barrier-strip span,
	.token-list code {
		width: 100%;
	}

	.hero-actions {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
	}

	.hero-action {
		width: 100%;
		padding-inline: 0.65rem;
		font-size: 0.86rem;
	}

	.note-grid,
	.family-grid,
	.comparison-layout,
	.comparison-board,
	.compare-code-grid,
	.recipe-grid,
	.api-detail-grid,
	.example-stack,
	.style-columns,
	.split,
	.text-model,
	.ops-grid,
	.trouble-list {
		grid-template-columns: 1fr;
	}

	.api-table > div,
	.comparison-table > div,
	.field-list li,
	.spec-table > div,
	.api-param-list > div,
	.module-map > div {
		grid-template-columns: 1fr;
		gap: 0.35rem;
	}

	.comparison-pill-grid {
		grid-template-columns: 1fr;
	}

	.vanilla-card,
	.mgfx-card-preview {
		min-height: 10rem;
	}

	.api-entry {
		padding: 0.9rem;
	}

	.api-entry-head > code {
		width: 100%;
	}

	pre code {
		font-size: 0.78rem;
	}
}
