/*
 * APK Mobile — main stylesheet
 *
 * Brand: APKMODZERA. Dark blue/near-black chrome, green reserved for actions,
 * blue for links and supporting emphasis, clean light content areas.
 *
 * Mobile-first. Base rules target 360–430px viewports. Two breakpoints only:
 * 768px (tablet / 2-column) and 1100px (desktop / 3-column, horizontal nav).
 * System font stack, no external requests, no framework.
 */

/* ========================================================== 1. design tokens */

:root {
	/* Brand — green is reserved for actions: buttons, badges, active state */
	--c-brand-green: #0a8044;
	--c-brand-green-hover: #076635;
	--c-brand-green-soft: #e4f5ec;
	--c-brand-green-ink: #0a6b3a;

	/* Brand — blue carries links and supporting emphasis */
	--c-brand-blue: #1668d6;
	--c-brand-blue-hover: #1257b0;
	--c-brand-blue-light: #5aa2ff;

	/* Dark chrome — header and primary navigation */
	--c-header: #0b1726;
	--c-header-2: #111f33;
	--c-on-header: #ffffff;
	--c-on-header-muted: #aab8c9;
	--c-header-hover: rgba(255, 255, 255, 0.09);

	/* Content surfaces */
	--c-page: #f4f6f9;
	--c-card: #ffffff;
	--c-surface: #eef1f6;

	/* Text */
	--c-text: #0e1520;
	--c-text-muted: #586373;

	/* Lines */
	--c-border: #e2e7ee;
	--c-border-strong: #cfd7e2;

	/* Top of the home-hero gradient. Theme-aware; white on light, header-ink on dark. */
	--c-hero-fade: #ffffff;

	/* Focus */
	--c-focus: #1668d6;
	--c-shadow-focus: 0 0 0 3px rgba(22, 104, 214, 0.2);

	/* Spacing */
	--s-1: 4px;
	--s-2: 8px;
	--s-3: 12px;
	--s-4: 16px;
	--s-5: 24px;
	--s-6: 32px;

	/* Radius */
	--r-sm: 8px;
	--r-md: 12px;
	--r-pill: 999px;

	/* Layout */
	--container: 1160px;
	--gutter: 16px;
	--tap: 44px;

	/* Type */
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
		Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
	--fs-xs: 0.75rem;
	--fs-sm: 0.8125rem;
	--fs-base: 0.9375rem;
	--fs-md: 1rem;
	--fs-lg: 1.125rem;
	--fs-xl: 1.375rem;

	/* Elevation — used sparingly */
	--shadow-sm: 0 1px 2px rgba(14, 21, 32, 0.05);

	/*
	 * Native controls must follow the applied theme, not the operating system.
	 * Without this, form fields, scrollbars and other browser-rendered widgets
	 * can betray a light page on a dark OS (or vice-versa) even though the
	 * `data-theme` attribute on <html> says otherwise.
	 */
	color-scheme: light;
}

/*
 * Dark theme. Set by the pre-paint script in header.php from the visitor's
 * stored choice, defaulting to dark when nothing is stored. The dark chrome
 * (header, navigation, footer) deliberately keeps its own hardcoded header
 * tokens in both themes; only the content area flips.
 */
:root[data-theme="dark"] {
	--c-page: #0b1219;
	--c-card: #141e2a;
	--c-surface: #1b2735;
	--c-text: #e8edf4;
	--c-text-muted: #9babbd;
	--c-border: #223043;
	--c-border-strong: #2f4056;
	--c-hero-fade: #111c2a;
	color-scheme: dark;
}

/* ================================================================= 2. reset */

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background-color: var(--c-page);
	color: var(--c-text);
	font-family: var(--font);
	font-size: var(--fs-md);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--s-1);
	line-height: 1.25;
	font-weight: 700;
}

p,
ul,
ol,
figure,
blockquote {
	margin: 0 0 var(--s-3);
}

ul,
ol {
	padding-left: 1.25rem;
}

a {
	color: var(--c-brand-blue);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--c-brand-blue-hover);
}

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

img,
video {
	height: auto;
	display: block;
}

button {
	font: inherit;
	color: inherit;
}

hr {
	border: 0;
	border-top: 1px solid var(--c-border);
	margin: var(--s-5) 0;
}

[hidden] {
	display: none !important;
}

/* Visible focus for keyboard users on every interactive element. */
:focus-visible {
	outline: 2px solid var(--c-focus);
	outline-offset: 2px;
	border-radius: var(--r-sm);
}

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

.skip-link:focus,
.screen-reader-text:focus {
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
	display: block;
	padding: var(--s-2) var(--s-3);
	background-color: var(--c-brand-green);
	color: #ffffff;
	border-radius: var(--r-sm);
}

/* ============================================================ 3. container */

.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.page {
	padding-block: var(--s-4) var(--s-6);
}

/* =============================================================== 4. header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background-color: var(--c-header);
	background-image: linear-gradient(180deg, #0d1b2e 0%, var(--c-header) 100%);
	border-bottom: 1px solid var(--c-header-2);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-2);
	position: relative;
	/* Compact but never smaller than the 44px touch target. */
	min-height: 50px;
}

.site-header__brand {
	min-width: 0;
	display: flex;
	align-items: center;
}

/* The focus ring needs a light colour to stay visible on the dark chrome. */
.site-header :focus-visible {
	outline-color: var(--c-brand-blue-light);
}

/* ---------------------------------------------------------- brand wordmark */

.brand {
	display: inline-flex;
	align-items: center;
	gap: var(--s-2);
	min-width: 0;
	margin: 0;
	color: var(--c-on-header);
	text-decoration: none;
}

/* A small green "chip" glyph: a nod to the tech/Android identity without
   reproducing the logo artwork. */
.brand__glyph {
	flex: 0 0 auto;
	position: relative;
	width: 26px;
	height: 26px;
	border-radius: 7px;
	background-color: var(--c-brand-green);
}

.brand__glyph::before,
.brand__glyph::after {
	content: "";
	position: absolute;
	left: 50%;
	border-radius: 1px;
	background-color: var(--c-header);
	transform: translateX(-50%);
}

.brand__glyph::before {
	top: 7px;
	width: 12px;
	height: 2px;
}

.brand__glyph::after {
	top: 13px;
	width: 8px;
	height: 2px;
}

.brand__name {
	color: var(--c-on-header);
	font-size: 1.0625rem;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Second half of the wordmark carries the brand green. */
.brand__accent {
	color: var(--c-brand-green);
}

/* On light backgrounds the wordmark needs the dark ink instead of white. */
.brand--light .brand__name {
	color: var(--c-text);
}

.brand:hover .brand__name {
	color: var(--c-brand-blue-light);
}

/* Declared after the dark hover rule so it wins on equal specificity. */
.brand--light:hover .brand__name {
	color: var(--c-brand-blue);
}

/* Larger treatment for the homepage title. */
.brand--display .brand__name {
	font-size: var(--fs-xl);
	letter-spacing: -0.01em;
}

/* ------------------------------------------------------------------- logo */

.custom-logo-link {
	display: inline-flex;
	align-items: center;
}

/* The header is dark, so give any uploaded logo a light plate to sit on.
   This keeps a dark or transparent PNG readable without editing the asset. */
.custom-logo {
	width: auto;
	max-height: 44px;
	height: auto;
	display: block;
	padding: 0;
	background: none;
	border-radius: 0;
	box-shadow: none;
}

/* Remove any card-like treatment for bundled brand logo wrapper if present. */
.brand--img .brand__logo {
	padding: 0;
	background: none;
	border-radius: 0;
	box-shadow: none;
}

.brand__logo {
	display: block;
	width: auto;
	height: 44px;
	max-height: 100%;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: var(--s-1);
	flex-shrink: 0;
}

/* Square icon button — sized to the 44px touch target. */
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tap);
	height: var(--tap);
	padding: 0;
	border: 0;
	border-radius: var(--r-md);
	background-color: transparent;
	color: var(--c-on-header);
	text-decoration: none;
	cursor: pointer;
}

.icon-btn:hover {
	background-color: var(--c-header-hover);
	color: #ffffff;
}

.icon-btn svg {
	display: block;
}

/* Theme toggle glyph: shows a moon on the light theme and a sun on the dark
   theme, so the icon always describes the theme being switched *to*. */
.theme-toggle__moon {
	display: block;
}

.theme-toggle__sun {
	display: none;
}

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

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

/* Hamburger morphs into a close icon. */
.menu-toggle {
	display: none;
}

.menu-toggle__bars {
	position: relative;
	display: block;
	width: 20px;
	height: 14px;
}

.menu-toggle__bars > span {
	position: absolute;
	left: 0;
	width: 100%;
	height: 2px;
	border-radius: 2px;
	background-color: currentColor;
	transition: transform 0.18s ease, opacity 0.18s ease;
}

.menu-toggle__bars > span:first-child {
	top: 0;
}

.menu-toggle__bars > span:last-child {
	bottom: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars > span:first-child {
	transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bars > span:last-child {
	transform: translateY(-6px) rotate(-45deg);
}

/* ================================================= 5. primary navigation */

/* Default (no JS): a plain horizontal row directly under the header bar, so
   the links stay reachable without JavaScript. */
.primary-nav {
	border-top: 1px solid var(--c-header-2);
	background-color: var(--c-header-2);
}

.primary-nav__inner {
	padding-block: var(--s-1);
}

.primary-nav__list {
	display: flex;
	align-items: center;
	gap: var(--s-1);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: thin;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
}

.primary-nav__list::-webkit-scrollbar {
	display: none;
}

.primary-nav__list > li {
	flex: 0 0 auto;
}

.primary-nav__list a {
	display: flex;
	align-items: center;
	min-height: var(--tap);
	padding-inline: var(--s-3);
	border-radius: var(--r-sm);
	color: var(--c-on-header-muted);
	font-size: var(--fs-base);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

/* With JS the navigation becomes a slide-in drawer, hidden off-canvas until
   the menu button opens it. One extra class wins over the horizontal row above
   because the drawer rules only ever apply in the JS-enhanced style. */
.has-js .primary-nav {
	position: fixed;
	top: 50px;
	left: 0;
	bottom: 0;
	z-index: 49;
	width: min(320px, 86vw);
	border-top: 0;
	background-color: var(--c-header-2);
	box-shadow: 12px 0 28px rgba(4, 9, 16, 0.35);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	transform: translateX(-100%);
	transition: transform 0.2s ease-out;
}

.has-js .primary-nav.is-open {
	transform: translateX(0);
}

/* Mobile drawer items stretch full-width, one per line, with a roomier target. */
.has-js .primary-nav__list {
	flex-direction: column;
	align-items: stretch;
	padding-block: var(--s-2);
}

.has-js .primary-nav__list a {
	padding-inline: var(--s-4);
	justify-content: flex-start;
	min-height: 42px;
}

.primary-nav__list a:hover,
.primary-nav__list a:focus-visible {
	background-color: var(--c-header-hover);
	color: #ffffff;
}

/* Active state is a brand action, so it gets the green. */
.primary-nav__list .current-menu-item > a,
.primary-nav__list .current_page_item > a {
	background-color: var(--c-brand-green);
	color: #ffffff;
}

.primary-nav__list .current-menu-item > a:hover {
	background-color: var(--c-brand-green-hover);
	color: #ffffff;
}

.sub-menu {
	display: none;
}

/* With JS the mobile navigation collapses behind the menu button; without JS
   the hardcoded row underneath the bar keeps every link reachable. */
.has-js .menu-toggle {
	display: inline-flex;
}

/* --- brand centering in the single mobile bar --------------------------------
   The menu button sits on the left, the actions on the right, and the brand is
   lifted out of the flex flow so it stays visually centred on the logo. */
.has-js .site-header__brand {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1;
	max-width: 56%;
}

.has-js .site-header__brand img,
.has-js .site-header__brand .brand__logo {
	max-height: 48px;
	height: 48px;
	width: auto;
	object-fit: contain;
	padding: 0;
	background: none;
	border-radius: 0;
	box-shadow: none;
}

.has-js .site-header__actions {
	margin-left: auto;
}

/* ============================================================== 6. hero */

.hero {
	padding-block: var(--s-4) var(--s-5);
	background-color: var(--c-card);
	background-image: linear-gradient(180deg, var(--c-hero-fade) 0%, var(--c-page) 100%);
	border-bottom: 1px solid var(--c-border);
}

.hero__title {
	margin: 0 0 var(--s-1);
	font-size: var(--fs-lg);
	font-weight: 800;
	letter-spacing: -0.01em;
}

.hero__tagline {
	margin: 0 0 var(--s-3);
	color: var(--c-text-muted);
	font-size: var(--fs-base);
}

.hero__search {
	max-width: 480px;
}

/* =========================================================== 7. search form */

.search-form {
	display: flex;
	gap: var(--s-2);
}

.search-form__field {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	min-width: 0;
}

.search-form__icon {
	position: absolute;
	left: var(--s-3);
	color: var(--c-text-muted);
	pointer-events: none;
}

.search-form__input {
	width: 100%;
	min-height: var(--tap);
	padding: var(--s-2) var(--s-3) var(--s-2) 38px;
	border: 1px solid var(--c-border-strong);
	border-radius: var(--r-md);
	background-color: var(--c-card);
	color: var(--c-text);
	font-family: inherit;
	font-size: var(--fs-md);
	-webkit-appearance: none;
	appearance: none;
}

.search-form__input::placeholder {
	color: var(--c-text-muted);
	opacity: 1;
}

.search-form__input:focus {
	outline: none;
	border-color: var(--c-brand-blue);
	box-shadow: var(--c-shadow-focus);
}

/* Searching is a primary action, so the button is brand green. */
.search-form__submit {
	flex: 0 0 auto;
	min-height: var(--tap);
	padding-inline: var(--s-4);
	border: 0;
	border-radius: var(--r-md);
	background-color: var(--c-brand-green);
	color: #ffffff;
	font-size: var(--fs-base);
	font-weight: 600;
	cursor: pointer;
}

.search-form__submit:hover {
	background-color: var(--c-brand-green-hover);
}

/* ============================================= 7b. header search overlay */

/* Hidden until assets/js/main.js opens it. The base rule applies even when
   `has-js` never lands, so the overlay can never cover the page without JS. */
.search-overlay {
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.18s ease, visibility 0.18s ease;
}

.has-js .search-overlay.is-open {
	visibility: visible;
	opacity: 1;
}

/* Full-screen layer above everything except keyboard helpers. */
.search-overlay {
	position: fixed;
	inset: 0;
	/* Above the mobile drawer (49) and header (50), below the lightbox (100). */
	z-index: 80;
}

.search-overlay__scrim {
	position: absolute;
	inset: 0;
	background-color: rgba(4, 9, 16, 0.55);
	cursor: pointer;
}

/* The panel lives in the top band under the header, where the thumb lands on
   mobile, with a gentle slide-down. */
.search-overlay__panel {
	position: relative;
	width: 100%;
	background-color: var(--c-page);
	border-bottom: 1px solid var(--c-border-strong);
	padding-block: var(--s-3);
}

.has-js .search-overlay__panel {
	transform: translateY(-10px);
	transition: transform 0.18s ease;
}

.has-js .search-overlay.is-open .search-overlay__panel {
	transform: translateY(0);
}

.search-overlay__form {
	display: flex;
	align-items: center;
	gap: var(--s-2);
	width: 100%;
	max-width: 640px;
	margin-inline: auto;
	padding-inline: var(--gutter);
	position: relative;
}

.search-overlay__icon {
	flex: 0 0 auto;
	position: absolute;
	left: calc(var(--gutter) + var(--s-3));
	color: var(--c-text-muted);
	pointer-events: none;
}

.search-overlay__input {
	width: 100%;
	min-height: var(--tap);
	padding: var(--s-2) var(--s-3) var(--s-2) 46px;
	border: 1px solid var(--c-border-strong);
	border-radius: var(--r-md);
	background-color: var(--c-card);
	color: var(--c-text);
	font-family: inherit;
	font-size: var(--fs-md);
	-webkit-appearance: none;
	appearance: none;
}

.search-overlay__input::placeholder {
	color: var(--c-text-muted);
	opacity: 1;
}

.search-overlay__input:focus {
	outline: none;
	border-color: var(--c-brand-blue);
	box-shadow: var(--c-shadow-focus);
}

.search-overlay__submit {
	flex: 0 0 auto;
	min-height: var(--tap);
	padding-inline: var(--s-4);
	border: 0;
	border-radius: var(--r-md);
	background-color: var(--c-brand-green);
	color: #ffffff;
	font-size: var(--fs-base);
	font-weight: 600;
	cursor: pointer;
}

.search-overlay__submit:hover {
	background-color: var(--c-brand-green-hover);
}

.search-overlay__close {
	flex: 0 0 auto;
	color: var(--c-text-muted);
}

.search-overlay__close:hover {
	background-color: var(--c-header-hover);
	color: var(--c-text);
}

.search-overlay :focus-visible {
	outline-color: var(--c-brand-blue);
}

/* ============================================================= 8. sections */

.section {
	padding-block: var(--s-5);
}

.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--s-3);
	margin-bottom: var(--s-3);
}

.section__title {
	margin: 0;
	font-size: var(--fs-lg);
	font-weight: 800;
	letter-spacing: -0.01em;
}

.section__more {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	min-height: var(--tap);
	color: var(--c-brand-blue);
	font-size: var(--fs-sm);
	font-weight: 600;
	text-decoration: none;
}

.section__more:hover {
	color: var(--c-brand-blue-hover);
}

.section__more-arrow {
	font-size: var(--fs-md);
	line-height: 1;
}

.empty-state {
	margin: 0;
	padding: var(--s-4);
	border: 1px solid var(--c-border);
	border-radius: var(--r-md);
	background-color: var(--c-card);
	color: var(--c-text-muted);
	font-size: var(--fs-base);
}

.empty-state--inline {
	padding: var(--s-3);
}

/* ========================================================= 9. app card grid */

.app-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--s-2);
}

.app-card {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--s-3);
	padding: 10px var(--s-3);
	border: 1px solid var(--c-border);
	border-radius: var(--r-md);
	background-color: var(--c-card);
	box-shadow: var(--shadow-sm);
}

.app-card:hover {
	border-color: var(--c-border-strong);
}

/* The stretched link makes the entire row one tap target while keeping a single
   real link and real heading semantics inside. */
.app-card:focus-within {
	outline: 2px solid var(--c-focus);
	outline-offset: 2px;
}

.app-card__icon {
	flex: 0 0 auto;
	display: block;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: var(--r-sm);
	background-color: var(--c-surface);
}

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

.app-card__initials {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #eaf2fd 0%, #dbe7f7 100%);
	color: var(--c-brand-blue);
	font-size: var(--fs-lg);
	font-weight: 800;
	line-height: 1;
}

.app-card__body {
	flex: 1 1 auto;
	min-width: 0;
}

.app-card__title {
	margin: 0;
	font-size: var(--fs-base);
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.app-card__title a {
	color: var(--c-text);
	text-decoration: none;
}

.app-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.app-card__meta {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 1px 0 0;
	color: var(--c-text-muted);
	font-size: var(--fs-sm);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Flex children do not ellipsis on their own, so allow them to shrink and
   truncate instead of pushing the badge out of the card. */
.app-card__meta > span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.app-card__version {
	flex: 0 1 auto;
	font-variant-numeric: tabular-nums;
}

.app-card__category {
	flex: 0 1 auto;
}

.app-card__sep {
	flex: 0 0 auto;
	opacity: 0.7;
}

.app-card__badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 3px var(--s-2);
	border-radius: var(--r-pill);
	background-color: var(--c-brand-green-soft);
	color: var(--c-brand-green-ink);
	font-size: var(--fs-xs);
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

.app-card__badge-icon {
	flex: 0 0 auto;
	display: block;
}

/* ============================================================ 10. chip row */

.chips {
	margin: 0;
	padding: 0;
}

.chips__list {
	display: flex;
	gap: var(--s-2);
	margin: 0;
	padding: 0 0 var(--s-1);
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: thin;
	-ms-overflow-style: none;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
}

.chips__list::-webkit-scrollbar {
	display: none;
}

.chips__item {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.chip {
	display: inline-flex;
	align-items: center;
	min-height: var(--tap);
	padding: 0 var(--s-4);
	border: 1px solid var(--c-border-strong);
	border-radius: var(--r-pill);
	background-color: var(--c-card);
	color: var(--c-text);
	font-size: var(--fs-base);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.chip:hover {
	border-color: var(--c-brand-blue);
	color: var(--c-brand-blue);
}


/* ================================================== 11. page + article shell */

.page-header {
	margin-bottom: var(--s-4);
}

.page-entry {
	max-width: 720px;
}

.page-entry__content {
	max-width: none;
}

.page-links {
	margin-top: var(--s-4);
	color: var(--c-text-muted);
	font-size: var(--fs-sm);
}

.page-links a {
	color: var(--c-brand-blue);
	text-decoration: none;
}

.page-links a:hover {
	text-decoration: underline;
}

.page-links__label {
	font-weight: 600;
}

.page-title {
	margin: 0 0 var(--s-3);
	font-size: var(--fs-xl);
	font-weight: 800;
	letter-spacing: -0.01em;
}

.page-title__query {
	overflow-wrap: anywhere;
}

.page-header__search {
	max-width: 480px;
}

.archive-description {
	color: var(--c-text-muted);
	font-size: var(--fs-base);
}

.article {
	max-width: 720px;
}

.article__media {
	margin: 0 0 var(--s-4);
}

.article__media img {
	width: 100%;
	border-radius: var(--r-md);
}

.article__title {
	font-size: var(--fs-xl);
	font-weight: 800;
	letter-spacing: -0.01em;
}

.article__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s-1);
	margin: 0 0 var(--s-4);
	color: var(--c-text-muted);
	font-size: var(--fs-sm);
}

.article__sep {
	opacity: 0.7;
}

.article__category {
	color: var(--c-brand-blue);
	font-weight: 600;
	text-decoration: none;
}

.article__category:hover {
	text-decoration: underline;
}

.article__content {
	font-size: var(--fs-md);
	overflow-wrap: break-word;
}

.article__content a {
	overflow-wrap: anywhere;
}

.article__content h2 {
	margin-top: var(--s-5);
	font-size: var(--fs-lg);
}

.article__content h3 {
	margin-top: var(--s-4);
	font-size: var(--fs-md);
}

.article__content img,
.article__content table,
.article__content pre {
	border-radius: var(--r-sm);
}

.article__content table {
	display: block;
	overflow-x: auto;
	max-width: 100%;
}

.article__tags {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-2);
	margin-top: var(--s-5);
	font-size: var(--fs-sm);
}

.article__tags a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	padding-inline: var(--s-3);
	border: 1px solid var(--c-border);
	border-radius: var(--r-pill);
	background-color: var(--c-card);
	text-decoration: none;
}

/* ================================================== 12. pagination + 404 */

.navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s-1);
	margin: var(--s-5) 0 0;
	padding: 0;
	list-style: none;
}

.navigation .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--tap);
	min-height: var(--tap);
	padding-inline: var(--s-2);
	border: 1px solid var(--c-border);
	border-radius: var(--r-sm);
	background-color: var(--c-card);
	color: var(--c-text);
	font-size: var(--fs-base);
	text-decoration: none;
}

.navigation .page-numbers:hover {
	border-color: var(--c-brand-blue);
	color: var(--c-brand-blue);
}

.navigation .page-numbers.current {
	border-color: var(--c-brand-green);
	background-color: var(--c-brand-green);
	color: #ffffff;
}

.navigation .page-numbers.dots {
	border-color: transparent;
	background: none;
}

.post-navigation {
	margin-top: var(--s-6);
	padding-top: var(--s-4);
	border-top: 1px solid var(--c-border);
}

.post-navigation .nav-links > * {
	flex: 1 1 0;
	min-width: 0;
}

.post-navigation a {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-height: var(--tap);
	color: var(--c-text);
	font-weight: 600;
	text-decoration: none;
}

.post-navigation .nav-next {
	text-align: right;
}

.nav-label {
	color: var(--c-text-muted);
	font-size: var(--fs-xs);
	font-weight: 500;
}

.nav-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.page-links {
	margin: var(--s-5) 0;
}

.error-404 {
	max-width: 420px;
	margin-inline: auto;
	padding-block: var(--s-6);
	text-align: center;
}

.error-404__title {
	font-size: var(--fs-xl);
	font-weight: 800;
}

.error-404__text {
	color: var(--c-text-muted);
}

.error-404__search {
	max-width: 480px;
	margin: 0 auto var(--s-4);
}

/* Primary CTA — brand green. */
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--tap);
	padding-inline: var(--s-5);
	border-radius: var(--r-md);
	background-color: var(--c-brand-green);
	color: #ffffff;
	font-size: var(--fs-base);
	font-weight: 600;
	text-decoration: none;
}

.button:hover {
	background-color: var(--c-brand-green-hover);
	color: #ffffff;
}

/* ======================================================== 12b. app detail page */

/*
 * Mobile-first app detail. Everything here is built to survive a 360px screen:
 * long titles wrap, long package names break mid-string, and the screenshots
 * row is the only element allowed to scroll sideways.
 */

.app {
	padding-bottom: var(--s-5);
}

/* Sections share one rhythm; the download card sits tighter against its neighbours. */
.app-section {
	padding-block: var(--s-4);
}

.app-section + .app-section {
	padding-top: 0;
}

.app-section__title {
	margin: 0 0 var(--s-3);
	font-size: var(--fs-md);
	font-weight: 700;
	letter-spacing: -0.01em;
}

/* ------------------------------------------------------------------- hero */

.app-hero {
	padding-block: var(--s-4);
	background-color: var(--c-card);
	background-image: linear-gradient(180deg, var(--c-hero-fade) 0%, var(--c-page) 100%);
	border-bottom: 1px solid var(--c-border);
}

.app-hero__inner {
	display: flex;
	/* Balanced: the icon centres against the title/facts block on desktop. */
	align-items: center;
	gap: var(--s-3);
}

.app-hero__icon {
	flex: 0 0 auto;
	width: 88px;
	height: 88px;
	overflow: hidden;
	border: 1px solid var(--c-border);
	border-radius: 20px;
	background-color: var(--c-surface);
	box-shadow: var(--shadow-sm);
}

.app-hero__icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.app-hero__initials {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #eaf2fd 0%, #dbe7f7 100%);
	color: var(--c-brand-blue);
	font-size: 2rem;
	font-weight: 800;
	line-height: 1;
}

.app-hero__body {
	flex: 1 1 auto;
	/* Without this a long unbroken title can push the row wider than 360px. */
	min-width: 0;
}

.app-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-bottom: var(--s-1);
	padding: 2px var(--s-2);
	border-radius: var(--r-pill);
	background-color: var(--c-brand-green-soft);
	color: var(--c-brand-green-ink);
	font-size: var(--fs-xs);
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
}

.app-hero__title {
	margin: 0;
	font-size: var(--fs-lg);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
	/* App names can be very long. Wrap rather than clip or overflow. */
	overflow-wrap: anywhere;
}

.app-hero__facts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s-1) var(--s-2);
	margin: var(--s-1) 0 0;
	padding: 0;
	list-style: none;
	font-size: var(--fs-sm);
	color: var(--c-text-muted);
}

.app-hero__fact {
	min-width: 0;
	max-width: 100%;
}

/* Inline separator between facts, hidden when a fact wraps to its own line. */
.app-hero__fact + .app-hero__fact::before {
	content: "·";
	margin-right: var(--s-2);
	color: var(--c-border-strong);
}

.app-hero__fact-label {
	color: var(--c-text-muted);
}

.app-hero__fact-value {
	font-weight: 700;
	color: var(--c-text);
}

.app-hero__version {
	font-weight: 600;
}

.app-hero__category a {
	color: var(--c-brand-blue);
	font-weight: 600;
	text-decoration: none;
}

.app-hero__category a:hover {
	text-decoration: underline;
}

/* Long excerpt is clamped so the hero cannot grow unbounded. */
.app-hero__tagline {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/*
 * Section blocks. These carry no rules of their own beyond the shared
 * `.app-section` rhythm; they are anchors for future per-section tweaks and
 * for the automated PHP-to-CSS reference check.
 */
.app-meta__inner,
.app-description,
.app-features,
.app-changelog,
.app-info,
.app-download,
.app-faq,
.app-related {
	min-width: 0;
}

/* The "Updated" pill in the hero uses the same green family as the card badge. */
.app-badge--updated {
	background-color: var(--c-brand-green-soft);
	color: var(--c-brand-green-ink);
}

/* --------------------------------------------------------------- meta strip */

.app-meta {
	padding-block: var(--s-2);
	background-color: var(--c-card);
	border-bottom: 1px solid var(--c-border);
}

.app-meta__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-1) var(--s-4);
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--fs-xs);
}

.app-meta__item {
	display: flex;
	align-items: baseline;
	gap: var(--s-1);
	min-width: 0;
}

.app-meta__label {
	color: var(--c-text-muted);
}

.app-meta__value {
	font-weight: 600;
	color: var(--c-text);
}

/* -------------------------------------------------------------- app body grid */

.app__body {
	display: flex;
	flex-direction: column;
	gap: var(--s-4);
	/*
	 * The body owns the page gutters on phones, matching the hero and meta strip
	 * above it, so every section sits on the same vertical rhythm as the intro.
	 */
	padding: var(--s-3) var(--gutter) 0;
}

/* Sections inside the body inherit its gutters instead of doubling them. */
.app__body .container {
	max-width: none;
	margin-inline: 0;
	padding-inline: 0;
}

.app__main,
.app__side {
	min-width: 0;
}

/* --------------------------------------------------------------- prose */

.app-prose {
	max-width: 68ch;
	font-size: var(--fs-base);
	line-height: 1.65;
	color: var(--c-text);
	overflow-wrap: break-word;
}

.app-prose--compact {
	font-size: var(--fs-sm);
	line-height: 1.6;
}

.app-prose > *:first-child {
	margin-top: 0;
}

.app-prose > *:last-child {
	margin-bottom: 0;
}

.app-prose p {
	margin: 0 0 var(--s-3);
}

.app-prose ul,
.app-prose ol {
	margin: 0 0 var(--s-3);
	padding-left: 1.25em;
}

.app-prose li {
	margin-bottom: var(--s-1);
}

.app-prose a {
	color: var(--c-brand-blue);
	overflow-wrap: anywhere;
}

.app-prose h2 {
	margin: var(--s-5) 0 var(--s-2);
	font-size: var(--fs-md);
	font-weight: 700;
}

.app-prose h3 {
	margin: var(--s-4) 0 var(--s-2);
	font-size: var(--fs-base);
	font-weight: 700;
}

.app-prose img {
	max-width: 100%;
	height: auto;
	border-radius: var(--r-md);
}

.app-prose figure {
	margin: 0 0 var(--s-4);
}

.app-prose figcaption {
	margin-top: var(--s-1);
	font-size: var(--fs-xs);
	color: var(--c-text-muted);
	text-align: center;
}

.app-prose blockquote {
	margin: 0 0 var(--s-3);
	padding-left: var(--s-3);
	border-left: 3px solid var(--c-border-strong);
	color: var(--c-text-muted);
}

.app-prose code {
	padding: 1px 4px;
	border-radius: 4px;
	background-color: var(--c-surface);
	font-size: 0.875em;
	overflow-wrap: anywhere;
}

/* ---------------------------------------------------------- screenshots */

.app-shots {
	/*
	 * Full-bleed: the row runs to the screen edge so the next card peeks past it.
	 * The head below puts its own container back inside, so the heading and the
	 * first card still line up with the rest of the page.
	 */
	margin-inline: calc(var(--gutter) * -1);
}

/*
 * The counter and dots are only worth showing once JavaScript can keep them in
 * step with the scroller, so they stay hidden until the `has-js` class lands.
 */
.app-shots__counter,
.app-shots__dots {
	display: none;
}

.has-js .app-shots__counter,
.has-js .app-shots__dots {
	display: flex;
}

.app-shots__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--s-3);
}

/* The head carries the container padding now, so the title needs none of its own. */
.app-shots__head .app-section__title {
	margin-bottom: 0;
}

.app-shots__counter {
	align-items: baseline;
	gap: 3px;
	margin: 0;
	font-size: var(--fs-xs);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--c-text-muted);
}

.app-shots__counter-sep {
	color: var(--c-border-strong);
}

.app-shots__counter-current {
	color: var(--c-text);
}

.app-shots__dots {
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0 var(--gutter) var(--s-2);
}

.app-shots__dot {
	width: 6px;
	height: 6px;
	border-radius: var(--r-pill);
	background-color: var(--c-border-strong);
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.app-shots__dot.is-active {
	/* Brand blue, so an active dot reads as chrome rather than as a control. */
	background-color: var(--c-brand-blue);
	transform: scale(1.25);
}

.app-shots__scroller {
	overflow-x: auto;
	/* Contain the scroll so it never leaks to the whole page. */
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
	/*
	 * The bar itself is hidden. The peeking next card, the counter and the dots all
	 * carry the affordance, and a thin bar under a row of images reads as a defect.
	 */
	scrollbar-width: none;
	-ms-overflow-style: none;
	overscroll-behavior-x: contain;
}

.app-shots__scroller::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

/* Keyboard users can reach the row and page it with the arrow keys. */
.app-shots__scroller:focus-visible {
	outline: 2px solid var(--c-focus);
	outline-offset: -2px;
	border-radius: var(--r-sm);
}

.app-shots__track {
	display: flex;
	/*
	 * `flex-start`, not the default `stretch`: cards size themselves to their own
	 * screenshot, so a landscape shot is a short card and a portrait one is tall.
	 * Stretching would drag every card to the tallest in the row and put the blank
	 * space back in.
	 */
	align-items: flex-start;
	gap: var(--s-2);
	margin: 0;
	/*
	 * `scroll-padding` matches the inline padding so a keyboard or programmatic jump
	 * lands the card against the edge instead of under the padding.
	 */
	padding: var(--s-1) var(--gutter) var(--s-2);
	scroll-padding-inline: var(--gutter);
	list-style: none;
}

.app-shots__item {
	flex: 0 0 auto;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	/*
	 * 85% of the gallery, which leaves a peek of the next card at every phone width
	 * (30px at 360, 35px at 390, 49px at 430). The upper cap only engages above about
	 * 495px, where the row is wide enough to be a grid shortly afterwards.
	 */
	width: min(85vw, 420px);
}

.app-shots__link {
	display: block;
	/*
	 * Deliberately no `aspect-ratio` and no height here. The frame takes whatever
	 * height the screenshot needs, so a 16:9 image gets a wide, short card and a 9:21
	 * image gets a tall one, and the surface behind it is never more than a border
	 * away from the picture.
	 */
	overflow: hidden;
	border: 1px solid var(--c-border);
	border-radius: var(--r-md);
	background-color: var(--c-surface);
}

.app-shots__link img {
	display: block;
	width: 100%;
	/*
	 * `auto` is what preserves the real ratio. The cap only bites on a stitched
	 * scroll far taller than a screen, where it stops one card from dwarfing the row;
	 * a normal 9:19.5 or 9:20 screenshot never reaches it. `contain` matters only
	 * once that cap applies, and then it letterboxes instead of cropping.
	 */
	height: auto;
	max-height: 90vh;
	object-fit: contain;
	transition: transform 0.2s ease;
}

/* On phones the gallery row still bleeds to the screen edges so the next card peeks. */
@media (max-width: 767.98px) {
	.app-shots__scroller {
		margin-inline: calc(-1 * var(--gutter));
	}
}

@media (hover: hover) and (pointer: fine) {
	.app-shots__link:hover img {
		transform: scale(1.015);
	}
}

.app-shots__hint {
	margin: 0;
	font-size: var(--fs-xs);
	color: var(--c-text-muted);
}

/* ------------------------------------------------------------- features */

.app-features__list {
	display: grid;
	gap: var(--s-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.app-features__item {
	display: flex;
	align-items: flex-start;
	gap: var(--s-2);
	min-width: 0;
	font-size: var(--fs-base);
	line-height: 1.5;
}

.app-features__check {
	flex: 0 0 auto;
	margin-top: 1px;
	color: var(--c-brand-green);
}

.app-features__text {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* ------------------------------------------------------------ changelog */

.app-changelog__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.app-changelog__item {
	position: relative;
	padding-left: var(--s-4);
	margin-bottom: var(--s-2);
	font-size: var(--fs-sm);
	line-height: 1.55;
	overflow-wrap: anywhere;
}

/* Blue tick rather than green, so green stays reserved for actions. */
.app-changelog__item::before {
	content: "";
	position: absolute;
	top: 0.55em;
	left: 2px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: var(--c-brand-blue);
}

/* ------------------------------------------------------------ info table */

.app-info__card {
	border: 1px solid var(--c-border);
	border-radius: var(--r-md);
	background-color: var(--c-card);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.app-info__table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--fs-sm);
}

.app-info__row > * {
	padding: var(--s-2) var(--s-3);
	/* Long values wrap instead of forcing the card to scroll. */
	overflow-wrap: anywhere;
	vertical-align: top;
}

.app-info__row + .app-info__row > * {
	border-top: 1px solid var(--c-border);
}
.app-info__label {
	width: 34%;
	color: var(--c-text-muted);
	font-weight: 500;
	text-align: left;
	white-space: nowrap;
}

.app-info__value {
	color: var(--c-text);
	font-weight: 600;
}

.app-info__code {
	display: inline-block;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.8125rem;
	color: var(--c-brand-blue);
	word-break: break-all;
}

/* -------------------------------------------------------------- download */

.app-download__card {
	padding: var(--s-4);
	border: 1px solid var(--c-border);
	border-radius: var(--r-md);
	background-color: var(--c-card);
	box-shadow: var(--shadow-sm);
	text-align: center;
}

.app-download__title {
	margin: 0 0 var(--s-3);
	font-size: var(--fs-md);
	font-weight: 700;
}

/* The green CTA. Shared by the inline button and the sticky bar. */
.btn-download {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--s-2);
	/* Generous touch target, well past the 44px minimum. */
	min-height: 52px;
	width: 100%;
	padding: var(--s-2) var(--s-4);
	border: 0;
	border-radius: var(--r-md);
	background-color: var(--c-brand-green);
	color: #ffffff;
	font-size: var(--fs-md);
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	/* Guard against long app names stretching the label on one line. */
	flex-wrap: wrap;
}

.btn-download:hover {
	background-color: var(--c-brand-green-hover);
	color: #ffffff;
}

.btn-download__icon {
	flex: 0 0 auto;
}

.btn-download__label {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Sticky bar stacks the label above a small supporting line. */
.btn-download__stack {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
	line-height: 1.25;
}

.btn-download__sub {
	font-size: var(--fs-xs);
	font-weight: 500;
	/* Sits on green, so a light tint keeps it readable without a second colour. */
	color: rgba(255, 255, 255, 0.88);
}

.btn-download--disabled {
	background-color: var(--c-surface);
	color: var(--c-text-muted);
	box-shadow: inset 0 0 0 1px var(--c-border-strong);
	cursor: not-allowed;
}

.app-download__unavailable {
	margin: var(--s-2) 0 0;
	font-size: var(--fs-xs);
	color: var(--c-text-muted);
}

.app-download__note {
	margin: var(--s-2) 0 0;
	font-size: var(--fs-xs);
	color: var(--c-text-muted);
}

/* ------------------------------------------------------------------- FAQ */

.app-faq__list {
	border: 1px solid var(--c-border);
	border-radius: var(--r-md);
	background-color: var(--c-card);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.app-faq__item + .app-faq__item {
	border-top: 1px solid var(--c-border);
}

.app-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3);
	/* Comfortable target and clear affordance without JS. */
	min-height: var(--tap);
	padding: var(--s-3);
	color: var(--c-text);
	font-size: var(--fs-sm);
	font-weight: 600;
	list-style: none;
	cursor: pointer;
}

/* Remove the default disclosure triangle in WebKit. */
.app-faq__question::-webkit-details-marker {
	display: none;
}

.app-faq__question-text {
	min-width: 0;
	overflow-wrap: anywhere;
}

.app-faq__chevron {
	flex: 0 0 auto;
	color: var(--c-brand-blue);
	transition: transform 0.15s ease;
}

.app-faq__item[open] .app-faq__chevron {
	transform: rotate(180deg);
}

.app-faq__question:hover .app-faq__question-text {
	color: var(--c-brand-blue);
}

.app-faq__answer {
	padding: 0 var(--s-3) var(--s-3);
	font-size: var(--fs-sm);
	line-height: 1.55;
	color: var(--c-text-muted);
	overflow-wrap: anywhere;
}

.app-faq__answer p {
	margin: 0;
}

/* ---------------------------------------------------------- sticky CTA bar */

.sticky-cta {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 60;
	display: none;
	padding: var(--s-2) var(--gutter);
	background-color: var(--c-header);
	box-shadow: 0 -2px 12px rgba(11, 23, 38, 0.18);
}

.has-js .sticky-cta.is-visible {
	display: block;
}

.btn-download--sticky {
	width: 100%;
	min-height: var(--tap);
	background-color: var(--c-brand-green);
	font-size: var(--fs-base);
}

/*
 * Reserve room at the end of the page so the bar never permanently covers the
 * last section. Scoped to :has() so pages without a download URL get no dead
 * space; browsers without :has() simply lose the reservation, which is a
 * cosmetic issue rather than a broken layout.
 */
.has-js .app-page:has(.sticky-cta) {
	padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

@supports not (padding: env(safe-area-inset-bottom)) {
	.sticky-cta {
		padding-bottom: calc(var(--s-2) + 8px);
	}
}

/* ================================================================= 13. footer */

/* Dark footer bookends the dark header and frames the light content area. */
.site-footer {
	margin-top: var(--s-6);
	border-top: 1px solid var(--c-header-2);
	background-color: var(--c-header);
	color: var(--c-on-header-muted);
	font-size: var(--fs-sm);
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--s-2);
	padding-block: var(--s-4);
}

.site-footer__copy {
	margin: var(--s-2) 0 0;
	color: var(--c-on-header-muted);
}

.site-footer__groups {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-4) var(--s-5);
}

.footer-nav {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--s-2);
	min-width: 0;
}

.footer-nav__title {
	margin: 0;
	color: var(--c-on-header-muted);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.footer-nav__list {
	display: flex;
	flex-direction: column;
	gap: var(--s-1);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Flat footer link row: wraps on narrow screens, one tidy line on wider ones. */
.footer-nav__list--inline {
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	column-gap: var(--s-4);
	row-gap: var(--s-1);
}

.footer-nav a {
	color: var(--c-on-header);
	font-weight: 600;
	text-decoration: none;
}

.footer-nav a:hover {
	color: var(--c-brand-blue-light);
	text-decoration: underline;
}

.site-footer :focus-visible {
	outline-color: var(--c-brand-blue-light);
}

/* ==================================================== 13c. contact form */

.contact-form {
	max-width: 640px;
}

.contact-form__notice {
	display: block;
	margin: 0 0 var(--s-3);
	padding: var(--s-3) var(--s-4);
	border-radius: var(--r-sm);
	font-weight: 600;
}

.contact-form__notice--success {
	background-color: var(--c-brand-green-soft);
	color: var(--c-brand-green-ink);
}

.contact-form__notice--error {
	background-color: #fdeeee;
	color: #8c1d1d;
}

:root[data-theme="dark"] .contact-form__notice--success {
	background-color: rgba(10, 128, 68, 0.18);
	color: #7fd8ab;
}

:root[data-theme="dark"] .contact-form__notice--error {
	background-color: rgba(181, 44, 44, 0.18);
	color: #f2b8b8;
}

.contact-form__field {
	margin: 0 0 var(--s-3);
}

.contact-form__field label {
	display: block;
	margin-bottom: var(--s-1);
	font-weight: 600;
}

.contact-form__required {
	color: var(--c-brand-green);
}

.contact-form__field input,
.contact-form__field textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: var(--s-2) var(--s-3);
	border: 1px solid var(--c-border-strong);
	border-radius: var(--r-sm);
	background-color: var(--c-card);
	color: var(--c-text);
	font-family: var(--font);
	font-size: var(--fs-base);
	line-height: 1.5;
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
	outline: none;
	box-shadow: var(--c-shadow-focus);
	border-color: var(--c-brand-blue);
}

.contact-form__submit {
	margin: 0;
}

/* ==================================================== 14. >= 768px (tablet) */

@media (min-width: 768px) {
	:root {
		--gutter: 24px;
	}

	.app-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--s-3);
	}

	.app-card {
		padding: var(--s-3);
	}

	.app-card__icon {
		width: 56px;
		height: 56px;
	}

	.section {
		padding-block: var(--s-6);
	}

	.hero {
		padding-block: var(--s-5) var(--s-6);
	}

	.hero__title {
		font-size: var(--fs-xl);
	}

	.brand--display .brand__name {
		font-size: 1.75rem;
	}

	.page-title {
		font-size: 1.75rem;
	}

	/* Chips have room to wrap instead of scrolling sideways. */
	.chips__list {
		flex-wrap: wrap;
		overflow-x: visible;
		scroll-snap-type: none;
		padding-bottom: 0;
	}

	/* --- app detail: hero becomes a roomier horizontal row */

	.app-hero {
		padding-block: var(--s-5);
	}

	.app-hero__icon {
		width: 104px;
		height: 104px;
		border-radius: 24px;
	}

	.app-hero__initials {
		font-size: 2.5rem;
	}

	.app-hero__title {
		font-size: var(--fs-xl);
	}

	.app-section {
		padding-block: var(--s-5);
	}

	.app-section + .app-section {
		padding-top: 0;
	}

	.app-section__title {
		font-size: var(--fs-lg);
	}

	/* Screenshots can flow as a grid once wrapping is affordable. */
	.app-shots {
		margin-inline: 0;
	}

	/*
	 * The grid shows every screenshot at once, so there is no longer a single
	 * position to report: the counter, the dots and the swipe hint all step aside
	 * rather than contradict what is on screen.
	 */
	.has-js .app-shots__counter,
	.has-js .app-shots__dots {
		display: none;
	}

	.app-shots__scroller {
		overflow-x: visible;
		scroll-snap-type: none;
		overscroll-behavior-x: auto;
	}

	.app-shots__track {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		/* Same reason as the flex row: cards keep their own height. */
		align-items: start;
		gap: var(--s-3);
		padding: var(--s-1) 0 var(--s-3);
		scroll-padding-inline: 0;
	}

	.app-shots__item {
		width: auto;
		scroll-snap-stop: normal;
	}

	.app-shots__hint {
		display: none;
	}

	/* From tablets up the body row is boxed exactly like the hero and meta strip. */
	.app__body {
		max-width: var(--container);
		margin-inline: auto;
	}

	.app-prose {
		font-size: var(--fs-md);
	}

	.app-features__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--s-2) var(--s-4);
	}

	.app-info__label {
		width: 30%;
	}

	.app-faq__question {
		padding: var(--s-3) var(--s-4);
		font-size: var(--fs-base);
	}

	.app-faq__answer {
		padding: 0 var(--s-4) var(--s-3);
	}

	/* Sticky bar is redundant once the sidebar CTA is visible. */
	.sticky-cta {
		display: none;
	}
}

/* ================================================= 15. >= 1100px (desktop) */

@media (min-width: 1100px) {
	.app-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--s-3);
	}

	/* Footer stays stacked so the legal group stays centered; the copyright
	   line sits below the links, aligned to the right. */
	.site-footer__inner {
		flex-direction: column;
		align-items: center;
		gap: var(--s-2);
	}

	.site-footer__copy {
		align-self: flex-end;
	}

	/* Horizontal navigation replaces the hamburger. The nav is back in the
	   bar as a centre-aligned row between the brand and the actions. */
	.has-js .primary-nav {
		position: static;
		width: auto;
		max-width: none;
		flex: 1 1 auto;
		min-width: 0;
		border-top: 0;
		background-color: transparent;
		box-shadow: none;
		overflow: visible;
		transform: none;
		transition: none;
	}

	.has-js .primary-nav.is-open {
		transform: none;
	}

	.has-js .menu-toggle {
		display: none;
	}

	.site-header__brand img,
	.site-header__brand .brand__logo {
		max-height: 48px;
		height: 48px;
		width: auto;
		padding: 0;
		background: none;
		border-radius: 0;
		box-shadow: none;
	}

	.has-js .site-header__brand {
		position: static;
		transform: none;
		max-width: none;
	}

	.has-js .site-header__actions {
		margin-left: 0;
	}

	.primary-nav__inner {
		display: flex;
		justify-content: center;
	}

	/* Must repeat the .has-js prefix from the mobile drawer rules — it carries
	   two classes and would otherwise win over this later one-class row rule. */
	.has-js .primary-nav__list {
		flex-direction: row;
		align-items: center;
		padding-block: 0;
		overflow-x: visible;
		justify-content: center;
	}

	.has-js .primary-nav__list a {
		min-height: var(--tap);
		padding-inline: var(--s-3);
		justify-content: center;
	}

	/* --- app detail: two-column layout, sidebar on the right */

	.app__body {
		display: grid;
		/* minmax(0, …) is what stops a long package name from widening the column. */
		grid-template-columns: minmax(0, 1fr) 320px;
		align-items: start;
		gap: var(--s-6);
	}

	/* Sidebar sticks alongside the prose on tall viewports. */
	.app__side {
		position: sticky;
		top: 72px;
	}

	.app-info__label {
		width: 40%;
	}

	.app-shots__track {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* ================================================ 12c. screenshot lightbox */
/*
 * Built and injected by assets/js/main.js on the first tap, so there is no overlay
 * markup in the template and nothing to render when the row is never opened.
 */

.apkmobile-lightbox {
	position: fixed;
	inset: 0;
	/* Above the sticky download bar, which sits at 60. */
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Respects notches on both orientations, and never hugs the screen edge. */
	padding:
		max(var(--s-4), env(safe-area-inset-top))
		max(var(--s-4), env(safe-area-inset-right))
		max(var(--s-4), env(safe-area-inset-bottom))
		max(var(--s-4), env(safe-area-inset-left));
	background-color: rgba(11, 23, 38, 0.93);
	/* Stop the page behind from rubber-banding while the overlay is up. */
	overscroll-behavior: contain;
}

.apkmobile-lightbox__img {
	display: block;
	/*
	 * `auto` on both axes plus a max pair keeps the real proportions of whatever
	 * aspect ratio the screenshot happens to be, with no upscaling.
	 */
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	border-radius: var(--r-md);
	background-color: var(--c-surface);
	box-shadow: 0 12px 40px rgba(4, 9, 16, 0.45);
}

.apkmobile-lightbox__close {
	/*
	 * Anchored to the overlay and never to the screenshot. The overlay is
	 * `position: fixed` with `inset: 0`, so it is a viewport-sized containing block
	 * and the control cannot be dragged out of reach by whichever image happens to be
	 * open, or by a short landscape viewport.
	 *
	 * The offsets are measured from the overlay's padding box, which is why the safe
	 * area is *added* to the base gap instead of being taken as a maximum: `max()`
	 * would throw the base gap away wherever an inset exists and leave the button
	 * flush against the notch, and would allow nothing at all where there is no inset.
	 */
	position: absolute;
	top: calc(var(--s-3) + env(safe-area-inset-top, 0px));
	right: calc(var(--s-3) + env(safe-area-inset-right, 0px));
	/*
	 * Above the image. The overlay centres a tall shot against the full height, so the
	 * top strip is image on most phones and the control has to win that overlap.
	 */
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--tap);
	height: var(--tap);
	/* The touch target is never allowed to fall below the 44px minimum. */
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--r-pill);
	background-color: rgba(255, 255, 255, 0.16);
	color: var(--c-on-header);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.apkmobile-lightbox__close:hover {
	background-color: rgba(255, 255, 255, 0.28);
}

.apkmobile-lightbox__close:focus-visible {
	outline: 2px solid var(--c-on-header);
	outline-offset: 2px;
}

.apkmobile-lightbox__close svg {
	width: 22px;
	height: 22px;
}

/*
 * Applied to <html> while the overlay is up. The scrollbar width is measured once
 * in JavaScript and handed over as a custom property, so locking the page does not
 * make the layout jump sideways on a desktop with a classic scrollbar.
 */
.apkmobile-lightbox-open {
	overflow: hidden;
	padding-right: var(--apkmobile-scrollbar, 0px);
}

/* ============================================ 16. user preferences / print */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.site-header,
	.site-footer,
	.navigation,
	.sticky-cta {
		display: none;
	}

	body {
		background: none;
	}
}
