/* ZeroWrt firmware download page
 * No external fonts, no CDN, no build step. */

:root {
	--bg: #f7f8f7;
	--bg-alt: #eef2ef;
	--surface: #ffffff;
	--surface-2: #f2f5f3;
	--border: #dde5e0;
	--border-strong: #c8d4cd;
	--text: #16211c;
	--text-muted: #5d6b64;
	--text-faint: #8a968f;
	--accent: #2e9d72;
	--accent-strong: #22815c;
	--accent-soft: rgba(46, 157, 114, .12);
	--accent-contrast: #ffffff;
	--warn: #c2701a;
	--shadow: 0 1px 2px rgba(16, 32, 24, .05), 0 8px 24px -12px rgba(16, 32, 24, .18);
	--shadow-lg: 0 2px 4px rgba(16, 32, 24, .06), 0 24px 48px -24px rgba(16, 32, 24, .28);
	--radius: 14px;
	--radius-sm: 9px;
	--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	--max: 1080px;
	--topbar-bg: rgba(247, 248, 247, .82);
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root[data-theme="auto"] {
		--bg: #0e1512;
		--bg-alt: #111a16;
		--surface: #151f1a;
		--surface-2: #1a2620;
		--border: #24332c;
		--border-strong: #31453b;
		--text: #e8f0ec;
		--text-muted: #9cb0a6;
		--text-faint: #6f847a;
		--accent: #4cbf90;
		--accent-strong: #6fd3a8;
		--accent-soft: rgba(76, 191, 144, .14);
		--accent-contrast: #06130d;
		--warn: #e0a35c;
		--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
		--shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 48px -24px rgba(0, 0, 0, .7);
		--topbar-bg: rgba(14, 21, 18, .82);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #0e1512;
	--bg-alt: #111a16;
	--surface: #151f1a;
	--surface-2: #1a2620;
	--border: #24332c;
	--border-strong: #31453b;
	--text: #e8f0ec;
	--text-muted: #9cb0a6;
	--text-faint: #6f847a;
	--accent: #4cbf90;
	--accent-strong: #6fd3a8;
	--accent-soft: rgba(76, 191, 144, .14);
	--accent-contrast: #06130d;
	--warn: #e0a35c;
	--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
	--shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 48px -24px rgba(0, 0, 0, .7);
	--topbar-bg: rgba(14, 21, 18, .82);
	color-scheme: dark;
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--accent-strong);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

h1, h2, h3 {
	line-height: 1.25;
	margin: 0;
	letter-spacing: -.015em;
}

p {
	margin: 0;
}

.container {
	width: 100%;
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 24px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--surface);
	color: var(--text);
	padding: 10px 16px;
	border-radius: 0 0 var(--radius-sm) 0;
	z-index: 100;
}

.skip-link:focus {
	left: 0;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--topbar-bg);
	backdrop-filter: saturate(1.6) blur(12px);
	border-bottom: 1px solid var(--border);
}

.topbar-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	height: 60px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: var(--text);
	font-weight: 650;
	letter-spacing: -.01em;
}

.brand:hover {
	text-decoration: none;
}

.brand-logo {
	display: block;
	border-radius: 7px;
}

.nav {
	display: flex;
	gap: 4px;
	margin-left: 8px;
	flex: 1;
}

.nav a {
	color: var(--text-muted);
	font-size: 14.5px;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
}

.nav a:hover {
	color: var(--text);
	background: var(--surface-2);
	text-decoration: none;
}

.topbar-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.icon-link,
.icon-button,
.lang-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 34px;
	min-width: 34px;
	padding: 0 8px;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text-muted);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.icon-link:hover,
.icon-button:hover,
.lang-button:hover {
	color: var(--text);
	background: var(--surface-2);
	text-decoration: none;
}

.lang-button {
	font-weight: 600;
	letter-spacing: .04em;
	border-color: var(--border);
}

.i-moon {
	display: none;
}

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

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

@media (prefers-color-scheme: dark) {
	:root[data-theme="auto"] .i-sun { display: none; }
	:root[data-theme="auto"] .i-moon { display: block; }
}

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

.hero {
	position: relative;
	padding: 74px 0 64px;
	overflow: hidden;
	background:
		radial-gradient(900px 380px at 18% -10%, var(--accent-soft), transparent 70%),
		radial-gradient(700px 320px at 92% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%);
	border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
	color: var(--accent-strong);
	font-size: 13px;
	font-weight: 650;
	letter-spacing: .12em;
	text-transform: uppercase;
	margin-bottom: 14px;
}

.hero-title {
	font-size: clamp(2.1rem, 5vw, 3.4rem);
	font-weight: 730;
}

.hero-title-accent {
	display: block;
	background: linear-gradient(92deg, var(--accent-strong), color-mix(in srgb, var(--accent) 55%, #7bd0f0));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.hero-sub {
	max-width: 62ch;
	margin-top: 18px;
	color: var(--text-muted);
	font-size: 1.05rem;
}

.hero-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 26px;
}

.chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 12px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-muted);
	font-size: 13px;
}

.chip b {
	color: var(--text);
	font-weight: 620;
}

.chip .dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent);
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 32px;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
	padding: 0 20px;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.button:hover {
	transform: translateY(-1px);
	box-shadow: var(--shadow);
	text-decoration: none;
}

.button.primary {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-contrast);
}

.button.primary:hover {
	background: var(--accent-strong);
	border-color: var(--accent-strong);
}

/* --------------------------------------------------------------- section */

.section {
	padding: 64px 0;
	border-bottom: 1px solid var(--border);
}

.section-alt {
	background: var(--bg-alt);
}

.section-head {
	margin-bottom: 30px;
}

.section-head h2 {
	font-size: clamp(1.45rem, 2.4vw, 1.85rem);
	font-weight: 700;
}

.section-sub {
	margin-top: 8px;
	color: var(--text-muted);
	max-width: 68ch;
}

/* ----------------------------------------------------------------- cards */

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	gap: 18px;
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
	border-color: var(--border-strong);
}

.card.recommended {
	border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
	box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}

.card-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.card-title {
	font-size: 1.12rem;
	font-weight: 680;
}

.card-key {
	margin-top: 3px;
	font-family: var(--mono);
	font-size: 12px;
	color: var(--text-faint);
	word-break: break-all;
}

.badges {
	display: flex;
	flex: none;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
}

.badge {
	flex: none;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 650;
	letter-spacing: .02em;
	background: var(--surface-2);
	color: var(--text-muted);
	border: 1px solid var(--border);
}

.badge.accent {
	background: var(--accent-soft);
	color: var(--accent-strong);
	border-color: transparent;
}

.card-facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 6px 14px;
	font-size: 13.5px;
}

.card-facts dt {
	color: var(--text-faint);
}

.card-facts dd {
	margin: 0;
	color: var(--text);
}

.card-facts .mono {
	font-family: var(--mono);
	font-size: 12.5px;
	word-break: break-all;
}

.sha-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.sha-text {
	font-family: var(--mono);
	font-size: 12px;
	color: var(--text-muted);
	word-break: break-all;
}

.copy-button {
	padding: 2px 8px;
	border: 1px solid var(--border);
	border-radius: 7px;
	background: var(--surface-2);
	color: var(--text-muted);
	font: inherit;
	font-size: 11.5px;
	cursor: pointer;
}

.copy-button:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

.card-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
	padding-top: 4px;
}

.card-actions .button {
	flex: 1;
	height: 40px;
	font-size: 14.5px;
}

.card-file {
	font-family: var(--mono);
	font-size: 11.5px;
	color: var(--text-faint);
	word-break: break-all;
}

.empty {
	grid-column: 1 / -1;
	padding: 40px 24px;
	text-align: center;
	border: 1px dashed var(--border-strong);
	border-radius: var(--radius);
	color: var(--text-muted);
	background: var(--surface);
}

.skeleton {
	min-height: 190px;
	background:
		linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--surface-2) 70%, transparent) 40%, transparent 60%)
		0 0 / 220% 100%,
		var(--surface);
	animation: shimmer 1.4s linear infinite;
	border-style: dashed;
	box-shadow: none;
}

@keyframes shimmer {
	from { background-position: 120% 0, 0 0; }
	to { background-position: -120% 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
	.skeleton { animation: none; }
	html { scroll-behavior: auto; }
	.card, .button { transition: none; }
}

.links-row {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin-top: 24px;
	font-size: 14px;
}

.links-row a {
	color: var(--text-muted);
}

.links-row a:hover {
	color: var(--accent-strong);
}

/* ----------------------------------------------------------------- steps */

.steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 18px;
}

.step {
	position: relative;
	padding: 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.step-no {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	margin-bottom: 10px;
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent-strong);
	font-size: 13px;
	font-weight: 700;
}

.step h3 {
	font-size: 1rem;
	font-weight: 660;
}

.step p {
	margin-top: 6px;
	color: var(--text-muted);
	font-size: 14px;
}

.step pre {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

pre {
	margin: 12px 0 0;
	padding: 11px 13px;
	overflow-x: auto;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 12.5px;
	line-height: 1.5;
}

code {
	font-family: var(--mono);
}

p code,
li code {
	padding: 1px 5px;
	border-radius: 5px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	font-size: .9em;
}

.note {
	margin-top: 22px;
	padding: 12px 16px;
	border-left: 3px solid var(--accent);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	background: var(--accent-soft);
	color: var(--text-muted);
	font-size: 14px;
}

/* -------------------------------------------------------------- timeline */

.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 22px;
}

.filter {
	padding: 6px 13px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-muted);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.filter:hover {
	color: var(--text);
	border-color: var(--border-strong);
}

.filter[aria-pressed="true"] {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-contrast);
}

.timeline {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.release {
	position: relative;
	padding: 18px 20px 18px 22px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.release::before {
	content: "";
	position: absolute;
	left: 0;
	top: 14px;
	bottom: 14px;
	width: 3px;
	border-radius: 3px;
	background: var(--border-strong);
}

.release.latest::before {
	background: var(--accent);
}

.release-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px;
}

.release-version {
	font-size: 1.02rem;
	font-weight: 680;
	font-family: var(--mono);
}

.release-meta {
	color: var(--text-faint);
	font-size: 13px;
}

.release-links {
	margin-left: auto;
	display: inline-flex;
	gap: 12px;
	font-size: 13px;
}

.release-body {
	margin-top: 10px;
	color: var(--text-muted);
	font-size: 14px;
}

.release-body h1,
.release-body h2,
.release-body h3,
.release-body h4 {
	margin: 10px 0 4px;
	color: var(--text);
	font-size: .95rem;
}

.release-body p {
	margin: 4px 0;
}

.release-body ul,
.release-body ol {
	margin: 4px 0;
	padding-left: 20px;
}

.release-body li {
	margin: 2px 0;
}

.release-body pre {
	background: var(--surface-2);
}

.release-body blockquote {
	margin: 8px 0;
	padding-left: 12px;
	border-left: 3px solid var(--border-strong);
	color: var(--text-faint);
}

/* ------------------------------------------------------------------- faq */

.faq {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.faq details {
	padding: 14px 18px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.faq summary {
	cursor: pointer;
	font-weight: 620;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.faq summary::-webkit-details-marker {
	display: none;
}

.faq summary::after {
	content: "+";
	color: var(--text-faint);
	font-weight: 400;
	font-size: 18px;
	line-height: 1;
}

.faq details[open] summary::after {
	content: "−";
}

.faq details p {
	margin-top: 10px;
	color: var(--text-muted);
	font-size: 14.5px;
}

/* ---------------------------------------------------------------- footer */

.footer {
	padding: 36px 0 44px;
	color: var(--text-muted);
	font-size: 13.5px;
}

.footer-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
}

.footer-brand {
	color: var(--text);
	font-weight: 600;
}

.footer-muted {
	margin-top: 4px;
	color: var(--text-faint);
	font-size: 12.5px;
}

.footer-links {
	display: flex;
	gap: 16px;
}

.noscript {
	padding: 30px 24px;
	color: var(--text-muted);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 820px) {
	.nav {
		display: none;
	}

	.hero {
		padding: 52px 0 44px;
	}

	.section {
		padding: 48px 0;
	}

	.topbar-inner {
		height: 54px;
	}
}

@media (max-width: 480px) {
	.container {
		padding: 0 16px;
	}

	.card {
		padding: 18px;
	}

	.release-links {
		margin-left: 0;
		width: 100%;
	}
}
