/* The documentation hub: a reading page in the suite's palette (tokens come from ../themes.css). */
:root {
	--font-ui: 'Segoe UI Variable Text', 'Segoe UI', system-ui, Arial, sans-serif;
	--font-display: 'Segoe UI Variable Display', 'Segoe UI', system-ui, Arial, sans-serif;
	--font-mono: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace;
	--radius: 4px;
	--radius-panel: 8px;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--press: 0.12s;
	--fast: 0.2s;
	--open: 0.32s;
	--enter: 0.65s;
	font-family: var(--font-ui);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	background: var(--canvas);
	color: var(--text);
}
a {
	color: var(--accent-ink);
}
h1,
h2,
h3 {
	font-family: var(--font-display);
	font-weight: 600;
	color: var(--ink-strong);
	margin: 0;
	letter-spacing: -0.02em;
}
code {
	font-family: var(--font-mono);
	font-size: 0.86em;
}

/* Header */
.hub-header {
	position: sticky;
	top: 0;
	z-index: 2;
	height: 56px;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 0 clamp(16px, 4vw, 40px);
	background: color-mix(in srgb, var(--canvas) 92%, transparent);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.hub-brand {
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--ink-strong);
	text-decoration: none;
	font-family: var(--font-display);
	font-size: 15px;
	font-weight: 500;
}
.hub-brand strong {
	font-weight: 700;
	margin-left: -5px;
}
.brand-symbol {
	width: 20px;
	height: 20px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2px;
	padding: 3px;
	background: var(--blue);
	border-radius: 3px;
}
.brand-symbol i {
	background: #fff;
	border-radius: 1px;
}
.brand-symbol i:nth-child(2) {
	opacity: 0.45;
}
.brand-symbol i:nth-child(3) {
	opacity: 0.7;
}
.hub-nav {
	display: flex;
	gap: 2px;
	margin-left: 10px;
}
.hub-nav a {
	color: var(--muted);
	text-decoration: none;
	font-size: 13px;
	padding: 6px 10px;
	border-radius: var(--radius);
	transition:
		background-color var(--fast),
		color var(--fast);
}
.hub-nav a:hover {
	color: var(--text);
	background: var(--hover);
}
.hub-icon {
	margin-left: auto;
	width: 34px;
	height: 34px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: var(--radius);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}
.hub-icon:hover {
	background: var(--hover);
	color: var(--text);
}
.hub-icon svg {
	width: 18px;
	height: 18px;
}
.hub-primary {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	height: 34px;
	padding: 0 14px;
	border-radius: var(--radius);
	background: var(--blue);
	color: var(--accent-fg);
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.hub-icon + .hub-primary {
	margin-left: 0;
}
.hub-primary:hover {
	filter: brightness(0.92);
}
.hub-icon:focus-visible,
.hub-primary:focus-visible,
.hub-nav a:focus-visible,
.hub-card:focus-visible,
.hub-brand:focus-visible {
	outline: 2px solid var(--blue);
	outline-offset: 2px;
}

/* Page */
.hub {
	max-width: 1180px;
	margin: 0 auto;
	overflow: clip;
	padding: clamp(40px, 7vw, 80px) clamp(16px, 4vw, 40px) 40px;
}
.hub-intro {
	position: relative;
	isolation: isolate;
}
.rings {
	position: absolute;
	z-index: -1;
	fill: none;
	stroke: var(--line);
	stroke-width: 0.22;
	overflow: visible;
	pointer-events: none;
}
.rings circle:nth-child(1) {
	stroke: var(--blue);
	opacity: 0.45;
	stroke-dasharray: 0.6 1.6;
}
.rings circle:nth-child(3) {
	stroke-dasharray: 0.4 1.2;
}
.rings--hub {
	width: 520px;
	height: 520px;
	right: -60px;
	top: -200px;
	opacity: 0.8;
}
@media (prefers-reduced-motion: no-preference) {
	.rings circle {
		transform-origin: 50% 50%;
		transform: rotate(-90deg);
		animation: ring-draw 1.4s var(--ease) both;
	}
	.rings circle:nth-child(2) {
		animation-delay: 0.1s;
	}
	.rings circle:nth-child(3) {
		animation-delay: 0.2s;
	}
	.rings circle:nth-child(1) {
		animation:
			ring-draw 1.4s var(--ease) both,
			ring-turn 120s linear 1.4s infinite;
	}
	@keyframes ring-draw {
		from {
			opacity: 0;
			transform: rotate(-120deg) scale(0.92);
		}
		to {
			transform: rotate(-90deg) scale(1);
		}
	}
	@keyframes ring-turn {
		from {
			transform: rotate(-90deg);
		}
		to {
			transform: rotate(270deg);
		}
	}
}
@media (max-width: 1000px) {
	.rings--hub {
		display: none;
	}
}
.hub-intro h1 {
	font-size: clamp(38px, 6vw, 60px);
	line-height: 1;
	letter-spacing: -0.03em;
}
.hub-intro p {
	max-width: 62ch;
	margin: 20px 0 0;
	font-size: 17px;
	color: var(--muted);
}
.hub-paths {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	margin-top: 32px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	overflow: hidden;
}
.hub-paths a {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px 20px 20px;
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	transition:
		background-color var(--fast) var(--ease),
		transform var(--fast) var(--ease);
}
.hub-paths a:hover {
	background: var(--selected);
	transform: translateY(-2px);
}
.hub-paths strong {
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 600;
	color: var(--accent-ink);
}
.hub-paths span {
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--muted);
}
.hub-section {
	margin-top: clamp(48px, 7vw, 72px);
}
.hub-section-bar {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 12px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--line);
}
.hub-section-bar h2 {
	font-size: 22px;
}
.hub-section-bar span {
	font-size: 13px;
	color: var(--muted);
	text-align: right;
}
.hub-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	border-radius: var(--radius-panel);
	overflow: hidden;
}
.hub-card {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-rows: auto 1fr auto;
	gap: 8px 14px;
	padding: 22px 20px 20px;
	margin: 0;
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	min-height: 150px;
	transition:
		background-color var(--fast) var(--ease),
		transform var(--fast) var(--ease);
}
.hub-card:hover {
	background: var(--selected);
	z-index: 1;
}
.hub-card > .app-badge {
	grid-row: span 3;
	align-self: start;
}
.hub-card:not(:has(> .app-badge)) {
	grid-template-columns: 1fr;
}
.hub-card h3 {
	font-size: 16px;
	letter-spacing: -0.01em;
	margin: 0;
	line-height: 1.3;
}
.hub-card p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--muted);
}
.hub-card p code {
	color: var(--text);
}
/* The ways in: explicit link labels, never a whole-card click. */
.hub-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	padding-top: 8px;
	font-size: 13px;
}
.hub-links a {
	color: var(--accent-ink);
	text-decoration: none;
	font-weight: 500;
	border-bottom: 1px solid transparent;
	transition:
		border-color var(--fast) var(--ease),
		color var(--fast) var(--ease);
}
.hub-links a:hover {
	border-bottom-color: currentColor;
}
.app-badge--plain {
	--app: var(--muted);
	background: var(--sunken);
	box-shadow: none;
	border: 1px solid var(--line-strong);
	color: var(--text);
	font-size: 13px;
}
.app-badge {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 3px;
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 700;
	background: var(--app);
	box-shadow: inset -5px 0 #ffffff25;
	color: #fff;
}
.app-tag {
	display: inline-block;
	font-style: normal;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	padding: 2px 5px;
	border-radius: 3px;
	border: 1px solid color-mix(in srgb, var(--tone, var(--blue)) 40%, transparent);
	color: var(--tone, var(--blue));
	margin-left: 6px;
	vertical-align: 2px;
}
.app-tag[data-tone='alpha'] {
	--tone: #b07a17;
}
:root[data-theme='dark'] .app-tag[data-tone='alpha'] {
	--tone: #e0a94a;
}
.hub-footer {
	max-width: calc(1180px - 2 * clamp(16px, 4vw, 40px));
	margin: 0 clamp(16px, 4vw, 40px);
	padding: 24px 0 48px;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	font-size: 12px;
	color: var(--muted);
	border-top: 1px solid var(--line);
}
@media (min-width: 1260px) {
	.hub-footer {
		margin: 0 auto;
	}
}
@media (max-width: 1000px) {
	.hub-grid,
	.hub-paths {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.hub-nav {
		display: none;
	}
}
@media (max-width: 600px) {
	.hub-grid,
	.hub-paths {
		grid-template-columns: minmax(0, 1fr);
	}
	.hub-section-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
	.hub-section-bar span {
		text-align: left;
	}
	.hub-primary {
		padding: 0 10px;
	}
}
@media (prefers-reduced-motion: no-preference) {
	/* The intro rises on load; each section once as it enters the viewport (docs.js). */
	.hub-intro > * {
		animation: rise var(--enter) var(--ease) both;
	}
	.hub-intro > :nth-child(2) {
		animation-delay: 0.08s;
	}
	.reveal-ready .hub-section {
		opacity: 0;
		transform: translateY(24px);
		transition:
			opacity var(--enter) var(--ease),
			transform var(--enter) var(--ease);
	}
	.hub-section.is-revealed {
		opacity: 1;
		transform: none;
	}
	.reveal-ready .hub-section .hub-card {
		opacity: 0;
	}
	.hub-section.is-revealed .hub-card {
		animation: rise var(--enter) var(--ease) both;
		animation-delay: calc(0.1s + var(--i, 0) * 0.06s);
	}
	html.theme-anim body,
	html.theme-anim .hub-header,
	html.theme-anim .hub-card,
	html.theme-anim .hub-grid {
		transition:
			background-color var(--open) var(--ease),
			color var(--open) var(--ease),
			border-color var(--open) var(--ease);
	}
	.hub-icon:active,
	.hub-primary:active {
		transform: scale(0.985);
		transition: transform var(--press) var(--ease);
	}
	@keyframes rise {
		from {
			opacity: 0;
			transform: translateY(16px);
		}
		to {
			opacity: 1;
			transform: none;
		}
	}
}
@media (prefers-reduced-motion: reduce) {
	.hub-card,
	.hub-nav a,
	.hub-card::after {
		transition: none;
	}
}
