:root {
	color-scheme: dark;
	--bg: #0c0e12;
	--bg-elevated: #12151c;
	--fg: #e8eaed;
	--muted: #9aa0a6;
	--accent: #2563eb;
	--accent-hover: #3b82f6;
	--card: #161a22;
	--border: #2a2f38;
	--radius: 12px;
	--tap-min: 44px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
	line-height: 1.5;
	-webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

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

body {
	margin: 0;
	min-height: 100dvh;
	background: var(--bg);
	color: var(--fg);
}

a {
	color: var(--accent);
	text-underline-offset: 2px;
}

a:hover {
	color: var(--accent-hover);
}

img {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

.wrap {
	width: 100%;
	max-width: 72rem;
	margin: 0 auto;
	padding: clamp(1rem, 4vw, 1.75rem) clamp(1rem, 4vw, 1.5rem) 3rem;
}

/* —— Shared header —— */
.site-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	padding-bottom: 1.25rem;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid var(--border);
}

.site-head__brand {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.site-head__title {
	margin: 0;
	font-size: clamp(1.15rem, 2.5vw, 1.35rem);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.site-head__title a {
	color: inherit;
	text-decoration: none;
}

.site-head__title a:hover {
	color: var(--accent);
}

.site-head__tag {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--muted);
}

.site-head__link {
	font-size: 0.9375rem;
	font-weight: 600;
	min-height: var(--tap-min);
	display: inline-flex;
	align-items: center;
}

/* —— Hub —— */
.hub-hero {
	margin-bottom: 1.75rem;
}

.hub-hero h1 {
	margin: 0 0 0.35rem;
	font-size: clamp(1.5rem, 4vw, 2rem);
	font-weight: 700;
	letter-spacing: -0.03em;
}

.hub-hero p {
	margin: 0;
	color: var(--muted);
	font-size: 0.9375rem;
	max-width: 40rem;
}

.hub-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

@media (min-width: 560px) {
	.hub-list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.hub-list {
		grid-template-columns: repeat(3, 1fr);
	}
}

.hub-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1rem 1.1rem;
	text-decoration: none;
	color: inherit;
	min-height: 100%;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.hub-card:hover {
	border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
	background: var(--bg-elevated);
	text-decoration: none;
}

.hub-card__row {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
}

.hub-card__row > div {
	flex: 1;
	min-width: 0;
}

.hub-card__icon {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--bg);
}

.hub-card h2 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.3;
}

.hub-card .meta {
	margin: 0.25rem 0 0;
	font-size: 0.8125rem;
	color: var(--muted);
}

.hub-card__summary {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	line-height: 1.35;
}

.hub-empty {
	color: var(--muted);
	font-size: 0.9375rem;
	margin: 0;
}

/* —— Detail —— */
.detail-hero {
	display: grid;
	gap: 1.25rem;
	align-items: start;
}

@media (min-width: 640px) {
	.detail-hero {
		grid-template-columns: 1fr auto;
		align-items: center;
	}
}

.detail-hero__main {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	min-width: 0;
}

.app-logo {
	width: clamp(64px, 18vw, 88px);
	height: clamp(64px, 18vw, 88px);
	border-radius: 18px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--bg);
	border: 1px solid var(--border);
}

.app-logo--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: clamp(1.35rem, 5vw, 1.85rem);
	font-weight: 800;
	color: color-mix(in srgb, var(--muted) 85%, var(--fg));
	user-select: none;
}

.detail-hero__text {
	min-width: 0;
}

.detail-hero__text h1 {
	margin: 0 0 0.35rem;
	font-size: clamp(1.35rem, 4vw, 1.75rem);
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.2;
}

.detail-lead {
	margin: 0 0 0.5rem;
	font-size: 0.9375rem;
	color: color-mix(in srgb, var(--fg) 88%, var(--muted));
	line-height: 1.45;
	max-width: 42rem;
}

.detail-meta {
	margin: 0;
	font-size: 0.875rem;
	color: var(--muted);
}

.detail-hero__cta {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.5rem;
}

@media (min-width: 640px) {
	.detail-hero__cta {
		align-items: flex-end;
		min-width: 11rem;
	}
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	background: var(--accent);
	color: #fff;
	text-decoration: none;
	padding: 0.65rem 1.25rem;
	border-radius: 10px;
	font-weight: 600;
	font-size: 1rem;
	min-height: var(--tap-min);
	transition:
		background-color 0.12s ease,
		transform 0.12s ease;
}

.btn:hover {
	background: var(--accent-hover);
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
}

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

.alias-note {
	margin: 0.75rem 0 0;
	font-size: 0.8125rem;
	color: var(--muted);
}

/* Additional APP Information */
.app-meta {
	margin-top: 1.25rem;
}

.app-meta__title {
	margin: 0 0 1rem;
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted);
}

.app-meta__list {
	margin: 0;
	padding: 0;
}

.app-meta__row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.2rem 1rem;
	padding: 0.65rem 0;
	border-bottom: 1px solid var(--border);
	align-items: baseline;
}

@media (min-width: 520px) {
	.app-meta__row {
		grid-template-columns: minmax(7.5rem, 11rem) 1fr;
	}
}

.app-meta__row:first-of-type {
	padding-top: 0;
}

.app-meta dt {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--muted);
}

.app-meta dd {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--fg);
	word-break: break-word;
}

/* Gallery: horizontal slide carousel (scroll-snap, touch swipe) */
.gallery {
	margin: 1.5rem 0;
}

.gallery h2 {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--muted);
}

.gallery__track {
	display: flex;
	width: 100%;
	gap: 0.65rem;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--border) transparent;
	padding-bottom: 0.35rem;
}

.gallery__track::-webkit-scrollbar {
	height: 6px;
}

.gallery__track::-webkit-scrollbar-thumb {
	background: var(--border);
	border-radius: 3px;
}

/* One slide = full width on phone; capped width on desktop so 9:16 shots are not huge / blurry */
.gallery__slide {
	flex: 0 0 100%;
	min-width: 100%;
	max-width: 100%;
	margin: 0;
	scroll-snap-align: start;
	scroll-snap-stop: normal;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--border);
	background: var(--bg);
	box-sizing: border-box;
}

.gallery__slide img {
	display: block;
	width: 100%;
	aspect-ratio: 9 / 16;
	object-fit: contain;
	background: var(--bg);
}

@media (min-width: 640px) {
	.gallery__slide {
		flex: 0 0 min(22rem, 100%);
		min-width: min(22rem, 100%);
		max-width: min(22rem, 100%);
	}

	.gallery:has(.gallery__slide:only-child) .gallery__track {
		justify-content: center;
	}
}

.gallery__hint {
	margin: 0.4rem 0 0;
	font-size: 0.75rem;
	color: var(--muted);
	text-align: center;
}

.gallery__hint:empty {
	display: none;
}

.prose-block {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: clamp(1rem, 3vw, 1.35rem);
	margin-top: 1.25rem;
	margin-bottom: 1.25rem;
}

.prose-block h2 {
	margin: 0 0 0.75rem;
	font-size: 1rem;
	font-weight: 600;
}

.prose-block > h1 {
	margin: 0 0 0.75rem;
	font-size: clamp(1.2rem, 3vw, 1.4rem);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.prose {
	font-size: 0.9375rem;
	line-height: 1.6;
	color: color-mix(in srgb, var(--fg) 92%, var(--muted));
}

.prose :where(h2, h3) {
	margin-top: 1.25rem;
	margin-bottom: 0.35rem;
	font-size: 1.05rem;
	color: var(--fg);
}

.prose :where(h2):first-child,
.prose :where(h3):first-child {
	margin-top: 0;
}

.prose :where(p) {
	margin: 0.5rem 0 0;
}

.prose :where(p):first-child {
	margin-top: 0;
}

.prose :where(ul, ol) {
	margin: 0.5rem 0 0;
	padding-left: 1.25rem;
}

.site-footer {
	margin-top: clamp(2rem, 6vw, 3rem);
	padding-top: 1.25rem;
	border-top: 1px solid var(--border);
}

.site-footer__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.65rem 1.25rem;
	font-size: 0.875rem;
}

.site-footer__nav a {
	color: var(--muted);
	font-weight: 500;
	text-decoration: none;
	min-height: var(--tap-min);
	display: inline-flex;
	align-items: center;
}

.site-footer__nav a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.legal-main {
	margin-top: 0.5rem;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
